aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/hso.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb/hso.c')
-rw-r--r--drivers/net/usb/hso.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index cde423c6d040..f84b78d94c40 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -5,6 +5,7 @@
5 * Copyright (C) 2008 Option International 5 * Copyright (C) 2008 Option International
6 * Filip Aben <f.aben@option.com> 6 * Filip Aben <f.aben@option.com>
7 * Denis Joseph Barrow <d.barow@option.com> 7 * Denis Joseph Barrow <d.barow@option.com>
8 * Jan Dumon <j.dumon@option.com>
8 * Copyright (C) 2007 Andrew Bird (Sphere Systems Ltd) 9 * Copyright (C) 2007 Andrew Bird (Sphere Systems Ltd)
9 * <ajb@spheresystems.co.uk> 10 * <ajb@spheresystems.co.uk>
10 * Copyright (C) 2008 Greg Kroah-Hartman <gregkh@suse.de> 11 * Copyright (C) 2008 Greg Kroah-Hartman <gregkh@suse.de>
@@ -462,9 +463,16 @@ static const struct usb_device_id hso_ids[] = {
462 {USB_DEVICE(0x0af0, 0x7701)}, 463 {USB_DEVICE(0x0af0, 0x7701)},
463 {USB_DEVICE(0x0af0, 0x7801)}, 464 {USB_DEVICE(0x0af0, 0x7801)},
464 {USB_DEVICE(0x0af0, 0x7901)}, 465 {USB_DEVICE(0x0af0, 0x7901)},
465 {USB_DEVICE(0x0af0, 0x7361)}, 466 {USB_DEVICE(0x0af0, 0x8200)},
466 {USB_DEVICE(0x0af0, 0xd057)}, 467 {USB_DEVICE(0x0af0, 0x8201)},
468 {USB_DEVICE(0x0af0, 0xd035)},
467 {USB_DEVICE(0x0af0, 0xd055)}, 469 {USB_DEVICE(0x0af0, 0xd055)},
470 {USB_DEVICE(0x0af0, 0xd155)},
471 {USB_DEVICE(0x0af0, 0xd255)},
472 {USB_DEVICE(0x0af0, 0xd057)},
473 {USB_DEVICE(0x0af0, 0xd157)},
474 {USB_DEVICE(0x0af0, 0xd257)},
475 {USB_DEVICE(0x0af0, 0xd357)},
468 {} 476 {}
469}; 477};
470MODULE_DEVICE_TABLE(usb, hso_ids); 478MODULE_DEVICE_TABLE(usb, hso_ids);
@@ -2410,20 +2418,22 @@ static void hso_free_net_device(struct hso_device *hso_dev)
2410 if (!hso_net) 2418 if (!hso_net)
2411 return; 2419 return;
2412 2420
2421 remove_net_device(hso_net->parent);
2422
2423 if (hso_net->net) {
2424 unregister_netdev(hso_net->net);
2425 free_netdev(hso_net->net);
2426 }
2427
2413 /* start freeing */ 2428 /* start freeing */
2414 for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) { 2429 for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) {
2415 usb_free_urb(hso_net->mux_bulk_rx_urb_pool[i]); 2430 usb_free_urb(hso_net->mux_bulk_rx_urb_pool[i]);
2416 kfree(hso_net->mux_bulk_rx_buf_pool[i]); 2431 kfree(hso_net->mux_bulk_rx_buf_pool[i]);
2432 hso_net->mux_bulk_rx_buf_pool[i] = NULL;
2417 } 2433 }
2418 usb_free_urb(hso_net->mux_bulk_tx_urb); 2434 usb_free_urb(hso_net->mux_bulk_tx_urb);
2419 kfree(hso_net->mux_bulk_tx_buf); 2435 kfree(hso_net->mux_bulk_tx_buf);
2420 2436 hso_net->mux_bulk_tx_buf = NULL;
2421 remove_net_device(hso_net->parent);
2422
2423 if (hso_net->net) {
2424 unregister_netdev(hso_net->net);
2425 free_netdev(hso_net->net);
2426 }
2427 2437
2428 kfree(hso_dev); 2438 kfree(hso_dev);
2429} 2439}
@@ -2526,14 +2536,15 @@ static void hso_create_rfkill(struct hso_device *hso_dev,
2526} 2536}
2527 2537
2528/* Creates our network device */ 2538/* Creates our network device */
2529static struct hso_device *hso_create_net_device(struct usb_interface *interface) 2539static struct hso_device *hso_create_net_device(struct usb_interface *interface,
2540 int port_spec)
2530{ 2541{
2531 int result, i; 2542 int result, i;
2532 struct net_device *net; 2543 struct net_device *net;
2533 struct hso_net *hso_net; 2544 struct hso_net *hso_net;
2534 struct hso_device *hso_dev; 2545 struct hso_device *hso_dev;
2535 2546
2536 hso_dev = hso_create_device(interface, HSO_INTF_MUX | HSO_PORT_NETWORK); 2547 hso_dev = hso_create_device(interface, port_spec);
2537 if (!hso_dev) 2548 if (!hso_dev)
2538 return NULL; 2549 return NULL;
2539 2550
@@ -2613,12 +2624,12 @@ static void hso_free_tiomget(struct hso_serial *serial)
2613{ 2624{
2614 struct hso_tiocmget *tiocmget = serial->tiocmget; 2625 struct hso_tiocmget *tiocmget = serial->tiocmget;
2615 if (tiocmget) { 2626 if (tiocmget) {
2616 kfree(tiocmget);
2617 if (tiocmget->urb) { 2627 if (tiocmget->urb) {
2618 usb_free_urb(tiocmget->urb); 2628 usb_free_urb(tiocmget->urb);
2619 tiocmget->urb = NULL; 2629 tiocmget->urb = NULL;
2620 } 2630 }
2621 serial->tiocmget = NULL; 2631 serial->tiocmget = NULL;
2632 kfree(tiocmget);
2622 2633
2623 } 2634 }
2624} 2635}
@@ -2933,7 +2944,8 @@ static int hso_probe(struct usb_interface *interface,
2933 if ((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) { 2944 if ((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) {
2934 /* Create the network device */ 2945 /* Create the network device */
2935 if (!disable_net) { 2946 if (!disable_net) {
2936 hso_dev = hso_create_net_device(interface); 2947 hso_dev = hso_create_net_device(interface,
2948 port_spec);
2937 if (!hso_dev) 2949 if (!hso_dev)
2938 goto exit; 2950 goto exit;
2939 tmp_dev = hso_dev; 2951 tmp_dev = hso_dev;
@@ -2965,7 +2977,7 @@ static int hso_probe(struct usb_interface *interface,
2965 /* It's a regular bulk interface */ 2977 /* It's a regular bulk interface */
2966 if (((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) 2978 if (((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK)
2967 && !disable_net) 2979 && !disable_net)
2968 hso_dev = hso_create_net_device(interface); 2980 hso_dev = hso_create_net_device(interface, port_spec);
2969 else 2981 else
2970 hso_dev = 2982 hso_dev =
2971 hso_create_bulk_serial_device(interface, port_spec); 2983 hso_create_bulk_serial_device(interface, port_spec);