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>
This commit is contained in:
Divy Le Ray 2009-06-03 06:19:15 +00:00 committed by David S. Miller
parent 6ba5f9c743
commit 56c8f14071

View File

@ -43,8 +43,6 @@ enum {
AQ_XAUI_TX_CFG = 0xe400, AQ_XAUI_TX_CFG = 0xe400,
/* MDIO_DEV_ANEG registers */ /* MDIO_DEV_ANEG registers */
AQ_100M_CTRL = 0x0010,
AQ_10G_CTRL = 0x0020,
AQ_1G_CTRL = 0xc400, AQ_1G_CTRL = 0xc400,
AQ_ANEG_STAT = 0xc800, AQ_ANEG_STAT = 0xc800,
@ -54,14 +52,15 @@ enum {
AQ_IMASK_GLOBAL = 0xff00, AQ_IMASK_GLOBAL = 0xff00,
}; };
#define AQBIT(x) (1 << (x)) enum {
#define IMASK_PMA AQBIT(0x2) IMASK_PMA = 1 << 2,
#define IMASK_GLOBAL AQBIT(0xf) IMASK_GLOBAL = 1 << 15,
#define ADV_1G_FULL AQBIT(0xf) ADV_1G_FULL = 1 << 15,
#define ADV_1G_HALF AQBIT(0xe) ADV_1G_HALF = 1 << 14,
#define ADV_10G_FULL AQBIT(0xc) ADV_10G_FULL = 1 << 12,
#define AQ_RESET (AQBIT(0xe) | AQBIT(0xf)) AQ_RESET = (1 << 14) | (1 << 15),
#define AQ_LOWPOWER AQBIT(0xb) AQ_LOWPOWER = 1 << 12,
};
static int aq100x_reset(struct cphy *phy, int wait) static int aq100x_reset(struct cphy *phy, int wait)
{ {
@ -160,7 +159,7 @@ static int aq100x_advertise(struct cphy *phy, unsigned int advertise_map)
adv = 0; adv = 0;
if (advertise_map & ADVERTISED_10000baseT_Full) if (advertise_map & ADVERTISED_10000baseT_Full)
adv |= ADV_10G_FULL; adv |= ADV_10G_FULL;
err = t3_mdio_change_bits(phy, MDIO_MMD_AN, AQ_10G_CTRL, err = t3_mdio_change_bits(phy, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
ADV_10G_FULL, adv); ADV_10G_FULL, adv);
if (err) if (err)
return err; return err;
@ -186,7 +185,8 @@ static int aq100x_advertise(struct cphy *phy, unsigned int advertise_map)
adv |= ADVERTISE_PAUSE_CAP; adv |= ADVERTISE_PAUSE_CAP;
if (advertise_map & ADVERTISED_Asym_Pause) if (advertise_map & ADVERTISED_Asym_Pause)
adv |= ADVERTISE_PAUSE_ASYM; adv |= ADVERTISE_PAUSE_ASYM;
err = t3_mdio_change_bits(phy, MDIO_MMD_AN, AQ_100M_CTRL, 0xfe0, adv); err = t3_mdio_change_bits(phy, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
0xfe0, adv);
return err; return err;
} }