02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

H<br />

Implementing a MUX-Based Network Interface Driver<br />

This function should return OK or ERROR. If an error occurs, it should set errno.<br />

The parameters are:<br />

pCookie<br />

Passes in a pointer to the END_OBJ structure returned by endLoad( ).<br />

Handling a Polling Send: endPollSend( )<br />

Your endPollSend( ) is used by any task (such as the debug agent) that wants to<br />

do a polling send. Thus, your endPollSend( ) must be able to put a packet directly<br />

onto the network stack without queuing a packet on an output queue.<br />

NOTE: When the system calls your endPollSend( ), it is probably in a mode that<br />

cannot service kernel calls. Thus, this entry point should not call any kernel<br />

functions, such as taking a semaphore or allocating memory. Likewise, this entry<br />

point should not block or busy wait because that would probably hang the entire<br />

system.<br />

Your endPollSend( ) must take the following form:<br />

STATUS endPollSend<br />

(<br />

void* pCookie, /* device structure */<br />

M_BLK_ID pMblk, /* data to send */<br />

)<br />

Within your endPollSend( ), check that the device is set to polled mode (by a<br />

previous endIoctl( ) call). Your endPollSend( ) should then put the packet (passed<br />

using pNBuff) directly onto the network. Your endPollSend( ) bypasses queuing<br />

the packet on any output queue.<br />

This function should return OK or ERROR. If an error occurs, it should set errno.<br />

The parameters are:<br />

pCookie<br />

Passes a pointer to the END_OBJ structure returned by endLoad( ).<br />

pMblk<br />

Passes a pointer to an mBlk structure containing the data you want to send.<br />

For information on setting up an mBlk, see H.3.1 Setting Up and Using a<br />

Memory Pool for Receive and Transmit Buffers, p.276.<br />

H<br />

295

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!