diff options
author | Dan Williams <dcbw@redhat.com> | 2012-02-24 14:08:43 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 15:53:38 -0500 |
commit | c192c8e71a2ded01170c1a992cd21aaedc822756 (patch) | |
tree | 7d2849700b7bdffae51ab2ff8ea7d131b895ec48 | |
parent | f799e7678390029e322ae2dc3cda389b11f38124 (diff) |
USB: qcserial: don't grab QMI port on Gobi 1000 devices
Gobi 1000 devices have a different port layout, which wasn't respected
by the current driver, and thus it grabbed the QMI/net port. In the
near future we'll be attaching another driver to the QMI/net port for
these devices (cdc-wdm and qmi_wwan) so make sure the qcserial driver
doesn't claim them. This patch also prevents qcserial from binding to
interfaces 0 and 1 on 1K devices because those interfaces do not
respond.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/serial/qcserial.c | 105 |
1 files changed, 62 insertions, 43 deletions
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 70e9f1abdad1..4f3a5a794884 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -24,39 +24,44 @@ | |||
24 | 24 | ||
25 | static bool debug; | 25 | static bool debug; |
26 | 26 | ||
27 | #define DEVICE_G1K(v, p) \ | ||
28 | USB_DEVICE(v, p), .driver_info = 1 | ||
29 | |||
27 | static const struct usb_device_id id_table[] = { | 30 | static const struct usb_device_id id_table[] = { |
28 | {USB_DEVICE(0x05c6, 0x9211)}, /* Acer Gobi QDL device */ | 31 | /* Gobi 1000 devices */ |
29 | {USB_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ | 32 | {DEVICE_G1K(0x05c6, 0x9211)}, /* Acer Gobi QDL device */ |
30 | {USB_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ | 33 | {DEVICE_G1K(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ |
31 | {USB_DEVICE(0x03f0, 0x201d)}, /* HP un2400 Gobi QDL Device */ | 34 | {DEVICE_G1K(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ |
32 | {USB_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ | 35 | {DEVICE_G1K(0x03f0, 0x201d)}, /* HP un2400 Gobi QDL Device */ |
33 | {USB_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ | 36 | {DEVICE_G1K(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ |
34 | {USB_DEVICE(0x04da, 0x250c)}, /* Panasonic Gobi QDL device */ | 37 | {DEVICE_G1K(0x04da, 0x250c)}, /* Panasonic Gobi QDL device */ |
35 | {USB_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ | 38 | {DEVICE_G1K(0x413c, 0x8172)}, /* Dell Gobi Modem device */ |
36 | {USB_DEVICE(0x413c, 0x8171)}, /* Dell Gobi QDL device */ | 39 | {DEVICE_G1K(0x413c, 0x8171)}, /* Dell Gobi QDL device */ |
37 | {USB_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ | 40 | {DEVICE_G1K(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ |
38 | {USB_DEVICE(0x1410, 0xa008)}, /* Novatel Gobi QDL device */ | 41 | {DEVICE_G1K(0x1410, 0xa008)}, /* Novatel Gobi QDL device */ |
39 | {USB_DEVICE(0x1410, 0xa010)}, /* Novatel Gobi QDL device */ | 42 | {DEVICE_G1K(0x0b05, 0x1776)}, /* Asus Gobi Modem device */ |
40 | {USB_DEVICE(0x1410, 0xa011)}, /* Novatel Gobi QDL device */ | 43 | {DEVICE_G1K(0x0b05, 0x1774)}, /* Asus Gobi QDL device */ |
41 | {USB_DEVICE(0x1410, 0xa012)}, /* Novatel Gobi QDL device */ | 44 | {DEVICE_G1K(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */ |
42 | {USB_DEVICE(0x1410, 0xa013)}, /* Novatel Gobi QDL device */ | 45 | {DEVICE_G1K(0x19d2, 0xfff2)}, /* ONDA Gobi QDL device */ |
43 | {USB_DEVICE(0x1410, 0xa014)}, /* Novatel Gobi QDL device */ | 46 | {DEVICE_G1K(0x1557, 0x0a80)}, /* OQO Gobi QDL device */ |
44 | {USB_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */ | 47 | {DEVICE_G1K(0x05c6, 0x9001)}, /* Generic Gobi Modem device */ |
45 | {USB_DEVICE(0x0b05, 0x1774)}, /* Asus Gobi QDL device */ | 48 | {DEVICE_G1K(0x05c6, 0x9002)}, /* Generic Gobi Modem device */ |
46 | {USB_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */ | 49 | {DEVICE_G1K(0x05c6, 0x9202)}, /* Generic Gobi Modem device */ |
47 | {USB_DEVICE(0x19d2, 0xfff2)}, /* ONDA Gobi QDL device */ | 50 | {DEVICE_G1K(0x05c6, 0x9203)}, /* Generic Gobi Modem device */ |
48 | {USB_DEVICE(0x1557, 0x0a80)}, /* OQO Gobi QDL device */ | 51 | {DEVICE_G1K(0x05c6, 0x9222)}, /* Generic Gobi Modem device */ |
49 | {USB_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */ | 52 | {DEVICE_G1K(0x05c6, 0x9008)}, /* Generic Gobi QDL device */ |
50 | {USB_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */ | 53 | {DEVICE_G1K(0x05c6, 0x9009)}, /* Generic Gobi Modem device */ |
51 | {USB_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */ | 54 | {DEVICE_G1K(0x05c6, 0x9201)}, /* Generic Gobi QDL device */ |
52 | {USB_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */ | 55 | {DEVICE_G1K(0x05c6, 0x9221)}, /* Generic Gobi QDL device */ |
53 | {USB_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */ | 56 | {DEVICE_G1K(0x05c6, 0x9231)}, /* Generic Gobi QDL device */ |
54 | {USB_DEVICE(0x05c6, 0x9008)}, /* Generic Gobi QDL device */ | 57 | {DEVICE_G1K(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ |
55 | {USB_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */ | 58 | |
56 | {USB_DEVICE(0x05c6, 0x9201)}, /* Generic Gobi QDL device */ | 59 | /* Gobi 2000 devices */ |
57 | {USB_DEVICE(0x05c6, 0x9221)}, /* Generic Gobi QDL device */ | 60 | {USB_DEVICE(0x1410, 0xa010)}, /* Novatel Gobi 2000 QDL device */ |
58 | {USB_DEVICE(0x05c6, 0x9231)}, /* Generic Gobi QDL device */ | 61 | {USB_DEVICE(0x1410, 0xa011)}, /* Novatel Gobi 2000 QDL device */ |
59 | {USB_DEVICE(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ | 62 | {USB_DEVICE(0x1410, 0xa012)}, /* Novatel Gobi 2000 QDL device */ |
63 | {USB_DEVICE(0x1410, 0xa013)}, /* Novatel Gobi 2000 QDL device */ | ||
64 | {USB_DEVICE(0x1410, 0xa014)}, /* Novatel Gobi 2000 QDL device */ | ||
60 | {USB_DEVICE(0x413c, 0x8185)}, /* Dell Gobi 2000 QDL device (N0218, VU936) */ | 65 | {USB_DEVICE(0x413c, 0x8185)}, /* Dell Gobi 2000 QDL device (N0218, VU936) */ |
61 | {USB_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ | 66 | {USB_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ |
62 | {USB_DEVICE(0x05c6, 0x9208)}, /* Generic Gobi 2000 QDL device */ | 67 | {USB_DEVICE(0x05c6, 0x9208)}, /* Generic Gobi 2000 QDL device */ |
@@ -92,6 +97,8 @@ static const struct usb_device_id id_table[] = { | |||
92 | {USB_DEVICE(0x05c6, 0x9204)}, /* Gobi 2000 QDL device */ | 97 | {USB_DEVICE(0x05c6, 0x9204)}, /* Gobi 2000 QDL device */ |
93 | {USB_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */ | 98 | {USB_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */ |
94 | 99 | ||
100 | /* Gobi 3000 devices */ | ||
101 | {USB_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Gobi 3000 QDL */ | ||
95 | {USB_DEVICE(0x05c6, 0x920c)}, /* Gobi 3000 QDL */ | 102 | {USB_DEVICE(0x05c6, 0x920c)}, /* Gobi 3000 QDL */ |
96 | {USB_DEVICE(0x05c6, 0x920d)}, /* Gobi 3000 Composite */ | 103 | {USB_DEVICE(0x05c6, 0x920d)}, /* Gobi 3000 Composite */ |
97 | {USB_DEVICE(0x1410, 0xa020)}, /* Novatel Gobi 3000 QDL */ | 104 | {USB_DEVICE(0x1410, 0xa020)}, /* Novatel Gobi 3000 QDL */ |
@@ -122,8 +129,10 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) | |||
122 | int retval = -ENODEV; | 129 | int retval = -ENODEV; |
123 | __u8 nintf; | 130 | __u8 nintf; |
124 | __u8 ifnum; | 131 | __u8 ifnum; |
132 | bool is_gobi1k = id->driver_info ? true : false; | ||
125 | 133 | ||
126 | dbg("%s", __func__); | 134 | dbg("%s", __func__); |
135 | dbg("Is Gobi 1000 = %d", is_gobi1k); | ||
127 | 136 | ||
128 | nintf = serial->dev->actconfig->desc.bNumInterfaces; | 137 | nintf = serial->dev->actconfig->desc.bNumInterfaces; |
129 | dbg("Num Interfaces = %d", nintf); | 138 | dbg("Num Interfaces = %d", nintf); |
@@ -169,15 +178,25 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) | |||
169 | 178 | ||
170 | case 3: | 179 | case 3: |
171 | case 4: | 180 | case 4: |
172 | /* Composite mode */ | 181 | /* Composite mode; don't bind to the QMI/net interface as that |
173 | /* ifnum == 0 is a broadband network adapter */ | 182 | * gets handled by other drivers. |
174 | if (ifnum == 1) { | 183 | */ |
175 | /* | 184 | |
176 | * Diagnostics Monitor (serial line 9600 8N1) | 185 | /* Gobi 1K USB layout: |
177 | * Qualcomm DM protocol | 186 | * 0: serial port (doesn't respond) |
178 | * use "libqcdm" (ModemManager) for communication | 187 | * 1: serial port (doesn't respond) |
179 | */ | 188 | * 2: AT-capable modem port |
180 | dbg("Diagnostics Monitor found"); | 189 | * 3: QMI/net |
190 | * | ||
191 | * Gobi 2K+ USB layout: | ||
192 | * 0: QMI/net | ||
193 | * 1: DM/DIAG (use libqcdm from ModemManager for communication) | ||
194 | * 2: AT-capable modem port | ||
195 | * 3: NMEA | ||
196 | */ | ||
197 | |||
198 | if (ifnum == 1 && !is_gobi1k) { | ||
199 | dbg("Gobi 2K+ DM/DIAG interface found"); | ||
181 | retval = usb_set_interface(serial->dev, ifnum, 0); | 200 | retval = usb_set_interface(serial->dev, ifnum, 0); |
182 | if (retval < 0) { | 201 | if (retval < 0) { |
183 | dev_err(&serial->dev->dev, | 202 | dev_err(&serial->dev->dev, |
@@ -196,13 +215,13 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) | |||
196 | retval = -ENODEV; | 215 | retval = -ENODEV; |
197 | kfree(data); | 216 | kfree(data); |
198 | } | 217 | } |
199 | } else if (ifnum==3) { | 218 | } else if (ifnum==3 && !is_gobi1k) { |
200 | /* | 219 | /* |
201 | * NMEA (serial line 9600 8N1) | 220 | * NMEA (serial line 9600 8N1) |
202 | * # echo "\$GPS_START" > /dev/ttyUSBx | 221 | * # echo "\$GPS_START" > /dev/ttyUSBx |
203 | * # echo "\$GPS_STOP" > /dev/ttyUSBx | 222 | * # echo "\$GPS_STOP" > /dev/ttyUSBx |
204 | */ | 223 | */ |
205 | dbg("NMEA GPS interface found"); | 224 | dbg("Gobi 2K+ NMEA GPS interface found"); |
206 | retval = usb_set_interface(serial->dev, ifnum, 0); | 225 | retval = usb_set_interface(serial->dev, ifnum, 0); |
207 | if (retval < 0) { | 226 | if (retval < 0) { |
208 | dev_err(&serial->dev->dev, | 227 | dev_err(&serial->dev->dev, |