aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-12 17:40:56 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:07:04 -0500
commitd1f7a5b8cfefdb443a05a9e3d636fe7fef57459a (patch)
treedaa2e395b99c31d356f364467d8c3451dd22697e /drivers
parentab25ecaea5459f2206dbae25106cff67a24d309e (diff)
libertas: implement suspend/resume for USB devices
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/libertas/if_usb.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 74fec9dfca07..15715a6b59e0 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -242,6 +242,10 @@ static int if_usb_probe(struct usb_interface *intf,
242 242
243 if_usb_set_boot2_ver(priv); 243 if_usb_set_boot2_ver(priv);
244 244
245 /* Set suspend/resume configuration:
246 wake via GPIO2 after a 20ms delay */
247 lbs_host_sleep_cfg(priv, EHS_WAKE_ON_UNICAST_DATA, 2, 20);
248
245 usb_get_dev(udev); 249 usb_get_dev(udev);
246 usb_set_intfdata(intf, cardp); 250 usb_set_intfdata(intf, cardp);
247 251
@@ -969,21 +973,24 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
969{ 973{
970 struct usb_card_rec *cardp = usb_get_intfdata(intf); 974 struct usb_card_rec *cardp = usb_get_intfdata(intf);
971 struct lbs_private *priv = cardp->priv; 975 struct lbs_private *priv = cardp->priv;
976 int ret;
972 977
973 lbs_deb_enter(LBS_DEB_USB); 978 lbs_deb_enter(LBS_DEB_USB);
974 979
975 if (priv->psstate != PS_STATE_FULL_POWER) 980 if (priv->psstate != PS_STATE_FULL_POWER)
976 return -1; 981 return -1;
977 982
978 netif_device_detach(priv->dev); 983 ret = lbs_suspend(priv);
979 netif_device_detach(priv->mesh_dev); 984 if (ret)
985 goto out;
980 986
981 /* Unlink tx & rx urb */ 987 /* Unlink tx & rx urb */
982 usb_kill_urb(cardp->tx_urb); 988 usb_kill_urb(cardp->tx_urb);
983 usb_kill_urb(cardp->rx_urb); 989 usb_kill_urb(cardp->rx_urb);
984 990
991 out:
985 lbs_deb_leave(LBS_DEB_USB); 992 lbs_deb_leave(LBS_DEB_USB);
986 return 0; 993 return ret;
987} 994}
988 995
989static int if_usb_resume(struct usb_interface *intf) 996static int if_usb_resume(struct usb_interface *intf)
@@ -995,8 +1002,7 @@ static int if_usb_resume(struct usb_interface *intf)
995 1002
996 if_usb_submit_rx_urb(cardp); 1003 if_usb_submit_rx_urb(cardp);
997 1004
998 netif_device_attach(priv->dev); 1005 lbs_resume(priv);
999 netif_device_attach(priv->mesh_dev);
1000 1006
1001 lbs_deb_leave(LBS_DEB_USB); 1007 lbs_deb_leave(LBS_DEB_USB);
1002 return 0; 1008 return 0;