Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #201: madwifi-suspend-signed2.patch

File madwifi-suspend-signed2.patch, 2.2 kB (added by svens, 14 years ago)
  • if_ath_pci.c

    old new  
    154154        pci_read_config_dword(pdev, 0x40, &val); 
    155155        if ((val & 0x0000ff00) != 0) 
    156156                pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); 
    157  
     157        pci_set_power_state(pdev, PCI_D0); 
    158158        phymem = pci_resource_start(pdev, 0); 
    159159        if (!request_mem_region(phymem, pci_resource_len(pdev, 0), "ath")) { 
    160160                printk(KERN_ERR "ath_pci: cannot reserve PCI memory region\n"); 
     
    246246        PCI_SAVE_STATE(pdev, 
    247247                ((struct ath_pci_softc *)dev->priv)->aps_pmstate); 
    248248        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? */ 
    250250 
    251251        return (0); 
    252252} 
     
    256256{ 
    257257        struct net_device *dev = pci_get_drvdata(pdev); 
    258258        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); 
    262261        /* XXX - Should this return nonzero on fail? */ 
    263262        PCI_RESTORE_STATE(pdev, 
    264263                ((struct ath_pci_softc *)dev->priv)->aps_pmstate); 
    265         /* 
     264      
     265        pci_set_master(pdev); 
     266        /* 
    266267         * Suspend/Resume resets the PCI configuration space, so we have to 
    267268         * re-disable the RETRY_TIMEOUT register (0x41) to keep 
    268269         * PCI Tx retries from interfering with C3 CPU state 
  • if_ath.c

    old new  
    12301230        struct ath_softc *sc = dev->priv; 
    12311231 
    12321232        DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags); 
     1233        ath_hal_setpower(sc->sc_ah, HAL_PM_FULL_SLEEP); 
    12331234        ath_stop(dev); 
    12341235} 
    12351236 
     
    12391240        struct ath_softc *sc = dev->priv; 
    12401241 
    12411242        DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags); 
     1243        ath_hal_setpower(sc->sc_ah, HAL_PM_AWAKE); 
    12421244        ath_init(dev); 
    12431245} 
    12441246 
     
    12481250        struct ath_softc *sc = dev->priv; 
    12491251 
    12501252        DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags); 
     1253        ath_hal_setpower(sc->sc_ah, HAL_PM_AWAKE); 
    12511254        ath_stop(dev); 
    12521255} 
    12531256