Commit 4f3a1d59 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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

into kroah.com:/home/linux/BK/gregkh-2.6
parents 157e3d70 303d082c
...@@ -2796,7 +2796,7 @@ E: gt8134b@prism.gatech.edu ...@@ -2796,7 +2796,7 @@ E: gt8134b@prism.gatech.edu
D: Dosemu D: Dosemu
N: Duncan Sands N: Duncan Sands
E: duncan.sands@wanadoo.fr E: duncan.sands@free.fr
W: http://topo.math.u-psud.fr/~sands W: http://topo.math.u-psud.fr/~sands
D: Alcatel SpeedTouch USB driver D: Alcatel SpeedTouch USB driver
S: 69 rue Dunois S: 69 rue Dunois
......
...@@ -468,6 +468,15 @@ contact NetChip Technologies for development boards and product ...@@ -468,6 +468,15 @@ contact NetChip Technologies for development boards and product
information. information.
</para> </para>
<para>For users of Intel's PXA 2xx series processors,
a <filename>pxa2xx_udc</filename> driver is available.
</para>
<para>At this writing, there are people at work on drivers in
this framework for several other USB device controllers,
with plans to make many of them be widely available.
</para>
<!-- !Edrivers/usb/gadget/net2280.c --> <!-- !Edrivers/usb/gadget/net2280.c -->
<para>A partial USB simulator, <para>A partial USB simulator,
...@@ -500,7 +509,7 @@ for usb controller hardware), other gadget drivers exist. ...@@ -500,7 +509,7 @@ for usb controller hardware), other gadget drivers exist.
<para>There's an <emphasis>ethernet</emphasis> gadget <para>There's an <emphasis>ethernet</emphasis> gadget
driver, which implements one of the most useful driver, which implements one of the most useful
<emphasis>Communications Device Class</emphasis> models. <emphasis>Communications Device Class</emphasis> (CDC) models.
One of the standards for cable modem interoperability even One of the standards for cable modem interoperability even
specifies the use of this ethernet model as one of two specifies the use of this ethernet model as one of two
mandatory options. mandatory options.
...@@ -509,6 +518,11 @@ an Ethernet adapter. ...@@ -509,6 +518,11 @@ an Ethernet adapter.
It provides access to a network where the gadget's CPU is one host, It provides access to a network where the gadget's CPU is one host,
which could easily be bridging, routing, or firewalling which could easily be bridging, routing, or firewalling
access to other networks. access to other networks.
Since some hardware can't fully implement the CDC Ethernet
requirements, this driver also implements a "good parts only"
subset of CDC Ethernet.
(That subset doesn't advertise itself as CDC Ethernet,
to avoid creating problems.)
</para> </para>
<para>There is also support for user mode gadget drivers, <para>There is also support for user mode gadget drivers,
...@@ -522,6 +536,17 @@ controller driver is available many applications for it ...@@ -522,6 +536,17 @@ controller driver is available many applications for it
won't require new kernel mode software. won't require new kernel mode software.
</para> </para>
<para>There's a USB Mass Storage class driver, which provides
a different solution for interoperability with systems such
as MS-Windows and MacOS.
That <emphasis>File-backed Storage</emphasis> driver uses a
file or block device as backing store for a drive,
like the <filename>loop</filename> driver.
The USB host uses the BBB, CB, or CBI versions of the mass
storage class specification, using transparent SCSI commands
to access the data from the backing store.
</para>
<para>Support for other kinds of gadget is expected to <para>Support for other kinds of gadget is expected to
be developed and contributed be developed and contributed
over time, as this driver framework evolves. over time, as this driver framework evolves.
......
...@@ -209,7 +209,7 @@ static int skel_probe(struct usb_interface *interface, ...@@ -209,7 +209,7 @@ static int skel_probe(struct usb_interface *interface,
The driver now needs to verify that this device is actually one that it The driver now needs to verify that this device is actually one that it
can accept. If so, it returns 0. can accept. If so, it returns 0.
If not, or if any error occurs during initialization, an errorcode If not, or if any error occurs during initialization, an errorcode
(such as <literal>-ENOMEM<literal> or <literal>-ENODEV<literal>) (such as <literal>-ENOMEM</literal> or <literal>-ENODEV</literal>)
is returned from the probe function. is returned from the probe function.
</para> </para>
<para> <para>
...@@ -327,6 +327,7 @@ if (!retval) { ...@@ -327,6 +327,7 @@ if (!retval) {
talk to the device, the release function in the driver is called. In this talk to the device, the release function in the driver is called. In this
function we decrement our private usage count and wait for possible function we decrement our private usage count and wait for possible
pending writes: pending writes:
</para>
<programlisting> <programlisting>
/* decrement our usage count for the device */ /* decrement our usage count for the device */
--skel->open_count; --skel->open_count;
......
...@@ -212,7 +212,7 @@ S: Maintained ...@@ -212,7 +212,7 @@ S: Maintained
ALCATEL SPEEDTOUCH USB DRIVER ALCATEL SPEEDTOUCH USB DRIVER
P: Duncan Sands P: Duncan Sands
M: duncan.sands@wanadoo.fr M: duncan.sands@free.fr
L: linux-usb-users@lists.sourceforge.net L: linux-usb-users@lists.sourceforge.net
L: linux-usb-devel@lists.sourceforge.net L: linux-usb-devel@lists.sourceforge.net
W: http://www.linux-usb.org/SpeedTouch/ W: http://www.linux-usb.org/SpeedTouch/
......
...@@ -33,10 +33,8 @@ config USB ...@@ -33,10 +33,8 @@ config USB
It doesn't normally hurt to select them all if you are not certain. It doesn't normally hurt to select them all if you are not certain.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called usbcore.
The module will be called usbcore. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
source "drivers/usb/core/Kconfig" source "drivers/usb/core/Kconfig"
...@@ -82,10 +80,8 @@ config USB_USS720 ...@@ -82,10 +80,8 @@ config USB_USS720
Say Y here if you own an USS-720 USB->Parport cable and intend to Say Y here if you own an USS-720 USB->Parport cable and intend to
connect anything other than a printer to it. connect anything other than a printer to it.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called uss720.
The module will be called uss720. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
source "drivers/usb/serial/Kconfig" source "drivers/usb/serial/Kconfig"
......
...@@ -159,7 +159,10 @@ static void usblp_dump(struct usblp *usblp) { ...@@ -159,7 +159,10 @@ static void usblp_dump(struct usblp *usblp) {
dbg("usblp=0x%p", usblp); dbg("usblp=0x%p", usblp);
dbg("dev=0x%p", usblp->dev); dbg("dev=0x%p", usblp->dev);
dbg("present=%d", usblp->present); dbg("present=%d", usblp->present);
dbg("buf=0x%p", usblp->buf); dbg("readbuf=0x%p", usblp->readbuf);
dbg("writebuf=0x%p", usblp->writebuf);
dbg("readurb=0x%p", usblp->readurb);
dbg("writeurb=0x%p", usblp->writeurb);
dbg("readcount=%d", usblp->readcount); dbg("readcount=%d", usblp->readcount);
dbg("ifnum=%d", usblp->ifnum); dbg("ifnum=%d", usblp->ifnum);
for (p = USBLP_FIRST_PROTOCOL; p <= USBLP_LAST_PROTOCOL; p++) { for (p = USBLP_FIRST_PROTOCOL; p <= USBLP_LAST_PROTOCOL; p++) {
......
...@@ -10,364 +10,329 @@ ...@@ -10,364 +10,329 @@
/* these maximums are arbitrary */ /* these maximums are arbitrary */
#define USB_MAXCONFIG 8 #define USB_MAXCONFIG 8
#define USB_ALTSETTINGALLOC 4
#define USB_MAXINTERFACES 32 #define USB_MAXINTERFACES 32
static int usb_parse_endpoint(struct usb_host_endpoint *endpoint, unsigned char *buffer, int size) static int usb_parse_endpoint(struct usb_host_endpoint *endpoint, unsigned char *buffer, int size)
{ {
unsigned char *buffer0 = buffer;
struct usb_descriptor_header *header; struct usb_descriptor_header *header;
unsigned char *begin; unsigned char *begin;
int parsed = 0, len, numskipped; int numskipped;
header = (struct usb_descriptor_header *)buffer; header = (struct usb_descriptor_header *)buffer;
/* Everything should be fine being passed into here, but we sanity */
/* check JIC */
if (header->bLength > size) {
err("ran out of descriptors parsing");
return -1;
}
if (header->bDescriptorType != USB_DT_ENDPOINT) { if (header->bDescriptorType != USB_DT_ENDPOINT) {
warn("unexpected descriptor 0x%X, expecting endpoint, 0x%X", warn("unexpected descriptor 0x%X, expecting endpoint, 0x%X",
header->bDescriptorType, USB_DT_ENDPOINT); header->bDescriptorType, USB_DT_ENDPOINT);
return parsed; return -EINVAL;
} }
if (header->bLength == USB_DT_ENDPOINT_AUDIO_SIZE) if (header->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE)
memcpy(&endpoint->desc, buffer, USB_DT_ENDPOINT_AUDIO_SIZE); memcpy(&endpoint->desc, buffer, USB_DT_ENDPOINT_AUDIO_SIZE);
else else if (header->bLength >= USB_DT_ENDPOINT_SIZE)
memcpy(&endpoint->desc, buffer, USB_DT_ENDPOINT_SIZE); memcpy(&endpoint->desc, buffer, USB_DT_ENDPOINT_SIZE);
else {
warn("invalid endpoint descriptor");
return -EINVAL;
}
if ((endpoint->desc.bEndpointAddress & ~USB_ENDPOINT_DIR_MASK) >= 16) {
warn("invalid endpoint address 0x%X",
endpoint->desc.bEndpointAddress);
return -EINVAL;
}
le16_to_cpus(&endpoint->desc.wMaxPacketSize); le16_to_cpus(&endpoint->desc.wMaxPacketSize);
buffer += header->bLength; buffer += header->bLength;
size -= header->bLength; size -= header->bLength;
parsed += header->bLength;
/* Skip over the rest of the Class Specific or Vendor Specific */ /* Skip over any Class Specific or Vendor Specific descriptors */
/* descriptors */
begin = buffer; begin = buffer;
numskipped = 0; numskipped = 0;
while (size >= sizeof(struct usb_descriptor_header)) { while (size >= sizeof(struct usb_descriptor_header)) {
header = (struct usb_descriptor_header *)buffer; header = (struct usb_descriptor_header *)buffer;
if (header->bLength < 2) {
err("invalid descriptor length of %d", header->bLength);
return -1;
}
/* If we find another "proper" descriptor then we're done */ /* If we find another "proper" descriptor then we're done */
if ((header->bDescriptorType == USB_DT_ENDPOINT) || if ((header->bDescriptorType == USB_DT_ENDPOINT) ||
(header->bDescriptorType == USB_DT_INTERFACE) || (header->bDescriptorType == USB_DT_INTERFACE))
(header->bDescriptorType == USB_DT_CONFIG) ||
(header->bDescriptorType == USB_DT_DEVICE))
break; break;
dbg("skipping descriptor 0x%X", dbg("skipping descriptor 0x%X", header->bDescriptorType);
header->bDescriptorType);
numskipped++; numskipped++;
buffer += header->bLength; buffer += header->bLength;
size -= header->bLength; size -= header->bLength;
parsed += header->bLength;
} }
if (numskipped) if (numskipped) {
dbg("skipped %d class/vendor specific endpoint descriptors", numskipped); dbg("skipped %d class/vendor specific endpoint descriptors", numskipped);
endpoint->extra = begin;
/* Copy any unknown descriptors into a storage area for drivers */ endpoint->extralen = buffer - begin;
/* to later parse */
len = (int)(buffer - begin);
if (!len) {
endpoint->extra = NULL;
endpoint->extralen = 0;
return parsed;
} }
endpoint->extra = kmalloc(len, GFP_KERNEL); return buffer - buffer0;
if (!endpoint->extra) {
err("couldn't allocate memory for endpoint extra descriptors");
endpoint->extralen = 0;
return parsed;
}
memcpy(endpoint->extra, begin, len);
endpoint->extralen = len;
return parsed;
} }
static void usb_release_intf(struct device *dev) static void usb_release_intf(struct device *dev)
{ {
struct usb_interface *intf; struct usb_interface *intf;
int j; int j;
int k;
intf = to_usb_interface(dev); intf = to_usb_interface(dev);
if (intf->altsetting) { if (intf->altsetting) {
for (j = 0; j < intf->num_altsetting; j++) { for (j = 0; j < intf->num_altsetting; j++) {
struct usb_host_interface *as = &intf->altsetting[j]; struct usb_host_interface *as = &intf->altsetting[j];
if (as->extra)
kfree(as->extra); kfree(as->endpoint);
if (as->endpoint) {
for (k = 0; k < as->desc.bNumEndpoints; k++)
if (as->endpoint[k].extra)
kfree(as->endpoint[k].extra);
kfree(as->endpoint);
}
} }
kfree(intf->altsetting); kfree(intf->altsetting);
} }
kfree(intf); kfree(intf);
} }
static int usb_parse_interface(struct usb_interface *interface, unsigned char *buffer, int size) static int usb_parse_interface(struct usb_host_config *config, unsigned char *buffer, int size)
{ {
int i, len, numskipped, retval, parsed = 0; unsigned char *buffer0 = buffer;
struct usb_descriptor_header *header; struct usb_interface_descriptor *d;
int inum, asnum;
struct usb_interface *interface;
struct usb_host_interface *ifp; struct usb_host_interface *ifp;
int len, numskipped;
struct usb_descriptor_header *header;
unsigned char *begin; unsigned char *begin;
int i, retval;
interface->act_altsetting = 0; d = (struct usb_interface_descriptor *) buffer;
interface->num_altsetting = 0; if (d->bDescriptorType != USB_DT_INTERFACE) {
interface->max_altsetting = USB_ALTSETTINGALLOC; warn("unexpected descriptor 0x%X, expecting interface, 0x%X",
device_initialize(&interface->dev); d->bDescriptorType, USB_DT_INTERFACE);
interface->dev.release = usb_release_intf; return -EINVAL;
}
/* put happens in usb_destroy_configuration */
get_device(&interface->dev);
interface->altsetting = kmalloc(sizeof(*interface->altsetting) * interface->max_altsetting,
GFP_KERNEL);
if (!interface->altsetting) {
err("couldn't kmalloc interface->altsetting");
return -1;
}
while (size > 0) {
struct usb_interface_descriptor *d;
if (interface->num_altsetting >= interface->max_altsetting) {
struct usb_host_interface *ptr;
int oldmas;
oldmas = interface->max_altsetting;
interface->max_altsetting += USB_ALTSETTINGALLOC;
if (interface->max_altsetting > USB_MAXALTSETTING) {
warn("too many alternate settings (incr %d max %d)\n",
USB_ALTSETTINGALLOC, USB_MAXALTSETTING);
return -1;
}
ptr = kmalloc(sizeof(*ptr) * interface->max_altsetting, GFP_KERNEL);
if (ptr == NULL) {
err("couldn't kmalloc interface->altsetting");
return -1;
}
memcpy(ptr, interface->altsetting, sizeof(*interface->altsetting) * oldmas);
kfree(interface->altsetting);
interface->altsetting = ptr;
}
ifp = interface->altsetting + interface->num_altsetting;
ifp->endpoint = NULL;
ifp->extra = NULL;
ifp->extralen = 0;
interface->num_altsetting++;
memcpy(ifp, buffer, USB_DT_INTERFACE_SIZE);
/* Skip over the interface */
buffer += ifp->desc.bLength;
parsed += ifp->desc.bLength;
size -= ifp->desc.bLength;
begin = buffer; inum = d->bInterfaceNumber;
numskipped = 0; if (inum >= config->desc.bNumInterfaces) {
/* Skip over any interface, class or vendor descriptors */ /* Skip to the next interface descriptor */
buffer += d->bLength;
size -= d->bLength;
while (size >= sizeof(struct usb_descriptor_header)) { while (size >= sizeof(struct usb_descriptor_header)) {
header = (struct usb_descriptor_header *)buffer; header = (struct usb_descriptor_header *) buffer;
if (header->bLength < 2) {
err("invalid descriptor length of %d", header->bLength);
return -1;
}
/* If we find another "proper" descriptor then we're done */ if (header->bDescriptorType == USB_DT_INTERFACE)
if ((header->bDescriptorType == USB_DT_INTERFACE) ||
(header->bDescriptorType == USB_DT_ENDPOINT) ||
(header->bDescriptorType == USB_DT_CONFIG) ||
(header->bDescriptorType == USB_DT_DEVICE))
break; break;
numskipped++;
buffer += header->bLength; buffer += header->bLength;
parsed += header->bLength;
size -= header->bLength; size -= header->bLength;
} }
return buffer - buffer0;
}
if (numskipped) interface = config->interface[inum];
dbg("skipped %d class/vendor specific interface descriptors", numskipped); asnum = d->bAlternateSetting;
if (asnum >= interface->num_altsetting) {
warn("invalid alternate setting %d for interface %d",
asnum, inum);
return -EINVAL;
}
/* Copy any unknown descriptors into a storage area for */ ifp = &interface->altsetting[asnum];
/* drivers to later parse */ if (ifp->desc.bLength) {
len = (int)(buffer - begin); warn("duplicate descriptor for interface %d altsetting %d",
if (len) { inum, asnum);
ifp->extra = kmalloc(len, GFP_KERNEL); return -EINVAL;
}
memcpy(&ifp->desc, buffer, USB_DT_INTERFACE_SIZE);
if (!ifp->extra) { buffer += d->bLength;
err("couldn't allocate memory for interface extra descriptors"); size -= d->bLength;
ifp->extralen = 0;
return -1;
}
memcpy(ifp->extra, begin, len);
ifp->extralen = len;
}
/* Did we hit an unexpected descriptor? */ /* Skip over any Class Specific or Vendor Specific descriptors */
begin = buffer;
numskipped = 0;
while (size >= sizeof(struct usb_descriptor_header)) {
header = (struct usb_descriptor_header *)buffer; header = (struct usb_descriptor_header *)buffer;
if ((size >= sizeof(struct usb_descriptor_header)) &&
((header->bDescriptorType == USB_DT_CONFIG) ||
(header->bDescriptorType == USB_DT_DEVICE)))
return parsed;
if (ifp->desc.bNumEndpoints > USB_MAXENDPOINTS) {
warn("too many endpoints");
return -1;
}
ifp->endpoint = (struct usb_host_endpoint *) /* If we find another "proper" descriptor then we're done */
kmalloc(ifp->desc.bNumEndpoints * if ((header->bDescriptorType == USB_DT_INTERFACE) ||
sizeof(struct usb_host_endpoint), GFP_KERNEL); (header->bDescriptorType == USB_DT_ENDPOINT))
if (!ifp->endpoint) { break;
err("out of memory");
return -1;
}
memset(ifp->endpoint, 0, ifp->desc.bNumEndpoints * dbg("skipping descriptor 0x%X", header->bDescriptorType);
sizeof(struct usb_host_endpoint)); numskipped++;
for (i = 0; i < ifp->desc.bNumEndpoints; i++) {
header = (struct usb_descriptor_header *)buffer;
if (header->bLength > size) { buffer += header->bLength;
err("ran out of descriptors parsing"); size -= header->bLength;
return -1; }
} if (numskipped) {
dbg("skipped %d class/vendor specific interface descriptors", numskipped);
retval = usb_parse_endpoint(ifp->endpoint + i, buffer, size); ifp->extra = begin;
if (retval < 0) ifp->extralen = buffer - begin;
return retval; }
buffer += retval; if (ifp->desc.bNumEndpoints > USB_MAXENDPOINTS) {
parsed += retval; warn("too many endpoints for interface %d altsetting %d",
size -= retval; inum, asnum);
return -EINVAL;
}
len = ifp->desc.bNumEndpoints * sizeof(struct usb_host_endpoint);
ifp->endpoint = kmalloc(len, GFP_KERNEL);
if (!ifp->endpoint) {
err("out of memory");
return -ENOMEM;
}
memset(ifp->endpoint, 0, len);
for (i = 0; i < ifp->desc.bNumEndpoints; i++) {
if (size < USB_DT_ENDPOINT_SIZE) {
warn("ran out of descriptors while parsing endpoints");
return -EINVAL;
} }
/* We check to see if it's an alternate to this one */ retval = usb_parse_endpoint(ifp->endpoint + i, buffer, size);
d = (struct usb_interface_descriptor *)buffer; if (retval < 0)
if (size < USB_DT_INTERFACE_SIZE return retval;
|| d->bDescriptorType != USB_DT_INTERFACE
|| !d->bAlternateSetting) buffer += retval;
return parsed; size -= retval;
} }
return parsed; return buffer - buffer0;
} }
int usb_parse_configuration(struct usb_host_config *config, char *buffer) int usb_parse_configuration(struct usb_host_config *config, char *buffer, int size)
{ {
int i, size; int nintf, nintf_orig;
int retval = -EINVAL; int i, j;
struct usb_interface *interface;
char *buffer2;
int size2;
struct usb_descriptor_header *header; struct usb_descriptor_header *header;
int numskipped, len;
char *begin;
int retval;
memcpy(&config->desc, buffer, USB_DT_CONFIG_SIZE); memcpy(&config->desc, buffer, USB_DT_CONFIG_SIZE);
le16_to_cpus(&config->desc.wTotalLength); if (config->desc.bDescriptorType != USB_DT_CONFIG ||
size = config->desc.wTotalLength; config->desc.bLength < USB_DT_CONFIG_SIZE) {
warn("invalid configuration descriptor");
for (i = 0; i < USB_MAXINTERFACES; ++i) return -EINVAL;
config->interface[i] = NULL; }
config->desc.wTotalLength = size;
if (config->desc.bNumInterfaces > USB_MAXINTERFACES) { nintf = nintf_orig = config->desc.bNumInterfaces;
warn("too many interfaces"); if (nintf > USB_MAXINTERFACES) {
goto error; warn("too many interfaces (%d max %d)",
nintf, USB_MAXINTERFACES);
config->desc.bNumInterfaces = nintf = USB_MAXINTERFACES;
} }
for (i = 0; i < config->desc.bNumInterfaces; ++i) { for (i = 0; i < nintf; ++i) {
config->interface[i] = kmalloc(sizeof(struct usb_interface), GFP_KERNEL); interface = config->interface[i] =
dbg("kmalloc IF %p, numif %i", config->interface[i], i); kmalloc(sizeof(struct usb_interface), GFP_KERNEL);
if (!config->interface[i]) { dbg("kmalloc IF %p, numif %i", interface, i);
if (!interface) {
err("out of memory"); err("out of memory");
retval = -ENOMEM; return -ENOMEM;
goto error;
} }
memset(config->interface[i], 0x00, sizeof(struct usb_interface)); memset(interface, 0, sizeof(struct usb_interface));
interface->dev.release = usb_release_intf;
device_initialize(&interface->dev);
/* put happens in usb_destroy_configuration */
get_device(&interface->dev);
} }
buffer += config->desc.bLength; /* Go through the descriptors, checking their length and counting the
size -= config->desc.bLength; * number of altsettings for each interface */
buffer2 = buffer;
config->extra = NULL; size2 = size;
config->extralen = 0; j = 0;
while (size2 >= sizeof(struct usb_descriptor_header)) {
for (i = 0; i < config->desc.bNumInterfaces; i++) { header = (struct usb_descriptor_header *) buffer2;
int numskipped, len; if ((header->bLength > size2) || (header->bLength < 2)) {
char *begin; warn("invalid descriptor of length %d", header->bLength);
return -EINVAL;
/* Skip over the rest of the Class Specific or Vendor */ }
/* Specific descriptors */
begin = buffer;
numskipped = 0;
while (size >= sizeof(struct usb_descriptor_header)) {
header = (struct usb_descriptor_header *)buffer;
if ((header->bLength > size) || (header->bLength < 2)) { if (header->bDescriptorType == USB_DT_INTERFACE) {
err("invalid descriptor length of %d", header->bLength); struct usb_interface_descriptor *d;
return -1;
if (header->bLength < USB_DT_INTERFACE_SIZE) {
warn("invalid interface descriptor");
return -EINVAL;
}
d = (struct usb_interface_descriptor *) header;
i = d->bInterfaceNumber;
if (i >= nintf_orig) {
warn("invalid interface number (%d/%d)",
i, nintf_orig);
return -EINVAL;
} }
if (i < nintf)
++config->interface[i]->num_altsetting;
/* If we find another "proper" descriptor then we're done */ } else if ((header->bDescriptorType == USB_DT_DEVICE ||
if ((header->bDescriptorType == USB_DT_ENDPOINT) || header->bDescriptorType == USB_DT_CONFIG) && j) {
(header->bDescriptorType == USB_DT_INTERFACE) || warn("unexpected descriptor type 0x%X", header->bDescriptorType);
(header->bDescriptorType == USB_DT_CONFIG) || return -EINVAL;
(header->bDescriptorType == USB_DT_DEVICE)) }
break;
dbg("skipping descriptor 0x%X", header->bDescriptorType); j = 1;
numskipped++; buffer2 += header->bLength;
size2 -= header->bLength;
}
buffer += header->bLength; /* Allocate the altsetting arrays */
size -= header->bLength; for (i = 0; i < config->desc.bNumInterfaces; ++i) {
interface = config->interface[i];
if (interface->num_altsetting > USB_MAXALTSETTING) {
warn("too many alternate settings for interface %d (%d max %d)\n",
i, interface->num_altsetting, USB_MAXALTSETTING);
return -EINVAL;
} }
if (numskipped) if (interface->num_altsetting == 0) {
dbg("skipped %d class/vendor specific endpoint descriptors", numskipped); warn("no alternate settings for interface %d", i);
return -EINVAL;
/* Copy any unknown descriptors into a storage area for */ }
/* drivers to later parse */
len = (int)(buffer - begin); len = sizeof(*interface->altsetting) * interface->num_altsetting;
if (len) { interface->altsetting = kmalloc(len, GFP_KERNEL);
if (config->extralen) { if (!interface->altsetting) {
warn("extra config descriptor"); err("couldn't kmalloc interface->altsetting");
} else { return -ENOMEM;
config->extra = kmalloc(len, GFP_KERNEL);
if (!config->extra) {
err("couldn't allocate memory for config extra descriptors");
config->extralen = 0;
return -1;
}
memcpy(config->extra, begin, len);
config->extralen = len;
}
} }
memset(interface->altsetting, 0, len);
}
buffer += config->desc.bLength;
size -= config->desc.bLength;
retval = usb_parse_interface(config->interface[i], buffer, size); /* Skip over any Class Specific or Vendor Specific descriptors */
begin = buffer;
numskipped = 0;
while (size >= sizeof(struct usb_descriptor_header)) {
header = (struct usb_descriptor_header *)buffer;
/* If we find another "proper" descriptor then we're done */
if ((header->bDescriptorType == USB_DT_ENDPOINT) ||
(header->bDescriptorType == USB_DT_INTERFACE))
break;
dbg("skipping descriptor 0x%X", header->bDescriptorType);
numskipped++;
buffer += header->bLength;
size -= header->bLength;
}
if (numskipped) {
dbg("skipped %d class/vendor specific configuration descriptors", numskipped);
config->extra = begin;
config->extralen = buffer - begin;
}
/* Parse all the interface/altsetting descriptors */
while (size >= sizeof(struct usb_descriptor_header)) {
retval = usb_parse_interface(config, buffer, size);
if (retval < 0) if (retval < 0)
return retval; return retval;
...@@ -375,11 +340,18 @@ int usb_parse_configuration(struct usb_host_config *config, char *buffer) ...@@ -375,11 +340,18 @@ int usb_parse_configuration(struct usb_host_config *config, char *buffer)
size -= retval; size -= retval;
} }
/* Check for missing altsettings */
for (i = 0; i < nintf; ++i) {
interface = config->interface[i];
for (j = 0; j < interface->num_altsetting; ++j) {
if (!interface->altsetting[j].desc.bLength) {
warn("missing altsetting %d for interface %d", j, i);
return -EINVAL;
}
}
}
return size; return size;
error:
for (i = 0; i < USB_MAXINTERFACES; ++i)
kfree(config->interface[i]);
return retval;
} }
// hub-only!! ... and only exported for reset/reinit path. // hub-only!! ... and only exported for reset/reinit path.
...@@ -387,7 +359,7 @@ int usb_parse_configuration(struct usb_host_config *config, char *buffer) ...@@ -387,7 +359,7 @@ int usb_parse_configuration(struct usb_host_config *config, char *buffer)
void usb_destroy_configuration(struct usb_device *dev) void usb_destroy_configuration(struct usb_device *dev)
{ {
int c, i; int c, i;
if (!dev->config) if (!dev->config)
return; return;
...@@ -401,12 +373,11 @@ void usb_destroy_configuration(struct usb_device *dev) ...@@ -401,12 +373,11 @@ void usb_destroy_configuration(struct usb_device *dev)
for (c = 0; c < dev->descriptor.bNumConfigurations; c++) { for (c = 0; c < dev->descriptor.bNumConfigurations; c++) {
struct usb_host_config *cf = &dev->config[c]; struct usb_host_config *cf = &dev->config[c];
if (!cf->interface)
break;
for (i = 0; i < cf->desc.bNumInterfaces; i++) { for (i = 0; i < cf->desc.bNumInterfaces; i++) {
struct usb_interface *ifp = cf->interface[i]; struct usb_interface *ifp = cf->interface[i];
put_device(&ifp->dev);
if (ifp)
put_device(&ifp->dev);
} }
} }
kfree(dev->config); kfree(dev->config);
...@@ -417,38 +388,39 @@ void usb_destroy_configuration(struct usb_device *dev) ...@@ -417,38 +388,39 @@ void usb_destroy_configuration(struct usb_device *dev)
// (used by real hubs and virtual root hubs) // (used by real hubs and virtual root hubs)
int usb_get_configuration(struct usb_device *dev) int usb_get_configuration(struct usb_device *dev)
{ {
int ncfg = dev->descriptor.bNumConfigurations;
int result; int result;
unsigned int cfgno, length; unsigned int cfgno, length;
unsigned char *buffer; unsigned char *buffer;
unsigned char *bigbuffer; unsigned char *bigbuffer;
struct usb_config_descriptor *desc; struct usb_config_descriptor *desc;
if (dev->descriptor.bNumConfigurations > USB_MAXCONFIG) { if (ncfg > USB_MAXCONFIG) {
warn("too many configurations"); warn("too many configurations (%d max %d)",
return -EINVAL; ncfg, USB_MAXCONFIG);
dev->descriptor.bNumConfigurations = ncfg = USB_MAXCONFIG;
} }
if (dev->descriptor.bNumConfigurations < 1) { if (ncfg < 1) {
warn("not enough configurations"); warn("no configurations");
return -EINVAL; return -EINVAL;
} }
dev->config = (struct usb_host_config *) length = ncfg * sizeof(struct usb_host_config);
kmalloc(dev->descriptor.bNumConfigurations * dev->config = kmalloc(length, GFP_KERNEL);
sizeof(struct usb_host_config), GFP_KERNEL);
if (!dev->config) { if (!dev->config) {
err("out of memory"); err("out of memory");
return -ENOMEM; return -ENOMEM;
} }
memset(dev->config, 0, dev->descriptor.bNumConfigurations * memset(dev->config, 0, length);
sizeof(struct usb_host_config));
dev->rawdescriptors = (char **)kmalloc(sizeof(char *) * length = ncfg * sizeof(char *);
dev->descriptor.bNumConfigurations, GFP_KERNEL); dev->rawdescriptors = kmalloc(length, GFP_KERNEL);
if (!dev->rawdescriptors) { if (!dev->rawdescriptors) {
err("out of memory"); err("out of memory");
return -ENOMEM; return -ENOMEM;
} }
memset(dev->rawdescriptors, 0, length);
buffer = kmalloc(8, GFP_KERNEL); buffer = kmalloc(8, GFP_KERNEL);
if (!buffer) { if (!buffer) {
...@@ -457,7 +429,7 @@ int usb_get_configuration(struct usb_device *dev) ...@@ -457,7 +429,7 @@ int usb_get_configuration(struct usb_device *dev)
} }
desc = (struct usb_config_descriptor *)buffer; desc = (struct usb_config_descriptor *)buffer;
for (cfgno = 0; cfgno < dev->descriptor.bNumConfigurations; cfgno++) { for (cfgno = 0; cfgno < ncfg; cfgno++) {
/* We grab the first 8 bytes so we know how long the whole */ /* We grab the first 8 bytes so we know how long the whole */
/* configuration is */ /* configuration is */
result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, buffer, 8); result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, buffer, 8);
...@@ -465,14 +437,14 @@ int usb_get_configuration(struct usb_device *dev) ...@@ -465,14 +437,14 @@ int usb_get_configuration(struct usb_device *dev)
if (result < 0) if (result < 0)
err("unable to get descriptor"); err("unable to get descriptor");
else { else {
err("config descriptor too short (expected %i, got %i)", 8, result); warn("config descriptor too short (expected %i, got %i)", 8, result);
result = -EINVAL; result = -EINVAL;
} }
goto err; goto err;
} }
/* Get the full buffer */ /* Get the full buffer */
length = le16_to_cpu(desc->wTotalLength); length = max((int) le16_to_cpu(desc->wTotalLength), USB_DT_CONFIG_SIZE);
bigbuffer = kmalloc(length, GFP_KERNEL); bigbuffer = kmalloc(length, GFP_KERNEL);
if (!bigbuffer) { if (!bigbuffer) {
...@@ -487,8 +459,8 @@ int usb_get_configuration(struct usb_device *dev) ...@@ -487,8 +459,8 @@ int usb_get_configuration(struct usb_device *dev)
err("couldn't get all of config descriptors"); err("couldn't get all of config descriptors");
kfree(bigbuffer); kfree(bigbuffer);
goto err; goto err;
} }
if (result < length) { if (result < length) {
err("config descriptor too short (expected %i, got %i)", length, result); err("config descriptor too short (expected %i, got %i)", length, result);
result = -EINVAL; result = -EINVAL;
...@@ -498,11 +470,11 @@ int usb_get_configuration(struct usb_device *dev) ...@@ -498,11 +470,11 @@ int usb_get_configuration(struct usb_device *dev)
dev->rawdescriptors[cfgno] = bigbuffer; dev->rawdescriptors[cfgno] = bigbuffer;
result = usb_parse_configuration(&dev->config[cfgno], bigbuffer); result = usb_parse_configuration(&dev->config[cfgno], bigbuffer, length);
if (result > 0) if (result > 0)
dbg("descriptor data left"); dbg("descriptor data left");
else if (result < 0) { else if (result < 0) {
result = -EINVAL; ++cfgno;
goto err; goto err;
} }
} }
......
...@@ -859,8 +859,7 @@ static int hub_port_debounce(struct usb_device *hub, int port) ...@@ -859,8 +859,7 @@ static int hub_port_debounce(struct usb_device *hub, int port)
} }
} }
/* XXX Replace this with dbg() when 2.6 is about to ship. */ dev_dbg (hubdev (hub),
dev_info (hubdev (hub),
"debounce: port %d: delay %dms stable %d status 0x%x\n", "debounce: port %d: delay %dms stable %d status 0x%x\n",
port + 1, delay_time, stable_count, portstatus); port + 1, delay_time, stable_count, portstatus);
......
...@@ -1424,14 +1424,15 @@ static int usb_device_suspend(struct device *dev, u32 state) ...@@ -1424,14 +1424,15 @@ static int usb_device_suspend(struct device *dev, u32 state)
struct usb_interface *intf; struct usb_interface *intf;
struct usb_driver *driver; struct usb_driver *driver;
if ((dev->driver == &usb_generic_driver) || if ((dev->driver == NULL) ||
(dev->driver == &usb_generic_driver) ||
(dev->driver_data == &usb_generic_driver_data)) (dev->driver_data == &usb_generic_driver_data))
return 0; return 0;
intf = to_usb_interface(dev); intf = to_usb_interface(dev);
driver = to_usb_driver(dev->driver); driver = to_usb_driver(dev->driver);
if (driver && driver->suspend) if (driver->suspend)
return driver->suspend(intf, state); return driver->suspend(intf, state);
return 0; return 0;
} }
...@@ -1441,14 +1442,15 @@ static int usb_device_resume(struct device *dev) ...@@ -1441,14 +1442,15 @@ static int usb_device_resume(struct device *dev)
struct usb_interface *intf; struct usb_interface *intf;
struct usb_driver *driver; struct usb_driver *driver;
if ((dev->driver == &usb_generic_driver) || if ((dev->driver == NULL) ||
(dev->driver == &usb_generic_driver) ||
(dev->driver_data == &usb_generic_driver_data)) (dev->driver_data == &usb_generic_driver_data))
return 0; return 0;
intf = to_usb_interface(dev); intf = to_usb_interface(dev);
driver = to_usb_driver(dev->driver); driver = to_usb_driver(dev->driver);
if (driver && driver->resume) if (driver->resume)
return driver->resume(intf); return driver->resume(intf);
return 0; return 0;
} }
......
...@@ -68,7 +68,7 @@ choice ...@@ -68,7 +68,7 @@ choice
config USB_ZERO config USB_ZERO
tristate "Gadget Zero (DEVELOPMENT)" tristate "Gadget Zero (DEVELOPMENT)"
depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA250 || USB_SA1100) depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA2XX || USB_SA1100)
help help
Gadget Zero is a two-configuration device. It either sinks and Gadget Zero is a two-configuration device. It either sinks and
sources bulk data; or it loops back a configurable number of sources bulk data; or it loops back a configurable number of
...@@ -97,9 +97,9 @@ config USB_ZERO_NET2280 ...@@ -97,9 +97,9 @@ config USB_ZERO_NET2280
depends on USB_ZERO && (USB_NET2280 || USB_DUMMY_HCD) depends on USB_ZERO && (USB_NET2280 || USB_DUMMY_HCD)
default y default y
config USB_ZERO_PXA250 config USB_ZERO_PXA2XX
bool bool
depends on USB_ZERO && USB_PXA250 depends on USB_ZERO && USB_PXA2XX
default y default y
config USB_ZERO_SA1100 config USB_ZERO_SA1100
...@@ -110,22 +110,28 @@ config USB_ZERO_SA1100 ...@@ -110,22 +110,28 @@ config USB_ZERO_SA1100
config USB_ETH config USB_ETH
tristate "Ethernet Gadget" tristate "Ethernet Gadget"
depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA250 || USB_SA1100) depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA2XX || USB_SA1100)
help help
This driver implements the "Communication Device Class" (CDC) This driver implements Ethernet style communication, in either
Ethernet Control Model. That protocol is often avoided with pure of two ways:
Ethernet adapters, in favor of simpler vendor-specific hardware,
but is widely supported by firmware for smart network devices. - The "Communication Device Class" (CDC) Ethernet Control Model.
That protocol is often avoided with pure Ethernet adapters, in
favor of simpler vendor-specific hardware, but is widely
supported by firmware for smart network devices.
- On hardware can't implement that protocol, a simpler approach
is used, placing fewer demands on USB.
Within the USB device, this gadget driver exposes a network device Within the USB device, this gadget driver exposes a network device
"usbX", where X depends on what other networking devices you have. "usbX", where X depends on what other networking devices you have.
Treat it like a two-node Ethernet link: host, and gadget. Treat it like a two-node Ethernet link: host, and gadget.
The Linux-USB host-side "usbnet" driver interoperates with this The Linux-USB host-side "usbnet" driver interoperates with this
driver, so that deep I/O queues can be supported. (On 2.4 kernels, driver, so that deep I/O queues can be supported. On 2.4 kernels,
use "CDCEther" instead.) Deep queues are especially important with use "CDCEther" instead, if you're using the CDC option. That CDC
high speed devices. It should also interoperate with standard CDC mode should also interoperate with standard CDC Ethernet class
Ethernet class drivers on other host operating systems. drivers on other host operating systems.
Say "y" to link the driver statically, or "m" to build a Say "y" to link the driver statically, or "m" to build a
dynamically linked module called "g_ether". dynamically linked module called "g_ether".
...@@ -137,9 +143,9 @@ config USB_ETH_NET2280 ...@@ -137,9 +143,9 @@ config USB_ETH_NET2280
depends on USB_ETH && (USB_NET2280 || USB_DUMMY_HCD) depends on USB_ETH && (USB_NET2280 || USB_DUMMY_HCD)
default y default y
config USB_ETH_PXA250 config USB_ETH_PXA2XX
bool bool
depends on USB_ETH && USB_PXA250 depends on USB_ETH && USB_PXA2XX
default y default y
config USB_ETH_SA1100 config USB_ETH_SA1100
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/uts.h> #include <linux/uts.h>
#include <linux/version.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
......
...@@ -20,10 +20,8 @@ config USB_HID ...@@ -20,10 +20,8 @@ config USB_HID
If unsure, say Y. If unsure, say Y.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called hid.
The module will be called hid. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
comment "Input core support is needed for USB HID input layer or HIDBP support" comment "Input core support is needed for USB HID input layer or HIDBP support"
depends on USB && INPUT=n depends on USB && INPUT=n
...@@ -104,10 +102,8 @@ config USB_KBD ...@@ -104,10 +102,8 @@ config USB_KBD
This is almost certainly not what you want. This is mostly This is almost certainly not what you want. This is mostly
useful for embedded applications or simple keyboards. useful for embedded applications or simple keyboards.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called usbkbd.
The module will be called usbkbd. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
If even remotely unsure, say N. If even remotely unsure, say N.
...@@ -122,10 +118,8 @@ config USB_MOUSE ...@@ -122,10 +118,8 @@ config USB_MOUSE
This is almost certainly not what you want. This is mostly This is almost certainly not what you want. This is mostly
useful for embedded applications or simple mice. useful for embedded applications or simple mice.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called usbmouse.
The module will be called usbmouse. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
If even remotely unsure, say N. If even remotely unsure, say N.
...@@ -140,10 +134,8 @@ config USB_AIPTEK ...@@ -140,10 +134,8 @@ config USB_AIPTEK
(CONFIG_INPUT_MOUSEDEV) and/or "Event interface support" (CONFIG_INPUT_MOUSEDEV) and/or "Event interface support"
(CONFIG_INPUT_EVDEV) as well. (CONFIG_INPUT_EVDEV) as well.
This driver is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called aiptek.
The module will be called aiptek. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_WACOM config USB_WACOM
tristate "Wacom Intuos/Graphire tablet support" tristate "Wacom Intuos/Graphire tablet support"
...@@ -154,10 +146,8 @@ config USB_WACOM ...@@ -154,10 +146,8 @@ config USB_WACOM
(CONFIG_INPUT_MOUSEDEV) and/or "Event interface support" (CONFIG_INPUT_MOUSEDEV) and/or "Event interface support"
(CONFIG_INPUT_EVDEV) as well. (CONFIG_INPUT_EVDEV) as well.
This driver is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called wacom.
The module will be called wacom. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_KBTAB config USB_KBTAB
tristate "KB Gear JamStudio tablet support" tristate "KB Gear JamStudio tablet support"
...@@ -168,10 +158,8 @@ config USB_KBTAB ...@@ -168,10 +158,8 @@ config USB_KBTAB
(CONFIG_INPUT_MOUSEDEV) and/or "Event interface support" (CONFIG_INPUT_MOUSEDEV) and/or "Event interface support"
(CONFIG_INPUT_EVDEV) as well. (CONFIG_INPUT_EVDEV) as well.
This driver is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called kbtab.
The module will be called kbtab.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_POWERMATE config USB_POWERMATE
tristate "Griffin PowerMate and Contour Jog support" tristate "Griffin PowerMate and Contour Jog support"
...@@ -184,10 +172,8 @@ config USB_POWERMATE ...@@ -184,10 +172,8 @@ config USB_POWERMATE
You can download userspace tools from http://sowerbutts.com/powermate/ You can download userspace tools from http://sowerbutts.com/powermate/
This driver is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called powermate.
The module will be called powermate. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_XPAD config USB_XPAD
tristate "X-Box gamepad support" tristate "X-Box gamepad support"
...@@ -200,8 +186,6 @@ config USB_XPAD ...@@ -200,8 +186,6 @@ config USB_XPAD
For information about how to connect the X-Box pad to USB, see For information about how to connect the X-Box pad to USB, see
Documentation/input/xpad.txt. Documentation/input/xpad.txt.
This driver is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called xpad.
The module will be called xpad. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
...@@ -14,10 +14,8 @@ config USB_DABUSB ...@@ -14,10 +14,8 @@ config USB_DABUSB
isochronous transactions. URB's are explained in isochronous transactions. URB's are explained in
<file:Documentation/usb/URB.txt>. <file:Documentation/usb/URB.txt>.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called dabusb.
The module will be called dabusb. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
comment "Video4Linux support is needed for USB Multimedia device support" comment "Video4Linux support is needed for USB Multimedia device support"
depends on USB && VIDEO_DEV=n depends on USB && VIDEO_DEV=n
...@@ -33,10 +31,8 @@ config USB_VICAM ...@@ -33,10 +31,8 @@ config USB_VICAM
Information on this API and pointers to "v4l" programs may be found Information on this API and pointers to "v4l" programs may be found
on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>. on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called vicam.
The module will be called vicam. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_DSBR config USB_DSBR
tristate "D-Link USB FM radio support (EXPERIMENTAL)" tristate "D-Link USB FM radio support (EXPERIMENTAL)"
...@@ -53,10 +49,8 @@ config USB_DSBR ...@@ -53,10 +49,8 @@ config USB_DSBR
"v4l" programs may be found on the WWW at "v4l" programs may be found on the WWW at
<http://roadrunner.swansea.uk.linux.org/v4l.shtml>. <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called dsbr100.
The module will be called dsbr100. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_IBMCAM config USB_IBMCAM
tristate "USB IBM (Xirlink) C-it Camera support" tristate "USB IBM (Xirlink) C-it Camera support"
...@@ -72,13 +66,12 @@ config USB_IBMCAM ...@@ -72,13 +66,12 @@ config USB_IBMCAM
"v4l" programs may be found on the WWW at "v4l" programs may be found on the WWW at
<http://roadrunner.swansea.uk.linux.org/v4l.shtml>. <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called ibmcam.
The module will be called ibmcam. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>. This This camera has several configuration options which
camera has several configuration options which can be specified when can be specified when you load the module. Read
you load the module. Read <file:Documentation/usb/ibmcam.txt> to <file:Documentation/usb/ibmcam.txt> to learn more.
learn more.
config USB_KONICAWC config USB_KONICAWC
tristate "USB Konica Webcam support" tristate "USB Konica Webcam support"
...@@ -93,10 +86,8 @@ config USB_KONICAWC ...@@ -93,10 +86,8 @@ config USB_KONICAWC
"v4l" programs may be found on the WWW at "v4l" programs may be found on the WWW at
<http://roadrunner.swansea.uk.linux.org/v4l.shtml>. <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called konicawc.
The module will be called konicawc. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
config USB_OV511 config USB_OV511
tristate "USB OV511 Camera support" tristate "USB OV511 Camera support"
...@@ -111,10 +102,8 @@ config USB_OV511 ...@@ -111,10 +102,8 @@ config USB_OV511
Information on this API and pointers to "v4l" programs may be found Information on this API and pointers to "v4l" programs may be found
on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>. on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called ov511.
The module will be called ov511. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_PWC config USB_PWC
tristate "USB Philips Cameras" tristate "USB Philips Cameras"
...@@ -152,10 +141,8 @@ config USB_PWC ...@@ -152,10 +141,8 @@ config USB_PWC
Information on this API and pointers to "v4l" programs may be found Information on this API and pointers to "v4l" programs may be found
on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>. on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called pwc.
The module will be called pwc. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_SE401 config USB_SE401
tristate "USB SE401 Camera support" tristate "USB SE401 Camera support"
...@@ -170,10 +157,8 @@ config USB_SE401 ...@@ -170,10 +157,8 @@ config USB_SE401
Information on this API and pointers to "v4l" programs may be found Information on this API and pointers to "v4l" programs may be found
on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>. on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called se401.
The module will be called se401. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_STV680 config USB_STV680
tristate "USB STV680 (Pencam) Camera support" tristate "USB STV680 (Pencam) Camera support"
...@@ -189,8 +174,6 @@ config USB_STV680 ...@@ -189,8 +174,6 @@ config USB_STV680
Information on this API and pointers to "v4l" programs may be found Information on this API and pointers to "v4l" programs may be found
on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>. on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called stv680.
The module will be called stv680. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
...@@ -89,7 +89,6 @@ static int dabusb_add_buf_tail (pdabusb_t s, struct list_head *dst, struct list_ ...@@ -89,7 +89,6 @@ static int dabusb_add_buf_tail (pdabusb_t s, struct list_head *dst, struct list_
static void dump_urb (struct urb *urb) static void dump_urb (struct urb *urb)
{ {
dbg("urb :%p", urb); dbg("urb :%p", urb);
dbg("next :%p", urb->next);
dbg("dev :%p", urb->dev); dbg("dev :%p", urb->dev);
dbg("pipe :%08X", urb->pipe); dbg("pipe :%08X", urb->pipe);
dbg("status :%d", urb->status); dbg("status :%d", urb->status);
...@@ -728,7 +727,7 @@ static int dabusb_probe (struct usb_interface *intf, ...@@ -728,7 +727,7 @@ static int dabusb_probe (struct usb_interface *intf,
pdabusb_t s; pdabusb_t s;
dbg("dabusb: probe: vendor id 0x%x, device id 0x%x ifnum:%d", dbg("dabusb: probe: vendor id 0x%x, device id 0x%x ifnum:%d",
usbdev->descriptor.idVendor, usbdev->descriptor.idProduct, ifnum); usbdev->descriptor.idVendor, usbdev->descriptor.idProduct, intf->altsetting->desc.bInterfaceNumber);
/* We don't handle multiple configurations */ /* We don't handle multiple configurations */
if (usbdev->descriptor.bNumConfigurations != 1) if (usbdev->descriptor.bNumConfigurations != 1)
...@@ -762,7 +761,7 @@ static int dabusb_probe (struct usb_interface *intf, ...@@ -762,7 +761,7 @@ static int dabusb_probe (struct usb_interface *intf,
goto reject; goto reject;
} }
} }
dbg("bound to interface: %d", ifnum); dbg("bound to interface: %d", intf->altsetting->desc.bInterfaceNumber);
usb_set_intfdata (intf, s); usb_set_intfdata (intf, s);
up (&s->mutex); up (&s->mutex);
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/mm.h>
#include <asm/io.h> #include <asm/io.h>
......
...@@ -1292,7 +1292,7 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id) ...@@ -1292,7 +1292,7 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id)
interface = &intf->altsetting[0]; interface = &intf->altsetting[0];
DBG(KERN_DEBUG "Interface %d. has %u. endpoints!\n", DBG(KERN_DEBUG "Interface %d. has %u. endpoints!\n",
ifnum, (unsigned) (interface->desc.bNumEndpoints)); interface->desc.bInterfaceNumber, (unsigned) (interface->desc.bNumEndpoints));
endpoint = &interface->endpoint[0].desc; endpoint = &interface->endpoint[0].desc;
if ((endpoint->bEndpointAddress & 0x80) && if ((endpoint->bEndpointAddress & 0x80) &&
......
...@@ -21,7 +21,9 @@ ...@@ -21,7 +21,9 @@
******************************************************************************/ ******************************************************************************/
/* /*
* Written by Johan Verrept, maintained by Duncan Sands (duncan.sands@wanadoo.fr) * Written by Johan Verrept, maintained by Duncan Sands (duncan.sands@free.fr)
*
* 1.7+: - See the check-in logs
* *
* 1.6: - No longer opens a connection if the firmware is not loaded * 1.6: - No longer opens a connection if the firmware is not loaded
* - Added support for the speedtouch 330 * - Added support for the speedtouch 330
...@@ -84,6 +86,11 @@ ...@@ -84,6 +86,11 @@
#include <linux/usb.h> #include <linux/usb.h>
#ifdef DEBUG
#define DEBUG_ON(x) BUG_ON(x)
#else
#define DEBUG_ON(x) do { if (x); } while (0)
#endif
#ifdef VERBOSE_DEBUG #ifdef VERBOSE_DEBUG
static int udsl_print_packet (const unsigned char *data, int len); static int udsl_print_packet (const unsigned char *data, int len);
...@@ -94,9 +101,9 @@ static int udsl_print_packet (const unsigned char *data, int len); ...@@ -94,9 +101,9 @@ static int udsl_print_packet (const unsigned char *data, int len);
#define vdbg(arg...) #define vdbg(arg...)
#endif #endif
#define DRIVER_AUTHOR "Johan Verrept, Duncan Sands <duncan.sands@wanadoo.fr>" #define DRIVER_AUTHOR "Johan Verrept, Duncan Sands <duncan.sands@free.fr>"
#define DRIVER_DESC "Alcatel SpeedTouch USB driver" #define DRIVER_DESC "Alcatel SpeedTouch USB driver"
#define DRIVER_VERSION "1.6" #define DRIVER_VERSION "1.7"
static const char udsl_driver_name [] = "speedtch"; static const char udsl_driver_name [] = "speedtch";
...@@ -109,10 +116,10 @@ static const char udsl_driver_name [] = "speedtch"; ...@@ -109,10 +116,10 @@ static const char udsl_driver_name [] = "speedtch";
#define UDSL_MAX_SND_BUFS 8 #define UDSL_MAX_SND_BUFS 8
#define UDSL_MAX_RCV_BUF_SIZE 1024 /* ATM cells */ #define UDSL_MAX_RCV_BUF_SIZE 1024 /* ATM cells */
#define UDSL_MAX_SND_BUF_SIZE 1024 /* ATM cells */ #define UDSL_MAX_SND_BUF_SIZE 1024 /* ATM cells */
#define UDSL_DEFAULT_RCV_URBS 1 #define UDSL_DEFAULT_RCV_URBS 2
#define UDSL_DEFAULT_SND_URBS 1 #define UDSL_DEFAULT_SND_URBS 2
#define UDSL_DEFAULT_RCV_BUFS 2 #define UDSL_DEFAULT_RCV_BUFS 4
#define UDSL_DEFAULT_SND_BUFS 2 #define UDSL_DEFAULT_SND_BUFS 4
#define UDSL_DEFAULT_RCV_BUF_SIZE 64 /* ATM cells */ #define UDSL_DEFAULT_RCV_BUF_SIZE 64 /* ATM cells */
#define UDSL_DEFAULT_SND_BUF_SIZE 64 /* ATM cells */ #define UDSL_DEFAULT_SND_BUF_SIZE 64 /* ATM cells */
...@@ -351,7 +358,7 @@ static void udsl_extract_cells (struct udsl_instance_data *instance, unsigned ch ...@@ -351,7 +358,7 @@ static void udsl_extract_cells (struct udsl_instance_data *instance, unsigned ch
dbg ("udsl_extract_cells: buffer overrun (max_pdu: %u, skb->len %u, vcc: 0x%p)", vcc_data->max_pdu, skb->len, vcc); dbg ("udsl_extract_cells: buffer overrun (max_pdu: %u, skb->len %u, vcc: 0x%p)", vcc_data->max_pdu, skb->len, vcc);
/* discard cells already received */ /* discard cells already received */
skb_trim (skb, 0); skb_trim (skb, 0);
BUG_ON (vcc_data->max_pdu < ATM_CELL_PAYLOAD); DEBUG_ON (vcc_data->max_pdu < ATM_CELL_PAYLOAD);
} }
memcpy (skb->tail, source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD); memcpy (skb->tail, source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD);
...@@ -498,7 +505,7 @@ static unsigned int udsl_write_cells (unsigned int howmany, struct sk_buff *skb, ...@@ -498,7 +505,7 @@ static unsigned int udsl_write_cells (unsigned int howmany, struct sk_buff *skb,
memset (target, 0, ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER); memset (target, 0, ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER);
target += ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER; target += ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER;
BUG_ON (--ctrl->num_cells); DEBUG_ON (--ctrl->num_cells);
} }
memcpy (target, ctrl->aal5_trailer, ATM_AAL5_TRAILER); memcpy (target, ctrl->aal5_trailer, ATM_AAL5_TRAILER);
...@@ -535,7 +542,7 @@ static void udsl_complete_receive (struct urb *urb, struct pt_regs *regs) ...@@ -535,7 +542,7 @@ static void udsl_complete_receive (struct urb *urb, struct pt_regs *regs)
vdbg ("udsl_complete_receive: urb 0x%p, status %d, actual_length %d, filled_cells %u, rcv 0x%p, buf 0x%p", urb, urb->status, urb->actual_length, buf->filled_cells, rcv, buf); vdbg ("udsl_complete_receive: urb 0x%p, status %d, actual_length %d, filled_cells %u, rcv 0x%p, buf 0x%p", urb, urb->status, urb->actual_length, buf->filled_cells, rcv, buf);
BUG_ON (buf->filled_cells > rcv_buf_size); DEBUG_ON (buf->filled_cells > rcv_buf_size);
/* may not be in_interrupt() */ /* may not be in_interrupt() */
spin_lock_irqsave (&instance->receive_lock, flags); spin_lock_irqsave (&instance->receive_lock, flags);
...@@ -1216,8 +1223,7 @@ static void udsl_usb_disconnect (struct usb_interface *intf) ...@@ -1216,8 +1223,7 @@ static void udsl_usb_disconnect (struct usb_interface *intf)
count = 0; count = 0;
spin_lock_irq (&instance->receive_lock); spin_lock_irq (&instance->receive_lock);
list_for_each (pos, &instance->spare_receivers) list_for_each (pos, &instance->spare_receivers)
if (++count > num_rcv_urbs) DEBUG_ON (++count > num_rcv_urbs);
panic (__FILE__ ": memory corruption detected at line %d!\n", __LINE__);
spin_unlock_irq (&instance->receive_lock); spin_unlock_irq (&instance->receive_lock);
dbg ("udsl_usb_disconnect: found %u spare receivers", count); dbg ("udsl_usb_disconnect: found %u spare receivers", count);
...@@ -1253,8 +1259,7 @@ static void udsl_usb_disconnect (struct usb_interface *intf) ...@@ -1253,8 +1259,7 @@ static void udsl_usb_disconnect (struct usb_interface *intf)
count = 0; count = 0;
spin_lock_irq (&instance->send_lock); spin_lock_irq (&instance->send_lock);
list_for_each (pos, &instance->spare_senders) list_for_each (pos, &instance->spare_senders)
if (++count > num_snd_urbs) DEBUG_ON (++count > num_snd_urbs);
panic (__FILE__ ": memory corruption detected at line %d!\n", __LINE__);
spin_unlock_irq (&instance->send_lock); spin_unlock_irq (&instance->send_lock);
dbg ("udsl_usb_disconnect: found %u spare senders", count); dbg ("udsl_usb_disconnect: found %u spare senders", count);
......
...@@ -87,7 +87,7 @@ get_endpoints (struct usbtest_dev *dev, struct usb_interface *intf) ...@@ -87,7 +87,7 @@ get_endpoints (struct usbtest_dev *dev, struct usb_interface *intf)
struct usb_host_endpoint *in, *out; struct usb_host_endpoint *in, *out;
struct usb_device *udev; struct usb_device *udev;
for (tmp = 0; tmp < intf->max_altsetting; tmp++) { for (tmp = 0; tmp < intf->num_altsetting; tmp++) {
unsigned ep; unsigned ep;
in = out = 0; in = out = 0;
......
...@@ -252,6 +252,8 @@ struct driver_info { ...@@ -252,6 +252,8 @@ struct driver_info {
/* for new devices, use the descriptor-reading code instead */ /* for new devices, use the descriptor-reading code instead */
int in; /* rx endpoint */ int in; /* rx endpoint */
int out; /* tx endpoint */ int out; /* tx endpoint */
unsigned long data; /* Misc driver specific data */
}; };
// we record the state for each of our queued skbs // we record the state for each of our queued skbs
...@@ -298,6 +300,9 @@ MODULE_PARM_DESC (msg_level, "Initial message level (default = 1)"); ...@@ -298,6 +300,9 @@ MODULE_PARM_DESC (msg_level, "Initial message level (default = 1)");
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static struct ethtool_ops usbnet_ethtool_ops;
static void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *);
/* mostly for PDA style devices, which are always connected if present */ /* mostly for PDA style devices, which are always connected if present */
static int always_connected (struct usbnet *dev) static int always_connected (struct usbnet *dev)
{ {
...@@ -312,7 +317,7 @@ get_endpoints (struct usbnet *dev, struct usb_interface *intf) ...@@ -312,7 +317,7 @@ get_endpoints (struct usbnet *dev, struct usb_interface *intf)
struct usb_host_interface *alt; struct usb_host_interface *alt;
struct usb_host_endpoint *in, *out; struct usb_host_endpoint *in, *out;
for (tmp = 0; tmp < intf->max_altsetting; tmp++) { for (tmp = 0; tmp < intf->num_altsetting; tmp++) {
unsigned ep; unsigned ep;
in = out = 0; in = out = 0;
...@@ -383,10 +388,10 @@ static const struct driver_info an2720_info = { ...@@ -383,10 +388,10 @@ static const struct driver_info an2720_info = {
#ifdef CONFIG_USB_AX8817X #ifdef CONFIG_USB_AX8817X
#define NEED_MII
/* ASIX AX8817X based USB 2.0 Ethernet Devices */ /* ASIX AX8817X based USB 2.0 Ethernet Devices */
#define HAVE_HARDWARE #define HAVE_HARDWARE
#define NEED_MII
#include <linux/crc32.h> #include <linux/crc32.h>
...@@ -394,6 +399,8 @@ static const struct driver_info an2720_info = { ...@@ -394,6 +399,8 @@ static const struct driver_info an2720_info = {
#define AX_CMD_READ_MII_REG 0x07 #define AX_CMD_READ_MII_REG 0x07
#define AX_CMD_WRITE_MII_REG 0x08 #define AX_CMD_WRITE_MII_REG 0x08
#define AX_CMD_SET_HW_MII 0x0a #define AX_CMD_SET_HW_MII 0x0a
#define AX_CMD_READ_EEPROM 0x0b
#define AX_CMD_WRITE_EEPROM 0x0c
#define AX_CMD_WRITE_RX_CTL 0x10 #define AX_CMD_WRITE_RX_CTL 0x10
#define AX_CMD_READ_IPG012 0x11 #define AX_CMD_READ_IPG012 0x11
#define AX_CMD_WRITE_IPG0 0x12 #define AX_CMD_WRITE_IPG0 0x12
...@@ -403,8 +410,15 @@ static const struct driver_info an2720_info = { ...@@ -403,8 +410,15 @@ static const struct driver_info an2720_info = {
#define AX_CMD_READ_NODE_ID 0x17 #define AX_CMD_READ_NODE_ID 0x17
#define AX_CMD_READ_PHY_ID 0x19 #define AX_CMD_READ_PHY_ID 0x19
#define AX_CMD_WRITE_MEDIUM_MODE 0x1b #define AX_CMD_WRITE_MEDIUM_MODE 0x1b
#define AX_CMD_READ_MONITOR_MODE 0x1c
#define AX_CMD_WRITE_MONITOR_MODE 0x1d
#define AX_CMD_WRITE_GPIOS 0x1f #define AX_CMD_WRITE_GPIOS 0x1f
#define AX_MONITOR_MODE 0x01
#define AX_MONITOR_LINK 0x02
#define AX_MONITOR_MAGIC 0x04
#define AX_MONITOR_HSFS 0x10
#define AX_MCAST_FILTER_SIZE 8 #define AX_MCAST_FILTER_SIZE 8
#define AX_MAX_MCAST 64 #define AX_MAX_MCAST 64
...@@ -441,11 +455,11 @@ static int ax8817x_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, ...@@ -441,11 +455,11 @@ static int ax8817x_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
static void ax8817x_async_cmd_callback(struct urb *urb, struct pt_regs *regs) static void ax8817x_async_cmd_callback(struct urb *urb, struct pt_regs *regs)
{ {
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context; struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context;
if (urb->status < 0) if (urb->status < 0)
printk(KERN_DEBUG "ax8817x_async_cmd_callback() failed with %d", printk(KERN_DEBUG "ax8817x_async_cmd_callback() failed with %d",
urb->status); urb->status);
kfree(req); kfree(req);
usb_free_urb(urb); usb_free_urb(urb);
} }
...@@ -456,12 +470,12 @@ static void ax8817x_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 i ...@@ -456,12 +470,12 @@ static void ax8817x_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 i
struct usb_ctrlrequest *req; struct usb_ctrlrequest *req;
int status; int status;
struct urb *urb; struct urb *urb;
if ((urb = usb_alloc_urb(0, GFP_ATOMIC)) == NULL) { if ((urb = usb_alloc_urb(0, GFP_ATOMIC)) == NULL) {
devdbg(dev, "Error allocating URB in write_cmd_async!"); devdbg(dev, "Error allocating URB in write_cmd_async!");
return; return;
} }
if ((req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC)) == NULL) { if ((req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC)) == NULL) {
deverr(dev, "Failed to allocate memory for control request"); deverr(dev, "Failed to allocate memory for control request");
usb_free_urb(urb); usb_free_urb(urb);
...@@ -496,34 +510,31 @@ static void ax8817x_set_multicast(struct net_device *net) ...@@ -496,34 +510,31 @@ static void ax8817x_set_multicast(struct net_device *net)
} else if (net->mc_count == 0) { } else if (net->mc_count == 0) {
/* just broadcast and directed */ /* just broadcast and directed */
} else { } else {
/* We use the 20 byte dev->data
* for our 8 byte filter buffer
* to avoid allocating memory that
* is tricky to free later */
u8 *multi_filter = (u8 *)dev->data;
struct dev_mc_list *mc_list = net->mc_list; struct dev_mc_list *mc_list = net->mc_list;
u8 *multi_filter;
u32 crc_bits; u32 crc_bits;
int i; int i;
multi_filter = kmalloc(AX_MCAST_FILTER_SIZE, GFP_ATOMIC); memset(multi_filter, 0, AX_MCAST_FILTER_SIZE);
if (multi_filter == NULL) {
/* Oops, couldn't allocate a buffer for setting the multicast
filter. Try all multi mode. */
rx_ctl |= 0x02;
} else {
memset(multi_filter, 0, AX_MCAST_FILTER_SIZE);
/* Build the multicast hash filter. */
for (i = 0; i < net->mc_count; i++) {
crc_bits =
ether_crc(ETH_ALEN,
mc_list->dmi_addr) >> 26;
multi_filter[crc_bits >> 3] |=
1 << (crc_bits & 7);
mc_list = mc_list->next;
}
ax8817x_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0,
AX_MCAST_FILTER_SIZE, multi_filter);
rx_ctl |= 0x10; /* Build the multicast hash filter. */
for (i = 0; i < net->mc_count; i++) {
crc_bits =
ether_crc(ETH_ALEN,
mc_list->dmi_addr) >> 26;
multi_filter[crc_bits >> 3] |=
1 << (crc_bits & 7);
mc_list = mc_list->next;
} }
ax8817x_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0,
AX_MCAST_FILTER_SIZE, multi_filter);
rx_ctl |= 0x10;
} }
ax8817x_write_cmd_async(dev, AX_CMD_WRITE_RX_CTL, rx_ctl, 0, 0, NULL); ax8817x_write_cmd_async(dev, AX_CMD_WRITE_RX_CTL, rx_ctl, 0, 0, NULL);
...@@ -533,7 +544,7 @@ static int ax8817x_mdio_read(struct net_device *netdev, int phy_id, int loc) ...@@ -533,7 +544,7 @@ static int ax8817x_mdio_read(struct net_device *netdev, int phy_id, int loc)
{ {
struct usbnet *dev = netdev->priv; struct usbnet *dev = netdev->priv;
u16 res; u16 res;
u8 buf[4]; u8 buf[1];
ax8817x_write_cmd(dev, AX_CMD_SET_SW_MII, 0, 0, 0, &buf); ax8817x_write_cmd(dev, AX_CMD_SET_SW_MII, 0, 0, 0, &buf);
ax8817x_read_cmd(dev, AX_CMD_READ_MII_REG, phy_id, (__u16)loc, 2, (u16 *)&res); ax8817x_read_cmd(dev, AX_CMD_READ_MII_REG, phy_id, (__u16)loc, 2, (u16 *)&res);
...@@ -546,23 +557,103 @@ static void ax8817x_mdio_write(struct net_device *netdev, int phy_id, int loc, i ...@@ -546,23 +557,103 @@ static void ax8817x_mdio_write(struct net_device *netdev, int phy_id, int loc, i
{ {
struct usbnet *dev = netdev->priv; struct usbnet *dev = netdev->priv;
u16 res = val; u16 res = val;
u8 buf[4]; u8 buf[1];
ax8817x_write_cmd(dev, AX_CMD_SET_SW_MII, 0, 0, 0, &buf); ax8817x_write_cmd(dev, AX_CMD_SET_SW_MII, 0, 0, 0, &buf);
ax8817x_write_cmd(dev, AX_CMD_WRITE_MII_REG, phy_id, (__u16)loc, 2, (u16 *)&res); ax8817x_write_cmd(dev, AX_CMD_WRITE_MII_REG, phy_id, (__u16)loc, 2, (u16 *)&res);
ax8817x_write_cmd(dev, AX_CMD_SET_HW_MII, 0, 0, 0, &buf); ax8817x_write_cmd(dev, AX_CMD_SET_HW_MII, 0, 0, 0, &buf);
} }
void ax8817x_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
{
struct usbnet *dev = (struct usbnet *)net->priv;
u8 opt;
if (ax8817x_read_cmd(dev, AX_CMD_READ_MONITOR_MODE, 0, 0, 1, &opt) < 0) {
wolinfo->supported = 0;
wolinfo->wolopts = 0;
return;
}
wolinfo->supported = WAKE_PHY | WAKE_MAGIC;
wolinfo->wolopts = 0;
if (opt & AX_MONITOR_MODE) {
if (opt & AX_MONITOR_LINK)
wolinfo->wolopts |= WAKE_PHY;
if (opt & AX_MONITOR_MAGIC)
wolinfo->wolopts |= WAKE_MAGIC;
}
}
int ax8817x_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
{
struct usbnet *dev = (struct usbnet *)net->priv;
u8 opt = 0;
u8 buf[1];
if (wolinfo->wolopts & WAKE_PHY)
opt |= AX_MONITOR_LINK;
if (wolinfo->wolopts & WAKE_MAGIC)
opt |= AX_MONITOR_MAGIC;
if (opt != 0)
opt |= AX_MONITOR_MODE;
if (ax8817x_write_cmd(dev, AX_CMD_WRITE_MONITOR_MODE,
opt, 0, 0, &buf) < 0)
return -EINVAL;
return 0;
}
int ax8817x_get_eeprom(struct net_device *net,
struct ethtool_eeprom *eeprom, u8 *data)
{
struct usbnet *dev = (struct usbnet *)net->priv;
u16 *ebuf = (u16 *)data;
int i;
/* Crude hack to ensure that we don't overwrite memory
* if an odd length is supplied
*/
if (eeprom->len % 2)
return -EINVAL;
/* ax8817x returns 2 bytes from eeprom on read */
for (i=0; i < eeprom->len / 2; i++) {
if (ax8817x_read_cmd(dev, AX_CMD_READ_EEPROM,
eeprom->offset + i, 0, 2, &ebuf[i]) < 0)
return -EINVAL;
}
return i * 2;
}
static void ax8817x_get_drvinfo (struct net_device *net,
struct ethtool_drvinfo *info)
{
/* Inherit standard device info */
usbnet_get_drvinfo(net, info);
info->eedump_len = 0x3e;
}
static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf) static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf)
{ {
int ret; int ret;
u8 buf[6]; u8 buf[6];
u16 *buf16 = (u16 *) buf; u16 *buf16 = (u16 *) buf;
int i; int i;
unsigned long gpio_bits = dev->driver_info->data;
dev->in = usb_rcvbulkpipe(dev->udev, 3); dev->in = usb_rcvbulkpipe(dev->udev, 3);
dev->out = usb_sndbulkpipe(dev->udev, 2); dev->out = usb_sndbulkpipe(dev->udev, 2);
/* Toggle the GPIOs in a manufacturer/model specific way */
for (i = 2; i >= 0; i--) {
if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_GPIOS,
(gpio_bits >> (i * 8)) & 0xff, 0, 0,
buf)) < 0)
return ret;
wait_ms(5);
}
if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_RX_CTL, 0x80, 0, 0, buf)) < 0) { if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_RX_CTL, 0x80, 0, 0, buf)) < 0) {
dbg("send AX_CMD_WRITE_RX_CTL failed: %d", ret); dbg("send AX_CMD_WRITE_RX_CTL failed: %d", ret);
return ret; return ret;
...@@ -640,6 +731,11 @@ static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf) ...@@ -640,6 +731,11 @@ static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf)
dev->net->set_multicast_list = ax8817x_set_multicast; dev->net->set_multicast_list = ax8817x_set_multicast;
usbnet_ethtool_ops.get_drvinfo = &ax8817x_get_drvinfo;
usbnet_ethtool_ops.get_wol = &ax8817x_get_wol;
usbnet_ethtool_ops.set_wol = &ax8817x_set_wol;
usbnet_ethtool_ops.get_eeprom = &ax8817x_get_eeprom;
return 0; return 0;
} }
...@@ -647,7 +743,30 @@ static const struct driver_info ax8817x_info = { ...@@ -647,7 +743,30 @@ static const struct driver_info ax8817x_info = {
.description = "ASIX AX8817x USB 2.0 Ethernet", .description = "ASIX AX8817x USB 2.0 Ethernet",
.bind = ax8817x_bind, .bind = ax8817x_bind,
.flags = FLAG_ETHER, .flags = FLAG_ETHER,
.data = 0x00130103,
};
static const struct driver_info dlink_dub_e100_info = {
.description = "DLink DUB-E100 USB Ethernet",
.bind = ax8817x_bind,
.flags = FLAG_ETHER,
.data = 0x009f9d9f,
};
static const struct driver_info netgear_fa120_info = {
.description = "Netgear FA-120 USB Ethernet",
.bind = ax8817x_bind,
.flags = FLAG_ETHER,
.data = 0x00130103,
}; };
static const struct driver_info hawking_uf200_info = {
.description = "Hawking UF200 USB Ethernet",
.bind = ax8817x_bind,
.flags = FLAG_ETHER,
.data = 0x001f1d1f,
};
#endif /* CONFIG_USB_AX8817X */ #endif /* CONFIG_USB_AX8817X */
...@@ -2415,72 +2534,45 @@ static int usbnet_open (struct net_device *net) ...@@ -2415,72 +2534,45 @@ static int usbnet_open (struct net_device *net)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static inline int static void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
usbnet_ethtool_ioctl (struct net_device *net, void __user *useraddr)
{ {
struct usbnet *dev = (struct usbnet *) net->priv; struct usbnet *dev = net->priv;
u32 cmd;
if (get_user (cmd, (u32 *)useraddr))
return -EFAULT;
switch (cmd) {
case ETHTOOL_GDRVINFO: { /* get driver info */
struct ethtool_drvinfo info;
memset (&info, 0, sizeof info);
info.cmd = ETHTOOL_GDRVINFO;
strncpy (info.driver, driver_name, sizeof info.driver);
strncpy (info.version, DRIVER_VERSION, sizeof info.version);
strncpy (info.fw_version, dev->driver_info->description,
sizeof info.fw_version);
usb_make_path (dev->udev, info.bus_info, sizeof info.bus_info);
if (copy_to_user (useraddr, &info, sizeof (info)))
return -EFAULT;
return 0;
}
case ETHTOOL_GLINK: /* get link status */ strncpy (info->driver, driver_name, sizeof info->driver);
if (dev->driver_info->check_connect) { strncpy (info->version, DRIVER_VERSION, sizeof info->version);
struct ethtool_value edata = { ETHTOOL_GLINK }; strncpy (info->fw_version, dev->driver_info->description,
sizeof info->fw_version);
usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info);
}
edata.data = dev->driver_info->check_connect (dev) == 0; static u32 usbnet_get_link (struct net_device *net)
if (copy_to_user (useraddr, &edata, sizeof (edata))) {
return -EFAULT; struct usbnet *dev = net->priv;
return 0;
}
break;
case ETHTOOL_GMSGLVL: { /* get message-level */ /* If a check_connect is defined, return it's results */
struct ethtool_value edata = {ETHTOOL_GMSGLVL}; if (dev->driver_info->check_connect)
return dev->driver_info->check_connect (dev) == 0;
edata.data = dev->msg_level; /* Otherwise, we're up to avoid breaking scripts */
if (copy_to_user (useraddr, &edata, sizeof (edata))) return 1;
return -EFAULT; }
return 0;
}
case ETHTOOL_SMSGLVL: { /* set message-level */ static u32 usbnet_get_msglevel (struct net_device *net)
struct ethtool_value edata; {
struct usbnet *dev = net->priv;
if (copy_from_user (&edata, useraddr, sizeof (edata))) return dev->msg_level;
return -EFAULT; }
dev->msg_level = edata.data;
return 0;
}
/* could also map RINGPARAM to RX/TX QLEN */
} static void usbnet_set_msglevel (struct net_device *net, u32 level)
/* Note that the ethtool user space code requires EOPNOTSUPP */ {
return -EOPNOTSUPP; struct usbnet *dev = net->priv;
dev->msg_level = level;
} }
static int usbnet_ioctl (struct net_device *net, struct ifreq *rq, int cmd) static int usbnet_ioctl (struct net_device *net, struct ifreq *rq, int cmd)
{ {
if (cmd == SIOCETHTOOL)
return usbnet_ethtool_ioctl (net, (void __user *)rq->ifr_data);
#ifdef NEED_MII #ifdef NEED_MII
{ {
struct usbnet *dev = (struct usbnet *)net->priv; struct usbnet *dev = (struct usbnet *)net->priv;
...@@ -2889,6 +2981,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) ...@@ -2889,6 +2981,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
net->watchdog_timeo = TX_TIMEOUT_JIFFIES; net->watchdog_timeo = TX_TIMEOUT_JIFFIES;
net->tx_timeout = usbnet_tx_timeout; net->tx_timeout = usbnet_tx_timeout;
net->do_ioctl = usbnet_ioctl; net->do_ioctl = usbnet_ioctl;
net->ethtool_ops = &usbnet_ethtool_ops;
// allow device-specific bind/init procedures // allow device-specific bind/init procedures
// NOTE net->name still not usable ... // NOTE net->name still not usable ...
...@@ -2991,19 +3084,19 @@ static const struct usb_device_id products [] = { ...@@ -2991,19 +3084,19 @@ static const struct usb_device_id products [] = {
}, { }, {
// Netgear FA120 // Netgear FA120
USB_DEVICE (0x0846, 0x1040), USB_DEVICE (0x0846, 0x1040),
.driver_info = (unsigned long) &ax8817x_info, .driver_info = (unsigned long) &netgear_fa120_info,
}, { }, {
// DLink DUB-E100 // DLink DUB-E100
USB_DEVICE (0x2001, 0x1a00), USB_DEVICE (0x2001, 0x1a00),
.driver_info = (unsigned long) &ax8817x_info, .driver_info = (unsigned long) &dlink_dub_e100_info,
}, { }, {
// Intellinet, ST Lab USB Ethernet // Intellinet, ST Lab USB Ethernet
USB_DEVICE (0x0b95, 0x1720), USB_DEVICE (0x0b95, 0x1720),
.driver_info = (unsigned long) &ax8817x_info, .driver_info = (unsigned long) &ax8817x_info,
}, { }, {
// Hawking UF200, TrendNet TU2-ET100 // Hawking UF200, TrendNet TU2-ET100
USB_DEVICE (0x07b8, 0x420a), USB_DEVICE (0x07b8, 0x420a),
.driver_info = (unsigned long) &ax8817x_info, .driver_info = (unsigned long) &hawking_uf200_info,
}, },
#endif #endif
...@@ -3167,6 +3260,14 @@ static struct usb_driver usbnet_driver = { ...@@ -3167,6 +3260,14 @@ static struct usb_driver usbnet_driver = {
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
}; };
/* Default ethtool_ops assigned. Devices can override in their bind() routine */
static struct ethtool_ops usbnet_ethtool_ops = {
.get_drvinfo = usbnet_get_drvinfo,
.get_link = usbnet_get_link,
.get_msglevel = usbnet_get_msglevel,
.set_msglevel = usbnet_set_msglevel,
};
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int __init usbnet_init (void) static int __init usbnet_init (void)
......
...@@ -17,10 +17,8 @@ config USB_SERIAL ...@@ -17,10 +17,8 @@ config USB_SERIAL
information on the specifics of the different devices that are information on the specifics of the different devices that are
supported, and on how to use them. supported, and on how to use them.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called usbserial.
The module will be called usbserial. If you want to compile it
as a module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_DEBUG config USB_SERIAL_DEBUG
bool "USB Serial Converter verbose debug" bool "USB Serial Converter verbose debug"
...@@ -70,10 +68,8 @@ config USB_SERIAL_BELKIN ...@@ -70,10 +68,8 @@ config USB_SERIAL_BELKIN
adaptor (F5U103 is one of the model numbers) or the Peracom single adaptor (F5U103 is one of the model numbers) or the Peracom single
port USB to serial adapter. port USB to serial adapter.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called belkin_sa.
The module will be called belkin_sa. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_WHITEHEAT config USB_SERIAL_WHITEHEAT
tristate "USB ConnectTech WhiteHEAT Serial Driver" tristate "USB ConnectTech WhiteHEAT Serial Driver"
...@@ -82,10 +78,8 @@ config USB_SERIAL_WHITEHEAT ...@@ -82,10 +78,8 @@ config USB_SERIAL_WHITEHEAT
Say Y here if you want to use a ConnectTech WhiteHEAT 4 port Say Y here if you want to use a ConnectTech WhiteHEAT 4 port
USB to serial converter device. USB to serial converter device.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called whiteheat.
The module will be called whiteheat. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_DIGI_ACCELEPORT config USB_SERIAL_DIGI_ACCELEPORT
tristate "USB Digi International AccelePort USB Serial Driver" tristate "USB Digi International AccelePort USB Serial Driver"
...@@ -99,11 +93,8 @@ config USB_SERIAL_DIGI_ACCELEPORT ...@@ -99,11 +93,8 @@ config USB_SERIAL_DIGI_ACCELEPORT
This driver works under SMP with the usb-uhci driver. It does not This driver works under SMP with the usb-uhci driver. It does not
work under SMP with the uhci driver. work under SMP with the uhci driver.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called digi_acceleport.
The module will be called digi_acceleport. If you want to compile
it as a module, say M here and read
<file:Documentation/modules.txt>.
config USB_SERIAL_EMPEG config USB_SERIAL_EMPEG
tristate "USB Empeg empeg-car Mark I/II Driver" tristate "USB Empeg empeg-car Mark I/II Driver"
...@@ -114,10 +105,8 @@ config USB_SERIAL_EMPEG ...@@ -114,10 +105,8 @@ config USB_SERIAL_EMPEG
device node. See <file:Documentation/usb/usb-serial.txt> for more device node. See <file:Documentation/usb/usb-serial.txt> for more
tidbits of information. tidbits of information.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called empeg.
The module will be called empeg. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_FTDI_SIO config USB_SERIAL_FTDI_SIO
tristate "USB FTDI Single Port Serial Driver (EXPERIMENTAL)" tristate "USB FTDI Single Port Serial Driver (EXPERIMENTAL)"
...@@ -130,10 +119,8 @@ config USB_SERIAL_FTDI_SIO ...@@ -130,10 +119,8 @@ config USB_SERIAL_FTDI_SIO
See <http://ftdi-usb-sio.sourceforge.net/> for more See <http://ftdi-usb-sio.sourceforge.net/> for more
information on this driver and the device. information on this driver and the device.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called ftdi_sio.
The module will be called ftdi_sio. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_VISOR config USB_SERIAL_VISOR
tristate "USB Handspring Visor / Palm m50x / Sony Clie Driver" tristate "USB Handspring Visor / Palm m50x / Sony Clie Driver"
...@@ -144,10 +131,8 @@ config USB_SERIAL_VISOR ...@@ -144,10 +131,8 @@ config USB_SERIAL_VISOR
<http://usbvisor.sourceforge.net/> for more information on using this <http://usbvisor.sourceforge.net/> for more information on using this
driver. driver.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called visor.
The module will be called visor. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_IPAQ config USB_SERIAL_IPAQ
tristate "USB PocketPC PDA Driver" tristate "USB PocketPC PDA Driver"
...@@ -158,10 +143,8 @@ config USB_SERIAL_IPAQ ...@@ -158,10 +143,8 @@ config USB_SERIAL_IPAQ
using a USB cradle/cable. For information on using the driver, using a USB cradle/cable. For information on using the driver,
read <file:Documentation/usb/usb-serial.txt>. read <file:Documentation/usb/usb-serial.txt>.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called ipaq.
The module will be called ipaq. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_IR config USB_SERIAL_IR
tristate "USB IR Dongle Serial Driver (EXPERIMENTAL)" tristate "USB IR Dongle Serial Driver (EXPERIMENTAL)"
...@@ -171,10 +154,8 @@ config USB_SERIAL_IR ...@@ -171,10 +154,8 @@ config USB_SERIAL_IR
devices. This is useful if you do not want to use the full IrDA devices. This is useful if you do not want to use the full IrDA
stack. stack.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called ir-usb.
The module will be called ir-usb. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_EDGEPORT config USB_SERIAL_EDGEPORT
tristate "USB Inside Out Edgeport Serial Driver" tristate "USB Inside Out Edgeport Serial Driver"
...@@ -199,10 +180,8 @@ config USB_SERIAL_EDGEPORT ...@@ -199,10 +180,8 @@ config USB_SERIAL_EDGEPORT
Edgeport/4 DIN Edgeport/4 DIN
Edgeport/16 Dual Edgeport/16 Dual
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called io_edgeport.
The module will be called io_edgeport. If you want to compile it
as a module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_EDGEPORT_TI config USB_SERIAL_EDGEPORT_TI
tristate "USB Inside Out Edgeport Serial Driver (TI devices)" tristate "USB Inside Out Edgeport Serial Driver (TI devices)"
...@@ -212,10 +191,8 @@ config USB_SERIAL_EDGEPORT_TI ...@@ -212,10 +191,8 @@ config USB_SERIAL_EDGEPORT_TI
Networks (Digi) that are not supported by the io_edgeport driver. Networks (Digi) that are not supported by the io_edgeport driver.
This includes the Edgeport/1 device. This includes the Edgeport/1 device.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called io_ti.
The module will be called io_ti. If you want to compile it
as a module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_KEYSPAN_PDA config USB_SERIAL_KEYSPAN_PDA
tristate "USB Keyspan PDA Single Port Serial Driver" tristate "USB Keyspan PDA Single Port Serial Driver"
...@@ -225,10 +202,8 @@ config USB_SERIAL_KEYSPAN_PDA ...@@ -225,10 +202,8 @@ config USB_SERIAL_KEYSPAN_PDA
serial converter device. This driver makes use of firmware serial converter device. This driver makes use of firmware
developed from scratch by Brian Warner. developed from scratch by Brian Warner.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called keyspan_pda.
The module will be called keyspan_pda. If you want to compile it
as a module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_KEYSPAN config USB_SERIAL_KEYSPAN
tristate "USB Keyspan USA-xxx Serial Driver" tristate "USB Keyspan USA-xxx Serial Driver"
...@@ -241,10 +216,8 @@ config USB_SERIAL_KEYSPAN ...@@ -241,10 +216,8 @@ config USB_SERIAL_KEYSPAN
See <http://misc.nu/hugh/keyspan.html> for more information. See <http://misc.nu/hugh/keyspan.html> for more information.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called keyspan.
The module will be called keyspan. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_KEYSPAN_MPR config USB_SERIAL_KEYSPAN_MPR
bool "USB Keyspan MPR Firmware" bool "USB Keyspan MPR Firmware"
...@@ -337,10 +310,8 @@ config USB_SERIAL_KLSI ...@@ -337,10 +310,8 @@ config USB_SERIAL_KLSI
Please read <file:Documentation/usb/usb-serial.txt> for more Please read <file:Documentation/usb/usb-serial.txt> for more
information. information.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called kl5kusb105.
The module will be called kl5kusb105. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_KOBIL_SCT config USB_SERIAL_KOBIL_SCT
tristate "USB KOBIL chipcard reader (EXPERIMENTAL)" tristate "USB KOBIL chipcard reader (EXPERIMENTAL)"
...@@ -357,10 +328,8 @@ config USB_SERIAL_KOBIL_SCT ...@@ -357,10 +328,8 @@ config USB_SERIAL_KOBIL_SCT
- KAAN Professional - KAAN Professional
Note that you need a current CT-API. Note that you need a current CT-API.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called kobil_sct.
The module will be called kobil_sct. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_MCT_U232 config USB_SERIAL_MCT_U232
tristate "USB MCT Single Port Serial Driver" tristate "USB MCT Single Port Serial Driver"
...@@ -372,10 +341,8 @@ config USB_SERIAL_MCT_U232 ...@@ -372,10 +341,8 @@ config USB_SERIAL_MCT_U232
This driver also works with Sitecom U232-P25 and D-Link DU-H3SP USB This driver also works with Sitecom U232-P25 and D-Link DU-H3SP USB
BAY devices. BAY devices.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called mct_u232.
The module will be called mct_u232. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_PL2303 config USB_SERIAL_PL2303
tristate "USB Prolific 2303 Single Port Serial Driver" tristate "USB Prolific 2303 Single Port Serial Driver"
...@@ -384,10 +351,8 @@ config USB_SERIAL_PL2303 ...@@ -384,10 +351,8 @@ config USB_SERIAL_PL2303
Say Y here if you want to use the PL2303 USB Serial single port Say Y here if you want to use the PL2303 USB Serial single port
adapter from Prolific. adapter from Prolific.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called pl2303.
The module will be called pl2303. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_SAFE config USB_SERIAL_SAFE
tristate "USB Safe Serial (Encapsulated) Driver (EXPERIMENTAL)" tristate "USB Safe Serial (Encapsulated) Driver (EXPERIMENTAL)"
...@@ -405,10 +370,8 @@ config USB_SERIAL_CYBERJACK ...@@ -405,10 +370,8 @@ config USB_SERIAL_CYBERJACK
reader. This is an interface to ISO 7816 compatible contactbased reader. This is an interface to ISO 7816 compatible contactbased
chipcards, e.g. GSM SIMs. chipcards, e.g. GSM SIMs.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called cyberjack.
The module will be called cyberjack. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
If unsure, say N. If unsure, say N.
...@@ -420,10 +383,8 @@ config USB_SERIAL_XIRCOM ...@@ -420,10 +383,8 @@ config USB_SERIAL_XIRCOM
serial converter device. This driver makes use of firmware serial converter device. This driver makes use of firmware
developed from scratch by Brian Warner. developed from scratch by Brian Warner.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called keyspan_pda.
The module will be called keyspan_pda. If you want to compile it
as a module, say M here and read <file:Documentation/modules.txt>.
config USB_SERIAL_OMNINET config USB_SERIAL_OMNINET
tristate "USB ZyXEL omni.net LCD Plus Driver (EXPERIMENTAL)" tristate "USB ZyXEL omni.net LCD Plus Driver (EXPERIMENTAL)"
...@@ -431,10 +392,8 @@ config USB_SERIAL_OMNINET ...@@ -431,10 +392,8 @@ config USB_SERIAL_OMNINET
help help
Say Y here if you want to use a ZyXEL omni.net LCD ISDN TA. Say Y here if you want to use a ZyXEL omni.net LCD ISDN TA.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called omninet.
The module will be called omninet. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_EZUSB config USB_EZUSB
bool bool
......
...@@ -341,7 +341,7 @@ static void ipaq_read_bulk_callback(struct urb *urb, struct pt_regs *regs) ...@@ -341,7 +341,7 @@ static void ipaq_read_bulk_callback(struct urb *urb, struct pt_regs *regs)
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
tty = port->tty; tty = port->tty;
if (urb->actual_length) { if (tty && urb->actual_length) {
for (i = 0; i < urb->actual_length ; ++i) { for (i = 0; i < urb->actual_length ; ++i) {
/* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */ /* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */
if(tty->flip.count >= TTY_FLIPBUF_SIZE) { if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
......
...@@ -871,8 +871,10 @@ static void destroy_serial (struct kobject *kobj) ...@@ -871,8 +871,10 @@ static void destroy_serial (struct kobject *kobj)
/* the ports are cleaned up and released in port_release() */ /* the ports are cleaned up and released in port_release() */
for (i = 0; i < serial->num_ports; ++i) for (i = 0; i < serial->num_ports; ++i)
if (serial->port[i]->dev.parent != NULL) if (serial->port[i]->dev.parent != NULL) {
device_unregister(&serial->port[i]->dev); device_unregister(&serial->port[i]->dev);
serial->port[i] = NULL;
}
/* If this is a "fake" port, we have to clean it up here, as it will /* If this is a "fake" port, we have to clean it up here, as it will
* not get cleaned up in port_release() as it was never registered with * not get cleaned up in port_release() as it was never registered with
......
...@@ -15,10 +15,8 @@ config USB_STORAGE ...@@ -15,10 +15,8 @@ config USB_STORAGE
similar devices. This driver may also be used for some cameras and similar devices. This driver may also be used for some cameras and
card readers. card readers.
This code is also available as a module ( = code which can be To compile this driver as a module, say M here: the
inserted in and removed from the running kernel whenever you want). module will be called usb-storage.
The module will be called usb-storage. If you want to compile it
as a module, say M here and read <file:Documentation/modules.txt>.
config USB_STORAGE_DEBUG config USB_STORAGE_DEBUG
bool "USB Mass Storage verbose debug" bool "USB Mass Storage verbose debug"
......
...@@ -289,7 +289,7 @@ UNUSUAL_DEV( 0x054c, 0x006d, 0x0000, 0x9999, ...@@ -289,7 +289,7 @@ UNUSUAL_DEV( 0x054c, 0x006d, 0x0000, 0x9999,
UNUSUAL_DEV( 0x057b, 0x0000, 0x0000, 0x0299, UNUSUAL_DEV( 0x057b, 0x0000, 0x0000, 0x0299,
"Y-E Data", "Y-E Data",
"Flashbuster-U", "Flashbuster-U",
US_SC_UFI, US_PR_CB, NULL, US_SC_DEVICE, US_PR_CB, NULL,
US_FL_SINGLE_LUN), US_FL_SINGLE_LUN),
UNUSUAL_DEV( 0x057b, 0x0000, 0x0300, 0x9999, UNUSUAL_DEV( 0x057b, 0x0000, 0x0300, 0x9999,
......
...@@ -80,7 +80,6 @@ struct usb_host_interface { ...@@ -80,7 +80,6 @@ struct usb_host_interface {
* @act_altsetting: index of current altsetting. this number is always * @act_altsetting: index of current altsetting. this number is always
* less than num_altsetting. after the device is configured, each * less than num_altsetting. after the device is configured, each
* interface uses its default setting of zero. * interface uses its default setting of zero.
* @max_altsetting: the max number of altsettings for this interface.
* @driver: the USB driver that is bound to this interface. * @driver: the USB driver that is bound to this interface.
* @minor: the minor number assigned to this interface, if this * @minor: the minor number assigned to this interface, if this
* interface is bound to a driver that uses the USB major number. * interface is bound to a driver that uses the USB major number.
...@@ -118,7 +117,6 @@ struct usb_interface { ...@@ -118,7 +117,6 @@ struct usb_interface {
unsigned act_altsetting; /* active alternate setting */ unsigned act_altsetting; /* active alternate setting */
unsigned num_altsetting; /* number of alternate settings */ unsigned num_altsetting; /* number of alternate settings */
unsigned max_altsetting; /* total memory allocated */
struct usb_driver *driver; /* driver */ struct usb_driver *driver; /* driver */
int minor; /* minor number this interface is bound to */ int minor; /* minor number this interface is bound to */
......
...@@ -72,9 +72,9 @@ struct usb_request { ...@@ -72,9 +72,9 @@ struct usb_request {
unsigned length; unsigned length;
dma_addr_t dma; dma_addr_t dma;
unsigned no_interrupt : 1, unsigned no_interrupt:1;
zero : 1, unsigned zero:1;
short_not_ok : 1; unsigned short_not_ok:1;
void (*complete)(struct usb_ep *ep, void (*complete)(struct usb_ep *ep,
struct usb_request *req); struct usb_request *req);
...@@ -122,9 +122,11 @@ struct usb_ep_ops { ...@@ -122,9 +122,11 @@ struct usb_ep_ops {
/** /**
* struct usb_ep - device side representation of USB endpoint * struct usb_ep - device side representation of USB endpoint
* @name:identifier for the endpoint, such as "ep-a" or "ep9in-bulk" * @name:identifier for the endpoint, such as "ep-a" or "ep9in-bulk"
* @ops: Function pointers used to access hardware-specific operations.
* @ep_list:the gadget's ep_list holds all of its endpoints * @ep_list:the gadget's ep_list holds all of its endpoints
* @maxpacket:the maximum packet size used on this endpoint, as * @maxpacket:The maximum packet size used on this endpoint. The initial
* configured when the endpoint was enabled. * value can sometimes be reduced (hardware allowing), according to
* the endpoint descriptor used to configure the endpoint.
* @driver_data:for use by the gadget driver. all other fields are * @driver_data:for use by the gadget driver. all other fields are
* read-only to gadget drivers. * read-only to gadget drivers.
* *
...@@ -138,7 +140,7 @@ struct usb_ep { ...@@ -138,7 +140,7 @@ struct usb_ep {
const char *name; const char *name;
const struct usb_ep_ops *ops; const struct usb_ep_ops *ops;
struct list_head ep_list; struct list_head ep_list;
unsigned maxpacket : 16; unsigned maxpacket:16;
}; };
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -443,18 +445,21 @@ struct usb_gadget_ops { ...@@ -443,18 +445,21 @@ struct usb_gadget_ops {
/** /**
* struct usb_gadget - represents a usb slave device * struct usb_gadget - represents a usb slave device
* @ops: Function pointers used to access hardware-specific operations.
* @ep0: Endpoint zero, used when reading or writing responses to * @ep0: Endpoint zero, used when reading or writing responses to
* driver setup() requests * driver setup() requests
* @ep_list: List of other endpoints supported by the device. * @ep_list: List of other endpoints supported by the device.
* @speed: Speed of current connection to USB host. * @speed: Speed of current connection to USB host.
* @name: Identifies the controller hardware type. Used in diagnostics * @name: Identifies the controller hardware type. Used in diagnostics
* and sometimes configuration. * and sometimes configuration.
* @dev: Driver model state for this abstract device.
* *
* Gadgets have a mostly-portable "gadget driver" implementing device * Gadgets have a mostly-portable "gadget driver" implementing device
* functions, handling all usb configurations and interfaces. They * functions, handling all usb configurations and interfaces. Gadget
* also have a hardware-specific driver (accessed through ops vectors), * drivers talk to hardware-specific code indirectly, through ops vectors.
* which insulates the gadget driver from hardware details and packages * That insulates the gadget driver from hardware details, and packages
* the hardware endpoints through generic i/o queues. * the hardware endpoints through generic i/o queues. The "usb_gadget"
* and "usb_ep" interfaces provide that insulation from the hardware.
* *
* Except for the driver data, all fields in this structure are * Except for the driver data, all fields in this structure are
* read-only to the gadget driver. That driver data is part of the * read-only to the gadget driver. That driver data is part of the
...@@ -469,10 +474,6 @@ struct usb_gadget { ...@@ -469,10 +474,6 @@ struct usb_gadget {
struct list_head ep_list; /* of usb_ep */ struct list_head ep_list; /* of usb_ep */
enum usb_device_speed speed; enum usb_device_speed speed;
const char *name; const char *name;
/* use this to allocate dma-coherent buffers or set up
* dma mappings. or print diagnostics, etc.
*/
struct device dev; struct device dev;
}; };
...@@ -576,6 +577,7 @@ usb_gadget_clear_selfpowered (struct usb_gadget *gadget) ...@@ -576,6 +577,7 @@ usb_gadget_clear_selfpowered (struct usb_gadget *gadget)
* Called in a context that permits sleeping. * Called in a context that permits sleeping.
* @suspend: Invoked on USB suspend. May be called in_interrupt. * @suspend: Invoked on USB suspend. May be called in_interrupt.
* @resume: Invoked on USB resume. May be called in_interrupt. * @resume: Invoked on USB resume. May be called in_interrupt.
* @driver: Driver model state for this driver.
* *
* Devices are disabled till a gadget driver successfully bind()s, which * Devices are disabled till a gadget driver successfully bind()s, which
* means the driver will handle setup() requests needed to enumerate (and * means the driver will handle setup() requests needed to enumerate (and
......
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