Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d1f7a5b8cfefdb443a05a9e3d636fe7fef57459a
Commit:     d1f7a5b8cfefdb443a05a9e3d636fe7fef57459a
Parent:     ab25ecaea5459f2206dbae25106cff67a24d309e
Author:     David Woodhouse <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 12 17:40:56 2007 -0500
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:07:04 2008 -0800

    libertas: implement suspend/resume for USB devices
    
    Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 drivers/net/wireless/libertas/if_usb.c |   16 +++++++++++-----
 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 74fec9d..15715a6 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,
 
        if_usb_set_boot2_ver(priv);
 
+       /* Set suspend/resume configuration:
+          wake via GPIO2 after a 20ms delay */
+       lbs_host_sleep_cfg(priv, EHS_WAKE_ON_UNICAST_DATA, 2, 20);
+
        usb_get_dev(udev);
        usb_set_intfdata(intf, cardp);
 
@@ -969,21 +973,24 @@ static int if_usb_suspend(struct usb_interface *intf, 
pm_message_t message)
 {
        struct usb_card_rec *cardp = usb_get_intfdata(intf);
        struct lbs_private *priv = cardp->priv;
+       int ret;
 
        lbs_deb_enter(LBS_DEB_USB);
 
        if (priv->psstate != PS_STATE_FULL_POWER)
                return -1;
 
-       netif_device_detach(priv->dev);
-       netif_device_detach(priv->mesh_dev);
+       ret = lbs_suspend(priv);
+       if (ret)
+               goto out;
 
        /* Unlink tx & rx urb */
        usb_kill_urb(cardp->tx_urb);
        usb_kill_urb(cardp->rx_urb);
 
+ out:
        lbs_deb_leave(LBS_DEB_USB);
-       return 0;
+       return ret;
 }
 
 static int if_usb_resume(struct usb_interface *intf)
@@ -995,8 +1002,7 @@ static int if_usb_resume(struct usb_interface *intf)
 
        if_usb_submit_rx_urb(cardp);
 
-       netif_device_attach(priv->dev);
-       netif_device_attach(priv->mesh_dev);
+       lbs_resume(priv);
 
        lbs_deb_leave(LBS_DEB_USB);
        return 0;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to