Download VxWorks®

Transcript
H
Implementing a MUX-Based Network Interface Driver
Set the hardware address macro to point to where the physical address is stored in
the RFC 2233-type MIB. For RFC 2233-type MIBs, the physical address for an
Ethernet device is stored in the pMib2Tbl in the END_OBJ. For example:
#define END_HADDR(pEnd)
\
((pEnd)->pMib2Tbl->m2Data.mibIfTbl.ifPhysAddress.phyAddress)
Step 4:
Add the EIOCGMIB2233 case in the ioctl routine.
For example:
/* New RFC 2233 mib2 interface */
case EIOCGMIB2233:
if ((data == NULL) || (pEndObj->pMib2Tbl == NULL))
error = EINVAL;
else
*((M2_ID **)data) = pEndObj->pMib2Tbl;
break;
Step 5:
Replace the old RFC 1213 interface API with the RFC 2233 interface API; then delete
the old RFC 1213 interface API.
RFC 1213 interface API. The old RFC 1213 interface used the END_ERR_ADD
macro for both updating packet counts and for counting error conditions.
(a) Replace all instances of END_ERR_ADD calls. After an END_ERR_ADD
instance is replaced, it can be deleted. For example:
END_ERR_ADD (&pDrvCtrl->endObj, MIB2_IN_UCAST, +1);
H
(b) Replace the deleted RFC 1213 interface.
RFC 2233 Interface API. The RFC 2233 interface API consists of
m2IfGenericPacketCount( ) and m2IfCounterUpdate( ). These routines are
accessed through pointers stored in pMib2Tbl of the END_OBJ. The pointer to
m2IfGenericPacketCount( ) is held in pDrvCtrl-> endObj.pMib2Tbl->
m2PktCountRtn. The pointer to m2IfCounterUpdate( ) is in pDrvCtrl->
endObj.pMib2Tbl-> m2CtrUpdateRtn.
The APIs for these routines are as follows:
m2If8023PacketCount. Increment the interface packet counters for an 802.3 device.
This function is used to update basic interface counters for a packet. The ctrl
argument specifies whether the packet is being sent or received
(M2_PACKET_IN or M2_PACKET_OUT). This function works for the 802.3
313