From 41bd72f9041def8e3334d3e3693862d078f5cb9a Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 17 Mar 2010 23:05:53 +0100 Subject: USB: serial: refactor read urb submission in generic driver Use the already exported function for submitting the read urb associated with a usb_serial_port. Make sure it returns the result of usb_submit_urb and rename to the more descriptive usb_serial_generic_submit_read_urb. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/usb_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/serial/usb_debug.c') diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c index 28026b47344a..63c2734e764a 100644 --- a/drivers/usb/serial/usb_debug.c +++ b/drivers/usb/serial/usb_debug.c @@ -69,7 +69,7 @@ static void usb_debug_read_bulk_callback(struct urb *urb) memcmp(urb->transfer_buffer, USB_DEBUG_BRK, USB_DEBUG_BRK_SIZE) == 0) { usb_serial_handle_break(port); - usb_serial_generic_resubmit_read_urb(port, GFP_ATOMIC); + usb_serial_generic_submit_read_urb(port, GFP_ATOMIC); return; } -- cgit v1.2.3 From 80fa92c1335a3c7f85a3e0d3dbffd79984fdccc0 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 17 Mar 2010 23:06:05 +0100 Subject: USB: usb_debug: use the generic kfifo-based write implementation Use the generic kfifo-based write implementation rather than allowing up to 4000 8 byte urbs in the host stack queues. Cc: Jason Wessel Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/usb_debug.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/usb/serial/usb_debug.c') diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c index 63c2734e764a..aa2702b76291 100644 --- a/drivers/usb/serial/usb_debug.c +++ b/drivers/usb/serial/usb_debug.c @@ -16,7 +16,6 @@ #include #include -#define URB_DEBUG_MAX_IN_FLIGHT_URBS 4000 #define USB_DEBUG_MAX_PACKET_SIZE 8 #define USB_DEBUG_BRK_SIZE 8 static char USB_DEBUG_BRK[USB_DEBUG_BRK_SIZE] = { @@ -84,7 +83,6 @@ static struct usb_serial_driver debug_device = { .id_table = id_table, .num_ports = 1, .open = usb_debug_open, - .max_in_flight_urbs = URB_DEBUG_MAX_IN_FLIGHT_URBS, .break_ctl = usb_debug_break_ctl, .read_bulk_callback = usb_debug_read_bulk_callback, }; -- cgit v1.2.3 From 7288d7550056c17d26c09a21f1a5c3764f2f882a Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Sun, 16 May 2010 20:33:48 +0200 Subject: USB: usb_debug: set bulk out size at probe Use bulk_out_size in usb_serial_driver to set urb buffer size. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/usb_debug.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'drivers/usb/serial/usb_debug.c') diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c index aa2702b76291..f2ed6a31be77 100644 --- a/drivers/usb/serial/usb_debug.c +++ b/drivers/usb/serial/usb_debug.c @@ -43,12 +43,6 @@ static struct usb_driver debug_driver = { .no_dynamic_id = 1, }; -static int usb_debug_open(struct tty_struct *tty, struct usb_serial_port *port) -{ - port->bulk_out_size = USB_DEBUG_MAX_PACKET_SIZE; - return usb_serial_generic_open(tty, port); -} - /* This HW really does not support a serial break, so one will be * emulated when ever the break state is set to true. */ @@ -82,7 +76,7 @@ static struct usb_serial_driver debug_device = { }, .id_table = id_table, .num_ports = 1, - .open = usb_debug_open, + .bulk_out_size = USB_DEBUG_MAX_PACKET_SIZE, .break_ctl = usb_debug_break_ctl, .read_bulk_callback = usb_debug_read_bulk_callback, }; -- cgit v1.2.3