struct e1000_adapter *adapter = netdev->priv; 
struct e1000_adapter *adapter = netdev_priv(netdev); 
e1000_get_regs(struct net_device *netdev,	       struct ethtool_regs *regs, void *p){	struct e1000_adapter *adapter = netdev->priv;	struct e1000_hw *hw = &adapter->hw;	uint32_t *regs_buff = p;	uint16_t phy_data;	memset(p, 0, E1000_REGS_LEN * sizeof(uint32_t));	regs->version = (1 << 24) | (hw->revision_id << 16) | hw->device_id;	regs_buff[0]  = E1000_READ_REG(hw, CTRL);	regs_buff[1]  = E1000_READ_REG(hw, STATUS);	regs_buff[2]  = E1000_READ_REG(hw, RCTL);	regs_buff[3]  = E1000_READ_REG(hw, RDLEN);	regs_buff[4]  = E1000_READ_REG(hw, RDH);	regs_buff[5]  = E1000_READ_REG(hw, RDT);	regs_buff[6]  = E1000_READ_REG(hw, RDTR);	regs_buff[7]  = E1000_READ_REG(hw, TCTL);	regs_buff[8]  = E1000_READ_REG(hw, TDLEN);	regs_buff[9]  = E1000_READ_REG(hw, TDH);	regs_buff[10] = E1000_READ_REG(hw, TDT);	regs_buff[11] = E1000_READ_REG(hw, TIDV);	regs_buff[12] = adapter->hw.phy_type;  /* PHY type (IGP=1, M88=0) */	if(hw->phy_type == e1000_phy_igp) {		e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT,				    IGP01E1000_PHY_AGC_A);		e1000_read_phy_reg(hw, IGP01E1000_PHY_AGC_A &				   IGP01E1000_PHY_PAGE_SELECT, &phy_data);		regs_buff[13] = (uint32_t)phy_data; /* cable length */		e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT,				    IGP01E1000_PHY_AGC_B);		e1000_read_phy_reg(hw, IGP01E1000_PHY_AGC_B &				   IGP01E1000_PHY_PAGE_SELECT, &phy_data);		regs_buff[14] = (uint32_t)phy_data; /* cable length */		e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT,				    IGP01E1000_PHY_AGC_C);		e1000_read_phy_reg(hw, IGP01E1000_PHY_AGC_C &				   IGP01E1000_PHY_PAGE_SELECT, &phy_data);		regs_buff[15] = (uint32_t)phy_data; /* cable length */		e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT,				    IGP01E1000_PHY_AGC_D);		e1000_read_phy_reg(hw, IGP01E1000_PHY_AGC_D &				   IGP01E1000_PHY_PAGE_SELECT, &phy_data);		regs_buff[16] = (uint32_t)phy_data; /* cable length */		regs_buff[17] = 0; /* extended 10bt distance (not needed) */		e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT, 0x0);		e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_STATUS &				   IGP01E1000_PHY_PAGE_SELECT, &phy_data);		regs_buff[18] = (uint32_t)phy_data; /* cable polarity */		e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT,				    IGP01E1000_PHY_PCS_INIT_REG);		e1000_read_phy_reg(hw, IGP01E1000_PHY_PCS_INIT_REG &				   IGP01E1000_PHY_PAGE_SELECT, &phy_data);		regs_buff[19] = (uint32_t)phy_data; /* cable polarity */		regs_buff[20] = 0; /* polarity correction enabled (always) */		regs_buff[22] = 0; /* phy receive errors (unavailable) */		regs_buff[23] = regs_buff[18]; /* mdix mode */		e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT, 0x0);	} else {        	e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);		regs_buff[13] = (uint32_t)phy_data; /* cable length */		regs_buff[14] = 0;  /* Dummy (to align w/ IGP phy reg dump) */		regs_buff[15] = 0;  /* Dummy (to align w/ IGP phy reg dump) */		regs_buff[16] = 0;  /* Dummy (to align w/ IGP phy reg dump) */        	e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);		regs_buff[17] = (uint32_t)phy_data; /* extended 10bt distance */		regs_buff[18] = regs_buff[13]; /* cable polarity */		regs_buff[19] = 0;  /* Dummy (to align w/ IGP phy reg dump) */		regs_buff[20] = regs_buff[17]; /* polarity correction */		/* phy receive errors */		regs_buff[22] = adapter->phy_stats.receive_errors;		regs_buff[23] = regs_buff[13]; /* mdix mode */	}	regs_buff[21] = adapter->phy_stats.idle_errors;  /* phy idle errors */	e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_data);	regs_buff[24] = (uint32_t)phy_data;  /* phy local receiver status */	regs_buff[25] = regs_buff[24];  /* phy remote receiver status */	if(hw->mac_type >= e1000_82540 &&	   hw->media_type == e1000_media_type_copper) {		regs_buff[26] = E1000_READ_REG(hw, MANC);	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/60490fe030f3969a8706d94c7cf8469be6330678/e1000_ethtool.c/clean/drivers/net/e1000/e1000_ethtool.c