Skip to contentSkip to conversation

fec_mx.c: Fix MX27 FEC logic to check validity of the MAC address in fuse

PATCH New Eric Jarrige 2 participants 2 messages Apr 15, 2010 – Apr 26, 2010 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fec_mx.c: Fix MX27 FEC logic to check validity of the MAC address in fuse

Fix MX27 FEC logic to check validity of the MAC address in fuse.
Only null (empty fuse) or invalid MAC address was retrieved from mx27 fuses before this change.

---

drivers/net/fec_mxc.c +1 -1
index 8c4ade5..d7706b5 100644
@@ -325,7 +325,7 @@ static int fec_get_hwaddr(struct eth_device *dev, unsigned char *mac)
        for (i = 0; i < 6; i++)
                mac[6-1-i] = readl(&iim->iim_bank_area0[IIM0_MAC + i]);
 
-       return is_valid_ether_addr(mac);
+       return !is_valid_ether_addr(mac);
 #endif
 }
#1 lore raw

PATCH 1/1 fec_mx.c: Fix MX27 FEC logic to check validity of the MAC address in fuse

Eric,

Quoted 11 lines · Eric Jarrige

Fix MX27 FEC logic to check validity of the MAC address in fuse.
Only null (empty fuse) or invalid MAC address was retrieved from mx27 fuses before this change.

---

drivers/net/fec_mxc.c +0 -0
index 8c4ade5..d7706b5 100644

drivers/net/fec_mxc.c static int fec_get_hwaddr(struct eth_device *dev, unsigned char *mac) · line 331

Quoted 8 lines
drivers/net/fec_mxc.c +1 -1
@@ -325,7 +325,7 @@ static int fec_get_hwaddr(struct eth_device *dev, unsigned char *mac)
         for (i = 0; i<  6; i++)
                 mac[6-1-i] = readl(&iim->iim_bank_area0[IIM0_MAC + i]);
 
-       return is_valid_ether_addr(mac);
+       return !is_valid_ether_addr(mac);
  #endif
  }
 

Nice catch! Applied to net repo, although I had to fix whitespace issues and shortened your title.

thanks,
Ben