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: (34 commits)
  USB Storage: remove duplicate Nokia entry in unusual_devs.h
  [PATCH] bluetooth: add support for another Kensington dongle
  [PATCH] usb serial: add support for Novatel S720/U720 CDMA/EV-DO modems
  [PATCH] USB: Nokia E70 is an unusual device
  USB: fix to usbfs_snoop logging of user defined control urbs
  USB: at91_udc: Additional checks
  USB: at91_udc: Cleanup variables after failure in usb_gadget_register_driver()
  USB: at91_udc: allow drivers that support high speed
  USB: u132-hcd/ftdi-elan: add support for Option GT 3G Quad card
  USB: at91_udc, misc fixes
  USB: at91 udc, support at91sam926x addresses
  USB: OHCI support for PNX8550
  USB: ohci handles hardware faults during root port resets
  USB: ohci at91 warning fix
  USB: ohci whitespace/comment fixups
  USB: MAINTAINERS update, EHCI and OHCI
  USB: gadget driver unbind() is optional; section fixes; misc
  UHCI: module parameter to ignore overcurrent changes
  USB: Nokia E70 is an unusual device
  USB AUERSWALD: replace kmalloc+memset with kzalloc
  ...
  • Loading branch information
Linus Torvalds committed Dec 21, 2006
2 parents 5576d18 + c305290 commit fb34d20
Show file tree
Hide file tree
Showing 55 changed files with 1,195 additions and 932 deletions.
8 changes: 8 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1714,6 +1714,14 @@ and is between 256 and 4096 characters. It is defined in the file
uart6850= [HW,OSS]
Format: <io>,<irq>

uhci-hcd.ignore_oc=
[USB] Ignore overcurrent events (default N).
Some badly-designed motherboards generate lots of
bogus events, for ports that aren't wired to
anything. Set this parameter to avoid log spamming.
Note that genuine overcurrent events won't be
reported either.

usbhid.mousepoll=
[USBHID] The interval which mice are to be polled at.

Expand Down
8 changes: 4 additions & 4 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3130,7 +3130,7 @@ USB EHCI DRIVER
P: David Brownell
M: dbrownell@users.sourceforge.net
L: linux-usb-devel@lists.sourceforge.net
S: Maintained
S: Odd Fixes

USB ET61X[12]51 DRIVER
P: Luca Risolia
Expand Down Expand Up @@ -3183,11 +3183,11 @@ S: Maintained
W: http://www.one-eyed-alien.net/~mdharm/linux-usb/

USB OHCI DRIVER
P: Roman Weissgaerber
M: weissg@vienna.at
P: David Brownell
M: dbrownell@users.sourceforge.net
L: linux-usb-users@lists.sourceforge.net
L: linux-usb-devel@lists.sourceforge.net
S: Maintained
S: Odd Fixes

USB OPTION-CARD DRIVER
P: Matthias Urlichs
Expand Down
1 change: 1 addition & 0 deletions drivers/bluetooth/hci_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ static struct usb_device_id blacklist_ids[] = {

/* Kensington Bluetooth USB adapter */
{ USB_DEVICE(0x047d, 0x105d), .driver_info = HCI_RESET },
{ USB_DEVICE(0x047d, 0x105e), .driver_info = HCI_WRONG_SCO_MTU },

/* ISSC Bluetooth Adapter v3.1 */
{ USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET },
Expand Down
54 changes: 29 additions & 25 deletions drivers/usb/class/usblp.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ MFG:HEWLETT-PACKARD;MDL:DESKJET 970C;CMD:MLC,PCL,PML;CLASS:PRINTER;DESCRIPTION:H

struct usblp {
struct usb_device *dev; /* USB device */
struct semaphore sem; /* locks this struct, especially "dev" */
struct mutex mut; /* locks this struct, especially "dev" */
char *writebuf; /* write transfer_buffer */
char *readbuf; /* read transfer_buffer */
char *statusbuf; /* status transfer_buffer */
Expand Down Expand Up @@ -465,7 +465,7 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
int twoints[2];
int retval = 0;

down (&usblp->sem);
mutex_lock (&usblp->mut);
if (!usblp->present) {
retval = -ENODEV;
goto done;
Expand Down Expand Up @@ -644,14 +644,14 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
}

done:
up (&usblp->sem);
mutex_unlock (&usblp->mut);
return retval;
}

static ssize_t usblp_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
{
struct usblp *usblp = file->private_data;
int timeout, rv, err = 0, transfer_length = 0;
int timeout, intr, rv, err = 0, transfer_length = 0;
size_t writecount = 0;

while (writecount < count) {
Expand All @@ -668,14 +668,16 @@ static ssize_t usblp_write(struct file *file, const char __user *buffer, size_t
if (rv < 0)
return writecount ? writecount : -EINTR;
}
down (&usblp->sem);
intr = mutex_lock_interruptible (&usblp->mut);
if (intr)
return writecount ? writecount : -EINTR;
if (!usblp->present) {
up (&usblp->sem);
mutex_unlock (&usblp->mut);
return -ENODEV;
}

if (usblp->sleeping) {
up (&usblp->sem);
mutex_unlock (&usblp->mut);
return writecount ? writecount : -ENODEV;
}

Expand All @@ -687,10 +689,10 @@ static ssize_t usblp_write(struct file *file, const char __user *buffer, size_t
err = usblp->writeurb->status;
} else
err = usblp_check_status(usblp, err);
up (&usblp->sem);
mutex_unlock (&usblp->mut);

/* if the fault was due to disconnect, let khubd's
* call to usblp_disconnect() grab usblp->sem ...
* call to usblp_disconnect() grab usblp->mut ...
*/
schedule ();
continue;
Expand All @@ -702,7 +704,7 @@ static ssize_t usblp_write(struct file *file, const char __user *buffer, size_t
*/
writecount += transfer_length;
if (writecount == count) {
up(&usblp->sem);
mutex_unlock(&usblp->mut);
break;
}

Expand All @@ -714,7 +716,7 @@ static ssize_t usblp_write(struct file *file, const char __user *buffer, size_t

if (copy_from_user(usblp->writeurb->transfer_buffer,
buffer + writecount, transfer_length)) {
up(&usblp->sem);
mutex_unlock(&usblp->mut);
return writecount ? writecount : -EFAULT;
}

Expand All @@ -727,10 +729,10 @@ static ssize_t usblp_write(struct file *file, const char __user *buffer, size_t
count = -EIO;
else
count = writecount ? writecount : -ENOMEM;
up (&usblp->sem);
mutex_unlock (&usblp->mut);
break;
}
up (&usblp->sem);
mutex_unlock (&usblp->mut);
}

return count;
Expand All @@ -739,12 +741,14 @@ static ssize_t usblp_write(struct file *file, const char __user *buffer, size_t
static ssize_t usblp_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
{
struct usblp *usblp = file->private_data;
int rv;
int rv, intr;

if (!usblp->bidir)
return -EINVAL;

down (&usblp->sem);
intr = mutex_lock_interruptible (&usblp->mut);
if (intr)
return -EINTR;
if (!usblp->present) {
count = -ENODEV;
goto done;
Expand All @@ -757,9 +761,9 @@ static ssize_t usblp_read(struct file *file, char __user *buffer, size_t count,
count = -EAGAIN;
goto done;
}
up(&usblp->sem);
mutex_unlock(&usblp->mut);
rv = wait_event_interruptible(usblp->wait, usblp->rcomplete || !usblp->present);
down(&usblp->sem);
mutex_lock(&usblp->mut);
if (rv < 0) {
count = -EINTR;
goto done;
Expand Down Expand Up @@ -807,7 +811,7 @@ static ssize_t usblp_read(struct file *file, char __user *buffer, size_t count,
}

done:
up (&usblp->sem);
mutex_unlock (&usblp->mut);
return count;
}

Expand Down Expand Up @@ -886,7 +890,7 @@ static int usblp_probe(struct usb_interface *intf,
goto abort;
}
usblp->dev = dev;
init_MUTEX (&usblp->sem);
mutex_init (&usblp->mut);
init_waitqueue_head(&usblp->wait);
usblp->ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
usblp->intf = intf;
Expand Down Expand Up @@ -1178,7 +1182,7 @@ static void usblp_disconnect(struct usb_interface *intf)
device_remove_file(&intf->dev, &dev_attr_ieee1284_id);

mutex_lock (&usblp_mutex);
down (&usblp->sem);
mutex_lock (&usblp->mut);
usblp->present = 0;
usb_set_intfdata (intf, NULL);

Expand All @@ -1187,7 +1191,7 @@ static void usblp_disconnect(struct usb_interface *intf)
usblp->writebuf, usblp->writeurb->transfer_dma);
usb_buffer_free (usblp->dev, USBLP_BUF_SIZE,
usblp->readbuf, usblp->readurb->transfer_dma);
up (&usblp->sem);
mutex_unlock (&usblp->mut);

if (!usblp->used)
usblp_cleanup (usblp);
Expand All @@ -1200,11 +1204,11 @@ static int usblp_suspend (struct usb_interface *intf, pm_message_t message)

/* this races against normal access and open */
mutex_lock (&usblp_mutex);
down (&usblp->sem);
mutex_lock (&usblp->mut);
/* we take no more IO */
usblp->sleeping = 1;
usblp_unlink_urbs(usblp);
up (&usblp->sem);
mutex_unlock (&usblp->mut);
mutex_unlock (&usblp_mutex);

return 0;
Expand All @@ -1216,12 +1220,12 @@ static int usblp_resume (struct usb_interface *intf)
int r;

mutex_lock (&usblp_mutex);
down (&usblp->sem);
mutex_lock (&usblp->mut);

usblp->sleeping = 0;
r = handle_bidir (usblp);

up (&usblp->sem);
mutex_unlock (&usblp->mut);
mutex_unlock (&usblp_mutex);

return r;
Expand Down
6 changes: 5 additions & 1 deletion drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,11 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
kfree(dr);
return -EFAULT;
}
snoop(&ps->dev->dev, "control urb\n");
snoop(&ps->dev->dev, "control urb: bRequest=%02x "
"bRrequestType=%02x wValue=%04x "
"wIndex=%04x wLength=%04x\n",
dr->bRequest, dr->bRequestType, dr->wValue,
dr->wIndex, dr->wLength);
break;

case USBDEVFS_URB_TYPE_BULK:
Expand Down
Loading

0 comments on commit fb34d20

Please sign in to comment.