Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6:
  [PATCH] USB: fix omninet driver bug
  [PATCH] USB: add ark3116 usb to serial driver
  [PATCH] usbserial: Fixes leak in serial_open() error path.
  [PATCH] usbserial: Fixes use-after-free in serial_open().
  [PATCH] USB: Emagic USB firmware loading fixes
  [PATCH] USB: add an IBM USB keyboard to the HID_QUIRK_NOGET blacklist
  [PATCH] USB: Add Sieraa Wireless 580 evdo card to airprime.c
  [PATCH] USB: ftdi_sio: add device id for ACT Solutions HomePro ZWave interface
  [PATCH] USB: ftdi_sio: Add support for HCG HF Dual ISO RFID Reader
  [PATCH] USB: ub oops in block_uevent
  [PATCH] USB: usbcore: don't check the device's power source
  [PATCH] USB: fix OHCI PM regression
  [PATCH] USB: pegasus fixes (logstorm, suspend)
  [PATCH] USBATM: fix modinfo output
  [PATCH] USBATM: change the default speedtouch iso altsetting
  [PATCH] USB: fix bug in ohci-hcd.c ohci_restart()
  • Loading branch information
Linus Torvalds committed May 12, 2006
2 parents 1a2acc9 + df3fccb commit 0d38edd
Show file tree
Hide file tree
Showing 19 changed files with 569 additions and 49 deletions.
18 changes: 10 additions & 8 deletions drivers/block/ub.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,9 @@ static void ub_cleanup(struct ub_dev *sc)
kfree(lun);
}

usb_set_intfdata(sc->intf, NULL);
usb_put_intf(sc->intf);
usb_put_dev(sc->dev);
kfree(sc);
}

Expand Down Expand Up @@ -2221,7 +2224,12 @@ static int ub_probe(struct usb_interface *intf,
// sc->ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
usb_set_intfdata(intf, sc);
usb_get_dev(sc->dev);
// usb_get_intf(sc->intf); /* Do we need this? */
/*
* Since we give the interface struct to the block level through
* disk->driverfs_dev, we have to pin it. Otherwise, block_uevent
* oopses on close after a disconnect (kernels 2.6.16 and up).
*/
usb_get_intf(sc->intf);

snprintf(sc->name, 12, DRV_NAME "(%d.%d)",
sc->dev->bus->busnum, sc->dev->devnum);
Expand Down Expand Up @@ -2286,7 +2294,7 @@ static int ub_probe(struct usb_interface *intf,

err_dev_desc:
usb_set_intfdata(intf, NULL);
// usb_put_intf(sc->intf);
usb_put_intf(sc->intf);
usb_put_dev(sc->dev);
kfree(sc);
err_core:
Expand Down Expand Up @@ -2461,12 +2469,6 @@ static void ub_disconnect(struct usb_interface *intf)
* and no URBs left in transit.
*/

usb_set_intfdata(intf, NULL);
// usb_put_intf(sc->intf);
sc->intf = NULL;
usb_put_dev(sc->dev);
sc->dev = NULL;

ub_put(sc);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/atm/speedtch.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static const char speedtch_driver_name[] = "speedtch";
#define RESUBMIT_DELAY 1000 /* milliseconds */

#define DEFAULT_BULK_ALTSETTING 1
#define DEFAULT_ISOC_ALTSETTING 2
#define DEFAULT_ISOC_ALTSETTING 3
#define DEFAULT_DL_512_FIRST 0
#define DEFAULT_ENABLE_ISOC 0
#define DEFAULT_SW_BUFFERING 0
Expand Down
8 changes: 4 additions & 4 deletions drivers/usb/atm/usbatm.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ static const char usbatm_driver_name[] = "usbatm";

#define UDSL_MAX_RCV_URBS 16
#define UDSL_MAX_SND_URBS 16
#define UDSL_MAX_BUF_SIZE 64 * 1024 /* bytes */
#define UDSL_MAX_BUF_SIZE 65536
#define UDSL_DEFAULT_RCV_URBS 4
#define UDSL_DEFAULT_SND_URBS 4
#define UDSL_DEFAULT_RCV_BUF_SIZE 64 * ATM_CELL_SIZE /* bytes */
#define UDSL_DEFAULT_SND_BUF_SIZE 64 * ATM_CELL_SIZE /* bytes */
#define UDSL_DEFAULT_RCV_BUF_SIZE 3392 /* 64 * ATM_CELL_SIZE */
#define UDSL_DEFAULT_SND_BUF_SIZE 3392 /* 64 * ATM_CELL_SIZE */

#define ATM_CELL_HEADER (ATM_CELL_SIZE - ATM_CELL_PAYLOAD)

Expand Down Expand Up @@ -135,7 +135,7 @@ MODULE_PARM_DESC(rcv_buf_bytes,
module_param(snd_buf_bytes, uint, S_IRUGO);
MODULE_PARM_DESC(snd_buf_bytes,
"Size of the buffers used for transmission, in bytes (range: 1-"
__MODULE_STRING(UDSL_MAX_SND_BUF_SIZE) ", default: "
__MODULE_STRING(UDSL_MAX_BUF_SIZE) ", default: "
__MODULE_STRING(UDSL_DEFAULT_SND_BUF_SIZE) ")");


Expand Down
13 changes: 6 additions & 7 deletions drivers/usb/core/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1805,6 +1805,12 @@ int usb_add_hcd(struct usb_hcd *hcd,
USB_SPEED_FULL;
hcd->self.root_hub = rhdev;

/* wakeup flag init defaults to "everything works" for root hubs,
* but drivers can override it in reset() if needed, along with
* recording the overall controller's system wakeup capability.
*/
device_init_wakeup(&rhdev->dev, 1);

/* "reset" is misnamed; its role is now one-time init. the controller
* should already have been reset (and boot firmware kicked off etc).
*/
Expand All @@ -1813,13 +1819,6 @@ int usb_add_hcd(struct usb_hcd *hcd,
goto err_hcd_driver_setup;
}

/* wakeup flag init is in transition; for now we can't rely on PCI to
* initialize these bits properly, so we let reset() override it.
* This init should _precede_ the reset() once PCI behaves.
*/
device_init_wakeup(&rhdev->dev,
device_can_wakeup(hcd->self.controller));

/* NOTE: root hub and controller capabilities may not be the same */
if (device_can_wakeup(hcd->self.controller)
&& device_can_wakeup(&hcd->self.root_hub->dev))
Expand Down
23 changes: 13 additions & 10 deletions drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1168,19 +1168,9 @@ static inline const char *plural(int n)
static int choose_configuration(struct usb_device *udev)
{
int i;
u16 devstatus;
int bus_powered;
int num_configs;
struct usb_host_config *c, *best;

/* If this fails, assume the device is bus-powered */
devstatus = 0;
usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus);
le16_to_cpus(&devstatus);
bus_powered = ((devstatus & (1 << USB_DEVICE_SELF_POWERED)) == 0);
dev_dbg(&udev->dev, "device is %s-powered\n",
bus_powered ? "bus" : "self");

best = NULL;
c = udev->config;
num_configs = udev->descriptor.bNumConfigurations;
Expand All @@ -1197,6 +1187,19 @@ static int choose_configuration(struct usb_device *udev)
* similar errors in their descriptors. If the next test
* were allowed to execute, such configurations would always
* be rejected and the devices would not work as expected.
* In the meantime, we run the risk of selecting a config
* that requires external power at a time when that power
* isn't available. It seems to be the lesser of two evils.
*
* Bugzilla #6448 reports a device that appears to crash
* when it receives a GET_DEVICE_STATUS request! We don't
* have any other way to tell whether a device is self-powered,
* but since we don't use that information anywhere but here,
* the call has been removed.
*
* Maybe the GET_DEVICE_STATUS call and the test below can
* be reinstated when device firmwares become more reliable.
* Don't hold your breath.
*/
#if 0
/* Rule out self-powered configs for a bus-powered device */
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ohci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ static int ohci_restart (struct ohci_hcd *ohci)
i = ohci->num_ports;
while (i--)
ohci_writel (ohci, RH_PS_PSS,
&ohci->regs->roothub.portstatus [temp]);
&ohci->regs->roothub.portstatus [i]);
ohci_dbg (ohci, "restart complete\n");
}
return 0;
Expand Down
4 changes: 4 additions & 0 deletions drivers/usb/input/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,9 @@ void hid_init_reports(struct hid_device *hid)
#define USB_VENDOR_ID_HP 0x03f0
#define USB_DEVICE_ID_HP_USBHUB_KB 0x020c

#define USB_VENDOR_ID_IBM 0x04b3
#define USB_DEVICE_ID_IBM_USBHUB_KB 0x3005

#define USB_VENDOR_ID_CREATIVELABS 0x062a
#define USB_DEVICE_ID_CREATIVELABS_SILVERCREST 0x0201

Expand Down Expand Up @@ -1681,6 +1684,7 @@ static const struct hid_blacklist {
{ USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_USBHUB_KB, HID_QUIRK_NOGET},
{ USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVELABS_SILVERCREST, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_IBM, USB_DEVICE_ID_IBM_USBHUB_KB, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
{ USB_VENDOR_ID_SILVERCREST, USB_DEVICE_ID_SILVERCREST_KB, HID_QUIRK_NOGET },
Expand Down
4 changes: 4 additions & 0 deletions drivers/usb/misc/emi26.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/usb.h>
#include <linux/delay.h>

#define MAX_INTEL_HEX_RECORD_LENGTH 16
typedef struct _INTEL_HEX_RECORD
Expand Down Expand Up @@ -114,6 +115,7 @@ static int emi26_load_firmware (struct usb_device *dev)

/* De-assert reset (let the CPU run) */
err = emi26_set_reset(dev,0);
msleep(250); /* let device settle */

/* 2. We upload the FPGA firmware into the EMI
* Note: collect up to 1023 (yes!) bytes and send them with
Expand Down Expand Up @@ -150,6 +152,7 @@ static int emi26_load_firmware (struct usb_device *dev)
goto wraperr;
}
}
msleep(250); /* let device settle */

/* De-assert reset (let the CPU run) */
err = emi26_set_reset(dev,0);
Expand Down Expand Up @@ -192,6 +195,7 @@ static int emi26_load_firmware (struct usb_device *dev)
err("%s - error loading firmware: error = %d", __FUNCTION__, err);
goto wraperr;
}
msleep(250); /* let device settle */

/* return 1 to fail the driver inialization
* and give real driver change to load */
Expand Down
4 changes: 4 additions & 0 deletions drivers/usb/misc/emi62.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/usb.h>
#include <linux/delay.h>

#define MAX_INTEL_HEX_RECORD_LENGTH 16
typedef struct _INTEL_HEX_RECORD
Expand Down Expand Up @@ -123,6 +124,7 @@ static int emi62_load_firmware (struct usb_device *dev)

/* De-assert reset (let the CPU run) */
err = emi62_set_reset(dev,0);
msleep(250); /* let device settle */

/* 2. We upload the FPGA firmware into the EMI
* Note: collect up to 1023 (yes!) bytes and send them with
Expand Down Expand Up @@ -166,6 +168,7 @@ static int emi62_load_firmware (struct usb_device *dev)
err("%s - error loading firmware: error = %d", __FUNCTION__, err);
goto wraperr;
}
msleep(250); /* let device settle */

/* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */

Expand Down Expand Up @@ -228,6 +231,7 @@ static int emi62_load_firmware (struct usb_device *dev)
err("%s - error loading firmware: error = %d", __FUNCTION__, err);
goto wraperr;
}
msleep(250); /* let device settle */

kfree(buf);

Expand Down
20 changes: 15 additions & 5 deletions drivers/usb/net/pegasus.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd)
set_register(pegasus, PhyCtrl, (indx | PHY_READ));
for (i = 0; i < REG_TIMEOUT; i++) {
ret = get_registers(pegasus, PhyCtrl, 1, data);
if (ret == -ESHUTDOWN)
goto fail;
if (data[0] & PHY_DONE)
break;
}
Expand All @@ -326,6 +328,7 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd)
*regd = le16_to_cpu(regdi);
return ret;
}
fail:
if (netif_msg_drv(pegasus))
dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);

Expand Down Expand Up @@ -354,12 +357,15 @@ static int write_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 regd)
set_register(pegasus, PhyCtrl, (indx | PHY_WRITE));
for (i = 0; i < REG_TIMEOUT; i++) {
ret = get_registers(pegasus, PhyCtrl, 1, data);
if (ret == -ESHUTDOWN)
goto fail;
if (data[0] & PHY_DONE)
break;
}
if (i < REG_TIMEOUT)
return ret;

fail:
if (netif_msg_drv(pegasus))
dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
return -ETIMEDOUT;
Expand Down Expand Up @@ -387,13 +393,16 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata)
ret = get_registers(pegasus, EpromCtrl, 1, &tmp);
if (tmp & EPROM_DONE)
break;
if (ret == -ESHUTDOWN)
goto fail;
}
if (i < REG_TIMEOUT) {
ret = get_registers(pegasus, EpromData, 2, &retdatai);
*retdata = le16_to_cpu(retdatai);
return ret;
}

fail:
if (netif_msg_drv(pegasus))
dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
return -ETIMEDOUT;
Expand Down Expand Up @@ -433,12 +442,15 @@ static int write_eprom_word(pegasus_t * pegasus, __u8 index, __u16 data)

for (i = 0; i < REG_TIMEOUT; i++) {
ret = get_registers(pegasus, EpromCtrl, 1, &tmp);
if (ret == -ESHUTDOWN)
goto fail;
if (tmp & EPROM_DONE)
break;
}
disable_eprom_write(pegasus);
if (i < REG_TIMEOUT)
return ret;
fail:
if (netif_msg_drv(pegasus))
dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
return -ETIMEDOUT;
Expand Down Expand Up @@ -1378,9 +1390,8 @@ static int pegasus_suspend (struct usb_interface *intf, pm_message_t message)
struct pegasus *pegasus = usb_get_intfdata(intf);

netif_device_detach (pegasus->net);
cancel_delayed_work(&pegasus->carrier_check);
if (netif_running(pegasus->net)) {
cancel_delayed_work(&pegasus->carrier_check);

usb_kill_urb(pegasus->rx_urb);
usb_kill_urb(pegasus->intr_urb);
}
Expand All @@ -1400,10 +1411,9 @@ static int pegasus_resume (struct usb_interface *intf)
pegasus->intr_urb->status = 0;
pegasus->intr_urb->actual_length = 0;
intr_callback(pegasus->intr_urb, NULL);

queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check,
CARRIER_CHECK_DELAY);
}
queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check,
CARRIER_CHECK_DELAY);
return 0;
}

Expand Down
10 changes: 10 additions & 0 deletions drivers/usb/serial/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ config USB_SERIAL_ANYDATA
To compile this driver as a module, choose M here: the
module will be called anydata.

config USB_SERIAL_ARK3116
tristate "USB ARK Micro 3116 USB Serial Driver (EXPERIMENTAL)"
depends on USB_SERIAL && EXPERIMENTAL
help
Say Y here if you want to use a ARK Micro 3116 USB to Serial
device.

To compile this driver as a module, choose M here: the
module will be called ark3116

config USB_SERIAL_BELKIN
tristate "USB Belkin and Peracom Single Port Serial Driver"
depends on USB_SERIAL
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/serial/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y)

obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o
obj-$(CONFIG_USB_SERIAL_ANYDATA) += anydata.o
obj-$(CONFIG_USB_SERIAL_ARK3116) += ark3116.o
obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o
obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o
obj-$(CONFIG_USB_SERIAL_CYBERJACK) += cyberjack.o
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/serial/airprime.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
static struct usb_device_id id_table [] = {
{ USB_DEVICE(0xf3d, 0x0112) }, /* AirPrime CDMA Wireless PC Card */
{ USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */
{ USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless Aircard 580 */
{ },
};
MODULE_DEVICE_TABLE(usb, id_table);
Expand Down
Loading

0 comments on commit 0d38edd

Please sign in to comment.