diff options
| author | Francois Romieu <romieu@fr.zoreil.com> | 2010-04-06 17:24:53 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-04-06 17:24:53 -0400 |
| commit | 3a7f8681ffb27bcc540fb74cda15e39c9395737b (patch) | |
| tree | fd05b93ccffc032d71c2026a1326a2584455e073 /drivers | |
| parent | 4cf46eaa5e46779d4e0a97f3f5c419cce1446bbe (diff) | |
via-velocity: remove private #define
Registers and their bits from mii.h. Courtesy from ed.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/via-velocity.c | 114 | ||||
| -rw-r--r-- | drivers/net/via-velocity.h | 77 |
2 files changed, 60 insertions, 131 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 91f3b841288c..078903f10f02 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
| @@ -719,30 +719,30 @@ static u32 mii_check_media_mode(struct mac_regs __iomem *regs) | |||
| 719 | u32 status = 0; | 719 | u32 status = 0; |
| 720 | u16 ANAR; | 720 | u16 ANAR; |
| 721 | 721 | ||
| 722 | if (!MII_REG_BITS_IS_ON(BMSR_LNK, MII_REG_BMSR, regs)) | 722 | if (!MII_REG_BITS_IS_ON(BMSR_LSTATUS, MII_BMSR, regs)) |
| 723 | status |= VELOCITY_LINK_FAIL; | 723 | status |= VELOCITY_LINK_FAIL; |
| 724 | 724 | ||
| 725 | if (MII_REG_BITS_IS_ON(G1000CR_1000FD, MII_REG_G1000CR, regs)) | 725 | if (MII_REG_BITS_IS_ON(ADVERTISE_1000FULL, MII_CTRL1000, regs)) |
| 726 | status |= VELOCITY_SPEED_1000 | VELOCITY_DUPLEX_FULL; | 726 | status |= VELOCITY_SPEED_1000 | VELOCITY_DUPLEX_FULL; |
| 727 | else if (MII_REG_BITS_IS_ON(G1000CR_1000, MII_REG_G1000CR, regs)) | 727 | else if (MII_REG_BITS_IS_ON(ADVERTISE_1000HALF, MII_CTRL1000, regs)) |
| 728 | status |= (VELOCITY_SPEED_1000); | 728 | status |= (VELOCITY_SPEED_1000); |
| 729 | else { | 729 | else { |
| 730 | velocity_mii_read(regs, MII_REG_ANAR, &ANAR); | 730 | velocity_mii_read(regs, MII_ADVERTISE, &ANAR); |
| 731 | if (ANAR & ANAR_TXFD) | 731 | if (ANAR & ADVERTISE_100FULL) |
| 732 | status |= (VELOCITY_SPEED_100 | VELOCITY_DUPLEX_FULL); | 732 | status |= (VELOCITY_SPEED_100 | VELOCITY_DUPLEX_FULL); |
| 733 | else if (ANAR & ANAR_TX) | 733 | else if (ANAR & ADVERTISE_100HALF) |
| 734 | status |= VELOCITY_SPEED_100; | 734 | status |= VELOCITY_SPEED_100; |
| 735 | else if (ANAR & ANAR_10FD) | 735 | else if (ANAR & ADVERTISE_10FULL) |
| 736 | status |= (VELOCITY_SPEED_10 | VELOCITY_DUPLEX_FULL); | 736 | status |= (VELOCITY_SPEED_10 | VELOCITY_DUPLEX_FULL); |
| 737 | else | 737 | else |
| 738 | status |= (VELOCITY_SPEED_10); | 738 | status |= (VELOCITY_SPEED_10); |
| 739 | } | 739 | } |
| 740 | 740 | ||
| 741 | if (MII_REG_BITS_IS_ON(BMCR_AUTO, MII_REG_BMCR, regs)) { | 741 | if (MII_REG_BITS_IS_ON(BMCR_ANENABLE, MII_BMCR, regs)) { |
| 742 | velocity_mii_read(regs, MII_REG_ANAR, &ANAR); | 742 | velocity_mii_read(regs, MII_ADVERTISE, &ANAR); |
| 743 | if ((ANAR & (ANAR_TXFD | ANAR_TX | ANAR_10FD | ANAR_10)) | 743 | if ((ANAR & (ADVERTISE_100FULL | ADVERTISE_100HALF | ADVERTISE_10FULL | ADVERTISE_10HALF)) |
| 744 | == (ANAR_TXFD | ANAR_TX | ANAR_10FD | ANAR_10)) { | 744 | == (ADVERTISE_100FULL | ADVERTISE_100HALF | ADVERTISE_10FULL | ADVERTISE_10HALF)) { |
| 745 | if (MII_REG_BITS_IS_ON(G1000CR_1000 | G1000CR_1000FD, MII_REG_G1000CR, regs)) | 745 | if (MII_REG_BITS_IS_ON(ADVERTISE_1000HALF | ADVERTISE_1000FULL, MII_CTRL1000, regs)) |
| 746 | status |= VELOCITY_AUTONEG_ENABLE; | 746 | status |= VELOCITY_AUTONEG_ENABLE; |
| 747 | } | 747 | } |
| 748 | } | 748 | } |
| @@ -801,23 +801,23 @@ static void set_mii_flow_control(struct velocity_info *vptr) | |||
| 801 | /*Enable or Disable PAUSE in ANAR */ | 801 | /*Enable or Disable PAUSE in ANAR */ |
| 802 | switch (vptr->options.flow_cntl) { | 802 | switch (vptr->options.flow_cntl) { |
| 803 | case FLOW_CNTL_TX: | 803 | case FLOW_CNTL_TX: |
| 804 | MII_REG_BITS_OFF(ANAR_PAUSE, MII_REG_ANAR, vptr->mac_regs); | 804 | MII_REG_BITS_OFF(ADVERTISE_PAUSE_CAP, MII_ADVERTISE, vptr->mac_regs); |
| 805 | MII_REG_BITS_ON(ANAR_ASMDIR, MII_REG_ANAR, vptr->mac_regs); | 805 | MII_REG_BITS_ON(ADVERTISE_PAUSE_ASYM, MII_ADVERTISE, vptr->mac_regs); |
| 806 | break; | 806 | break; |
| 807 | 807 | ||
| 808 | case FLOW_CNTL_RX: | 808 | case FLOW_CNTL_RX: |
| 809 | MII_REG_BITS_ON(ANAR_PAUSE, MII_REG_ANAR, vptr->mac_regs); | 809 | MII_REG_BITS_ON(ADVERTISE_PAUSE_CAP, MII_ADVERTISE, vptr->mac_regs); |
| 810 | MII_REG_BITS_ON(ANAR_ASMDIR, MII_REG_ANAR, vptr->mac_regs); | 810 | MII_REG_BITS_ON(ADVERTISE_PAUSE_ASYM, MII_ADVERTISE, vptr->mac_regs); |
| 811 | break; | 811 | break; |
| 812 | 812 | ||
| 813 | case FLOW_CNTL_TX_RX: | 813 | case FLOW_CNTL_TX_RX: |
| 814 | MII_REG_BITS_ON(ANAR_PAUSE, MII_REG_ANAR, vptr->mac_regs); | 814 | MII_REG_BITS_ON(ADVERTISE_PAUSE_CAP, MII_ADVERTISE, vptr->mac_regs); |
| 815 | MII_REG_BITS_ON(ANAR_ASMDIR, MII_REG_ANAR, vptr->mac_regs); | 815 | MII_REG_BITS_ON(ADVERTISE_PAUSE_ASYM, MII_ADVERTISE, vptr->mac_regs); |
| 816 | break; | 816 | break; |
| 817 | 817 | ||
| 818 | case FLOW_CNTL_DISABLE: | 818 | case FLOW_CNTL_DISABLE: |
| 819 | MII_REG_BITS_OFF(ANAR_PAUSE, MII_REG_ANAR, vptr->mac_regs); | 819 | MII_REG_BITS_OFF(ADVERTISE_PAUSE_CAP, MII_ADVERTISE, vptr->mac_regs); |
| 820 | MII_REG_BITS_OFF(ANAR_ASMDIR, MII_REG_ANAR, vptr->mac_regs); | 820 | MII_REG_BITS_OFF(ADVERTISE_PAUSE_ASYM, MII_ADVERTISE, vptr->mac_regs); |
| 821 | break; | 821 | break; |
| 822 | default: | 822 | default: |
| 823 | break; | 823 | break; |
| @@ -832,10 +832,10 @@ static void set_mii_flow_control(struct velocity_info *vptr) | |||
| 832 | */ | 832 | */ |
| 833 | static void mii_set_auto_on(struct velocity_info *vptr) | 833 | static void mii_set_auto_on(struct velocity_info *vptr) |
| 834 | { | 834 | { |
| 835 | if (MII_REG_BITS_IS_ON(BMCR_AUTO, MII_REG_BMCR, vptr->mac_regs)) | 835 | if (MII_REG_BITS_IS_ON(BMCR_ANENABLE, MII_BMCR, vptr->mac_regs)) |
| 836 | MII_REG_BITS_ON(BMCR_REAUTO, MII_REG_BMCR, vptr->mac_regs); | 836 | MII_REG_BITS_ON(BMCR_ANRESTART, MII_BMCR, vptr->mac_regs); |
| 837 | else | 837 | else |
| 838 | MII_REG_BITS_ON(BMCR_AUTO, MII_REG_BMCR, vptr->mac_regs); | 838 | MII_REG_BITS_ON(BMCR_ANENABLE, MII_BMCR, vptr->mac_regs); |
| 839 | } | 839 | } |
| 840 | 840 | ||
| 841 | static u32 check_connection_type(struct mac_regs __iomem *regs) | 841 | static u32 check_connection_type(struct mac_regs __iomem *regs) |
| @@ -860,11 +860,11 @@ static u32 check_connection_type(struct mac_regs __iomem *regs) | |||
| 860 | else | 860 | else |
| 861 | status |= VELOCITY_SPEED_100; | 861 | status |= VELOCITY_SPEED_100; |
| 862 | 862 | ||
| 863 | if (MII_REG_BITS_IS_ON(BMCR_AUTO, MII_REG_BMCR, regs)) { | 863 | if (MII_REG_BITS_IS_ON(BMCR_ANENABLE, MII_BMCR, regs)) { |
| 864 | velocity_mii_read(regs, MII_REG_ANAR, &ANAR); | 864 | velocity_mii_read(regs, MII_ADVERTISE, &ANAR); |
| 865 | if ((ANAR & (ANAR_TXFD | ANAR_TX | ANAR_10FD | ANAR_10)) | 865 | if ((ANAR & (ADVERTISE_100FULL | ADVERTISE_100HALF | ADVERTISE_10FULL | ADVERTISE_10HALF)) |
| 866 | == (ANAR_TXFD | ANAR_TX | ANAR_10FD | ANAR_10)) { | 866 | == (ADVERTISE_100FULL | ADVERTISE_100HALF | ADVERTISE_10FULL | ADVERTISE_10HALF)) { |
| 867 | if (MII_REG_BITS_IS_ON(G1000CR_1000 | G1000CR_1000FD, MII_REG_G1000CR, regs)) | 867 | if (MII_REG_BITS_IS_ON(ADVERTISE_1000HALF | ADVERTISE_1000FULL, MII_CTRL1000, regs)) |
| 868 | status |= VELOCITY_AUTONEG_ENABLE; | 868 | status |= VELOCITY_AUTONEG_ENABLE; |
| 869 | } | 869 | } |
| 870 | } | 870 | } |
| @@ -905,7 +905,7 @@ static int velocity_set_media_mode(struct velocity_info *vptr, u32 mii_status) | |||
| 905 | */ | 905 | */ |
| 906 | 906 | ||
| 907 | if (PHYID_GET_PHY_ID(vptr->phy_id) == PHYID_CICADA_CS8201) | 907 | if (PHYID_GET_PHY_ID(vptr->phy_id) == PHYID_CICADA_CS8201) |
| 908 | MII_REG_BITS_ON(AUXCR_MDPPS, MII_REG_AUXCR, vptr->mac_regs); | 908 | MII_REG_BITS_ON(AUXCR_MDPPS, MII_NCONFIG, vptr->mac_regs); |
| 909 | 909 | ||
| 910 | /* | 910 | /* |
| 911 | * If connection type is AUTO | 911 | * If connection type is AUTO |
| @@ -915,9 +915,9 @@ static int velocity_set_media_mode(struct velocity_info *vptr, u32 mii_status) | |||
| 915 | /* clear force MAC mode bit */ | 915 | /* clear force MAC mode bit */ |
| 916 | BYTE_REG_BITS_OFF(CHIPGCR_FCMODE, ®s->CHIPGCR); | 916 | BYTE_REG_BITS_OFF(CHIPGCR_FCMODE, ®s->CHIPGCR); |
| 917 | /* set duplex mode of MAC according to duplex mode of MII */ | 917 | /* set duplex mode of MAC according to duplex mode of MII */ |
| 918 | MII_REG_BITS_ON(ANAR_TXFD | ANAR_TX | ANAR_10FD | ANAR_10, MII_REG_ANAR, vptr->mac_regs); | 918 | MII_REG_BITS_ON(ADVERTISE_100FULL | ADVERTISE_100HALF | ADVERTISE_10FULL | ADVERTISE_10HALF, MII_ADVERTISE, vptr->mac_regs); |
| 919 | MII_REG_BITS_ON(G1000CR_1000FD | G1000CR_1000, MII_REG_G1000CR, vptr->mac_regs); | 919 | MII_REG_BITS_ON(ADVERTISE_1000FULL | ADVERTISE_1000HALF, MII_CTRL1000, vptr->mac_regs); |
| 920 | MII_REG_BITS_ON(BMCR_SPEED1G, MII_REG_BMCR, vptr->mac_regs); | 920 | MII_REG_BITS_ON(BMCR_SPEED1000, MII_BMCR, vptr->mac_regs); |
| 921 | 921 | ||
| 922 | /* enable AUTO-NEGO mode */ | 922 | /* enable AUTO-NEGO mode */ |
| 923 | mii_set_auto_on(vptr); | 923 | mii_set_auto_on(vptr); |
| @@ -952,31 +952,31 @@ static int velocity_set_media_mode(struct velocity_info *vptr, u32 mii_status) | |||
| 952 | BYTE_REG_BITS_ON(TCR_TB2BDIS, ®s->TCR); | 952 | BYTE_REG_BITS_ON(TCR_TB2BDIS, ®s->TCR); |
| 953 | } | 953 | } |
| 954 | 954 | ||
| 955 | MII_REG_BITS_OFF(G1000CR_1000FD | G1000CR_1000, MII_REG_G1000CR, vptr->mac_regs); | 955 | MII_REG_BITS_OFF(ADVERTISE_1000FULL | ADVERTISE_1000HALF, MII_CTRL1000, vptr->mac_regs); |
| 956 | 956 | ||
| 957 | if (!(mii_status & VELOCITY_DUPLEX_FULL) && (mii_status & VELOCITY_SPEED_10)) | 957 | if (!(mii_status & VELOCITY_DUPLEX_FULL) && (mii_status & VELOCITY_SPEED_10)) |
| 958 | BYTE_REG_BITS_OFF(TESTCFG_HBDIS, ®s->TESTCFG); | 958 | BYTE_REG_BITS_OFF(TESTCFG_HBDIS, ®s->TESTCFG); |
| 959 | else | 959 | else |
| 960 | BYTE_REG_BITS_ON(TESTCFG_HBDIS, ®s->TESTCFG); | 960 | BYTE_REG_BITS_ON(TESTCFG_HBDIS, ®s->TESTCFG); |
| 961 | 961 | ||
| 962 | /* MII_REG_BITS_OFF(BMCR_SPEED1G, MII_REG_BMCR, vptr->mac_regs); */ | 962 | /* MII_REG_BITS_OFF(BMCR_SPEED1000, MII_BMCR, vptr->mac_regs); */ |
| 963 | velocity_mii_read(vptr->mac_regs, MII_REG_ANAR, &ANAR); | 963 | velocity_mii_read(vptr->mac_regs, MII_ADVERTISE, &ANAR); |
| 964 | ANAR &= (~(ANAR_TXFD | ANAR_TX | ANAR_10FD | ANAR_10)); | 964 | ANAR &= (~(ADVERTISE_100FULL | ADVERTISE_100HALF | ADVERTISE_10FULL | ADVERTISE_10HALF)); |
| 965 | if (mii_status & VELOCITY_SPEED_100) { | 965 | if (mii_status & VELOCITY_SPEED_100) { |
| 966 | if (mii_status & VELOCITY_DUPLEX_FULL) | 966 | if (mii_status & VELOCITY_DUPLEX_FULL) |
| 967 | ANAR |= ANAR_TXFD; | 967 | ANAR |= ADVERTISE_100FULL; |
| 968 | else | 968 | else |
| 969 | ANAR |= ANAR_TX; | 969 | ANAR |= ADVERTISE_100HALF; |
| 970 | } else { | 970 | } else { |
| 971 | if (mii_status & VELOCITY_DUPLEX_FULL) | 971 | if (mii_status & VELOCITY_DUPLEX_FULL) |
| 972 | ANAR |= ANAR_10FD; | 972 | ANAR |= ADVERTISE_10FULL; |
| 973 | else | 973 | else |
| 974 | ANAR |= ANAR_10; | 974 | ANAR |= ADVERTISE_10HALF; |
| 975 | } | 975 | } |
| 976 | velocity_mii_write(vptr->mac_regs, MII_REG_ANAR, ANAR); | 976 | velocity_mii_write(vptr->mac_regs, MII_ADVERTISE, ANAR); |
| 977 | /* enable AUTO-NEGO mode */ | 977 | /* enable AUTO-NEGO mode */ |
| 978 | mii_set_auto_on(vptr); | 978 | mii_set_auto_on(vptr); |
| 979 | /* MII_REG_BITS_ON(BMCR_AUTO, MII_REG_BMCR, vptr->mac_regs); */ | 979 | /* MII_REG_BITS_ON(BMCR_ANENABLE, MII_BMCR, vptr->mac_regs); */ |
| 980 | } | 980 | } |
| 981 | /* vptr->mii_status=mii_check_media_mode(vptr->mac_regs); */ | 981 | /* vptr->mii_status=mii_check_media_mode(vptr->mac_regs); */ |
| 982 | /* vptr->mii_status=check_connection_type(vptr->mac_regs); */ | 982 | /* vptr->mii_status=check_connection_type(vptr->mac_regs); */ |
| @@ -1178,36 +1178,36 @@ static void mii_init(struct velocity_info *vptr, u32 mii_status) | |||
| 1178 | /* | 1178 | /* |
| 1179 | * Reset to hardware default | 1179 | * Reset to hardware default |
| 1180 | */ | 1180 | */ |
| 1181 | MII_REG_BITS_OFF((ANAR_ASMDIR | ANAR_PAUSE), MII_REG_ANAR, vptr->mac_regs); | 1181 | MII_REG_BITS_OFF((ADVERTISE_PAUSE_ASYM | ADVERTISE_PAUSE_CAP), MII_ADVERTISE, vptr->mac_regs); |
| 1182 | /* | 1182 | /* |
| 1183 | * Turn on ECHODIS bit in NWay-forced full mode and turn it | 1183 | * Turn on ECHODIS bit in NWay-forced full mode and turn it |
| 1184 | * off it in NWay-forced half mode for NWay-forced v.s. | 1184 | * off it in NWay-forced half mode for NWay-forced v.s. |
| 1185 | * legacy-forced issue. | 1185 | * legacy-forced issue. |
| 1186 | */ | 1186 | */ |
| 1187 | if (vptr->mii_status & VELOCITY_DUPLEX_FULL) | 1187 | if (vptr->mii_status & VELOCITY_DUPLEX_FULL) |
| 1188 | MII_REG_BITS_ON(TCSR_ECHODIS, MII_REG_TCSR, vptr->mac_regs); | 1188 | MII_REG_BITS_ON(TCSR_ECHODIS, MII_SREVISION, vptr->mac_regs); |
| 1189 | else | 1189 | else |
| 1190 | MII_REG_BITS_OFF(TCSR_ECHODIS, MII_REG_TCSR, vptr->mac_regs); | 1190 | MII_REG_BITS_OFF(TCSR_ECHODIS, MII_SREVISION, vptr->mac_regs); |
| 1191 | /* | 1191 | /* |
| 1192 | * Turn on Link/Activity LED enable bit for CIS8201 | 1192 | * Turn on Link/Activity LED enable bit for CIS8201 |
| 1193 | */ | 1193 | */ |
| 1194 | MII_REG_BITS_ON(PLED_LALBE, MII_REG_PLED, vptr->mac_regs); | 1194 | MII_REG_BITS_ON(PLED_LALBE, MII_TPISTATUS, vptr->mac_regs); |
| 1195 | break; | 1195 | break; |
| 1196 | case PHYID_VT3216_32BIT: | 1196 | case PHYID_VT3216_32BIT: |
| 1197 | case PHYID_VT3216_64BIT: | 1197 | case PHYID_VT3216_64BIT: |
| 1198 | /* | 1198 | /* |
| 1199 | * Reset to hardware default | 1199 | * Reset to hardware default |
| 1200 | */ | 1200 | */ |
| 1201 | MII_REG_BITS_ON((ANAR_ASMDIR | ANAR_PAUSE), MII_REG_ANAR, vptr->mac_regs); | 1201 | MII_REG_BITS_ON((ADVERTISE_PAUSE_ASYM | ADVERTISE_PAUSE_CAP), MII_ADVERTISE, vptr->mac_regs); |
| 1202 | /* | 1202 | /* |
| 1203 | * Turn on ECHODIS bit in NWay-forced full mode and turn it | 1203 | * Turn on ECHODIS bit in NWay-forced full mode and turn it |
| 1204 | * off it in NWay-forced half mode for NWay-forced v.s. | 1204 | * off it in NWay-forced half mode for NWay-forced v.s. |
| 1205 | * legacy-forced issue | 1205 | * legacy-forced issue |
| 1206 | */ | 1206 | */ |
| 1207 | if (vptr->mii_status & VELOCITY_DUPLEX_FULL) | 1207 | if (vptr->mii_status & VELOCITY_DUPLEX_FULL) |
| 1208 | MII_REG_BITS_ON(TCSR_ECHODIS, MII_REG_TCSR, vptr->mac_regs); | 1208 | MII_REG_BITS_ON(TCSR_ECHODIS, MII_SREVISION, vptr->mac_regs); |
| 1209 | else | 1209 | else |
| 1210 | MII_REG_BITS_OFF(TCSR_ECHODIS, MII_REG_TCSR, vptr->mac_regs); | 1210 | MII_REG_BITS_OFF(TCSR_ECHODIS, MII_SREVISION, vptr->mac_regs); |
| 1211 | break; | 1211 | break; |
| 1212 | 1212 | ||
| 1213 | case PHYID_MARVELL_1000: | 1213 | case PHYID_MARVELL_1000: |
| @@ -1219,15 +1219,15 @@ static void mii_init(struct velocity_info *vptr, u32 mii_status) | |||
| 1219 | /* | 1219 | /* |
| 1220 | * Reset to hardware default | 1220 | * Reset to hardware default |
| 1221 | */ | 1221 | */ |
| 1222 | MII_REG_BITS_ON((ANAR_ASMDIR | ANAR_PAUSE), MII_REG_ANAR, vptr->mac_regs); | 1222 | MII_REG_BITS_ON((ADVERTISE_PAUSE_ASYM | ADVERTISE_PAUSE_CAP), MII_ADVERTISE, vptr->mac_regs); |
| 1223 | break; | 1223 | break; |
| 1224 | default: | 1224 | default: |
| 1225 | ; | 1225 | ; |
| 1226 | } | 1226 | } |
| 1227 | velocity_mii_read(vptr->mac_regs, MII_REG_BMCR, &BMCR); | 1227 | velocity_mii_read(vptr->mac_regs, MII_BMCR, &BMCR); |
| 1228 | if (BMCR & BMCR_ISO) { | 1228 | if (BMCR & BMCR_ISOLATE) { |
| 1229 | BMCR &= ~BMCR_ISO; | 1229 | BMCR &= ~BMCR_ISOLATE; |
| 1230 | velocity_mii_write(vptr->mac_regs, MII_REG_BMCR, BMCR); | 1230 | velocity_mii_write(vptr->mac_regs, MII_BMCR, BMCR); |
| 1231 | } | 1231 | } |
| 1232 | } | 1232 | } |
| 1233 | 1233 | ||
| @@ -2953,13 +2953,13 @@ static int velocity_set_wol(struct velocity_info *vptr) | |||
| 2953 | 2953 | ||
| 2954 | if (vptr->mii_status & VELOCITY_AUTONEG_ENABLE) { | 2954 | if (vptr->mii_status & VELOCITY_AUTONEG_ENABLE) { |
| 2955 | if (PHYID_GET_PHY_ID(vptr->phy_id) == PHYID_CICADA_CS8201) | 2955 | if (PHYID_GET_PHY_ID(vptr->phy_id) == PHYID_CICADA_CS8201) |
| 2956 | MII_REG_BITS_ON(AUXCR_MDPPS, MII_REG_AUXCR, vptr->mac_regs); | 2956 | MII_REG_BITS_ON(AUXCR_MDPPS, MII_NCONFIG, vptr->mac_regs); |
| 2957 | 2957 | ||
| 2958 | MII_REG_BITS_OFF(G1000CR_1000FD | G1000CR_1000, MII_REG_G1000CR, vptr->mac_regs); | 2958 | MII_REG_BITS_OFF(ADVERTISE_1000FULL | ADVERTISE_1000HALF, MII_CTRL1000, vptr->mac_regs); |
| 2959 | } | 2959 | } |
| 2960 | 2960 | ||
| 2961 | if (vptr->mii_status & VELOCITY_SPEED_1000) | 2961 | if (vptr->mii_status & VELOCITY_SPEED_1000) |
| 2962 | MII_REG_BITS_ON(BMCR_REAUTO, MII_REG_BMCR, vptr->mac_regs); | 2962 | MII_REG_BITS_ON(BMCR_ANRESTART, MII_BMCR, vptr->mac_regs); |
| 2963 | 2963 | ||
| 2964 | BYTE_REG_BITS_ON(CHIPGCR_FCMODE, ®s->CHIPGCR); | 2964 | BYTE_REG_BITS_ON(CHIPGCR_FCMODE, ®s->CHIPGCR); |
| 2965 | 2965 | ||
diff --git a/drivers/net/via-velocity.h b/drivers/net/via-velocity.h index ef4a0f64ba16..c38191179fae 100644 --- a/drivers/net/via-velocity.h +++ b/drivers/net/via-velocity.h | |||
| @@ -1240,86 +1240,16 @@ struct velocity_context { | |||
| 1240 | u32 pattern[8]; | 1240 | u32 pattern[8]; |
| 1241 | }; | 1241 | }; |
| 1242 | 1242 | ||
| 1243 | |||
| 1244 | /* | ||
| 1245 | * MII registers. | ||
| 1246 | */ | ||
| 1247 | |||
| 1248 | |||
| 1249 | /* | 1243 | /* |
| 1250 | * Registers in the MII (offset unit is WORD) | 1244 | * Registers in the MII (offset unit is WORD) |
| 1251 | */ | 1245 | */ |
| 1252 | 1246 | ||
| 1253 | #define MII_REG_BMCR 0x00 // physical address | ||
| 1254 | #define MII_REG_BMSR 0x01 // | ||
| 1255 | #define MII_REG_PHYID1 0x02 // OUI | ||
| 1256 | #define MII_REG_PHYID2 0x03 // OUI + Module ID + REV ID | ||
| 1257 | #define MII_REG_ANAR 0x04 // | ||
| 1258 | #define MII_REG_ANLPAR 0x05 // | ||
| 1259 | #define MII_REG_G1000CR 0x09 // | ||
| 1260 | #define MII_REG_G1000SR 0x0A // | ||
| 1261 | #define MII_REG_MODCFG 0x10 // | ||
| 1262 | #define MII_REG_TCSR 0x16 // | ||
| 1263 | #define MII_REG_PLED 0x1B // | ||
| 1264 | // NS, MYSON only | ||
| 1265 | #define MII_REG_PCR 0x17 // | ||
| 1266 | // ESI only | ||
| 1267 | #define MII_REG_PCSR 0x17 // | ||
| 1268 | #define MII_REG_AUXCR 0x1C // | ||
| 1269 | |||
| 1270 | // Marvell 88E1000/88E1000S | 1247 | // Marvell 88E1000/88E1000S |
| 1271 | #define MII_REG_PSCR 0x10 // PHY specific control register | 1248 | #define MII_REG_PSCR 0x10 // PHY specific control register |
| 1272 | 1249 | ||
| 1273 | // | 1250 | // |
| 1274 | // Bits in the BMCR register | 1251 | // Bits in the Silicon revision register |
| 1275 | // | ||
| 1276 | #define BMCR_RESET 0x8000 // | ||
| 1277 | #define BMCR_LBK 0x4000 // | ||
| 1278 | #define BMCR_SPEED100 0x2000 // | ||
| 1279 | #define BMCR_AUTO 0x1000 // | ||
| 1280 | #define BMCR_PD 0x0800 // | ||
| 1281 | #define BMCR_ISO 0x0400 // | ||
| 1282 | #define BMCR_REAUTO 0x0200 // | ||
| 1283 | #define BMCR_FDX 0x0100 // | ||
| 1284 | #define BMCR_SPEED1G 0x0040 // | ||
| 1285 | // | ||
| 1286 | // Bits in the BMSR register | ||
| 1287 | // | ||
| 1288 | #define BMSR_AUTOCM 0x0020 // | ||
| 1289 | #define BMSR_LNK 0x0004 // | ||
| 1290 | |||
| 1291 | // | ||
| 1292 | // Bits in the ANAR register | ||
| 1293 | // | ||
| 1294 | #define ANAR_ASMDIR 0x0800 // Asymmetric PAUSE support | ||
| 1295 | #define ANAR_PAUSE 0x0400 // Symmetric PAUSE Support | ||
| 1296 | #define ANAR_T4 0x0200 // | ||
| 1297 | #define ANAR_TXFD 0x0100 // | ||
| 1298 | #define ANAR_TX 0x0080 // | ||
| 1299 | #define ANAR_10FD 0x0040 // | ||
| 1300 | #define ANAR_10 0x0020 // | ||
| 1301 | // | ||
| 1302 | // Bits in the ANLPAR register | ||
| 1303 | // | ||
| 1304 | #define ANLPAR_ASMDIR 0x0800 // Asymmetric PAUSE support | ||
| 1305 | #define ANLPAR_PAUSE 0x0400 // Symmetric PAUSE Support | ||
| 1306 | #define ANLPAR_T4 0x0200 // | ||
| 1307 | #define ANLPAR_TXFD 0x0100 // | ||
| 1308 | #define ANLPAR_TX 0x0080 // | ||
| 1309 | #define ANLPAR_10FD 0x0040 // | ||
| 1310 | #define ANLPAR_10 0x0020 // | ||
| 1311 | |||
| 1312 | // | ||
| 1313 | // Bits in the G1000CR register | ||
| 1314 | // | ||
| 1315 | #define G1000CR_1000FD 0x0200 // PHY is 1000-T Full-duplex capable | ||
| 1316 | #define G1000CR_1000 0x0100 // PHY is 1000-T Half-duplex capable | ||
| 1317 | |||
| 1318 | // | ||
| 1319 | // Bits in the G1000SR register | ||
| 1320 | // | 1252 | // |
| 1321 | #define G1000SR_1000FD 0x0800 // LP PHY is 1000-T Full-duplex capable | ||
| 1322 | #define G1000SR_1000 0x0400 // LP PHY is 1000-T Half-duplex capable | ||
| 1323 | 1253 | ||
| 1324 | #define TCSR_ECHODIS 0x2000 // | 1254 | #define TCSR_ECHODIS 0x2000 // |
| 1325 | #define AUXCR_MDPPS 0x0004 // | 1255 | #define AUXCR_MDPPS 0x0004 // |
| @@ -1338,7 +1268,6 @@ struct velocity_context { | |||
| 1338 | 1268 | ||
| 1339 | #define PHYID_REV_ID_MASK 0x0000000FUL | 1269 | #define PHYID_REV_ID_MASK 0x0000000FUL |
| 1340 | 1270 | ||
| 1341 | #define PHYID_GET_PHY_REV_ID(i) ((i) & PHYID_REV_ID_MASK) | ||
| 1342 | #define PHYID_GET_PHY_ID(i) ((i) & ~PHYID_REV_ID_MASK) | 1271 | #define PHYID_GET_PHY_ID(i) ((i) & ~PHYID_REV_ID_MASK) |
| 1343 | 1272 | ||
| 1344 | #define MII_REG_BITS_ON(x,i,p) do {\ | 1273 | #define MII_REG_BITS_ON(x,i,p) do {\ |
| @@ -1362,8 +1291,8 @@ struct velocity_context { | |||
| 1362 | 1291 | ||
| 1363 | #define MII_GET_PHY_ID(p) ({\ | 1292 | #define MII_GET_PHY_ID(p) ({\ |
| 1364 | u32 id;\ | 1293 | u32 id;\ |
| 1365 | velocity_mii_read((p),MII_REG_PHYID2,(u16 *) &id);\ | 1294 | velocity_mii_read((p),MII_PHYSID2,(u16 *) &id);\ |
| 1366 | velocity_mii_read((p),MII_REG_PHYID1,((u16 *) &id)+1);\ | 1295 | velocity_mii_read((p),MII_PHYSID1,((u16 *) &id)+1);\ |
| 1367 | (id);}) | 1296 | (id);}) |
| 1368 | 1297 | ||
| 1369 | /* | 1298 | /* |
