This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to obtain the mac address from the build in MAC_ID registers

Hi,

I am trying to obtain the HW mac address values.

I tried the following piece of code:

    // Ask the Kernel the MAC of the SITARA
    if((s=socket(PF_INET,SOCK_DGRAM,0)) == -1)
        return -1;

    memset(&exchange,0x00,sizeof(exchange));    
    strcpy(exchange.ifr_name,"eth0");
    err=ioctl(s,SIOCGIFHWADDR,&exchange);
    if(!err)
        memcpy(SN,exchange.ifr_hwaddr.sa_data,6);

However this does not give me the register values. I expect a value which starts with 00:18:31 ( TI vendor ID)

How can I get the HW value. The value I read with the peice of code just gives me the value set with IFconfig (or uBoot)

Regards Marcel

  • Marcel,

    I am not working on the Linux side of things right now so I can't comment on that driver. However the register address for the fused MAC addresses (one for each port) are documented in the TRM.

    But do not assume just the value you use above. TI has several ranges of MAC addresses. Some devices I have start with D4-94-A1 for example.

    Regards.