aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2009-06-03 02:19:15 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-04 00:01:50 -0400
commit56c8f140719e6f62836fb645d3fd96c6289907fb (patch)
tree61184388d435bc01b0f061d370a780634b2361e3 /drivers/net/cxgb3
parent6ba5f9c74365263db161941b1e7467cdba06a5fe (diff)
cxgb3: minor aq100x phy fixes
Use generic MDIO generic values. Based on Ben Hutchings'review comments. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb3')
-rw-r--r--drivers/net/cxgb3/aq100x.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/net/cxgb3/aq100x.c b/drivers/net/cxgb3/aq100x.c
index c51e50d925d0..b1fd5bf836e4 100644
--- a/drivers/net/cxgb3/aq100x.c
+++ b/drivers/net/cxgb3/aq100x.c
@@ -43,8 +43,6 @@ enum {
43 AQ_XAUI_TX_CFG = 0xe400, 43 AQ_XAUI_TX_CFG = 0xe400,
44 44
45 /* MDIO_DEV_ANEG registers */ 45 /* MDIO_DEV_ANEG registers */
46 AQ_100M_CTRL = 0x0010,
47 AQ_10G_CTRL = 0x0020,
48 AQ_1G_CTRL = 0xc400, 46 AQ_1G_CTRL = 0xc400,
49 AQ_ANEG_STAT = 0xc800, 47 AQ_ANEG_STAT = 0xc800,
50 48
@@ -54,14 +52,15 @@ enum {
54 AQ_IMASK_GLOBAL = 0xff00, 52 AQ_IMASK_GLOBAL = 0xff00,
55}; 53};
56 54
57#define AQBIT(x) (1 << (x)) 55enum {
58#define IMASK_PMA AQBIT(0x2) 56 IMASK_PMA = 1 << 2,
59#define IMASK_GLOBAL AQBIT(0xf) 57 IMASK_GLOBAL = 1 << 15,
60#define ADV_1G_FULL AQBIT(0xf) 58 ADV_1G_FULL = 1 << 15,
61#define ADV_1G_HALF AQBIT(0xe) 59 ADV_1G_HALF = 1 << 14,
62#define ADV_10G_FULL AQBIT(0xc) 60 ADV_10G_FULL = 1 << 12,
63#define AQ_RESET (AQBIT(0xe) | AQBIT(0xf)) 61 AQ_RESET = (1 << 14) | (1 << 15),
64#define AQ_LOWPOWER AQBIT(0xb) 62 AQ_LOWPOWER = 1 << 12,
63};
65 64
66static int aq100x_reset(struct cphy *phy, int wait) 65static int aq100x_reset(struct cphy *phy, int wait)
67{ 66{
@@ -160,7 +159,7 @@ static int aq100x_advertise(struct cphy *phy, unsigned int advertise_map)
160 adv = 0; 159 adv = 0;
161 if (advertise_map & ADVERTISED_10000baseT_Full) 160 if (advertise_map & ADVERTISED_10000baseT_Full)
162 adv |= ADV_10G_FULL; 161 adv |= ADV_10G_FULL;
163 err = t3_mdio_change_bits(phy, MDIO_MMD_AN, AQ_10G_CTRL, 162 err = t3_mdio_change_bits(phy, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
164 ADV_10G_FULL, adv); 163 ADV_10G_FULL, adv);
165 if (err) 164 if (err)
166 return err; 165 return err;
@@ -186,7 +185,8 @@ static int aq100x_advertise(struct cphy *phy, unsigned int advertise_map)
186 adv |= ADVERTISE_PAUSE_CAP; 185 adv |= ADVERTISE_PAUSE_CAP;
187 if (advertise_map & ADVERTISED_Asym_Pause) 186 if (advertise_map & ADVERTISED_Asym_Pause)
188 adv |= ADVERTISE_PAUSE_ASYM; 187 adv |= ADVERTISE_PAUSE_ASYM;
189 err = t3_mdio_change_bits(phy, MDIO_MMD_AN, AQ_100M_CTRL, 0xfe0, adv); 188 err = t3_mdio_change_bits(phy, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
189 0xfe0, adv);
190 190
191 return err; 191 return err;
192} 192}