Commit 959ab1dc authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge kroah.com:/home/greg/linux/BK/bleed-2.5

into kroah.com:/home/greg/linux/BK/usb-2.6
parents 01477f1c 6afd2055
......@@ -7,7 +7,7 @@ menu "USB support"
# ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface.
config USB
tristate "Support for USB"
depends on PCI || SA1111
depends on PCI || SA1111 || ARCH_OMAP1510 || ARCH_OMAP1610
---help---
Universal Serial Bus (USB) is a specification for a serial bus
subsystem which offers higher speeds and more features than the
......
......@@ -31,6 +31,7 @@
#include <asm/uaccess.h>
#include <asm/byteorder.h>
#include "usb.h"
#include "hcd.h"
#include "hub.h"
......@@ -1316,8 +1317,8 @@ int usb_physical_reset_device(struct usb_device *dev)
kfree(descriptor);
usb_destroy_configuration(dev);
ret = usb_get_device_descriptor(dev);
if (ret < sizeof(dev->descriptor)) {
ret = usb_get_device_descriptor(dev, sizeof(dev->descriptor));
if (ret != sizeof(dev->descriptor)) {
if (ret < 0)
err("unable to get device %s descriptor "
"(error=%d)", dev->devpath, ret);
......
......@@ -546,10 +546,10 @@ void usb_sg_cancel (struct usb_sg_request *io)
*
* Gets a USB descriptor. Convenience functions exist to simplify
* getting some types of descriptors. Use
* usb_get_device_descriptor() for USB_DT_DEVICE,
* usb_get_device_descriptor() for USB_DT_DEVICE (not exported),
* and usb_get_string() or usb_string() for USB_DT_STRING.
* Configuration descriptors (USB_DT_CONFIG) are part of the device
* structure, at least for the current configuration.
* Device (USB_DT_DEVICE) and configuration descriptors (USB_DT_CONFIG)
* are part of the device structure.
* In addition to a number of USB-standard descriptors, some
* devices also use class-specific or vendor-specific descriptors.
*
......@@ -610,6 +610,7 @@ int usb_get_string(struct usb_device *dev, unsigned short langid, unsigned char
/**
* usb_get_device_descriptor - (re)reads the device descriptor
* @dev: the device whose device descriptor is being updated
* @size: how much of the descriptor to read
* Context: !in_interrupt ()
*
* Updates the copy of the device descriptor stored in the device structure,
......@@ -618,24 +619,35 @@ int usb_get_string(struct usb_device *dev, unsigned short langid, unsigned char
* vendors product and version fields (idVendor, idProduct, and bcdDevice).
* That lets device drivers compare against non-byteswapped constants.
*
* There's normally no need to use this call, although some devices
* will change their descriptors after events like updating firmware.
* Not exported, only for use by the core. If drivers really want to read
* the device descriptor directly, they can call usb_get_descriptor() with
* type = USB_DT_DEVICE and index = 0.
*
* This call is synchronous, and may not be used in an interrupt context.
*
* Returns the number of bytes received on success, or else the status code
* returned by the underlying usb_control_msg() call.
*/
int usb_get_device_descriptor(struct usb_device *dev)
int usb_get_device_descriptor(struct usb_device *dev, unsigned int size)
{
int ret = usb_get_descriptor(dev, USB_DT_DEVICE, 0, &dev->descriptor,
sizeof(dev->descriptor));
struct usb_device_descriptor *desc;
int ret;
if (size > sizeof(*desc))
return -EINVAL;
desc = kmalloc(sizeof(*desc), GFP_NOIO);
if (!desc)
return -ENOMEM;
ret = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc, size);
if (ret >= 0) {
le16_to_cpus(&dev->descriptor.bcdUSB);
le16_to_cpus(&dev->descriptor.idVendor);
le16_to_cpus(&dev->descriptor.idProduct);
le16_to_cpus(&dev->descriptor.bcdDevice);
le16_to_cpus(&desc->bcdUSB);
le16_to_cpus(&desc->idVendor);
le16_to_cpus(&desc->idProduct);
le16_to_cpus(&desc->bcdDevice);
memcpy(&dev->descriptor, desc, size);
}
kfree(desc);
return ret;
}
......@@ -1241,7 +1253,6 @@ EXPORT_SYMBOL(usb_sg_wait);
// synchronous control message convenience routines
EXPORT_SYMBOL(usb_get_descriptor);
EXPORT_SYMBOL(usb_get_device_descriptor);
EXPORT_SYMBOL(usb_get_status);
EXPORT_SYMBOL(usb_get_string);
EXPORT_SYMBOL(usb_string);
......
......@@ -206,12 +206,15 @@ void usb_deregister(struct usb_driver *driver)
*/
struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, unsigned ifnum)
{
struct usb_host_config *config = dev->actconfig;
int i;
for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++)
if (dev->actconfig->interface[i]->altsetting[0]
if (!config)
return NULL;
for (i = 0; i < config->desc.bNumInterfaces; i++)
if (config->interface[i]->altsetting[0]
.desc.bInterfaceNumber == ifnum)
return dev->actconfig->interface[i];
return config->interface[i];
return NULL;
}
......@@ -233,14 +236,17 @@ struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, unsigned ifnum)
struct usb_endpoint_descriptor *
usb_epnum_to_ep_desc(struct usb_device *dev, unsigned epnum)
{
struct usb_host_config *config = dev->actconfig;
int i, k;
for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
if (!config)
return NULL;
for (i = 0; i < config->desc.bNumInterfaces; i++) {
struct usb_interface *intf;
struct usb_host_interface *alt;
/* only endpoints in current altseting are active */
intf = dev->actconfig->interface[i];
/* only endpoints in current altsetting are active */
intf = config->interface[i];
alt = intf->altsetting + intf->act_altsetting;
for (k = 0; k < alt->desc.bNumEndpoints; k++)
......@@ -1059,7 +1065,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
wait_ms(10); /* Let the SET_ADDRESS settle */
/* high and low speed devices don't need this... */
err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, &dev->descriptor, 8);
err = usb_get_device_descriptor(dev, 8);
if (err >= 8)
break;
wait_ms(100);
......@@ -1079,8 +1085,8 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
/* USB device state == addressed ... still not usable */
err = usb_get_device_descriptor(dev);
if (err < (signed)sizeof(dev->descriptor)) {
err = usb_get_device_descriptor(dev, sizeof(dev->descriptor));
if (err != (signed)sizeof(dev->descriptor)) {
dev_err(&dev->dev, "device descriptor read/all, error %d\n", err);
goto fail;
}
......
......@@ -14,3 +14,6 @@ extern void usb_enable_endpoint (struct usb_device *dev,
struct usb_endpoint_descriptor *epd);
extern void usb_enable_interface (struct usb_device *dev,
struct usb_interface *intf);
extern int usb_get_device_descriptor(struct usb_device *dev,
unsigned int size);
......@@ -3,12 +3,10 @@
# (a) a peripheral controller, and
# (b) the gadget driver using it.
#
# for 2.5 kbuild, drivers/usb/gadget/Kconfig
# source this at the end of drivers/usb/Kconfig
#
menuconfig USB_GADGET
menu "USB Gadget Support"
config USB_GADGET
tristate "Support for USB Gadgets"
depends on EXPERIMENTAL
help
USB is a master/slave protocol, organized with one master
host (such as a PC) controlling up to 127 peripheral devices.
......@@ -36,12 +34,15 @@ menuconfig USB_GADGET
# USB Peripheral Controller Support
#
choice
prompt "USB Peripheral Controller Support"
prompt "USB Peripheral Controller"
depends on USB_GADGET
help
A USB device uses a controller to talk to its host.
Systems should have only one such upstream link.
config USB_NET2280
tristate "NetChip 2280 USB Peripheral Controller"
depends on PCI && USB_GADGET
config USB_GADGET_NET2280
boolean "NetChip 2280"
depends on PCI
help
NetChip 2280 is a PCI based USB peripheral controller which
supports both full and high speed USB 2.0 data transfers.
......@@ -54,21 +55,118 @@ config USB_NET2280
dynamically linked module called "net2280" and force all
gadget drivers to also be dynamically linked.
config USB_NET2280
tristate
depends on USB_GADGET_NET2280
default USB_GADGET
config USB_GADGET_PXA2XX
boolean "PXA 2xx or IXP 42x"
depends on ARCH_PXA || ARCH_IXP425
help
Intel's PXA 2xx series XScale ARM-5TE processors include
an integrated full speed USB 1.1 device controller. The
controller in the IXP 4xx series is register-compatible.
It has fifteen fixed-function endpoints, as well as endpoint
zero (for control transfers).
Say "y" to link the driver statically, or "m" to build a
dynamically linked module called "pxa2xx_udc" and force all
gadget drivers to also be dynamically linked.
config USB_PXA2XX
tristate
depends on USB_GADGET_PXA2XX
default USB_GADGET
# if there's only one gadget driver, using only two bulk endpoints,
# don't waste memory for the other endpoints
config USB_PXA2XX_SMALL
depends on USB_GADGET_PXA2XX
bool
default y if USB_ZERO
default y if USB_ETH
default y if USB_G_SERIAL
config USB_GADGET_GOKU
boolean "Toshiba TC86C001 'Goku-S'"
depends on PCI
help
The Toshiba TC86C001 is a PCI device which includes controllers
for full speed USB devices, IDE, I2C, SIO, plus a USB host (OHCI).
The device controller has three configurable (bulk or interrupt)
endpoints, plus endpoint zero (for control transfers).
Say "y" to link the driver statically, or "m" to build a
dynamically linked module called "goku_udc" and to force all
gadget drivers to also be dynamically linked.
config USB_GOKU
tristate
depends on USB_GADGET_GOKU
default USB_GADGET
# this could be built elsewhere (doesn't yet exist)
config USB_GADGET_SA1100
boolean "SA 1100"
depends on ARCH_SA1100
help
Intel's SA-1100 is an ARM-4 processor with an integrated
full speed USB 1.1 device controller.
It has two fixed-function endpoints, as well as endpoint
zero (for control transfers).
config USB_SA1100
tristate
depends on USB_GADGET_SA1100
default USB_GADGET
config USB_GADGET_DUMMY_HCD
boolean "Dummy HCD (DEVELOPMENT)"
depends on USB
help
This host controller driver emulates USB, looping all data transfer
requests back to a USB "gadget driver" in the same host. The host
side is the master; the gadget side is the slave. Gadget drivers
can be high, full, or low speed; and they have access to endpoints
like those from NET2280, PXA2xx, or SA1100 hardware.
This may help in some stages of creating a driver to embed in a
Linux device, since it lets you debug several parts of the gadget
driver without its hardware or drivers being involved.
Since such a gadget side driver needs to interoperate with a host
side Linux-USB device driver, this may help to debug both sides
of a USB protocol stack.
Say "y" to link the driver statically, or "m" to build a
dynamically linked module called "dummy_hcd" and force all
gadget drivers to also be dynamically linked.
config USB_DUMMY_HCD
tristate
depends on USB_GADGET_DUMMY_HCD
default USB_GADGET
endchoice
#
# USB Gadget Drivers
#
choice
prompt "USB Gadget Drivers"
tristate "USB Gadget Drivers"
depends on USB_GADGET
default USB_ETH
# FIXME want a cleaner dependency/config approach for drivers.
# this first set of drivers all depend on bulk-capable hardware.
config USB_ZERO
tristate "Gadget Zero (DEVELOPMENT)"
depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA2XX || USB_SA1100)
depends on EXPERIMENTAL
help
Gadget Zero is a two-configuration device. It either sinks and
sources bulk data; or it loops back a configurable number of
......@@ -91,26 +189,9 @@ config USB_ZERO
Say "y" to link the driver statically, or "m" to build a
dynamically linked module called "g_zero".
config USB_ZERO_NET2280
bool
# for now, treat the "dummy" hcd as if it were a net2280
depends on USB_ZERO && (USB_NET2280 || USB_DUMMY_HCD)
default y
config USB_ZERO_PXA2XX
bool
depends on USB_ZERO && USB_PXA2XX
default y
config USB_ZERO_SA1100
bool
depends on USB_ZERO && USB_SA1100
default y
config USB_ETH
tristate "Ethernet Gadget"
depends on USB_GADGET && NET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA2XX || USB_SA1100)
depends on NET
help
This driver implements Ethernet style communication, in either
of two ways:
......@@ -136,26 +217,9 @@ config USB_ETH
Say "y" to link the driver statically, or "m" to build a
dynamically linked module called "g_ether".
config USB_ETH_NET2280
bool
# for now, treat the "dummy" hcd as if it were a net2280
depends on USB_ETH && (USB_NET2280 || USB_DUMMY_HCD)
default y
config USB_ETH_PXA2XX
bool
depends on USB_ETH && USB_PXA2XX
default y
config USB_ETH_SA1100
bool
depends on USB_ETH && USB_SA1100
default y
config USB_GADGETFS
tristate "Gadget Filesystem (EXPERIMENTAL)"
depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA2XX) && EXPERIMENTAL
depends on EXPERIMENTAL
help
This driver provides a filesystem based API that lets user mode
programs implement a single-configuration USB device, including
......@@ -166,16 +230,43 @@ config USB_GADGETFS
Say "y" to link the driver statically, or "m" to build a
dynamically linked module called "gadgetfs".
config USB_GADGETFS_NET2280
bool
# for now, treat the "dummy" hcd as if it were a net2280
depends on USB_GADGETFS && (USB_NET2280 || USB_DUMMY_HCD)
default y
config USB_FILE_STORAGE
tristate "File-backed Storage Gadget (DEVELOPMENT)"
# we don't support the SA1100 because of its limitations
depends on USB_GADGET_SA1100 = n
help
The File-backed Storage Gadget acts as a USB Mass Storage
disk drive. As its storage repository it can use a regular
file or a block device (in much the same way as the "loop"
device driver), specified as a module parameter.
config USB_GADGETFS_PXA2XX
bool
depends on USB_GADGETFS && USB_PXA2XX
default y
Say "y" to link the driver statically, or "m" to build a
dynamically linked module called "g_file_storage".
config USB_FILE_STORAGE_TEST
bool "File-backed Storage Gadget test version"
depends on USB_FILE_STORAGE
default n
help
Say "y" to generate the larger testing version of the
File-backed Storage Gadget, useful for probing the
behavior of USB Mass Storage hosts. Not needed for
normal operation.
config USB_G_SERIAL
tristate "Serial Gadget"
help
The Serial Gadget talks to the Linux-USB generic serial driver.
Say "y" to link the driver statically, or "m" to build a
dynamically linked module called "g_serial".
# put drivers that need isochronous transfer support (for audio
# or video class gadget drivers), or specific hardware, here.
# - none yet
config USB_G_SERIAL
tristate "serial Gadget"
......@@ -200,4 +291,4 @@ config USB_G_SERIAL_SA1100
endchoice
# endmenuconfig
endmenu
......@@ -2,6 +2,8 @@
# USB peripheral controller drivers
#
obj-$(CONFIG_USB_NET2280) += net2280.o
obj-$(CONFIG_USB_PXA2XX) += pxa2xx_udc.o
obj-$(CONFIG_USB_GOKU) += goku_udc.o
#
# USB gadget drivers
......@@ -10,8 +12,11 @@ g_zero-objs := zero.o usbstring.o
g_ether-objs := ether.o usbstring.o
g_serial-objs := serial.o usbstring.o
gadgetfs-objs := inode.o usbstring.o
g_file_storage-objs := file_storage.o usbstring.o
obj-$(CONFIG_USB_ZERO) += g_zero.o
obj-$(CONFIG_USB_ETH) += g_ether.o
obj-$(CONFIG_USB_GADGETFS) += gadgetfs.o
obj-$(CONFIG_USB_FILE_STORAGE) += g_file_storage.o
obj-$(CONFIG_USB_G_SERIAL) += g_serial.o
......@@ -122,12 +122,9 @@ struct eth_dev {
*
* CHIP ... hardware identifier
* DRIVER_VERSION_NUM ... alerts the host side driver to differences
* EP0_MAXPACKET ... controls packetization of control requests
* EP_*_NAME ... which endpoints do we use for which purpose?
* EP_*_NUM ... numbers for them (often limited by hardware)
* HIGHSPEED ... define if ep0 and descriptors need high speed support
* MAX_USB_POWER ... define if we use other than 100 mA bus current
* SELFPOWER ... unless we can run on bus power, USB_CONFIG_ATT_SELFPOWER
* WAKEUP ... if hardware supports remote wakeup AND we will issue the
* usb_gadget_wakeup() call to initiate it, USB_CONFIG_ATT_WAKEUP
*
......@@ -143,6 +140,9 @@ struct eth_dev {
/* #undef on hardware that can't implement CDC */
#define DEV_CONFIG_CDC
/* undef on bus-powered hardware, and #define MAX_USB_POWER */
#define SELFPOWER
/*
* NetChip 2280, PCI based.
*
......@@ -152,11 +152,10 @@ struct eth_dev {
* performance note: only PIO needs per-usb-packet IRQs (ep0, ep-e, ep-f)
* otherwise IRQs are per-Ethernet-packet unless TX_DELAY and chaining help.
*/
#ifdef CONFIG_USB_ETH_NET2280
#ifdef CONFIG_USB_GADGET_NET2280
#define CHIP "net2280"
#define DEFAULT_QLEN 4 /* has dma chaining */
#define DRIVER_VERSION_NUM 0x0101
#define EP0_MAXPACKET 64
static const char EP_OUT_NAME [] = "ep-a";
#define EP_OUT_NUM 1
static const char EP_IN_NAME [] = "ep-b";
......@@ -164,8 +163,6 @@ static const char EP_IN_NAME [] = "ep-b";
static const char EP_STATUS_NAME [] = "ep-f";
#define EP_STATUS_NUM 3
#define HIGHSPEED
/* specific hardware configs could be bus-powered */
#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
/* supports remote wakeup, but this driver doesn't */
extern int net2280_set_fifo_mode (struct usb_gadget *gadget, int mode);
......@@ -186,17 +183,14 @@ static inline void hw_optimize (struct usb_gadget *gadget)
* multiple interfaces (or altsettings) aren't usable. so this hardware
* can't implement CDC, which needs both capabilities.
*/
#ifdef CONFIG_USB_ETH_PXA2XX
#ifdef CONFIG_USB_GADGET_PXA2XX
#undef DEV_CONFIG_CDC
#define CHIP "pxa2xx"
#define DRIVER_VERSION_NUM 0x0103
#define EP0_MAXPACKET 16
static const char EP_OUT_NAME [] = "ep2out-bulk";
#define EP_OUT_NUM 2
static const char EP_IN_NAME [] = "ep1in-bulk";
#define EP_IN_NUM 1
/* doesn't support bus-powered operation */
#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
/* supports remote wakeup, but this driver doesn't */
/* no hw optimizations to apply */
......@@ -209,17 +203,14 @@ static const char EP_IN_NAME [] = "ep1in-bulk";
* can't have a notification endpoint, since there are only the two
* bulk-capable ones. the CDC spec allows that.
*/
#ifdef CONFIG_USB_ETH_SA1100
#ifdef CONFIG_USB_GADGET_SA1100
#define CHIP "sa1100"
#define DRIVER_VERSION_NUM 0x0105
#define EP0_MAXPACKET 8
static const char EP_OUT_NAME [] = "ep1out-bulk";
#define EP_OUT_NUM 1
static const char EP_IN_NAME [] = "ep2in-bulk";
#define EP_IN_NUM 2
// EP_STATUS_NUM is undefined
/* doesn't support bus-powered operation */
#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
/* doesn't support remote wakeup? */
/* no hw optimizations to apply */
......@@ -231,25 +222,43 @@ static const char EP_IN_NAME [] = "ep2in-bulk";
*
* This has three semi-configurable full speed bulk/interrupt endpoints.
*/
#ifdef CONFIG_USB_ETH_GOKU
#ifdef CONFIG_USB_GADGET_GOKU
#define CHIP "goku"
#define DRIVER_VERSION_NUM 0x0106
#define EP0_MAXPACKET 8
static const char EP_OUT_NAME [] = "ep1-bulk";
#define EP_OUT_NUM 1
static const char EP_IN_NAME [] = "ep2-bulk";
#define EP_IN_NUM 2
static const char EP_STATUS_NAME [] = "ep3-bulk";
#define EP_STATUS_NUM 3
#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
/* doesn't support remote wakeup */
#define hw_optimize(g) do {} while (0)
#endif
/*
* SuperH UDC: UDC built-in to some Renesas SH processors.
*
* This has three semi-configurable full speed bulk/interrupt endpoints.
*
* Only one configuration and interface is supported. So this hardware
* can't implement CDC.
*/
#ifdef CONFIG_USB_GADGET_SUPERH
#undef DEV_CONFIG_CDC
#define CHIP "superh"
#define DRIVER_VERSION_NUM 0x0107
static const char EP_OUT_NAME[] = "ep1out-bulk";
#define EP_OUT_NUM 1
static const char EP_IN_NAME[] = "ep2in-bulk";
#define EP_IN_NUM 2
#define hw_optimize(g) do {} while (0)
#endif
/*-------------------------------------------------------------------------*/
#ifndef EP0_MAXPACKET
#ifndef CHIP
# error Configure some USB peripheral controller driver!
#endif
......@@ -280,19 +289,15 @@ static const char EP_STATUS_NAME [] = "ep3-bulk";
* hardware that supports remote wakeup defaults to disabling it.
*/
#ifndef SELFPOWER
/* default: say we rely on bus power */
#define SELFPOWER 0
/* else:
* - SELFPOWER value must be USB_CONFIG_ATT_SELFPOWER
* - MAX_USB_POWER may be nonzero.
*/
#endif
#ifndef MAX_USB_POWER
/* any hub supports this steady state bus power consumption */
#define MAX_USB_POWER 100 /* mA */
#ifdef SELFPOWER
/* some hosts are confused by 0mA */
#define MAX_USB_POWER 2 /* mA */
#else
/* bus powered */
#error Define your bus power consumption!
#endif
#endif /* MAX_USB_POWER */
#ifndef WAKEUP
/* default: this driver won't do remote wakeup */
......@@ -376,7 +381,7 @@ module_param (qmult, uint, S_IRUGO|S_IWUSR);
/*
* This device advertises one configuration.
*/
static const struct usb_device_descriptor
static struct usb_device_descriptor
device_desc = {
.bLength = sizeof device_desc,
.bDescriptorType = USB_DT_DEVICE,
......@@ -386,7 +391,6 @@ device_desc = {
.bDeviceClass = DEV_CONFIG_CLASS,
.bDeviceSubClass = 0,
.bDeviceProtocol = 0,
.bMaxPacketSize0 = EP0_MAXPACKET,
.idVendor = __constant_cpu_to_le16 (DRIVER_VENDOR_NUM),
.idProduct = __constant_cpu_to_le16 (DRIVER_PRODUCT_NUM),
......@@ -396,7 +400,7 @@ device_desc = {
.bNumConfigurations = 1,
};
static const struct usb_config_descriptor
static struct usb_config_descriptor
eth_config = {
.bLength = sizeof eth_config,
.bDescriptorType = USB_DT_CONFIG,
......@@ -409,7 +413,7 @@ eth_config = {
#endif
.bConfigurationValue = DEV_CONFIG_VALUE,
.iConfiguration = STRING_PRODUCT,
.bmAttributes = USB_CONFIG_ATT_ONE | SELFPOWER | WAKEUP,
.bmAttributes = USB_CONFIG_ATT_ONE | WAKEUP,
.bMaxPower = (MAX_USB_POWER + 1) / 2,
};
......@@ -645,7 +649,7 @@ hs_sink_desc = {
.bInterval = 1,
};
static const struct usb_qualifier_descriptor
static struct usb_qualifier_descriptor
dev_qualifier = {
.bLength = sizeof dev_qualifier,
.bDescriptorType = USB_DT_DEVICE_QUALIFIER,
......@@ -653,12 +657,10 @@ dev_qualifier = {
.bcdUSB = __constant_cpu_to_le16 (0x0200),
.bDeviceClass = DEV_CONFIG_CLASS,
/* assumes ep0 uses the same value for both speeds ... */
.bMaxPacketSize0 = EP0_MAXPACKET,
.bNumConfigurations = 1,
};
/* maxpacket and other transfer characteristics vary by speed. */
#define ep_desc(g,hs,fs) (((g)->speed==USB_SPEED_HIGH)?(hs):(fs))
......@@ -959,7 +961,7 @@ eth_set_config (struct eth_dev *dev, unsigned number, int gfp_flags)
if (number == dev->config)
return 0;
#ifdef CONFIG_USB_ETH_SA1100
#ifdef CONFIG_USB_GADGET_SA1100
if (dev->config && atomic_read (&dev->tx_qlen) != 0) {
/* tx fifo is full, but we can't clear it...*/
INFO (dev, "can't change configurations\n");
......@@ -1006,6 +1008,7 @@ eth_set_config (struct eth_dev *dev, unsigned number, int gfp_flags)
/* section 3.8.2 table 11 of the CDC spec lists Ethernet notifications */
#define CDC_NOTIFY_NETWORK_CONNECTION 0x00 /* required; 6.3.1 */
#define CDC_NOTIFY_RESPONSE_AVAILABLE 0x01 /* optional; 6.3.2 */
#define CDC_NOTIFY_SPEED_CHANGE 0x2a /* required; 6.3.8 */
struct cdc_notification {
......@@ -1123,6 +1126,8 @@ static void eth_setup_complete (struct usb_ep *ep, struct usb_request *req)
/* see section 3.8.2 table 10 of the CDC spec for more ethernet
* requests, mostly for filters (multicast, pm) and statistics
*/
#define CDC_SEND_ENCAPSULATED_REQUEST 0x00 /* optional */
#define CDC_GET_ENCAPSULATED_RESPONSE 0x01 /* optional */
#define CDC_SET_ETHERNET_PACKET_FILTER 0x43 /* required */
/*
......@@ -1188,7 +1193,7 @@ eth_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
value = eth_set_config (dev, ctrl->wValue, GFP_ATOMIC);
spin_unlock (&dev->lock);
break;
#ifdef CONFIG_USB_ETH_PXA2XX
#ifdef CONFIG_USB_GADGET_PXA2XX
/* PXA UDC prevents us from using SET_INTERFACE in normal ways.
* And it hides GET_CONFIGURATION and GET_INTERFACE too.
*/
......@@ -1638,7 +1643,7 @@ static int eth_start_xmit (struct sk_buff *skb, struct net_device *net)
req->context = skb;
req->complete = tx_complete;
#ifdef CONFIG_USB_ETH_SA1100
#ifdef CONFIG_USB_GADGET_SA1100
/* don't demand zlp (req->zero) support from all hardware */
if ((length % dev->in_ep->maxpacket) == 0)
length++;
......@@ -1770,6 +1775,17 @@ eth_bind (struct usb_gadget *gadget)
return -ENODEV;
#endif
device_desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
#ifdef HIGHSPEED
/* assumes ep0 uses the same value for both speeds ... */
dev_qualifier.bMaxPacketSize0 = device_desc.bMaxPacketSize0;
#endif
#ifdef SELFPOWERED
eth_config.bmAttributes |= USB_CONFIG_ATT_SELFPOWERED;
usb_gadget_set_selfpowered (gadget);
#endif
net = alloc_etherdev (sizeof *dev);
if (!net)
return status;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -520,6 +520,7 @@ struct net2280_ep {
unsigned num : 8,
fifo_size : 12,
in_fifo_validate : 1,
out_overflow : 1,
stopped : 1,
is_in : 1,
is_iso : 1;
......@@ -529,6 +530,7 @@ static inline void allow_status (struct net2280_ep *ep)
{
/* ep0 only */
writel ( (1 << CLEAR_CONTROL_STATUS_PHASE_HANDSHAKE)
| (1 << CLEAR_NAK_OUT_PACKETS)
| (1 << CLEAR_NAK_OUT_PACKETS_MODE)
, &ep->regs->ep_rsp);
ep->stopped = 1;
......@@ -546,7 +548,6 @@ struct net2280_request {
dma_addr_t td_dma;
struct list_head queue;
unsigned mapped : 1,
dma_done : 1,
valid : 1;
};
......@@ -559,8 +560,7 @@ struct net2280 {
unsigned enabled : 1,
protocol_stall : 1,
got_irq : 1,
region : 1,
selfpowered : 1;
region : 1;
u16 chiprev;
/* pci state used to access those endpoints */
......
......@@ -135,9 +135,6 @@ do { \
#define GS_NUM_PORTS 16
#define GS_VENDOR_ID 0x05F9
#define GS_PRODUCT_ID 0xFFFF
#define GS_NUM_CONFIGS 1
#define GS_NO_CONFIG_ID 0
#define GS_BULK_CONFIG_ID 2
......@@ -187,7 +184,7 @@ static int debug = G_SERIAL_DEBUG;
* DMA channels to manage their FIFOs. It supports high speed.
* Those endpoints can be arranged in any desired configuration.
*/
#ifdef CONFIG_USB_G_SERIAL_NET2280
#ifdef CONFIG_USB_GADGET_NET2280
#define CHIP "net2280"
#define EP0_MAXPACKET 64
static const char EP_OUT_NAME[] = "ep-a";
......@@ -220,13 +217,13 @@ static inline void hw_optimize(struct usb_gadget *gadget)
* can't use altsettings or reset the interfaces independently.
* So stick to a single interface.
*/
#ifdef CONFIG_USB_G_SERIAL_PXA2XX
#ifdef CONFIG_USB_GADGET_PXA2XX
#define CHIP "pxa2xx"
#define EP0_MAXPACKET 16
static const char EP_OUT_NAME[] = "ep12out-bulk";
#define EP_OUT_NUM 12
static const char EP_IN_NAME[] = "ep11in-bulk";
#define EP_IN_NUM 11
static const char EP_OUT_NAME[] = "ep2out-bulk";
#define EP_OUT_NUM 2
static const char EP_IN_NAME[] = "ep1in-bulk";
#define EP_IN_NUM 1
#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
/* no hw optimizations to apply */
......@@ -245,7 +242,7 @@ static const char EP_IN_NAME[] = "ep11in-bulk";
* in special situations. So this is a case of "choose it right
* during enumeration" ...
*/
#ifdef CONFIG_USB_G_SERIAL_SA1100
#ifdef CONFIG_USB_GADGET_SA1100
#define CHIP "sa1100"
#define EP0_MAXPACKET 8
static const char EP_OUT_NAME[] = "ep1out-bulk";
......@@ -264,7 +261,7 @@ static const char EP_IN_NAME [] = "ep2in-bulk";
*
* This has three semi-configurable full speed bulk/interrupt endpoints.
*/
#ifdef CONFIG_USB_G_SERIAL_GOKU
#ifdef CONFIG_USB_GADGET_GOKU
#define CHIP "goku"
#define DRIVER_VERSION_NUM 0x0116
#define EP0_MAXPACKET 8
......@@ -302,6 +299,14 @@ static const char EP_IN_NAME [] = "ep2-bulk";
/* else value must be USB_CONFIG_ATT_WAKEUP */
#endif
/* Thanks to NetChip Technologies for donating this product ID.
*
* DO NOT REUSE THESE IDs with a protocol-incompatible driver!! Ever!!
* Instead: allocate your own, using normal USB-IF procedures.
*/
#define GS_VENDOR_ID 0x0525 /* NetChip */
#define GS_PRODUCT_ID 0xa4a6 /* Linux-USB Serial Gadget */
/* Structures */
......
......@@ -131,7 +131,7 @@ static const char loopback [] = "loop input to output";
* DMA channels to manage their FIFOs. It supports high speed.
* Those endpoints can be arranged in any desired configuration.
*/
#ifdef CONFIG_USB_ZERO_NET2280
#if defined(CONFIG_USB_GADGET_NET2280) || defined(CONFIG_USB_GADGET_DUMMY_HCD)
#define CHIP "net2280"
#define DRIVER_VERSION_NUM 0x0101
static const char EP_OUT_NAME [] = "ep-a";
......@@ -154,7 +154,7 @@ static const char EP_IN_NAME [] = "ep-b";
* can't use altsettings or reset the interfaces independently.
* So stick to a single interface.
*/
#ifdef CONFIG_USB_ZERO_PXA2XX
#ifdef CONFIG_USB_GADGET_PXA2XX
#define CHIP "pxa2xx"
#define DRIVER_VERSION_NUM 0x0103
static const char EP_OUT_NAME [] = "ep12out-bulk";
......@@ -176,7 +176,7 @@ static const char EP_IN_NAME [] = "ep11in-bulk";
* in special situations. So this is a case of "choose it right
* during enumeration" ...
*/
#ifdef CONFIG_USB_ZERO_SA1100
#ifdef CONFIG_USB_GADGET_SA1100
#define CHIP "sa1100"
#define DRIVER_VERSION_NUM 0x0105
static const char EP_OUT_NAME [] = "ep1out-bulk";
......@@ -192,7 +192,7 @@ static const char EP_IN_NAME [] = "ep2in-bulk";
*
* This has three semi-configurable full speed bulk/interrupt endpoints.
*/
#ifdef CONFIG_USB_ZERO_GOKU
#ifdef CONFIG_USB_GADGET_GOKU
#define CHIP "goku"
#define DRIVER_VERSION_NUM 0x0106
static const char EP_OUT_NAME [] = "ep1-bulk";
......@@ -936,7 +936,7 @@ zero_set_config (struct zero_dev *dev, unsigned number, int gfp_flags)
if (number == dev->config)
return 0;
#ifdef CONFIG_USB_ZERO_SA1100
#ifdef CONFIG_USB_GADGET_SA1100
if (dev->config) {
/* tx fifo is full, but we can't clear it...*/
INFO (dev, "can't change configurations\n");
......
......@@ -684,6 +684,10 @@ MODULE_LICENSE ("GPL");
#include "ohci-sa1111.c"
#endif
#if !(defined(CONFIG_PCI) || defined(CONFIG_SA1111))
#ifdef CONFIG_ARCH_OMAP
#include "ohci-omap.c"
#endif
#if !(defined(CONFIG_PCI) || defined(CONFIG_SA1111) || defined(CONFIG_ARCH_OMAP))
#error "missing bus glue for ohci-hcd"
#endif
This diff is collapsed.
/*
* linux/drivers/usb/host/ohci-omap.h
*
* OMAP OHCI USB controller specific defines
*/
/* OMAP USB OHCI common defines */
#define OMAP_OHCI_NAME "omap-ohci"
#define OMAP_OHCI_BASE 0xfffba000
#define OMAP_OHCI_SIZE 4096
#define HMC_CLEAR (0x3f << 1)
#define APLL_NDPLL_SWITCH 0x0001
#define DPLL_PLL_ENABLE 0x0010
#define DPLL_LOCK 0x0001
#define SOFT_REQ_REG_REQ 0x0001
#define USB_MCLK_EN 0x0010
#define USB_HOST_HHC_UHOST_EN 0x00000200
#define SOFT_USB_OTG_REQ (1 << 8)
#define SOFT_USB_REQ (1 << 3)
#define STATUS_REQ_REG 0xfffe0840
#define USB_HOST_DPLL_REQ (1 << 8)
#define SOFT_DPLL_REQ (1 << 0)
/* OMAP-1510 USB OHCI defines */
#define OMAP1510_LB_MEMSIZE 32 /* Should be same as SDRAM size */
#define OMAP1510_LB_CLOCK_DIV 0xfffec10c
#define OMAP1510_LB_MMU_CTL 0xfffec208
#define OMAP1510_LB_MMU_LCK 0xfffec224
#define OMAP1510_LB_MMU_LD_TLB 0xfffec228
#define OMAP1510_LB_MMU_CAM_H 0xfffec22c
#define OMAP1510_LB_MMU_CAM_L 0xfffec230
#define OMAP1510_LB_MMU_RAM_H 0xfffec234
#define OMAP1510_LB_MMU_RAM_L 0xfffec238
/* OMAP-1610 USB OHCI defines */
#define USB_TRANSCEIVER_CTRL 0xfffe1064
#define OTG_REV 0xfffb0400
#define OTG_SYSCON_1 0xfffb0404
#define OTG_IDLE_EN (1 << 15)
#define DEV_IDLE_EN (1 << 13)
#define OTG_SYSCON_2 0xfffb0408
#define OTG_CTRL 0xfffb040c
#define OTG_IRQ_EN 0xfffb0410
#define OTG_IRQ_SRC 0xfffb0414
#define OTG_EN (1 << 31)
#define USBX_SYNCHRO (1 << 30)
#define SRP_VBUS (1 << 12)
#define OTG_PADEN (1 << 10)
#define HMC_PADEN (1 << 9)
#define UHOST_EN (1 << 8)
/* Hardware specific defines */
#define OMAP1510_FPGA_HOST_CTRL 0xe800020c
......@@ -781,17 +781,25 @@ static int dabusb_probe (struct usb_interface *intf,
static void dabusb_disconnect (struct usb_interface *intf)
{
wait_queue_t __wait;
pdabusb_t s = usb_get_intfdata (intf);
dbg("dabusb_disconnect");
init_waitqueue_entry(&__wait, current);
usb_set_intfdata (intf, NULL);
if (s) {
usb_deregister_dev (intf, &dabusb_class);
s->remove_pending = 1;
wake_up (&s->wait);
add_wait_queue(&s->remove_ok, &__wait);
set_current_state(TASK_UNINTERRUPTIBLE);
if (s->state == _started)
sleep_on (&s->remove_ok);
schedule();
current->state = TASK_RUNNING;
remove_wait_queue(&s->remove_ok, &__wait);
s->usbdev = NULL;
s->overruns = 0;
}
......
......@@ -6,6 +6,7 @@ comment "USB Miscellaneous drivers"
config USB_EMI62
tristate "EMI 6|2m USB Audio interface support"
depends on USB
---help---
This driver loads firmware to Emagic EMI 6|2m low latency USB
Audio and Midi interface.
......@@ -20,6 +21,7 @@ config USB_EMI62
config USB_EMI26
tristate "EMI 2|6 USB Audio interface support"
depends on USB
---help---
This driver loads firmware to Emagic EMI 2|6 low latency USB
Audio interface.
......
......@@ -1927,7 +1927,6 @@ static int auerswald_probe (struct usb_interface *intf,
{
struct usb_device *usbdev = interface_to_usbdev(intf);
pauerswald_t cp = NULL;
DECLARE_WAIT_QUEUE_HEAD (wqh);
unsigned int u = 0;
char *pbuf;
int ret;
......@@ -1975,7 +1974,8 @@ static int auerswald_probe (struct usb_interface *intf,
dbg ("Version is %X", cp->version);
/* allow some time to settle the device */
sleep_on_timeout (&wqh, HZ / 3 );
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(HZ/3);
/* Try to get a suitable textual description of the device */
/* Device name:*/
......
......@@ -161,7 +161,7 @@ tiglusb_read (struct file *filp, char __user *buf, size_t count, loff_t * f_pos)
int bytes_to_read = 0;
int bytes_read = 0;
int result = 0;
char buffer[BULK_RCV_MAX];
char *buffer;
unsigned int pipe;
if (*f_pos)
......@@ -173,6 +173,10 @@ tiglusb_read (struct file *filp, char __user *buf, size_t count, loff_t * f_pos)
if (!s->dev)
return -EIO;
buffer = kmalloc(BULK_RCV_MAX, GFP_KERNEL);
if (!buffer)
return -ENOMEM;
bytes_to_read = (count >= BULK_RCV_MAX) ? BULK_RCV_MAX : count;
pipe = usb_rcvbulkpipe (s->dev, 1);
......@@ -203,6 +207,7 @@ tiglusb_read (struct file *filp, char __user *buf, size_t count, loff_t * f_pos)
}
out:
kfree(buffer);
return ret ? ret : bytes_read;
}
......@@ -214,7 +219,7 @@ tiglusb_write (struct file *filp, const char __user *buf, size_t count, loff_t *
int bytes_to_write = 0;
int bytes_written = 0;
int result = 0;
char buffer[BULK_SND_MAX];
char *buffer;
unsigned int pipe;
if (*f_pos)
......@@ -226,6 +231,10 @@ tiglusb_write (struct file *filp, const char __user *buf, size_t count, loff_t *
if (!s->dev)
return -EIO;
buffer = kmalloc(BULK_SND_MAX, GFP_KERNEL);
if (!buffer)
return -ENOMEM;
bytes_to_write = (count >= BULK_SND_MAX) ? BULK_SND_MAX : count;
if (copy_from_user (buffer, buf, bytes_to_write)) {
ret = -EFAULT;
......@@ -258,6 +267,7 @@ tiglusb_write (struct file *filp, const char __user *buf, size_t count, loff_t *
}
out:
kfree(buffer);
return ret ? ret : bytes_written;
}
......@@ -387,8 +397,12 @@ tiglusb_probe (struct usb_interface *intf,
static void
tiglusb_disconnect (struct usb_interface *intf)
{
wait_queue_t __wait;
ptiglusb_t s = usb_get_intfdata (intf);
init_waitqueue_entry(&__wait, current);
usb_set_intfdata (intf, NULL);
if (!s || !s->dev) {
info ("bogus disconnect");
......@@ -397,8 +411,12 @@ tiglusb_disconnect (struct usb_interface *intf)
s->remove_pending = 1;
wake_up (&s->wait);
add_wait_queue(&s->wait, &__wait);
set_current_state(TASK_UNINTERRUPTIBLE);
if (s->state == _started)
sleep_on (&s->remove_ok);
schedule();
current->state = TASK_RUNNING;
remove_wait_queue(&s->wait, &__wait);
down (&s->mutex);
s->dev = NULL;
s->opened = 0;
......
......@@ -651,7 +651,7 @@ static int kobil_ioctl(struct usb_serial_port *port, struct file *file,
return 0;
case TCSETS: // 0x5402
if (! &port->tty->termios) {
if (!(port->tty->termios)) {
dbg("%s - port %d Error: port->tty->termios is NULL", __FUNCTION__, port->number);
return -ENOTTY;
}
......
......@@ -353,8 +353,8 @@ static int whiteheat_attach (struct usb_serial *serial)
int pipe;
int ret;
int alen;
__u8 command[2] = { WHITEHEAT_GET_HW_INFO, 0 };
__u8 result[sizeof(*hw_info) + 1];
__u8 *command;
__u8 *result;
int i;
int j;
struct urb *urb;
......@@ -365,13 +365,22 @@ static int whiteheat_attach (struct usb_serial *serial)
command_port = serial->port[COMMAND_PORT];
pipe = usb_sndbulkpipe (serial->dev, command_port->bulk_out_endpointAddress);
command = kmalloc(2, GFP_KERNEL);
if (!command)
goto no_command_buffer;
command[0] = WHITEHEAT_GET_HW_INFO;
command[1] = 0;
result = kmalloc(sizeof(*hw_info) + 1, GFP_KERNEL);
if (!result)
goto no_result_buffer;
/*
* When the module is reloaded the firmware is still there and
* the endpoints are still in the usb core unchanged. This is the
* unlinking bug in disguise. Same for the call below.
*/
usb_clear_halt(serial->dev, pipe);
ret = usb_bulk_msg (serial->dev, pipe, command, sizeof(command), &alen, COMMAND_TIMEOUT);
ret = usb_bulk_msg (serial->dev, pipe, command, 2, &alen, COMMAND_TIMEOUT);
if (ret) {
err("%s: Couldn't send command [%d]", serial->type->name, ret);
goto no_firmware;
......@@ -383,7 +392,7 @@ static int whiteheat_attach (struct usb_serial *serial)
pipe = usb_rcvbulkpipe (serial->dev, command_port->bulk_in_endpointAddress);
/* See the comment on the usb_clear_halt() above */
usb_clear_halt(serial->dev, pipe);
ret = usb_bulk_msg (serial->dev, pipe, result, sizeof(result), &alen, COMMAND_TIMEOUT);
ret = usb_bulk_msg (serial->dev, pipe, result, sizeof(*hw_info) + 1, &alen, COMMAND_TIMEOUT);
if (ret) {
err("%s: Couldn't get results [%d]", serial->type->name, ret);
goto no_firmware;
......@@ -485,6 +494,8 @@ static int whiteheat_attach (struct usb_serial *serial)
usb_set_serial_port_data(command_port, command_info);
command_port->write_urb->complete = command_port_write_callback;
command_port->read_urb->complete = command_port_read_callback;
kfree(result);
kfree(command);
return 0;
......@@ -526,6 +537,10 @@ static int whiteheat_attach (struct usb_serial *serial)
no_private:
;
}
kfree(result);
no_result_buffer:
kfree(command);
no_command_buffer:
return -ENOMEM;
}
......
......@@ -309,44 +309,6 @@ static int proc_info (struct Scsi_Host *hostptr, char *buffer, char **start, off
* Sysfs interface
***********************************************************************/
/* Output routine for the sysfs info file */
static ssize_t show_info(struct device *dev, char *buffer)
{
char *pos = buffer;
const int length = PAGE_SIZE;
struct scsi_device *sdev = to_scsi_device(dev);
struct us_data *us = (struct us_data*)sdev->host->hostdata[0];
/* print the controller name */
SPRINTF(" Host scsi%d: usb-storage\n", sdev->host->host_no);
/* print product, vendor, and serial number strings */
SPRINTF(" Vendor: %s\n", us->vendor);
SPRINTF(" Product: %s\n", us->product);
SPRINTF("Serial Number: %s\n", us->serial);
/* show the protocol and transport */
SPRINTF(" Protocol: %s\n", us->protocol_name);
SPRINTF(" Transport: %s\n", us->transport_name);
/* show the device flags */
if (pos < buffer + length) {
pos += sprintf(pos, " Quirks:");
DO_FLAG(SINGLE_LUN);
DO_FLAG(SCM_MULT_TARG);
DO_FLAG(FIX_INQUIRY);
DO_FLAG(FIX_CAPACITY);
*(pos++) = '\n';
}
return (pos - buffer);
}
static DEVICE_ATTR(info, S_IRUGO, show_info, NULL);
/* Output routine for the sysfs max_sectors file */
static ssize_t show_max_sectors(struct device *dev, char *buf)
{
......@@ -373,7 +335,6 @@ static DEVICE_ATTR(max_sectors, S_IRUGO | S_IWUSR, show_max_sectors,
store_max_sectors);
static struct device_attribute *sysfs_device_attr_list[] = {
&dev_attr_info,
&dev_attr_max_sectors,
NULL,
};
......
......@@ -115,6 +115,13 @@ UNUSUAL_DEV( 0x04a4, 0x0004, 0x0001, 0x0001,
"DVD-CAM DZ-MV100A Camcorder",
US_SC_SCSI, US_PR_CB, NULL, US_FL_SINGLE_LUN),
/* Reported by Simon Levitt <simon@whattf.com>
* This entry needs Sub and Proto fields */
UNUSUAL_DEV( 0x04b8, 0x0601, 0x0100, 0x0100,
"Epson",
"875DC Storage",
US_SC_SCSI, US_PR_CB, NULL, US_FL_FIX_INQUIRY),
/* Reported by Khalid Aziz <khalid@gonehiking.org>
* This entry is needed because the device reports Sub=ff */
UNUSUAL_DEV( 0x04b8, 0x0602, 0x0110, 0x0110,
......@@ -482,11 +489,6 @@ UNUSUAL_DEV( 0x07ab, 0xfc01, 0x0000, 0x9999,
"Freecom",
"USB-IDE",
US_SC_QIC, US_PR_FREECOM, freecom_init, 0),
UNUSUAL_DEV( 0x07ab, 0xfc84, 0x0000, 0x9999,
"Freecom",
"FX-5/FX-50",
US_SC_QIC, US_PR_FREECOM, freecom_init, 0),
#endif
UNUSUAL_DEV( 0x07af, 0x0004, 0x0100, 0x0133,
......
......@@ -856,7 +856,6 @@ extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
/* wrappers around usb_control_msg() for the most common standard requests */
extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype,
unsigned char descindex, void *buf, int size);
extern int usb_get_device_descriptor(struct usb_device *dev);
extern int usb_get_status(struct usb_device *dev,
int type, int target, void *data);
extern int usb_get_string(struct usb_device *dev,
......
......@@ -33,6 +33,7 @@
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/usb.h>
#include <linux/usb_ch9.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/pcm.h>
......@@ -2560,9 +2561,10 @@ static int snd_usb_extigy_boot_quirk(struct usb_device *dev, struct usb_interfac
err = usb_control_msg(dev, usb_sndctrlpipe(dev,0),
0x10, 0x43, 0x0001, 0x000a, NULL, 0, HZ);
if (err < 0) snd_printdd("error sending boot message: %d\n", err);
err = usb_get_device_descriptor(dev);
err = usb_get_descriptor(dev, USB_DT_DEVICE, 0,
&dev->descriptor, sizeof(dev->descriptor));
config = dev->actconfig;
if (err < 0) snd_printdd("error usb_get_device_descriptor: %d\n", err);
if (err < 0) snd_printdd("error usb_get_descriptor: %d\n", err);
err = usb_reset_configuration(dev);
if (err < 0) snd_printdd("error usb_reset_configuration: %d\n", err);
snd_printdd("extigy_boot: new boot length = %d\n", get_cfg_desc(config)->wTotalLength);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment