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: USB: pwc : do not pass stack allocated buffers to USB core. USB: otg: Fix bug on remove path without transceiver USB: correct error handling in cdc-wdm USB: removal of tty->low_latency hack dating back to the old serial code USB: serial: sierra driver bug fix for composite interface USB: gadget: omap_udc uses platform_driver_probe() USB: ci13xxx_udc: fix build error USB: musb: Prevent multiple includes of musb.h USB: pass mem_flags to dma_alloc_coherent USB: g_file_storage: fix use-after-free bug when closing files USB: ehci-sched.c: EHCI SITD scheduling bugfix USB: fix mos7840 problem with minor numbers USB: mos7840: add new device id USB: musb: fix build when !CONFIG_PM USB: musb: Remove my email address from few musb related drivers USB: Gadget: MIPS CI13xxx UDC bugfixes USB: Unusual Device support for Gold MP3 Player Energy USB: serial: fix lifetime and locking problems
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* This driver supports USB CDC WCM Device Management.
|
||||
*
|
||||
* Copyright (c) 2007-2008 Oliver Neukum
|
||||
* Copyright (c) 2007-2009 Oliver Neukum
|
||||
*
|
||||
* Some code taken from cdc-acm.c
|
||||
*
|
||||
@@ -610,7 +610,7 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||
if (!buffer)
|
||||
goto out;
|
||||
|
||||
while (buflen > 0) {
|
||||
while (buflen > 2) {
|
||||
if (buffer [1] != USB_DT_CS_INTERFACE) {
|
||||
dev_err(&intf->dev, "skipping garbage\n");
|
||||
goto next_desc;
|
||||
@@ -646,16 +646,18 @@ next_desc:
|
||||
spin_lock_init(&desc->iuspin);
|
||||
init_waitqueue_head(&desc->wait);
|
||||
desc->wMaxCommand = maxcom;
|
||||
/* this will be expanded and needed in hardware endianness */
|
||||
desc->inum = cpu_to_le16((u16)intf->cur_altsetting->desc.bInterfaceNumber);
|
||||
desc->intf = intf;
|
||||
INIT_WORK(&desc->rxwork, wdm_rxwork);
|
||||
|
||||
iface = &intf->altsetting[0];
|
||||
rv = -EINVAL;
|
||||
iface = intf->cur_altsetting;
|
||||
if (iface->desc.bNumEndpoints != 1)
|
||||
goto err;
|
||||
ep = &iface->endpoint[0].desc;
|
||||
if (!ep || !usb_endpoint_is_int_in(ep)) {
|
||||
rv = -EINVAL;
|
||||
if (!ep || !usb_endpoint_is_int_in(ep))
|
||||
goto err;
|
||||
}
|
||||
|
||||
desc->wMaxPacketSize = le16_to_cpu(ep->wMaxPacketSize);
|
||||
desc->bMaxPacketSize0 = udev->descriptor.bMaxPacketSize0;
|
||||
@@ -711,12 +713,19 @@ next_desc:
|
||||
|
||||
usb_set_intfdata(intf, desc);
|
||||
rv = usb_register_dev(intf, &wdm_class);
|
||||
dev_info(&intf->dev, "cdc-wdm%d: USB WDM device\n",
|
||||
intf->minor - WDM_MINOR_BASE);
|
||||
if (rv < 0)
|
||||
goto err;
|
||||
goto err3;
|
||||
else
|
||||
dev_info(&intf->dev, "cdc-wdm%d: USB WDM device\n",
|
||||
intf->minor - WDM_MINOR_BASE);
|
||||
out:
|
||||
return rv;
|
||||
err3:
|
||||
usb_set_intfdata(intf, NULL);
|
||||
usb_buffer_free(interface_to_usbdev(desc->intf),
|
||||
desc->bMaxPacketSize0,
|
||||
desc->inbuf,
|
||||
desc->response->transfer_dma);
|
||||
err2:
|
||||
usb_buffer_free(interface_to_usbdev(desc->intf),
|
||||
desc->wMaxPacketSize,
|
||||
|
||||
@@ -119,7 +119,7 @@ void *hcd_buffer_alloc(
|
||||
if (size <= pool_max [i])
|
||||
return dma_pool_alloc(hcd->pool [i], mem_flags, dma);
|
||||
}
|
||||
return dma_alloc_coherent(hcd->self.controller, size, dma, 0);
|
||||
return dma_alloc_coherent(hcd->self.controller, size, dma, mem_flags);
|
||||
}
|
||||
|
||||
void hcd_buffer_free(
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
* - Gadget API (majority of optional features)
|
||||
* - Suspend & Remote Wakeup
|
||||
*/
|
||||
#include <linux/delay.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/dmapool.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
@@ -142,7 +143,7 @@ static struct {
|
||||
#define CAP_DEVICEADDR (0x014UL)
|
||||
#define CAP_ENDPTLISTADDR (0x018UL)
|
||||
#define CAP_PORTSC (0x044UL)
|
||||
#define CAP_DEVLC (0x0B4UL)
|
||||
#define CAP_DEVLC (0x084UL)
|
||||
#define CAP_USBMODE (hw_bank.lpm ? 0x0C8UL : 0x068UL)
|
||||
#define CAP_ENDPTSETUPSTAT (hw_bank.lpm ? 0x0D8UL : 0x06CUL)
|
||||
#define CAP_ENDPTPRIME (hw_bank.lpm ? 0x0DCUL : 0x070UL)
|
||||
@@ -1986,6 +1987,8 @@ static int ep_enable(struct usb_ep *ep,
|
||||
do {
|
||||
dbg_event(_usb_addr(mEp), "ENABLE", 0);
|
||||
|
||||
mEp->qh[mEp->dir].ptr->cap = 0;
|
||||
|
||||
if (mEp->type == USB_ENDPOINT_XFER_CONTROL)
|
||||
mEp->qh[mEp->dir].ptr->cap |= QH_IOS;
|
||||
else if (mEp->type == USB_ENDPOINT_XFER_ISOC)
|
||||
|
||||
@@ -738,7 +738,6 @@ static struct fsg_dev *the_fsg;
|
||||
static struct usb_gadget_driver fsg_driver;
|
||||
|
||||
static void close_backing_file(struct lun *curlun);
|
||||
static void close_all_backing_files(struct fsg_dev *fsg);
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -3593,12 +3592,10 @@ static int fsg_main_thread(void *fsg_)
|
||||
fsg->thread_task = NULL;
|
||||
spin_unlock_irq(&fsg->lock);
|
||||
|
||||
/* In case we are exiting because of a signal, unregister the
|
||||
* gadget driver and close the backing file. */
|
||||
if (test_and_clear_bit(REGISTERED, &fsg->atomic_bitflags)) {
|
||||
/* If we are exiting because of a signal, unregister the
|
||||
* gadget driver. */
|
||||
if (test_and_clear_bit(REGISTERED, &fsg->atomic_bitflags))
|
||||
usb_gadget_unregister_driver(&fsg_driver);
|
||||
close_all_backing_files(fsg);
|
||||
}
|
||||
|
||||
/* Let the unbind and cleanup routines know the thread has exited */
|
||||
complete_and_exit(&fsg->thread_notifier, 0);
|
||||
@@ -3703,14 +3700,6 @@ static void close_backing_file(struct lun *curlun)
|
||||
}
|
||||
}
|
||||
|
||||
static void close_all_backing_files(struct fsg_dev *fsg)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < fsg->nluns; ++i)
|
||||
close_backing_file(&fsg->luns[i]);
|
||||
}
|
||||
|
||||
|
||||
static ssize_t show_ro(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
@@ -3845,6 +3834,7 @@ static void /* __init_or_exit */ fsg_unbind(struct usb_gadget *gadget)
|
||||
if (curlun->registered) {
|
||||
device_remove_file(&curlun->dev, &dev_attr_ro);
|
||||
device_remove_file(&curlun->dev, &dev_attr_file);
|
||||
close_backing_file(curlun);
|
||||
device_unregister(&curlun->dev);
|
||||
curlun->registered = 0;
|
||||
}
|
||||
@@ -4190,7 +4180,6 @@ autoconf_fail:
|
||||
out:
|
||||
fsg->state = FSG_STATE_TERMINATED; // The thread is dead
|
||||
fsg_unbind(gadget);
|
||||
close_all_backing_files(fsg);
|
||||
complete(&fsg->thread_notifier);
|
||||
return rc;
|
||||
}
|
||||
@@ -4284,7 +4273,6 @@ static void __exit fsg_cleanup(void)
|
||||
/* Wait for the thread to finish up */
|
||||
wait_for_completion(&fsg->thread_notifier);
|
||||
|
||||
close_all_backing_files(fsg);
|
||||
kref_put(&fsg->ref, fsg_release);
|
||||
}
|
||||
module_exit(fsg_cleanup);
|
||||
|
||||
@@ -3104,7 +3104,6 @@ static int omap_udc_resume(struct platform_device *dev)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
static struct platform_driver udc_driver = {
|
||||
.probe = omap_udc_probe,
|
||||
.remove = __exit_p(omap_udc_remove),
|
||||
.suspend = omap_udc_suspend,
|
||||
.resume = omap_udc_resume,
|
||||
@@ -3122,7 +3121,7 @@ static int __init udc_init(void)
|
||||
#endif
|
||||
"%s\n", driver_desc,
|
||||
use_dma ? " (dma)" : "");
|
||||
return platform_driver_register(&udc_driver);
|
||||
return platform_driver_probe(&udc_driver, omap_udc_probe);
|
||||
}
|
||||
module_init(udc_init);
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@ static int tt_available (
|
||||
* already scheduled transactions
|
||||
*/
|
||||
if (125 < usecs) {
|
||||
int ufs = (usecs / 125) - 1;
|
||||
int ufs = (usecs / 125);
|
||||
int i;
|
||||
for (i = uframe; i < (uframe + ufs) && i < 8; i++)
|
||||
if (0 < tt_usecs[i]) {
|
||||
|
||||
@@ -2191,7 +2191,7 @@ static int musb_resume_early(struct platform_device *pdev)
|
||||
|
||||
#else
|
||||
#define musb_suspend NULL
|
||||
#define musb_resume NULL
|
||||
#define musb_resume_early NULL
|
||||
#endif
|
||||
|
||||
static struct platform_driver musb_driver = {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Some code has been taken from tusb6010.c
|
||||
* Copyrights for that are attributable to:
|
||||
* Copyright (C) 2006 Nokia Corporation
|
||||
* Jarkko Nikula <jarkko.nikula@nokia.com>
|
||||
* Tony Lindgren <tony@atomide.com>
|
||||
*
|
||||
* This file is part of the Inventra Controller Driver for Linux.
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* TUSB6010 USB 2.0 OTG Dual Role controller
|
||||
*
|
||||
* Copyright (C) 2006 Nokia Corporation
|
||||
* Jarkko Nikula <jarkko.nikula@nokia.com>
|
||||
* Tony Lindgren <tony@atomide.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Definitions for TUSB6010 USB 2.0 OTG Dual Role controller
|
||||
*
|
||||
* Copyright (C) 2006 Nokia Corporation
|
||||
* Jarkko Nikula <jarkko.nikula@nokia.com>
|
||||
* Tony Lindgren <tony@atomide.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -43,7 +43,8 @@ EXPORT_SYMBOL(otg_get_transceiver);
|
||||
*/
|
||||
void otg_put_transceiver(struct otg_transceiver *x)
|
||||
{
|
||||
put_device(x->dev);
|
||||
if (x)
|
||||
put_device(x->dev);
|
||||
}
|
||||
EXPORT_SYMBOL(otg_put_transceiver);
|
||||
|
||||
|
||||
@@ -175,13 +175,6 @@ static int cyberjack_open(struct tty_struct *tty,
|
||||
dbg("%s - usb_clear_halt", __func__);
|
||||
usb_clear_halt(port->serial->dev, port->write_urb->pipe);
|
||||
|
||||
/* force low_latency on so that our tty_push actually forces
|
||||
* the data through, otherwise it is scheduled, and with high
|
||||
* data rates (like with OHCI) data can get lost.
|
||||
*/
|
||||
if (tty)
|
||||
tty->low_latency = 1;
|
||||
|
||||
priv = usb_get_serial_port_data(port);
|
||||
spin_lock_irqsave(&priv->lock, flags);
|
||||
priv->rdtodo = 0;
|
||||
|
||||
@@ -656,10 +656,6 @@ static int cypress_open(struct tty_struct *tty,
|
||||
priv->rx_flags = 0;
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
|
||||
/* setting to zero could cause data loss */
|
||||
if (tty)
|
||||
tty->low_latency = 1;
|
||||
|
||||
/* raise both lines and set termios */
|
||||
spin_lock_irqsave(&priv->lock, flags);
|
||||
priv->line_control = CONTROL_DTR | CONTROL_RTS;
|
||||
|
||||
@@ -478,12 +478,6 @@ static void empeg_set_termios(struct tty_struct *tty,
|
||||
termios->c_cflag
|
||||
|= CS8; /* character size 8 bits */
|
||||
|
||||
/*
|
||||
* Force low_latency on; otherwise the pushes are scheduled;
|
||||
* this is bad as it opens up the possibility of dropping bytes
|
||||
* on the floor. We don't want to drop bytes on the floor. :)
|
||||
*/
|
||||
tty->low_latency = 1;
|
||||
tty_encode_baud_rate(tty, 115200, 115200);
|
||||
}
|
||||
|
||||
|
||||
@@ -973,14 +973,6 @@ static int garmin_open(struct tty_struct *tty,
|
||||
|
||||
dbg("%s - port %d", __func__, port->number);
|
||||
|
||||
/*
|
||||
* Force low_latency on so that our tty_push actually forces the data
|
||||
* through, otherwise it is scheduled, and with high data rates (like
|
||||
* with OHCI) data can get lost.
|
||||
*/
|
||||
if (tty)
|
||||
tty->low_latency = 1;
|
||||
|
||||
spin_lock_irqsave(&garmin_data_p->lock, flags);
|
||||
garmin_data_p->mode = initial_mode;
|
||||
garmin_data_p->count = 0;
|
||||
|
||||
@@ -122,12 +122,6 @@ int usb_serial_generic_open(struct tty_struct *tty,
|
||||
|
||||
dbg("%s - port %d", __func__, port->number);
|
||||
|
||||
/* force low_latency on so that our tty_push actually forces the data
|
||||
through, otherwise it is scheduled, and with high data rates (like
|
||||
with OHCI) data can get lost. */
|
||||
if (tty)
|
||||
tty->low_latency = 1;
|
||||
|
||||
/* clear the throttle flags */
|
||||
spin_lock_irqsave(&port->lock, flags);
|
||||
port->throttled = 0;
|
||||
|
||||
@@ -193,8 +193,6 @@ static const struct divisor_table_entry divisor_table[] = {
|
||||
/* local variables */
|
||||
static int debug;
|
||||
|
||||
static int low_latency = 1; /* tty low latency flag, on by default */
|
||||
|
||||
static atomic_t CmdUrbs; /* Number of outstanding Command Write Urbs */
|
||||
|
||||
|
||||
@@ -867,9 +865,6 @@ static int edge_open(struct tty_struct *tty,
|
||||
if (edge_port == NULL)
|
||||
return -ENODEV;
|
||||
|
||||
if (tty)
|
||||
tty->low_latency = low_latency;
|
||||
|
||||
/* see if we've set up our endpoint info yet (can't set it up
|
||||
in edge_startup as the structures were not set up at that time.) */
|
||||
serial = port->serial;
|
||||
@@ -3299,6 +3294,3 @@ MODULE_FIRMWARE("edgeport/down2.fw");
|
||||
|
||||
module_param(debug, bool, S_IRUGO | S_IWUSR);
|
||||
MODULE_PARM_DESC(debug, "Debug enabled or not");
|
||||
|
||||
module_param(low_latency, bool, S_IRUGO | S_IWUSR);
|
||||
MODULE_PARM_DESC(low_latency, "Low latency enabled or not");
|
||||
|
||||
@@ -76,7 +76,6 @@ struct edgeport_uart_buf_desc {
|
||||
#define EDGE_READ_URB_STOPPING 1
|
||||
#define EDGE_READ_URB_STOPPED 2
|
||||
|
||||
#define EDGE_LOW_LATENCY 1
|
||||
#define EDGE_CLOSING_WAIT 4000 /* in .01 sec */
|
||||
|
||||
#define EDGE_OUT_BUF_SIZE 1024
|
||||
@@ -232,7 +231,6 @@ static unsigned short OperationalBuildNumber;
|
||||
|
||||
static int debug;
|
||||
|
||||
static int low_latency = EDGE_LOW_LATENCY;
|
||||
static int closing_wait = EDGE_CLOSING_WAIT;
|
||||
static int ignore_cpu_rev;
|
||||
static int default_uart_mode; /* RS232 */
|
||||
@@ -1850,9 +1848,6 @@ static int edge_open(struct tty_struct *tty,
|
||||
if (edge_port == NULL)
|
||||
return -ENODEV;
|
||||
|
||||
if (tty)
|
||||
tty->low_latency = low_latency;
|
||||
|
||||
port_number = port->number - port->serial->minor;
|
||||
switch (port_number) {
|
||||
case 0:
|
||||
@@ -3008,9 +3003,6 @@ MODULE_FIRMWARE("edgeport/down3.bin");
|
||||
module_param(debug, bool, S_IRUGO | S_IWUSR);
|
||||
MODULE_PARM_DESC(debug, "Debug enabled or not");
|
||||
|
||||
module_param(low_latency, bool, S_IRUGO | S_IWUSR);
|
||||
MODULE_PARM_DESC(low_latency, "Low latency enabled or not");
|
||||
|
||||
module_param(closing_wait, int, S_IRUGO | S_IWUSR);
|
||||
MODULE_PARM_DESC(closing_wait, "Maximum wait for data to drain, in .01 secs");
|
||||
|
||||
|
||||
@@ -631,13 +631,7 @@ static int ipaq_open(struct tty_struct *tty,
|
||||
priv->free_len += PACKET_SIZE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Force low latency on. This will immediately push data to the line
|
||||
* discipline instead of queueing.
|
||||
*/
|
||||
|
||||
if (tty) {
|
||||
tty->low_latency = 1;
|
||||
/* FIXME: These two are bogus */
|
||||
tty->raw = 1;
|
||||
tty->real_raw = 1;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user