[linux-usb-devel] Catherine the Great
You have the unique chance to get sexier with our remedy! It will make your squib a real space rocket that will raise you up to the seventh sky of the sexual satisfaction! To get it at lower price than anywhere else, go to our website: http://www.worldwideadvertainment.com/ -- okrtrprpsfstnpsssprnnlrnrnsnrpsrugstsprmrgrkoorqslrurosusnsnsfqhplpmtspppfqh - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] [GIT PATCH] USB fixes for 2.6.22-rc6
Here are some USB fixes against your 2.6.22-rc6 tree. They fix a pretty serious gadget file_storage bug, some minor bugs in other drivers (although the suck up all kernel memory in the system is pretty nasty...) and adds 2 new device ids. All of these have been in the -mm releases for a while. Please pull from: master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6.git/ The full patches will be sent to the linux-usb-devel mailing list, if anyone wants to see them. thanks, greg k-h drivers/usb/gadget/file_storage.c | 12 +--- drivers/usb/misc/iowarrior.c |7 --- drivers/usb/misc/usblcd.c | 22 ++ drivers/usb/serial/ftdi_sio.c |1 + drivers/usb/serial/ftdi_sio.h |1 + drivers/usb/serial/io_edgeport.c |4 ++-- drivers/usb/serial/option.c |6 -- drivers/usb/serial/ti_usb_3410_5052.c |8 +--- 8 files changed, 40 insertions(+), 21 deletions(-) --- Alexander Gattin (1): USB: add new device id to option driver Luiz Fernando N. Capitulino (1): USB: ftdio_sio: New IPlus device ID Oleg Nesterov (1): USB: g_file_storage: call allow_signal() Oliver Neukum (4): USB: ti serial driver sleeps with spinlock held USB: memory leak in iowarrior.c USB: usblcd doesn't limit memory consumption during write USB: fix race leading to use after free in io_edgeport - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] [PATCH 1/7] USB: g_file_storage: call allow_signal()
From: Oleg Nesterov [EMAIL PROTECTED] New changes in the signal-handling code require compensating changes in g_file_storage. This patch (as913) by Oleg Nesterov makes the code use allow_signal() instead of sigprocmask(). From: Alan Stern [EMAIL PROTECTED] Signed-off-by: Alan Stern [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/gadget/file_storage.c | 12 +--- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index c6b6479..4639b62 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c @@ -686,7 +686,6 @@ struct fsg_dev { int thread_wakeup_needed; struct completion thread_notifier; struct task_struct *thread_task; - sigset_tthread_signal_mask; int cmnd_size; u8 cmnd[MAX_COMMAND_SIZE]; @@ -3277,8 +3276,7 @@ static void handle_exception(struct fsg_dev *fsg) /* Clear the existing signals. Anything but SIGUSR1 is converted * into a high-priority EXIT exception. */ for (;;) { - sig = dequeue_signal_lock(current, fsg-thread_signal_mask, - info); + sig = dequeue_signal_lock(current, current-blocked, info); if (!sig) break; if (sig != SIGUSR1) { @@ -3431,10 +3429,10 @@ static int fsg_main_thread(void *fsg_) /* Allow the thread to be killed by a signal, but set the signal mask * to block everything but INT, TERM, KILL, and USR1. */ - siginitsetinv(fsg-thread_signal_mask, sigmask(SIGINT) | - sigmask(SIGTERM) | sigmask(SIGKILL) | - sigmask(SIGUSR1)); - sigprocmask(SIG_SETMASK, fsg-thread_signal_mask, NULL); + allow_signal(SIGINT); + allow_signal(SIGTERM); + allow_signal(SIGKILL); + allow_signal(SIGUSR1); /* Arrange for userspace references to be interpreted as kernel * pointers. That way we can pass a kernel pointer to a routine -- 1.5.2.2 - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] [PATCH 2/7] USB: ti serial driver sleeps with spinlock held
From: Oliver Neukum [EMAIL PROTECTED] you are submitting an URB with GFP_KERNEL holding a spinlock. In this case the spinlock can be dropped earlier. Signed-off-by: Oliver Neukum [EMAIL PROTECTED] Cc: Al Borchers [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/ti_usb_3410_5052.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 4203e2b..3d505fd 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c @@ -1555,15 +1555,17 @@ static int ti_restart_read(struct ti_port *tport, struct tty_struct *tty) spin_lock_irqsave(tport-tp_lock, flags); if (tport-tp_read_urb_state == TI_READ_URB_STOPPED) { + tport-tp_read_urb_state = TI_READ_URB_RUNNING; urb = tport-tp_port-read_urb; + spin_unlock_irqrestore(tport-tp_lock, flags); urb-complete = ti_bulk_in_callback; urb-context = tport; urb-dev = tport-tp_port-serial-dev; status = usb_submit_urb(urb, GFP_KERNEL); + } else { + tport-tp_read_urb_state = TI_READ_URB_RUNNING; + spin_unlock_irqrestore(tport-tp_lock, flags); } - tport-tp_read_urb_state = TI_READ_URB_RUNNING; - - spin_unlock_irqrestore(tport-tp_lock, flags); return status; } -- 1.5.2.2 - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] [PATCH 3/7] USB: memory leak in iowarrior.c
From: Oliver Neukum [EMAIL PROTECTED] this is a classical memory leak in the ioctl handler. The buffer is simply never freed. This fixes it the obvious way. Signed-off-by: Oliver Neukum [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/misc/iowarrior.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index fc51207..3bb33f7 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -495,8 +495,8 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file, /* verify that the device wasn't unplugged */ if (!dev-present) { - mutex_unlock(dev-mutex); - return -ENODEV; + retval = -ENODEV; + goto error_out; } dbg(%s - minor %d, cmd 0x%.4x, arg %ld, __func__, dev-minor, cmd, @@ -579,9 +579,10 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file, retval = -ENOTTY; break; } - +error_out: /* unlock the device */ mutex_unlock(dev-mutex); + kfree(buffer); return retval; } -- 1.5.2.2 - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] [PATCH 4/7] USB: usblcd doesn't limit memory consumption during write
From: Oliver Neukum [EMAIL PROTECTED] usblcd currently has no way to limit memory consumption by fast writers. This is a security problem, as it allows users with write access to this device to drive the system into oom despite resource limits. Here's the fix taken from the modern skeleton driver. Signed-off-by: Oliver Neukum [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/misc/usblcd.c | 22 ++ 1 files changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c index 887ef95..12bad8a 100644 --- a/drivers/usb/misc/usblcd.c +++ b/drivers/usb/misc/usblcd.c @@ -42,10 +42,14 @@ struct usb_lcd { size_t bulk_in_size; /* the size of the receive buffer */ __u8bulk_in_endpointAddr; /* the address of the bulk in endpoint */ __u8bulk_out_endpointAddr; /* the address of the bulk out endpoint */ - struct kref kref; + struct kref kref; + struct semaphorelimit_sem; /* to stop writes at full throttle from +* using up all RAM */ }; #define to_lcd_dev(d) container_of(d, struct usb_lcd, kref) +#define USB_LCD_CONCURRENT_WRITES 5 + static struct usb_driver lcd_driver; static DEFINE_MUTEX(usb_lcd_open_mutex); @@ -186,12 +190,13 @@ static void lcd_write_bulk_callback(struct urb *urb) /* free up our allocated buffer */ usb_buffer_free(urb-dev, urb-transfer_buffer_length, urb-transfer_buffer, urb-transfer_dma); + up(dev-limit_sem); } static ssize_t lcd_write(struct file *file, const char __user * user_buffer, size_t count, loff_t *ppos) { struct usb_lcd *dev; -int retval = 0; +int retval = 0, r; struct urb *urb = NULL; char *buf = NULL; @@ -201,10 +206,16 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, siz if (count == 0) goto exit; + r = down_interruptible(dev-limit_sem); + if (r 0) + return -EINTR; + /* create a urb, and a buffer for it, and copy the data to the urb */ urb = usb_alloc_urb(0, GFP_KERNEL); - if (!urb) - return -ENOMEM; + if (!urb) { + retval = -ENOMEM; + goto err_no_buf; + } buf = usb_buffer_alloc(dev-udev, count, GFP_KERNEL, urb-transfer_dma); if (!buf) { @@ -239,6 +250,8 @@ exit: error: usb_buffer_free(dev-udev, count, buf, urb-transfer_dma); usb_free_urb(urb); +err_no_buf: + up(dev-limit_sem); return retval; } @@ -277,6 +290,7 @@ static int lcd_probe(struct usb_interface *interface, const struct usb_device_id goto error; } kref_init(dev-kref); + sema_init(dev-limit_sem, USB_LCD_CONCURRENT_WRITES); dev-udev = usb_get_dev(interface_to_usbdev(interface)); dev-interface = interface; -- 1.5.2.2 - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] [PATCH 5/7] USB: fix race leading to use after free in io_edgeport
From: Oliver Neukum [EMAIL PROTECTED] usb_unlink_urb() is asynchronous, therefore an URB's buffer may not be freed without waiting for the completion handler. This patch switches to usb_kill_urb(), which is synchronous. Thanks to Alan for making me look at the remaining users of usb_unlink_urb() Signed-off-by: Oliver Neukum [EMAIL PROTECTED] Signed-off-by: Al Borchers [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/io_edgeport.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index 4807f96..056e192 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -3046,11 +3046,11 @@ static void edge_shutdown (struct usb_serial *serial) } /* free up our endpoint stuff */ if (edge_serial-is_epic) { - usb_unlink_urb(edge_serial-interrupt_read_urb); + usb_kill_urb(edge_serial-interrupt_read_urb); usb_free_urb(edge_serial-interrupt_read_urb); kfree(edge_serial-interrupt_in_buffer); - usb_unlink_urb(edge_serial-read_urb); + usb_kill_urb(edge_serial-read_urb); usb_free_urb(edge_serial-read_urb); kfree(edge_serial-bulk_in_buffer); } -- 1.5.2.2 - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] [PATCH 6/7] USB: add new device id to option driver
From: Alexander Gattin [EMAIL PROTECTED] Cc: Matthias Urlichs [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/option.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 89f067d..5d3999e 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -111,7 +111,8 @@ static int option_send_setup(struct usb_serial_port *port); #define NOVATELWIRELESS_VENDOR_ID 0x1410 #define ANYDATA_VENDOR_ID 0x16d5 -#define ANYDATA_PRODUCT_ID 0x6501 +#define ANYDATA_PRODUCT_ADU_E100A 0x6501 +#define ANYDATA_PRODUCT_ADU_500A 0x6502 #define BANDRICH_VENDOR_ID 0x1A8D #define BANDRICH_PRODUCT_C100_10x1002 @@ -169,7 +170,8 @@ static struct usb_device_id option_ids[] = { { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */ { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */ { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2410) }, /* Novatel EU740 */ - { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, + { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, + { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard */ -- 1.5.2.2 - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] [PATCH 7/7] USB: ftdio_sio: New IPlus device ID
From: Luiz Fernando N. Capitulino [EMAIL PROTECTED] Reported by Grzegorz Chimosz [EMAIL PROTECTED] Signed-off-by: Luiz Fernando N. Capitulino [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/serial/ftdi_sio.c |1 + drivers/usb/serial/ftdi_sio.h |1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 2353679..da1c6f7 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -317,6 +317,7 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, FTDI_ACTZWAVE_PID) }, { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) }, { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_IPLUS2_PID) }, { USB_DEVICE(FTDI_VID, FTDI_DMX4ALL) }, { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 33aee90..d9e4971 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h @@ -56,6 +56,7 @@ /* iPlus device */ #define FTDI_IPLUS_PID 0xD070 /* Product Id */ +#define FTDI_IPLUS2_PID 0xD071 /* Product Id */ /* DMX4ALL DMX Interfaces */ #define FTDI_DMX4ALL 0xC850 -- 1.5.2.2 - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [PATCH] Active Huawei E220 devs
Phil, Thank you for accept the unusual_devs.h portion of the previous patch. Greg, This is the updated patch, please check it. best wishes Linlei Huawei Technologies Wireless Terminal RD Dept This patch make the HUAWEI E220 device to map out three ports instead of only one virtural cd port. CC: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] CC: fangxiaozhi [EMAIL PROTECTED] Signed-off-by: fangxiaozhi fangxiaozhi60675.huawei.com diff -urN -X linux-2.6.21.1-vanilla/Documentation/dontdiff linux-2.6.21.1-vanilla/drivers/usb/storage/initializers.c linux-2.6.21.1/drivers/usb/storage/initializers.c --- linux-2.6.21.1-vanilla/drivers/usb/storage/initializers.c 2007-04-28 05:49:26.0 +0800 +++ linux-2.6.21.1/drivers/usb/storage/initializers.c 2007-06-26 23:43:54.0 +0800 @@ -90,3 +90,16 @@ return (res ? -1 : 0); } + +/* This places the HUAWEI E220 devices in multi-port mode */ +int usb_stor_switch_ports_init(struct us_data *us) +{ + int result = 0; + us-iobuf[0] = 0x1; + result = usb_control_msg(us-pusb_dev, usb_sndctrlpipe(us-pusb_dev, 0), + USB_REQ_SET_FEATURE, USB_TYPE_STANDARD | USB_RECIP_DEVICE, + 0x01, 0x0, us-iobuf, 0x1, 1000); + US_DEBUGP(usb_control_msg performing result is %d\n, result); + return (result ? 0 : -1); +} + diff -urN -X linux-2.6.21.1-vanilla/Documentation/dontdiff linux-2.6.21.1-vanilla/drivers/usb/storage/initializers.h linux-2.6.21.1/drivers/usb/storage/initializers.h --- linux-2.6.21.1-vanilla/drivers/usb/storage/initializers.h 2007-04-28 05:49:26.0 +0800 +++ linux-2.6.21.1/drivers/usb/storage/initializers.h 2007-06-25 23:01:18.0 +0800 @@ -47,3 +47,6 @@ /* This function is required to activate all four slots on the UCR-61S2B * flash reader */ int usb_stor_ucr61s2b_init(struct us_data *us); + +/* This places the HUAWEI E220 devices in multi-port mode */ +int usb_stor_switch_ports_init(struct us_data *us); diff -urN -X linux-2.6.21.1-vanilla/Documentation/dontdiff linux-2.6.21.1-vanilla/drivers/usb/storage/unusual_devs.h linux-2.6.21.1/drivers/usb/storage/unusual_devs.h --- linux-2.6.21.1-vanilla/drivers/usb/storage/unusual_devs.h 2007-04-28 05:49:26.0 +0800 +++ linux-2.6.21.1/drivers/usb/storage/unusual_devs.h 2007-06-25 23:01:18.0 +0800 @@ -1371,14 +1371,15 @@ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_IGNORE_RESIDUE ), -/* This prevents the kernel from detecting the virtual cd-drive with the - * Windows drivers. [EMAIL PROTECTED] +/* This tells the usb driver to place the HUAWEI E220 devices into multi-port mode + * Reported by fangxiaozhi [EMAIL PROTECTED] + * and by linlei [EMAIL PROTECTED] */ -UNUSUAL_DEV( 0x12d1, 0x1003, 0x, 0x, +UNUSUAL_DEV( 0x12d1, 0x1003, 0x, 0x, HUAWEI, - E220 USB-UMTS Install, - US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_IGNORE_DEVICE), + HUAWEI MOBILE Mass Storage, + US_SC_DEVICE, US_PR_DEVICE, usb_stor_switch_ports_init, + 0), /* Reported by Vilius Bilinkevicius vilisas AT xxx DOT lt) */ UNUSUAL_DEV( 0x132b, 0x000b, 0x0001, 0x0001, linlei 60022748 wrote: Hi there, This patch make the HUAWEI E220 device to map out three ports instead of only one virtural cd port. See the patch for the full explanation, CC's, and sign-off. And please apply. Short of Greg's point that the return status of usb_control_msg() isn't checked, the patch looks good to me. Or, more specifically, I'm signing off on the unusual_devs.h portion of it. So when ya'll send an updated version, I'll add my Signed-off-by. -- Phil Dibowitz [EMAIL PROTECTED] Open Source software and tech docsInsanity Palace of Metallica http://www.phildev.net/ http://www.ipom.com/ Never write it in C if you can do it in 'awk'; Never do it in 'awk' if 'sed' can handle it; Never use 'sed' when 'tr' can do the job; Never invoke 'tr' when 'cat' is sufficient; Avoid using 'cat' whenever possible -- Taylor's Laws of Programming - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] usb hub port power switching
Hello. How to correctly turn off the port power of usb hub (assuming hub supports individual port power switching). Correctly means that all drivers using the device on that port are notified before the power is removed. Removed device could also be a usb hub. My experiments with function usb_control_msg( hdev, usb_sndctrlpipe(hdev, 0), USB_REQ_CLEAR_FEATURE, USB_RT_PORT, USB_PORT_FEAT_POWER, port1, NULL, 0, 1000); will not give desired results. When I try to turn off port power with usb_control_msg, the port resides on usb hub (not root hub), then the power is indeed switched off but drivers are not notified. The devices I use are usb 1.1 and 2.0 mass storage devices, linux kernel 2.6.18. After the feat power feature was cleared the power went away for a couple of seconds but then (i think this was the scsi subsystem who wanted to perform IO with the device) usb subsystem found logical disconnect on port and the device was re-powered... Things get more complicated if port power must be switched off on root hub that has kind of controller where each port is shared by ohci - ehci driver. Most 2.0 pci to usb root hubs fall to that category. If the port is used by both drivers (actually the sharing starts from hardware) then the power must be turned off (port power feature cleared) on both controllers. I don't know the generic solution how to set up port mapping, except looking to the datasheet. My question is how can I notify all drivers related to given usb hub port when i have (struct usb_device *dev) where dev is the device on hub port where the power must be switched off? JR - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] usb hub port power switching
Am Dienstag, 26. Juni 2007 schrieb Jüri Reitel: Hello. How to correctly turn off the port power of usb hub (assuming hub supports individual port power switching). Correctly means that all drivers using the device on that port are notified before the power is removed. Removed device could also be a usb hub. You'd have to use the code paths usbfs uses for disconnecting via+ioctl. Regards Oliver - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] salun en el sexo
Aqui encontara todo lo relacionado con la salud sexual. En este sitio podr resolver todos los problemas del sexo, que nunca ms le inquietaran. No es un sitio de pornografia. Si es un sitio para aprender sobre el sexo. Mediante este enlace tiene toda la informacin: http://www.bestsevendiamonds.com/health/ Si es su deseo darse de baja, para no recibir ms publicidad es necesario lo haga en el siguiente enlace. http://www.bestsevendiamonds.com/health/bajas.asp Muchas gracias - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] usb hub port power switching
Oliver Neukum wrote: Am Dienstag, 26. Juni 2007 schrieb Jüri Reitel: Hello. How to correctly turn off the port power of usb hub (assuming hub supports individual port power switching). Correctly means that all drivers using the device on that port are notified before the power is removed. Removed device could also be a usb hub. You'd have to use the code paths usbfs uses for disconnecting via+ioctl. Thank you for fast replay Looked into drivers/usb/core/devio.c functions usbdev_ioctl proc_ioctl_default proc_ioctl USBDEVFS_DISCONNECT branch calls usb_driver_release_interface As i can understand i should obtain list of all interfaces registered to the port that i want to turn of the power and then call usbdev ioctl drivers/usb/core/hub.c has function void usb_disconnect(struct usb_device **pdev) I exported usb_disconnect function and use it in my own driver where i get struct usb_device * hub, because i know bus topology static int set_usb_port_power_state(struct usb_device *hub, int port, int new_state) { int ret; if (new_state) { ret = set_usb_hub_port_feature(hub, port, USB_PORT_FEAT_POWER); } else { //notify also children device drivers if (port 0 port = USB_MAXCHILDREN hub-children[port - 1]) { usb_disconnect(hub-children[port - 1]); } ret = clear_usb_hub_port_feature(hub, port, USB_PORT_FEAT_POWER); } return ret; } hub is obtained with usb_get_dev and later put with usb_put_dev First tests have been successful, with usb to usb hub and with root hub althoug i had to change some files in usb/host/ The most hardest part to me is to understand the needed locks before calling kernel functions Following patch is only tested with NEC uPD720101 usb 2.0 Host controller, this patch allows port power switching on nec root hub diff -ruN linux-2.6.18/drivers/usb/host/ehci-hub.c linux-2.6.18-modified/drivers/usb/host/ehci-hub.c --- linux-2.6.18/drivers/usb/host/ehci-hub.c2006-09-20 06:42:06.0 +0300 +++ linux-2.6.18-modified/drivers/usb/host/ehci-hub.c 2006-11-30 13:12:01.0 +0200 @@ -344,7 +344,7 @@ goto error; wIndex--; temp = readl (ehci-regs-port_status [wIndex]); - if (temp PORT_OWNER) + if ((temp PORT_OWNER) wValue != USB_PORT_FEAT_POWER) break; switch (wValue) { @@ -510,7 +510,7 @@ goto error; wIndex--; temp = readl (ehci-regs-port_status [wIndex]); - if (temp PORT_OWNER) + if ((temp PORT_OWNER) wValue != USB_PORT_FEAT_POWER) break; temp = ~PORT_RWC_BITS; diff -ruN linux-2.6.18/drivers/usb/host/ohci-hcd.c linux-2.6.18-modified/drivers/usb/host/ohci-hcd.c --- linux-2.6.18/drivers/usb/host/ohci-hcd.c2006-09-20 06:42:06.0 +0300 +++ linux-2.6.18-modified/drivers/usb/host/ohci-hcd.c 2006-11-30 13:05:27.0 +0200 @@ -666,6 +666,11 @@ temp |= RH_A_NPS; ohci_writel (ohci, temp, ohci-regs-roothub.a); } + + temp = ~(RH_A_NPS | RH_A_NOCP); + temp |= RH_A_PSM | RH_A_OCPM; + ohci_writel (ohci, temp, ohci-regs-roothub.a); + ohci_writel (ohci, RH_HS_LPSC, ohci-regs-roothub.status); ohci_writel (ohci, (temp RH_A_NPS) ? 0 : RH_B_PPCM, ohci-regs-roothub.b); diff -ruN linux-2.6.18/drivers/usb/host/ohci-hub.c linux-2.6.18-modified/drivers/usb/host/ohci-hub.c --- linux-2.6.18/drivers/usb/host/ohci-hub.c2006-09-20 06:42:06.0 +0300 +++ linux-2.6.18-modified/drivers/usb/host/ohci-hub.c 2006-11-30 13:16:25.0 +0200 @@ -559,6 +559,9 @@ break; case USB_PORT_FEAT_POWER: temp = RH_PS_LSDA; + ohci_writel (ohci, temp, ohci-regs-roothub.portstatus[wIndex]); + ohci_readl (ohci, ohci-regs-roothub.portstatus[wIndex]); + temp = RH_PS_CSC | RH_PS_PESC; break; case USB_PORT_FEAT_C_CONNECTION: temp = RH_PS_CSC; JR - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [PATCH] Add usb_setup_{control, bulk, int}_urb helpers
On Mon, 25 Jun 2007, Pete Zaitcev wrote: Sounds even more useful. Better abandon the halfway wrappers for the new ones. Another thing I'd think may be useful is to take the endpoint address instead of the pipe, because the pipe type is known to each wrapper, right? I'm in favor of doing away with pipe values. Bear in mind however that the endpoint address or usb_host_endpoint structure doesn't quite contain all the information of a pipe. The extra missing ingredient is a way to specify the direction for Control transfers (with Bulk, Interrupt, or Isochronous transfers the endpoint descriptor determines the direction). If you prefer, the direction can be or'ed into the high bit of the endpoint number. That's a reasonably standard approach, since it's how endpoint descriptors are formatted. (Note that devices do not contain an endpoint descriptor for ep0. usbcore makes up a fake descriptor of its own, with the direction permanently set to OUT.) Alan Stern - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [PATCH] Add usb_setup_{control, bulk, int}_urb helpers
On Mon, 25 Jun 2007, Greg KH wrote: You mean something like the following, but also for bulk and int? I like it, it reduces the number of allocations and frees we have to do as the transfer buffer will get freed automatically with the urb, when it is. What do people think? + urb = kzalloc(sizeof(*urb) + size, mem_flags); + if (!urb) + return NULL; + buffer = ((unsigned char *)(urb) + size); This is no good. The buffer has to be located in its own cache line; it can't be combined with another data structure like the URB. They must be allocated separately. Alan Stern - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [PATCH] Active Huawei E220 devs
On Tue, 26 Jun 2007, linlei 60022748 wrote: Phil, Thank you for accept the unusual_devs.h portion of the previous patch. Greg, This is the updated patch, please check it. +/* This places the HUAWEI E220 devices in multi-port mode */ +int usb_stor_switch_ports_init(struct us_data *us) +{ + int result = 0; + us-iobuf[0] = 0x1; + result = usb_control_msg(us-pusb_dev, usb_sndctrlpipe(us-pusb_dev, 0), + USB_REQ_SET_FEATURE, USB_TYPE_STANDARD | USB_RECIP_DEVICE, + 0x01, 0x0, us-iobuf, 0x1, 1000); + US_DEBUGP(usb_control_msg performing result is %d\n, result); + return (result ? 0 : -1); +} You should call usb_stor_control_msg() instead of usb_control_msg(). Also you don't need to call usb_sndctrlpipe(); you can use us-send_ctrl_pipe directly. Alan Stern - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] usb hub port power switching
On Tue, 26 Jun 2007, Jüri Reitel wrote: Hello. How to correctly turn off the port power of usb hub (assuming hub supports individual port power switching). Correctly means that all drivers using the device on that port are notified before the power is removed. Removed device could also be a usb hub. My experiments with function usb_control_msg( hdev, usb_sndctrlpipe(hdev, 0), USB_REQ_CLEAR_FEATURE, USB_RT_PORT, USB_PORT_FEAT_POWER, port1, NULL, 0, 1000); will not give desired results. When I try to turn off port power with usb_control_msg, the port resides on usb hub (not root hub), then the power is indeed switched off but drivers are not notified. You don't just want to notify the drivers; you want to destroy the entire device data structure. The only way to do it is to acquire the hub's device lock and call usb_disconnect() in hub.c. (Note that usb_disconnect is not EXPORT'ed.) Then turn off the USB_PORT_FEAT_C_CONNECTION and USB_PORT_FEAT_C_ENABLE status bits for that port in the hub and release the hub's lock. The devices I use are usb 1.1 and 2.0 mass storage devices, linux kernel 2.6.18. After the feat power feature was cleared the power went away for a couple of seconds but then (i think this was the scsi subsystem who wanted to perform IO with the device) usb subsystem found logical disconnect on port and the device was re-powered... Things get more complicated if port power must be switched off on root hub that has kind of controller where each port is shared by ohci - ehci driver. Most 2.0 pci to usb root hubs fall to that category. If the port is used by both drivers (actually the sharing starts from hardware) then the power must be turned off (port power feature cleared) on both controllers. I don't know the generic solution how to set up port mapping, except looking to the datasheet. Things are much worse with root hubs. In general they do _not_ support port power switching. My question is how can I notify all drivers related to given usb hub port when i have (struct usb_device *dev) where dev is the device on hub port where the power must be switched off? usb_disconnect() will notify all those drivers for you. Alan Stern - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] usb hub port power switching
On Tue, 26 Jun 2007, Jüri Reitel wrote: Looked into drivers/usb/core/devio.c functions usbdev_ioctl proc_ioctl_default proc_ioctl USBDEVFS_DISCONNECT branch calls usb_driver_release_interface As i can understand i should obtain list of all interfaces registered to the port that i want to turn of the power and then call usbdev ioctl Don't do this. Just call usb_disconnect(). drivers/usb/core/hub.c has function void usb_disconnect(struct usb_device **pdev) I exported usb_disconnect function and use it in my own driver where i get struct usb_device * hub, because i know bus topology static int set_usb_port_power_state(struct usb_device *hub, int port, int new_state) { int ret; if (new_state) { ret = set_usb_hub_port_feature(hub, port, USB_PORT_FEAT_POWER); } else { //notify also children device drivers if (port 0 port = USB_MAXCHILDREN hub-children[port - 1]) { If you're going to test to see if port is a valid number, you should do the test at the start of the routine -- before checking new_state. usb_disconnect(hub-children[port - 1]); } ret = clear_usb_hub_port_feature(hub, port, USB_PORT_FEAT_POWER); } return ret; } hub is obtained with usb_get_dev and later put with usb_put_dev First tests have been successful, with usb to usb hub and with root hub althoug i had to change some files in usb/host/ The most hardest part to me is to understand the needed locks before calling kernel functions Your routine needs to call usb_lock_device(hub) at the start and usb_unlock_device(hub) at the end. And you also need to clear the USB_PORT_FEAT_C_CONNECT and USB_PORT_FEAT_C_ENABLE features after turning off the port power. In general doing this with root hubs simply will not work. The USB controllers used on most PCs never turn off power to their ports. Alan Stern - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [PATCH] Add usb_setup_{control, bulk, int}_urb helpers
On Tue, Jun 26, 2007 at 10:32:42AM -0400, Alan Stern wrote: On Mon, 25 Jun 2007, Greg KH wrote: You mean something like the following, but also for bulk and int? I like it, it reduces the number of allocations and frees we have to do as the transfer buffer will get freed automatically with the urb, when it is. What do people think? + urb = kzalloc(sizeof(*urb) + size, mem_flags); + if (!urb) + return NULL; + buffer = ((unsigned char *)(urb) + size); This is no good. The buffer has to be located in its own cache line; it can't be combined with another data structure like the URB. They must be allocated separately. Why? I thought the only requirement be that they are from DMA-able memory. thanks, greg k-h - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [PATCH] Active Huawei E220 devs
On Tue, Jun 26, 2007 at 04:06:38PM +0800, linlei 60022748 wrote: diff -urN -X linux-2.6.21.1-vanilla/Documentation/dontdiff linux-2.6.21.1-vanilla/drivers/usb/storage/initializers.h linux-2.6.21.1/drivers/usb/storage/initializers.h --- linux-2.6.21.1-vanilla/drivers/usb/storage/initializers.h 2007-04-28 05:49:26.0 +0800 +++ linux-2.6.21.1/drivers/usb/storage/initializers.h 2007-06-25 23:01:18.0 +0800 @@ -47,3 +47,6 @@ /* This function is required to activate all four slots on the UCR-61S2B * flash reader */ int usb_stor_ucr61s2b_init(struct us_data *us); + +/* This places the HUAWEI E220 devices in multi-port mode */ +int usb_stor_switch_ports_init(struct us_data *us); Generally, these functions are named to refer to the devices they are used for (i.e. the ucr61s2b in the previous function). diff -urN -X linux-2.6.21.1-vanilla/Documentation/dontdiff linux-2.6.21.1-vanilla/drivers/usb/storage/unusual_devs.h linux-2.6.21.1/drivers/usb/storage/unusual_devs.h --- linux-2.6.21.1-vanilla/drivers/usb/storage/unusual_devs.h 2007-04-28 05:49:26.0 +0800 +++ linux-2.6.21.1/drivers/usb/storage/unusual_devs.h 2007-06-25 23:01:18.0 +0800 @@ -1371,14 +1371,15 @@ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_IGNORE_RESIDUE ), -/* This prevents the kernel from detecting the virtual cd-drive with the - * Windows drivers. [EMAIL PROTECTED] +/* This tells the usb driver to place the HUAWEI E220 devices into multi-port mode + * Reported by fangxiaozhi [EMAIL PROTECTED] + * and by linlei [EMAIL PROTECTED] */ -UNUSUAL_DEV( 0x12d1, 0x1003, 0x, 0x, +UNUSUAL_DEV( 0x12d1, 0x1003, 0x, 0x, Do you really want a device range from 0 to 0? Matt -- Matthew Dharm Home: [EMAIL PROTECTED] Maintainer, Linux USB Mass Storage Driver M: No, Windows doesn't have any nag screens. C: Then what are those blue and white screens I get every day? -- Mike and Cobb User Friendly, 1/4/1999 pgphYigwkoP90.pgp Description: PGP signature - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] Possible bug in isp116x-hcd
On Tue, 26 Jun 2007, ok wrote: I took out the references to urb-lock in preproc_atl_queue and isp116x_urb_enqueue. They didn't seem to serve any purpose; is that correct? Seems to be correct. urb-hcpriv is already protected by isp116x-lock. Is urb-lock entirely to guard only urb-status? If so, is the urb-lock unnecessary also in preproc_atl_queue()? That's right. The only part of an URB that usbcore will change while the URB is active is the status, so that's the only part protected by urb-lock. (Actually usbcore will also change urb-reject, but that field isn't used by HCDs.) Sure this preproc_atl_queue() has suffered from my attitude better not touch it if it works. Good that it can be simplified. Thanks for your review! Right now I don't have the hardware available. But I am working on it. These changes are big and have to be tested, no doubt. I will let you know. Maybe the whole thing could be simplified even more. It's hard to say exactly without being familiar with the hardware. For instance, is it possible the multiple maxpacket-sized transactions succeeded and then one failed? I think the overall outline of the logic should look like this: Find out how much has been successfully transferred and accumulate the amount. If the ptd is still active then exit immediately. Find out if there was a low-level error (CRC, bit stuffing, data toggle, stall, no response, invalid PID, buffer over/underflow). Increment the error counter and retry the last transaction if there are 3 errors, otherwise fail the transfer. Find out if there was a high-level error (unexpected PID, data overflow, data underflow + URB_SHORT_NOT_OK). These cause the transfer to fail immediately. If no short packet was received and the requested amount of data has not yet been transferred, proceed to transfer the remaining data. Send a zero-length packet if needed. You might need an extra flag in the endpoint structure to indicate whether the ZLP has already been sent. Do the status transaction for control transfers. What I ended up with looked a lot like this, but not exactly the same. It probably still needs some cleaning up. Alan Stern - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [PATCH] Add usb_setup_{control, bulk, int}_urb helpers
On Tue, 26 Jun 2007, Greg KH wrote: On Tue, Jun 26, 2007 at 10:32:42AM -0400, Alan Stern wrote: On Mon, 25 Jun 2007, Greg KH wrote: You mean something like the following, but also for bulk and int? I like it, it reduces the number of allocations and frees we have to do as the transfer buffer will get freed automatically with the urb, when it is. What do people think? + urb = kzalloc(sizeof(*urb) + size, mem_flags); + if (!urb) + return NULL; + buffer = ((unsigned char *)(urb) + size); This is no good. The buffer has to be located in its own cache line; it can't be combined with another data structure like the URB. They must be allocated separately. Why? I thought the only requirement be that they are from DMA-able memory. Another important requirement of streaming DMA-IN transfers is that the CPU must not touch the buffer's cache line while it is mapped for DMA. If it does, you risk reading stale values into the CPU's cache. Then when the device puts the correct values in the buffer, the CPU ignores them (and maybe even overwrites them!) because it thinks it already knows the buffer's contents. Now if you knew for certain that the buffer would only be used for OUT transfers then you might be okay. But I'm not certain, and in any case it's best to obey the access rules for DMA. Alan Stern - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [PATCH] Active Huawei E220 devs
On Tue, Jun 26, 2007 at 08:57:08AM -0700, Matthew Dharm wrote: -UNUSUAL_DEV( 0x12d1, 0x1003, 0x, 0x, +UNUSUAL_DEV( 0x12d1, 0x1003, 0x, 0x, Do you really want a device range from 0 to 0? Generally speaking, I ask people to only include devices that actually exist and need this. Since they only (afaik) have one device at this point... -- Phil Dibowitz [EMAIL PROTECTED] Open Source software and tech docsInsanity Palace of Metallica http://www.phildev.net/ http://www.ipom.com/ Never write it in C if you can do it in 'awk'; Never do it in 'awk' if 'sed' can handle it; Never use 'sed' when 'tr' can do the job; Never invoke 'tr' when 'cat' is sufficient; Avoid using 'cat' whenever possible -- Taylor's Laws of Programming signature.asc Description: Digital signature - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] usb_fill_bulk_urb() broken for USB1.1?
On 06/26/2007 10:20 AM, Keith Chew wrote: [cc: linux-usb-devel] We have been using a Zydas based WIFI drivers under kernel 2.6.16.18 with great success. Recently, when we upgraded to 2.6.20.1 (also tested on 2.6.21.5), we found that during initialisation, these calls works with USB2.0 but stopped working on USB1.1: usb_fill_bulk_urb(); usb_submit_urb(); The error code returned is -22 (-EINVAL). In 2.6.16.18, it works for both USB2.0 and 1.1. When we change to use usb_fill_int_urb(), it then works for USB1.1, but takes up to 15 seconds (usually less than 5 seconds) for the driver to initialise. Also, usb_fill_int_urb() does not work for USB2.0 (kernel panic). Can anyone point us to the right direction on how to get usb_fill_bulk_urb() working on USB1.1? We need this as not all of the deployed machines have USB2.0 enabled. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] long-term regression
On Mon, 25 Jun 2007 15:56:17 -0700 (PDT) [EMAIL PROTECTED] wrote: due to the size the files are posted at http://linux.lang.hm/linux let me know what else I can send to help. David Lang I suggest that you test 2.6.22-rcN using one or both of these boot options: noisapnp pnpacpi=off Somewhere between 2.6.18 and 2.6.22-development, the ACPI config symbol also starting enabling (selecting) PNP. That's one of many differences I would also disable CONFIG_USB_USS720, at least for testing. On Mon, 25 Jun 2007, Randy Dunlap wrote: Date: Mon, 25 Jun 2007 15:40:28 -0700 From: Randy Dunlap [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Andrew Morton [EMAIL PROTECTED], [EMAIL PROTECTED], linux-usb-devel@lists.sourceforge.net Subject: Re: long-term regression [EMAIL PROTECTED] wrote: On Thu, 21 Jun 2007, Randy Dunlap wrote: Date: Thu, 21 Jun 2007 08:36:59 -0700 From: Randy Dunlap [EMAIL PROTECTED] To: Andrew Morton [EMAIL PROTECTED] Cc: [EMAIL PROTECTED], [EMAIL PROTECTED], linux-usb-devel@lists.sourceforge.net Subject: Re: long-term regression On Thu, 21 Jun 2007 05:28:07 -0700 Andrew Morton wrote: On Sun, 17 Jun 2007 10:57:55 -0700 (PDT) [EMAIL PROTECTED] wrote: I haven't had time to bisect this, but I'm having a problem on a AMD64 gentoo system where the printer doesn't work with recent kernels. 2.6.18-rc3 worked 2.6.21.1 doesn't 2.6.22-rc4 doesn't unfortunantly the system is gooted on 2.6.18 at the moment and I'm out of town so my ability to test is limited I can provide the 2.6.22-rc4 (attached) and 2.6.18-rc3 configs. dmesg appears to show the port being detected, but writes to the port under newer kernels appear to complete, but no data gets to the printer. any suggestions other then doing the large bisect? That would be good, thanks. Please be sure to cc linux-usb-devel on the results. OK, I'm curious about how someone deduced that this is a problem with a USB printer vs. parallel port printer since the config file has: CONFIG_PRINTER=y CONFIG_USB_PRINTER=y The kernel boot log should probably be posted also. here is the dmesg from 2.6.22-rc4 and kern.log showing 2.6.22.-rc4 and 2.6.180rc3 the printer not working is the parallel port. This email didn't show up on lkml or linux-usb-devel due to size limits (it was 900+ KB). David, please send your working 2.6.18 config file. Can you post the kernel log files on the web somewhere? --- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [PATCH] USB: driver for CM109 chipset
Greg KH wrote: On Sat, Jun 16, 2007 at 11:35:49PM +0200, Alfred E. Heggestad wrote: From: Alfred E. Heggestad [EMAIL PROTECTED] This driver adds support for USB VoIP phones using the CM109 chipset, such as the KIP-1000. Keypad is scanned and events are reported to the input subsystem. The buzzer can be activated by sending SND_TONE or SND_BELL to the input device. The driver has been tested with linux 2.6.21.3 on i386 and AMD64, and linux 2.6.21.1 on Broadcom BCM3302 (MIPS, OpenWRT Project) The current patch applies cleanly and is tested on linux 2.6.22-rc4 More testing and code review is welcome.. Signed-off-by: Alfred E. Heggestad [EMAIL PROTECTED] You should send this to the Input subsystem maintainer, not me, as I don't control this directory in the kernel tree. ok, thanks for the info. I have sent the patch to Dmitry Torokhov and the linux-input mailinglist. /alfred thanks, greg k-h - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] usb_fill_bulk_urb() broken for USB1.1?
On Tue, 26 Jun 2007 13:52:41 -0400, Chuck Ebbert [EMAIL PROTECTED] wrote: On 06/26/2007 10:20 AM, Keith Chew wrote: [cc: linux-usb-devel] We have been using a Zydas based WIFI drivers under kernel 2.6.16.18 with great success. Recently, when we upgraded to 2.6.20.1 (also tested on 2.6.21.5), we found that during initialisation, these calls works with USB2.0 but stopped working on USB1.1: usb_fill_bulk_urb(); usb_submit_urb(); The error code returned is -22 (-EINVAL). In 2.6.16.18, it works for both USB2.0 and 1.1. This looks like an attempt to submit a bulk URB to an interrupt endpoint, with garbage interval or something of that nature. I think it would be the best to talk to the driver author directly. -- Pete - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] HID device communication problem with kernel 2.4
Hello, Unfortunately the problem is thrown new light upon... However, commenting out that line from kernel source is a solution, customer does not want to patch all the workstations' kernel. Some errors can be excluded with workaround (silent query from device that provide other response than the next one..), but now I am facing with a difficult trouble. Just a simple scanf() call from stdin cause that button pressed messages do not arrive. If some other data is queried from the device, the button pressed messages arrive again. I don't know the kernel code sufficiently, but I think there is some communication with the device in the background, and somehow the duplicate message filtering holds up the device to be waken up. But how can I know that scanf() read is complete? During typing it's ok, it goes wrong after pressing enter. Is there a signal or message that I could handle? Leaving the kernel code intact. I fear that this is quite hopeless this way. Please tell me if you have an idea, Thank you: Berci -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Szilvási Bertalan Sent: Friday, June 22, 2007 5:39 PM To: linux-usb-devel@lists.sourceforge.net Cc: nofilter Subject: Re: [linux-usb-devel] HID device communication problem with kernel2.4 Hi again, After some serious investigation problem is solved. And the key of the solution is contained by this listgroup.. :-). As it turned out from this mail http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg13486.html , duplicate messages are filtered out in kernel 2.4. I do not understand why it works so, and the surrounding kernel code is also strange for me. If I comment out that line, it works fine. Keeping the kernel intact, two queries that provide different answers work also fine, giving opportunity to hack a horrible workaround in the tool. 2.6 kernel code is free from that ominous filtering. Pete, thank you for your reply, and you all take care: Berci -Original Message- From: Pete Zaitcev [mailto:[EMAIL PROTECTED] Sent: Friday, June 22, 2007 12:24 AM To: Szilvási Bertalan Cc: linux-usb-devel@lists.sourceforge.net; [EMAIL PROTECTED] Subject: Re: HID device communication problem with kernel 2.4 On Thu, 21 Jun 2007 22:39:32 +0200, Szilvási Bertalan [EMAIL PROTECTED] wrote: Communication is done with blocks of 9 values. I send 9 usage_refs to the device using HIDIOCSUSAGE and HIDIOCSREPORT ioctl calls, and wait for the reply. Using cat /dev/usb/hiddev0 I can see that answer has arrived. But only at the first time! After that, no reply arrives, until I press a button on the device. Then the button pressed data can be seen, and after that the serial number query works correctly again for _one_ time, and stops working until the next button event. Setting LEDs and reading button events work always. It seems that only messages that need reply from the device fail. I see your message, but I don't have an immediate answer. Devices routinely communicate blocks of values. This needs looking into. It may be something as simple as a missing wake_up(), but I don't know. Please let me know if you uncover something new and/or come with a patch. -- Pete - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [Bugme-new] [Bug 8681] New: USB printer autosuspend breaks Samsung ML-2510
On Tue, 26 Jun 2007 19:12:14 -0700 (PDT) [EMAIL PROTECTED] wrote: http://bugzilla.kernel.org/show_bug.cgi?id=8681 Summary: USB printer autosuspend breaks Samsung ML-2510 Product: Drivers Version: 2.5 KernelVersion: 2.6.21.5 Platform: All OS/Version: Linux Tree: Mainline Status: NEW Severity: normal Priority: P1 Component: USB AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] With all recent kernels, support for the Samsung ML-2510 USB printer (USB ID 04e8:327e) is broken. When plugged in the printer shows up and works for a few seconds; then, with no obvious trigger or dmesg output, it stops working and disappears from `lsusb`. Other USB devices on this system work fine, I've narrowed it down the following patch, introduced in 2.6.20: d0532184086906889f4a0cd92eade1f7be49fbac USB: autosuspend for usb printer driver this implements autosuspend for usb printers. It compiles and is tested. Reverting that single patch from 2.6.21.5 fixes the problem. Please consider fixing/reverting/quirking the USB printer autosuspend code. Oliver got fingered ;) - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] [PATCH] dm9601: HW header size shouldn't be included in packet length
The dm9601 driver was including the 2 byte hardware header in the packet length, causing the HW to send 2 extra bytes of garbage on tx. Signed-off-by: Peter Korsgaard [EMAIL PROTECTED] --- drivers/net/usb/dm9601.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Index: linux-2.6.22-rc6/drivers/net/usb/dm9601.c === --- linux-2.6.22-rc6.orig/drivers/net/usb/dm9601.c +++ linux-2.6.22-rc6/drivers/net/usb/dm9601.c @@ -489,6 +489,8 @@ b3..n: packet data */ + len = skb-len; + if (skb_headroom(skb) DM_TX_OVERHEAD) { struct sk_buff *skb2; @@ -501,10 +503,9 @@ __skb_push(skb, DM_TX_OVERHEAD); - len = skb-len; /* usbnet adds padding if length is a multiple of packet size if so, adjust length value in header */ - if ((len % dev-maxpacket) == 0) + if ((skb-len % dev-maxpacket) == 0) len++; skb-data[0] = len; -- Bye, Peter Korsgaard - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [PATCH] dm9601: HW header size shouldn't be included in packet length
On Tuesday 26 June 2007, Peter Korsgaard wrote: The dm9601 driver was including the 2 byte hardware header in the packet length, causing the HW to send 2 extra bytes of garbage on tx. Signed-off-by: Peter Korsgaard [EMAIL PROTECTED] --- drivers/net/usb/dm9601.c |5 +++-- This should go to netdev, not the usb list... 1 file changed, 3 insertions(+), 2 deletions(-) Index: linux-2.6.22-rc6/drivers/net/usb/dm9601.c === --- linux-2.6.22-rc6.orig/drivers/net/usb/dm9601.c +++ linux-2.6.22-rc6/drivers/net/usb/dm9601.c @@ -489,6 +489,8 @@ b3..n: packet data */ + len = skb-len; + if (skb_headroom(skb) DM_TX_OVERHEAD) { struct sk_buff *skb2; @@ -501,10 +503,9 @@ __skb_push(skb, DM_TX_OVERHEAD); - len = skb-len; /* usbnet adds padding if length is a multiple of packet size if so, adjust length value in header */ - if ((len % dev-maxpacket) == 0) + if ((skb-len % dev-maxpacket) == 0) len++; skb-data[0] = len; -- Bye, Peter Korsgaard - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] [PATCH] usbnet: Zero padding byte if there is tail room in skb.
Usbnet adds a padding byte if a 0 byte packet would be sent. Zero padding byte if there is tail room in skb. Signed-of-by: Peter Korsgaard [EMAIL PROTECTED] --- drivers/net/usb/usbnet.c |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) Index: linux-2.6.22-rc6/drivers/net/usb/usbnet.c === --- linux-2.6.22-rc6.orig/drivers/net/usb/usbnet.c +++ linux-2.6.22-rc6/drivers/net/usb/usbnet.c @@ -953,11 +953,14 @@ /* don't assume the hardware handles USB_ZERO_PACKET * NOTE: strictly conforming cdc-ether devices should expect * the ZLP here, but ignore the one-byte packet. -* -* FIXME zero that byte, if it doesn't require a new skb. */ - if ((length % dev-maxpacket) == 0) + if ((length % dev-maxpacket) == 0) { urb-transfer_buffer_length++; + if (skb_tailroom(skb)) { + skb-data[skb-len] = 0; + __skb_put(skb, 1); + } + } spin_lock_irqsave (dev-txq.lock, flags); -- Bye, Peter Korsgaard - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [PATCH] usbnet: Zero padding byte if there is tail room in skb.
On Tuesday 26 June 2007, Peter Korsgaard wrote: Usbnet adds a padding byte if a 0 byte packet would be sent. Zero padding byte if there is tail room in skb. Signed-of-by: Peter Korsgaard [EMAIL PROTECTED] --- drivers/net/usb/usbnet.c |9 ++--- drivers/net patches should go to the netdev list .. However, Acked-by: David Brownell [EMAIL PROTECTED] 1 file changed, 6 insertions(+), 3 deletions(-) Index: linux-2.6.22-rc6/drivers/net/usb/usbnet.c === --- linux-2.6.22-rc6.orig/drivers/net/usb/usbnet.c +++ linux-2.6.22-rc6/drivers/net/usb/usbnet.c @@ -953,11 +953,14 @@ /* don't assume the hardware handles USB_ZERO_PACKET * NOTE: strictly conforming cdc-ether devices should expect * the ZLP here, but ignore the one-byte packet. - * - * FIXME zero that byte, if it doesn't require a new skb. */ - if ((length % dev-maxpacket) == 0) + if ((length % dev-maxpacket) == 0) { urb-transfer_buffer_length++; + if (skb_tailroom(skb)) { + skb-data[skb-len] = 0; + __skb_put(skb, 1); + } + } spin_lock_irqsave (dev-txq.lock, flags); -- Bye, Peter Korsgaard - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [PATCH] dm9601: HW header size shouldn't be included in packet length
David == David Brownell [EMAIL PROTECTED] writes: David On Tuesday 26 June 2007, Peter Korsgaard wrote: The dm9601 driver was including the 2 byte hardware header in the packet length, causing the HW to send 2 extra bytes of garbage on tx. Signed-off-by: Peter Korsgaard [EMAIL PROTECTED] --- drivers/net/usb/dm9601.c |5 +++-- David This should go to netdev, not the usb list... Really? Also the usbnet patch? Then we better update the L: lines in MAINTAINERS. -- Bye, Peter Korsgaard - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [PATCH] dm9601: HW header size shouldn't be included in packet length
On Tuesday 26 June 2007, Peter Korsgaard wrote: David == David Brownell [EMAIL PROTECTED] writes: David On Tuesday 26 June 2007, Peter Korsgaard wrote: The dm9601 driver was including the 2 byte hardware header in the packet length, causing the HW to send 2 extra bytes of garbage on tx. Signed-off-by: Peter Korsgaard [EMAIL PROTECTED] --- drivers/net/usb/dm9601.c |5 +++-- David This should go to netdev, not the usb list... Really? Also the usbnet patch? Then we better update the L: lines in MAINTAINERS. Good idea. That should probably have been done when the drivers were moved. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel