OSDN Git Service

cdc_ncm: toggle altsetting to force reset before setup
authorBjørn Mork <bjorn@mork.no>
Thu, 3 Mar 2016 21:20:53 +0000 (22:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2016 06:41:59 +0000 (15:41 +0900)
commit3aaa64b61a787d0aedc5c3fe36102419fc4eeb93
treead3439adb1eff67920c4f9496ffc769992c94a40
parent32cb6781a96f24287a7b3c8716f47b0e8768709d
cdc_ncm: toggle altsetting to force reset before setup

[ Upstream commit 48906f62c96cc2cd35753e59310cb70eb08cc6a5 ]

Some devices will silently fail setup unless they are reset first.
This is necessary even if the data interface is already in
altsetting 0, which it will be when the device is probed for the
first time.  Briefly toggling the altsetting forces a function
reset regardless of the initial state.

This fixes a setup problem observed on a number of Huawei devices,
appearing to operate in NTB-32 mode even if we explicitly set them
to NTB-16 mode.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/usb/cdc_ncm.c