else tp->tg3_flags2 &= ~TG3_FLG2_PHY_SERDES; 
static int __devinit tg3_phy_probe(struct tg3 *tp){	u32 hw_phy_id_1, hw_phy_id_2;	u32 hw_phy_id, hw_phy_id_masked;	int err;	/* Reading the PHY ID register can conflict with ASF	 * firwmare access to the PHY hardware.	 */	err = 0;	if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) {		hw_phy_id = hw_phy_id_masked = PHY_ID_INVALID;	} else {		/* Now read the physical PHY_ID from the chip and verify		 * that it is sane.  If it doesn't look good, we fall back		 * to either the hard-coded table based PHY_ID and failing		 * that the value found in the eeprom area.		 */		err |= tg3_readphy(tp, MII_PHYSID1, &hw_phy_id_1);		err |= tg3_readphy(tp, MII_PHYSID2, &hw_phy_id_2);		hw_phy_id  = (hw_phy_id_1 & 0xffff) << 10;		hw_phy_id |= (hw_phy_id_2 & 0xfc00) << 16;		hw_phy_id |= (hw_phy_id_2 & 0x03ff) <<  0;		hw_phy_id_masked = hw_phy_id & PHY_ID_MASK;	}	if (!err && KNOWN_PHY_ID(hw_phy_id_masked)) {		tp->phy_id = hw_phy_id;		if (hw_phy_id_masked == PHY_ID_BCM8002)			tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES;	} else {		if (tp->phy_id != PHY_ID_INVALID) {			/* Do nothing, phy ID already set up in			 * tg3_get_eeprom_hw_cfg().			 */		} else {			struct subsys_tbl_ent *p;			/* No eeprom signature?  Try the hardcoded			 * subsys device table.			 */			p = lookup_by_subsys(tp);			if (!p)				return -ENODEV;			tp->phy_id = p->phy_id;			if (!tp->phy_id ||			    tp->phy_id == PHY_ID_BCM8002)				tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES;		}	}	if (!(tp->tg3_flags2 & TG3_FLG2_ANY_SERDES) &&	    !(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) {		u32 bmsr, adv_reg, tg3_ctrl;		tg3_readphy(tp, MII_BMSR, &bmsr);		if (!tg3_readphy(tp, MII_BMSR, &bmsr) &&		    (bmsr & BMSR_LSTATUS))			goto skip_phy_reset;		    		err = tg3_phy_reset(tp);		if (err)			return err;		adv_reg = (ADVERTISE_10HALF | ADVERTISE_10FULL |			   ADVERTISE_100HALF | ADVERTISE_100FULL |			   ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP);		tg3_ctrl = 0;		if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY)) {			tg3_ctrl = (MII_TG3_CTRL_ADV_1000_HALF |				    MII_TG3_CTRL_ADV_1000_FULL);			if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0 ||			    tp->pci_chip_rev_id == CHIPREV_ID_5701_B0)				tg3_ctrl |= (MII_TG3_CTRL_AS_MASTER |					     MII_TG3_CTRL_ENABLE_AS_MASTER);		}		if (!tg3_copper_is_advertising_all(tp)) {			tg3_writephy(tp, MII_ADVERTISE, adv_reg);			if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY))				tg3_writephy(tp, MII_TG3_CTRL, tg3_ctrl);			tg3_writephy(tp, MII_BMCR,				     BMCR_ANENABLE | BMCR_ANRESTART);		}		tg3_phy_set_wirespeed(tp);		tg3_writephy(tp, MII_ADVERTISE, adv_reg);		if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY))			tg3_writephy(tp, MII_TG3_CTRL, tg3_ctrl);	}skip_phy_reset:	if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401) {		err = tg3_init_5401phy_dsp(tp);		if (err)			return err;	}	if (!err && ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401)) {		err = tg3_init_5401phy_dsp(tp);	}	if (tp->tg3_flags2 & TG3_FLG2_ANY_SERDES)		tp->link_config.advertising =			(ADVERTISED_1000baseT_Half |			 ADVERTISED_1000baseT_Full |			 ADVERTISED_Autoneg |			 ADVERTISED_FIBRE);	if (tp->tg3_flags & TG3_FLAG_10_100_ONLY)		tp->link_config.advertising &=			~(ADVERTISED_1000baseT_Half |			  ADVERTISED_1000baseT_Full);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/da6b2d01d6bd2e79fd4f7a08acd37dc4e8fcdce8/tg3.c/buggy/drivers/net/tg3.c