aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm/ambassador.c
diff options
context:
space:
mode:
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 @@
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
2072static 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
2084static void __devinit amb_esi (amb_dev * dev, u8 * esi) { 2073static 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