2 Power management interface routines.
3 Written by Mariusz Matuszek.
4 This code is currently just a placeholder for later work and
5 does not do anything useful.
7 This is part of rtl8180 OpenSource driver.
8 Copyright (C) Andrea Merello 2004 <andreamrl@tiscali.it>
9 Released under the terms of GPL (General Public Licence)
13 #include "r8192E_hw.h"
15 #include "r8190_rtl8256.h"
17 int rtl8192E_save_state (struct pci_dev
*dev
, pm_message_t state
)
19 printk(KERN_NOTICE
"r8192E save state call (state %u).\n", state
.event
);
24 int rtl8192E_suspend (struct pci_dev
*pdev
, pm_message_t state
)
26 struct net_device
*dev
= pci_get_drvdata(pdev
);
27 struct r8192_priv
*priv
= ieee80211_priv(dev
);
33 RT_TRACE(COMP_POWER
, "============> r8192E suspend call.\n");
34 if (!netif_running(dev
))
37 if (dev
->netdev_ops
->ndo_stop
)
38 dev
->netdev_ops
->ndo_stop(dev
);
40 // Call MgntActSet_RF_State instead to prevent RF config race condition.
41 if(!priv
->ieee80211
->bSupportRemoteWakeUp
) {
42 MgntActSet_RF_State(dev
, eRfOff
, RF_CHANGE_BY_INIT
);
43 // 2006.11.30. System reset bit
44 ulRegRead
= read_nic_dword(priv
, CPU_GEN
);
45 ulRegRead
|=CPU_GEN_SYSTEM_RESET
;
46 write_nic_dword(priv
, CPU_GEN
, ulRegRead
);
49 write_nic_dword(priv
, WFCRC0
, 0xffffffff);
50 write_nic_dword(priv
, WFCRC1
, 0xffffffff);
51 write_nic_dword(priv
, WFCRC2
, 0xffffffff);
54 ucRegRead
= read_nic_byte(priv
, GPO
);
56 write_nic_byte(priv
, GPO
, ucRegRead
);
59 write_nic_byte(priv
, PMR
, 0x5);
60 //Disable tx, enanble rx
61 write_nic_byte(priv
, MacBlkCtrl
, 0xa);
65 RT_TRACE(COMP_POWER
, "r8192E support WOL call??????????????????????\n");
66 if(priv
->ieee80211
->bSupportRemoteWakeUp
) {
67 RT_TRACE(COMP_POWER
, "r8192E support WOL call!!!!!!!!!!!!!!!!!!.\n");
69 netif_device_detach(dev
);
71 pci_disable_device(pdev
);
72 pci_enable_wake(pdev
, pci_choose_state(pdev
,state
),
73 priv
->ieee80211
->bSupportRemoteWakeUp
?1:0);
74 pci_set_power_state(pdev
,pci_choose_state(pdev
,state
));
79 int rtl8192E_resume (struct pci_dev
*pdev
)
81 struct net_device
*dev
= pci_get_drvdata(pdev
);
85 RT_TRACE(COMP_POWER
, "================>r8192E resume call.");
87 pci_set_power_state(pdev
, PCI_D0
);
89 err
= pci_enable_device(pdev
);
91 printk(KERN_ERR
"%s: pci_enable_device failed on resume\n",
96 pci_restore_state(pdev
);
99 * Suspend/Resume resets the PCI configuration space, so we have to
100 * re-disable the RETRY_TIMEOUT register (0x41) to keep PCI Tx retries
101 * from interfering with C3 CPU state. pci_restore_state won't help
102 * here since it only restores the first 64 bytes pci config header.
104 pci_read_config_dword(pdev
, 0x40, &val
);
105 if ((val
& 0x0000ff00) != 0) {
106 pci_write_config_dword(pdev
, 0x40, val
& 0xffff00ff);
111 pci_enable_wake(pdev
, PCI_D0
, 0);
113 if(!netif_running(dev
))
116 netif_device_attach(dev
);
118 if (dev
->netdev_ops
->ndo_open
)
119 dev
->netdev_ops
->ndo_open(dev
);
122 RT_TRACE(COMP_POWER
, "<================r8192E resume call.\n");
127 int rtl8192E_enable_wake (struct pci_dev
*dev
, pm_message_t state
, int enable
)
129 printk(KERN_NOTICE
"r8192E enable wake call (state %u, enable %d).\n",
130 state
.event
, enable
);
This page took 0.03382 seconds and 6 git commands to generate.