Intel IXP400 Frozen Dessert Maker User Manual


 
Intel
®
IXP400 Software
Access-Layer Components: HSS-Access (IxHssAcc) API
April 2005 IXP400 Software Version 2.0 Programmer’s Guide
202 Document Number: 252539, Revision: 007
13.5.2.1 CallBack
If the pointer to the rxCallback() is not NULL when ixHssAccChanConnect() is called, an ISR will
call rxCallback() to handle Tx/Rx data. It is called when each of N channels receives
bytesPerTStrigger bytes.
Usually, a Rx thread is created to handle the HSS channelized service. The thread will be waiting
for a semaphore. When rxCallback() is called by IxHssAcc, rxCallback() will put the information
from IxHssAcc into a structure, and send a semaphore to the thread. Then rxCallback() returns so
that IxHssAcc can continue its own tasks. The Rx thread — after receiving the semaphore — will
wake up, take the parameters passed by rxCallback(), and perform Rx data processing, Tx data
preparation, and error handling.
For Rx data processing, rxCallback() provides the offset value rxOffset to indicate where data is
just written into each circular buffer. rxOffset is shared for all the circular buffers in the pool. The
client has to make sure the Rx data are processed or moved to somewhere else before overwritten
by the NPE since the buffers are circular.
For TX data preparation, rxCallback() provides the offset value txOffset to indicate which pointer
list in the pointer lists pool is pointing to the data buffers currently being or will be transmitted. As
a result, the client can use txOffset to determine where new data needs to be put into the data buffer
pool for transmission. For example, data can be prepared and moved into buffers pointed by the
(txOffset-2)th pointer list.
rxCallback() also provides the number of errors NPE receives. The client can call function
ixHssAccLastErrorRetrievalInitiate() to initiate the retrieval of the last HSS error.
13.5.2.2 Polled
If the pointer to the rxCallback() is NULL when ixHssAccChanConnect() is called, it implies that
the client will use a polling mechanism to detect when the Tx and Rx of channelized data is to
occur. The client will use ixHssAccChanStatusQuery() to query whether channelized data has been
received. If data has been received, IxHssAcc will return the details in the output parameters of
ixHssAccChanStatusQuery.
ixHssAccChanStatusQuery() returns a flag dataRecvd that indicates whether the access component
has any data for the client. If FA L S E , the other output parameters will not have been written to. If it
is TRUE, then rxOffset, txOffset, and numHssErrs — returned by ixHssAccChanStatusQuery() —
are valid and can be used in the same way as in the callback function case above.
Figure 63 shows the Tx/Rx process.