X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Fnet%2Fcxgb3%2Faq100x.c;h=341b7ef1508f241d1ad358ed004a947877761846;hb=08562cb27da6a1472be15898173105b46801a73b;hp=c51e50d925d0239df0213c39787ebea76b3e2af0;hpb=f22a563b0a4c2a84b6ff8831306532b64c9c1747;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/net/cxgb3/aq100x.c b/drivers/net/cxgb3/aq100x.c index c51e50d..341b7ef 100644 --- a/drivers/net/cxgb3/aq100x.c +++ b/drivers/net/cxgb3/aq100x.c @@ -43,8 +43,6 @@ enum { AQ_XAUI_TX_CFG = 0xe400, /* MDIO_DEV_ANEG registers */ - AQ_100M_CTRL = 0x0010, - AQ_10G_CTRL = 0x0020, AQ_1G_CTRL = 0xc400, AQ_ANEG_STAT = 0xc800, @@ -54,14 +52,15 @@ enum { AQ_IMASK_GLOBAL = 0xff00, }; -#define AQBIT(x) (1 << (x)) -#define IMASK_PMA AQBIT(0x2) -#define IMASK_GLOBAL AQBIT(0xf) -#define ADV_1G_FULL AQBIT(0xf) -#define ADV_1G_HALF AQBIT(0xe) -#define ADV_10G_FULL AQBIT(0xc) -#define AQ_RESET (AQBIT(0xe) | AQBIT(0xf)) -#define AQ_LOWPOWER AQBIT(0xb) +enum { + IMASK_PMA = 1 << 2, + IMASK_GLOBAL = 1 << 15, + ADV_1G_FULL = 1 << 15, + ADV_1G_HALF = 1 << 14, + ADV_10G_FULL = 1 << 12, + AQ_RESET = (1 << 14) | (1 << 15), + AQ_LOWPOWER = 1 << 12, +}; 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; if (advertise_map & ADVERTISED_10000baseT_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); if (err) return err; @@ -186,7 +185,8 @@ static int aq100x_advertise(struct cphy *phy, unsigned int advertise_map) adv |= ADVERTISE_PAUSE_CAP; if (advertise_map & ADVERTISED_Asym_Pause) 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; } @@ -271,7 +271,8 @@ int t3_aq100x_phy_prep(struct cphy *phy, struct adapter *adapter, int phy_addr, cphy_init(phy, adapter, phy_addr, &aq100x_ops, mdio_ops, SUPPORTED_1000baseT_Full | SUPPORTED_10000baseT_Full | - SUPPORTED_Autoneg | SUPPORTED_AUI, "1000/10GBASE-T"); + SUPPORTED_TP | SUPPORTED_Autoneg | SUPPORTED_AUI, + "1000/10GBASE-T"); /* * The PHY has been out of reset ever since the system powered up. So @@ -316,11 +317,9 @@ int t3_aq100x_phy_prep(struct cphy *phy, struct adapter *adapter, int phy_addr, /* Firmware version check. */ t3_mdio_read(phy, MDIO_MMD_VEND1, AQ_FW_VERSION, &v); - if (v != 30) { + if (v != 101) CH_WARN(adapter, "PHY%d: unsupported firmware %d\n", phy_addr, v); - return 0; /* allow t3_prep_adapter to succeed */ - } /* * The PHY should start in really-low-power mode. Prepare it for normal