diff options
Diffstat (limited to 'drivers/net/wan/lmc/lmc_media.c')
-rw-r--r-- | drivers/net/wan/lmc/lmc_media.c | 66 |
1 files changed, 27 insertions, 39 deletions
diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c index 8aa461c941ce..f327674fc93a 100644 --- a/drivers/net/wan/lmc/lmc_media.c +++ b/drivers/net/wan/lmc/lmc_media.c | |||
@@ -16,8 +16,6 @@ | |||
16 | #include <linux/inet.h> | 16 | #include <linux/inet.h> |
17 | #include <linux/bitops.h> | 17 | #include <linux/bitops.h> |
18 | 18 | ||
19 | #include <net/syncppp.h> | ||
20 | |||
21 | #include <asm/processor.h> /* Processor type for cache alignment. */ | 19 | #include <asm/processor.h> /* Processor type for cache alignment. */ |
22 | #include <asm/io.h> | 20 | #include <asm/io.h> |
23 | #include <asm/dma.h> | 21 | #include <asm/dma.h> |
@@ -95,8 +93,7 @@ static void lmc_dummy_set_1 (lmc_softc_t * const, int); | |||
95 | static void lmc_dummy_set2_1 (lmc_softc_t * const, lmc_ctl_t *); | 93 | static void lmc_dummy_set2_1 (lmc_softc_t * const, lmc_ctl_t *); |
96 | 94 | ||
97 | static inline void write_av9110_bit (lmc_softc_t *, int); | 95 | static inline void write_av9110_bit (lmc_softc_t *, int); |
98 | static void write_av9110 (lmc_softc_t *, u_int32_t, u_int32_t, u_int32_t, | 96 | static void write_av9110(lmc_softc_t *, u32, u32, u32, u32, u32); |
99 | u_int32_t, u_int32_t); | ||
100 | 97 | ||
101 | lmc_media_t lmc_ds3_media = { | 98 | lmc_media_t lmc_ds3_media = { |
102 | lmc_ds3_init, /* special media init stuff */ | 99 | lmc_ds3_init, /* special media init stuff */ |
@@ -427,7 +424,7 @@ lmc_ds3_set_scram (lmc_softc_t * const sc, int ie) | |||
427 | static int | 424 | static int |
428 | lmc_ds3_get_link_status (lmc_softc_t * const sc) | 425 | lmc_ds3_get_link_status (lmc_softc_t * const sc) |
429 | { | 426 | { |
430 | u_int16_t link_status, link_status_11; | 427 | u16 link_status, link_status_11; |
431 | int ret = 1; | 428 | int ret = 1; |
432 | 429 | ||
433 | lmc_mii_writereg (sc, 0, 17, 7); | 430 | lmc_mii_writereg (sc, 0, 17, 7); |
@@ -449,7 +446,7 @@ lmc_ds3_get_link_status (lmc_softc_t * const sc) | |||
449 | (link_status & LMC_FRAMER_REG0_OOFS)){ | 446 | (link_status & LMC_FRAMER_REG0_OOFS)){ |
450 | ret = 0; | 447 | ret = 0; |
451 | if(sc->last_led_err[3] != 1){ | 448 | if(sc->last_led_err[3] != 1){ |
452 | u16 r1; | 449 | u16 r1; |
453 | lmc_mii_writereg (sc, 0, 17, 01); /* Turn on Xbit error as our cisco does */ | 450 | lmc_mii_writereg (sc, 0, 17, 01); /* Turn on Xbit error as our cisco does */ |
454 | r1 = lmc_mii_readreg (sc, 0, 18); | 451 | r1 = lmc_mii_readreg (sc, 0, 18); |
455 | r1 &= 0xfe; | 452 | r1 &= 0xfe; |
@@ -462,7 +459,7 @@ lmc_ds3_get_link_status (lmc_softc_t * const sc) | |||
462 | else { | 459 | else { |
463 | lmc_led_off(sc, LMC_DS3_LED3); /* turn on red LED */ | 460 | lmc_led_off(sc, LMC_DS3_LED3); /* turn on red LED */ |
464 | if(sc->last_led_err[3] == 1){ | 461 | if(sc->last_led_err[3] == 1){ |
465 | u16 r1; | 462 | u16 r1; |
466 | lmc_mii_writereg (sc, 0, 17, 01); /* Turn off Xbit error */ | 463 | lmc_mii_writereg (sc, 0, 17, 01); /* Turn off Xbit error */ |
467 | r1 = lmc_mii_readreg (sc, 0, 18); | 464 | r1 = lmc_mii_readreg (sc, 0, 18); |
468 | r1 |= 0x01; | 465 | r1 |= 0x01; |
@@ -540,20 +537,19 @@ lmc_ds3_watchdog (lmc_softc_t * const sc) | |||
540 | * SSI methods | 537 | * SSI methods |
541 | */ | 538 | */ |
542 | 539 | ||
543 | static void | 540 | static void lmc_ssi_init(lmc_softc_t * const sc) |
544 | lmc_ssi_init (lmc_softc_t * const sc) | ||
545 | { | 541 | { |
546 | u_int16_t mii17; | 542 | u16 mii17; |
547 | int cable; | 543 | int cable; |
548 | 544 | ||
549 | sc->ictl.cardtype = LMC_CTL_CARDTYPE_LMC1000; | 545 | sc->ictl.cardtype = LMC_CTL_CARDTYPE_LMC1000; |
550 | 546 | ||
551 | mii17 = lmc_mii_readreg (sc, 0, 17); | 547 | mii17 = lmc_mii_readreg(sc, 0, 17); |
552 | 548 | ||
553 | cable = (mii17 & LMC_MII17_SSI_CABLE_MASK) >> LMC_MII17_SSI_CABLE_SHIFT; | 549 | cable = (mii17 & LMC_MII17_SSI_CABLE_MASK) >> LMC_MII17_SSI_CABLE_SHIFT; |
554 | sc->ictl.cable_type = cable; | 550 | sc->ictl.cable_type = cable; |
555 | 551 | ||
556 | lmc_gpio_mkoutput (sc, LMC_GEP_SSI_TXCLOCK); | 552 | lmc_gpio_mkoutput(sc, LMC_GEP_SSI_TXCLOCK); |
557 | } | 553 | } |
558 | 554 | ||
559 | static void | 555 | static void |
@@ -681,11 +677,11 @@ lmc_ssi_set_speed (lmc_softc_t * const sc, lmc_ctl_t * ctl) | |||
681 | static int | 677 | static int |
682 | lmc_ssi_get_link_status (lmc_softc_t * const sc) | 678 | lmc_ssi_get_link_status (lmc_softc_t * const sc) |
683 | { | 679 | { |
684 | u_int16_t link_status; | 680 | u16 link_status; |
685 | u_int32_t ticks; | 681 | u32 ticks; |
686 | int ret = 1; | 682 | int ret = 1; |
687 | int hw_hdsk = 1; | 683 | int hw_hdsk = 1; |
688 | 684 | ||
689 | /* | 685 | /* |
690 | * missing CTS? Hmm. If we require CTS on, we may never get the | 686 | * missing CTS? Hmm. If we require CTS on, we may never get the |
691 | * link to come up, so omit it in this test. | 687 | * link to come up, so omit it in this test. |
@@ -720,9 +716,9 @@ lmc_ssi_get_link_status (lmc_softc_t * const sc) | |||
720 | } | 716 | } |
721 | else if (ticks == 0 ) { /* no clock found ? */ | 717 | else if (ticks == 0 ) { /* no clock found ? */ |
722 | ret = 0; | 718 | ret = 0; |
723 | if(sc->last_led_err[3] != 1){ | 719 | if (sc->last_led_err[3] != 1) { |
724 | sc->stats.tx_lossOfClockCnt++; | 720 | sc->extra_stats.tx_lossOfClockCnt++; |
725 | printk(KERN_WARNING "%s: Lost Clock, Link Down\n", sc->name); | 721 | printk(KERN_WARNING "%s: Lost Clock, Link Down\n", sc->name); |
726 | } | 722 | } |
727 | sc->last_led_err[3] = 1; | 723 | sc->last_led_err[3] = 1; |
728 | lmc_led_on (sc, LMC_MII16_LED3); /* turn ON red LED */ | 724 | lmc_led_on (sc, LMC_MII16_LED3); /* turn ON red LED */ |
@@ -838,9 +834,7 @@ write_av9110_bit (lmc_softc_t * sc, int c) | |||
838 | LMC_CSR_WRITE (sc, csr_gp, sc->lmc_gpio); | 834 | LMC_CSR_WRITE (sc, csr_gp, sc->lmc_gpio); |
839 | } | 835 | } |
840 | 836 | ||
841 | static void | 837 | static void write_av9110(lmc_softc_t *sc, u32 n, u32 m, u32 v, u32 x, u32 r) |
842 | write_av9110 (lmc_softc_t * sc, u_int32_t n, u_int32_t m, u_int32_t v, | ||
843 | u_int32_t x, u_int32_t r) | ||
844 | { | 838 | { |
845 | int i; | 839 | int i; |
846 | 840 | ||
@@ -887,19 +881,13 @@ write_av9110 (lmc_softc_t * sc, u_int32_t n, u_int32_t m, u_int32_t v, | |||
887 | | LMC_GEP_SSI_GENERATOR)); | 881 | | LMC_GEP_SSI_GENERATOR)); |
888 | } | 882 | } |
889 | 883 | ||
890 | static void | 884 | static void lmc_ssi_watchdog(lmc_softc_t * const sc) |
891 | lmc_ssi_watchdog (lmc_softc_t * const sc) | ||
892 | { | 885 | { |
893 | u_int16_t mii17 = lmc_mii_readreg (sc, 0, 17); | 886 | u16 mii17 = lmc_mii_readreg(sc, 0, 17); |
894 | if (((mii17 >> 3) & 7) == 7) | 887 | if (((mii17 >> 3) & 7) == 7) |
895 | { | 888 | lmc_led_off(sc, LMC_MII16_LED2); |
896 | lmc_led_off (sc, LMC_MII16_LED2); | 889 | else |
897 | } | 890 | lmc_led_on(sc, LMC_MII16_LED2); |
898 | else | ||
899 | { | ||
900 | lmc_led_on (sc, LMC_MII16_LED2); | ||
901 | } | ||
902 | |||
903 | } | 891 | } |
904 | 892 | ||
905 | /* | 893 | /* |
@@ -929,7 +917,7 @@ lmc_t1_read (lmc_softc_t * const sc, int a) | |||
929 | static void | 917 | static void |
930 | lmc_t1_init (lmc_softc_t * const sc) | 918 | lmc_t1_init (lmc_softc_t * const sc) |
931 | { | 919 | { |
932 | u_int16_t mii16; | 920 | u16 mii16; |
933 | int i; | 921 | int i; |
934 | 922 | ||
935 | sc->ictl.cardtype = LMC_CTL_CARDTYPE_LMC1200; | 923 | sc->ictl.cardtype = LMC_CTL_CARDTYPE_LMC1200; |
@@ -1028,7 +1016,7 @@ lmc_t1_set_status (lmc_softc_t * const sc, lmc_ctl_t * ctl) | |||
1028 | */ static int | 1016 | */ static int |
1029 | lmc_t1_get_link_status (lmc_softc_t * const sc) | 1017 | lmc_t1_get_link_status (lmc_softc_t * const sc) |
1030 | { | 1018 | { |
1031 | u_int16_t link_status; | 1019 | u16 link_status; |
1032 | int ret = 1; | 1020 | int ret = 1; |
1033 | 1021 | ||
1034 | /* LMC5245 (DS3) & LMC1200 (DS1) LED definitions | 1022 | /* LMC5245 (DS3) & LMC1200 (DS1) LED definitions |