PCI power management support. Currently performs an 'ifstate=disable'

on the card.
origin
solomon 2002-08-07 15:39:02 +00:00
parent bba3591bff
commit 6ea809c158
2 changed files with 62 additions and 27 deletions

View File

@ -41,6 +41,7 @@
* Intersil Corporation as part of PRISM(R) chipset product development.
*
* --------------------------------------------------------------------
- Support for PCI power managment
- Fixed a wep hang on the transmit side
- Compile fixes; mainly for 2.2 kernels
- Add support for the SIOCGIWRATE wireless extension.

View File

@ -252,24 +252,32 @@ static void pci_unregister_driver(struct pci_driver *drv);
static void *pci_get_drvdata (struct pci_dev *dev);
static void pci_set_drvdata (struct pci_dev *dev, void *driver_data);
#define pci_resource_start(dev,bar) \
(((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_SPACE) ? \
((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_IO_MASK) : \
((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_MEM_MASK))
/* no-ops */
#define pci_enable_device(a) 0
#define pci_disable_device(a) 0
#define request_mem_region(x,y,z) (1)
#define release_mem_region(x,y) do {} while (0)
#ifndef pci_resource_start
#define pci_resource_start(dev, i) \
(((dev)->base_address[i] & PCI_BASE_ADDRESS_SPACE) ? \
((dev)->base_address[i] & PCI_BASE_ADDRESS_IO_MASK) : \
((dev)->base_address[i] & PCI_BASE_ADDRESS_MEM_MASK))
#define pci_resource_flags(dev, i) \
(dev->base_address[i] & IORESOURCE_IO)
#endif
#endif /* (WLAN_HOSTIF == WLAN_PLX || WLAN_HOSTIF == WLAN_PCI) */
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */
/*-----------------------------------------------------------------*/
#if (WLAN_HOSTIF == WLAN_PLX || WLAN_HOSTIF == WLAN_PCI)
static int prism2sta_suspend_pci(struct pci_dev *pdev, u32 state);
static int prism2sta_resume_pci(struct pci_dev *pdev);
#endif
#if (WLAN_HOSTIF == WLAN_PLX)
static struct pci_device_id pci_id_tbl[] = {
static struct pci_device_id plx_id_tbl[] = {
{
PCIVENDOR_EUMITCOM, PCIDEVICE_WL11000,
PCI_ANY_ID, PCI_ANY_ID,
@ -344,15 +352,14 @@ static int prism2sta_probe_plx(struct pci_dev *pdev,
static void prism2sta_remove_plx(struct pci_dev *pdev);
struct pci_driver prism2_plx_drv_id = {
{},
"prism2_plx", /* Driver name */
pci_id_tbl, /* id table */
prism2sta_probe_plx, /* probe function */
prism2sta_remove_plx, /* remove function */
NULL, /* save_state function */
NULL, /* suspend function */
NULL, /* resume function */
NULL, /* enable_wake function */
name: "prism2_plx",
probe: prism2sta_probe_plx,
remove: prism2sta_remove_plx,
id_table: plx_id_tbl,
#ifdef CONFIG_PM
suspend: prism2sta_suspend_pci,
resume: prism2sta_resume_pci,
#endif
};
#endif /* WLAN_PLX */
@ -378,15 +385,14 @@ static int prism2sta_probe_pci(struct pci_dev *pdev,
static void prism2sta_remove_pci(struct pci_dev *pdev);
struct pci_driver prism2_pci_drv_id = {
{},
"prism2_pci", /* Driver name */
pci_id_tbl, /* id table */
prism2sta_probe_pci, /* probe function */
prism2sta_remove_pci, /* remove function */
NULL, /* save_state function */
NULL, /* suspend function */
NULL, /* resume function */
NULL, /* enable_wake function */
name: "prism2_pci",
probe: prism2sta_probe_pci,
remove: prism2sta_remove_pci,
id_table: pci_id_tbl,
#ifdef CONFIG_PM
suspend: prism2sta_suspend_pci,
resume: prism2sta_resume_pci,
#endif
};
#endif /* WLAN_PCI */
@ -3550,9 +3556,39 @@ static void prism2sta_remove_pci(struct pci_dev *pdev)
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
}
#endif /* WLAN_PCI */
#if (WLAN_HOSTIF == WLAN_PLX || WLAN_HOSTIF == WLAN_PCI)
#ifdef CONFIG_PM
static int prism2sta_suspend_pci(struct pci_dev *pdev, u32 state)
{
wlandevice_t *wlandev;
wlandev = (wlandevice_t *) pci_get_drvdata(pdev);
/* reset hardware */
if (wlandev)
prism2sta_ifstate(wlandev, P80211ENUM_ifstate_disable);
// call a netif_device_detach(wlandev->netdev) ?
return 0;
}
static int prism2sta_resume_pci (struct pci_dev *pdev)
{
wlandevice_t *wlandev;
wlandev = (wlandevice_t *) pci_get_drvdata(pdev);
if (wlandev)
prism2sta_ifstate(wlandev, P80211ENUM_ifstate_disable);
return 0;
}
#endif
#endif
#if (WLAN_HOSTIF == WLAN_PLX)
/*----------------------------------------------------------------
* prism2sta_probe_plx
@ -4236,12 +4272,10 @@ static wlandevice_t *create_wlan(void)
wlandev->txframe = &prism2sta_txframe;
wlandev->mlmerequest = &prism2sta_mlmerequest;
wlandev->hwremovedfn = &prism2sta_hwremoved;
#if defined(__LINUX_WLAN__) && defined (__KERNEL__)
#if WIRELESS_EXT > 10
wlandev->get_wireless_stats = &prism2wext_get_wireless_stats;
wlandev->support_ioctl = &prism2wext_support_ioctl;
#endif
#endif
#if (WLAN_HOSTIF == WLAN_PCMCIA)
wlandev->name = ((prism2sta_priv_t*)wlandev->priv)->node.dev_name;