Re: [Fwd: Changing MAC address with 'ip' command.]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2 Jan 2001, Ben Greear wrote:

> Some additional notes:  I had the same bad results trying to set
> the mac on a tulip based NIC with kernel 2.2.17.  Using the tulip-diag
> tool, I was able to see that the original MAC was still reported by
> the NIC, but ifconfig showed the one I had tried to set.
> 
> Hopefully I'm missing some simple detail/command??

The tulip-diag and rtl8139-diag programs have _almost_ all of the code to
change the station address for most of the supported chips(1).

But people are almost always wrong about their reasons for wanting the
station address _permanently_ changed, so I frequently leave the actual code
disabled in the diagnostic programs.

The complex part of the code is there, and has been tested.  For instance,
see the comment in rtl8139-diag.c:
____
/* Caution!  This routine works!
   It will permanently change the EEPROM contents.
   "You could put an eye out with that thing." */
static int do_update(long ioaddr, unsigned short *ee_values,


The missing code is just
--------
    if (set_hwaddr)
        for (i = 0; i < 3; i++)
            do_update(ioaddr, eeprom_contents, 7 + i, "Station address",
                (new_hwaddr[i*2]<<8) + new_hwaddr[i*2+1]);


Note: The 21041 and PNIC-1 (82c168 and '169) use unique EEPROM access
   methods.  I don't think that it's possible to write the 21040 EEPROM.


Donald Becker				becker@scyld.com
Scyld Computing Corporation		http://www.scyld.com
410 Severn Ave. Suite 210		Second Generation Beowulf Clusters
Annapolis MD 21403			410-990-9993

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux