aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/lmc/lmc_media.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wan/lmc/lmc_media.c')
-rw-r--r--drivers/net/wan/lmc/lmc_media.c55
1 files changed, 24 insertions, 31 deletions
diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c
index 1cc5834ebbc2..2e0711a956cc 100644
--- a/drivers/net/wan/lmc/lmc_media.c
+++ b/drivers/net/wan/lmc/lmc_media.c
@@ -425,7 +425,7 @@ lmc_ds3_set_scram (lmc_softc_t * const sc, int ie)
425static int 425static int
426lmc_ds3_get_link_status (lmc_softc_t * const sc) 426lmc_ds3_get_link_status (lmc_softc_t * const sc)
427{ 427{
428 u_int16_t link_status, link_status_11; 428 u16 link_status, link_status_11;
429 int ret = 1; 429 int ret = 1;
430 430
431 lmc_mii_writereg (sc, 0, 17, 7); 431 lmc_mii_writereg (sc, 0, 17, 7);
@@ -447,7 +447,7 @@ lmc_ds3_get_link_status (lmc_softc_t * const sc)
447 (link_status & LMC_FRAMER_REG0_OOFS)){ 447 (link_status & LMC_FRAMER_REG0_OOFS)){
448 ret = 0; 448 ret = 0;
449 if(sc->last_led_err[3] != 1){ 449 if(sc->last_led_err[3] != 1){
450 u16 r1; 450 u16 r1;
451 lmc_mii_writereg (sc, 0, 17, 01); /* Turn on Xbit error as our cisco does */ 451 lmc_mii_writereg (sc, 0, 17, 01); /* Turn on Xbit error as our cisco does */
452 r1 = lmc_mii_readreg (sc, 0, 18); 452 r1 = lmc_mii_readreg (sc, 0, 18);
453 r1 &= 0xfe; 453 r1 &= 0xfe;
@@ -460,7 +460,7 @@ lmc_ds3_get_link_status (lmc_softc_t * const sc)
460 else { 460 else {
461 lmc_led_off(sc, LMC_DS3_LED3); /* turn on red LED */ 461 lmc_led_off(sc, LMC_DS3_LED3); /* turn on red LED */
462 if(sc->last_led_err[3] == 1){ 462 if(sc->last_led_err[3] == 1){
463 u16 r1; 463 u16 r1;
464 lmc_mii_writereg (sc, 0, 17, 01); /* Turn off Xbit error */ 464 lmc_mii_writereg (sc, 0, 17, 01); /* Turn off Xbit error */
465 r1 = lmc_mii_readreg (sc, 0, 18); 465 r1 = lmc_mii_readreg (sc, 0, 18);
466 r1 |= 0x01; 466 r1 |= 0x01;
@@ -538,20 +538,19 @@ lmc_ds3_watchdog (lmc_softc_t * const sc)
538 * SSI methods 538 * SSI methods
539 */ 539 */
540 540
541static void 541static void lmc_ssi_init(lmc_softc_t * const sc)
542lmc_ssi_init (lmc_softc_t * const sc)
543{ 542{
544 u_int16_t mii17; 543 u16 mii17;
545 int cable; 544 int cable;
546 545
547 sc->ictl.cardtype = LMC_CTL_CARDTYPE_LMC1000; 546 sc->ictl.cardtype = LMC_CTL_CARDTYPE_LMC1000;
548 547
549 mii17 = lmc_mii_readreg (sc, 0, 17); 548 mii17 = lmc_mii_readreg(sc, 0, 17);
550 549
551 cable = (mii17 & LMC_MII17_SSI_CABLE_MASK) >> LMC_MII17_SSI_CABLE_SHIFT; 550 cable = (mii17 & LMC_MII17_SSI_CABLE_MASK) >> LMC_MII17_SSI_CABLE_SHIFT;
552 sc->ictl.cable_type = cable; 551 sc->ictl.cable_type = cable;
553 552
554 lmc_gpio_mkoutput (sc, LMC_GEP_SSI_TXCLOCK); 553 lmc_gpio_mkoutput(sc, LMC_GEP_SSI_TXCLOCK);
555} 554}
556 555
557static void 556static void
@@ -679,11 +678,11 @@ lmc_ssi_set_speed (lmc_softc_t * const sc, lmc_ctl_t * ctl)
679static int 678static int
680lmc_ssi_get_link_status (lmc_softc_t * const sc) 679lmc_ssi_get_link_status (lmc_softc_t * const sc)
681{ 680{
682 u_int16_t link_status; 681 u16 link_status;
683 u_int32_t ticks; 682 u_int32_t ticks;
684 int ret = 1; 683 int ret = 1;
685 int hw_hdsk = 1; 684 int hw_hdsk = 1;
686 685
687 /* 686 /*
688 * missing CTS? Hmm. If we require CTS on, we may never get the 687 * missing CTS? Hmm. If we require CTS on, we may never get the
689 * link to come up, so omit it in this test. 688 * link to come up, so omit it in this test.
@@ -718,9 +717,9 @@ lmc_ssi_get_link_status (lmc_softc_t * const sc)
718 } 717 }
719 else if (ticks == 0 ) { /* no clock found ? */ 718 else if (ticks == 0 ) { /* no clock found ? */
720 ret = 0; 719 ret = 0;
721 if(sc->last_led_err[3] != 1){ 720 if (sc->last_led_err[3] != 1) {
722 sc->stats.tx_lossOfClockCnt++; 721 sc->extra_stats.tx_lossOfClockCnt++;
723 printk(KERN_WARNING "%s: Lost Clock, Link Down\n", sc->name); 722 printk(KERN_WARNING "%s: Lost Clock, Link Down\n", sc->name);
724 } 723 }
725 sc->last_led_err[3] = 1; 724 sc->last_led_err[3] = 1;
726 lmc_led_on (sc, LMC_MII16_LED3); /* turn ON red LED */ 725 lmc_led_on (sc, LMC_MII16_LED3); /* turn ON red LED */
@@ -885,19 +884,13 @@ write_av9110 (lmc_softc_t * sc, u_int32_t n, u_int32_t m, u_int32_t v,
885 | LMC_GEP_SSI_GENERATOR)); 884 | LMC_GEP_SSI_GENERATOR));
886} 885}
887 886
888static void 887static void lmc_ssi_watchdog(lmc_softc_t * const sc)
889lmc_ssi_watchdog (lmc_softc_t * const sc)
890{ 888{
891 u_int16_t mii17 = lmc_mii_readreg (sc, 0, 17); 889 u16 mii17 = lmc_mii_readreg(sc, 0, 17);
892 if (((mii17 >> 3) & 7) == 7) 890 if (((mii17 >> 3) & 7) == 7)
893 { 891 lmc_led_off(sc, LMC_MII16_LED2);
894 lmc_led_off (sc, LMC_MII16_LED2); 892 else
895 } 893 lmc_led_on(sc, LMC_MII16_LED2);
896 else
897 {
898 lmc_led_on (sc, LMC_MII16_LED2);
899 }
900
901} 894}
902 895
903/* 896/*
@@ -927,7 +920,7 @@ lmc_t1_read (lmc_softc_t * const sc, int a)
927static void 920static void
928lmc_t1_init (lmc_softc_t * const sc) 921lmc_t1_init (lmc_softc_t * const sc)
929{ 922{
930 u_int16_t mii16; 923 u16 mii16;
931 int i; 924 int i;
932 925
933 sc->ictl.cardtype = LMC_CTL_CARDTYPE_LMC1200; 926 sc->ictl.cardtype = LMC_CTL_CARDTYPE_LMC1200;
@@ -1026,7 +1019,7 @@ lmc_t1_set_status (lmc_softc_t * const sc, lmc_ctl_t * ctl)
1026 */ static int 1019 */ static int
1027lmc_t1_get_link_status (lmc_softc_t * const sc) 1020lmc_t1_get_link_status (lmc_softc_t * const sc)
1028{ 1021{
1029 u_int16_t link_status; 1022 u16 link_status;
1030 int ret = 1; 1023 int ret = 1;
1031 1024
1032 /* LMC5245 (DS3) & LMC1200 (DS1) LED definitions 1025 /* LMC5245 (DS3) & LMC1200 (DS1) LED definitions