I believe (struct arpcom *) ifPtr)->ac_enaddr is the Mac address you wants (it
has 6 bytes), ifPtr = ifunit("ln0").
UINT8 macBuffer[8];
sysCpmEnetAddrGet(0, macBuffer);
MacAddr = nlprintf("0x%02X%02X%02X%02X%02X%02X",
macBuffer[0],
macBuffer[1],
macBuffer[2],
macBuffer[3],
macBuffer[4],
macBuffer[5]);
Jim
-----------------------------------------
Jim Way, Software Engineer
Datum Austin (Austron Inc.)
voice: 512.721.4170
fax : 512.990.9712
email: jwayATdatumDOTcom (no spam please)
-----------------------------------------
vxWorks Tornado II
Something like this :
char macAddr [6];
pIf = ifunit ("ln0");
struct arpcom *pArpcom;
pArpcom = (struct arpcom*) pIf;
memcpy (macaddr, (pArpcom->ac_ecaddr),6);
==========================
Matt Brown
Lockheed Martin - Software
Baltimore, MD
> ----------
> From: vxwe...@lbl.gov[SMTP:vxwe...@lbl.gov]
> Sent: Monday, February 26, 2001 11:32 AM
> To: vxwork...@csg.lbl.gov
> Subject: How do I get the MAC address using vxWorks API?
>
> Submitted-by vxwexp...@csg.lbl.gov Mon Feb 26 08:26:07 2001
> Submitted-by: "Anil Dadlani" <anil.d...@c-cube.com>
>
> > Hi,
> >
> > I need to read the MAC address of a Ethernet chip. How do I get this
> using
> > vxWorks APIs?
> > We do have a lower level BSP API which stores this 6 byte address into
> the
> > driver control structure (etherEndDevice)
> > I found:
> > ifunit ("ln0") function which returns the ifnet structure. Which field
> has
> > the MAC address?
> >
> >
> > Thanks
> >
> > Anil
> >
> >
>
>
> **********
>
>
"Brown, Matthew" wrote:
>
> I couldn't find any kind of direct call in the vxWorks API to get it
Actually there is one if you are using MUX:
char mData[6];
muxIoctl(pCookie, EIOCGADDR, mData);
will return the MAC address in mData.
Baris