17
17
#include <linux/crc32.h>
18
18
#include <linux/errno.h>
19
19
#include <linux/ethtool.h>
20
+ #include <linux/mii.h>
20
21
#include <linux/netdevice.h>
21
22
#include <linux/etherdevice.h>
22
23
#include <linux/skbuff.h>
@@ -500,25 +501,25 @@ static int try_next_permutation(struct bigmac *bp, void __iomem *tregs)
500
501
501
502
/* Reset the PHY. */
502
503
bp -> sw_bmcr = (BMCR_ISOLATE | BMCR_PDOWN | BMCR_LOOPBACK );
503
- bigmac_tcvr_write (bp , tregs , BIGMAC_BMCR , bp -> sw_bmcr );
504
+ bigmac_tcvr_write (bp , tregs , MII_BMCR , bp -> sw_bmcr );
504
505
bp -> sw_bmcr = (BMCR_RESET );
505
- bigmac_tcvr_write (bp , tregs , BIGMAC_BMCR , bp -> sw_bmcr );
506
+ bigmac_tcvr_write (bp , tregs , MII_BMCR , bp -> sw_bmcr );
506
507
507
508
timeout = 64 ;
508
509
while (-- timeout ) {
509
- bp -> sw_bmcr = bigmac_tcvr_read (bp , tregs , BIGMAC_BMCR );
510
+ bp -> sw_bmcr = bigmac_tcvr_read (bp , tregs , MII_BMCR );
510
511
if ((bp -> sw_bmcr & BMCR_RESET ) == 0 )
511
512
break ;
512
513
udelay (20 );
513
514
}
514
515
if (timeout == 0 )
515
516
printk (KERN_ERR "%s: PHY reset failed.\n" , bp -> dev -> name );
516
517
517
- bp -> sw_bmcr = bigmac_tcvr_read (bp , tregs , BIGMAC_BMCR );
518
+ bp -> sw_bmcr = bigmac_tcvr_read (bp , tregs , MII_BMCR );
518
519
519
520
/* Now we try 10baseT. */
520
521
bp -> sw_bmcr &= ~(BMCR_SPEED100 );
521
- bigmac_tcvr_write (bp , tregs , BIGMAC_BMCR , bp -> sw_bmcr );
522
+ bigmac_tcvr_write (bp , tregs , MII_BMCR , bp -> sw_bmcr );
522
523
return 0 ;
523
524
}
524
525
@@ -534,8 +535,8 @@ static void bigmac_timer(unsigned long data)
534
535
535
536
bp -> timer_ticks ++ ;
536
537
if (bp -> timer_state == ltrywait ) {
537
- bp -> sw_bmsr = bigmac_tcvr_read (bp , tregs , BIGMAC_BMSR );
538
- bp -> sw_bmcr = bigmac_tcvr_read (bp , tregs , BIGMAC_BMCR );
538
+ bp -> sw_bmsr = bigmac_tcvr_read (bp , tregs , MII_BMSR );
539
+ bp -> sw_bmcr = bigmac_tcvr_read (bp , tregs , MII_BMCR );
539
540
if (bp -> sw_bmsr & BMSR_LSTATUS ) {
540
541
printk (KERN_INFO "%s: Link is now up at %s.\n" ,
541
542
bp -> dev -> name ,
@@ -588,30 +589,30 @@ static void bigmac_begin_auto_negotiation(struct bigmac *bp)
588
589
int timeout ;
589
590
590
591
/* Grab new software copies of PHY registers. */
591
- bp -> sw_bmsr = bigmac_tcvr_read (bp , tregs , BIGMAC_BMSR );
592
- bp -> sw_bmcr = bigmac_tcvr_read (bp , tregs , BIGMAC_BMCR );
592
+ bp -> sw_bmsr = bigmac_tcvr_read (bp , tregs , MII_BMSR );
593
+ bp -> sw_bmcr = bigmac_tcvr_read (bp , tregs , MII_BMCR );
593
594
594
595
/* Reset the PHY. */
595
596
bp -> sw_bmcr = (BMCR_ISOLATE | BMCR_PDOWN | BMCR_LOOPBACK );
596
- bigmac_tcvr_write (bp , tregs , BIGMAC_BMCR , bp -> sw_bmcr );
597
+ bigmac_tcvr_write (bp , tregs , MII_BMCR , bp -> sw_bmcr );
597
598
bp -> sw_bmcr = (BMCR_RESET );
598
- bigmac_tcvr_write (bp , tregs , BIGMAC_BMCR , bp -> sw_bmcr );
599
+ bigmac_tcvr_write (bp , tregs , MII_BMCR , bp -> sw_bmcr );
599
600
600
601
timeout = 64 ;
601
602
while (-- timeout ) {
602
- bp -> sw_bmcr = bigmac_tcvr_read (bp , tregs , BIGMAC_BMCR );
603
+ bp -> sw_bmcr = bigmac_tcvr_read (bp , tregs , MII_BMCR );
603
604
if ((bp -> sw_bmcr & BMCR_RESET ) == 0 )
604
605
break ;
605
606
udelay (20 );
606
607
}
607
608
if (timeout == 0 )
608
609
printk (KERN_ERR "%s: PHY reset failed.\n" , bp -> dev -> name );
609
610
610
- bp -> sw_bmcr = bigmac_tcvr_read (bp , tregs , BIGMAC_BMCR );
611
+ bp -> sw_bmcr = bigmac_tcvr_read (bp , tregs , MII_BMCR );
611
612
612
613
/* First we try 100baseT. */
613
614
bp -> sw_bmcr |= BMCR_SPEED100 ;
614
- bigmac_tcvr_write (bp , tregs , BIGMAC_BMCR , bp -> sw_bmcr );
615
+ bigmac_tcvr_write (bp , tregs , MII_BMCR , bp -> sw_bmcr );
615
616
616
617
bp -> timer_state = ltrywait ;
617
618
bp -> timer_ticks = 0 ;
@@ -1054,7 +1055,7 @@ static u32 bigmac_get_link(struct net_device *dev)
1054
1055
struct bigmac * bp = netdev_priv (dev );
1055
1056
1056
1057
spin_lock_irq (& bp -> lock );
1057
- bp -> sw_bmsr = bigmac_tcvr_read (bp , bp -> tregs , BIGMAC_BMSR );
1058
+ bp -> sw_bmsr = bigmac_tcvr_read (bp , bp -> tregs , MII_BMSR );
1058
1059
spin_unlock_irq (& bp -> lock );
1059
1060
1060
1061
return (bp -> sw_bmsr & BMSR_LSTATUS );
0 commit comments