net: usb: cdc_ether: use oob_wake for wrigley modem on tegra
authorJames Wylder <james.wylder@motorola.com>
Tue, 5 Apr 2011 18:00:29 +0000 (13:00 -0500)
committerBenoit Goby <benoit@android.com>
Thu, 7 Apr 2011 03:17:13 +0000 (20:17 -0700)
Change-Id: Ic00782db2ff8a1a791d3324db16dc21a8016e2ca
Signed-off-by: James Wylder <james.wylder@motorola.com>
drivers/net/usb/cdc_ether.c

index b3fe0de4046970dc27fbc31b478b9cce42cf9c63..c29546ddee47661e85405c62de5ac12f1812e0d1 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/usb.h>
 #include <linux/usb/cdc.h>
 #include <linux/usb/usbnet.h>
+#include <linux/usb/oob_wake.h>
 
 
 #if defined(CONFIG_USB_NET_RNDIS_HOST) || defined(CONFIG_USB_NET_RNDIS_HOST_MODULE)
@@ -469,6 +470,35 @@ static const struct driver_info mbm_info = {
        .manage_power = cdc_manage_power,
 };
 
+#ifdef CONFIG_USB_OOBWAKE
+/* out of band wake devices */
+static void oob_wake_cdc_unbind(struct usbnet *dev, struct usb_interface *intf)
+{
+       pr_info("%s: unregister interface for out of band wakeups\n", __func__);
+       oob_wake_unregister(intf);
+       usbnet_cdc_unbind(dev, intf);
+}
+
+static int oob_wake_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
+{
+       int status;
+
+       pr_info("%s: register interface for out of band wakeups\n", __func__);
+       status = cdc_bind(dev, intf);
+       oob_wake_register(intf);
+       return status;
+}
+
+static const struct driver_info        oob_wake_cdc_info = {
+       .description =  "CDC Wakeable Ethernet Device",
+       .flags =        FLAG_ETHER,
+       .bind =         oob_wake_cdc_bind,
+       .unbind =       oob_wake_cdc_unbind,
+       .status =       cdc_status,
+       .manage_power = cdc_manage_power,
+};
+#endif /* CONFIG_USB_OOBWAKE */
+
 /*-------------------------------------------------------------------------*/
 
 
@@ -573,6 +603,14 @@ static const struct usb_device_id  products [] = {
  * NOTE:  this match must come AFTER entries blacklisting devices
  * because of bugs/quirks in a given product (like Zaurus, above).
  */
+#ifdef CONFIG_USB_OOBWAKE
+{
+       /* Motorola Wrigley LTE Modem */
+       USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x4267, USB_CLASS_COMM,
+               USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
+       .driver_info = (unsigned long) &oob_wake_cdc_info,
+},
+#endif /* CONFIG_USB_OOBWAKE */
 {
        USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,
                        USB_CDC_PROTO_NONE),