summaryrefslogtreecommitdiffstats
path: root/drivers/atm/ambassador.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2006-12-08 02:36:28 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 08:28:40 -0800
commit0a8588578508a6c58a30ad1a7e23b285cfab49f3 (patch)
treece01093171ccf5cb84d8c2f5a325b0db40644f04 /drivers/atm/ambassador.c
parent60e657e377037d8ce82015903dd195851b7861ed (diff)
downloadlinux-0a8588578508a6c58a30ad1a7e23b285cfab49f3.tar.bz2
[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.c17
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 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/poison.h>
+#include <linux/bitrev.h>
#include <asm/atomic.h>
#include <asm/io.h>
@@ -2068,18 +2069,6 @@ static void __devinit amb_ucode_version (amb_dev * dev) {
PRINTK (KERN_INFO, "microcode version is %u.%u", major, minor);
}
-// swap bits within byte to get Ethernet ordering
-static u8 bit_swap (u8 byte)
-{
- const u8 swap[] = {
- 0x0, 0x8, 0x4, 0xc,
- 0x2, 0xa, 0x6, 0xe,
- 0x1, 0x9, 0x5, 0xd,
- 0x3, 0xb, 0x7, 0xf
- };
- return ((swap[byte & 0xf]<<4) | swap[byte>>4]);
-}
-
// get end station address
static void __devinit amb_esi (amb_dev * dev, u8 * esi) {
u32 lower4;
@@ -2101,9 +2090,9 @@ static void __devinit amb_esi (amb_dev * dev, u8 * esi) {
PRINTDB (DBG_INIT, "ESI:");
for (i = 0; i < ESI_LEN; ++i) {
if (i < 4)
- esi[i] = bit_swap (lower4>>(8*i));
+ esi[i] = bitrev8(lower4>>(8*i));
else
- esi[i] = bit_swap (upper2>>(8*(i-4)));
+ esi[i] = bitrev8(upper2>>(8*(i-4)));
PRINTDM (DBG_INIT, " %02x", esi[i]);
}