02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

VxWorks 5.5<br />

<strong>BSP</strong> Developer’s <strong>Guide</strong><br />

work that is now handled in the TCP/IP stack. Thus, in a 4.4 BSD driver, this code<br />

is unnecessary and should be removed.<br />

G.2.2 Changing the Transmit Startup Routine<br />

Under 4.3 BSD, the function prototype for a transmit startup routine is as follows:<br />

static void xxTxStartup (int unit);<br />

Under 4.4 BSD, the prototype has changed to the following:<br />

static void xxTxStartup (struct ifnet * pDrvCtrl);<br />

The 4.4 BSD version expects a pointer to a driver control structure. This change<br />

eases the burden on the startup routine. Instead of having to find its own driver<br />

control structure, it receives a pointer to a driver control structure as input.<br />

If the driver uses netJobAdd( ) to schedule the transmit startup routine for<br />

task-level execution, edit the netJobAdd( ) call to pass in a DRV_CTRL structure<br />

pointer instead of a unit number.<br />

G.2.3 Changes in Receiving Packets<br />

Under 4.3 BSD, the driver calls do_protocol_with_type( ). For example:<br />

do_protocol_with_type (etherType, pMbuf, &pDrvCtrl->idr, len);<br />

This call expects an etherType (which the driver had to discover previously), a<br />

pointer to an mbuf containing the packet data, the Interface Data Record, and the<br />

length of the data.<br />

Under 4.4 BSD, replace the call above with a call to do_protocol( ). For example:<br />

do_protocol (pEh, pMbuf, &pDrvCtrl->idr, len);<br />

The first parameter expects a pointer to the very beginning of the packet (including<br />

the link level header). All the other parameters remain the same. The driver no<br />

longer needs to figure out the etherType for the protocol.<br />

262

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

Saved successfully!

Ooh no, something went wrong!