Ticket #201: madwifi-suspend-signed.patch
| File madwifi-suspend-signed.patch, 2.3 kB (added by svens@gmx.de, 6 years ago) |
|---|
-
ath/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 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 pci_set_power_state(pdev, PCI_D0); 259 260 260 if (!pci_enable_device(pdev))261 return 1;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_enable_device(pdev); 266 pci_set_master(pdev); 267 /* 266 268 * Suspend/Resume resets the PCI configuration space, so we have to 267 269 * re-disable the RETRY_TIMEOUT register (0x41) to keep 268 270 * PCI Tx retries from interfering with C3 CPU state -
ath/if_ath.c
old new 1221 1224 struct ath_softc *sc = dev->priv; 1222 1225 1223 1226 DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags); 1224 ath_stop(dev); 1227 ath_hal_setpower(sc->sc_ah, HAL_PM_FULL_SLEEP); 1228 /* ath_stop(dev);*/ 1225 1229 } 1226 1230 1227 1231 void … … 1230 1234 struct ath_softc *sc = dev->priv; 1231 1235 1232 1236 DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags); 1233 ath_init(dev); 1237 ath_hal_setpower(sc->sc_ah, HAL_PM_AWAKE); 1238 ath_reset(dev); 1239 /* ath_init(dev);*/ 1234 1240 } 1235 1241 1236 1242 void … … 1239 1245 struct ath_softc *sc = dev->priv; 1240 1246 1241 1247 DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags); 1242 ath_stop(dev); 1248 ath_hal_setpower(sc->sc_ah, HAL_PM_AWAKE); 1249 /* ath_stop(dev);*/ 1243 1250 } 1244 1251 1245 1252 static void
