diff options
author | Frank Gevaerts <frank.gevaerts@fks.be> | 2006-06-30 05:34:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-07-12 19:03:23 -0400 |
commit | b33488eb5c27c13c3e88cdf29d344ccdcb0859f2 (patch) | |
tree | 678da73c0a649126ff49fda97c341c94b6ce2779 /drivers/usb/serial | |
parent | b512504e5671f83638be0ddb085c4b1832f623d3 (diff) |
[PATCH] USB: ipaq.c timing parameters
Adds configurable waiting periods to the ipaq connection code. These are
not needed when the pocketpc device is running normally when plugged in,
but they need extra delays if they are physically connected while
rebooting.
There are two parameters :
* initial_wait : this is the delay before the driver attemts to start the
connection. This is needed because the pocktpc device takes much
longer to boot if the driver starts sending control packets too soon.
* connect_retries : this is the number of times the control urb is
retried before finally giving up. The patch also adds a 1 second delay
between retries.
I'm not sure if the cases where this patch is useful are general enough
to include this in the kernel.
Signed-off-by: Frank Gevaerts <frank.gevaerts@fks.be>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/ipaq.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index c021905f0637..65beea6e54d1 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c | |||
@@ -70,6 +70,8 @@ | |||
70 | 70 | ||
71 | static __u16 product, vendor; | 71 | static __u16 product, vendor; |
72 | static int debug; | 72 | static int debug; |
73 | static int connect_retries = KP_RETRIES; | ||
74 | static int initial_wait; | ||
73 | 75 | ||
74 | /* Function prototypes for an ipaq */ | 76 | /* Function prototypes for an ipaq */ |
75 | static int ipaq_open (struct usb_serial_port *port, struct file *filp); | 77 | static int ipaq_open (struct usb_serial_port *port, struct file *filp); |
@@ -582,7 +584,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) | |||
582 | struct ipaq_private *priv; | 584 | struct ipaq_private *priv; |
583 | struct ipaq_packet *pkt; | 585 | struct ipaq_packet *pkt; |
584 | int i, result = 0; | 586 | int i, result = 0; |
585 | int retries = KP_RETRIES; | 587 | int retries = connect_retries; |
586 | 588 | ||
587 | dbg("%s - port %d", __FUNCTION__, port->number); | 589 | dbg("%s - port %d", __FUNCTION__, port->number); |
588 | 590 | ||
@@ -646,6 +648,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) | |||
646 | port->read_urb->transfer_buffer_length = URBDATA_SIZE; | 648 | port->read_urb->transfer_buffer_length = URBDATA_SIZE; |
647 | port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE; | 649 | port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE; |
648 | 650 | ||
651 | msleep(1000*initial_wait); | ||
649 | /* Start reading from the device */ | 652 | /* Start reading from the device */ |
650 | usb_fill_bulk_urb(port->read_urb, serial->dev, | 653 | usb_fill_bulk_urb(port->read_urb, serial->dev, |
651 | usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), | 654 | usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), |
@@ -672,6 +675,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) | |||
672 | } | 675 | } |
673 | return 0; | 676 | return 0; |
674 | } | 677 | } |
678 | msleep(1000); | ||
675 | } | 679 | } |
676 | err("%s - failed doing control urb, error %d", __FUNCTION__, result); | 680 | err("%s - failed doing control urb, error %d", __FUNCTION__, result); |
677 | goto error; | 681 | goto error; |
@@ -967,3 +971,9 @@ MODULE_PARM_DESC(vendor, "User specified USB idVendor"); | |||
967 | 971 | ||
968 | module_param(product, ushort, 0); | 972 | module_param(product, ushort, 0); |
969 | MODULE_PARM_DESC(product, "User specified USB idProduct"); | 973 | MODULE_PARM_DESC(product, "User specified USB idProduct"); |
974 | |||
975 | module_param(connect_retries, int, S_IRUGO|S_IWUSR); | ||
976 | MODULE_PARM_DESC(connect_retries, "Maximum number of connect retries (one second each)"); | ||
977 | |||
978 | module_param(initial_wait, int, S_IRUGO|S_IWUSR); | ||
979 | MODULE_PARM_DESC(initial_wait, "Time to wait before attempting a connection (in seconds)"); | ||