aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/class/cdc-acm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
-rw-r--r--drivers/usb/class/cdc-acm.c49
1 files changed, 26 insertions, 23 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 3670d77e912c..ca90326f2f5c 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -291,13 +291,13 @@ static void acm_read_bulk(struct urb *urb, struct pt_regs *regs)
291 struct acm_ru *rcv = urb->context; 291 struct acm_ru *rcv = urb->context;
292 struct acm *acm = rcv->instance; 292 struct acm *acm = rcv->instance;
293 int status = urb->status; 293 int status = urb->status;
294 dbg("Entering acm_read_bulk with status %d\n", urb->status); 294 dbg("Entering acm_read_bulk with status %d", urb->status);
295 295
296 if (!ACM_READY(acm)) 296 if (!ACM_READY(acm))
297 return; 297 return;
298 298
299 if (status) 299 if (status)
300 dev_dbg(&acm->data->dev, "bulk rx status %d\n", status); 300 dev_dbg(&acm->data->dev, "bulk rx status %d", status);
301 301
302 buf = rcv->buffer; 302 buf = rcv->buffer;
303 buf->size = urb->actual_length; 303 buf->size = urb->actual_length;
@@ -343,7 +343,7 @@ next_buffer:
343 list_del(&buf->list); 343 list_del(&buf->list);
344 spin_unlock(&acm->read_lock); 344 spin_unlock(&acm->read_lock);
345 345
346 dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d\n", buf, buf->size); 346 dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size);
347 347
348 tty_buffer_request_room(tty, buf->size); 348 tty_buffer_request_room(tty, buf->size);
349 if (!acm->throttle) 349 if (!acm->throttle)
@@ -394,7 +394,7 @@ urbs:
394 rcv->urb->transfer_dma = buf->dma; 394 rcv->urb->transfer_dma = buf->dma;
395 rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 395 rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
396 396
397 dbg("acm_rx_tasklet: sending urb 0x%p, rcv 0x%p, buf 0x%p\n", rcv->urb, rcv, buf); 397 dbg("acm_rx_tasklet: sending urb 0x%p, rcv 0x%p, buf 0x%p", rcv->urb, rcv, buf);
398 398
399 /* This shouldn't kill the driver as unsuccessful URBs are returned to the 399 /* This shouldn't kill the driver as unsuccessful URBs are returned to the
400 free-urbs-pool and resubmited ASAP */ 400 free-urbs-pool and resubmited ASAP */
@@ -413,7 +413,7 @@ static void acm_write_bulk(struct urb *urb, struct pt_regs *regs)
413{ 413{
414 struct acm *acm = (struct acm *)urb->context; 414 struct acm *acm = (struct acm *)urb->context;
415 415
416 dbg("Entering acm_write_bulk with status %d\n", urb->status); 416 dbg("Entering acm_write_bulk with status %d", urb->status);
417 417
418 acm_write_done(acm); 418 acm_write_done(acm);
419 acm_write_start(acm); 419 acm_write_start(acm);
@@ -424,7 +424,7 @@ static void acm_write_bulk(struct urb *urb, struct pt_regs *regs)
424static void acm_softint(void *private) 424static void acm_softint(void *private)
425{ 425{
426 struct acm *acm = private; 426 struct acm *acm = private;
427 dbg("Entering acm_softint.\n"); 427 dbg("Entering acm_softint.");
428 428
429 if (!ACM_READY(acm)) 429 if (!ACM_READY(acm))
430 return; 430 return;
@@ -440,7 +440,7 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
440 struct acm *acm; 440 struct acm *acm;
441 int rv = -EINVAL; 441 int rv = -EINVAL;
442 int i; 442 int i;
443 dbg("Entering acm_tty_open.\n"); 443 dbg("Entering acm_tty_open.");
444 444
445 mutex_lock(&open_mutex); 445 mutex_lock(&open_mutex);
446 446
@@ -541,7 +541,7 @@ static int acm_tty_write(struct tty_struct *tty, const unsigned char *buf, int c
541 int wbn; 541 int wbn;
542 struct acm_wb *wb; 542 struct acm_wb *wb;
543 543
544 dbg("Entering acm_tty_write to write %d bytes,\n", count); 544 dbg("Entering acm_tty_write to write %d bytes,", count);
545 545
546 if (!ACM_READY(acm)) 546 if (!ACM_READY(acm))
547 return -EINVAL; 547 return -EINVAL;
@@ -793,7 +793,7 @@ static int acm_probe (struct usb_interface *intf,
793 793
794 if (!buflen) { 794 if (!buflen) {
795 if (intf->cur_altsetting->endpoint->extralen && intf->cur_altsetting->endpoint->extra) { 795 if (intf->cur_altsetting->endpoint->extralen && intf->cur_altsetting->endpoint->extra) {
796 dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint\n"); 796 dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint");
797 buflen = intf->cur_altsetting->endpoint->extralen; 797 buflen = intf->cur_altsetting->endpoint->extralen;
798 buffer = intf->cur_altsetting->endpoint->extra; 798 buffer = intf->cur_altsetting->endpoint->extra;
799 } else { 799 } else {
@@ -842,24 +842,24 @@ next_desc:
842 842
843 if (!union_header) { 843 if (!union_header) {
844 if (call_interface_num > 0) { 844 if (call_interface_num > 0) {
845 dev_dbg(&intf->dev,"No union descriptor, using call management descriptor\n"); 845 dev_dbg(&intf->dev,"No union descriptor, using call management descriptor");
846 data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = call_interface_num)); 846 data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = call_interface_num));
847 control_interface = intf; 847 control_interface = intf;
848 } else { 848 } else {
849 dev_dbg(&intf->dev,"No union descriptor, giving up\n"); 849 dev_dbg(&intf->dev,"No union descriptor, giving up");
850 return -ENODEV; 850 return -ENODEV;
851 } 851 }
852 } else { 852 } else {
853 control_interface = usb_ifnum_to_if(usb_dev, union_header->bMasterInterface0); 853 control_interface = usb_ifnum_to_if(usb_dev, union_header->bMasterInterface0);
854 data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = union_header->bSlaveInterface0)); 854 data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = union_header->bSlaveInterface0));
855 if (!control_interface || !data_interface) { 855 if (!control_interface || !data_interface) {
856 dev_dbg(&intf->dev,"no interfaces\n"); 856 dev_dbg(&intf->dev,"no interfaces");
857 return -ENODEV; 857 return -ENODEV;
858 } 858 }
859 } 859 }
860 860
861 if (data_interface_num != call_interface_num) 861 if (data_interface_num != call_interface_num)
862 dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported.\n"); 862 dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported.");
863 863
864skip_normal_probe: 864skip_normal_probe:
865 865
@@ -867,7 +867,7 @@ skip_normal_probe:
867 if (data_interface->cur_altsetting->desc.bInterfaceClass != CDC_DATA_INTERFACE_TYPE) { 867 if (data_interface->cur_altsetting->desc.bInterfaceClass != CDC_DATA_INTERFACE_TYPE) {
868 if (control_interface->cur_altsetting->desc.bInterfaceClass == CDC_DATA_INTERFACE_TYPE) { 868 if (control_interface->cur_altsetting->desc.bInterfaceClass == CDC_DATA_INTERFACE_TYPE) {
869 struct usb_interface *t; 869 struct usb_interface *t;
870 dev_dbg(&intf->dev,"Your device has switched interfaces.\n"); 870 dev_dbg(&intf->dev,"Your device has switched interfaces.");
871 871
872 t = control_interface; 872 t = control_interface;
873 control_interface = data_interface; 873 control_interface = data_interface;
@@ -878,7 +878,7 @@ skip_normal_probe:
878 } 878 }
879 879
880 if (usb_interface_claimed(data_interface)) { /* valid in this context */ 880 if (usb_interface_claimed(data_interface)) { /* valid in this context */
881 dev_dbg(&intf->dev,"The data interface isn't available\n"); 881 dev_dbg(&intf->dev,"The data interface isn't available");
882 return -EBUSY; 882 return -EBUSY;
883 } 883 }
884 884
@@ -895,7 +895,7 @@ skip_normal_probe:
895 if ((epread->bEndpointAddress & USB_DIR_IN) != USB_DIR_IN) { 895 if ((epread->bEndpointAddress & USB_DIR_IN) != USB_DIR_IN) {
896 /* descriptors are swapped */ 896 /* descriptors are swapped */
897 struct usb_endpoint_descriptor *t; 897 struct usb_endpoint_descriptor *t;
898 dev_dbg(&intf->dev,"The data interface has switched endpoints\n"); 898 dev_dbg(&intf->dev,"The data interface has switched endpoints");
899 899
900 t = epread; 900 t = epread;
901 epread = epwrite; 901 epread = epwrite;
@@ -910,7 +910,7 @@ skip_normal_probe:
910 } 910 }
911 911
912 if (!(acm = kzalloc(sizeof(struct acm), GFP_KERNEL))) { 912 if (!(acm = kzalloc(sizeof(struct acm), GFP_KERNEL))) {
913 dev_dbg(&intf->dev, "out of memory (acm kzalloc)\n"); 913 dev_dbg(&intf->dev, "out of memory (acm kzalloc)");
914 goto alloc_fail; 914 goto alloc_fail;
915 } 915 }
916 916
@@ -936,26 +936,26 @@ skip_normal_probe:
936 936
937 buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma); 937 buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
938 if (!buf) { 938 if (!buf) {
939 dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)\n"); 939 dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)");
940 goto alloc_fail2; 940 goto alloc_fail2;
941 } 941 }
942 acm->ctrl_buffer = buf; 942 acm->ctrl_buffer = buf;
943 943
944 if (acm_write_buffers_alloc(acm) < 0) { 944 if (acm_write_buffers_alloc(acm) < 0) {
945 dev_dbg(&intf->dev, "out of memory (write buffer alloc)\n"); 945 dev_dbg(&intf->dev, "out of memory (write buffer alloc)");
946 goto alloc_fail4; 946 goto alloc_fail4;
947 } 947 }
948 948
949 acm->ctrlurb = usb_alloc_urb(0, GFP_KERNEL); 949 acm->ctrlurb = usb_alloc_urb(0, GFP_KERNEL);
950 if (!acm->ctrlurb) { 950 if (!acm->ctrlurb) {
951 dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)\n"); 951 dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)");
952 goto alloc_fail5; 952 goto alloc_fail5;
953 } 953 }
954 for (i = 0; i < num_rx_buf; i++) { 954 for (i = 0; i < num_rx_buf; i++) {
955 struct acm_ru *rcv = &(acm->ru[i]); 955 struct acm_ru *rcv = &(acm->ru[i]);
956 956
957 if (!(rcv->urb = usb_alloc_urb(0, GFP_KERNEL))) { 957 if (!(rcv->urb = usb_alloc_urb(0, GFP_KERNEL))) {
958 dev_dbg(&intf->dev, "out of memory (read urbs usb_alloc_urb)\n"); 958 dev_dbg(&intf->dev, "out of memory (read urbs usb_alloc_urb)");
959 goto alloc_fail7; 959 goto alloc_fail7;
960 } 960 }
961 961
@@ -966,13 +966,13 @@ skip_normal_probe:
966 struct acm_rb *buf = &(acm->rb[i]); 966 struct acm_rb *buf = &(acm->rb[i]);
967 967
968 if (!(buf->base = usb_buffer_alloc(acm->dev, readsize, GFP_KERNEL, &buf->dma))) { 968 if (!(buf->base = usb_buffer_alloc(acm->dev, readsize, GFP_KERNEL, &buf->dma))) {
969 dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)\n"); 969 dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)");
970 goto alloc_fail7; 970 goto alloc_fail7;
971 } 971 }
972 } 972 }
973 acm->writeurb = usb_alloc_urb(0, GFP_KERNEL); 973 acm->writeurb = usb_alloc_urb(0, GFP_KERNEL);
974 if (!acm->writeurb) { 974 if (!acm->writeurb) {
975 dev_dbg(&intf->dev, "out of memory (writeurb kmalloc)\n"); 975 dev_dbg(&intf->dev, "out of memory (writeurb kmalloc)");
976 goto alloc_fail7; 976 goto alloc_fail7;
977 } 977 }
978 978
@@ -1086,6 +1086,9 @@ static struct usb_device_id acm_ids[] = {
1086 { USB_DEVICE(0x0ace, 0x1608), /* ZyDAS 56K USB MODEM */ 1086 { USB_DEVICE(0x0ace, 0x1608), /* ZyDAS 56K USB MODEM */
1087 .driver_info = SINGLE_RX_URB, /* firmware bug */ 1087 .driver_info = SINGLE_RX_URB, /* firmware bug */
1088 }, 1088 },
1089 { USB_DEVICE(0x0ace, 0x1611), /* ZyDAS 56K USB MODEM - new version */
1090 .driver_info = SINGLE_RX_URB, /* firmware bug */
1091 },
1089 /* control interfaces with various AT-command sets */ 1092 /* control interfaces with various AT-command sets */
1090 { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, 1093 { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
1091 USB_CDC_ACM_PROTO_AT_V25TER) }, 1094 USB_CDC_ACM_PROTO_AT_V25TER) },