rem: static int pci_set_power_state(uint8 bus, uint8 dev, uint8 func, int state)
add: pci_set_power_state(uint8 bus, uint8 dev, uint8 func, int state)
context: static int pci_set_power_state(uint8 bus, uint8 dev, uint8 func, int state){	uint8 pm_reg, cur_state;	uint16 cur_status;	if (pci_get_capability(bus, dev, func, PCI_cap_id_pm, &pm_reg) == 0)		return EIO;			if (state > PCI_pm_state_d3)		state = PCI_pm_state_d3;		cur_status = read_pci_config(bus, dev, func, pm_reg + PCI_pm_status, 1);	cur_state = cur_status & PCI_pm_mask;		if (cur_state == state)		return 0;	if (state == PCI_pm_state_d1 || state == PCI_pm_state_d2) {		uint16 pmc;		pmc = read_pci_config(bus, dev, func, pm_reg + PCI_pm_ctrl, 2);		if (state == PCI_pm_state_d1 && !(pmc & PCI_pm_d1supp))			return EIO;		if (state == PCI_pm_state_d2 && !(pmc & PCI_pm_d2supp))			return EIO;	}	if (cur_state != PCI_pm_state_d3) {		cur_status &= ~PCI_pm_mask;		cur_status |= state;	}		write_pci_config(bus, dev, func, pm_reg + PCI_pm_status, 2, cur_status);		if (state == PCI_pm_state_d3 || cur_state == PCI_pm_state_d3) {		snooze(10 * 1000);	} else if (state == PCI_pm_state_d2 || cur_state == PCI_pm_state_d2)		snooze(200); 		return 0;}