From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, "Dan Williams" <dcbw@redhat.com>,
"Bjørn Mork" <bjorn@mork.no>,
"David S. Miller" <davem@davemloft.net>
Subject: [ 12/98] net: qmi_wwan: set correct altsetting for Gobi 1K devices
Date: Tue, 26 Mar 2013 15:42:01 -0700 [thread overview]
Message-ID: <20130326224243.734398687@linuxfoundation.org> (raw)
In-Reply-To: <20130326224242.449070940@linuxfoundation.org>
3.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjørn Mork <bjorn@mork.no>
[ Upstream commit b701f16dd490d3f346724050f17d60beda094998 ]
commit bd877e4 ("net: qmi_wwan: use a single bind function for
all device types") made Gobi 1K devices fail probing.
Using the number of endpoints in the default altsetting to decide
whether the function use one or two interfaces is wrong. Other
altsettings may provide more endpoints.
With Gobi 1K devices, USB interface #3's altsetting is 0 by default, but
altsetting 0 only provides one interrupt endpoint and is not sufficent
for QMI. Altsetting 1 provides all 3 endpoints required for qmi_wwan
and works with QMI. Gobi 1K layout for intf#3 is:
Interface Descriptor: 255/255/255
bInterfaceNumber 3
bAlternateSetting 0
Endpoint Descriptor: Interrupt IN
Interface Descriptor: 255/255/255
bInterfaceNumber 3
bAlternateSetting 1
Endpoint Descriptor: Interrupt IN
Endpoint Descriptor: Bulk IN
Endpoint Descriptor: Bulk OUT
Prior to commit bd877e4, we would call usbnet_get_endpoints
before giving up finding enough endpoints. Removing the early
endpoint number test and the strict functional descriptor
requirement allow qmi_wwan_bind to continue until
usbnet_get_endpoints has made the final attempt to collect
endpoints. This restores the behaviour from before commit
bd877e4 without losing the added benefit of using a single bind
function.
The driver has always required a CDC Union functional descriptor
for two-interface functions. Using the existence of this
descriptor to detect two-interface functions is the logically
correct method.
Reported-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Tested-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/usb/qmi_wwan.c | 49 ++++++++++++++-------------------------------
1 file changed, 16 insertions(+), 33 deletions(-)
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -139,16 +139,9 @@ static int qmi_wwan_bind(struct usbnet *
BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data) < sizeof(struct qmi_wwan_state)));
- /* control and data is shared? */
- if (intf->cur_altsetting->desc.bNumEndpoints == 3) {
- info->control = intf;
- info->data = intf;
- goto shared;
- }
-
- /* else require a single interrupt status endpoint on control intf */
- if (intf->cur_altsetting->desc.bNumEndpoints != 1)
- goto err;
+ /* set up initial state */
+ info->control = intf;
+ info->data = intf;
/* and a number of CDC descriptors */
while (len > 3) {
@@ -207,25 +200,14 @@ next_desc:
buf += h->bLength;
}
- /* did we find all the required ones? */
- if (!(found & (1 << USB_CDC_HEADER_TYPE)) ||
- !(found & (1 << USB_CDC_UNION_TYPE))) {
- dev_err(&intf->dev, "CDC functional descriptors missing\n");
- goto err;
- }
-
- /* verify CDC Union */
- if (desc->bInterfaceNumber != cdc_union->bMasterInterface0) {
- dev_err(&intf->dev, "bogus CDC Union: master=%u\n", cdc_union->bMasterInterface0);
- goto err;
- }
-
- /* need to save these for unbind */
- info->control = intf;
- info->data = usb_ifnum_to_if(dev->udev, cdc_union->bSlaveInterface0);
- if (!info->data) {
- dev_err(&intf->dev, "bogus CDC Union: slave=%u\n", cdc_union->bSlaveInterface0);
- goto err;
+ /* Use separate control and data interfaces if we found a CDC Union */
+ if (cdc_union) {
+ info->data = usb_ifnum_to_if(dev->udev, cdc_union->bSlaveInterface0);
+ if (desc->bInterfaceNumber != cdc_union->bMasterInterface0 || !info->data) {
+ dev_err(&intf->dev, "bogus CDC Union: master=%u, slave=%u\n",
+ cdc_union->bMasterInterface0, cdc_union->bSlaveInterface0);
+ goto err;
+ }
}
/* errors aren't fatal - we can live with the dynamic address */
@@ -235,11 +217,12 @@ next_desc:
}
/* claim data interface and set it up */
- status = usb_driver_claim_interface(driver, info->data, dev);
- if (status < 0)
- goto err;
+ if (info->control != info->data) {
+ status = usb_driver_claim_interface(driver, info->data, dev);
+ if (status < 0)
+ goto err;
+ }
-shared:
status = qmi_wwan_register_subdriver(dev);
if (status < 0 && info->control != info->data) {
usb_set_intfdata(info->data, NULL);
next prev parent reply other threads:[~2013-03-26 22:42 UTC|newest]
Thread overview: 102+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-26 22:41 [ 00/98] 3.8.5-stable review Greg Kroah-Hartman
2013-03-26 22:41 ` [ 01/98] USB: EHCI: work around silicon bug in Intels EHCI controllers Greg Kroah-Hartman
2013-03-26 22:41 ` [ 02/98] sunsu: Fix panic in case of nonexistent port at "console=ttySY" cmdline option Greg Kroah-Hartman
2013-03-26 22:41 ` [ 03/98] net/ipv4: Ensure that location of timestamp option is stored Greg Kroah-Hartman
2013-03-26 22:41 ` [ 04/98] bridge: reserve space for IFLA_BRPORT_FAST_LEAVE Greg Kroah-Hartman
2013-03-26 22:41 ` [ 05/98] netconsole: dont call __netpoll_cleanup() while atomic Greg Kroah-Hartman
2013-03-26 22:41 ` [ 06/98] batman-adv: verify tt len does not exceed packet len Greg Kroah-Hartman
2013-03-26 22:41 ` [ 07/98] bonding: dont call update_speed_duplex() under spinlocks Greg Kroah-Hartman
2013-03-26 22:41 ` [ 08/98] tg3: 5715 does not link up when autoneg off Greg Kroah-Hartman
2013-03-26 22:41 ` [ 09/98] sctp: Use correct sideffect command in duplicate cookie handling Greg Kroah-Hartman
2013-03-26 22:41 ` [ 10/98] sctp: dont break the loop while meeting the active_path so as to find the matched transport Greg Kroah-Hartman
2013-03-26 22:42 ` [ 11/98] ipv4: fix definition of FIB_TABLE_HASHSZ Greg Kroah-Hartman
2013-03-26 22:42 ` Greg Kroah-Hartman [this message]
2013-03-26 22:42 ` [ 13/98] tcp: fix skb_availroom() Greg Kroah-Hartman
2013-03-26 22:42 ` [ 14/98] skb: Propagate pfmemalloc on skb from head page only Greg Kroah-Hartman
2013-03-26 22:42 ` [ 15/98] Revert "ip_gre: make ipgre_tunnel_xmit() not parse network header as IP unconditionally" Greg Kroah-Hartman
2013-03-26 22:42 ` [ 16/98] rtnetlink: Mask the rta_type when range checking Greg Kroah-Hartman
2013-03-26 22:42 ` [ 17/98] net: cdc_ncm, cdc_mbim: allow user to prefer NCM for backwards compatibility Greg Kroah-Hartman
2013-03-26 22:42 ` [ 18/98] bnx2x: add missing napi deletion in error path Greg Kroah-Hartman
2013-03-26 22:42 ` [ 19/98] vhost/net: fix heads usage of ubuf_info Greg Kroah-Hartman
2013-03-26 22:42 ` [ 20/98] bnx2x: fix occasional statistics off-by-4GB error Greg Kroah-Hartman
2013-03-26 22:42 ` [ 21/98] tcp: dont handle MTU reduction on LISTEN socket Greg Kroah-Hartman
2013-03-26 22:42 ` [ 22/98] inet: limit length of fragment queue hash table bucket lists Greg Kroah-Hartman
2013-03-26 22:42 ` [ 23/98] drivers/net/ethernet/sfc/ptp.c: adjust duplicate test Greg Kroah-Hartman
2013-03-26 22:42 ` [ 24/98] sfc: Properly sync RX DMA buffer when it is not the last in the page Greg Kroah-Hartman
2013-03-26 22:42 ` [ 25/98] sfc: Fix efx_rx_buf_offset() in the presence of swiotlb Greg Kroah-Hartman
2013-03-26 22:42 ` [ 26/98] sfc: Detach net device when stopping queues for reconfiguration Greg Kroah-Hartman
2013-03-26 22:42 ` [ 27/98] sfc: Disable soft interrupt handling during efx_device_detach_sync() Greg Kroah-Hartman
2013-03-26 22:42 ` [ 28/98] sfc: Only use TX push if a single descriptor is to be written Greg Kroah-Hartman
2013-03-26 22:42 ` [ 29/98] ALSA: hda/cirrus - Fix the digital beep registration Greg Kroah-Hartman
2013-03-26 22:42 ` [ 30/98] ALSA: hda - Fix typo in checking IEC958 emphasis bit Greg Kroah-Hartman
2013-03-26 22:42 ` [ 31/98] ALSA: usb: Parse UAC2 extension unit like for UAC1 Greg Kroah-Hartman
2013-03-26 22:42 ` [ 32/98] ALSA: snd-usb: mixer: propagate errors up the call chain Greg Kroah-Hartman
2013-03-26 22:42 ` [ 33/98] ALSA: snd-usb: mixer: ignore -EINVAL in snd_usb_mixer_controls() Greg Kroah-Hartman
2013-03-26 22:42 ` [ 34/98] saner proc_get_inode() calling conventions Greg Kroah-Hartman
2013-03-26 22:42 ` [ 35/98] vfs,proc: guarantee unique inodes in /proc Greg Kroah-Hartman
2013-03-26 22:42 ` [ 36/98] Revert "drm/i915: try to train DP even harder" Greg Kroah-Hartman
2013-03-26 22:42 ` [ 37/98] drm/i915: restrict kernel address leak in debugfs Greg Kroah-Hartman
2013-03-26 22:42 ` [ 38/98] tracing: Fix race in snapshot swapping Greg Kroah-Hartman
2013-03-26 22:42 ` [ 39/98] tracing: Fix free of probe entry by calling call_rcu_sched() Greg Kroah-Hartman
2013-03-26 22:42 ` [ 40/98] tracing: Protect tracer flags with trace_types_lock Greg Kroah-Hartman
2013-03-26 22:42 ` [ 41/98] tracing: Keep overwrite in sync between regular and snapshot buffers Greg Kroah-Hartman
2013-03-26 22:42 ` [ 42/98] rtlwifi: rtl8192cu: Fix schedule while atomic bug splat Greg Kroah-Hartman
2013-03-26 22:42 ` [ 43/98] rtlwifi: rtl8192cu: Fix problem that prevents reassociation Greg Kroah-Hartman
2013-03-26 22:42 ` [ 44/98] mwifiex: fix potential out-of-boundary access to ibss rate table Greg Kroah-Hartman
2013-03-26 22:42 ` [ 45/98] drm/i915: bounds check execbuffer relocation count Greg Kroah-Hartman
2013-03-26 22:42 ` [ 46/98] Revert "drm/i915: write backlight harder" Greg Kroah-Hartman
2013-03-26 22:42 ` [ 47/98] i2c: tegra: check the clk_prepare_enable() return value Greg Kroah-Hartman
2013-03-26 22:42 ` [ 48/98] KMS: fix EDID detailed timing vsync parsing Greg Kroah-Hartman
2013-03-26 22:42 ` [ 49/98] KMS: fix EDID detailed timing frame rate Greg Kroah-Hartman
2013-03-26 22:42 ` [ 50/98] drivers/rtc/rtc-at91rm9200.c: use a variable for storing IMR Greg Kroah-Hartman
2013-03-26 22:42 ` [ 51/98] mm/hugetlb: fix total hugetlbfs pages count when using memory overcommit accouting Greg Kroah-Hartman
2013-03-26 22:42 ` [ 52/98] drivers/video/ep93xx-fb.c: include <linux/io.h> for devm_ioremap() Greg Kroah-Hartman
2013-03-26 22:42 ` [ 53/98] mqueue: sys_mq_open: do not call mnt_drop_write() if read-only Greg Kroah-Hartman
2013-03-26 22:42 ` [ 54/98] target/iscsi: Fix mutual CHAP auth on big-endian arches Greg Kroah-Hartman
2013-03-26 22:42 ` [ 55/98] target/file: Bump FD_MAX_SECTORS to 2048 to handle 1M sized I/Os Greg Kroah-Hartman
2013-03-26 22:42 ` [ 56/98] ARM: tegra: fix register address of slink controller Greg Kroah-Hartman
2013-03-26 22:42 ` [ 57/98] dm thin: fix discard corruption Greg Kroah-Hartman
2013-03-26 22:42 ` [ 58/98] dm verity: avoid deadlock Greg Kroah-Hartman
2013-03-26 22:42 ` [ 59/98] drm/mgag200: Bug fix: Modified pll algorithm for EH project Greg Kroah-Hartman
2013-03-26 22:42 ` [ 60/98] drm/radeon: add Richland pci ids Greg Kroah-Hartman
2013-03-26 22:42 ` [ 61/98] drm/radeon: add support for Richland APUs Greg Kroah-Hartman
2013-03-26 22:42 ` [ 62/98] drm/radeon: fix S/R on VM systems (cayman/TN/SI) Greg Kroah-Hartman
2013-03-26 22:42 ` [ 63/98] drm/radeon: fix backend map setup on 1 RB trinity boards Greg Kroah-Hartman
2013-03-26 22:42 ` [ 64/98] drm/radeon/benchmark: make sure bo blit copy exists before using it Greg Kroah-Hartman
2013-03-26 22:42 ` [ 65/98] cifs: delay super block destruction until all cifsFileInfo objects are gone Greg Kroah-Hartman
2013-03-26 22:42 ` [ 66/98] cifs: ignore everything in SPNEGO blob after mechTypes Greg Kroah-Hartman
2013-03-26 22:42 ` [ 67/98] jbd2: fix use after free in jbd2_journal_dirty_metadata() Greg Kroah-Hartman
2013-03-26 22:42 ` [ 68/98] ext4: fix the wrong number of the allocated blocks in ext4_split_extent() Greg Kroah-Hartman
2013-03-26 22:42 ` [ 69/98] usb-storage: add unusual_devs entry for Samsung YP-Z3 mp3 player Greg Kroah-Hartman
2013-03-26 22:42 ` [ 70/98] ext4: use atomic64_t for the per-flexbg free_clusters count Greg Kroah-Hartman
2013-03-26 22:43 ` [ 71/98] ext4: use s_extent_max_zeroout_kb value as number of kb Greg Kroah-Hartman
2013-03-26 22:43 ` [ 72/98] ext4: fix data=journal fast mount/umount hang Greg Kroah-Hartman
2013-03-26 22:43 ` [ 73/98] IPoIB: Fix send lockup due to missed TX completion Greg Kroah-Hartman
2013-03-26 22:43 ` [ 74/98] watchdog: sp5100_tco: Set the AcpiMmioSel bitmask value to 1 instead of 2 Greg Kroah-Hartman
2013-03-26 22:43 ` [ 75/98] watchdog: sp5100_tco: Remove code that may cause a boot failure Greg Kroah-Hartman
2013-03-26 22:43 ` [ 76/98] md/raid5: schedule_construction should abort if nothing to do Greg Kroah-Hartman
2013-03-26 22:43 ` [ 77/98] MD RAID5: Avoid accessing gendisk or queue structs when not available Greg Kroah-Hartman
2013-03-26 22:43 ` [ 78/98] md/raid5: ensure sync and DISCARD dont happen at the same time Greg Kroah-Hartman
2013-03-26 22:43 ` [ 79/98] nfsd: fix bad offset use Greg Kroah-Hartman
2013-03-26 22:43 ` [ 80/98] clockevents: Dont allow dummy broadcast timers Greg Kroah-Hartman
2013-03-26 22:43 ` [ 81/98] x86-64: Fix the failure case in copy_user_handle_tail() Greg Kroah-Hartman
2013-03-26 22:43 ` [ 82/98] USB: xhci - fix bit definitions for IMAN register Greg Kroah-Hartman
2013-03-26 22:43 ` [ 83/98] USB: xhci: correctly enable interrupts Greg Kroah-Hartman
2013-03-26 22:43 ` [ 84/98] USB: cdc-acm: fix device unregistration Greg Kroah-Hartman
2013-03-26 22:43 ` [ 85/98] USB: EHCI: fix regression during bus resume Greg Kroah-Hartman
2013-03-26 22:43 ` [ 86/98] USB: EHCI: fix regression in QH unlinking Greg Kroah-Hartman
2013-03-26 22:43 ` [ 87/98] usb: gadget: ffs: fix enable multiple instances Greg Kroah-Hartman
2013-03-26 22:43 ` [ 88/98] USB: serial: fix interface refcounting Greg Kroah-Hartman
2013-03-26 22:43 ` [ 89/98] efivars: Allow disabling use as a pstore backend Greg Kroah-Hartman
2013-03-26 22:43 ` [ 90/98] efivars: Add module parameter to disable " Greg Kroah-Hartman
2013-03-26 22:43 ` [ 91/98] efivars: Fix check for CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE Greg Kroah-Hartman
2013-03-26 22:43 ` [ 92/98] ACPI: Rework acpi_get_child() to be more efficient Greg Kroah-Hartman
2013-03-26 22:43 ` [ 93/98] udf: Fix bitmap overflow on large filesystems with small block size Greg Kroah-Hartman
2013-03-26 22:43 ` [ 94/98] USB: garmin_gps: fix memory leak on disconnect Greg Kroah-Hartman
2013-03-26 22:43 ` [ 95/98] USB: io_ti: fix get_icount for two port adapters Greg Kroah-Hartman
2013-03-26 22:43 ` [ 96/98] usb: musb: da8xx: Fix build breakage due to typo Greg Kroah-Hartman
2013-03-26 22:43 ` [ 97/98] ARM: DMA-mapping: add missing GFP_DMA flag for atomic buffer allocation Greg Kroah-Hartman
2013-03-26 22:43 ` [ 98/98] rt2x00: error in configurations with mesh support disabled Greg Kroah-Hartman
2013-03-27 18:34 ` [ 00/98] 3.8.5-stable review Shuah Khan
2013-03-27 18:40 ` Greg Kroah-Hartman
2013-03-28 14:12 ` Satoru Takeuchi
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=20130326224243.734398687@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=bjorn@mork.no \
--cc=davem@davemloft.net \
--cc=dcbw@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.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).