You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (97 commits) USB: qcserial: add device id for HP devices USB: isp1760: Add a delay before reading the SKIPMAP registers in isp1760-hcd.c USB: allow malformed LANGID descriptors USB: pxa27x_udc: typo fixes and code cleanups USB: gadget: gadget zero uses new suspend/resume hooks USB: gadget: composite device-level suspend/resume hooks USB: r8a66597-hcd: suspend/resume support USB: more u32 conversion after transfer_buffer_length and actual_length USB: Fix cp2101 USB serial device driver termios functions for console use USB: CP2101 New Device ID USB: ipaq: handle 4 endpoint devices USB: S3C: Move usb-control.h to platform include USB: ohci-hcd: Add ARCH_S3C24XX to the ohci-s3c2410.c glue USB: pedantic: spelling correction in comment for ch9.h USB: host: fix sparse warning: Using plain integer as NULL pointer USB: ohci-s3c2410: fix name of bus clock USB: ohci-s3c2410: remove <mach/hardware.h> include USB: serial: rename cp2101 driver to cp210x USB: CP2101 Reduce Error Logging USB: CP2101 Support AN205 baud rates ...
This commit is contained in:
@@ -229,16 +229,26 @@ struct usbmon_packet {
|
||||
int status; /* 28: */
|
||||
unsigned int length; /* 32: Length of data (submitted or actual) */
|
||||
unsigned int len_cap; /* 36: Delivered length */
|
||||
unsigned char setup[8]; /* 40: Only for Control 'S' */
|
||||
}; /* 48 bytes total */
|
||||
union { /* 40: */
|
||||
unsigned char setup[SETUP_LEN]; /* Only for Control S-type */
|
||||
struct iso_rec { /* Only for ISO */
|
||||
int error_count;
|
||||
int numdesc;
|
||||
} iso;
|
||||
} s;
|
||||
int interval; /* 48: Only for Interrupt and ISO */
|
||||
int start_frame; /* 52: For ISO */
|
||||
unsigned int xfer_flags; /* 56: copy of URB's transfer_flags */
|
||||
unsigned int ndesc; /* 60: Actual number of ISO descriptors */
|
||||
}; /* 64 total length */
|
||||
|
||||
These events can be received from a character device by reading with read(2),
|
||||
with an ioctl(2), or by accessing the buffer with mmap.
|
||||
with an ioctl(2), or by accessing the buffer with mmap. However, read(2)
|
||||
only returns first 48 bytes for compatibility reasons.
|
||||
|
||||
The character device is usually called /dev/usbmonN, where N is the USB bus
|
||||
number. Number zero (/dev/usbmon0) is special and means "all buses".
|
||||
However, this feature is not implemented yet. Note that specific naming
|
||||
policy is set by your Linux distribution.
|
||||
Note that specific naming policy is set by your Linux distribution.
|
||||
|
||||
If you create /dev/usbmon0 by hand, make sure that it is owned by root
|
||||
and has mode 0600. Otherwise, unpriviledged users will be able to snoop
|
||||
@@ -279,9 +289,10 @@ size is out of [unspecified] bounds for this kernel, the call fails with
|
||||
This call returns the current size of the buffer in bytes.
|
||||
|
||||
MON_IOCX_GET, defined as _IOW(MON_IOC_MAGIC, 6, struct mon_get_arg)
|
||||
MON_IOCX_GETX, defined as _IOW(MON_IOC_MAGIC, 10, struct mon_get_arg)
|
||||
|
||||
This call waits for events to arrive if none were in the kernel buffer,
|
||||
then returns the first event. Its argument is a pointer to the following
|
||||
These calls wait for events to arrive if none were in the kernel buffer,
|
||||
then return the first event. The argument is a pointer to the following
|
||||
structure:
|
||||
|
||||
struct mon_get_arg {
|
||||
@@ -294,6 +305,8 @@ Before the call, hdr, data, and alloc should be filled. Upon return, the area
|
||||
pointed by hdr contains the next event structure, and the data buffer contains
|
||||
the data, if any. The event is removed from the kernel buffer.
|
||||
|
||||
The MON_IOCX_GET copies 48 bytes, MON_IOCX_GETX copies 64 bytes.
|
||||
|
||||
MON_IOCX_MFETCH, defined as _IOWR(MON_IOC_MAGIC, 7, struct mon_mfetch_arg)
|
||||
|
||||
This ioctl is primarily used when the application accesses the buffer
|
||||
|
||||
@@ -29,13 +29,14 @@
|
||||
|
||||
#include <mach/bast-map.h>
|
||||
#include <mach/bast-irq.h>
|
||||
#include <mach/usb-control.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
#include <plat/usb-control.h>
|
||||
#include <plat/devs.h>
|
||||
|
||||
#include "usb-simtec.h"
|
||||
|
||||
/* control power and monitor over-current events on various Simtec
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
/* arch/arm/mach-s3c2410/include/mach/usb-control.h
|
||||
/* arch/arm/plat-s3c/include/plat/usb-control.h
|
||||
*
|
||||
* Copyright (c) 2004 Simtec Electronics
|
||||
* Ben Dooks <ben@simtec.co.uk>
|
||||
*
|
||||
* S3C2410 - usb port information
|
||||
* S3C - USB host port information
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_USBCONTROL_H
|
||||
#define __ASM_ARCH_USBCONTROL_H "arch/arm/mach-s3c2410/include/mach/usb-control.h"
|
||||
#define __ASM_ARCH_USBCONTROL_H
|
||||
|
||||
#define S3C_HCDFLG_USED (1)
|
||||
|
||||
+5
-6
@@ -391,7 +391,7 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum);
|
||||
*/
|
||||
#ifdef CONFIG_USB_LIBUSUAL
|
||||
|
||||
#define ub_usb_ids storage_usb_ids
|
||||
#define ub_usb_ids usb_storage_usb_ids
|
||||
#else
|
||||
|
||||
static struct usb_device_id ub_usb_ids[] = {
|
||||
@@ -2146,10 +2146,9 @@ static int ub_get_pipes(struct ub_dev *sc, struct usb_device *dev,
|
||||
ep = &altsetting->endpoint[i].desc;
|
||||
|
||||
/* Is it a BULK endpoint? */
|
||||
if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
|
||||
== USB_ENDPOINT_XFER_BULK) {
|
||||
if (usb_endpoint_xfer_bulk(ep)) {
|
||||
/* BULK in or out? */
|
||||
if (ep->bEndpointAddress & USB_DIR_IN) {
|
||||
if (usb_endpoint_dir_in(ep)) {
|
||||
if (ep_in == NULL)
|
||||
ep_in = ep;
|
||||
} else {
|
||||
@@ -2168,9 +2167,9 @@ static int ub_get_pipes(struct ub_dev *sc, struct usb_device *dev,
|
||||
sc->send_ctrl_pipe = usb_sndctrlpipe(dev, 0);
|
||||
sc->recv_ctrl_pipe = usb_rcvctrlpipe(dev, 0);
|
||||
sc->send_bulk_pipe = usb_sndbulkpipe(dev,
|
||||
ep_out->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK);
|
||||
usb_endpoint_num(ep_out));
|
||||
sc->recv_bulk_pipe = usb_rcvbulkpipe(dev,
|
||||
ep_in->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK);
|
||||
usb_endpoint_num(ep_in));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ obj-$(CONFIG_USB_SL811_HCD) += host/
|
||||
obj-$(CONFIG_USB_U132_HCD) += host/
|
||||
obj-$(CONFIG_USB_R8A66597_HCD) += host/
|
||||
obj-$(CONFIG_USB_HWA_HCD) += host/
|
||||
obj-$(CONFIG_USB_ISP1760_HCD) += host/
|
||||
|
||||
obj-$(CONFIG_USB_C67X00_HCD) += c67x00/
|
||||
|
||||
|
||||
@@ -880,16 +880,19 @@ static int usblp_wwait(struct usblp *usblp, int nonblock)
|
||||
if (rc <= 0)
|
||||
break;
|
||||
|
||||
if (schedule_timeout(msecs_to_jiffies(1500)) == 0) {
|
||||
if (usblp->flags & LP_ABORT) {
|
||||
if (schedule_timeout(msecs_to_jiffies(5000)) == 0) {
|
||||
err = usblp_check_status(usblp, err);
|
||||
if (err == 1) { /* Paper out */
|
||||
rc = -ENOSPC;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
schedule();
|
||||
/* Prod the printer, Gentoo#251237. */
|
||||
mutex_lock(&usblp->mut);
|
||||
usblp_read_status(usblp, usblp->statusbuf);
|
||||
mutex_unlock(&usblp->mut);
|
||||
}
|
||||
}
|
||||
}
|
||||
set_current_state(TASK_RUNNING);
|
||||
|
||||
@@ -187,7 +187,7 @@ static char *usb_dump_endpoint_descriptor(int speed, char *start, char *end,
|
||||
}
|
||||
|
||||
/* this isn't checking for illegal values */
|
||||
switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
|
||||
switch (usb_endpoint_type(desc)) {
|
||||
case USB_ENDPOINT_XFER_CONTROL:
|
||||
type = "Ctrl";
|
||||
if (speed == USB_SPEED_HIGH) /* uframes per NAK */
|
||||
|
||||
+11
-10
@@ -104,7 +104,7 @@ MODULE_PARM_DESC(usbfs_snoop, "true to log all usbfs traffic");
|
||||
|
||||
#define MAX_USBFS_BUFFER_SIZE 16384
|
||||
|
||||
static inline int connected(struct dev_state *ps)
|
||||
static int connected(struct dev_state *ps)
|
||||
{
|
||||
return (!list_empty(&ps->list) &&
|
||||
ps->dev->state != USB_STATE_NOTATTACHED);
|
||||
@@ -248,7 +248,7 @@ static void free_async(struct async *as)
|
||||
kfree(as);
|
||||
}
|
||||
|
||||
static inline void async_newpending(struct async *as)
|
||||
static void async_newpending(struct async *as)
|
||||
{
|
||||
struct dev_state *ps = as->ps;
|
||||
unsigned long flags;
|
||||
@@ -258,7 +258,7 @@ static inline void async_newpending(struct async *as)
|
||||
spin_unlock_irqrestore(&ps->lock, flags);
|
||||
}
|
||||
|
||||
static inline void async_removepending(struct async *as)
|
||||
static void async_removepending(struct async *as)
|
||||
{
|
||||
struct dev_state *ps = as->ps;
|
||||
unsigned long flags;
|
||||
@@ -268,7 +268,7 @@ static inline void async_removepending(struct async *as)
|
||||
spin_unlock_irqrestore(&ps->lock, flags);
|
||||
}
|
||||
|
||||
static inline struct async *async_getcompleted(struct dev_state *ps)
|
||||
static struct async *async_getcompleted(struct dev_state *ps)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct async *as = NULL;
|
||||
@@ -283,7 +283,7 @@ static inline struct async *async_getcompleted(struct dev_state *ps)
|
||||
return as;
|
||||
}
|
||||
|
||||
static inline struct async *async_getpending(struct dev_state *ps,
|
||||
static struct async *async_getpending(struct dev_state *ps,
|
||||
void __user *userurb)
|
||||
{
|
||||
unsigned long flags;
|
||||
@@ -302,7 +302,7 @@ static inline struct async *async_getpending(struct dev_state *ps,
|
||||
|
||||
static void snoop_urb(struct urb *urb, void __user *userurb)
|
||||
{
|
||||
int j;
|
||||
unsigned j;
|
||||
unsigned char *data = urb->transfer_buffer;
|
||||
|
||||
if (!usbfs_snoop)
|
||||
@@ -311,9 +311,9 @@ static void snoop_urb(struct urb *urb, void __user *userurb)
|
||||
dev_info(&urb->dev->dev, "direction=%s\n",
|
||||
usb_urb_dir_in(urb) ? "IN" : "OUT");
|
||||
dev_info(&urb->dev->dev, "userurb=%p\n", userurb);
|
||||
dev_info(&urb->dev->dev, "transfer_buffer_length=%d\n",
|
||||
dev_info(&urb->dev->dev, "transfer_buffer_length=%u\n",
|
||||
urb->transfer_buffer_length);
|
||||
dev_info(&urb->dev->dev, "actual_length=%d\n", urb->actual_length);
|
||||
dev_info(&urb->dev->dev, "actual_length=%u\n", urb->actual_length);
|
||||
dev_info(&urb->dev->dev, "data: ");
|
||||
for (j = 0; j < urb->transfer_buffer_length; ++j)
|
||||
printk("%02x ", data[j]);
|
||||
@@ -376,7 +376,7 @@ static void destroy_async_on_interface(struct dev_state *ps,
|
||||
destroy_async(ps, &hitlist);
|
||||
}
|
||||
|
||||
static inline void destroy_all_async(struct dev_state *ps)
|
||||
static void destroy_all_async(struct dev_state *ps)
|
||||
{
|
||||
destroy_async(ps, &ps->async_pending);
|
||||
}
|
||||
@@ -525,7 +525,8 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype,
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (ps->dev->state != USB_STATE_ADDRESS
|
||||
if (ps->dev->state != USB_STATE_UNAUTHENTICATED
|
||||
&& ps->dev->state != USB_STATE_ADDRESS
|
||||
&& ps->dev->state != USB_STATE_CONFIGURED)
|
||||
return -EHOSTUNREACH;
|
||||
if (USB_TYPE_VENDOR == (USB_TYPE_MASK & requesttype))
|
||||
|
||||
@@ -66,7 +66,7 @@ static ssize_t show_ep_type(struct device *dev, struct device_attribute *attr,
|
||||
struct ep_device *ep = to_ep_device(dev);
|
||||
char *type = "unknown";
|
||||
|
||||
switch (ep->desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
|
||||
switch (usb_endpoint_type(ep->desc)) {
|
||||
case USB_ENDPOINT_XFER_CONTROL:
|
||||
type = "Control";
|
||||
break;
|
||||
@@ -94,7 +94,7 @@ static ssize_t show_ep_interval(struct device *dev,
|
||||
|
||||
in = (ep->desc->bEndpointAddress & USB_DIR_IN);
|
||||
|
||||
switch (ep->desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
|
||||
switch (usb_endpoint_type(ep->desc)) {
|
||||
case USB_ENDPOINT_XFER_CONTROL:
|
||||
if (ep->udev->speed == USB_SPEED_HIGH) /* uframes per NAK */
|
||||
interval = ep->desc->bInterval;
|
||||
@@ -131,10 +131,9 @@ static ssize_t show_ep_direction(struct device *dev,
|
||||
struct ep_device *ep = to_ep_device(dev);
|
||||
char *direction;
|
||||
|
||||
if ((ep->desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
|
||||
USB_ENDPOINT_XFER_CONTROL)
|
||||
if (usb_endpoint_xfer_control(ep->desc))
|
||||
direction = "both";
|
||||
else if (ep->desc->bEndpointAddress & USB_DIR_IN)
|
||||
else if (usb_endpoint_dir_in(ep->desc))
|
||||
direction = "in";
|
||||
else
|
||||
direction = "out";
|
||||
|
||||
+13
-20
@@ -279,9 +279,9 @@ static const u8 hs_rh_config_descriptor [] = {
|
||||
* helper routine for returning string descriptors in UTF-16LE
|
||||
* input can actually be ISO-8859-1; ASCII is its 7-bit subset
|
||||
*/
|
||||
static int ascii2utf (char *s, u8 *utf, int utfmax)
|
||||
static unsigned ascii2utf(char *s, u8 *utf, int utfmax)
|
||||
{
|
||||
int retval;
|
||||
unsigned retval;
|
||||
|
||||
for (retval = 0; *s && utfmax > 1; utfmax -= 2, retval += 2) {
|
||||
*utf++ = *s++;
|
||||
@@ -304,19 +304,15 @@ static int ascii2utf (char *s, u8 *utf, int utfmax)
|
||||
* Produces either a manufacturer, product or serial number string for the
|
||||
* virtual root hub device.
|
||||
*/
|
||||
static int rh_string (
|
||||
int id,
|
||||
struct usb_hcd *hcd,
|
||||
u8 *data,
|
||||
int len
|
||||
) {
|
||||
static unsigned rh_string(int id, struct usb_hcd *hcd, u8 *data, unsigned len)
|
||||
{
|
||||
char buf [100];
|
||||
|
||||
// language ids
|
||||
if (id == 0) {
|
||||
buf[0] = 4; buf[1] = 3; /* 4 bytes string data */
|
||||
buf[2] = 0x09; buf[3] = 0x04; /* MSFT-speak for "en-us" */
|
||||
len = min (len, 4);
|
||||
len = min_t(unsigned, len, 4);
|
||||
memcpy (data, buf, len);
|
||||
return len;
|
||||
|
||||
@@ -332,10 +328,7 @@ static int rh_string (
|
||||
} else if (id == 3) {
|
||||
snprintf (buf, sizeof buf, "%s %s %s", init_utsname()->sysname,
|
||||
init_utsname()->release, hcd->driver->description);
|
||||
|
||||
// unsupported IDs --> "protocol stall"
|
||||
} else
|
||||
return -EPIPE;
|
||||
}
|
||||
|
||||
switch (len) { /* All cases fall through */
|
||||
default:
|
||||
@@ -360,9 +353,8 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
|
||||
u8 tbuf [sizeof (struct usb_hub_descriptor)]
|
||||
__attribute__((aligned(4)));
|
||||
const u8 *bufp = tbuf;
|
||||
int len = 0;
|
||||
unsigned len = 0;
|
||||
int status;
|
||||
int n;
|
||||
u8 patch_wakeup = 0;
|
||||
u8 patch_protocol = 0;
|
||||
|
||||
@@ -456,10 +448,11 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
|
||||
patch_wakeup = 1;
|
||||
break;
|
||||
case USB_DT_STRING << 8:
|
||||
n = rh_string (wValue & 0xff, hcd, ubuf, wLength);
|
||||
if (n < 0)
|
||||
if ((wValue & 0xff) < 4)
|
||||
urb->actual_length = rh_string(wValue & 0xff,
|
||||
hcd, ubuf, wLength);
|
||||
else /* unsupported IDs --> "protocol stall" */
|
||||
goto error;
|
||||
urb->actual_length = n;
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
@@ -629,7 +622,7 @@ static int rh_queue_status (struct usb_hcd *hcd, struct urb *urb)
|
||||
{
|
||||
int retval;
|
||||
unsigned long flags;
|
||||
int len = 1 + (urb->dev->maxchild / 8);
|
||||
unsigned len = 1 + (urb->dev->maxchild / 8);
|
||||
|
||||
spin_lock_irqsave (&hcd_root_hub_lock, flags);
|
||||
if (hcd->status_urb || urb->transfer_buffer_length < len) {
|
||||
@@ -901,7 +894,7 @@ static int register_root_hub(struct usb_hcd *hcd)
|
||||
|
||||
mutex_lock(&usb_bus_list_lock);
|
||||
|
||||
usb_dev->ep0.desc.wMaxPacketSize = __constant_cpu_to_le16(64);
|
||||
usb_dev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
|
||||
retval = usb_get_device_descriptor(usb_dev, USB_DT_DEVICE_SIZE);
|
||||
if (retval != sizeof usb_dev->descriptor) {
|
||||
mutex_unlock(&usb_bus_list_lock);
|
||||
|
||||
+19
-9
@@ -392,7 +392,7 @@ static void hub_irq(struct urb *urb)
|
||||
{
|
||||
struct usb_hub *hub = urb->context;
|
||||
int status = urb->status;
|
||||
int i;
|
||||
unsigned i;
|
||||
unsigned long bits;
|
||||
|
||||
switch (status) {
|
||||
@@ -1305,6 +1305,7 @@ void usb_set_device_state(struct usb_device *udev,
|
||||
recursively_mark_NOTATTACHED(udev);
|
||||
spin_unlock_irqrestore(&device_state_lock, flags);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(usb_set_device_state);
|
||||
|
||||
/*
|
||||
* WUSB devices are simple: they have no hubs behind, so the mapping
|
||||
@@ -2471,20 +2472,20 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
|
||||
*/
|
||||
switch (udev->speed) {
|
||||
case USB_SPEED_VARIABLE: /* fixed at 512 */
|
||||
udev->ep0.desc.wMaxPacketSize = __constant_cpu_to_le16(512);
|
||||
udev->ep0.desc.wMaxPacketSize = cpu_to_le16(512);
|
||||
break;
|
||||
case USB_SPEED_HIGH: /* fixed at 64 */
|
||||
udev->ep0.desc.wMaxPacketSize = __constant_cpu_to_le16(64);
|
||||
udev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
|
||||
break;
|
||||
case USB_SPEED_FULL: /* 8, 16, 32, or 64 */
|
||||
/* to determine the ep0 maxpacket size, try to read
|
||||
* the device descriptor to get bMaxPacketSize0 and
|
||||
* then correct our initial guess.
|
||||
*/
|
||||
udev->ep0.desc.wMaxPacketSize = __constant_cpu_to_le16(64);
|
||||
udev->ep0.desc.wMaxPacketSize = cpu_to_le16(64);
|
||||
break;
|
||||
case USB_SPEED_LOW: /* fixed at 8 */
|
||||
udev->ep0.desc.wMaxPacketSize = __constant_cpu_to_le16(8);
|
||||
udev->ep0.desc.wMaxPacketSize = cpu_to_le16(8);
|
||||
break;
|
||||
default:
|
||||
goto fail;
|
||||
@@ -3393,9 +3394,9 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
|
||||
goto re_enumerate;
|
||||
}
|
||||
|
||||
/* Restore the device's previous configuration */
|
||||
if (!udev->actconfig)
|
||||
goto done;
|
||||
|
||||
ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
|
||||
USB_REQ_SET_CONFIGURATION, 0,
|
||||
udev->actconfig->desc.bConfigurationValue, 0,
|
||||
@@ -3408,16 +3409,25 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
|
||||
}
|
||||
usb_set_device_state(udev, USB_STATE_CONFIGURED);
|
||||
|
||||
/* Put interfaces back into the same altsettings as before.
|
||||
* Don't bother to send the Set-Interface request for interfaces
|
||||
* that were already in altsetting 0; besides being unnecessary,
|
||||
* many devices can't handle it. Instead just reset the host-side
|
||||
* endpoint state.
|
||||
*/
|
||||
for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {
|
||||
struct usb_interface *intf = udev->actconfig->interface[i];
|
||||
struct usb_interface_descriptor *desc;
|
||||
|
||||
/* set_interface resets host side toggle even
|
||||
* for altsetting zero. the interface may have no driver.
|
||||
*/
|
||||
desc = &intf->cur_altsetting->desc;
|
||||
if (desc->bAlternateSetting == 0) {
|
||||
usb_disable_interface(udev, intf, true);
|
||||
usb_enable_interface(udev, intf, true);
|
||||
ret = 0;
|
||||
} else {
|
||||
ret = usb_set_interface(udev, desc->bInterfaceNumber,
|
||||
desc->bAlternateSetting);
|
||||
}
|
||||
if (ret < 0) {
|
||||
dev_err(&udev->dev, "failed to restore interface %d "
|
||||
"altsetting %d (error=%d)\n",
|
||||
|
||||
@@ -59,7 +59,7 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int *actual_length)
|
||||
retval = (ctx.status == -ENOENT ? -ETIMEDOUT : ctx.status);
|
||||
|
||||
dev_dbg(&urb->dev->dev,
|
||||
"%s timed out on ep%d%s len=%d/%d\n",
|
||||
"%s timed out on ep%d%s len=%u/%u\n",
|
||||
current->comm,
|
||||
usb_endpoint_num(&urb->ep->desc),
|
||||
usb_urb_dir_in(urb) ? "in" : "out",
|
||||
@@ -804,18 +804,16 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
|
||||
dev_err(&dev->dev,
|
||||
"string descriptor 0 read error: %d\n",
|
||||
err);
|
||||
goto errout;
|
||||
} else if (err < 4) {
|
||||
dev_err(&dev->dev, "string descriptor 0 too short\n");
|
||||
err = -EINVAL;
|
||||
goto errout;
|
||||
} else {
|
||||
dev->have_langid = 1;
|
||||
dev->string_langid = tbuf[2] | (tbuf[3] << 8);
|
||||
/* always use the first langid listed */
|
||||
dev_dbg(&dev->dev, "default language 0x%04x\n",
|
||||
dev->string_langid);
|
||||
}
|
||||
|
||||
dev->have_langid = 1;
|
||||
}
|
||||
|
||||
err = usb_string_sub(dev, dev->string_langid, index, tbuf);
|
||||
@@ -1719,7 +1717,8 @@ free_interfaces:
|
||||
}
|
||||
kfree(new_interfaces);
|
||||
|
||||
if (cp->string == NULL)
|
||||
if (cp->string == NULL &&
|
||||
!(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
|
||||
cp->string = usb_cache_string(dev, cp->desc.iConfiguration);
|
||||
|
||||
/* Now that all the interfaces are set up, register them
|
||||
|
||||
@@ -54,6 +54,10 @@ static const struct usb_device_id usb_quirk_list[] = {
|
||||
{ USB_DEVICE(0x0638, 0x0a13), .driver_info =
|
||||
USB_QUIRK_STRING_FETCH_255 },
|
||||
|
||||
/* Saitek Cyborg Gold Joystick */
|
||||
{ USB_DEVICE(0x06a3, 0x0006), .driver_info =
|
||||
USB_QUIRK_CONFIG_INTF_STRINGS },
|
||||
|
||||
/* M-Systems Flash Disk Pioneers */
|
||||
{ USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/usb.h>
|
||||
#include <linux/usb/quirks.h>
|
||||
#include "usb.h"
|
||||
|
||||
/* Active configuration fields */
|
||||
@@ -813,7 +814,8 @@ int usb_create_sysfs_intf_files(struct usb_interface *intf)
|
||||
if (intf->sysfs_files_created || intf->unregistering)
|
||||
return 0;
|
||||
|
||||
if (alt->string == NULL)
|
||||
if (alt->string == NULL &&
|
||||
!(udev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
|
||||
alt->string = usb_cache_string(udev, alt->desc.iInterface);
|
||||
if (alt->string)
|
||||
retval = device_create_file(&intf->dev, &dev_attr_interface);
|
||||
|
||||
@@ -295,7 +295,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
|
||||
if (!urb || urb->hcpriv || !urb->complete)
|
||||
return -EINVAL;
|
||||
dev = urb->dev;
|
||||
if ((!dev) || (dev->state < USB_STATE_DEFAULT))
|
||||
if ((!dev) || (dev->state < USB_STATE_UNAUTHENTICATED))
|
||||
return -ENODEV;
|
||||
|
||||
/* For now, get the endpoint from the pipe. Eventually drivers
|
||||
@@ -370,7 +370,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
|
||||
}
|
||||
|
||||
/* the I/O buffer must be mapped/unmapped, except when length=0 */
|
||||
if (urb->transfer_buffer_length < 0)
|
||||
if (urb->transfer_buffer_length > INT_MAX)
|
||||
return -EMSGSIZE;
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
@@ -254,6 +254,7 @@ config USB_PXA25X_SMALL
|
||||
config USB_GADGET_PXA27X
|
||||
boolean "PXA 27x"
|
||||
depends on ARCH_PXA && PXA27x
|
||||
select USB_OTG_UTILS
|
||||
help
|
||||
Intel's PXA 27x series XScale ARM v5TE processors include
|
||||
an integrated full speed USB 1.1 device controller.
|
||||
|
||||
@@ -551,7 +551,7 @@ udc_alloc_request(struct usb_ep *usbep, gfp_t gfp)
|
||||
dma_desc->status = AMD_ADDBITS(dma_desc->status,
|
||||
UDC_DMA_STP_STS_BS_HOST_BUSY,
|
||||
UDC_DMA_STP_STS_BS);
|
||||
dma_desc->bufptr = __constant_cpu_to_le32(DMA_DONT_USE);
|
||||
dma_desc->bufptr = cpu_to_le32(DMA_DONT_USE);
|
||||
req->td_data = dma_desc;
|
||||
req->td_data_last = NULL;
|
||||
req->chain_len = 1;
|
||||
|
||||
@@ -1017,7 +1017,7 @@ static struct usb_endpoint_descriptor usba_ep0_desc = {
|
||||
.bDescriptorType = USB_DT_ENDPOINT,
|
||||
.bEndpointAddress = 0,
|
||||
.bmAttributes = USB_ENDPOINT_XFER_CONTROL,
|
||||
.wMaxPacketSize = __constant_cpu_to_le16(64),
|
||||
.wMaxPacketSize = cpu_to_le16(64),
|
||||
/* FIXME: I have no idea what to put here */
|
||||
.bInterval = 1,
|
||||
};
|
||||
@@ -1207,21 +1207,21 @@ static int do_test_mode(struct usba_udc *udc)
|
||||
/* Avoid overly long expressions */
|
||||
static inline bool feature_is_dev_remote_wakeup(struct usb_ctrlrequest *crq)
|
||||
{
|
||||
if (crq->wValue == __constant_cpu_to_le16(USB_DEVICE_REMOTE_WAKEUP))
|
||||
if (crq->wValue == cpu_to_le16(USB_DEVICE_REMOTE_WAKEUP))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool feature_is_dev_test_mode(struct usb_ctrlrequest *crq)
|
||||
{
|
||||
if (crq->wValue == __constant_cpu_to_le16(USB_DEVICE_TEST_MODE))
|
||||
if (crq->wValue == cpu_to_le16(USB_DEVICE_TEST_MODE))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool feature_is_ep_halt(struct usb_ctrlrequest *crq)
|
||||
{
|
||||
if (crq->wValue == __constant_cpu_to_le16(USB_ENDPOINT_HALT))
|
||||
if (crq->wValue == cpu_to_le16(USB_ENDPOINT_HALT))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -1239,7 +1239,7 @@ static int handle_ep0_setup(struct usba_udc *udc, struct usba_ep *ep,
|
||||
status = cpu_to_le16(udc->devstatus);
|
||||
} else if (crq->bRequestType
|
||||
== (USB_DIR_IN | USB_RECIP_INTERFACE)) {
|
||||
status = __constant_cpu_to_le16(0);
|
||||
status = cpu_to_le16(0);
|
||||
} else if (crq->bRequestType
|
||||
== (USB_DIR_IN | USB_RECIP_ENDPOINT)) {
|
||||
struct usba_ep *target;
|
||||
@@ -1250,12 +1250,12 @@ static int handle_ep0_setup(struct usba_udc *udc, struct usba_ep *ep,
|
||||
|
||||
status = 0;
|
||||
if (is_stalled(udc, target))
|
||||
status |= __constant_cpu_to_le16(1);
|
||||
status |= cpu_to_le16(1);
|
||||
} else
|
||||
goto delegate;
|
||||
|
||||
/* Write directly to the FIFO. No queueing is done. */
|
||||
if (crq->wLength != __constant_cpu_to_le16(sizeof(status)))
|
||||
if (crq->wLength != cpu_to_le16(sizeof(status)))
|
||||
goto stall;
|
||||
ep->state = DATA_STAGE_IN;
|
||||
__raw_writew(status, ep->fifo);
|
||||
@@ -1274,7 +1274,7 @@ static int handle_ep0_setup(struct usba_udc *udc, struct usba_ep *ep,
|
||||
} else if (crq->bRequestType == USB_RECIP_ENDPOINT) {
|
||||
struct usba_ep *target;
|
||||
|
||||
if (crq->wLength != __constant_cpu_to_le16(0)
|
||||
if (crq->wLength != cpu_to_le16(0)
|
||||
|| !feature_is_ep_halt(crq))
|
||||
goto stall;
|
||||
target = get_ep_by_addr(udc, le16_to_cpu(crq->wIndex));
|
||||
@@ -1308,7 +1308,7 @@ static int handle_ep0_setup(struct usba_udc *udc, struct usba_ep *ep,
|
||||
} else if (crq->bRequestType == USB_RECIP_ENDPOINT) {
|
||||
struct usba_ep *target;
|
||||
|
||||
if (crq->wLength != __constant_cpu_to_le16(0)
|
||||
if (crq->wLength != cpu_to_le16(0)
|
||||
|| !feature_is_ep_halt(crq))
|
||||
goto stall;
|
||||
|
||||
@@ -1514,7 +1514,7 @@ restart:
|
||||
*/
|
||||
ep->state = DATA_STAGE_IN;
|
||||
} else {
|
||||
if (crq.crq.wLength != __constant_cpu_to_le16(0))
|
||||
if (crq.crq.wLength != cpu_to_le16(0))
|
||||
ep->state = DATA_STAGE_OUT;
|
||||
else
|
||||
ep->state = STATUS_STAGE_IN;
|
||||
|
||||
@@ -66,7 +66,7 @@ static struct usb_device_descriptor device_desc = {
|
||||
.bLength = sizeof device_desc,
|
||||
.bDescriptorType = USB_DT_DEVICE,
|
||||
|
||||
.bcdUSB = __constant_cpu_to_le16(0x0200),
|
||||
.bcdUSB = cpu_to_le16(0x0200),
|
||||
|
||||
.bDeviceClass = USB_CLASS_COMM,
|
||||
.bDeviceSubClass = 0,
|
||||
@@ -74,8 +74,8 @@ static struct usb_device_descriptor device_desc = {
|
||||
/* .bMaxPacketSize0 = f(hardware) */
|
||||
|
||||
/* Vendor and product id can be overridden by module parameters. */
|
||||
.idVendor = __constant_cpu_to_le16(CDC_VENDOR_NUM),
|
||||
.idProduct = __constant_cpu_to_le16(CDC_PRODUCT_NUM),
|
||||
.idVendor = cpu_to_le16(CDC_VENDOR_NUM),
|
||||
.idProduct = cpu_to_le16(CDC_PRODUCT_NUM),
|
||||
/* .bcdDevice = f(hardware) */
|
||||
/* .iManufacturer = DYNAMIC */
|
||||
/* .iProduct = DYNAMIC */
|
||||
@@ -193,7 +193,7 @@ static int __init cdc_bind(struct usb_composite_dev *cdev)
|
||||
gadget->name,
|
||||
cdc_config_driver.label);
|
||||
device_desc.bcdDevice =
|
||||
__constant_cpu_to_le16(0x0300 | 0x0099);
|
||||
cpu_to_le16(0x0300 | 0x0099);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user