aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/skfp/drvfbi.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2006-12-19 16:09:08 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-05 16:58:47 -0500
commitbc63eb9c7ec0eb7b091db2d82d46d1e68ff9e231 (patch)
treedfcbc44d49a516eb2c95ac2f724fbee52427d0fd /drivers/net/skfp/drvfbi.c
parent079ca7da1e6d05c7cb82e9c4f2e1d98839332664 (diff)
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/skfp/drvfbi.c')
-rw-r--r--drivers/net/skfp/drvfbi.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/net/skfp/drvfbi.c b/drivers/net/skfp/drvfbi.c
index 5b475833f645..4fe624b0dd25 100644
--- a/drivers/net/skfp/drvfbi.c
+++ b/drivers/net/skfp/drvfbi.c
@@ -23,6 +23,7 @@
23#include "h/smc.h" 23#include "h/smc.h"
24#include "h/supern_2.h" 24#include "h/supern_2.h"
25#include "h/skfbiinc.h" 25#include "h/skfbiinc.h"
26#include <linux/bitrev.h>
26 27
27#ifndef lint 28#ifndef lint
28static const char ID_sccs[] = "@(#)drvfbi.c 1.63 99/02/11 (C) SK " ; 29static const char ID_sccs[] = "@(#)drvfbi.c 1.63 99/02/11 (C) SK " ;
@@ -445,16 +446,14 @@ void read_address(struct s_smc *smc, u_char *mac_addr)
445 char PmdType ; 446 char PmdType ;
446 int i ; 447 int i ;
447 448
448 extern const u_char canonical[256] ;
449
450#if (defined(ISA) || defined(MCA)) 449#if (defined(ISA) || defined(MCA))
451 for (i = 0; i < 4 ;i++) { /* read mac address from board */ 450 for (i = 0; i < 4 ;i++) { /* read mac address from board */
452 smc->hw.fddi_phys_addr.a[i] = 451 smc->hw.fddi_phys_addr.a[i] =
453 canonical[(inpw(PR_A(i+SA_MAC))&0xff)] ; 452 bitrev8(inpw(PR_A(i+SA_MAC)));
454 } 453 }
455 for (i = 4; i < 6; i++) { 454 for (i = 4; i < 6; i++) {
456 smc->hw.fddi_phys_addr.a[i] = 455 smc->hw.fddi_phys_addr.a[i] =
457 canonical[(inpw(PR_A(i+SA_MAC+PRA_OFF))&0xff)] ; 456 bitrev8(inpw(PR_A(i+SA_MAC+PRA_OFF)));
458 } 457 }
459#endif 458#endif
460#ifdef EISA 459#ifdef EISA
@@ -464,17 +463,17 @@ void read_address(struct s_smc *smc, u_char *mac_addr)
464 */ 463 */
465 for (i = 0; i < 4 ;i++) { /* read mac address from board */ 464 for (i = 0; i < 4 ;i++) { /* read mac address from board */
466 smc->hw.fddi_phys_addr.a[i] = 465 smc->hw.fddi_phys_addr.a[i] =
467 canonical[inp(PR_A(i+SA_MAC))] ; 466 bitrev8(inp(PR_A(i+SA_MAC)));
468 } 467 }
469 for (i = 4; i < 6; i++) { 468 for (i = 4; i < 6; i++) {
470 smc->hw.fddi_phys_addr.a[i] = 469 smc->hw.fddi_phys_addr.a[i] =
471 canonical[inp(PR_A(i+SA_MAC+PRA_OFF))] ; 470 bitrev8(inp(PR_A(i+SA_MAC+PRA_OFF)));
472 } 471 }
473#endif 472#endif
474#ifdef PCI 473#ifdef PCI
475 for (i = 0; i < 6; i++) { /* read mac address from board */ 474 for (i = 0; i < 6; i++) { /* read mac address from board */
476 smc->hw.fddi_phys_addr.a[i] = 475 smc->hw.fddi_phys_addr.a[i] =
477 canonical[inp(ADDR(B2_MAC_0+i))] ; 476 bitrev8(inp(ADDR(B2_MAC_0+i)));
478 } 477 }
479#endif 478#endif
480#ifndef PCI 479#ifndef PCI
@@ -493,7 +492,7 @@ void read_address(struct s_smc *smc, u_char *mac_addr)
493 if (mac_addr) { 492 if (mac_addr) {
494 for (i = 0; i < 6 ;i++) { 493 for (i = 0; i < 6 ;i++) {
495 smc->hw.fddi_canon_addr.a[i] = mac_addr[i] ; 494 smc->hw.fddi_canon_addr.a[i] = mac_addr[i] ;
496 smc->hw.fddi_home_addr.a[i] = canonical[mac_addr[i]] ; 495 smc->hw.fddi_home_addr.a[i] = bitrev8(mac_addr[i]);
497 } 496 }
498 return ; 497 return ;
499 } 498 }
@@ -501,7 +500,7 @@ void read_address(struct s_smc *smc, u_char *mac_addr)
501 500
502 for (i = 0; i < 6 ;i++) { 501 for (i = 0; i < 6 ;i++) {
503 smc->hw.fddi_canon_addr.a[i] = 502 smc->hw.fddi_canon_addr.a[i] =
504 canonical[smc->hw.fddi_phys_addr.a[i]] ; 503 bitrev8(smc->hw.fddi_phys_addr.a[i]);
505 } 504 }
506} 505}
507 506
@@ -1269,11 +1268,8 @@ void driver_get_bia(struct s_smc *smc, struct fddi_addr *bia_addr)
1269{ 1268{
1270 int i ; 1269 int i ;
1271 1270
1272 extern const u_char canonical[256] ; 1271 for (i = 0 ; i < 6 ; i++)
1273 1272 bia_addr->a[i] = bitrev8(smc->hw.fddi_phys_addr.a[i]);
1274 for (i = 0 ; i < 6 ; i++) {
1275 bia_addr->a[i] = canonical[smc->hw.fddi_phys_addr.a[i]] ;
1276 }
1277} 1273}
1278 1274
1279void smt_start_watchdog(struct s_smc *smc) 1275void smt_start_watchdog(struct s_smc *smc)