Intel IXP400 Frozen Dessert Maker User Manual


 
Intel
®
IXP400 Software
Access-Layer Components: HSS-Access (IxHssAcc) API
Programmer’s Guide IXP400 Software Version 2.0 April 2005
Document Number: 252539, Revision: 007 207
When the transmission is done, the TxDone call back function, registered with
ixHssAccPktPortConnect(), is called, and the buffer can be returned to IXP_BUF pool using
IX_OSAL_MBUF_POOL_PUT_CHAIN().
The following is example Tx code showing how to send an IXP_BUF:
The following is example Tx code showing how to chain IXP_BUFs together:
The process is shown in Figure 65.
IX_OSAL_MBUF *txBuffer;
IX_OSAL_MBUF *txBufferChain = NULL;
// get a IX_OSAL_MBUF(IXP_BUF)
IX_OSAL_MBUF_POOL_GET(poolId, &txBuffer);
// set the data length in the buffer
IX_OSAL_MBUF_MLEN(txBuffer) = NumberOfBytesToSend;
/* set the values to transmit */
for (byteIndex = 0; byteIndex < IX_OSAL_MBUF_MLEN(txBuffer);
byteIndex++)
((UINT8 *)IX_OSAL_MBUF_MDATA(txBuffer))[byteIndex]
=userData[byteIndex];
//send the buffer out
ixHssAccPktPortTx (hssPortId, hdlcPortId, txBuffer);
IX_OSAL_MBUF *txBufferChain = NULL;
IX_OSAL_MBUF *lastBuffer = NULL;
if (txBufferChain == NULL)
{ // the first buffer
txBufferChain = txBuffer;
/* set packet header for buffer */
IX_OSAL_MBUF_PKT_LEN(txBufferChain) = 0;
}
else
{ // following buffers
IX_OSAL_MBUF_NEXT_BUFFER_IN_PKT_PTR(lastBuffer) =
txBuffer;
}
// update the chain length
IX_OSAL_MBUF_PKT_LEN(txBufferChain) +=
IX_OSAL_MBUF_MLEN(txBuffer);
IX_OSAL_MBUF_NEXT_BUFFER_IN_PKT_PTR(txBuffer) = NULL;
lastBuffer = txBuffer;
// send the bubber out
ixHssAccPktPortTx (hssPortId, hdlcPortId, txBufferChain);