blob: 92c95aa36638077cea8b5328b4aafcda480c33bf [file] [log] [blame]
Jerry Chuang5f53d8c2009-05-21 22:16:02 -07001/*
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.
6
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)
10*/
11
12#ifdef CONFIG_RTL8192_PM
13#include "r8192U.h"
14#include "r8192U_pm.h"
15
16/*****************************************************************************/
17int rtl8192U_save_state (struct pci_dev *dev, u32 state)
18{
19 printk(KERN_NOTICE "r8192U save state call (state %u).\n", state);
20 return(-EAGAIN);
21}
22
23int rtl8192U_suspend(struct usb_interface *intf, pm_message_t state)
24{
25#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
26 struct net_device *dev = usb_get_intfdata(intf);
27#else
28 //struct net_device *dev = (struct net_device *)ptr;
29#endif
30 RT_TRACE(COMP_POWER, "============> r8192U suspend call.\n");
31
32 if(dev) {
33 if (!netif_running(dev)) {
34 printk(KERN_WARNING "netif not running, go out suspend function\n");
35 return 0;
36 }
37
38 dev->stop(dev);
39 mdelay(10);
40
41 netif_device_detach(dev);
42 }
43
44 return 0;
45}
46
47int rtl8192U_resume (struct usb_interface *intf)
48{
49#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
50 struct net_device *dev = usb_get_intfdata(intf);
51#else
52 //struct net_device *dev = (struct net_device *)ptr;
53#endif
54
55 RT_TRACE(COMP_POWER, "================>r8192U resume call.");
56
57 if(dev) {
58 if (!netif_running(dev)){
59 printk(KERN_WARNING "netif not running, go out resume function\n");
60 return 0;
61 }
62
63 netif_device_attach(dev);
64 dev->open(dev);
65 }
66
67 return 0;
68}
69
70int rtl8192U_enable_wake (struct pci_dev *dev, u32 state, int enable)
71{
72 printk(KERN_NOTICE "r8192U enable wake call (state %u, enable %d).\n",
73 state, enable);
74 return(-EAGAIN);
75}
76
77#endif //CONFIG_RTL8192_PM