netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>
To: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: "Bjørn Mork" <bjorn-yOkvZcmFvRU@public.gmane.org>
Subject: [PATCH 2/3] cdc_ether: allow vendor specific data interface if control interface is vendor specific
Date: Tue, 13 Dec 2011 05:33:03 +0100	[thread overview]
Message-ID: <1323750784-32608-3-git-send-email-bjorn@mork.no> (raw)
In-Reply-To: <1323750784-32608-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>

From: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>

Some vendors, like Huawei, use the vendor specific class code all over the
place even for devices which otherwise conform pretty well to the CDC ECM
specification.  This allows such devices to be supported merely by
adding them to the device specific whitelist.

Signed-off-by: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>
---
 drivers/net/usb/cdc_ether.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index 99ed6eb..84840dd 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -211,8 +211,12 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
 
 			/* a data interface altsetting does the real i/o */
 			d = &info->data->cur_altsetting->desc;
-			if (d->bInterfaceClass != USB_CLASS_CDC_DATA) {
-				dev_dbg(&intf->dev, "slave class %u\n",
+			if ((d->bInterfaceClass != USB_CLASS_CDC_DATA) &&
+				/* Allow vendor specific data interface iff
+				   control interface is vendor specific */
+				!(info->control->cur_altsetting->desc.bInterfaceClass == USB_CLASS_VENDOR_SPEC &&
+					d->bInterfaceClass == USB_CLASS_VENDOR_SPEC)) {
+				dev_dbg(&intf->dev, "xslave class %u\n",
 					d->bInterfaceClass);
 				goto bad_desc;
 			}
-- 
1.7.7.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2011-12-13  4:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13  4:33 [PATCH 0/3] Adding a new driver for Huawei E392 WWAN modem Bjorn Mork
     [not found] ` <1323750784-32608-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
2011-12-13  4:33   ` [PATCH 1/3] option: Removing one bogus and adding some new Huawei combinations Bjorn Mork
2011-12-13 17:16     ` Greg KH
2011-12-13  4:33   ` Bjorn Mork [this message]
     [not found]     ` <1323750784-32608-3-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
2011-12-13  4:54       ` [PATCH 2/3] cdc_ether: allow vendor specific data interface if control interface is vendor specific Joe Perches
2011-12-13  4:59         ` Bjørn Mork
     [not found]           ` <87vcplcbj3.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2011-12-13 10:39             ` Sergei Shtylyov
2011-12-13  4:33   ` [PATCH 3/3] qmi_wwan: Driver for WWAN devices requiring use of the QMI protocol Bjorn Mork
     [not found]     ` <1323750784-32608-4-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
2011-12-14 17:08       ` Dan Williams
     [not found]         ` <1323882501.2077.3.camel-wKZy7rqYPVb5EHUCmHmTqw@public.gmane.org>
2011-12-15 10:02           ` Bjørn Mork
2011-12-15 17:52             ` Dan Williams
     [not found]               ` <1323971530.23419.13.camel-wKZy7rqYPVb5EHUCmHmTqw@public.gmane.org>
2011-12-16 16:03                 ` Bjørn Mork
     [not found]                   ` <874nx0bj1d.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
2011-12-16 17:17                     ` Dan Williams
     [not found]                       ` <1324055842.17587.18.camel-wKZy7rqYPVb5EHUCmHmTqw@public.gmane.org>
2012-01-04 20:57                         ` Dan Williams
2012-01-05  8:58                           ` Bjørn Mork
2011-12-13  9:02 ` [PATCH 0/3] Adding a new driver for Huawei E392 WWAN modem Bjørn Mork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323750784-32608-3-git-send-email-bjorn@mork.no \
    --to=bjorn-yokvzcmfvru@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).