uint32_t ctrl, ctrl_ext, rctl, manc, status; 
uint32_t ctrl, ctrl_ext, rctl, manc, status, swsm; 
e1000_suspend(struct pci_dev *pdev, uint32_t state){	struct net_device *netdev = pci_get_drvdata(pdev);	struct e1000_adapter *adapter = netdev->priv;	uint32_t ctrl, ctrl_ext, rctl, manc, status;	uint32_t wufc = adapter->wol;	netif_device_detach(netdev);	if(netif_running(netdev))		e1000_down(adapter);	status = E1000_READ_REG(&adapter->hw, STATUS);	if(status & E1000_STATUS_LU)		wufc &= ~E1000_WUFC_LNKC;	if(wufc) {		e1000_setup_rctl(adapter);		e1000_set_multi(netdev);		/* turn on all-multi mode if wake on multicast is enabled */		if(adapter->wol & E1000_WUFC_MC) {			rctl = E1000_READ_REG(&adapter->hw, RCTL);			rctl |= E1000_RCTL_MPE;			E1000_WRITE_REG(&adapter->hw, RCTL, rctl);		}		if(adapter->hw.mac_type >= e1000_82540) {			ctrl = E1000_READ_REG(&adapter->hw, CTRL);			/* advertise wake from D3Cold */			#define E1000_CTRL_ADVD3WUC 0x00100000			/* phy power management enable */			#define E1000_CTRL_EN_PHY_PWR_MGMT 0x00200000			ctrl |= E1000_CTRL_ADVD3WUC |				E1000_CTRL_EN_PHY_PWR_MGMT;			E1000_WRITE_REG(&adapter->hw, CTRL, ctrl);		}		if(adapter->hw.media_type == e1000_media_type_fiber ||		   adapter->hw.media_type == e1000_media_type_internal_serdes) {			/* keep the laser running in D3 */			ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT);			ctrl_ext |= E1000_CTRL_EXT_SDP7_DATA;			E1000_WRITE_REG(&adapter->hw, CTRL_EXT, ctrl_ext);		}		E1000_WRITE_REG(&adapter->hw, WUC, E1000_WUC_PME_EN);		E1000_WRITE_REG(&adapter->hw, WUFC, wufc);		pci_enable_wake(pdev, 3, 1);		pci_enable_wake(pdev, 4, 1); /* 4 == D3 cold */	} else {		E1000_WRITE_REG(&adapter->hw, WUC, 0);		E1000_WRITE_REG(&adapter->hw, WUFC, 0);		pci_enable_wake(pdev, 3, 0);		pci_enable_wake(pdev, 4, 0); /* 4 == D3 cold */	}	pci_save_state(pdev);	if(adapter->hw.mac_type >= e1000_82540 &&	   adapter->hw.media_type == e1000_media_type_copper) {		manc = E1000_READ_REG(&adapter->hw, MANC);		if(manc & E1000_MANC_SMBUS_EN) {			manc |= E1000_MANC_ARP_EN;			E1000_WRITE_REG(&adapter->hw, MANC, manc);			pci_enable_wake(pdev, 3, 1);			pci_enable_wake(pdev, 4, 1); /* 4 == D3 cold */		}	}	pci_disable_device(pdev);	state = (state > 0) ? 3 : 0;	pci_set_power_state(pdev, state);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/2d7edb923a823660b081bd4c660300ee19adca8d/e1000_main.c/clean/drivers/net/e1000/e1000_main.c