aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-22 16:14:16 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-22 16:14:16 -0500
commit39470bf24d93927bb27929b9f0d52ff5d608cfcb (patch)
tree36c5f47fbf29f58f96970083a7e0d44d34cdf81d
parent2596627c5c30b45aa206b7b1b864bf00de3c3503 (diff)
parent39559b4ff89e390c42633d23d257e793a1177e03 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: USB: unusual_devs.h entry for nokia 6233 USB: Fix for typo in ohci-ep93xx.c USB: disable USB_MULTITHREAD_PROBE USB: add vendor/device id for Option GT Max 3.6 cards USB: unusual_devs.h for 0x046b:ff40 USB: make usbhid ignore Imation Disc Stakka USB: rndis_host: fix crash while probing a Nokia S60 mobile USB: asix: Detect internal PHY and enable/use accordingly usbtouchscreen: make ITM screens report BTN_TOUCH as zero when not touched
-rw-r--r--drivers/usb/core/Kconfig16
-rw-r--r--drivers/usb/core/hub.c9
-rw-r--r--drivers/usb/host/ohci-ep93xx.c2
-rw-r--r--drivers/usb/input/hid-core.c4
-rw-r--r--drivers/usb/input/usbtouchscreen.c98
-rw-r--r--drivers/usb/net/asix.c18
-rw-r--r--drivers/usb/net/rndis_host.c23
-rw-r--r--drivers/usb/serial/option.c3
-rw-r--r--drivers/usb/storage/unusual_devs.h19
9 files changed, 114 insertions, 78 deletions
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index f8324d8d06ac..3e66b2a9974a 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -72,22 +72,6 @@ config USB_SUSPEND
72 72
73 If you are unsure about this, say N here. 73 If you are unsure about this, say N here.
74 74
75config USB_MULTITHREAD_PROBE
76 bool "USB Multi-threaded probe (EXPERIMENTAL)"
77 depends on USB && EXPERIMENTAL
78 default n
79 help
80 Say Y here if you want the USB core to spawn a new thread for
81 every USB device that is probed. This can cause a small speedup
82 in boot times on systems with a lot of different USB devices.
83
84 This option should be safe to enable, but if any odd probing
85 problems are found, please disable it, or dynamically turn it
86 off in the /sys/module/usbcore/parameters/multithread_probe
87 file
88
89 When in doubt, say N.
90
91config USB_OTG 75config USB_OTG
92 bool 76 bool
93 depends on USB && EXPERIMENTAL 77 depends on USB && EXPERIMENTAL
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 2651c2e2a89f..1988224b362b 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -88,14 +88,7 @@ static DECLARE_WAIT_QUEUE_HEAD(khubd_wait);
88static struct task_struct *khubd_task; 88static struct task_struct *khubd_task;
89 89
90/* multithreaded probe logic */ 90/* multithreaded probe logic */
91static int multithread_probe = 91static int multithread_probe = 0;
92#ifdef CONFIG_USB_MULTITHREAD_PROBE
93 1;
94#else
95 0;
96#endif
97module_param(multithread_probe, bool, S_IRUGO);
98MODULE_PARM_DESC(multithread_probe, "Run each USB device probe in a new thread");
99 92
100/* cycle leds on hubs that aren't blinking for attention */ 93/* cycle leds on hubs that aren't blinking for attention */
101static int blinkenlights = 0; 94static int blinkenlights = 0;
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c
index 43ae696b2ec2..3348b07f0fe5 100644
--- a/drivers/usb/host/ohci-ep93xx.c
+++ b/drivers/usb/host/ohci-ep93xx.c
@@ -169,7 +169,7 @@ static int ohci_hcd_ep93xx_drv_remove(struct platform_device *pdev)
169static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_t state) 169static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_t state)
170{ 170{
171 struct usb_hcd *hcd = platform_get_drvdata(pdev); 171 struct usb_hcd *hcd = platform_get_drvdata(pdev);
172 struct ochi_hcd *ohci = hcd_to_ohci(hcd); 172 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
173 173
174 if (time_before(jiffies, ohci->next_statechange)) 174 if (time_before(jiffies, ohci->next_statechange))
175 msleep(5); 175 msleep(5);
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 6e739efee6f7..ea3636d96e1b 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -796,6 +796,9 @@ void usbhid_init_reports(struct hid_device *hid)
796#define USB_VENDOR_ID_LOGITECH 0x046d 796#define USB_VENDOR_ID_LOGITECH 0x046d
797#define USB_DEVICE_ID_LOGITECH_USB_RECEIVER 0xc101 797#define USB_DEVICE_ID_LOGITECH_USB_RECEIVER 0xc101
798 798
799#define USB_VENDOR_ID_IMATION 0x0718
800#define USB_DEVICE_ID_DISC_STAKKA 0xd000
801
799/* 802/*
800 * Alphabetically sorted blacklist by quirk type. 803 * Alphabetically sorted blacklist by quirk type.
801 */ 804 */
@@ -883,6 +886,7 @@ static const struct hid_blacklist {
883 { USB_VENDOR_ID_GTCO_IPANEL_1, USB_DEVICE_ID_GTCO_10, HID_QUIRK_IGNORE }, 886 { USB_VENDOR_ID_GTCO_IPANEL_1, USB_DEVICE_ID_GTCO_10, HID_QUIRK_IGNORE },
884 { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_8, HID_QUIRK_IGNORE }, 887 { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_8, HID_QUIRK_IGNORE },
885 { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_d, HID_QUIRK_IGNORE }, 888 { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_d, HID_QUIRK_IGNORE },
889 { USB_VENDOR_ID_IMATION, USB_DEVICE_ID_DISC_STAKKA, HID_QUIRK_IGNORE },
886 { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE }, 890 { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE },
887 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE }, 891 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE },
888 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY, HID_QUIRK_IGNORE }, 892 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY, HID_QUIRK_IGNORE },
diff --git a/drivers/usb/input/usbtouchscreen.c b/drivers/usb/input/usbtouchscreen.c
index 7f3c57da9bc0..86e37a20f8e5 100644
--- a/drivers/usb/input/usbtouchscreen.c
+++ b/drivers/usb/input/usbtouchscreen.c
@@ -66,7 +66,7 @@ struct usbtouch_device_info {
66 66
67 void (*process_pkt) (struct usbtouch_usb *usbtouch, unsigned char *pkt, int len); 67 void (*process_pkt) (struct usbtouch_usb *usbtouch, unsigned char *pkt, int len);
68 int (*get_pkt_len) (unsigned char *pkt, int len); 68 int (*get_pkt_len) (unsigned char *pkt, int len);
69 int (*read_data) (unsigned char *pkt, int *x, int *y, int *touch, int *press); 69 int (*read_data) (struct usbtouch_usb *usbtouch, unsigned char *pkt);
70 int (*init) (struct usbtouch_usb *usbtouch); 70 int (*init) (struct usbtouch_usb *usbtouch);
71}; 71};
72 72
@@ -85,6 +85,9 @@ struct usbtouch_usb {
85 struct usbtouch_device_info *type; 85 struct usbtouch_device_info *type;
86 char name[128]; 86 char name[128];
87 char phys[64]; 87 char phys[64];
88
89 int x, y;
90 int touch, press;
88}; 91};
89 92
90 93
@@ -161,14 +164,14 @@ static struct usb_device_id usbtouch_devices[] = {
161#define EGALAX_PKT_TYPE_REPT 0x80 164#define EGALAX_PKT_TYPE_REPT 0x80
162#define EGALAX_PKT_TYPE_DIAG 0x0A 165#define EGALAX_PKT_TYPE_DIAG 0x0A
163 166
164static int egalax_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) 167static int egalax_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
165{ 168{
166 if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT) 169 if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT)
167 return 0; 170 return 0;
168 171
169 *x = ((pkt[3] & 0x0F) << 7) | (pkt[4] & 0x7F); 172 dev->x = ((pkt[3] & 0x0F) << 7) | (pkt[4] & 0x7F);
170 *y = ((pkt[1] & 0x0F) << 7) | (pkt[2] & 0x7F); 173 dev->y = ((pkt[1] & 0x0F) << 7) | (pkt[2] & 0x7F);
171 *touch = pkt[0] & 0x01; 174 dev->touch = pkt[0] & 0x01;
172 175
173 return 1; 176 return 1;
174} 177}
@@ -195,11 +198,11 @@ static int egalax_get_pkt_len(unsigned char *buf, int len)
195 * PanJit Part 198 * PanJit Part
196 */ 199 */
197#ifdef CONFIG_USB_TOUCHSCREEN_PANJIT 200#ifdef CONFIG_USB_TOUCHSCREEN_PANJIT
198static int panjit_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) 201static int panjit_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
199{ 202{
200 *x = ((pkt[2] & 0x0F) << 8) | pkt[1]; 203 dev->x = ((pkt[2] & 0x0F) << 8) | pkt[1];
201 *y = ((pkt[4] & 0x0F) << 8) | pkt[3]; 204 dev->y = ((pkt[4] & 0x0F) << 8) | pkt[3];
202 *touch = pkt[0] & 0x01; 205 dev->touch = pkt[0] & 0x01;
203 206
204 return 1; 207 return 1;
205} 208}
@@ -215,11 +218,11 @@ static int panjit_read_data(unsigned char *pkt, int *x, int *y, int *touch, int
215#define MTOUCHUSB_RESET 7 218#define MTOUCHUSB_RESET 7
216#define MTOUCHUSB_REQ_CTRLLR_ID 10 219#define MTOUCHUSB_REQ_CTRLLR_ID 10
217 220
218static int mtouch_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) 221static int mtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
219{ 222{
220 *x = (pkt[8] << 8) | pkt[7]; 223 dev->x = (pkt[8] << 8) | pkt[7];
221 *y = (pkt[10] << 8) | pkt[9]; 224 dev->y = (pkt[10] << 8) | pkt[9];
222 *touch = (pkt[2] & 0x40) ? 1 : 0; 225 dev->touch = (pkt[2] & 0x40) ? 1 : 0;
223 226
224 return 1; 227 return 1;
225} 228}
@@ -260,14 +263,32 @@ static int mtouch_init(struct usbtouch_usb *usbtouch)
260 * ITM Part 263 * ITM Part
261 */ 264 */
262#ifdef CONFIG_USB_TOUCHSCREEN_ITM 265#ifdef CONFIG_USB_TOUCHSCREEN_ITM
263static int itm_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) 266static int itm_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
264{ 267{
265 *x = ((pkt[0] & 0x1F) << 7) | (pkt[3] & 0x7F); 268 int touch;
266 *y = ((pkt[1] & 0x1F) << 7) | (pkt[4] & 0x7F); 269 /*
267 *press = ((pkt[2] & 0x01) << 7) | (pkt[5] & 0x7F); 270 * ITM devices report invalid x/y data if not touched.
268 *touch = ~pkt[7] & 0x20; 271 * if the screen was touched before but is not touched any more
272 * report touch as 0 with the last valid x/y data once. then stop
273 * reporting data until touched again.
274 */
275 dev->press = ((pkt[2] & 0x01) << 7) | (pkt[5] & 0x7F);
276
277 touch = ~pkt[7] & 0x20;
278 if (!touch) {
279 if (dev->touch) {
280 dev->touch = 0;
281 return 1;
282 }
269 283
270 return *touch; 284 return 0;
285 }
286
287 dev->x = ((pkt[0] & 0x1F) << 7) | (pkt[3] & 0x7F);
288 dev->y = ((pkt[1] & 0x1F) << 7) | (pkt[4] & 0x7F);
289 dev->touch = touch;
290
291 return 1;
271} 292}
272#endif 293#endif
273 294
@@ -276,7 +297,7 @@ static int itm_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *pr
276 * eTurboTouch part 297 * eTurboTouch part
277 */ 298 */
278#ifdef CONFIG_USB_TOUCHSCREEN_ETURBO 299#ifdef CONFIG_USB_TOUCHSCREEN_ETURBO
279static int eturbo_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) 300static int eturbo_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
280{ 301{
281 unsigned int shift; 302 unsigned int shift;
282 303
@@ -285,9 +306,9 @@ static int eturbo_read_data(unsigned char *pkt, int *x, int *y, int *touch, int
285 return 0; 306 return 0;
286 307
287 shift = (6 - (pkt[0] & 0x03)); 308 shift = (6 - (pkt[0] & 0x03));
288 *x = ((pkt[3] << 7) | pkt[4]) >> shift; 309 dev->x = ((pkt[3] << 7) | pkt[4]) >> shift;
289 *y = ((pkt[1] << 7) | pkt[2]) >> shift; 310 dev->y = ((pkt[1] << 7) | pkt[2]) >> shift;
290 *touch = (pkt[0] & 0x10) ? 1 : 0; 311 dev->touch = (pkt[0] & 0x10) ? 1 : 0;
291 312
292 return 1; 313 return 1;
293} 314}
@@ -307,14 +328,14 @@ static int eturbo_get_pkt_len(unsigned char *buf, int len)
307 * Gunze part 328 * Gunze part
308 */ 329 */
309#ifdef CONFIG_USB_TOUCHSCREEN_GUNZE 330#ifdef CONFIG_USB_TOUCHSCREEN_GUNZE
310static int gunze_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) 331static int gunze_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
311{ 332{
312 if (!(pkt[0] & 0x80) || ((pkt[1] | pkt[2] | pkt[3]) & 0x80)) 333 if (!(pkt[0] & 0x80) || ((pkt[1] | pkt[2] | pkt[3]) & 0x80))
313 return 0; 334 return 0;
314 335
315 *x = ((pkt[0] & 0x1F) << 7) | (pkt[2] & 0x7F); 336 dev->x = ((pkt[0] & 0x1F) << 7) | (pkt[2] & 0x7F);
316 *y = ((pkt[1] & 0x1F) << 7) | (pkt[3] & 0x7F); 337 dev->y = ((pkt[1] & 0x1F) << 7) | (pkt[3] & 0x7F);
317 *touch = pkt[0] & 0x20; 338 dev->touch = pkt[0] & 0x20;
318 339
319 return 1; 340 return 1;
320} 341}
@@ -383,11 +404,11 @@ static int dmc_tsc10_init(struct usbtouch_usb *usbtouch)
383} 404}
384 405
385 406
386static int dmc_tsc10_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) 407static int dmc_tsc10_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
387{ 408{
388 *x = ((pkt[2] & 0x03) << 8) | pkt[1]; 409 dev->x = ((pkt[2] & 0x03) << 8) | pkt[1];
389 *y = ((pkt[4] & 0x03) << 8) | pkt[3]; 410 dev->y = ((pkt[4] & 0x03) << 8) | pkt[3];
390 *touch = pkt[0] & 0x01; 411 dev->touch = pkt[0] & 0x01;
391 412
392 return 1; 413 return 1;
393} 414}
@@ -492,23 +513,22 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
492static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch, 513static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch,
493 unsigned char *pkt, int len) 514 unsigned char *pkt, int len)
494{ 515{
495 int x, y, touch, press;
496 struct usbtouch_device_info *type = usbtouch->type; 516 struct usbtouch_device_info *type = usbtouch->type;
497 517
498 if (!type->read_data(pkt, &x, &y, &touch, &press)) 518 if (!type->read_data(usbtouch, pkt))
499 return; 519 return;
500 520
501 input_report_key(usbtouch->input, BTN_TOUCH, touch); 521 input_report_key(usbtouch->input, BTN_TOUCH, usbtouch->touch);
502 522
503 if (swap_xy) { 523 if (swap_xy) {
504 input_report_abs(usbtouch->input, ABS_X, y); 524 input_report_abs(usbtouch->input, ABS_X, usbtouch->y);
505 input_report_abs(usbtouch->input, ABS_Y, x); 525 input_report_abs(usbtouch->input, ABS_Y, usbtouch->x);
506 } else { 526 } else {
507 input_report_abs(usbtouch->input, ABS_X, x); 527 input_report_abs(usbtouch->input, ABS_X, usbtouch->x);
508 input_report_abs(usbtouch->input, ABS_Y, y); 528 input_report_abs(usbtouch->input, ABS_Y, usbtouch->y);
509 } 529 }
510 if (type->max_press) 530 if (type->max_press)
511 input_report_abs(usbtouch->input, ABS_PRESSURE, press); 531 input_report_abs(usbtouch->input, ABS_PRESSURE, usbtouch->press);
512 input_sync(usbtouch->input); 532 input_sync(usbtouch->input);
513} 533}
514 534
diff --git a/drivers/usb/net/asix.c b/drivers/usb/net/asix.c
index f538013965b0..896449f0cf85 100644
--- a/drivers/usb/net/asix.c
+++ b/drivers/usb/net/asix.c
@@ -898,7 +898,7 @@ static int ax88772_link_reset(struct usbnet *dev)
898 898
899static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) 899static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
900{ 900{
901 int ret; 901 int ret, embd_phy;
902 void *buf; 902 void *buf;
903 u16 rx_ctl; 903 u16 rx_ctl;
904 struct asix_data *data = (struct asix_data *)&dev->data; 904 struct asix_data *data = (struct asix_data *)&dev->data;
@@ -919,13 +919,15 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
919 AX_GPIO_RSE | AX_GPIO_GPO_2 | AX_GPIO_GPO2EN, 5)) < 0) 919 AX_GPIO_RSE | AX_GPIO_GPO_2 | AX_GPIO_GPO2EN, 5)) < 0)
920 goto out2; 920 goto out2;
921 921
922 /* 0x10 is the phy id of the embedded 10/100 ethernet phy */
923 embd_phy = ((asix_get_phy_addr(dev) & 0x1f) == 0x10 ? 1 : 0);
922 if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, 924 if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT,
923 1, 0, 0, buf)) < 0) { 925 embd_phy, 0, 0, buf)) < 0) {
924 dbg("Select PHY #1 failed: %d", ret); 926 dbg("Select PHY #1 failed: %d", ret);
925 goto out2; 927 goto out2;
926 } 928 }
927 929
928 if ((ret = asix_sw_reset(dev, AX_SWRESET_IPPD)) < 0) 930 if ((ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL)) < 0)
929 goto out2; 931 goto out2;
930 932
931 msleep(150); 933 msleep(150);
@@ -933,8 +935,14 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
933 goto out2; 935 goto out2;
934 936
935 msleep(150); 937 msleep(150);
936 if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL | AX_SWRESET_PRL)) < 0) 938 if (embd_phy) {
937 goto out2; 939 if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL)) < 0)
940 goto out2;
941 }
942 else {
943 if ((ret = asix_sw_reset(dev, AX_SWRESET_PRTE)) < 0)
944 goto out2;
945 }
938 946
939 msleep(150); 947 msleep(150);
940 rx_ctl = asix_read_rx_ctl(dev); 948 rx_ctl = asix_read_rx_ctl(dev);
diff --git a/drivers/usb/net/rndis_host.c b/drivers/usb/net/rndis_host.c
index ea5f44de3de2..a322a16d9cf8 100644
--- a/drivers/usb/net/rndis_host.c
+++ b/drivers/usb/net/rndis_host.c
@@ -379,6 +379,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
379{ 379{
380 int retval; 380 int retval;
381 struct net_device *net = dev->net; 381 struct net_device *net = dev->net;
382 struct cdc_state *info = (void *) &dev->data;
382 union { 383 union {
383 void *buf; 384 void *buf;
384 struct rndis_msg_hdr *header; 385 struct rndis_msg_hdr *header;
@@ -397,7 +398,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
397 return -ENOMEM; 398 return -ENOMEM;
398 retval = usbnet_generic_cdc_bind(dev, intf); 399 retval = usbnet_generic_cdc_bind(dev, intf);
399 if (retval < 0) 400 if (retval < 0)
400 goto done; 401 goto fail;
401 402
402 net->hard_header_len += sizeof (struct rndis_data_hdr); 403 net->hard_header_len += sizeof (struct rndis_data_hdr);
403 404
@@ -412,10 +413,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
412 if (unlikely(retval < 0)) { 413 if (unlikely(retval < 0)) {
413 /* it might not even be an RNDIS device!! */ 414 /* it might not even be an RNDIS device!! */
414 dev_err(&intf->dev, "RNDIS init failed, %d\n", retval); 415 dev_err(&intf->dev, "RNDIS init failed, %d\n", retval);
415fail: 416 goto fail_and_release;
416 usb_driver_release_interface(driver_of(intf),
417 ((struct cdc_state *)&(dev->data))->data);
418 goto done;
419 } 417 }
420 dev->hard_mtu = le32_to_cpu(u.init_c->max_transfer_size); 418 dev->hard_mtu = le32_to_cpu(u.init_c->max_transfer_size);
421 /* REVISIT: peripheral "alignment" request is ignored ... */ 419 /* REVISIT: peripheral "alignment" request is ignored ... */
@@ -431,7 +429,7 @@ fail:
431 retval = rndis_command(dev, u.header); 429 retval = rndis_command(dev, u.header);
432 if (unlikely(retval < 0)) { 430 if (unlikely(retval < 0)) {
433 dev_err(&intf->dev, "rndis get ethaddr, %d\n", retval); 431 dev_err(&intf->dev, "rndis get ethaddr, %d\n", retval);
434 goto fail; 432 goto fail_and_release;
435 } 433 }
436 tmp = le32_to_cpu(u.get_c->offset); 434 tmp = le32_to_cpu(u.get_c->offset);
437 if (unlikely((tmp + 8) > (1024 - ETH_ALEN) 435 if (unlikely((tmp + 8) > (1024 - ETH_ALEN)
@@ -439,7 +437,7 @@ fail:
439 dev_err(&intf->dev, "rndis ethaddr off %d len %d ?\n", 437 dev_err(&intf->dev, "rndis ethaddr off %d len %d ?\n",
440 tmp, le32_to_cpu(u.get_c->len)); 438 tmp, le32_to_cpu(u.get_c->len));
441 retval = -EDOM; 439 retval = -EDOM;
442 goto fail; 440 goto fail_and_release;
443 } 441 }
444 memcpy(net->dev_addr, tmp + (char *)&u.get_c->request_id, ETH_ALEN); 442 memcpy(net->dev_addr, tmp + (char *)&u.get_c->request_id, ETH_ALEN);
445 443
@@ -455,11 +453,18 @@ fail:
455 retval = rndis_command(dev, u.header); 453 retval = rndis_command(dev, u.header);
456 if (unlikely(retval < 0)) { 454 if (unlikely(retval < 0)) {
457 dev_err(&intf->dev, "rndis set packet filter, %d\n", retval); 455 dev_err(&intf->dev, "rndis set packet filter, %d\n", retval);
458 goto fail; 456 goto fail_and_release;
459 } 457 }
460 458
461 retval = 0; 459 retval = 0;
462done: 460
461 kfree(u.buf);
462 return retval;
463
464fail_and_release:
465 usb_set_intfdata(info->data, NULL);
466 usb_driver_release_interface(driver_of(intf), info->data);
467fail:
463 kfree(u.buf); 468 kfree(u.buf);
464 return retval; 469 return retval;
465} 470}
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 5ca04e82ea19..0fed43a96871 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -78,6 +78,7 @@ static int option_send_setup(struct usb_serial_port *port);
78#define OPTION_PRODUCT_FUSION2 0x6300 78#define OPTION_PRODUCT_FUSION2 0x6300
79#define OPTION_PRODUCT_COBRA 0x6500 79#define OPTION_PRODUCT_COBRA 0x6500
80#define OPTION_PRODUCT_COBRA2 0x6600 80#define OPTION_PRODUCT_COBRA2 0x6600
81#define OPTION_PRODUCT_GTMAX36 0x6701
81#define HUAWEI_PRODUCT_E600 0x1001 82#define HUAWEI_PRODUCT_E600 0x1001
82#define HUAWEI_PRODUCT_E220 0x1003 83#define HUAWEI_PRODUCT_E220 0x1003
83#define AUDIOVOX_PRODUCT_AIRCARD 0x0112 84#define AUDIOVOX_PRODUCT_AIRCARD 0x0112
@@ -90,6 +91,7 @@ static struct usb_device_id option_ids[] = {
90 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, 91 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) },
91 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, 92 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) },
92 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, 93 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) },
94 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTMAX36) },
93 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 95 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
94 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, 96 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) },
95 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, 97 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) },
@@ -104,6 +106,7 @@ static struct usb_device_id option_ids1[] = {
104 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, 106 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) },
105 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, 107 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) },
106 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, 108 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) },
109 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTMAX36) },
107 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 110 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
108 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, 111 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) },
109 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, 112 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) },
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index cddef3efba0a..b49f2a78189e 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -197,6 +197,13 @@ UNUSUAL_DEV( 0x0421, 0x047c, 0x0370, 0x0370,
197 US_SC_DEVICE, US_PR_DEVICE, NULL, 197 US_SC_DEVICE, US_PR_DEVICE, NULL,
198 US_FL_MAX_SECTORS_64 ), 198 US_FL_MAX_SECTORS_64 ),
199 199
200/* Reported by Manuel Osdoba <manuel.osdoba@tu-ilmenau.de> */
201UNUSUAL_DEV( 0x0421, 0x0492, 0x0452, 0x0452,
202 "Nokia",
203 "Nokia 6233",
204 US_SC_DEVICE, US_PR_DEVICE, NULL,
205 US_FL_MAX_SECTORS_64 ),
206
200/* Reported by Alex Corcoles <alex@corcoles.net> */ 207/* Reported by Alex Corcoles <alex@corcoles.net> */
201UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x0370, 208UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x0370,
202 "Nokia", 209 "Nokia",
@@ -254,6 +261,18 @@ UNUSUAL_DEV( 0x045a, 0x5210, 0x0101, 0x0101,
254 US_SC_SCSI, US_PR_KARMA, rio_karma_init, 0), 261 US_SC_SCSI, US_PR_KARMA, rio_karma_init, 0),
255#endif 262#endif
256 263
264/*
265 * This virtual floppy is found in Sun equipment (x4600, x4200m2, etc.)
266 * Reported by Pete Zaitcev <zaitcev@redhat.com>
267 * This device chokes on both version of MODE SENSE which we have, so
268 * use_10_for_ms is not effective, and we use US_FL_NO_WP_DETECT.
269 */
270UNUSUAL_DEV( 0x046b, 0xff40, 0x0100, 0x0100,
271 "AMI",
272 "Virtual Floppy",
273 US_SC_DEVICE, US_PR_DEVICE, NULL,
274 US_FL_NO_WP_DETECT),
275
257/* Patch submitted by Philipp Friedrich <philipp@void.at> */ 276/* Patch submitted by Philipp Friedrich <philipp@void.at> */
258UNUSUAL_DEV( 0x0482, 0x0100, 0x0100, 0x0100, 277UNUSUAL_DEV( 0x0482, 0x0100, 0x0100, 0x0100,
259 "Kyocera", 278 "Kyocera",