diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-07 22:21:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-07 22:21:56 -0500 |
commit | 7677ced48e2bbbb8d847d34f37e5d96d2b0e41e4 (patch) | |
tree | 0a859f403c02eb854d9ffa11bd17f77056891d07 /drivers/net/macmace.c | |
parent | 21d37bbc65e39a26856de6b14be371ff24e0d03f (diff) | |
parent | ac38dfc39e7684f55174742e5f0d6c5a0093bbf6 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (116 commits)
sk98lin: planned removal
AT91: MACB support
sky2: version 1.12
sky2: add new chip ids
sky2: Yukon Extreme support
sky2: safer transmit timeout
sky2: TSO support for EC_U
sky2: use dev_err for error reports
sky2: add Wake On Lan support
fix unaligned exception in /drivers/net/wireless/orinoco.c
Remove unused kernel config option DLCI_COUNT
z85230: spinlock logic
mips: declance: Driver model for the PMAD-A
Spidernet: Rework RX linked list
NET: turn local_save_flags() + local_irq_disable() into local_irq_save()
NET-3c59x: turn local_save_flags() + local_irq_disable() into local_irq_save()
hp100: convert pci_module_init() to pci_register_driver()
NetXen: Added ethtool support for user level tools.
NetXen: Firmware crb init changes.
maintainers: add atl1 maintainers
...
Diffstat (limited to 'drivers/net/macmace.c')
-rw-r--r-- | drivers/net/macmace.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/net/macmace.c b/drivers/net/macmace.c index 464e4a6f3d5f..5d541e873041 100644 --- a/drivers/net/macmace.c +++ b/drivers/net/macmace.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/string.h> | 23 | #include <linux/string.h> |
24 | #include <linux/crc32.h> | 24 | #include <linux/crc32.h> |
25 | #include <linux/bitrev.h> | ||
25 | #include <asm/io.h> | 26 | #include <asm/io.h> |
26 | #include <asm/pgtable.h> | 27 | #include <asm/pgtable.h> |
27 | #include <asm/irq.h> | 28 | #include <asm/irq.h> |
@@ -81,19 +82,6 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id); | |||
81 | static irqreturn_t mace_dma_intr(int irq, void *dev_id); | 82 | static irqreturn_t mace_dma_intr(int irq, void *dev_id); |
82 | static void mace_tx_timeout(struct net_device *dev); | 83 | static void mace_tx_timeout(struct net_device *dev); |
83 | 84 | ||
84 | /* Bit-reverse one byte of an ethernet hardware address. */ | ||
85 | |||
86 | static int bitrev(int b) | ||
87 | { | ||
88 | int d = 0, i; | ||
89 | |||
90 | for (i = 0; i < 8; ++i, b >>= 1) { | ||
91 | d = (d << 1) | (b & 1); | ||
92 | } | ||
93 | |||
94 | return d; | ||
95 | } | ||
96 | |||
97 | /* | 85 | /* |
98 | * Load a receive DMA channel with a base address and ring length | 86 | * Load a receive DMA channel with a base address and ring length |
99 | */ | 87 | */ |
@@ -219,12 +207,12 @@ struct net_device *mace_probe(int unit) | |||
219 | addr = (void *)MACE_PROM; | 207 | addr = (void *)MACE_PROM; |
220 | 208 | ||
221 | for (j = 0; j < 6; ++j) { | 209 | for (j = 0; j < 6; ++j) { |
222 | u8 v=bitrev(addr[j<<4]); | 210 | u8 v = bitrev8(addr[j<<4]); |
223 | checksum ^= v; | 211 | checksum ^= v; |
224 | dev->dev_addr[j] = v; | 212 | dev->dev_addr[j] = v; |
225 | } | 213 | } |
226 | for (; j < 8; ++j) { | 214 | for (; j < 8; ++j) { |
227 | checksum ^= bitrev(addr[j<<4]); | 215 | checksum ^= bitrev8(addr[j<<4]); |
228 | } | 216 | } |
229 | 217 | ||
230 | if (checksum != 0xFF) { | 218 | if (checksum != 0xFF) { |