Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to submit the MAC Address to vxWorks

381 views
Skip to first unread message

Markus Zeier

unread,
Feb 10, 2004, 10:59:38 AM2/10/04
to
Hi,

I'm writing my own END Network Driver. During this work I got a
problem with the Ethernet address that vxWorks retrieves. Although in
both MIB tables (RFC 1213 and RFC 2233) the correct value is stored,
ifShow() says the MAC address is 00:00:00:00:00:00. Unfortunately this
is also the MAC address which is put into the sent packets as source
address. For a better understanding of my problem I have to say, that
the MAC address of the card can only be determinate after doing a call
to the card itself. It isn't stored within a ROM, but it is combined
out of five predefined Bytes and one Byte which is read out from DIP
Switches. I'm aware of the fact that this is a really special thing to
do but it is the way it has to be done for my purpose.
The EIOCGADDR command within ioctl is implemented and working. As far
as I understand this is where ifShow should get the MAC address from,
but this command isn't even invoked by ifShow.

My questions are:
Where do ifShow and the IPStack get the MAC address from?
Where is the MAC stored within vxWorks besides the MIB structure?

Kind regards

Markus Zeier

Ignacio G.T.

unread,
Feb 10, 2004, 1:56:38 PM2/10/04
to
On 10 Feb 2004 07:59:38 -0800, groups...@lemming.ch (Markus Zeier)
wrote:

You should initialize the END and MIB structures in your xxEndLoad
function. Something like:

status1 = END_OBJ_INIT (&pXX->end,
(DEV_OBJ *)pXX,
(char *)XX_NAME,
pXX->unit,
&endFuncTable,
"END-based XX Ethernet Driver.");

status2 = END_MIB_INIT (&pXX->end,
M2_ifType_ethernet_csmacd,
&pXX->enetAddr[0],
6,
SIZEOF_ETHERHEADER+ETHERMTU,
END_SPEED);

Are you calling these functions inside xxEndLoad or outside it?

--
Ignacio G.T.

Markus Zeier

unread,
Feb 11, 2004, 2:06:05 AM2/11/04
to
>
> You should initialize the END and MIB structures in your xxEndLoad
> function. Something like:
>
> status1 = END_OBJ_INIT (&pXX->end,
> (DEV_OBJ *)pXX,
> (char *)XX_NAME,
> pXX->unit,
> &endFuncTable,
> "END-based XX Ethernet Driver.");
>
> status2 = END_MIB_INIT (&pXX->end,
> M2_ifType_ethernet_csmacd,
> &pXX->enetAddr[0],
> 6,
> SIZEOF_ETHERHEADER+ETHERMTU,
> END_SPEED);
>
> Are you calling these functions inside xxEndLoad or outside it?

I calling them inside xxEndLoad function. Although END_MIB_INIT isn't
called cause this is as far as I know for MIB Tabels for RFC1213. In
my case the MIB Tables are initialise by invoking m2IfAlloc. My
problem is that within the MIB tables the correct value is stored,
only ifShow and the IP Stack seems not aware of this fact.

Here is the code for initialisation within xxEndLoad

<snip>

if(END_OBJ_INIT (&newEndObj->endObj, (DEV_OBJ
*)newEndObj,DRV_NAME,newEndObj->unit, &myNetFuncs,"PowerLink Network
driver.")==ERROR){
goto loadErrorExit;
}

#ifdef INCLUDE_RFC_1213 /* Old RFC 1213 mib2 interface */
if(END_MIB_INIT (&newEndObj->endObj,
M2_ifType_other,&newEndObj->enetAddr[0], 6,
END_BUFSIZ,END_SPEED)==ERROR){
goto loadErrorExit;
}
/* Mark the device ready */
if(END_OBJ_READY (&newEndObj->endObj,IFF_NOTRAILERS | IFF_BROADCAST |
IFF_MULTICAST | IFF_NOARP)==ERROR){
goto loadErrorExit;
}
printf("MyFlags = 0x%x\n",pEnd->endObj.flags);

#else /* New RFC 2233 mib2 interface */
/* Initialize MIB-II entries (for RFC 2233 ifXTable)*/
newEndObj->endObj.pMib2Tbl =
m2IfAlloc(M2_ifType_other,(UINT8*)newEndObj->enetAddr,
6,PLMTU,END_SPEED,DRV_NAME,newEndObj->unit);
if (newEndObj->endObj.pMib2Tbl == NULL){
/*printf ("%s%d - MIB-II initializations failed\n",
DRV_NAME, newEndObj->unit);*/
goto loadErrorExit;
}

Kind regards

Markus Zeier

Markus Zeier

unread,
Feb 24, 2004, 3:51:23 AM2/24/04
to
groups...@lemming.ch (Markus Zeier) wrote in message news:<93f6ead7.04021...@posting.google.com>...

I've solved the problem.

It seems that the interface Type "M2_ifType_other" was the trigger for
my Problem. After I changed this value to "M2_ifType_ehternetCsmacd",
ifShow and the sent packets have the right MAC Address. Althoug I
don't write an Ethernet CSMACD Driver it seems vxWorks want it that
way, and who am I to disagree.

Kind regards

Markus Zeier

Ignacio G.T.

unread,
Feb 24, 2004, 9:33:00 AM2/24/04
to
Congratulations!

--
Ignacio G.T.

computer

unread,
Mar 10, 2004, 4:59:08 AM3/10/04
to
I find some source code at http://amac.paqtool.com. There has a
utility which can change Mac Address under all windows system. Any
they post some source code.I think it can meet what you need.:)


groups...@lemming.ch (Markus Zeier) wrote in message news:<93f6ead7.04021...@posting.google.com>...

0 new messages