It is desireable to have a way to identify network devices.
This should be independent from the type of netdev, so a common identifier is needed.
Base this on the driver ID and the index in the configuration struct.
This way we achive unique IDs that stay consistent for any firmware flashed on a board.
Some drivers return on netdev_driver_t::recv() not the actual frame size, but
an upper bound estimation of it. The upper layer code is already prepared to
handle that. This brings the doc in sync with the code.
Clarified in the documentation how netdev_driver_t::recv() should behave in case
the size of the buffer in parameter buf (indicated by parameter len) is to small
to fit the received frame.
netdev_driver_t::recv does on of three things:
- Receive the frame
- Drop it
- Get (an estimation of) the size of the frame
The brief section of the documentation was changed to reflect this. (And it
starts with the least obvious thing in the hope readers of the API stumble upon
it...)
Removed the invalid precondition in netdev_driver_t::recv that the buffer never
NULL and the length positive. (In the "get message size" case both is wrong, in
the drop message case the first part is wrong.)
While reviewing #9942 I noticed that the documentation on the netdev
driver API is unclear and in some cases outright contradicting itself:
> ```
> @return number of bytes used from @p value
> @return `< 0` on error, 0 on success
> ```
IMHO this is unacceptable for such a central API where communication
This fixes a few things and also clarifies preconditions:
- Specifies negative `errno`s clearly so all drivers return the same
when required
- Re-iterates parameter preconditions and special cases within the
parameter documentation itself (might also help towards #9805?)
- Fixes contradictions within return value documentation
- Adds missing parameter documentation on `init()`.