Commit c8931e4d authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/gregkh/linux/linus-2.6

into home.osdl.org:/home/torvalds/v2.5/linux
parents d6170cab 527542c6
......@@ -35,7 +35,6 @@ obj-$(CONFIG_USB_SE401) += media/
obj-$(CONFIG_USB_STV680) += media/
obj-$(CONFIG_USB_VICAM) += media/
obj-$(CONFIG_USB_AX8817X) += net/
obj-$(CONFIG_USB_CATC) += net/
obj-$(CONFIG_USB_KAWETH) += net/
obj-$(CONFIG_USB_PEGASUS) += net/
......
obj-$(CONFIG_USB_AX8817X) += crc32.o
obj-$(CONFIG_USB_CATC) += crc32.o
obj-$(CONFIG_USB_SPEEDTOUCH) += crc32.o
obj-$(CONFIG_USB_USBNET) += crc32.o
......@@ -1750,7 +1750,7 @@ static int alloc_usb_midi_device( struct usb_device *d, struct usb_midi_state *s
return 0;
error_end:
if ( mdevs != NULL && devices > 0 ) {
if ( mdevs != NULL ) {
for ( i=0 ; i<devices ; i++ ) {
if ( mdevs[i] != NULL ) {
unregister_sound_midi( mdevs[i]->dev_midi );
......
......@@ -237,9 +237,6 @@ int usb_parse_configuration(struct usb_host_config *config, char *buffer, int si
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);
}
/* Go through the descriptors, checking their length and counting the
......
......@@ -23,22 +23,44 @@
#include "usb.h"
/* Active configuration fields */
#define usb_actconfig_attr(field, format_string) \
#define usb_actconfig_show(field, format_string) \
static ssize_t \
show_##field (struct device *dev, char *buf) \
{ \
struct usb_device *udev; \
\
udev = to_usb_device (dev); \
if (udev->actconfig) \
return sprintf (buf, format_string, udev->actconfig->desc.field); \
else return 0; \
} \
#define usb_actconfig_attr(field, format_string) \
usb_actconfig_show(field,format_string) \
static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL);
usb_actconfig_attr (bNumInterfaces, "%2d\n")
usb_actconfig_attr (bConfigurationValue, "%2d\n")
usb_actconfig_attr (bmAttributes, "%2x\n")
usb_actconfig_attr (bMaxPower, "%3dmA\n")
/* configuration value is always present, and r/w */
usb_actconfig_show(bConfigurationValue,"%u\n");
static ssize_t
set_bConfigurationValue (struct device *dev, const char *buf, size_t count)
{
struct usb_device *udev = udev = to_usb_device (dev);
int config, value;
if (sscanf (buf, "%u", &config) != 1 || config > 255)
return -EINVAL;
value = usb_set_configuration (udev, config);
return (value < 0) ? value : count;
}
static DEVICE_ATTR(bConfigurationValue, S_IRUGO | S_IWUSR,
show_bConfigurationValue, set_bConfigurationValue);
/* String fields */
static ssize_t show_product (struct device *dev, char *buf)
{
......
......@@ -273,17 +273,17 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, u32 state)
int retval = 0;
hcd = pci_get_drvdata(dev);
dev_dbg (hcd->controller, "suspend D%d --> D%d\n",
dev->current_state, state);
switch (hcd->state) {
case USB_STATE_HALT:
dev_dbg (hcd->controller, "halted; hcd not suspended\n");
break;
case USB_STATE_SUSPENDED:
dev_dbg (hcd->controller, "suspend D%d --> D%d\n",
dev->current_state, state);
dev_dbg (hcd->controller, "hcd already suspended\n");
break;
default:
dev_dbg (hcd->controller, "suspend to state %d\n", state);
/* remote wakeup needs hub->suspend() cooperation */
// pci_enable_wake (dev, 3, 1);
......@@ -292,6 +292,9 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, u32 state)
/* driver may want to disable DMA etc */
hcd->state = USB_STATE_QUIESCING;
retval = hcd->driver->suspend (hcd, state);
if (retval)
dev_dbg (hcd->controller, "suspend fail, retval %d\n",
retval);
}
pci_set_power_state (dev, state);
......@@ -311,6 +314,9 @@ int usb_hcd_pci_resume (struct pci_dev *dev)
int retval;
hcd = pci_get_drvdata(dev);
dev_dbg (hcd->controller, "resume from state D%d\n",
dev->current_state);
if (hcd->state != USB_STATE_SUSPENDED) {
dev_dbg (hcd->controller, "can't resume, not suspended!\n");
return -EL3HLT;
......
......@@ -781,18 +781,40 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf)
* @skip_ep0: 0 to disable endpoint 0, 1 to skip it.
*
* Disables all the device's endpoints, potentially including endpoint 0.
* Deallocates hcd/hardware state for the endpoints ... and nukes all
* pending urbs.
* Deallocates hcd/hardware state for the endpoints (nuking all or most
* pending urbs) and usbcore state for the interfaces, so that usbcore
* must usb_set_configuration() before any interfaces could be used.
*/
void usb_disable_device(struct usb_device *dev, int skip_ep0)
{
int i;
dbg("nuking URBs for device %s", dev->dev.bus_id);
dev_dbg(&dev->dev, "%s nuking %s URBs\n", __FUNCTION__,
skip_ep0 ? "non-ep0" : "all");
for (i = skip_ep0; i < 16; ++i) {
usb_disable_endpoint(dev, i);
usb_disable_endpoint(dev, i + USB_DIR_IN);
}
dev->toggle[0] = dev->toggle[1] = 0;
dev->halted[0] = dev->halted[1] = 0;
/* getting rid of interfaces will disconnect
* any drivers bound to them (a key side effect)
*/
if (dev->actconfig) {
for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
struct usb_interface *interface;
/* remove this interface */
interface = dev->actconfig->interface[i];
dev_dbg (&dev->dev, "unregistering interface %s\n",
interface->dev.bus_id);
device_del(&interface->dev);
}
dev->actconfig = 0;
if (dev->state == USB_STATE_CONFIGURED)
dev->state = USB_STATE_ADDRESS;
}
}
......@@ -979,6 +1001,9 @@ int usb_reset_configuration(struct usb_device *dev)
int i, retval;
struct usb_host_config *config;
/* dev->serialize guards all config changes */
down(&dev->serialize);
for (i = 1; i < 16; ++i) {
usb_disable_endpoint(dev, i);
usb_disable_endpoint(dev, i + USB_DIR_IN);
......@@ -989,8 +1014,10 @@ int usb_reset_configuration(struct usb_device *dev)
USB_REQ_SET_CONFIGURATION, 0,
config->desc.bConfigurationValue, 0,
NULL, 0, HZ * USB_CTRL_SET_TIMEOUT);
if (retval < 0)
return retval;
if (retval < 0) {
dev->state = USB_STATE_ADDRESS;
goto done;
}
dev->toggle[0] = dev->toggle[1] = 0;
dev->halted[0] = dev->halted[1] = 0;
......@@ -1002,7 +1029,9 @@ int usb_reset_configuration(struct usb_device *dev)
intf->act_altsetting = 0;
usb_enable_interface(dev, intf);
}
return 0;
done:
up(&dev->serialize);
return (retval < 0) ? retval : 0;
}
/**
......@@ -1012,72 +1041,105 @@ int usb_reset_configuration(struct usb_device *dev)
* Context: !in_interrupt ()
*
* This is used to enable non-default device modes. Not all devices
* support this kind of configurability. By default, configuration
* zero is selected after enumeration; many devices only have a single
* use this kind of configurability; many devices only have one
* configuration.
*
* USB devices may support one or more configurations, which affect
* USB device configurations may affect Linux interoperability,
* power consumption and the functionality available. For example,
* the default configuration is limited to using 100mA of bus power,
* so that when certain device functionality requires more power,
* and the device is bus powered, that functionality will be in some
* and the device is bus powered, that functionality should be in some
* non-default device configuration. Other device modes may also be
* reflected as configuration options, such as whether two ISDN
* channels are presented as independent 64Kb/s interfaces or as one
* bonded 128Kb/s interface.
* channels are available independently; and choosing between open
* standard device protocols (like CDC) or proprietary ones.
*
* Note that USB has an additional level of device configurability,
* associated with interfaces. That configurability is accessed using
* usb_set_interface().
*
* This call is synchronous, and may not be used in an interrupt context.
* This call is synchronous. The calling context must be able to sleep,
* and must not hold the driver model lock for USB; usb device driver
* probe() methods may not use this routine.
*
* Returns zero on success, or else the status code returned by the
* underlying usb_control_msg() call.
* underlying call that failed. On succesful completion, each interface
* in the original device configuration has been destroyed, and each one
* in the new configuration has been probed by all relevant usb device
* drivers currently known to the kernel.
*/
int usb_set_configuration(struct usb_device *dev, int configuration)
{
int i, ret;
struct usb_host_config *cp = NULL;
/* dev->serialize guards all config changes */
down(&dev->serialize);
for (i=0; i<dev->descriptor.bNumConfigurations; i++) {
if (dev->config[i].desc.bConfigurationValue == configuration) {
cp = &dev->config[i];
break;
}
}
if ((!cp && configuration != 0) || (cp && configuration == 0)) {
warn("selecting invalid configuration %d", configuration);
return -EINVAL;
if ((!cp && configuration != 0)) {
ret = -EINVAL;
goto out;
}
if (cp && configuration == 0)
dev_warn(&dev->dev, "config 0 descriptor??\n");
/* if it's already configured, clear out old state first. */
/* if it's already configured, clear out old state first.
* getting rid of old interfaces means unbinding their drivers.
*/
if (dev->state != USB_STATE_ADDRESS)
usb_disable_device (dev, 1); // Skip ep0
dev->toggle[0] = dev->toggle[1] = 0;
dev->halted[0] = dev->halted[1] = 0;
dev->state = USB_STATE_ADDRESS;
if ((ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
USB_REQ_SET_CONFIGURATION, 0, configuration, 0,
NULL, 0, HZ * USB_CTRL_SET_TIMEOUT)) < 0)
return ret;
if (configuration)
dev->state = USB_STATE_CONFIGURED;
goto out;
dev->actconfig = cp;
if (!configuration)
dev->state = USB_STATE_ADDRESS;
else {
dev->state = USB_STATE_CONFIGURED;
/* reset more hc/hcd interface/endpoint state */
/* re-initialize hc/hcd/usbcore interface/endpoint state.
* this triggers binding of drivers to interfaces; and
* maybe probe() calls will choose different altsettings.
*/
for (i = 0; i < cp->desc.bNumInterfaces; ++i) {
struct usb_interface *intf = cp->interface[i];
struct usb_interface_descriptor *desc;
intf->act_altsetting = 0;
desc = &intf->altsetting [0].desc;
usb_enable_interface(dev, intf);
intf->dev.parent = &dev->dev;
intf->dev.driver = NULL;
intf->dev.bus = &usb_bus_type;
intf->dev.dma_mask = dev->dev.dma_mask;
sprintf (&intf->dev.bus_id[0], "%d-%s:%d.%d",
dev->bus->busnum, dev->devpath,
configuration,
desc->bInterfaceNumber);
dev_dbg (&dev->dev,
"registering %s (config #%d, interface %d)\n",
intf->dev.bus_id, configuration,
desc->bInterfaceNumber);
device_add (&intf->dev);
usb_create_driverfs_intf_files (intf);
}
}
return 0;
out:
up(&dev->serialize);
return ret;
}
/**
* usb_string - returns ISO 8859-1 version of a string descriptor
* @dev: the device whose string descriptor is being retrieved
......
......@@ -898,6 +898,7 @@ void usb_disconnect(struct usb_device **pdev)
* this device will fail.
*/
dev->state = USB_STATE_NOTATTACHED;
down(&dev->serialize);
dev_info (&dev->dev, "USB disconnect, address %d\n", dev->devnum);
......@@ -908,32 +909,19 @@ void usb_disconnect(struct usb_device **pdev)
usb_disconnect(child);
}
/* deallocate hcd/hardware state ... and nuke all pending urbs */
/* deallocate hcd/hardware state ... nuking all pending urbs and
* cleaning up all state associated with the current configuration
*/
usb_disable_device(dev, 0);
/* disconnect() drivers from interfaces (a key side effect) */
dev_dbg (&dev->dev, "unregistering interfaces\n");
if (dev->actconfig) {
for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
struct usb_interface *interface;
/* remove this interface */
interface = dev->actconfig->interface[i];
device_unregister(&interface->dev);
}
}
dev_dbg (&dev->dev, "unregistering device\n");
/* Free the device number and remove the /proc/bus/usb entry */
if (dev->devnum > 0) {
clear_bit(dev->devnum, dev->bus->devmap.devicemap);
usbfs_remove_device(dev);
}
up(&dev->serialize);
device_unregister(&dev->dev);
/* Decrement the reference count, it'll auto free everything when */
/* it hits 0 which could very well be now */
usb_put_dev(dev);
}
/**
......@@ -1017,7 +1005,6 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
dev->dev.driver = &usb_generic_driver;
dev->dev.bus = &usb_bus_type;
dev->dev.driver_data = &usb_generic_driver_data;
usb_get_dev(dev);
if (dev->dev.bus_id[0] == 0)
sprintf (&dev->dev.bus_id[0], "%d-%s",
dev->bus->busnum, dev->devpath);
......@@ -1090,27 +1077,12 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
err = usb_get_configuration(dev);
if (err < 0) {
dev_err(&dev->dev, "unable to get device %d configuration (error=%d)\n",
dev->devnum, err);
dev_err(&dev->dev, "can't read configurations, error %d\n",
err);
goto fail;
}
/* choose and set the configuration here */
if (dev->descriptor.bNumConfigurations != 1) {
dev_info(&dev->dev,
"configuration #%d chosen from %d choices\n",
dev->config[0].desc.bConfigurationValue,
dev->descriptor.bNumConfigurations);
}
err = usb_set_configuration(dev, dev->config[0].desc.bConfigurationValue);
if (err) {
dev_err(&dev->dev, "failed to set device %d default configuration (error=%d)\n",
dev->devnum, err);
goto fail;
}
/* USB device state == configured ... tell the world! */
/* Tell the world! */
dev_dbg(&dev->dev, "new device strings: Mfr=%d, Product=%d, SerialNumber=%d\n",
dev->descriptor.iManufacturer, dev->descriptor.iProduct, dev->descriptor.iSerialNumber);
......@@ -1123,30 +1095,32 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
usb_show_string(dev, "SerialNumber", dev->descriptor.iSerialNumber);
#endif
/* put into sysfs, with device and config specific files */
/* put device-specific files into sysfs */
err = device_add (&dev->dev);
if (err)
if (err) {
dev_err(&dev->dev, "can't device_add, error %d\n", err);
goto fail;
}
usb_create_driverfs_dev_files (dev);
/* Register all of the interfaces for this device with the driver core.
* Remember, interfaces get bound to drivers, not devices. */
for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
struct usb_interface *interface = dev->actconfig->interface[i];
struct usb_interface_descriptor *desc;
desc = &interface->altsetting [interface->act_altsetting].desc;
interface->dev.parent = &dev->dev;
interface->dev.driver = NULL;
interface->dev.bus = &usb_bus_type;
interface->dev.dma_mask = parent->dma_mask;
sprintf (&interface->dev.bus_id[0], "%d-%s:%d",
dev->bus->busnum, dev->devpath,
desc->bInterfaceNumber);
dev_dbg (&dev->dev, "%s - registering interface %s\n", __FUNCTION__, interface->dev.bus_id);
device_add (&interface->dev);
usb_create_driverfs_intf_files (interface);
/* choose and set the configuration. that registers the interfaces
* with the driver core, and lets usb device drivers bind to them.
*/
if (dev->descriptor.bNumConfigurations != 1) {
dev_info(&dev->dev,
"configuration #%d chosen from %d choices\n",
dev->config[0].desc.bConfigurationValue,
dev->descriptor.bNumConfigurations);
}
err = usb_set_configuration(dev,
dev->config[0].desc.bConfigurationValue);
if (err) {
dev_err(&dev->dev, "can't set config #%d, error %d\n",
dev->config[0].desc.bConfigurationValue, err);
goto fail;
}
/* USB device state == configured ... usable */
/* add a /proc/bus/usb entry */
usbfs_add_device(dev);
......@@ -1156,7 +1130,6 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
dev->state = USB_STATE_DEFAULT;
clear_bit(dev->devnum, dev->bus->devmap.devicemap);
dev->devnum = -1;
usb_put_dev(dev);
return err;
}
......
This diff is collapsed.
......@@ -354,6 +354,7 @@ static ssize_t
ep_io (struct ep_data *epdata, void *buf, unsigned len)
{
DECLARE_COMPLETION (done);
int value;
spin_lock_irq (&epdata->dev->lock);
if (likely (epdata->ep != NULL)) {
......@@ -363,14 +364,12 @@ ep_io (struct ep_data *epdata, void *buf, unsigned len)
req->complete = epio_complete;
req->buf = buf;
req->length = len;
epdata->status = usb_ep_queue (epdata->ep, req, GFP_ATOMIC);
value = usb_ep_queue (epdata->ep, req, GFP_ATOMIC);
} else
epdata->status = -ENODEV;
value = -ENODEV;
spin_unlock_irq (&epdata->dev->lock);
if (epdata->status == 0) {
int value;
if (likely (value == 0)) {
value = wait_event_interruptible (done.wait, done.done);
if (value != 0) {
spin_lock_irq (&epdata->dev->lock);
......@@ -378,17 +377,21 @@ ep_io (struct ep_data *epdata, void *buf, unsigned len)
DBG (epdata->dev, "%s i/o interrupted\n",
epdata->name);
usb_ep_dequeue (epdata->ep, epdata->req);
spin_unlock_irq (&epdata->dev->lock);
wait_event (done.wait, done.done);
if (epdata->status == 0)
epdata->status = value;
if (epdata->status == -ECONNRESET)
epdata->status = -EINTR;
} else {
spin_unlock_irq (&epdata->dev->lock);
DBG (epdata->dev, "endpoint gone\n");
epdata->status = -ENODEV;
}
spin_unlock_irq (&epdata->dev->lock);
}
}
return epdata->status;
}
return value;
}
......@@ -424,10 +427,12 @@ ep_read (struct file *fd, char *buf, size_t len, loff_t *ptr)
if (unlikely (!kbuf))
goto free1;
VDEBUG (data->dev, "%s read %d OUT\n", data->name, len);
value = ep_io (data, kbuf, len);
VDEBUG (data->dev, "%s read %d OUT, status %d\n",
data->name, len, value);
if (value >= 0 && copy_to_user (buf, kbuf, value))
value = -EFAULT;
free1:
up (&data->lock);
kfree (kbuf);
......@@ -470,8 +475,9 @@ ep_write (struct file *fd, const char *buf, size_t len, loff_t *ptr)
goto free1;
}
VDEBUG (data->dev, "%s write %d IN\n", data->name, len);
value = ep_io (data, kbuf, len);
VDEBUG (data->dev, "%s write %d IN, status %d\n",
data->name, len, value);
free1:
up (&data->lock);
kfree (kbuf);
......@@ -1200,9 +1206,11 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
if (value >= 0)
value = min (ctrl->wLength, (u16) value);
break;
default:
case USB_DT_STRING:
goto unrecognized;
default: // all others are errors
break;
}
break;
......
......@@ -1965,13 +1965,11 @@ static void reset_hc(struct uhci_hcd *uhci)
outw(USBCMD_GRESET, io_addr + USBCMD);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((HZ*50+999) / 1000);
set_current_state(TASK_RUNNING);
outw(0, io_addr + USBCMD);
/* Another 10ms delay */
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((HZ*10+999) / 1000);
set_current_state(TASK_RUNNING);
uhci->resume_detect = 0;
}
......
/* -*- linux-c -*- */
/*
* Driver for USB Scanners (linux-2.5)
* Driver for USB Scanners (linux-2.6)
*
* Copyright (C) 1999, 2000, 2001, 2002 David E. Nelson
* Copyright (C) 2002, 2003 Henning Meier-Geinitz
......@@ -369,6 +369,18 @@
* - Added vendor/product ids for Avision, Canon, HP, Microtek and Relisys scanners.
* - Clean up irq urb when not enough memory is available.
*
* 0.4.15 2003-09-22
* - Use static declarations for usb_scanner_init/usb_scanner_exit
* (Daniele Bellucci).
* - Report back return codes of usb_register and usb_usbmit_urb instead of -1 or
* -ENONMEM (Daniele Bellucci).
* - Balancing usb_register_dev/usb_deregister_dev in probe_scanner when a fail
* condition occours (Daniele Bellucci).
* - Added vendor/product ids for Canon, HP, Microtek, Mustek, Siemens, UMAX, and
* Visioneer scanners.
* - Added test for USB_CLASS_CDC_DATA which is used by some fingerprint scanners.
*
*
* TODO
* - Performance
* - Select/poll methods
......@@ -950,6 +962,7 @@ probe_scanner(struct usb_interface *intf,
if (interface[0].desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC &&
interface[0].desc.bInterfaceClass != USB_CLASS_PER_INTERFACE &&
interface[0].desc.bInterfaceClass != USB_CLASS_CDC_DATA &&
interface[0].desc.bInterfaceClass != SCN_CLASS_SCANJET) {
dbg("probe_scanner: This interface doesn't look like a scanner (class=0x%x).", interface[0].desc.bInterfaceClass);
return -ENODEV;
......@@ -1043,6 +1056,7 @@ probe_scanner(struct usb_interface *intf,
scn->scn_irq = usb_alloc_urb(0, GFP_KERNEL);
if (!scn->scn_irq) {
usb_deregister_dev(intf, &scanner_class);
kfree(scn);
up(&scn_mutex);
return -ENOMEM;
......@@ -1061,11 +1075,13 @@ probe_scanner(struct usb_interface *intf,
// endpoint[(int)have_intr].bInterval);
250);
if (usb_submit_urb(scn->scn_irq, GFP_KERNEL)) {
retval = usb_submit_urb(scn->scn_irq, GFP_KERNEL);
if (retval) {
err("probe_scanner(%d): Unable to allocate INT URB.", intf->minor);
usb_deregister_dev(intf, &scanner_class);
kfree(scn);
up(&scn_mutex);
return -ENOMEM;
return retval;
}
}
......@@ -1076,6 +1092,7 @@ probe_scanner(struct usb_interface *intf,
if (have_intr)
usb_unlink_urb(scn->scn_irq);
usb_free_urb(scn->scn_irq);
usb_deregister_dev(intf, &scanner_class);
kfree(scn);
up(&scn_mutex);
return -ENOMEM;
......@@ -1087,6 +1104,7 @@ probe_scanner(struct usb_interface *intf,
if (have_intr)
usb_unlink_urb(scn->scn_irq);
usb_free_urb(scn->scn_irq);
usb_deregister_dev(intf, &scanner_class);
kfree(scn->obuf);
kfree(scn);
up(&scn_mutex);
......@@ -1169,22 +1187,25 @@ usb_driver scanner_driver = {
.id_table = ids,
};
void __exit
static void __exit
usb_scanner_exit(void)
{
usb_deregister(&scanner_driver);
}
int __init
static int __init
usb_scanner_init (void)
{
if (usb_register(&scanner_driver) < 0)
return -1;
int retval;
retval = usb_register(&scanner_driver);
if (retval)
goto out;
info(DRIVER_VERSION ":" DRIVER_DESC);
if (vendor != -1 && product != -1)
info("probe_scanner: User specified USB scanner -- Vendor:Product - %x:%x", vendor, product);
return 0;
out:
return retval;
}
module_init(usb_scanner_init);
......
/*
* Driver for USB Scanners (linux-2.5)
* Driver for USB Scanners (linux-2.6)
*
* Copyright (C) 1999, 2000, 2001, 2002 David E. Nelson
* Previously maintained by Brian Beattie
......@@ -43,7 +43,7 @@
// #define DEBUG
#define DRIVER_VERSION "0.4.14"
#define DRIVER_VERSION "0.4.15"
#define DRIVER_DESC "USB Scanner Driver"
#include <linux/usb.h>
......@@ -122,7 +122,10 @@ static struct usb_device_id scanner_device_ids [] = {
{ USB_DEVICE(0x04a9, 0x220d) }, /* CanoScan N670U/N676U/LIDE 20 */
{ USB_DEVICE(0x04a9, 0x220e) }, /* CanoScan N1240U/LIDE 30 */
{ USB_DEVICE(0x04a9, 0x220f) }, /* CanoScan 8000F */
{ USB_DEVICE(0x04a9, 0x2210) }, /* CanoScan 9900F */
{ USB_DEVICE(0x04a9, 0x2212) }, /* CanoScan 5000F */
{ USB_DEVICE(0x04a9, 0x2213) }, /* LIDE 50 */
{ USB_DEVICE(0x04a9, 0x2215) }, /* CanoScan 3000 */
{ USB_DEVICE(0x04a9, 0x3042) }, /* FS4000US */
/* Colorado -- See Primax/Colorado below */
/* Compaq */
......@@ -158,7 +161,9 @@ static struct usb_device_id scanner_device_ids [] = {
// { USB_DEVICE(0x03f0, 0x0701) }, /* ScanJet 5300C - NOT SUPPORTED - use hpusbscsi driver */
{ USB_DEVICE(0x03f0, 0x0705) }, /* ScanJet 4400C */
// { USB_DEVICE(0x03f0, 0x0801) }, /* ScanJet 7400C - NOT SUPPORTED - use hpusbscsi driver */
{ USB_DEVICE(0x03f0, 0x0805) }, /* ScanJet 4470c */
{ USB_DEVICE(0x03f0, 0x0901) }, /* ScanJet 2300C */
{ USB_DEVICE(0x03f0, 0x0a01) }, /* ScanJet 2400c */
{ USB_DEVICE(0x03F0, 0x1005) }, /* ScanJet 5400C */
{ USB_DEVICE(0x03F0, 0x1105) }, /* ScanJet 5470C */
{ USB_DEVICE(0x03f0, 0x1205) }, /* ScanJet 5550C */
......@@ -177,9 +182,11 @@ static struct usb_device_id scanner_device_ids [] = {
/* Memorex */
{ USB_DEVICE(0x0461, 0x0346) }, /* 6136u - repackaged Primax ? */
/* Microtek */
{ USB_DEVICE(0x05da, 0x20a7) }, /* ScanMaker 5600 */
{ USB_DEVICE(0x05da, 0x20c9) }, /* ScanMaker 6700 */
{ USB_DEVICE(0x05da, 0x30ce) }, /* ScanMaker 3800 */
{ USB_DEVICE(0x05da, 0x30cf) }, /* ScanMaker 4800 */
{ USB_DEVICE(0x05da, 0x30d4) }, /* ScanMaker 3830 + 3840 */
{ USB_DEVICE(0x04a7, 0x0224) }, /* Scanport 3000 (actually Visioneer?)*/
/* The following SCSI-over-USB Microtek devices are supported by the
microtek driver: Enable SCSI and USB Microtek in kernel config */
......@@ -214,6 +221,7 @@ static struct usb_device_id scanner_device_ids [] = {
{ USB_DEVICE(0x055f, 0x021e) }, /* BearPaw 1200 TA/CS */
{ USB_DEVICE(0x055f, 0x0400) }, /* BearPaw 2400 TA PRO */
{ USB_DEVICE(0x055f, 0x0401) }, /* P 3600 A3 Pro */
{ USB_DEVICE(0x055f, 0x0409) }, /* BearPaw 2448TA Pro */
{ USB_DEVICE(0x055f, 0x0873) }, /* ScanExpress 600 USB */
{ USB_DEVICE(0x055f, 0x1000) }, /* BearPaw 4800 TA PRO */
// { USB_DEVICE(0x05d8, 0x4002) }, /* BearPaw 1200 CU and ScanExpress 1200 UB Plus (see Artec) */
......@@ -279,6 +287,9 @@ static struct usb_device_id scanner_device_ids [] = {
{ USB_DEVICE(0x04b8, 0x011e) }, /* Perfection 1660 Photo */
{ USB_DEVICE(0x04b8, 0x0801) }, /* Stylus CX5200 */
{ USB_DEVICE(0x04b8, 0x0802) }, /* Stylus CX3200 */
/* Siemens */
{ USB_DEVICE(0x0681, 0x0005) }, /* ID Mouse Professional */
{ USB_DEVICE(0x0681, 0x0010) }, /* Cherry FingerTIP ID Board - Sensor */
/* SYSCAN */
{ USB_DEVICE(0x0a82, 0x4600) }, /* TravelScan 460/464 */
/* Trust */
......@@ -289,6 +300,7 @@ static struct usb_device_id scanner_device_ids [] = {
{ USB_DEVICE(0x1606, 0x0010) }, /* Astra 1220U */
{ USB_DEVICE(0x1606, 0x0030) }, /* Astra 2000U */
{ USB_DEVICE(0x1606, 0x0060) }, /* Astra 3400U/3450U */
{ USB_DEVICE(0x1606, 0x0070) }, /* Astra 4400 */
{ USB_DEVICE(0x1606, 0x0130) }, /* Astra 2100U */
{ USB_DEVICE(0x1606, 0x0160) }, /* Astra 5400U */
{ USB_DEVICE(0x1606, 0x0230) }, /* Astra 2200U */
......@@ -296,7 +308,8 @@ static struct usb_device_id scanner_device_ids [] = {
{ USB_DEVICE(0x04a7, 0x0211) }, /* OneTouch 7600 USB */
{ USB_DEVICE(0x04a7, 0x0221) }, /* OneTouch 5300 USB */
{ USB_DEVICE(0x04a7, 0x0224) }, /* OneTouch 4800 USB */
{ USB_DEVICE(0x04a7, 0x0226) }, /* OneTouch 5300 USB */
{ USB_DEVICE(0x04a7, 0x0226) }, /* OneTouch 5800 USB */
{ USB_DEVICE(0x04a7, 0x022c) }, /* OneTouch 9020 USB */
{ USB_DEVICE(0x04a7, 0x0231) }, /* 6100 USB */
{ USB_DEVICE(0x04a7, 0x0311) }, /* 6200 EPP/USB */
{ USB_DEVICE(0x04a7, 0x0321) }, /* OneTouch 8100 EPP/USB */
......
......@@ -112,8 +112,8 @@ config USB_MOUSE
depends on USB && INPUT
---help---
Say Y here only if you are absolutely sure that you don't want
to use the generic HID driver for your USB keyboard and prefer
to use the keyboard in its limited Boot Protocol mode instead.
to use the generic HID driver for your USB mouse and prefer
to use the mouse in its limited Boot Protocol mode instead.
This is almost certainly not what you want. This is mostly
useful for embedded applications or simple mice.
......
......@@ -7,25 +7,6 @@ comment "USB Network adaptors"
comment "Networking support is needed for USB Networking device support"
depends on USB && !NET
config USB_AX8817X_STANDALONE
tristate "USB ASIX AX8817X Ethernet device support (EXPERIMENTAL)"
depends on USB && NET && EXPERIMENTAL
---help---
Say Y if you want to use one of the following 10/100Mps USB
Ethernet devices based on the ASIX AX88172 chip. Supported
devices are:
ASIX AX88172
D-Link DUB-E100
Hawking UF200
Netgear FA120
This driver makes the adapter appear as a normal Ethernet interface,
typically on eth0, if it is the only ethernet device, or perhaps on
eth1, if you have a PCI or ISA ethernet card installed.
To compile this driver as a module, choose M here: the
module will be called ax8817x.
config USB_CATC
tristate "USB CATC NetMate-based Ethernet device support (EXPERIMENTAL)"
depends on USB && NET && EXPERIMENTAL
......
......@@ -2,7 +2,6 @@
# Makefile for USB Network drivers
#
obj-$(CONFIG_USB_AX8817X_STANDALONE) += ax8817x.o
obj-$(CONFIG_USB_CATC) += catc.o
obj-$(CONFIG_USB_KAWETH) += kaweth.o
obj-$(CONFIG_USB_PEGASUS) += pegasus.o
......
......@@ -2,6 +2,5 @@
# Makefile for USB Network drivers which require generic MII code.
#
obj-$(CONFIG_USB_AX8817X) += mii.o
obj-$(CONFIG_USB_PEGASUS) += mii.o
obj-$(CONFIG_USB_USBNET) += mii.o
This diff is collapsed.
......@@ -594,8 +594,6 @@ static inline long cond_wait_interruptible_timeout_irqrestore(
timeout = schedule_timeout(timeout);
set_current_state( TASK_RUNNING );
remove_wait_queue( q, &wait );
return( timeout );
......
......@@ -17,6 +17,11 @@
* See http://ftdi-usb-sio.sourceforge.net for upto date testing info
* and extra documentation
*
* (21/Sep/2003) Ian Abbott
* Added VID/PID for Omnidirectional Control Technology US101 USB to
* RS-232 adapter (also rebadged as Dick Smith Electronics XH6381).
* VID/PID supplied by Donald Gordon.
*
* (19/Aug/2003) Ian Abbott
* Freed urb's transfer buffer in write bulk callback.
* Omitted some paranoid checks in write bulk callback that don't matter.
......@@ -334,6 +339,7 @@ static struct usb_device_id id_table_8U232AM [] = {
{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_7_PID, 0, 0x3ff) },
{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_8_PID, 0, 0x3ff) },
{ USB_DEVICE_VER(IDTECH_VID, IDTECH_IDT1221U_PID, 0, 0x3ff) },
{ USB_DEVICE_VER(OCT_VID, OCT_US101_PID, 0, 0x3ff) },
{ } /* Terminating entry */
};
......@@ -406,6 +412,7 @@ static struct usb_device_id id_table_FT232BM [] = {
{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_7_PID, 0x400, 0xffff) },
{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_8_PID, 0x400, 0xffff) },
{ USB_DEVICE_VER(IDTECH_VID, IDTECH_IDT1221U_PID, 0x400, 0xffff) },
{ USB_DEVICE_VER(OCT_VID, OCT_US101_PID, 0x400, 0xffff) },
{ } /* Terminating entry */
};
......@@ -491,6 +498,7 @@ static struct usb_device_id id_table_combined [] = {
{ USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_7_PID) },
{ USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_8_PID) },
{ USB_DEVICE(IDTECH_VID, IDTECH_IDT1221U_PID) },
{ USB_DEVICE(OCT_VID, OCT_US101_PID) },
{ USB_DEVICE_VER(FTDI_VID, FTDI_HE_TIRA1_PID, 0x400, 0xffff) },
{ USB_DEVICE(FTDI_VID, FTDI_USB_UIRT_PID) },
{ } /* Terminating entry */
......
......@@ -133,6 +133,13 @@
#define IDTECH_VID 0x0ACD /* ID TECH Vendor ID */
#define IDTECH_IDT1221U_PID 0x0300 /* IDT1221U USB to RS-232 adapter */
/*
* Definitions for Omnidirectional Control Technology, Inc. devices
*/
#define OCT_VID 0x0B39 /* OCT vendor ID */
/* Note: OCT US101 is also rebadged as Dick Smith Electronics (NZ) XH6381 */
#define OCT_US101_PID 0x0421 /* OCT US101 USB to RS-232 */
/* Commands */
#define FTDI_SIO_RESET 0 /* Reset the port */
#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
......
......@@ -1019,10 +1019,10 @@ int usb_serial_probe(struct usb_interface *interface,
retval = type->probe (serial, id_pattern);
module_put(type->owner);
if (retval < 0) {
if (retval) {
dbg ("sub driver rejected device");
kfree (serial);
return -ENODEV;
return retval;
}
}
......
......@@ -1074,7 +1074,6 @@ static int usb_stor_reset_common(struct us_data *us,
up(&us->dev_semaphore);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(HZ*6);
set_current_state(TASK_RUNNING);
down(&us->dev_semaphore);
if (test_bit(US_FLIDX_DISCONNECTING, &us->flags)) {
US_DEBUGP("Reset interrupted by disconnect\n");
......
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