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 />

pDst<br />

Expects NULL or a pointer to the mBlk structure into which to write the<br />

extracted destination address (local) of the packet.<br />

pESrc<br />

Expects NULL or a pointer to the mBlk structure into which to write the<br />

extracted source address (end, if different) of the packet.end source of packet.<br />

pEDst<br />

Expects NULL or a pointer to the mBlk structure into which to write the<br />

extracted destination address (end, if different) of the packet.<br />

H.6 Writing Protocols That Use the MUX API<br />

This section describes how to port protocols to the MUX-based model. As shown<br />

in Figure H-1, MUX-based protocols bind themselves to the MUX from above and<br />

network interface drivers (ENDs) bind themselves to the MUX from below. Thus,<br />

a protocol is layered on top of the MUX, which is layered on top of a network<br />

interface driver. The responsibilities of each is given in Table H-3.<br />

Table H-3<br />

Layers and Responsibilities<br />

Layer<br />

Protocol<br />

MUX<br />

Network<br />

Interface Driver<br />

Responsibilities<br />

Interface to the transport layer, and, through it, to application programs.<br />

Copying packet data if needed.<br />

Loading and unloading drivers.<br />

Binding and unbinding protocols.<br />

Calling each bound protocol’s receive routine.<br />

Managing memory for buffer loaning.<br />

Dealing with hardware.<br />

Loading a driver into the system.<br />

Unloading a driver from the system.<br />

Loaning buffers to upper layers.<br />

H<br />

301

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

Saved successfully!

Ooh no, something went wrong!