diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2006-12-19 13:09:08 -0800 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-05 16:58:47 -0500 |
commit | bc63eb9c7ec0eb7b091db2d82d46d1e68ff9e231 (patch) | |
tree | dfcbc44d49a516eb2c95ac2f724fbee52427d0fd /drivers/net/bmac.c | |
parent | 079ca7da1e6d05c7cb82e9c4f2e1d98839332664 (diff) | |
download | linux-bc63eb9c7ec0eb7b091db2d82d46d1e68ff9e231.tar.gz linux-bc63eb9c7ec0eb7b091db2d82d46d1e68ff9e231.tar.bz2 linux-bc63eb9c7ec0eb7b091db2d82d46d1e68ff9e231.zip |
net: use bitrev8
Use bitrev8 for bmac, mace, macmace, macsonic, and skfp drivers.
[akpm@osdl.org: use the API, not the array]
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mirko Lindner <mlindner@syskonnect.de>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/bmac.c')
-rw-r--r-- | drivers/net/bmac.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c index 4528ce9c4e43..c143304dcff5 100644 --- a/drivers/net/bmac.c +++ b/drivers/net/bmac.c @@ -18,6 +18,7 @@ #include <linux/init.h> #include <linux/spinlock.h> #include <linux/crc32.h> +#include <linux/bitrev.h> #include <asm/prom.h> #include <asm/dbdma.h> #include <asm/io.h> @@ -140,7 +141,6 @@ static unsigned char *bmac_emergency_rxbuf; + (N_RX_RING + N_TX_RING + 4) * sizeof(struct dbdma_cmd) \ + sizeof(struct sk_buff_head)) -static unsigned char bitrev(unsigned char b); static int bmac_open(struct net_device *dev); static int bmac_close(struct net_device *dev); static int bmac_transmit_packet(struct sk_buff *skb, struct net_device *dev); @@ -586,18 +586,6 @@ bmac_construct_rxbuff(struct sk_buff *skb, volatile struct dbdma_cmd *cp) virt_to_bus(addr), 0); } -/* Bit-reverse one byte of an ethernet hardware address. */ -static unsigned char -bitrev(unsigned char b) -{ - int d = 0, i; - - for (i = 0; i < 8; ++i, b >>= 1) - d = (d << 1) | (b & 1); - return d; -} - - static void bmac_init_tx_ring(struct bmac_data *bp) { @@ -1224,8 +1212,8 @@ bmac_get_station_address(struct net_device *dev, unsigned char *ea) { reset_and_select_srom(dev); data = read_srom(dev, i + EnetAddressOffset/2, SROMAddressBits); - ea[2*i] = bitrev(data & 0x0ff); - ea[2*i+1] = bitrev((data >> 8) & 0x0ff); + ea[2*i] = bitrev8(data & 0x0ff); + ea[2*i+1] = bitrev8((data >> 8) & 0x0ff); } } @@ -1315,7 +1303,7 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i rev = addr[0] == 0 && addr[1] == 0xA0; for (j = 0; j < 6; ++j) - dev->dev_addr[j] = rev? bitrev(addr[j]): addr[j]; + dev->dev_addr[j] = rev ? bitrev8(addr[j]): addr[j]; /* Enable chip without interrupts for now */ bmac_enable_and_reset_chip(dev); |