aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/class
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/class')
-rw-r--r--drivers/usb/class/Kconfig6
-rw-r--r--drivers/usb/class/cdc-acm.c8
-rw-r--r--drivers/usb/class/cdc-wdm.c19
-rw-r--r--drivers/usb/class/usbtmc.c26
4 files changed, 24 insertions, 35 deletions
diff --git a/drivers/usb/class/Kconfig b/drivers/usb/class/Kconfig
index 316aac8e4ca1..bb8b73682a70 100644
--- a/drivers/usb/class/Kconfig
+++ b/drivers/usb/class/Kconfig
@@ -2,11 +2,10 @@
2# USB Class driver configuration 2# USB Class driver configuration
3# 3#
4comment "USB Device Class drivers" 4comment "USB Device Class drivers"
5 depends on USB
6 5
7config USB_ACM 6config USB_ACM
8 tristate "USB Modem (CDC ACM) support" 7 tristate "USB Modem (CDC ACM) support"
9 depends on USB && TTY 8 depends on TTY
10 ---help--- 9 ---help---
11 This driver supports USB modems and ISDN adapters which support the 10 This driver supports USB modems and ISDN adapters which support the
12 Communication Device Class Abstract Control Model interface. 11 Communication Device Class Abstract Control Model interface.
@@ -21,7 +20,6 @@ config USB_ACM
21 20
22config USB_PRINTER 21config USB_PRINTER
23 tristate "USB Printer support" 22 tristate "USB Printer support"
24 depends on USB
25 help 23 help
26 Say Y here if you want to connect a USB printer to your computer's 24 Say Y here if you want to connect a USB printer to your computer's
27 USB port. 25 USB port.
@@ -31,7 +29,6 @@ config USB_PRINTER
31 29
32config USB_WDM 30config USB_WDM
33 tristate "USB Wireless Device Management support" 31 tristate "USB Wireless Device Management support"
34 depends on USB
35 ---help--- 32 ---help---
36 This driver supports the WMC Device Management functionality 33 This driver supports the WMC Device Management functionality
37 of cell phones compliant to the CDC WMC specification. You can use 34 of cell phones compliant to the CDC WMC specification. You can use
@@ -42,7 +39,6 @@ config USB_WDM
42 39
43config USB_TMC 40config USB_TMC
44 tristate "USB Test and Measurement Class support" 41 tristate "USB Test and Measurement Class support"
45 depends on USB
46 help 42 help
47 Say Y here if you want to connect a USB device that follows 43 Say Y here if you want to connect a USB device that follows
48 the USB.org specification for USB Test and Measurement devices 44 the USB.org specification for USB Test and Measurement devices
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index c77f7ae48f1c..171d7a9df3ae 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -828,14 +828,6 @@ static int acm_tty_ioctl(struct tty_struct *tty,
828 return rv; 828 return rv;
829} 829}
830 830
831static const __u32 acm_tty_speed[] = {
832 0, 50, 75, 110, 134, 150, 200, 300, 600,
833 1200, 1800, 2400, 4800, 9600, 19200, 38400,
834 57600, 115200, 230400, 460800, 500000, 576000,
835 921600, 1000000, 1152000, 1500000, 2000000,
836 2500000, 3000000, 3500000, 4000000
837};
838
839static void acm_tty_set_termios(struct tty_struct *tty, 831static void acm_tty_set_termios(struct tty_struct *tty,
840 struct ktermios *termios_old) 832 struct ktermios *termios_old)
841{ 833{
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 122d056d96d5..8a230f0ef77c 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -13,6 +13,7 @@
13 */ 13 */
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/ioctl.h>
16#include <linux/slab.h> 17#include <linux/slab.h>
17#include <linux/module.h> 18#include <linux/module.h>
18#include <linux/mutex.h> 19#include <linux/mutex.h>
@@ -644,6 +645,22 @@ static int wdm_release(struct inode *inode, struct file *file)
644 return 0; 645 return 0;
645} 646}
646 647
648static long wdm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
649{
650 struct wdm_device *desc = file->private_data;
651 int rv = 0;
652
653 switch (cmd) {
654 case IOCTL_WDM_MAX_COMMAND:
655 if (copy_to_user((void __user *)arg, &desc->wMaxCommand, sizeof(desc->wMaxCommand)))
656 rv = -EFAULT;
657 break;
658 default:
659 rv = -ENOTTY;
660 }
661 return rv;
662}
663
647static const struct file_operations wdm_fops = { 664static const struct file_operations wdm_fops = {
648 .owner = THIS_MODULE, 665 .owner = THIS_MODULE,
649 .read = wdm_read, 666 .read = wdm_read,
@@ -652,6 +669,8 @@ static const struct file_operations wdm_fops = {
652 .flush = wdm_flush, 669 .flush = wdm_flush,
653 .release = wdm_release, 670 .release = wdm_release,
654 .poll = wdm_poll, 671 .poll = wdm_poll,
672 .unlocked_ioctl = wdm_ioctl,
673 .compat_ioctl = wdm_ioctl,
655 .llseek = noop_llseek, 674 .llseek = noop_llseek,
656}; 675};
657 676
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 70d69d06054f..4c5506ae5e45 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -718,50 +718,32 @@ exit:
718 718
719static int usbtmc_ioctl_clear_out_halt(struct usbtmc_device_data *data) 719static int usbtmc_ioctl_clear_out_halt(struct usbtmc_device_data *data)
720{ 720{
721 u8 *buffer;
722 int rv; 721 int rv;
723 722
724 buffer = kmalloc(2, GFP_KERNEL);
725 if (!buffer)
726 return -ENOMEM;
727
728 rv = usb_clear_halt(data->usb_dev, 723 rv = usb_clear_halt(data->usb_dev,
729 usb_sndbulkpipe(data->usb_dev, data->bulk_out)); 724 usb_sndbulkpipe(data->usb_dev, data->bulk_out));
730 725
731 if (rv < 0) { 726 if (rv < 0) {
732 dev_err(&data->usb_dev->dev, "usb_control_msg returned %d\n", 727 dev_err(&data->usb_dev->dev, "usb_control_msg returned %d\n",
733 rv); 728 rv);
734 goto exit; 729 return rv;
735 } 730 }
736 rv = 0; 731 return 0;
737
738exit:
739 kfree(buffer);
740 return rv;
741} 732}
742 733
743static int usbtmc_ioctl_clear_in_halt(struct usbtmc_device_data *data) 734static int usbtmc_ioctl_clear_in_halt(struct usbtmc_device_data *data)
744{ 735{
745 u8 *buffer;
746 int rv; 736 int rv;
747 737
748 buffer = kmalloc(2, GFP_KERNEL);
749 if (!buffer)
750 return -ENOMEM;
751
752 rv = usb_clear_halt(data->usb_dev, 738 rv = usb_clear_halt(data->usb_dev,
753 usb_rcvbulkpipe(data->usb_dev, data->bulk_in)); 739 usb_rcvbulkpipe(data->usb_dev, data->bulk_in));
754 740
755 if (rv < 0) { 741 if (rv < 0) {
756 dev_err(&data->usb_dev->dev, "usb_control_msg returned %d\n", 742 dev_err(&data->usb_dev->dev, "usb_control_msg returned %d\n",
757 rv); 743 rv);
758 goto exit; 744 return rv;
759 } 745 }
760 rv = 0; 746 return 0;
761
762exit:
763 kfree(buffer);
764 return rv;
765} 747}
766 748
767static int get_capabilities(struct usbtmc_device_data *data) 749static int get_capabilities(struct usbtmc_device_data *data)