diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2006-12-08 05:36:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:28:40 -0500 |
commit | 0a8588578508a6c58a30ad1a7e23b285cfab49f3 (patch) | |
tree | ce01093171ccf5cb84d8c2f5a325b0db40644f04 /drivers/atm/ambassador.c | |
parent | 60e657e377037d8ce82015903dd195851b7861ed (diff) |
[PATCH] atm/ambassador: use bitrev8
Use bitrev8 for ambassador driver.
Cc: Chas Williams <linux-atm-general@lists.sourceforge.net>
Cc: Giuliano Procida at Madge Networks <gprocida@madge.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/atm/ambassador.c')
-rw-r--r-- | drivers/atm/ambassador.c | 17 |
1 files changed, 3 insertions, 14 deletions
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 | ||