diff options
Diffstat (limited to 'drivers/net/mace.c')
-rw-r--r-- | drivers/net/mace.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/net/mace.c b/drivers/net/mace.c index 2907cfb12ada..9ec24f0d5d68 100644 --- a/drivers/net/mace.c +++ b/drivers/net/mace.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/crc32.h> | 16 | #include <linux/crc32.h> |
17 | #include <linux/spinlock.h> | 17 | #include <linux/spinlock.h> |
18 | #include <linux/bitrev.h> | ||
18 | #include <asm/prom.h> | 19 | #include <asm/prom.h> |
19 | #include <asm/dbdma.h> | 20 | #include <asm/dbdma.h> |
20 | #include <asm/io.h> | 21 | #include <asm/io.h> |
@@ -74,7 +75,6 @@ struct mace_data { | |||
74 | #define PRIV_BYTES (sizeof(struct mace_data) \ | 75 | #define PRIV_BYTES (sizeof(struct mace_data) \ |
75 | + (N_RX_RING + NCMDS_TX * N_TX_RING + 3) * sizeof(struct dbdma_cmd)) | 76 | + (N_RX_RING + NCMDS_TX * N_TX_RING + 3) * sizeof(struct dbdma_cmd)) |
76 | 77 | ||
77 | static int bitrev(int); | ||
78 | static int mace_open(struct net_device *dev); | 78 | static int mace_open(struct net_device *dev); |
79 | static int mace_close(struct net_device *dev); | 79 | static int mace_close(struct net_device *dev); |
80 | static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev); | 80 | static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev); |
@@ -96,18 +96,6 @@ static void __mace_set_address(struct net_device *dev, void *addr); | |||
96 | */ | 96 | */ |
97 | static unsigned char *dummy_buf; | 97 | static unsigned char *dummy_buf; |
98 | 98 | ||
99 | /* Bit-reverse one byte of an ethernet hardware address. */ | ||
100 | static inline int | ||
101 | bitrev(int b) | ||
102 | { | ||
103 | int d = 0, i; | ||
104 | |||
105 | for (i = 0; i < 8; ++i, b >>= 1) | ||
106 | d = (d << 1) | (b & 1); | ||
107 | return d; | ||
108 | } | ||
109 | |||
110 | |||
111 | static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_id *match) | 99 | static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_id *match) |
112 | { | 100 | { |
113 | struct device_node *mace = macio_get_of_node(mdev); | 101 | struct device_node *mace = macio_get_of_node(mdev); |
@@ -173,7 +161,7 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i | |||
173 | 161 | ||
174 | rev = addr[0] == 0 && addr[1] == 0xA0; | 162 | rev = addr[0] == 0 && addr[1] == 0xA0; |
175 | for (j = 0; j < 6; ++j) { | 163 | for (j = 0; j < 6; ++j) { |
176 | dev->dev_addr[j] = rev? bitrev(addr[j]): addr[j]; | 164 | dev->dev_addr[j] = rev ? bitrev8(addr[j]): addr[j]; |
177 | } | 165 | } |
178 | mp->chipid = (in_8(&mp->mace->chipid_hi) << 8) | | 166 | mp->chipid = (in_8(&mp->mace->chipid_hi) << 8) | |
179 | in_8(&mp->mace->chipid_lo); | 167 | in_8(&mp->mace->chipid_lo); |