diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/atm/Kconfig | 1 | ||||
-rw-r--r-- | drivers/atm/ambassador.c | 17 |
2 files changed, 4 insertions, 14 deletions
diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig index cfa5af883e13..2ddd76fdbc43 100644 --- a/drivers/atm/Kconfig +++ b/drivers/atm/Kconfig | |||
@@ -242,6 +242,7 @@ config ATM_IDT77252_USE_SUNI | |||
242 | config ATM_AMBASSADOR | 242 | config ATM_AMBASSADOR |
243 | tristate "Madge Ambassador (Collage PCI 155 Server)" | 243 | tristate "Madge Ambassador (Collage PCI 155 Server)" |
244 | depends on PCI && ATM | 244 | depends on PCI && ATM |
245 | select BITREVERSE | ||
245 | help | 246 | help |
246 | This is a driver for ATMizer based ATM card produced by Madge | 247 | This is a driver for ATMizer based ATM card produced by Madge |
247 | Networks Ltd. Say Y (or M to compile as a module named ambassador) | 248 | Networks Ltd. Say Y (or M to compile as a module named ambassador) |
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c index afa7d750a593..3c372e08f77d 100644 --- a/drivers/atm/ambassador.c +++ b/drivers/atm/ambassador.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
33 | #include <linux/interrupt.h> | 33 | #include <linux/interrupt.h> |
34 | #include <linux/poison.h> | 34 | #include <linux/poison.h> |
35 | #include <linux/bitrev.h> | ||
35 | 36 | ||
36 | #include <asm/atomic.h> | 37 | #include <asm/atomic.h> |
37 | #include <asm/io.h> | 38 | #include <asm/io.h> |
@@ -2068,18 +2069,6 @@ static void __devinit amb_ucode_version (amb_dev * dev) { | |||
2068 | PRINTK (KERN_INFO, "microcode version is %u.%u", major, minor); | 2069 | PRINTK (KERN_INFO, "microcode version is %u.%u", major, minor); |
2069 | } | 2070 | } |
2070 | 2071 | ||
2071 | // swap bits within byte to get Ethernet ordering | ||
2072 | static u8 bit_swap (u8 byte) | ||
2073 | { | ||
2074 | const u8 swap[] = { | ||
2075 | 0x0, 0x8, 0x4, 0xc, | ||
2076 | 0x2, 0xa, 0x6, 0xe, | ||
2077 | 0x1, 0x9, 0x5, 0xd, | ||
2078 | 0x3, 0xb, 0x7, 0xf | ||
2079 | }; | ||
2080 | return ((swap[byte & 0xf]<<4) | swap[byte>>4]); | ||
2081 | } | ||
2082 | |||
2083 | // get end station address | 2072 | // get end station address |
2084 | static void __devinit amb_esi (amb_dev * dev, u8 * esi) { | 2073 | static void __devinit amb_esi (amb_dev * dev, u8 * esi) { |
2085 | u32 lower4; | 2074 | u32 lower4; |
@@ -2101,9 +2090,9 @@ static void __devinit amb_esi (amb_dev * dev, u8 * esi) { | |||
2101 | PRINTDB (DBG_INIT, "ESI:"); | 2090 | PRINTDB (DBG_INIT, "ESI:"); |
2102 | for (i = 0; i < ESI_LEN; ++i) { | 2091 | for (i = 0; i < ESI_LEN; ++i) { |
2103 | if (i < 4) | 2092 | if (i < 4) |
2104 | esi[i] = bit_swap (lower4>>(8*i)); | 2093 | esi[i] = bitrev8(lower4>>(8*i)); |
2105 | else | 2094 | else |
2106 | esi[i] = bit_swap (upper2>>(8*(i-4))); | 2095 | esi[i] = bitrev8(upper2>>(8*(i-4))); |
2107 | PRINTDM (DBG_INIT, " %02x", esi[i]); | 2096 | PRINTDM (DBG_INIT, " %02x", esi[i]); |
2108 | } | 2097 | } |
2109 | 2098 | ||