diff options
author | Joe Perches <joe@perches.com> | 2011-11-16 04:38:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-16 20:23:17 -0500 |
commit | 6a3c910ca04ecd69b16dae47b26097a92c533828 (patch) | |
tree | 27d9f1c13c039f67e58120ea12cf65b89a531ee0 /drivers/net/ethernet/freescale | |
parent | 28011cf19b75df9d3f35489a7599a97ec0b3f1a0 (diff) |
ethernet: Convert MAC_ADDR_LEN uses to ETH_ALEN
Reduce the number of #defines, use the normal #define from if_ether.h
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.c | 12 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.h | 3 |
2 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index ff3e8b0f0da3..8e21ceb3b7da 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
@@ -734,7 +734,7 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev) | |||
734 | 734 | ||
735 | mac_addr = of_get_mac_address(np); | 735 | mac_addr = of_get_mac_address(np); |
736 | if (mac_addr) | 736 | if (mac_addr) |
737 | memcpy(dev->dev_addr, mac_addr, MAC_ADDR_LEN); | 737 | memcpy(dev->dev_addr, mac_addr, ETH_ALEN); |
738 | 738 | ||
739 | if (model && !strcasecmp(model, "TSEC")) | 739 | if (model && !strcasecmp(model, "TSEC")) |
740 | priv->device_flags = | 740 | priv->device_flags = |
@@ -3114,7 +3114,7 @@ static void gfar_set_multi(struct net_device *dev) | |||
3114 | static void gfar_clear_exact_match(struct net_device *dev) | 3114 | static void gfar_clear_exact_match(struct net_device *dev) |
3115 | { | 3115 | { |
3116 | int idx; | 3116 | int idx; |
3117 | static const u8 zero_arr[MAC_ADDR_LEN] = {0, 0, 0, 0, 0, 0}; | 3117 | static const u8 zero_arr[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; |
3118 | 3118 | ||
3119 | for(idx = 1;idx < GFAR_EM_NUM + 1;idx++) | 3119 | for(idx = 1;idx < GFAR_EM_NUM + 1;idx++) |
3120 | gfar_set_mac_for_addr(dev, idx, zero_arr); | 3120 | gfar_set_mac_for_addr(dev, idx, zero_arr); |
@@ -3137,7 +3137,7 @@ static void gfar_set_hash_for_addr(struct net_device *dev, u8 *addr) | |||
3137 | { | 3137 | { |
3138 | u32 tempval; | 3138 | u32 tempval; |
3139 | struct gfar_private *priv = netdev_priv(dev); | 3139 | struct gfar_private *priv = netdev_priv(dev); |
3140 | u32 result = ether_crc(MAC_ADDR_LEN, addr); | 3140 | u32 result = ether_crc(ETH_ALEN, addr); |
3141 | int width = priv->hash_width; | 3141 | int width = priv->hash_width; |
3142 | u8 whichbit = (result >> (32 - width)) & 0x1f; | 3142 | u8 whichbit = (result >> (32 - width)) & 0x1f; |
3143 | u8 whichreg = result >> (32 - width + 5); | 3143 | u8 whichreg = result >> (32 - width + 5); |
@@ -3158,7 +3158,7 @@ static void gfar_set_mac_for_addr(struct net_device *dev, int num, | |||
3158 | struct gfar_private *priv = netdev_priv(dev); | 3158 | struct gfar_private *priv = netdev_priv(dev); |
3159 | struct gfar __iomem *regs = priv->gfargrp[0].regs; | 3159 | struct gfar __iomem *regs = priv->gfargrp[0].regs; |
3160 | int idx; | 3160 | int idx; |
3161 | char tmpbuf[MAC_ADDR_LEN]; | 3161 | char tmpbuf[ETH_ALEN]; |
3162 | u32 tempval; | 3162 | u32 tempval; |
3163 | u32 __iomem *macptr = ®s->macstnaddr1; | 3163 | u32 __iomem *macptr = ®s->macstnaddr1; |
3164 | 3164 | ||
@@ -3166,8 +3166,8 @@ static void gfar_set_mac_for_addr(struct net_device *dev, int num, | |||
3166 | 3166 | ||
3167 | /* Now copy it into the mac registers backwards, cuz */ | 3167 | /* Now copy it into the mac registers backwards, cuz */ |
3168 | /* little endian is silly */ | 3168 | /* little endian is silly */ |
3169 | for (idx = 0; idx < MAC_ADDR_LEN; idx++) | 3169 | for (idx = 0; idx < ETH_ALEN; idx++) |
3170 | tmpbuf[MAC_ADDR_LEN - 1 - idx] = addr[idx]; | 3170 | tmpbuf[ETH_ALEN - 1 - idx] = addr[idx]; |
3171 | 3171 | ||
3172 | gfar_write(macptr, *((u32 *) (tmpbuf))); | 3172 | gfar_write(macptr, *((u32 *) (tmpbuf))); |
3173 | 3173 | ||
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h index cda6cb2eb1d2..fe7ac3a83194 100644 --- a/drivers/net/ethernet/freescale/gianfar.h +++ b/drivers/net/ethernet/freescale/gianfar.h | |||
@@ -74,9 +74,6 @@ struct ethtool_rx_list { | |||
74 | * will be the next highest multiple of 512 bytes. */ | 74 | * will be the next highest multiple of 512 bytes. */ |
75 | #define INCREMENTAL_BUFFER_SIZE 512 | 75 | #define INCREMENTAL_BUFFER_SIZE 512 |
76 | 76 | ||
77 | |||
78 | #define MAC_ADDR_LEN 6 | ||
79 | |||
80 | #define PHY_INIT_TIMEOUT 100000 | 77 | #define PHY_INIT_TIMEOUT 100000 |
81 | #define GFAR_PHY_CHANGE_TIME 2 | 78 | #define GFAR_PHY_CHANGE_TIME 2 |
82 | 79 | ||