Ticket #201: madwifi-suspend-signed2.patch
| File madwifi-suspend-signed2.patch, 2.2 kB (added by svens, 6 years ago) |
|---|
-
if_ath_pci.c
old new 154 154 pci_read_config_dword(pdev, 0x40, &val); 155 155 if ((val & 0x0000ff00) != 0) 156 156 pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); 157 157 pci_set_power_state(pdev, PCI_D0); 158 158 phymem = pci_resource_start(pdev, 0); 159 159 if (!request_mem_region(phymem, pci_resource_len(pdev, 0), "ath")) { 160 160 printk(KERN_ERR "ath_pci: cannot reserve PCI memory region\n"); … … 246 246 PCI_SAVE_STATE(pdev, 247 247 ((struct ath_pci_softc *)dev->priv)->aps_pmstate); 248 248 pci_disable_device(pdev); 249 if (pci_set_power_state(pdev, 3)); /* XXX: what? */249 if (pci_set_power_state(pdev, PCI_D3hot)); /* XXX: what? */ 250 250 251 251 return (0); 252 252 } … … 256 256 { 257 257 struct net_device *dev = pci_get_drvdata(pdev); 258 258 u32 val; 259 260 if (!pci_enable_device(pdev)) 261 return 1; 259 pci_set_power_state(pdev, PCI_D0); 260 pci_enable_device(pdev); 262 261 /* XXX - Should this return nonzero on fail? */ 263 262 PCI_RESTORE_STATE(pdev, 264 263 ((struct ath_pci_softc *)dev->priv)->aps_pmstate); 265 /* 264 265 pci_set_master(pdev); 266 /* 266 267 * Suspend/Resume resets the PCI configuration space, so we have to 267 268 * re-disable the RETRY_TIMEOUT register (0x41) to keep 268 269 * PCI Tx retries from interfering with C3 CPU state -
if_ath.c
old new 1230 1230 struct ath_softc *sc = dev->priv; 1231 1231 1232 1232 DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags); 1233 ath_hal_setpower(sc->sc_ah, HAL_PM_FULL_SLEEP); 1233 1234 ath_stop(dev); 1234 1235 } 1235 1236 … … 1239 1240 struct ath_softc *sc = dev->priv; 1240 1241 1241 1242 DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags); 1243 ath_hal_setpower(sc->sc_ah, HAL_PM_AWAKE); 1242 1244 ath_init(dev); 1243 1245 } 1244 1246 … … 1248 1250 struct ath_softc *sc = dev->priv; 1249 1251 1250 1252 DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags); 1253 ath_hal_setpower(sc->sc_ah, HAL_PM_AWAKE); 1251 1254 ath_stop(dev); 1252 1255 } 1253 1256
