diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-02-27 16:19:21 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-02-27 16:19:21 -0800 |
commit | bb173251b923d2122658d1eb27f62b90da5e27f7 (patch) | |
tree | 9ce447bc958e7f89cbd3524611ce5b30b0d9b437 /usb | |
parent | a8d4bec05652c3c1eade627286bd4a95f8ef5986 (diff) | |
parent | 8731c84dd619e8920c639a72cd3977413eb10b4b (diff) | |
download | patches-bb173251b923d2122658d1eb27f62b90da5e27f7.tar.gz |
Merge branch 'master' of gregkh@master.kernel.org:/pub/scm/linux/kernel/git/gregkh/patches
Diffstat (limited to 'usb')
-rw-r--r-- | usb/usb-credits-add-credits-about-the-zc0301-and-et61x51-usb-drivers.patch | 29 | ||||
-rw-r--r-- | usb/usb-ethernet-gadget-driver-section-fixups.patch | 145 | ||||
-rw-r--r-- | usb/usb-fix-warning-in-drivers-usb-media-ov511.c.patch | 33 | ||||
-rw-r--r-- | usb/usb-gadget-driver-section-fixups.patch | 147 | ||||
-rw-r--r-- | usb/usb-gadget-rndis-fix-alloc-bug.patch | 43 | ||||
-rw-r--r-- | usb/usb-lh7a40x-gadget-driver-fixed-a-dead-lock.patch | 52 | ||||
-rw-r--r-- | usb/usb-reduce-syslog-clutter.patch | 40 | ||||
-rw-r--r-- | usb/usb-unusual_devs-entry-for-lyra-rca-rd1080.patch | 35 | ||||
-rw-r--r-- | usb/usb-visor.c-id-for-gspda-smartphone.patch | 49 | ||||
-rw-r--r-- | usb/usb-zc0301-driver-updates.patch | 214 | ||||
-rw-r--r-- | usb/usbfs2.patch | 241 | ||||
-rw-r--r-- | usb/usbip.patch | 22 |
12 files changed, 999 insertions, 51 deletions
diff --git a/usb/usb-credits-add-credits-about-the-zc0301-and-et61x51-usb-drivers.patch b/usb/usb-credits-add-credits-about-the-zc0301-and-et61x51-usb-drivers.patch new file mode 100644 index 0000000000000..44a149c6b1d66 --- /dev/null +++ b/usb/usb-credits-add-credits-about-the-zc0301-and-et61x51-usb-drivers.patch @@ -0,0 +1,29 @@ +From luca.risolia@studio.unibo.it Tue Feb 7 15:49:05 2006 +Date: Wed, 8 Feb 2006 00:50:59 +0000 +From: Luca Risolia <luca.risolia@studio.unibo.it> +To: Greg Kroah-Hartman <gregkh@suse.de> +Subject: USB: CREDITS: Add credits about the ZC0301 and ET61X[12]51 USB drivers +Message-ID: <20060208005059.GA10459@studio.unibo.it> +Content-Disposition: inline + +This patch adds credits about the ZC0301 and ET61X[12]51 USB drivers +which have been included in the mainline kernel recently. + +Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + CREDITS | 2 ++ + 1 file changed, 2 insertions(+) + +--- gregkh-2.6.orig/CREDITS ++++ gregkh-2.6/CREDITS +@@ -2814,6 +2814,8 @@ E: luca.risolia@studio.unibo.it + P: 1024D/FCE635A4 88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4 + D: V4L driver for W996[87]CF JPEG USB Dual Mode Camera Chips + D: V4L2 driver for SN9C10x PC Camera Controllers ++D: V4L2 driver for ET61X151 and ET61X251 PC Camera Controllers ++D: V4L2 driver for ZC0301 Image Processor and Control Chip + S: Via Liberta' 41/A + S: Osio Sotto, 24046, Bergamo + S: Italy diff --git a/usb/usb-ethernet-gadget-driver-section-fixups.patch b/usb/usb-ethernet-gadget-driver-section-fixups.patch new file mode 100644 index 0000000000000..a4e78ff61afd0 --- /dev/null +++ b/usb/usb-ethernet-gadget-driver-section-fixups.patch @@ -0,0 +1,145 @@ +From david-b@pacbell.net Sat Feb 18 12:51:14 2006 +From: David Brownell <david-b@pacbell.net> +To: Greg KH <gregkh@suse.de> +Subject: USB: ethernet gadget driver section fixups +Date: Sat, 18 Feb 2006 12:31:23 -0800 +Cc: Aras Vaichas <arasv@magellan-technology.com> +Message-Id: <200602181231.23445.david-b@pacbell.net> + +From: Aras Vaichas <arasv@magellan-technology.com> + +This patch allows you to set the iSerialNumber field in the +usb_device_descriptor structure for your USB ethernet gadget. + +It also changes the parameters shown through sysfs so they're +no longer declared as __initdata, preventing potential oopses. + +That's most useful for the Ethernet addresses, which may in +some cases be random "locally administered" addresses. + +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/ether.c | 38 +++++++++++++++++++++++++++----------- + 1 file changed, 27 insertions(+), 11 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/gadget/ether.c ++++ gregkh-2.6/drivers/usb/gadget/ether.c +@@ -182,33 +182,37 @@ struct eth_dev { + * parameters are in UTF-8 (superset of ASCII's 7 bit characters). + */ + +-static ushort __initdata idVendor; ++static ushort idVendor; + module_param(idVendor, ushort, S_IRUGO); + MODULE_PARM_DESC(idVendor, "USB Vendor ID"); + +-static ushort __initdata idProduct; ++static ushort idProduct; + module_param(idProduct, ushort, S_IRUGO); + MODULE_PARM_DESC(idProduct, "USB Product ID"); + +-static ushort __initdata bcdDevice; ++static ushort bcdDevice; + module_param(bcdDevice, ushort, S_IRUGO); + MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)"); + +-static char *__initdata iManufacturer; ++static char *iManufacturer; + module_param(iManufacturer, charp, S_IRUGO); + MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string"); + +-static char *__initdata iProduct; ++static char *iProduct; + module_param(iProduct, charp, S_IRUGO); + MODULE_PARM_DESC(iProduct, "USB Product string"); + ++static char *iSerialNumber; ++module_param(iSerialNumber, charp, S_IRUGO); ++MODULE_PARM_DESC(iSerialNumber, "SerialNumber"); ++ + /* initial value, changed by "ifconfig usb0 hw ether xx:xx:xx:xx:xx:xx" */ +-static char *__initdata dev_addr; ++static char *dev_addr; + module_param(dev_addr, charp, S_IRUGO); + MODULE_PARM_DESC(dev_addr, "Device Ethernet Address"); + + /* this address is invisible to ifconfig */ +-static char *__initdata host_addr; ++static char *host_addr; + module_param(host_addr, charp, S_IRUGO); + MODULE_PARM_DESC(host_addr, "Host Ethernet Address"); + +@@ -403,6 +407,7 @@ static inline int BITRATE(struct usb_gad + #define STRING_CDC 7 + #define STRING_SUBSET 8 + #define STRING_RNDIS 9 ++#define STRING_SERIALNUMBER 10 + + /* holds our biggest descriptor (or RNDIS response) */ + #define USB_BUFSIZ 256 +@@ -870,6 +875,7 @@ static inline void __init hs_subset_desc + + static char manufacturer [50]; + static char product_desc [40] = DRIVER_DESC; ++static char serial_number [20]; + + #ifdef DEV_CONFIG_CDC + /* address that the host will use ... usually assigned at random */ +@@ -880,6 +886,7 @@ static char ethaddr [2 * ETH_ALEN + 1 + static struct usb_string strings [] = { + { STRING_MANUFACTURER, manufacturer, }, + { STRING_PRODUCT, product_desc, }, ++ { STRING_SERIALNUMBER, serial_number, }, + { STRING_DATA, "Ethernet Data", }, + #ifdef DEV_CONFIG_CDC + { STRING_CDC, "CDC Ethernet", }, +@@ -2162,7 +2169,7 @@ static u8 __init nibble (unsigned char c + return 0; + } + +-static void __init get_ether_addr (const char *str, u8 *dev_addr) ++static int __init get_ether_addr(const char *str, u8 *dev_addr) + { + if (str) { + unsigned i; +@@ -2177,9 +2184,10 @@ static void __init get_ether_addr (const + dev_addr [i] = num; + } + if (is_valid_ether_addr (dev_addr)) +- return; ++ return 0; + } + random_ether_addr(dev_addr); ++ return 1; + } + + static int __init +@@ -2277,6 +2285,10 @@ eth_bind (struct usb_gadget *gadget) + strlcpy (manufacturer, iManufacturer, sizeof manufacturer); + if (iProduct) + strlcpy (product_desc, iProduct, sizeof product_desc); ++ if (iSerialNumber) { ++ device_desc.iSerialNumber = STRING_SERIALNUMBER, ++ strlcpy(serial_number, iSerialNumber, sizeof serial_number); ++ } + + /* all we really need is bulk IN/OUT */ + usb_ep_autoconfig_reset (gadget); +@@ -2386,9 +2398,13 @@ autoconf_fail: + * The host side address is used with CDC and RNDIS, and commonly + * ends up in a persistent config database. + */ +- get_ether_addr(dev_addr, net->dev_addr); ++ if (get_ether_addr(dev_addr, net->dev_addr)) ++ dev_warn(&gadget->dev, ++ "using random %s ethernet address\n", "self"); + if (cdc || rndis) { +- get_ether_addr(host_addr, dev->host_mac); ++ if (get_ether_addr(host_addr, dev->host_mac)) ++ dev_warn(&gadget->dev, ++ "using random %s ethernet address\n", "host"); + #ifdef DEV_CONFIG_CDC + snprintf (ethaddr, sizeof ethaddr, "%02X%02X%02X%02X%02X%02X", + dev->host_mac [0], dev->host_mac [1], diff --git a/usb/usb-fix-warning-in-drivers-usb-media-ov511.c.patch b/usb/usb-fix-warning-in-drivers-usb-media-ov511.c.patch new file mode 100644 index 0000000000000..176062ebd0ac7 --- /dev/null +++ b/usb/usb-fix-warning-in-drivers-usb-media-ov511.c.patch @@ -0,0 +1,33 @@ +From kernel-janitors-bounces@lists.osdl.org Wed Feb 15 13:45:49 2006 +From: Matthew Martin <lihnucks@gmail.com> +To: kernel-janitors@lists.osdl.org +Date: Wed, 15 Feb 2006 15:41:25 -0600 +Message-Id: <1140039685.14352.1.camel@localhost.localdomain> +Subject: USB: Fix warning in drivers/usb/media/ov511.c + +Gcc 4.0.2 had the warning: + +drivers/usb/media/ov511.c: In function 'show_exposure': +drivers/usb/media/ov511.c:5642: warning: 'exp' may be used uninitialized +in this function + +Here is the patch to fix that warning. + +Signed-off-by: Matthew Martin <lihnucks@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/media/ov511.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- gregkh-2.6.orig/drivers/usb/media/ov511.c ++++ gregkh-2.6/drivers/usb/media/ov511.c +@@ -5639,7 +5639,7 @@ static CLASS_DEVICE_ATTR(hue, S_IRUGO, s + static ssize_t show_exposure(struct class_device *cd, char *buf) + { + struct usb_ov511 *ov = cd_to_ov(cd); +- unsigned char exp; ++ unsigned char exp = 0; + + if (!ov->dev) + return -ENODEV; diff --git a/usb/usb-gadget-driver-section-fixups.patch b/usb/usb-gadget-driver-section-fixups.patch new file mode 100644 index 0000000000000..ff346c59f1164 --- /dev/null +++ b/usb/usb-gadget-driver-section-fixups.patch @@ -0,0 +1,147 @@ +From david-b@pacbell.net Sat Feb 18 12:51:14 2006 +From: David Brownell <david-b@pacbell.net> +To: Greg KH <gregkh@suse.de> +Subject: USB: gadget driver section fixups +Date: Sat, 18 Feb 2006 12:31:05 -0800 +Message-Id: <200602181231.05193.david-b@pacbell.net> + + +This adds __init section annotations to gadget driver bind() routines to +remove calls from .text into .init sections (for endpoint autoconfig). +Likewise it adds __exit section annotations to their unbind() routines. + +The specification of the gadget driver register/unregister functions is +updated to explicitly allow use of those sections. + +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/ether.c | 4 ++-- + drivers/usb/gadget/file_storage.c | 4 ++-- + drivers/usb/gadget/serial.c | 6 +++--- + drivers/usb/gadget/zero.c | 6 +++--- + include/linux/usb_gadget.h | 7 +++++-- + 5 files changed, 15 insertions(+), 12 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/gadget/zero.c ++++ gregkh-2.6/drivers/usb/gadget/zero.c +@@ -1119,7 +1119,7 @@ zero_autoresume (unsigned long _dev) + + /*-------------------------------------------------------------------------*/ + +-static void ++static void __exit + zero_unbind (struct usb_gadget *gadget) + { + struct zero_dev *dev = get_gadget_data (gadget); +@@ -1136,7 +1136,7 @@ zero_unbind (struct usb_gadget *gadget) + set_gadget_data (gadget, NULL); + } + +-static int ++static int __init + zero_bind (struct usb_gadget *gadget) + { + struct zero_dev *dev; +@@ -1288,7 +1288,7 @@ static struct usb_gadget_driver zero_dri + #endif + .function = (char *) longname, + .bind = zero_bind, +- .unbind = zero_unbind, ++ .unbind = __exit_p(zero_unbind), + + .setup = zero_setup, + .disconnect = zero_disconnect, +--- gregkh-2.6.orig/drivers/usb/gadget/ether.c ++++ gregkh-2.6/drivers/usb/gadget/ether.c +@@ -2125,7 +2125,7 @@ eth_req_free (struct usb_ep *ep, struct + } + + +-static void ++static void __exit + eth_unbind (struct usb_gadget *gadget) + { + struct eth_dev *dev = get_gadget_data (gadget); +@@ -2532,7 +2532,7 @@ static struct usb_gadget_driver eth_driv + + .function = (char *) driver_desc, + .bind = eth_bind, +- .unbind = eth_unbind, ++ .unbind = __exit_p(eth_unbind), + + .setup = eth_setup, + .disconnect = eth_disconnect, +--- gregkh-2.6.orig/drivers/usb/gadget/file_storage.c ++++ gregkh-2.6/drivers/usb/gadget/file_storage.c +@@ -3678,7 +3678,7 @@ static void lun_release(struct device *d + kref_put(&fsg->ref, fsg_release); + } + +-static void fsg_unbind(struct usb_gadget *gadget) ++static void __exit fsg_unbind(struct usb_gadget *gadget) + { + struct fsg_dev *fsg = get_gadget_data(gadget); + int i; +@@ -4064,7 +4064,7 @@ static struct usb_gadget_driver fsg_dri + #endif + .function = (char *) longname, + .bind = fsg_bind, +- .unbind = fsg_unbind, ++ .unbind = __exit_p(fsg_unbind), + .disconnect = fsg_disconnect, + .setup = fsg_setup, + .suspend = fsg_suspend, +--- gregkh-2.6.orig/drivers/usb/gadget/serial.c ++++ gregkh-2.6/drivers/usb/gadget/serial.c +@@ -369,7 +369,7 @@ static struct usb_gadget_driver gs_gadge + #endif /* CONFIG_USB_GADGET_DUALSPEED */ + .function = GS_LONG_NAME, + .bind = gs_bind, +- .unbind = gs_unbind, ++ .unbind = __exit_p(gs_unbind), + .setup = gs_setup, + .disconnect = gs_disconnect, + .driver = { +@@ -1413,7 +1413,7 @@ requeue: + * Called on module load. Allocates and initializes the device + * structure and a control request. + */ +-static int gs_bind(struct usb_gadget *gadget) ++static int __init gs_bind(struct usb_gadget *gadget) + { + int ret; + struct usb_ep *ep; +@@ -1538,7 +1538,7 @@ autoconf_fail: + * Called on module unload. Frees the control request and device + * structure. + */ +-static void gs_unbind(struct usb_gadget *gadget) ++static void __exit gs_unbind(struct usb_gadget *gadget) + { + struct gs_dev *dev = get_gadget_data(gadget); + +--- gregkh-2.6.orig/include/linux/usb_gadget.h ++++ gregkh-2.6/include/linux/usb_gadget.h +@@ -801,7 +801,9 @@ struct usb_gadget_driver { + * Call this in your gadget driver's module initialization function, + * to tell the underlying usb controller driver about your driver. + * The driver's bind() function will be called to bind it to a +- * gadget. This function must be called in a context that can sleep. ++ * gadget before this registration call returns. It's expected that ++ * the bind() functions will be in init sections. ++ * This function must be called in a context that can sleep. + */ + int usb_gadget_register_driver (struct usb_gadget_driver *driver); + +@@ -814,7 +816,8 @@ int usb_gadget_register_driver (struct u + * going away. If the controller is connected to a USB host, + * it will first disconnect(). The driver is also requested + * to unbind() and clean up any device state, before this procedure +- * finally returns. ++ * finally returns. It's expected that the unbind() functions ++ * will in in exit sections, so may not be linked in some kernels. + * This function must be called in a context that can sleep. + */ + int usb_gadget_unregister_driver (struct usb_gadget_driver *driver); diff --git a/usb/usb-gadget-rndis-fix-alloc-bug.patch b/usb/usb-gadget-rndis-fix-alloc-bug.patch new file mode 100644 index 0000000000000..0b9e9a26f47a5 --- /dev/null +++ b/usb/usb-gadget-rndis-fix-alloc-bug.patch @@ -0,0 +1,43 @@ +From david-b@pacbell.net Wed Feb 22 19:47:23 2006 +From: Shaun Tancheff <shaun@tancheff.com> +Subject: USB: Gadget RNDIS fix alloc bug. (buffer overflow) +Date: Wed, 22 Feb 2006 19:47:19 -0800 +To: Greg KH <gregkh@suse.de> +Cc: Robert Schwebel <r.schwebel@pengutronix.de>, Shaun Tancheff <shaun@tancheff.com> +Content-Disposition: inline +Message-Id: <200602221947.20100.david-b@pacbell.net> + +From: Shaun Tancheff <shaun@tancheff.com> + +Remote NDIS response to OID_GEN_SUPPORTED_LIST only allocated space +for the data attached to the reply, and not the reply structure +itself. This caused other kmalloc'd memory to be corrupted. + +Signed-off-by: Shaun Tancheff <shaun@tancheff.com> +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/usb/gadget/rndis.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/gadget/rndis.c ++++ gregkh-2.6/drivers/usb/gadget/rndis.c +@@ -853,11 +853,14 @@ static int rndis_query_response (int con + // DEBUG("%s: OID = %08X\n", __FUNCTION__, cpu_to_le32(buf->OID)); + if (!rndis_per_dev_params [configNr].dev) return -ENOTSUPP; + +- /* +- * we need more memory: +- * oid_supported_list is the largest answer ++ /* ++ * we need more memory: ++ * gen_ndis_query_resp expects enough space for ++ * rndis_query_cmplt_type followed by data. ++ * oid_supported_list is the largest data reply + */ +- r = rndis_add_response (configNr, sizeof (oid_supported_list)); ++ r = rndis_add_response (configNr, ++ sizeof (oid_supported_list) + sizeof(rndis_query_cmplt_type)); + if (!r) + return -ENOMEM; + resp = (rndis_query_cmplt_type *) r->buf; diff --git a/usb/usb-lh7a40x-gadget-driver-fixed-a-dead-lock.patch b/usb/usb-lh7a40x-gadget-driver-fixed-a-dead-lock.patch new file mode 100644 index 0000000000000..502c66487e7fc --- /dev/null +++ b/usb/usb-lh7a40x-gadget-driver-fixed-a-dead-lock.patch @@ -0,0 +1,52 @@ +From vagabon.xyz@gmail.com Thu Feb 23 00:42:08 2006 +Message-ID: <cda58cb80602230035h43c7223dm@mail.gmail.com> +Date: Thu, 23 Feb 2006 09:35:06 +0100 +From: "Franck Bui-Huu" <vagabon.xyz@gmail.com> +Subject: USB: lh7a40x gadget driver: Fixed a dead lock +Cc: "David Brownell" <david-b@pacbell.net>, greg@kroah.com +Content-Disposition: inline + +There is a dead lock in lh7a40x udc driver. When the driver receive a +SET_FEATURE HALT request, the dev lock is taken by the interrupt +handler lh7a40x_udc_irq then the handler will call lh7a40x_set_halt +function which in its turn will try to acquire the dev lock. + +Signed-off-by: Franck Bui-Huu <franck.bui-huu@innova-card.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/lh7a40x_udc.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- gregkh-2.6.orig/drivers/usb/gadget/lh7a40x_udc.c ++++ gregkh-2.6/drivers/usb/gadget/lh7a40x_udc.c +@@ -1062,11 +1062,11 @@ static int lh7a40x_ep_enable(struct usb_ + ep->pio_irqs = 0; + ep->ep.maxpacket = le16_to_cpu(desc->wMaxPacketSize); + ++ spin_unlock_irqrestore(&ep->dev->lock, flags); ++ + /* Reset halt state (does flush) */ + lh7a40x_set_halt(_ep, 0); + +- spin_unlock_irqrestore(&ep->dev->lock, flags); +- + DEBUG("%s: enabled %s\n", __FUNCTION__, _ep->name); + return 0; + } +@@ -1775,6 +1775,7 @@ static void lh7a40x_ep0_setup(struct lh7 + break; + + qep = &dev->ep[ep_num]; ++ spin_unlock(&dev->lock); + if (ctrl.bRequest == USB_REQ_SET_FEATURE) { + DEBUG_SETUP("SET_FEATURE (%d)\n", + ep_num); +@@ -1784,6 +1785,7 @@ static void lh7a40x_ep0_setup(struct lh7 + ep_num); + lh7a40x_set_halt(&qep->ep, 0); + } ++ spin_lock(&dev->lock); + usb_set_index(0); + + /* Reply with a ZLP on next IN token */ diff --git a/usb/usb-reduce-syslog-clutter.patch b/usb/usb-reduce-syslog-clutter.patch new file mode 100644 index 0000000000000..8e94ab9329f26 --- /dev/null +++ b/usb/usb-reduce-syslog-clutter.patch @@ -0,0 +1,40 @@ +From linux-usb-devel-admin@lists.sourceforge.net Fri Feb 24 01:51:08 2006 +Message-ID: <43FED6FC.3090604@imap.cc> +From: Tilman Schmidt <tilman@imap.cc> +Cc: <hjlipp@web.de> +Subject: USB: reduce syslog clutter +Date: Fri, 24 Feb 2006 10:50:52 +0100 + +The current versions of the err() / info() / warn() syslog macros +insert __FILE__ at the beginning of the message, which expands to +the complete path name of the source file within the kernel tree. + +With the following patch, when used in a module, they'll insert the +module name instead, which is significantly shorter and also tends to +be more useful to users trying to make sense of a particular message. + +Signed-off-by: Tilman Schmidt <tilman@imap.cc> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + include/linux/usb.h | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- gregkh-2.6.orig/include/linux/usb.h ++++ gregkh-2.6/include/linux/usb.h +@@ -1198,11 +1198,13 @@ extern void usb_unregister_notify(struct + #endif + + #define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ +- __FILE__ , ## arg) ++ THIS_MODULE ? THIS_MODULE->name : __FILE__ , ## arg) + #define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , \ +- __FILE__ , ## arg) ++ THIS_MODULE ? THIS_MODULE->name : __FILE__ , ## arg) + #define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , \ +- __FILE__ , ## arg) ++ THIS_MODULE ? THIS_MODULE->name : __FILE__ , ## arg) ++#define notice(format, arg...) printk(KERN_NOTICE "%s: " format "\n" , \ ++ THIS_MODULE ? THIS_MODULE->name : __FILE__ , ## arg) + + + #endif /* __KERNEL__ */ diff --git a/usb/usb-unusual_devs-entry-for-lyra-rca-rd1080.patch b/usb/usb-unusual_devs-entry-for-lyra-rca-rd1080.patch new file mode 100644 index 0000000000000..b51a79400b152 --- /dev/null +++ b/usb/usb-unusual_devs-entry-for-lyra-rca-rd1080.patch @@ -0,0 +1,35 @@ +From stern@rowland.harvard.edu Thu Feb 23 07:19:30 2006 +Date: Thu, 23 Feb 2006 10:19:25 -0500 (EST) +From: Alan Stern <stern@rowland.harvard.edu> +To: Greg KH <greg@kroah.com> +cc: David Hamilton <niftimusmaximus@lycos.com>, Phil Dibowitz <phil@ipom.com> +Subject: USB: unusual_devs entry for Lyra RCA RD1080 +Message-ID: <Pine.LNX.4.44L0.0602231013330.5204-100000@iolanthe.rowland.org> + +This patch (as656) adds an unusual_devs.h entry for the Lyra RCA RD1080 +MP3 player. Its card-reader firmware has the common +report-one-too-many-sectors bug. This fixes Novell bug #152175. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/storage/unusual_devs.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- gregkh-2.6.orig/drivers/usb/storage/unusual_devs.h ++++ gregkh-2.6/drivers/usb/storage/unusual_devs.h +@@ -753,6 +753,13 @@ UNUSUAL_DEV( 0x0693, 0x0005, 0x0100, 0x + "Flashgate", + US_SC_SCSI, US_PR_BULK, NULL, 0 ), + ++/* Reported by David Hamilton <niftimusmaximus@lycos.com> */ ++UNUSUAL_DEV( 0x069b, 0x3004, 0x0001, 0x0001, ++ "Thomson Multimedia Inc.", ++ "RCA RD1080 MP3 Player", ++ US_SC_DEVICE, US_PR_DEVICE, NULL, ++ US_FL_FIX_CAPACITY ), ++ + UNUSUAL_DEV( 0x0781, 0x0001, 0x0200, 0x0200, + "Sandisk", + "ImageMate SDDR-05a", diff --git a/usb/usb-visor.c-id-for-gspda-smartphone.patch b/usb/usb-visor.c-id-for-gspda-smartphone.patch new file mode 100644 index 0000000000000..6ead241839358 --- /dev/null +++ b/usb/usb-visor.c-id-for-gspda-smartphone.patch @@ -0,0 +1,49 @@ +From hendrik@somehost.de Sun Feb 19 10:00:11 2006 +From: Hendrik Schweppe <hendrik@somehost.de> +To: Greg KH <greg@kroah.com> +Date: Sun, 19 Feb 2006 19:00:04 +0100 +Subject: USB: visor.c id for gspda smartphone +Message-Id: <1140372004.24874.39.camel@localhost.localdomain> + +Added the USB vendorID of GSPDA and the productID of GSPDA's palm +smartphone 'xplore m68' to the list of known devices. + +Signed-off-by: Hendrik Schweppe <linuxkpatch@hendrik.fam-schweppe.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/visor.c | 3 +++ + drivers/usb/serial/visor.h | 3 +++ + 2 files changed, 6 insertions(+) + +--- gregkh-2.6.orig/drivers/usb/serial/visor.h ++++ gregkh-2.6/drivers/usb/serial/visor.h +@@ -36,6 +36,9 @@ + #define PALM_ZIRE_ID 0x0070 + #define PALM_M100_ID 0x0080 + ++#define GSPDA_VENDOR_ID 0x115e ++#define GSPDA_XPLORE_M68_ID 0xf100 ++ + #define SONY_VENDOR_ID 0x054C + #define SONY_CLIE_3_5_ID 0x0038 + #define SONY_CLIE_4_0_ID 0x0066 +--- gregkh-2.6.orig/drivers/usb/serial/visor.c ++++ gregkh-2.6/drivers/usb/serial/visor.c +@@ -69,6 +69,8 @@ static struct usb_device_id id_table [] + .driver_info = (kernel_ulong_t)&palm_os_4_probe }, + { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO600_ID), + .driver_info = (kernel_ulong_t)&palm_os_4_probe }, ++ { USB_DEVICE(GSPDA_VENDOR_ID, GSPDA_XPLORE_M68_ID), ++ .driver_info = (kernel_ulong_t)&palm_os_4_probe }, + { USB_DEVICE(PALM_VENDOR_ID, PALM_M500_ID), + .driver_info = (kernel_ulong_t)&palm_os_4_probe }, + { USB_DEVICE(PALM_VENDOR_ID, PALM_M505_ID), +@@ -139,6 +141,7 @@ static struct usb_device_id id_table_com + { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_VISOR_ID) }, + { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO_ID) }, + { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO600_ID) }, ++ { USB_DEVICE(GSPDA_VENDOR_ID, GSPDA_XPLORE_M68_ID) }, + { USB_DEVICE(PALM_VENDOR_ID, PALM_M500_ID) }, + { USB_DEVICE(PALM_VENDOR_ID, PALM_M505_ID) }, + { USB_DEVICE(PALM_VENDOR_ID, PALM_M515_ID) }, diff --git a/usb/usb-zc0301-driver-updates.patch b/usb/usb-zc0301-driver-updates.patch new file mode 100644 index 0000000000000..0f108dc9d137c --- /dev/null +++ b/usb/usb-zc0301-driver-updates.patch @@ -0,0 +1,214 @@ +From luca.risolia@studio.unibo.it Tue Feb 7 15:03:45 2006 +Date: Wed, 8 Feb 2006 00:05:27 +0000 +From: Luca Risolia <luca.risolia@studio.unibo.it> +To: Greg Kroah-Hartman <gregkh@suse.de> +Cc: Andrew Morton <akpm@osdl.org> +Subject: USB: ZC0301 driver updates +Message-ID: <20060208000527.GA10310@studio.unibo.it> +Content-Disposition: inline + +"Cosmetic" driver updates for the ZC0301 driver: + +- Fix stream_interrupt() (and work around a possible kernel bug); + +- Fix vidioc_enum_input() and split vidioc_gs_input() in two parts; +- Use wait_event_interruptible_timeout() instead of wait_event_interruptible() + when waiting for video frames; +- replace erroneous wake_up_interruptible(&wait_stream) with + wake_up(&wait_stream); +- Cosmetic cleanups in the documentation. + +Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + Documentation/usb/zc0301.txt | 19 +++++---------- + drivers/usb/media/zc0301.h | 2 - + drivers/usb/media/zc0301_core.c | 43 ++++++++++++++++++++++------------- + drivers/usb/media/zc0301_pas202bcb.c | 2 - + 4 files changed, 37 insertions(+), 29 deletions(-) + +--- gregkh-2.6.orig/Documentation/usb/zc0301.txt ++++ gregkh-2.6/Documentation/usb/zc0301.txt +@@ -67,8 +67,7 @@ Some of the features of the driver are: + - available mmap or read/poll methods for video streaming through isochronous + data transfers; + - automatic detection of image sensor; +-- video formats is standard JPEG in various compression qualities +- (see also "Notes for V4L2 application developers" paragraph); ++- video format is standard JPEG; + - full support for the capabilities of every possible image sensors that can + be connected to the ZC0301 bridges, including, for istance, red, green, + blue and global gain adjustments and exposure control (see "Supported +@@ -226,10 +225,6 @@ The same number of buffers as before wil + of the new video frames, so you have to map the buffers again before any I/O + attempts on them. + +-This driver supports the standard JPEG video format. The current compression +-quality may vary from 0 to 3 and can be selected or queried thanks to the +-VIDIOC_S_JPEGCOMP and VIDIOC_G_JPEGCOMP V4L2 ioctl's. +- + + 10. Contact information + ======================= +@@ -242,9 +237,9 @@ the fingerprint is: '88E8 F32F 7244 68BA + + 11. Credits + =========== +-- Informations about the chip internals to enable the I2C protocol have been +- taken from the documentation of the ZC030x Video4Linux1 driver written by +- Andrew Birkett <andy@nobugs.org>; +-- Initialization values of the ZC0301 connected to the PAS202BCB image sensor +- have been taken from the SPCA5XX driver maintained by +- Michel Xhaard <mxhaard@magic.fr> ++- Informations about the chip internals needed to enable the I2C protocol have ++ been taken from the documentation of the ZC030x Video4Linux1 driver written ++ by Andrew Birkett <andy@nobugs.org>; ++- Initialization values of the ZC0301 controller connected to the PAS202BCB ++ image sensor have been taken from the SPCA5XX driver maintained by ++ Michel Xhaard <mxhaard@magic.fr>. +--- gregkh-2.6.orig/drivers/usb/media/zc0301_core.c ++++ gregkh-2.6/drivers/usb/media/zc0301_core.c +@@ -3,9 +3,9 @@ + * * + * Copyright (C) 2006 by Luca Risolia <luca.risolia@studio.unibo.it> * + * * +- * Informations about the chip internals to enable the I2C protocol have * +- * been taken from the documentation of the ZC030x Video4Linux1 driver * +- * written by Andrew Birkett <andy@nobugs.org> * ++ * Informations about the chip internals needed to enable the I2C protocol * ++ * have been taken from the documentation of the ZC030x Video4Linux1 * ++ * driver written by Andrew Birkett <andy@nobugs.org> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * +@@ -54,8 +54,8 @@ + #define ZC0301_MODULE_AUTHOR "(C) 2006 Luca Risolia" + #define ZC0301_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>" + #define ZC0301_MODULE_LICENSE "GPL" +-#define ZC0301_MODULE_VERSION "1:1.00" +-#define ZC0301_MODULE_VERSION_CODE KERNEL_VERSION(1, 0, 0) ++#define ZC0301_MODULE_VERSION "1:1.01" ++#define ZC0301_MODULE_VERSION_CODE KERNEL_VERSION(1, 0, 1) + + /*****************************************************************************/ + +@@ -314,7 +314,7 @@ static void zc0301_urb_complete(struct u + if ((*f)) + (*f)->state = F_QUEUED; + DBG(3, "Stream interrupted"); +- wake_up_interruptible(&cam->wait_stream); ++ wake_up(&cam->wait_stream); + } + + if (cam->state & DEV_DISCONNECTED) +@@ -526,7 +526,7 @@ static int zc0301_stream_interrupt(struc + ZC0301_URB_TIMEOUT); + if (cam->state & DEV_DISCONNECTED) + return -ENODEV; +- else if (!timeout) { ++ else if (cam->stream != STREAM_OFF) { + cam->state |= DEV_MISCONFIGURED; + DBG(1, "URB timeout reached. The camera is misconfigured. To " + "use it, close and open /dev/video%d again.", +@@ -547,8 +547,7 @@ zc0301_set_compression(struct zc0301_dev + + if ((r = zc0301_read_reg(cam, 0x0008)) < 0) + err += r; +- err += zc0301_write_reg(cam, 0x0008, +- r | 0x11 | (compression->quality >> 1)); ++ err += zc0301_write_reg(cam, 0x0008, r | 0x11 | compression->quality); + + return err ? -EIO : 0; + } +@@ -737,8 +736,7 @@ static int zc0301_release(struct inode* + + + static ssize_t +-zc0301_read(struct file* filp, char __user * buf, +- size_t count, loff_t* f_pos) ++zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos) + { + struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); + struct zc0301_frame_t* f, * i; +@@ -1019,6 +1017,7 @@ zc0301_vidioc_enuminput(struct zc0301_de + + memset(&i, 0, sizeof(i)); + strcpy(i.name, "Camera"); ++ i.type = V4L2_INPUT_TYPE_CAMERA; + + if (copy_to_user(arg, &i, sizeof(i))) + return -EFAULT; +@@ -1028,7 +1027,19 @@ zc0301_vidioc_enuminput(struct zc0301_de + + + static int +-zc0301_vidioc_gs_input(struct zc0301_device* cam, void __user * arg) ++zc0301_vidioc_g_input(struct zc0301_device* cam, void __user * arg) ++{ ++ int index = 0; ++ ++ if (copy_to_user(arg, &index, sizeof(index))) ++ return -EFAULT; ++ ++ return 0; ++} ++ ++ ++static int ++zc0301_vidioc_s_input(struct zc0301_device* cam, void __user * arg) + { + int index; + +@@ -1446,7 +1457,7 @@ zc0301_vidioc_s_jpegcomp(struct zc0301_d + if (copy_from_user(&jc, arg, sizeof(jc))) + return -EFAULT; + +- if (jc.quality < 0 || jc.quality > 3) ++ if (jc.quality != 0) + return -EINVAL; + + if (cam->stream == STREAM_ON) +@@ -1738,8 +1749,10 @@ static int zc0301_ioctl_v4l2(struct inod + return zc0301_vidioc_enuminput(cam, arg); + + case VIDIOC_G_INPUT: ++ return zc0301_vidioc_g_input(cam, arg); ++ + case VIDIOC_S_INPUT: +- return zc0301_vidioc_gs_input(cam, arg); ++ return zc0301_vidioc_s_input(cam, arg); + + case VIDIOC_QUERYCTRL: + return zc0301_vidioc_query_ctrl(cam, arg); +@@ -1980,7 +1993,7 @@ static void zc0301_usb_disconnect(struct + zc0301_stop_transfer(cam); + cam->state |= DEV_DISCONNECTED; + wake_up_interruptible(&cam->wait_frame); +- wake_up_interruptible(&cam->wait_stream); ++ wake_up(&cam->wait_stream); + } else { + cam->state |= DEV_DISCONNECTED; + zc0301_release_resources(cam); +--- gregkh-2.6.orig/drivers/usb/media/zc0301.h ++++ gregkh-2.6/drivers/usb/media/zc0301.h +@@ -45,7 +45,7 @@ + #define ZC0301_MAX_DEVICES 64 + #define ZC0301_FORCE_MUNMAP 0 + #define ZC0301_MAX_FRAMES 32 +-#define ZC0301_COMPRESSION_QUALITY 2 ++#define ZC0301_COMPRESSION_QUALITY 0 + #define ZC0301_URBS 2 + #define ZC0301_ISO_PACKETS 7 + #define ZC0301_ALTERNATE_SETTING 7 +--- gregkh-2.6.orig/drivers/usb/media/zc0301_pas202bcb.c ++++ gregkh-2.6/drivers/usb/media/zc0301_pas202bcb.c +@@ -318,7 +318,7 @@ static struct zc0301_sensor pas202bcb = + .width = 640, + .height = 480, + .pixelformat = V4L2_PIX_FMT_JPEG, +- .priv = 16, ++ .priv = 8, + }, + }; + diff --git a/usb/usbfs2.patch b/usb/usbfs2.patch index 64b1b9b5fb771..92b5d4a5c623f 100644 --- a/usb/usbfs2.patch +++ b/usb/usbfs2.patch @@ -2,13 +2,16 @@ drivers/usb/Kconfig | 2 drivers/usb/Makefile | 2 drivers/usb/usbfs2/Kconfig | 7 - drivers/usb/usbfs2/Makefile | 5 - drivers/usb/usbfs2/usbfs2.c | 345 ++++++++++++++++++++++++++++++++++++++++++++ - 5 files changed, 361 insertions(+) + drivers/usb/usbfs2/Makefile | 7 + drivers/usb/usbfs2/inode.c | 485 ++++++++++++++++++++++++++++++++++++++++++++ + include/linux/usb.h | 2 + 6 files changed, 505 insertions(+) --- /dev/null +++ gregkh-2.6/drivers/usb/usbfs2/Makefile -@@ -0,0 +1,5 @@ +@@ -0,0 +1,7 @@ ++usbfs2-objs := inode.o ++ +obj-$(CONFIG_USB_USBFS2) += usbfs2.o + +ifeq ($(CONFIG_USB_DEBUG),y) @@ -47,8 +50,8 @@ + + Most users want to say Y here. --- /dev/null -+++ gregkh-2.6/drivers/usb/usbfs2/usbfs2.c -@@ -0,0 +1,345 @@ ++++ gregkh-2.6/drivers/usb/usbfs2/inode.c +@@ -0,0 +1,485 @@ +/* + * usbfs2.c - usbfs2 + * @@ -236,46 +239,45 @@ + return error; +} + -+#if 0 +/** -+ * securityfs_create_file - create a file in the securityfs filesystem ++ * usbfs2_create_file - create a file in the usbfs2 filesystem + * + * @name: a pointer to a string containing the name of the file to create. + * @mode: the permission that the file should have + * @parent: a pointer to the parent dentry for this file. This should be a + * directory dentry if set. If this paramater is NULL, then the -+ * file will be created in the root of the securityfs filesystem. ++ * file will be created in the root of the usbfs2 filesystem. + * @data: a pointer to something that the caller will want to get to later + * on. The inode.u.generic_ip pointer will point to this value on + * the open() call. + * @fops: a pointer to a struct file_operations that should be used for + * this file. + * -+ * This is the basic "create a file" function for securityfs. It allows for a ++ * This is the basic "create a file" function for usbfs2. It allows for a + * wide range of flexibility in createing a file, or a directory (if you -+ * want to create a directory, the securityfs_create_dir() function is ++ * want to create a directory, the usbfs2_create_dir() function is + * recommended to be used instead.) + * + * This function will return a pointer to a dentry if it succeeds. This -+ * pointer must be passed to the securityfs_remove() function when the file is ++ * pointer must be passed to the usbfs2_remove() function when the file is + * to be removed (no automatic cleanup happens if your module is unloaded, + * you are responsible here.) If an error occurs, NULL will be returned. + * -+ * If securityfs is not enabled in the kernel, the value -ENODEV will be ++ * If usbfs2 is not enabled in the kernel, the value -ENODEV will be + * returned. It is not wise to check for this value, but rather, check for + * NULL or !NULL instead as to eliminate the need for #ifdef in the calling + * code. + */ -+static struct dentry *securityfs_create_file(const char *name, mode_t mode, -+ struct dentry *parent, void *data, -+ struct file_operations *fops) ++static struct dentry *usbfs2_create_file(const char *name, mode_t mode, ++ struct dentry *parent, void *data, ++ struct file_operations *fops) +{ + struct dentry *dentry = NULL; + int error; + -+ pr_debug("securityfs: creating file '%s'\n",name); ++ pr_debug("usbfs2: creating file '%s'\n",name); + -+ error = simple_pin_fs("securityfs", &mount, &mount_count); ++ error = simple_pin_fs("usbfs2", &mount, &mount_count); + if (error) { + dentry = ERR_PTR(error); + goto exit; @@ -299,48 +301,47 @@ +} + +/** -+ * securityfs_create_dir - create a directory in the securityfs filesystem ++ * usbfs2_create_dir - create a directory in the usbfs2 filesystem + * + * @name: a pointer to a string containing the name of the directory to + * create. + * @parent: a pointer to the parent dentry for this file. This should be a + * directory dentry if set. If this paramater is NULL, then the -+ * directory will be created in the root of the securityfs filesystem. ++ * directory will be created in the root of the usbfs2 filesystem. + * -+ * This function creates a directory in securityfs with the given name. ++ * This function creates a directory in usbfs2 with the given name. + * + * This function will return a pointer to a dentry if it succeeds. This -+ * pointer must be passed to the securityfs_remove() function when the file is ++ * pointer must be passed to the usbfs2_remove() function when the file is + * to be removed (no automatic cleanup happens if your module is unloaded, + * you are responsible here.) If an error occurs, NULL will be returned. + * -+ * If securityfs is not enabled in the kernel, the value -ENODEV will be ++ * If usbfs2 is not enabled in the kernel, the value -ENODEV will be + * returned. It is not wise to check for this value, but rather, check for + * NULL or !NULL instead as to eliminate the need for #ifdef in the calling + * code. + */ -+static struct dentry *securityfs_create_dir(const char *name, struct dentry *parent) ++static struct dentry *usbfs2_create_dir(const char *name, struct dentry *parent) +{ -+ return securityfs_create_file(name, -+ S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO, -+ parent, NULL, NULL); ++ return usbfs2_create_file(name, S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO, ++ parent, NULL, NULL); +} + +/** -+ * securityfs_remove - removes a file or directory from the securityfs filesystem ++ * usbfs2_remove - removes a file or directory from the usbfs2 filesystem + * + * @dentry: a pointer to a the dentry of the file or directory to be + * removed. + * -+ * This function removes a file or directory in securityfs that was previously -+ * created with a call to another securityfs function (like -+ * securityfs_create_file() or variants thereof.) ++ * This function removes a file or directory in usbfs2 that was previously ++ * created with a call to another usbfs2 function (like ++ * usbfs2_create_file() or variants thereof.) + * + * This function is required to be called in order for the file to be + * removed, no automatic cleanup of files will happen when a module is + * removed, you are responsible here. + */ -+static void securityfs_remove(struct dentry *dentry) ++static void usbfs2_remove(struct dentry *dentry) +{ + struct dentry *parent; + @@ -364,33 +365,193 @@ + mutex_unlock(&parent->d_inode->i_mutex); + simple_release_fs(&mount, &mount_count); +} ++ ++ ++static void add_bus(struct usb_bus *bus) ++{ ++ struct dentry *parent; ++ char name[8]; ++ ++ sprintf(name, "%03d", bus->busnum); ++ ++ parent = mount->mnt_sb->s_root; ++ bus->usbfs2_dentry = usbfs2_create_dir(name, parent); ++ if (bus->usbfs2_dentry == NULL) { ++ dev_err(bus->controller, "error creating usbfs2 bus entry"); ++ return; ++ } ++} ++ ++static void remove_bus(struct usb_bus *bus) ++{ ++ if (bus->usbfs2_dentry) { ++ usbfs2_remove(bus->usbfs2_dentry); ++ bus->usbfs2_dentry = NULL; ++ } ++} ++ ++struct ep_object { ++ struct usb_endpoint_descriptor *desc; ++ struct usb_device *udev; ++ struct dentry *dentry; ++}; ++ ++static ssize_t ep_read_file(struct file *file, char __user *buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ep_object *ep_obj = file->private_data; ++ dbg("endpoint %02x read from", ep_obj->desc->bEndpointAddress); ++ return 0; ++} ++ ++static ssize_t ep_write_file(struct file *file, const char __user *buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ep_object *ep_obj = file->private_data; ++ dbg("endpoint %02x written to", ep_obj->desc->bEndpointAddress); ++ return count; ++} ++ ++static int ep_open(struct inode *inode, struct file *file) ++{ ++ if (inode->u.generic_ip) ++ file->private_data = inode->u.generic_ip; ++ return 0; ++} ++ ++static struct file_operations ep_file_ops = { ++ .read = ep_read_file, ++ .write = ep_write_file, ++ .open = ep_open, ++}; ++ ++static void add_endpoint(struct dentry *parent, struct usb_host_endpoint *endpoint, struct usb_device *udev) ++{ ++ struct ep_object *ep_obj; ++ char name[8]; ++ ++ ep_obj = kzalloc(sizeof(struct ep_object), GFP_KERNEL); ++ if (!ep_obj) ++ return; ++ ++ ep_obj->desc = &endpoint->desc; ++ ep_obj->udev = udev; ++ ++ sprintf(name, "ep_%02x", endpoint->desc.bEndpointAddress); ++ ep_obj->dentry = usbfs2_create_file(name, S_IRWXU | S_IRUGO | S_IXUGO, ++ parent, ep_obj, &ep_file_ops); ++} ++ ++static void add_device(struct usb_device *dev) ++{ ++ char name[8]; ++ ++ if (!dev->bus->usbfs2_dentry) { ++ dev_err(&dev->dev, "no directory created for the device's bus\n"); ++ return; ++ } ++ ++ sprintf(name, "%03d", dev->devnum); ++ dev->usbfs2_dentry = usbfs2_create_dir(name, dev->bus->usbfs2_dentry); ++ if (dev->usbfs2_dentry == NULL) { ++ dev_err(&dev->dev, "error creating usbfs2 device entry"); ++ return; ++ } ++ add_endpoint(dev->usbfs2_dentry, &dev->ep0, dev); ++ ++} ++ ++static void remove_device(struct usb_device *dev) ++{ ++ if (dev->usbfs2_dentry) { ++ usbfs2_remove(dev->usbfs2_dentry); ++ dev->usbfs2_dentry = NULL; ++ } ++#if 0 ++ /* FIXME need to do something like this here */ ++ while (!list_empty(&dev->filelist)) { ++ struct dev_state *ds; ++ struct siginfo sinfo; ++ ++ ds = list_entry(dev->filelist.next, struct dev_state, list); ++ wake_up_all(&ds->wait); ++ list_del_init(&ds->list); ++ if (ds->discsignr) { ++ sinfo.si_signo = SIGPIPE; ++ sinfo.si_errno = EPIPE; ++ sinfo.si_code = SI_ASYNCIO; ++ sinfo.si_addr = ds->disccontext; ++ kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid); ++ } ++ } +#endif ++} ++ ++static int usbfs2_notify(struct notifier_block *self, unsigned long action, ++ void *dev) ++{ ++ switch (action) { ++ case USB_DEVICE_ADD: ++ add_device(dev); ++ break; ++ case USB_DEVICE_REMOVE: ++ remove_device(dev); ++ break; ++ case USB_BUS_ADD: ++ add_bus(dev); ++ break; ++ case USB_BUS_REMOVE: ++ remove_bus(dev); ++ break; ++ } ++ return NOTIFY_OK; ++} ++ ++static struct notifier_block usbfs2_nb = { ++ .notifier_call = usbfs2_notify, ++}; + -+static decl_subsys(usbfs2, NULL, NULL); + +static int __init usbfs2_init(void) +{ + int retval; + -+ kset_set_kset_s(&usbfs2_subsys, kernel_subsys); -+ retval = subsystem_register(&usbfs2_subsys); -+ if (retval) -+ return retval; -+ + retval = register_filesystem(&fs_type); + if (retval) -+ subsystem_unregister(&usbfs2_subsys); ++ goto exit; ++ ++ usb_register_notify(&usbfs2_nb); ++ ++exit: + return retval; +} + +static void __exit usbfs2_exit(void) +{ ++ usb_unregister_notify(&usbfs2_nb); + simple_release_fs(&mount, &mount_count); + unregister_filesystem(&fs_type); -+ subsystem_unregister(&usbfs2_subsys); +} + +core_initcall(usbfs2_init); +module_exit(usbfs2_exit); +MODULE_LICENSE("GPL"); + +--- gregkh-2.6.orig/include/linux/usb.h ++++ gregkh-2.6/include/linux/usb.h +@@ -291,6 +291,7 @@ struct usb_bus { + int bandwidth_isoc_reqs; /* number of Isoc. requests */ + + struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ ++ struct dentry *usbfs2_dentry; /* usbfs2 dentry entry for the bus */ + + struct class_device *class_dev; /* class device for this bus */ + struct kref kref; /* reference counting for this bus */ +@@ -361,6 +362,7 @@ struct usb_device { + struct list_head filelist; + struct class_device *class_dev; + struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ ++ struct dentry *usbfs2_dentry; /* usbfs2 dentry entry for the device */ + + /* + * Child devices - these can be either new devices diff --git a/usb/usbip.patch b/usb/usbip.patch index 07ed5eb95fc8c..51f68ea0b984c 100644 --- a/usb/usbip.patch +++ b/usb/usbip.patch @@ -41,17 +41,17 @@ a link to the userspace tools needed to get this to work. --- /dev/null +++ gregkh-2.6/drivers/usb/ip/Kconfig @@ -0,0 +1,32 @@ -+config USB_IP -+ bool "USB IP support (EXPERIMENTAL)" -+ depends on USB && EXPERIMENTAL -+ default N -+ ---help--- -+ This enables pushing USB packets over IP to allow remote -+ machines access to USB devices directly. For more details, -+ and links to the userspace utility programs to let this work -+ properly, see http://usbip.naist.jp/ -+ -+ If unsure, say N. ++#config USB_IP ++# bool "USB IP support (EXPERIMENTAL)" ++# depends on USB && EXPERIMENTAL ++# default N ++# ---help--- ++# This enables pushing USB packets over IP to allow remote ++# machines access to USB devices directly. For more details, ++# and links to the userspace utility programs to let this work ++# properly, see http://usbip.naist.jp/ ++# ++# If unsure, say N. + +config USB_IP_VHCI + tristate "USB IP Host controller driver" |