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

Step 1:<br />

Modify the END load routine to set up the RFC 2233-type MIB in the END_OBJ.<br />

In the xxxEndLoad( ) routine, initialize the MIB-II entries (for RFC 2233). For<br />

example:<br />

pDrvCtrl->endObj.pMib2Tbl = m2IfAlloc(M2_ifType_ethernet_csmacd,<br />

(UINT8*) enetAddr, 6,<br />

ETHERMTU, speed,<br />

DEV_NAME, pDrvCtrl->unit);<br />

if (pDrvCtrl->endObj.pMib2Tbl == NULL)<br />

{<br />

logMsg ("%s%d - MIB-II initializations failed\n",<br />

DEV_NAME, pDrvCtrl->unit,0,0,0,0);<br />

goto errorExit;<br />

}<br />

/*<br />

* Set the RFC2233 flag bit in the END object flags field and<br />

* install the counter update routines.<br />

*/<br />

m2IfPktCountRtnInstall(pDrvCtrl->endObj.pMib2Tbl, m2If8023PacketCount);<br />

/*<br />

* Make a copy of the data in the mib2Tbl struct as well. We do this<br />

* mainly for backward compatibility issues. There might be some<br />

* code that references the END pointer and does lookups on the mib2Tbl,<br />

* which causes all sorts of problems.<br />

*/<br />

bcopy ((char *)&pDrvCtrl->endObj.pMib2Tbl->m2Data.mibIfTbl,<br />

(char *)&pDrvCtrl->endObj.mib2Tbl, sizeof (M2_INTERFACETBL));/*<br />

Mark the device ready */<br />

END_OBJ_READY (&pDrvCtrl->endObj,<br />

IFF_NOTRAILERS | IFF_MULTICAST | IFF_BROADCAST |<br />

END_MIB_2233);<br />

Step 2:<br />

Modify the END unload routine to delete the RFC 2233-type MIB from the END_OBJ.<br />

In the xxxEndUnload( ) routine, add MIB-II free routine entries. For example:<br />

m2IfFree(pDrvCtrl->endObj.pMib2Tbl);<br />

pDrvCtrl->endObj.pMib2Tbl = NULL;<br />

Step 3:<br />

Change the hardware address macro to point to the new location of the<br />

physical address.<br />

The hardware address macro is usually defined with the name<br />

END_HADDR(pEnd) but may be defined with the prefix reflecting the actual<br />

driver, such as in the fei82557End driver, where it is FEI_HADDR(pEnd).<br />

312

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

Saved successfully!

Ooh no, something went wrong!