Transmitting Packets on a Network Device
NetDev_Tx() is used to notify the Ethernet device that a new packet is available to be transmitted. It performs the following actions:
For DMA-based hardware, the driver should select the next available transmit descriptor and set the pointer to the data area equal to the address pointed to by
p_data.For non-DMA hardware, the driver should call
Mem_Copy()to copy the data stored in the buffer to the device’s internal memory. The address of the buffer is specified byp_data.Once completed, the driver must configure the device with the number of bytes to transmit. This value contained in the
sizeargument. DMA-based devices have a size field within the transmit descriptor. Non-DMA devices have a transmit size register that must be configured.The driver then takes all necessary steps to initiate transmission of the data.
NetDev_Tx()setsperrtoNET_DEV_ERR_NONEand returns from the transmit function.