The next function in the device API structure is the transmit/Tx()
function.
Files
Every device driver’s net_dev.c
Prototype
Note that since every device driver’s Tx()
function is accessed only by function pointer via the device driver’s API structure, it doesn’t need to be globally available and should therefore be declared as ‘static
’.
Arguments
pif
Pointer to the interface to start a network device.
p_data
Pointer to address of the data to transmit.
size
Size of the data to transmit.
perr
Pointer to variable that will receive the return error code from this function.
Returned Value
None.
Required Configuration
None.
Notes / Warnings
The transmit function should perform the following actions:
p_data
. Mem_Copy()
the data stored within the buffer pointed to by p_data
to the device’s internal memory. perr
to NET_DEV_ERR_NONE
and return from the transmit function.