Skip to contentSkip to conversation

ACPI: How to Suspend a PCIe Network Card

DISCUSSION Julius Schulz-Zander 1 participant 1 message Aug 25, 2006 ACPI

lore
Share & tools
lore
#0 lore raw

Hi,

i would like zu suspend my pci-express Atheros Wifi-Card in my MacBook.

All the Kernel-Methods want to get the Device Pointer. But how do i get this?

These functions are intended for use by individual drivers, and are defined in struct pci_driver:

        int  (*save_state) (struct pci_dev *dev, u32 state);
        int  (*suspend)(struct pci_dev *dev, u32 state);
        int  (*resume) (struct pci_dev *dev);
        int  (*enable_wake) (struct pci_dev *dev, u32 state, int enable);

Suspend in general, in every pci driver, has to implement:
pci_disable_device(dev);
and
pci_set_power_state(dev,state);
These are implemented in "/usr/src/linux-2.6.17-gentoo-r4/drivers/pci/pci.c".

Hence, suspend in in the madwifi pci driver is using these two funktions in the file "/root/madwifi-0.9.2/madwifi-0.9.2/ath/if_ath_pci.c" ath_pci_suspend(struct pci_dev *pdev, pm_message_t state)
is using

	struct net_device *dev = pci_get_drvdata(pdev);
        ath_suspend(dev);
        PCI_SAVE_STATE(pdev, ((struct ath_pci_softc*)dev->priv)->aps_pmstate);
        pci_disable_device(pdev);
        return pci_set_power_state(pdev, PCI_D3hot);

but there is also a acpi-methods like this in the
file "/usr/src/linux-2.6.17-gentoo-r4/drivers/pci/pci-acpi.c" static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) Maybe i can use this one?

So now i think that it must be possible, to suspend my Atheros Wifi-Card, when running "ath_pci_suspend" with the correct device Pointer! Is that correct? But how do i get this Pointer?

Does anyone has experiences setting the Power-State of PCI Devices?

Greetings,
Julius

Signature · 1 line
get my public gpg-key: http://julius.fazzepullis.de/key.asc