1.6.3.10 DRV_G3ADP_MAC_PacketTx Function
C
TCPIP_MAC_RES DRV_G3ADP_MAC_PacketTx(DRV_HANDLE hMac, TCPIP_MAC_PACKET * ptrPacket);
Summary
G3 ADP MAC driver transmit function.
Description
This is the MAC transmit function. Using this function a packet is submitted to the G3 ADP stack for transmission.
Precondition
DRV_G3ADP_MAC_Initialize must have been called to set up the driver. DRV_G3ADP_MAC_Open() should have been called to obtain a valid handle.
Parameters
Param | Description |
---|---|
hMac | Handle identifying the MAC driver client |
ptrPacket | Pointer to a TCPIP_MAC_PACKET that's completely formatted and ready to be transmitted over the network |
Returns
TCPIP_MAC_RES_OK if success
A TCPIP_MAC_RES error value if failed
Example
TCPIP_MAC_RES res;
TCPIP_MAC_PACKET * ptrPacket;
// The content of the packet must be built accordingly to TCPIP_MAC_PACKET
if(pNetIf->hIfMac != 0)
{
res = DRV_G3ADP_MAC_PacketTx(pNetIf->hIfMac, ptrPacket);
}
Remarks
The G3 ADP MAC driver supports internal queuing. A packet is rejected only if it's not properly formatted. Otherwise it will be scheduled for transmission and queued internally if needed.
Once the packet is scheduled for transmission the G3 ADP MAC driver will set the TCPIP_MAC_PKT_FLAG_QUEUED flag so that the stack is aware that this packet is under processing and cannot be modified.
Once the packet is transmitted, the TCPIP_MAC_PKT_FLAG_QUEUED will be cleared, the proper packet acknowledgment result (ackRes) will be set and the packet acknowledgment function (ackFunc) will be called.