diff options
Diffstat (limited to 'drivers/staging/usbip')
-rw-r--r-- | drivers/staging/usbip/Kconfig | 7 | ||||
-rw-r--r-- | drivers/staging/usbip/Makefile | 2 | ||||
-rw-r--r-- | drivers/staging/usbip/usbip_common.c | 90 | ||||
-rw-r--r-- | drivers/staging/usbip/usbip_common.h | 8 | ||||
-rw-r--r-- | drivers/staging/usbip/vhci_sysfs.c | 2 |
5 files changed, 17 insertions, 92 deletions
diff --git a/drivers/staging/usbip/Kconfig b/drivers/staging/usbip/Kconfig index 350d5d6..2c1d10a 100644 --- a/drivers/staging/usbip/Kconfig +++ b/drivers/staging/usbip/Kconfig @@ -34,3 +34,10 @@ config USB_IP_HOST To compile this driver as a module, choose M here: the module will be called usbip. + +config USB_IP_DEBUG_ENABLE + bool "USB-IP Debug Enable" + depends on USB_IP_COMMON + default N + ---help--- + This enables the debug messages from the USB-IP drivers. diff --git a/drivers/staging/usbip/Makefile b/drivers/staging/usbip/Makefile index 179f421..6f2916b 100644 --- a/drivers/staging/usbip/Makefile +++ b/drivers/staging/usbip/Makefile @@ -7,6 +7,6 @@ vhci-hcd-objs := vhci_sysfs.o vhci_tx.o vhci_rx.o vhci_hcd.o obj-$(CONFIG_USB_IP_HOST) += usbip.o usbip-objs := stub_dev.o stub_main.o stub_rx.o stub_tx.o -ifeq ($(CONFIG_USB_DEBUG),y) +ifeq ($(CONFIG_USB_IP_DEBUG_ENABLE),y) EXTRA_CFLAGS += -DDEBUG endif diff --git a/drivers/staging/usbip/usbip_common.c b/drivers/staging/usbip/usbip_common.c index ddb6f5f..7a45da8 100644 --- a/drivers/staging/usbip/usbip_common.c +++ b/drivers/staging/usbip/usbip_common.c @@ -33,7 +33,7 @@ /*-------------------------------------------------------------------------*/ /* debug routines */ -#ifdef CONFIG_USB_DEBUG +#ifdef CONFIG_USB_IP_DEBUG_ENABLE unsigned long usbip_debug_flag = 0xffffffff; #else unsigned long usbip_debug_flag; @@ -55,10 +55,7 @@ static ssize_t show_flag(struct device *dev, struct device_attribute *attr, static ssize_t store_flag(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - unsigned long flag; - - sscanf(buf, "%lx", &flag); - usbip_debug_flag = flag; + sscanf(buf, "%lx", &usbip_debug_flag); return count; } @@ -66,33 +63,8 @@ DEVICE_ATTR(usbip_debug, (S_IRUGO | S_IWUSR), show_flag, store_flag); static void usbip_dump_buffer(char *buff, int bufflen) { - int i; - - if (bufflen > 128) { - for (i = 0; i < 128; i++) { - if (i%24 == 0) - printk(KERN_DEBUG " "); - printk(KERN_DEBUG "%02x ", (unsigned char) buff[i]); - if (i%4 == 3) - printk(KERN_DEBUG "| "); - if (i%24 == 23) - printk(KERN_DEBUG "\n"); - } - printk(KERN_DEBUG "... (%d byte)\n", bufflen); - return; - } - - for (i = 0; i < bufflen; i++) { - if (i%24 == 0) - printk(KERN_DEBUG " "); - printk(KERN_DEBUG "%02x ", (unsigned char) buff[i]); - if (i%4 == 3) - printk(KERN_DEBUG "| "); - if (i%24 == 23) - printk(KERN_DEBUG "\n"); - } - printk(KERN_DEBUG "\n"); - + print_hex_dump(KERN_DEBUG, "usb-ip", DUMP_PREFIX_OFFSET, 16, 4, + buff, bufflen, false); } static void usbip_dump_pipe(unsigned int p) @@ -558,60 +530,6 @@ err: } EXPORT_SYMBOL_GPL(usbip_xmit); - -/* now a usrland utility should set options. */ -#if 0 -int setquickack(struct socket *socket) -{ - mm_segment_t oldfs; - int val = 1; - int ret; - - oldfs = get_fs(); - set_fs(get_ds()); - ret = socket->ops->setsockopt(socket, SOL_TCP, TCP_QUICKACK, - (char __user *) &val, sizeof(ret)); - set_fs(oldfs); - - return ret; -} - -int setnodelay(struct socket *socket) -{ - mm_segment_t oldfs; - int val = 1; - int ret; - - oldfs = get_fs(); - set_fs(get_ds()); - ret = socket->ops->setsockopt(socket, SOL_TCP, TCP_NODELAY, - (char __user *) &val, sizeof(ret)); - set_fs(oldfs); - - return ret; -} - -int setkeepalive(struct socket *socket) -{ - mm_segment_t oldfs; - int val = 1; - int ret; - - oldfs = get_fs(); - set_fs(get_ds()); - ret = socket->ops->setsockopt(socket, SOL_SOCKET, SO_KEEPALIVE, - (char __user *) &val, sizeof(ret)); - set_fs(oldfs); - - return ret; -} - -void setreuse(struct socket *socket) -{ - socket->sk->sk_reuse = 1; -} -#endif - struct socket *sockfd_to_socket(unsigned int sockfd) { struct socket *socket; diff --git a/drivers/staging/usbip/usbip_common.h b/drivers/staging/usbip/usbip_common.h index 1ca3eab..6f1dcb1 100644 --- a/drivers/staging/usbip/usbip_common.h +++ b/drivers/staging/usbip/usbip_common.h @@ -33,12 +33,12 @@ */ /** - * usbip_udbg - print debug messages if CONFIG_USB_DEBUG is defined + * usbip_udbg - print debug messages if CONFIG_USB_IP_DEBUG_ENABLE is defined * @fmt: * @args: */ -#ifdef CONFIG_USB_DEBUG +#ifdef CONFIG_USB_IP_DEBUG_ENABLE #define usbip_udbg(fmt, args...) \ do { \ @@ -47,11 +47,11 @@ __FILE__, __LINE__, __func__, ##args); \ } while (0) -#else /* CONFIG_USB_DEBUG */ +#else /* CONFIG_USB_IP_DEBUG_ENABLE */ #define usbip_udbg(fmt, args...) do { } while (0) -#endif /* CONFIG_USB_DEBUG */ +#endif /* CONFIG_USB_IP_DEBUG_ENABLE */ enum { diff --git a/drivers/staging/usbip/vhci_sysfs.c b/drivers/staging/usbip/vhci_sysfs.c index d8992d1..f6e34e0 100644 --- a/drivers/staging/usbip/vhci_sysfs.c +++ b/drivers/staging/usbip/vhci_sysfs.c @@ -144,7 +144,7 @@ static int valid_args(__u32 rhport, enum usb_device_speed speed) case USB_SPEED_LOW: case USB_SPEED_FULL: case USB_SPEED_HIGH: - case USB_SPEED_VARIABLE: + case USB_SPEED_WIRELESS: break; default: usbip_uerr("speed %d\n", speed); |