Skip to contentSkip to conversation

drivers/net/sunhme.c patch

PATCH Tom Southerland 3 participants 6 messages Oct 29, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

This patch provides a unique mac address for all interfaces for the Sun QFE card (non-sparc). It takes the base mac from the first interface and increments the mac address for the other interfaces.

It still preserves the 'macaddr' parameter so if desired, it can still be used.

Before patching:

eth0      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth1      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth2      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth3      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB

After patching:

eth0      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth1      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BC
eth2      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BD
eth3      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BE

Cheers,

Tom

drivers/net/sunhme.c 2007-10-29 08:53:03.000000000 -0600 renamed from drivers/net/sunhme.c.orig 2007-10-29 07:58:25.000000000 -0600 +5 -0
@@ -3083,6 +3083,11 @@ static int __devinit happy_meal_pci_prob
                }
 #else
                get_hme_mac_nonsparc(pdev, &dev->dev_addr[0]);
+                if(macaddr[5] == 0){
+                 for (i = 0; i < 6; i++)
+                       macaddr[i] = dev->dev_addr[i];
+                 macaddr[5]++;
+                }
 #endif
        }
 
#1 lore raw
Quoted 5 lines · Tom Southerland

This patch provides a unique mac address for all interfaces for the Sun QFE card (non-sparc). It takes the base mac from the first interface and increments the mac address for the other interfaces.

Where is the difference to a SPARC QFE? PCI is PCI after all, is not it?

maintainer
#2 lore raw

From: Jan Engelhardt <[email protected]>
Date: Mon, 29 Oct 2007 16:11:18 +0100 (CET)

Quoted 9 lines · Tom Southerland
Quoted 5 lines

This patch provides a unique mac address for all interfaces for the Sun QFE card (non-sparc). It takes the base mac from the first interface and increments the mac address for the other interfaces.

Where is the difference to a SPARC QFE? PCI is PCI after all, is not it?

This is exactly why I wish this patch had been posted to [email protected], now we have a dialogue going and even if I add netdev to the CC: now, you can't follow it completely as a netdev subscriber without going to the lkml archives.

To answer the question, yes it is just a normal PCI device, they put 4 HME chips behind a PCI bridge. However, the OpenFirmware on the cards usually creates device node properties for these PCI devices for the local ethernet addresses. That's what he's trying to duplicate here.

#3 lore raw
Quoted 7 lines · David Miller
Quoted 7 lines · Tom Southerland
Quoted 5 lines

This patch provides a unique mac address for all interfaces for the Sun QFE card (non-sparc). It takes the base mac from the first interface and increments the mac address for the other interfaces.

Quoted 7 lines
Quoted 1 line

Where is the difference to a SPARC QFE? PCI is PCI after all, is not it?

To answer the question, yes it is just a normal PCI device, they put 4 HME chips behind a PCI bridge. However, the OpenFirmware on the cards usually creates device node properties for these PCI devices for the local ethernet addresses. That's what he's trying to duplicate here.

The question was more like: if I put in a QFE (that was acquired together with a SUN E250) into x86, would I get duplicate MACs? (Would be strange - I would have supposed the OF on the card is independent.)

maintainer
#4 lore raw

From: Jan Engelhardt <[email protected]>
Date: Mon, 29 Oct 2007 23:12:25 +0100 (CET)

Quoted 3 lines

The question was more like: if I put in a QFE (that was acquired together with a SUN E250) into x86, would I get duplicate MACs? (Would be strange - I would have supposed the OF on the card is independent.)

You are not supposed to. Each HME instance should get a unique MAC.

Normally OF would propagate this information around to the independant device nodes, and we should try to preserve this behavior for non-OF systems.

maintainer
#5 lore raw
In reply to Tom Southerland

From: Tom Southerland <[email protected]>
Date: Mon, 29 Oct 2007 08:54:14 -0600

Quoted 15 lines

This patch provides a unique mac address for all interfaces for the Sun QFE card (non-sparc). It takes the base mac from the first interface and increments the mac address for the other interfaces.

It still preserves the 'macaddr' parameter so if desired, it can still be used.

Before patching:

eth0      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth1      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth2      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth3      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
Quoted 6 lines

After patching:

eth0      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth1      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BC
eth2      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BD
eth3      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BE

Could you please post this to [email protected] which is where networking patches should go?

Thank you.