Commit de7924cb authored by Anton Blanchard's avatar Anton Blanchard

Merge samba.org:/scratch/anton/linux-2.5

into samba.org:/scratch/anton/tmp3
parents 1050d7c7 eb0a5728
This diff is collapsed.
......@@ -855,28 +855,14 @@ asmlinkage long sys32_time(int * tloc)
return i;
}
asmlinkage long
sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options)
{
return compat_sys_wait4(pid, stat_addr, options, NULL);
}
extern asmlinkage long
sys_getrusage(int who, struct rusage *ru);
compat_sys_wait4(compat_pid_t pid, compat_uint_t * stat_addr, int options,
struct compat_rusage *ru);
asmlinkage long
sys32_getrusage(int who, struct rusage32 *ru)
sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options)
{
struct rusage r;
int ret;
mm_segment_t old_fs = get_fs();
set_fs (KERNEL_DS);
ret = sys_getrusage(who, &r);
set_fs (old_fs);
if (put_rusage (ru, &r)) return -EFAULT;
return ret;
return compat_sys_wait4(pid, stat_addr, options, NULL);
}
int sys32_ni_syscall(int call)
......
......@@ -74,7 +74,7 @@ static void register_irq_proc (unsigned int irq);
* Special irq handlers.
*/
void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs) { return IRQ_NONE; }
/*
* Generic no controller code
......@@ -433,7 +433,7 @@ asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
*/
int request_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
irqreturn_t (*handler)(int, void *, struct pt_regs *),
unsigned long irqflags,
const char * devname,
void *dev_id)
......
......@@ -195,7 +195,7 @@ static void set_rtc_mmss(unsigned long nowtime)
spin_unlock(&rtc_lock);
}
static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
static unsigned long rtc_update = 0;
......@@ -255,6 +255,8 @@ static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
}
write_sequnlock(&xtime_lock);
return IRQ_HANDLED;
}
unsigned long get_cmos_time(void)
......
......@@ -573,8 +573,8 @@ static void sw_connect(struct gameport *gameport, struct gameport_dev *dev)
{
struct sw *sw;
int i, j, k, l;
unsigned char buf[SW_LENGTH];
unsigned char idbuf[SW_LENGTH];
unsigned char *buf = NULL; /* [SW_LENGTH] */
unsigned char *idbuf = NULL; /* [SW_LENGTH] */
unsigned char m = 1;
char comment[40];
......@@ -583,6 +583,11 @@ static void sw_connect(struct gameport *gameport, struct gameport_dev *dev)
if (!(sw = kmalloc(sizeof(struct sw), GFP_KERNEL))) return;
memset(sw, 0, sizeof(struct sw));
buf = kmalloc(SW_LENGTH, GFP_KERNEL);
idbuf = kmalloc(SW_LENGTH, GFP_KERNEL);
if (!buf || !idbuf)
goto fail1;
gameport->private = sw;
sw->gameport = gameport;
......@@ -739,6 +744,8 @@ static void sw_connect(struct gameport *gameport, struct gameport_dev *dev)
return;
fail2: gameport_close(gameport);
fail1: kfree(sw);
kfree(buf);
kfree(idbuf);
}
static void sw_disconnect(struct gameport *gameport)
......
......@@ -167,7 +167,7 @@ static int uinput_validate_absbits(struct input_dev *dev)
static int uinput_alloc_device(struct file *file, const char *buffer, size_t count)
{
struct uinput_user_dev user_dev;
struct uinput_user_dev *user_dev;
struct input_dev *dev;
struct uinput_device *udev;
int size,
......@@ -178,34 +178,40 @@ static int uinput_alloc_device(struct file *file, const char *buffer, size_t cou
udev = (struct uinput_device *)file->private_data;
dev = udev->dev;
if (copy_from_user(&user_dev, buffer, sizeof(struct uinput_user_dev))) {
user_dev = kmalloc(sizeof(*user_dev), GFP_KERNEL);
if (!user_dev) {
retval = -ENOMEM;
goto exit;
}
if (copy_from_user(user_dev, buffer, sizeof(struct uinput_user_dev))) {
retval = -EFAULT;
goto exit;
}
if (NULL != dev->name)
kfree(dev->name);
size = strnlen(user_dev.name, UINPUT_MAX_NAME_SIZE);
size = strnlen(user_dev->name, UINPUT_MAX_NAME_SIZE);
dev->name = kmalloc(size + 1, GFP_KERNEL);
if (!dev->name) {
retval = -ENOMEM;
goto exit;
}
strncpy(dev->name, user_dev.name, size);
strncpy(dev->name, user_dev->name, size);
dev->name[size] = '\0';
dev->id.bustype = user_dev.id.bustype;
dev->id.vendor = user_dev.id.vendor;
dev->id.product = user_dev.id.product;
dev->id.version = user_dev.id.version;
dev->ff_effects_max = user_dev.ff_effects_max;
dev->id.bustype = user_dev->id.bustype;
dev->id.vendor = user_dev->id.vendor;
dev->id.product = user_dev->id.product;
dev->id.version = user_dev->id.version;
dev->ff_effects_max = user_dev->ff_effects_max;
size = sizeof(int) * (ABS_MAX + 1);
memcpy(dev->absmax, user_dev.absmax, size);
memcpy(dev->absmin, user_dev.absmin, size);
memcpy(dev->absfuzz, user_dev.absfuzz, size);
memcpy(dev->absflat, user_dev.absflat, size);
memcpy(dev->absmax, user_dev->absmax, size);
memcpy(dev->absmin, user_dev->absmin, size);
memcpy(dev->absfuzz, user_dev->absfuzz, size);
memcpy(dev->absflat, user_dev->absflat, size);
/* check if absmin/absmax/absfuzz/absflat are filled as
* told in Documentation/input/input-programming.txt */
......@@ -216,6 +222,7 @@ static int uinput_alloc_device(struct file *file, const char *buffer, size_t cou
}
exit:
kfree(user_dev);
return retval;
}
......
......@@ -36,7 +36,6 @@ obj-$(CONFIG_USB_STV680) += media/
obj-$(CONFIG_USB_VICAM) += media/
obj-$(CONFIG_USB_CATC) += net/
obj-$(CONFIG_USB_CDCETHER) += net/
obj-$(CONFIG_USB_KAWETH) += net/
obj-$(CONFIG_USB_PEGASUS) += net/
obj-$(CONFIG_USB_RTL8150) += net/
......
......@@ -13,6 +13,29 @@
#include <linux/usb.h>
#include "hcd.h"
/**
* usb_init_urb - initializes a urb so that it can be used by a USB driver
* @urb: pointer to the urb to initialize
*
* Initializes a urb so that the USB subsystem can use it properly.
*
* If a urb is created with a call to usb_alloc_urb() it is not
* necessary to call this function. Only use this if you allocate the
* space for a struct urb on your own. If you call this function, be
* careful when freeing the memory for your urb that it is no longer in
* use by the USB core.
*
* Only use this function if you _really_ understand what you are doing.
*/
void usb_init_urb(struct urb *urb)
{
if (urb) {
memset(urb, 0, sizeof(*urb));
urb->count = (atomic_t)ATOMIC_INIT(1);
spin_lock_init(&urb->lock);
}
}
/**
* usb_alloc_urb - creates a new urb for a USB driver to use
* @iso_packets: number of iso packets for this urb
......@@ -40,11 +63,7 @@ struct urb *usb_alloc_urb(int iso_packets, int mem_flags)
err("alloc_urb: kmalloc failed");
return NULL;
}
memset(urb, 0, sizeof(*urb));
urb->count = (atomic_t)ATOMIC_INIT(1);
spin_lock_init(&urb->lock);
usb_init_urb(urb);
return urb;
}
......@@ -387,7 +406,7 @@ int usb_unlink_urb(struct urb *urb)
return -ENODEV;
}
// asynchronous request completion model
EXPORT_SYMBOL(usb_init_urb);
EXPORT_SYMBOL(usb_alloc_urb);
EXPORT_SYMBOL(usb_free_urb);
EXPORT_SYMBOL(usb_get_urb);
......
......@@ -1283,7 +1283,8 @@ static int isochronous_find_limits(struct uhci_hcd *uhci, struct urb *urb, unsig
}
if (last_urb) {
*end = (last_urb->start_frame + last_urb->number_of_packets) & 1023;
*end = (last_urb->start_frame + last_urb->number_of_packets *
last_urb->interval) & (UHCI_NUMFRAMES-1);
ret = 0;
} else
ret = -1; /* no previous urb found */
......@@ -1933,9 +1934,10 @@ static void suspend_hc(struct uhci_hcd *uhci)
dbg("%x: suspend_hc", io_addr);
outw(USBCMD_EGSM, io_addr + USBCMD);
uhci->is_suspended = 1;
smp_wmb();
outw(USBCMD_EGSM, io_addr + USBCMD);
}
static void wakeup_hc(struct uhci_hcd *uhci)
......@@ -1945,6 +1947,9 @@ static void wakeup_hc(struct uhci_hcd *uhci)
dbg("%x: wakeup_hc", io_addr);
/* Global resume for 20ms */
outw(USBCMD_FGR | USBCMD_EGSM, io_addr + USBCMD);
wait_ms(20);
outw(0, io_addr + USBCMD);
/* wait for EOP to be sent */
......@@ -1965,7 +1970,7 @@ static int ports_active(struct uhci_hcd *uhci)
int i;
for (i = 0; i < uhci->rh_numports; i++)
connection |= (inw(io_addr + USBPORTSC1 + i * 2) & 0x1);
connection |= (inw(io_addr + USBPORTSC1 + i * 2) & USBPORTSC_CCS);
return connection;
}
......
......@@ -359,9 +359,6 @@ static struct usb_driver usb_kbd_driver = {
.probe = usb_kbd_probe,
.disconnect = usb_kbd_disconnect,
.id_table = usb_kbd_id_table,
.driver = {
.devclass = &input_devclass,
},
};
static int __init usb_kbd_init(void)
......
......@@ -242,9 +242,6 @@ static struct usb_driver usb_mouse_driver = {
.probe = usb_mouse_probe,
.disconnect = usb_mouse_disconnect,
.id_table = usb_mouse_id_table,
.driver = {
.devclass = &input_devclass,
},
};
static int __init usb_mouse_init(void)
......
/*
* USB ViCam WebCam driver
* Copyright (c) 2002 Joe Burks (jburks@wavicle.org),
* John Tyner (jtyner@cs.ucr.edu)
* Christopher L Cheney (ccheney@cheney.cx),
* Pavel Machek (pavel@suse.cz),
* John Tyner (jtyner@cs.ucr.edu),
* Monroe Williams (monroe@pobox.com)
*
* Supports 3COM HomeConnect PC Digital WebCam
*
......
......@@ -28,30 +28,6 @@ config USB_CATC
The module will be called catc. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
config USB_CDCETHER
tristate "USB CDC Ethernet support (EXPERIMENTAL)"
depends on USB && NET && EXPERIMENTAL
---help---
This driver supports devices conforming to the Communication Device
Class Ethernet Control Model. This is used in some cable modems.
For more details on the specification, get the Communication Device
Class specification from <http://www.usb.org/>.
This driver should work with the following devices:
* Ericsson PipeRider (all variants)
* Motorola (DM100 and SB4100)
* Broadcom Cable Modem (reference design)
* Toshiba PCX1100U and possibly other cable modems
The device creates a network device (ethX, where X depends on what
other networking devices you have in use), as for a normal PCI
or ISA based ethernet network card.
This code is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called cdc-ether. If you want to compile it
as a module, say M here and read <file:Documentation/modules.txt>.
config USB_KAWETH
tristate "USB KLSI KL5USB101-based ethernet device support"
depends on USB && NET
......@@ -124,26 +100,147 @@ config USB_RTL8150
module, say M here and read <file:Documentation/modules.txt>.
config USB_USBNET
tristate "USB-to-USB Networking for cables, PDAs and other devices"
tristate "Host-to-Host Networking for Cables and Smart Devices"
depends on USB && NET
---help---
This driver supports network links over USB with USB "Network"
or "data transfer" cables, often used to network laptops to PCs.
Such cables have chips from suppliers such as Belkin/eTEK, GeneSys
(GeneLink), NetChip and Prolific. Some motherboards with USB PC2PC
support include such chips.
Intelligent USB devices, such as PDAs running Linux (like Yopy
and Zaurus, or iPaqs after upgrading to Linux) can use the same
approach to provide Internet access.
This driver supports several kinds of network links over USB,
with "minidrivers" built around a common network driver core
that supports deep queues for efficient transfers.
Typically, these links involves only two network hosts. The
host runs "usbnet", and the other end of the link might be:
- Another USB host, when using USB "network" or "data transfer"
cables. These are often used to network laptops to PCs, like
"Laplink" parallel cables or some motherboards. These rely
on specialized chips from many suppliers.
- An intelligent USB gadget, perhaps embedding a Linux system.
These include PDAs running Linux (iPaq, Yopy, Zaurus, and
others), and devices that interoperate using the standard
CDC-Ethernet specification (including many cable modems).
These links will have names like "usb0", "usb1", etc. They act
like two-node Ethernets, so you can use 802.1d Ethernet Bridging
(CONFIG_BRIDGE) to simplify your network routing. For more
information see <http://www.linux-usb.org/usbnet/>.
The link will appear with a name like "usb0", when the link is
a two-node link, or "eth0" for most CDC-Ethernet devices. Those
two-node links are most easily managed with Ethernet Bridging
(CONFIG_BRIDGE) instead of routing.
For more information see <http://www.linux-usb.org/usbnet/>.
This code is also available as a kernel module (code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called usbnet. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
comment "USB Host-to-Host Cables"
depends on USB_USBNET
config USB_AN2720
boolean "AnchorChips 2720 based cables (Xircom PGUNET, ...)"
depends on USB_USBNET
default y
help
Choose this option if you're using a host-to-host cable
based on this design. Note that AnchorChips is now a
Cypress brand.
config USB_BELKIN
boolean "eTEK based host-to-host cables (Advance, Belkin, ...)"
depends on USB_USBNET
default y
help
Choose this option if you're using a host-to-host cable
based on this design: two NetChip 2890 chips and an Atmel
microcontroller, with LEDs that indicate traffic.
config USB_GENESYS
boolean "GeneSys GL620USB-A based cables"
default y
depends on USB_USBNET
help
Choose this option if you're using a host-to-host cable,
or PC2PC motherboard, with this chip.
Note that the half-duplex "GL620USB" is not supported.
config USB_NET1080
boolean "NetChip 1080 based cables (Laplink, ...)"
default y
depends on USB_USBNET
help
Choose this option if you're using a host-to-host cable based
on this design: one NetChip 1080 chips and supporting logic,
supporting LEDs that indicate traffic
config USB_PL2301
boolean "Prolific PL-2301/2302 based cables"
default y
# handshake/init/reset problems, from original 'plusb' driver
depends on USB_USBNET && EXPERIMENTAL
help
Choose this option if you're using a host-to-host cable
with one of these chips.
comment "Intelligent USB Devices/Gadgets"
depends on USB_USBNET
config USB_ARMLINUX
boolean "Embedded ARM Linux links (iPaq, ...)"
depends on USB_USBNET
default y
help
Choose this option to support the "usb-eth" networking driver
used by most of the ARM Linux community with device controllers
such as the SA-11x0 and PXA-25x UDCs.
Although the ROMs shipped with Sharp Zaurus products use a
different link level framing protocol, you can have them use
this simpler protocol by installing a different kernel.
config USB_EPSON2888
boolean "Epson 2888 based firmware (DEVELOPMENT)"
depends on USB_USBNET
default y
help
Choose this option to support the usb networking links used
by some sample firmware from Epson.
config USB_ZAURUS
boolean "Sharp Zaurus (stock ROMs)"
depends on USB_USBNET
default y
help
Choose this option to support the usb networking links used by
Zaurus models like the SL-5000D, SL-5500, SL-5600, A-300, B-500.
If you install an alternate ROM image, you may no longer need
to support this protocol. Only the "eth-fd" driver really needs
this non-conformant variant of CDC Ethernet protocol.
config USB_CDCETHER
boolean "CDC Ethernet support (smart devices such as cable modems)"
# experimental primarily because cdc-ether was.
# make it non-experimental after more interop testing
depends on USB_USBNET && EXPERIMENTAL
default y
help
This option supports devices conforming to the Communication Device
Class (CDC) Ethernet Control Model, a specification that's easy to
implement in device firmware. The CDC specifications are available
from <http://www.usb.org/>.
CDC Ethernet is an implementation option for DOCSIS cable modems
that support USB connectivity, used for non-Microsoft USB hosts.
This driver should work with at least the following devices:
* Ericsson PipeRider (all variants)
* Motorola (DM100 and SB4100)
* Broadcom Cable Modem (reference design)
* Toshiba PCX1100U
* ...
This driver creates an interface named "ethX", where X depends on
what other networking devices you have in use. However, if the
IEEE 802 "local assignment" bit is set in the address, a "usbX"
name is used instead.
......@@ -3,7 +3,6 @@
#
obj-$(CONFIG_USB_CATC) += catc.o
obj-$(CONFIG_USB_CDCETHER) += cdc-ether.o
obj-$(CONFIG_USB_KAWETH) += kaweth.o
obj-$(CONFIG_USB_PEGASUS) += pegasus.o
obj-$(CONFIG_USB_RTL8150) += rtl8150.o
......
......@@ -157,20 +157,7 @@
#include <linux/dma-mapping.h>
/* minidrivers _could_ be individually configured */
#define CONFIG_USB_AN2720
#define CONFIG_USB_BELKIN
#undef CONFIG_USB_CDCETHER
//#define CONFIG_USB_CDCETHER /* NYET */
#define CONFIG_USB_EPSON2888
#define CONFIG_USB_GENESYS
#define CONFIG_USB_NET1080
#define CONFIG_USB_PL2301
#define CONFIG_USB_ARMLINUX
#define CONFIG_USB_ZAURUS
#define DRIVER_VERSION "31-Mar-2003"
#define DRIVER_VERSION "25-Apr-2003"
/*-------------------------------------------------------------------------*/
......@@ -256,6 +243,7 @@ struct driver_info {
#define FLAG_FRAMING_Z 0x0004 /* zaurus adds a trailer */
#define FLAG_NO_SETINT 0x0010 /* device can't set_interface() */
#define FLAG_ETHER 0x0020 /* maybe use "eth%d" names */
/* init device ... can sleep, or cause probe() failure */
int (*bind)(struct usbnet *, struct usb_interface *);
......@@ -314,24 +302,20 @@ MODULE_PARM_DESC (msg_level, "Initial message level (default = 1)");
: (in_interrupt () ? "in_interrupt" : "can sleep"))
#ifdef DEBUG
#define devdbg(usbnet, fmt, arg...) \
do { \
printk(KERN_DEBUG "%s:", (usbnet)->net.name); \
printk(fmt, ## arg); \
printk("\n"); \
} while (0)
#define devdbg(usbnet, fmt, arg...) \
printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net.name , ## arg)
#else
#define devdbg(usbnet, fmt, arg...) do {} while(0)
#endif
#define deverr(usbnet, fmt, arg...) \
printk(KERN_ERR "%s: " fmt "\n" , (usbnet)->net.name, ## arg)
printk(KERN_ERR "%s: " fmt "\n" , (usbnet)->net.name , ## arg)
#define devwarn(usbnet, fmt, arg...) \
printk(KERN_WARNING "%s: " fmt "\n" , (usbnet)->net.name, ## arg)
printk(KERN_WARNING "%s: " fmt "\n" , (usbnet)->net.name , ## arg)
#define devinfo(usbnet, fmt, arg...) \
do { if ((usbnet)->msg_level >= 1) \
printk(KERN_INFO "%s: " fmt "\n" , (usbnet)->net.name, ## arg); \
printk(KERN_INFO "%s: " fmt "\n" , (usbnet)->net.name , ## arg); \
} while (0)
/*-------------------------------------------------------------------------*/
......@@ -396,6 +380,7 @@ get_endpoints (struct usbnet *dev, struct usb_interface *intf)
#ifdef CONFIG_USB_AN2720
#define HAVE_HARDWARE
/*-------------------------------------------------------------------------
*
......@@ -421,6 +406,7 @@ static const struct driver_info an2720_info = {
#ifdef CONFIG_USB_BELKIN
#define HAVE_HARDWARE
/*-------------------------------------------------------------------------
*
......@@ -447,7 +433,11 @@ static const struct driver_info belkin_info = {
* Takes two interfaces. The DATA interface is inactive till an altsetting
* is selected. Configuration data includes class descriptors.
*
* Zaurus uses nonstandard framing, but is otherwise CDC Ether.
* Zaurus uses nonstandard framing, and doesn't uniquify its Ethernet
* addresses, but is otherwise CDC Ether.
*
* This should interop with whatever the 2.4 "CDCEther.c" driver
* (by Brad Hards) talked with.
*
*-------------------------------------------------------------------------*/
......@@ -589,9 +579,17 @@ static int cdc_bind (struct usbnet *dev, struct usb_interface *intf)
if (!info->header || !info ->u || !info->ether)
goto bad_desc;
status = get_ethernet_addr (dev, info->ether);
if (status < 0)
return status;
#ifdef CONFIG_USB_ZAURUS
/* Zaurus ethernet addresses aren't unique ... */
if ((dev->driver_info->flags & FLAG_FRAMING_Z) != 0)
/* ignore */ ;
else
#endif
{
status = get_ethernet_addr (dev, info->ether);
if (status < 0)
return status;
}
/* claim data interface and set it up ... with side effects.
* network traffic can't flow until an altsetting is enabled.
......@@ -609,8 +607,6 @@ static int cdc_bind (struct usbnet *dev, struct usb_interface *intf)
dev->net.mtu = cpu_to_le16p (&info->ether->wMaxSegmentSize)
- ETH_HLEN;
if ((dev->driver_info->flags & FLAG_FRAMING_Z) == 0)
strcpy (dev->net.name, "eth%d");
return 0;
bad_desc:
......@@ -640,9 +636,11 @@ static void cdc_unbind (struct usbnet *dev, struct usb_interface *intf)
#ifdef CONFIG_USB_CDCETHER
#define HAVE_HARDWARE
static const struct driver_info cdc_info = {
.description = "CDC Ethernet Device",
.flags = FLAG_ETHER,
// .check_connect = cdc_check_connect,
.bind = cdc_bind,
.unbind = cdc_unbind,
......@@ -653,6 +651,7 @@ static const struct driver_info cdc_info = {
#ifdef CONFIG_USB_EPSON2888
#define HAVE_HARDWARE
/*-------------------------------------------------------------------------
*
......@@ -663,6 +662,8 @@ static const struct driver_info cdc_info = {
* implements this interface. Product developers can reuse or modify that
* code, such as by using their own product and vendor codes.
*
* Support was from Juro Bystricky <bystricky.juro@erd.epson.com>
*
*-------------------------------------------------------------------------*/
static const struct driver_info epson2888_info = {
......@@ -676,6 +677,7 @@ static const struct driver_info epson2888_info = {
#ifdef CONFIG_USB_GENESYS
#define HAVE_HARDWARE
/*-------------------------------------------------------------------------
*
......@@ -693,6 +695,9 @@ static const struct driver_info epson2888_info = {
* the transfer direction. (That's disabled here, partially coded.)
* A control URB would block until other side writes an interrupt.
*
* Original code from Jiun-Jie Huang <huangjj@genesyslogic.com.tw>
* and merged into "usbnet" by Stanislav Brabec <utx@penguin.cz>.
*
*-------------------------------------------------------------------------*/
// control msg write command
......@@ -1011,6 +1016,7 @@ static const struct driver_info genelink_info = {
#ifdef CONFIG_USB_NET1080
#define HAVE_HARDWARE
/*-------------------------------------------------------------------------
*
......@@ -1526,11 +1532,15 @@ static const struct driver_info net1080_info = {
#ifdef CONFIG_USB_PL2301
#define HAVE_HARDWARE
/*-------------------------------------------------------------------------
*
* Prolific PL-2301/PL-2302 driver ... http://www.prolifictech.com
*
* The protocol and handshaking used here should be bug-compatible
* with the Linux 2.2 "plusb" driver, by Deti Fliegl.
*
*-------------------------------------------------------------------------*/
/*
......@@ -1590,6 +1600,7 @@ static const struct driver_info prolific_info = {
#ifdef CONFIG_USB_ARMLINUX
#define HAVE_HARDWARE
/*-------------------------------------------------------------------------
*
......@@ -1622,6 +1633,7 @@ static const struct driver_info yopy_info = {
#ifdef CONFIG_USB_ZAURUS
#define HAVE_HARDWARE
#include <linux/crc32.h>
......@@ -1736,7 +1748,9 @@ static struct net_device_stats *usbnet_get_stats (struct net_device *net)
/*-------------------------------------------------------------------------*/
/* urb completions may be in_irq; avoid doing real work then. */
/* some LK 2.4 HCDs oopsed if we freed or resubmitted urbs from
* completion callbacks. 2.5 should have fixed those bugs...
*/
static void defer_bh (struct usbnet *dev, struct sk_buff *skb)
{
......@@ -2502,6 +2516,10 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
int status;
info = (struct driver_info *) prod->driver_info;
if (!info) {
dev_dbg (&udev->dev, "blacklisted by %s\n", driver_name);
return -ENODEV;
}
xdev = interface_to_usbdev (udev);
interface = &udev->altsetting [udev->act_altsetting];
......@@ -2553,9 +2571,15 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
// allow device-specific bind/init procedures
// NOTE net->name still not usable ...
if (info->bind)
if (info->bind) {
status = info->bind (dev, udev);
else if (!info->in || info->out)
// heuristic: "usb%d" for links we know are two-host,
// else "eth%d" when there's reasonable doubt. userspace
// can rename the link if it knows better.
if ((dev->driver_info->flags & FLAG_ETHER) != 0
&& (net->dev_addr [0] & 0x02) == 0)
strcpy (net->name, "eth%d");
} else if (!info->in || info->out)
status = get_endpoints (dev, udev);
else {
dev->in = usb_rcvbulkpipe (xdev, info->in);
......@@ -2592,6 +2616,10 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
/*-------------------------------------------------------------------------*/
#ifndef HAVE_HARDWARE
#error You need to configure some hardware for this driver
#endif
/*
* chip vendor names won't normally be on the cables, and
* may not be on the device.
......@@ -2716,6 +2744,22 @@ static const struct usb_device_id products [] = {
#endif
#ifdef CONFIG_USB_CDCETHER
#ifndef CONFIG_USB_ZAURUS
/* if we couldn't whitelist Zaurus, we must blacklist it */
{
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO
| USB_DEVICE_ID_MATCH_DEVICE,
.idVendor = 0x04DD,
.idProduct = 0x8004,
/* match the master interface */
.bInterfaceClass = USB_CLASS_COMM,
.bInterfaceSubClass = 6 /* Ethernet model */,
.bInterfaceProtocol = 0,
.driver_info = 0, /* BLACKLIST */
},
#endif
{
/* CDC Ether uses two interfaces, not necessarily consecutive.
* We match the main interface, ignoring the optional device
......@@ -2725,10 +2769,7 @@ static const struct usb_device_id products [] = {
* NOTE: this match must come AFTER entries working around
* bugs/quirks in a given product (like Zaurus, above).
*/
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO,
.bInterfaceClass = USB_CLASS_COMM,
.bInterfaceSubClass = 6 /* Ethernet model */,
.bInterfaceProtocol = 0,
USB_INTERFACE_INFO (USB_CLASS_COMM, 6 /* Ethernet model */, 0),
.driver_info = (unsigned long) &cdc_info,
},
#endif
......
......@@ -222,8 +222,6 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig
dbg("%s - port %d", __FUNCTION__, port->number);
usb_serial_debug_data (__FILE__, __FUNCTION__, count, buf);
while (count > 0) {
/* try to find a free urb in our list of them */
......@@ -264,6 +262,8 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig
memcpy (urb->transfer_buffer, current_position, transfer_size);
}
usb_serial_debug_data (__FILE__, __FUNCTION__, transfer_size, urb->transfer_buffer);
/* build up our urb */
usb_fill_bulk_urb (
urb,
......
......@@ -1356,6 +1356,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
} else {
memcpy(&fifo->fifo[fifo->head], data, firsthalf);
}
usb_serial_debug_data (__FILE__, __FUNCTION__, firsthalf, &fifo->fifo[fifo->head]);
// update the index and size
fifo->head += firsthalf;
......@@ -1376,16 +1377,13 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
} else {
memcpy(&fifo->fifo[fifo->head], &data[firsthalf], secondhalf);
}
usb_serial_debug_data (__FILE__, __FUNCTION__, secondhalf, &fifo->fifo[fifo->head]);
// update the index and size
fifo->count += secondhalf;
fifo->head += secondhalf;
// No need to check for wrap since we can not get to end of fifo in this part
}
if (copySize) {
usb_serial_debug_data (__FILE__, __FUNCTION__, copySize, data);
}
send_more_port_data((struct edgeport_serial *)usb_get_serial_data(port->serial), edge_port);
dbg("%s wrote %d byte(s) TxCredits %d, Fifo %d", __FUNCTION__, copySize, edge_port->txCredits, fifo->count);
......
......@@ -370,8 +370,6 @@ static int ipaq_write(struct usb_serial_port *port, int from_user, const unsigne
dbg("%s - port %d", __FUNCTION__, port->number);
usb_serial_debug_data(__FILE__, __FUNCTION__, count, buf);
while (count > 0) {
transfer_size = min(count, PACKET_SIZE);
if (ipaq_write_bulk(port, from_user, current_position, transfer_size)) {
......
......@@ -340,8 +340,8 @@ static int keyspan_write(struct usb_serial_port *port, int from_user,
p_priv = usb_get_serial_port_data(port);
d_details = p_priv->device_details;
dbg("%s - for port %d (%d chars [%x]), flip=%d",
__FUNCTION__, port->number, count, buf[0], p_priv->out_flip);
dbg("%s - for port %d (%d chars), flip=%d",
__FUNCTION__, port->number, count, p_priv->out_flip);
for (left = count; left > 0; left -= todo) {
todo = left;
......
......@@ -370,7 +370,7 @@ static inline void usb_serial_debug_data (const char *file, const char *function
/* Use our own dbg macro */
#undef dbg
#define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG __FILE__ ": " format "\n" , ## arg); } while (0)
#define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg); } while (0)
......
......@@ -35,6 +35,14 @@
/* If you edit this file, please try to keep it sorted first by VendorID,
* then by ProductID.
*
* If you want to add an entry for this file, please send the following
* to greg@kroah.com:
* - patch that adds the entry for your device which includes your
* email address right above the entry.
* - a copy of /proc/bus/usb/devices with your device plugged in
* running with this patch.
*
*/
UNUSUAL_DEV( 0x03ee, 0x0000, 0x0000, 0x0245,
......@@ -229,10 +237,18 @@ UNUSUAL_DEV( 0x0525, 0xa140, 0x0100, 0x0100,
US_SC_8070, US_PR_BULK, NULL,
US_FL_FIX_INQUIRY | US_FL_START_STOP ),
/* Submitted by Lars Gemeinhardt <linux-usb@gemeinhardt.info>
* Needed for START_STOP flag */
UNUSUAL_DEV( 0x0547, 0x2810, 0x0001, 0x0001,
"Mello",
"MP3 Player",
US_SC_SCSI, US_PR_BULK, NULL,
US_FL_START_STOP),
/* This entry is needed because the device reports Sub=ff */
UNUSUAL_DEV( 0x054c, 0x0010, 0x0106, 0x0440,
UNUSUAL_DEV( 0x054c, 0x0010, 0x0106, 0x0450,
"Sony",
"DSC-S30/S70/S75/505V/F505/F707/F717",
"DSC-S30/S70/S75/505V/F505/F707/F717/P8",
US_SC_SCSI, US_PR_CB, NULL,
US_FL_SINGLE_LUN | US_FL_START_STOP | US_FL_MODE_XLATE ),
......@@ -299,6 +315,19 @@ UNUSUAL_DEV( 0x0a17, 0x0004, 0x1000, 0x1000,
US_SC_8070, US_PR_CBI, NULL,
US_FL_FIX_INQUIRY ),
/* This Pentax still camera is not conformant
* to the USB storage specification: -
* - It does not like the INQUIRY command. So we must handle this command
* of the SCSI layer ourselves.
* Tested on Rev. 10.00 (0x1000)
* Submitted by James Courtier-Dutton <James@superbug.demon.co.uk>
*/
UNUSUAL_DEV( 0x0a17, 0x0004, 0x1000, 0x1000,
"ASAHI PENTAX",
"PENTAX OPTIO 430",
US_SC_8070, US_PR_CBI, NULL,
US_FL_FIX_INQUIRY ),
#ifdef CONFIG_USB_STORAGE_ISD200
UNUSUAL_DEV( 0x05ab, 0x0031, 0x0100, 0x0110,
"In-System",
......
......@@ -564,7 +564,7 @@ static inline void rep_nop(void)
#define ARCH_HAS_PREFETCH
extern inline void prefetch(const void *x)
{
alternative_input(ASM_NOP3,
alternative_input(ASM_NOP4,
"prefetchnta (%1)",
X86_FEATURE_XMM,
"r" (x));
......@@ -578,7 +578,7 @@ extern inline void prefetch(const void *x)
spinlocks to avoid one state transition in the cache coherency protocol. */
extern inline void prefetchw(const void *x)
{
alternative_input(ASM_NOP3,
alternative_input(ASM_NOP4,
"prefetchw (%1)",
X86_FEATURE_3DNOW,
"r" (x));
......
......@@ -51,7 +51,7 @@ static char *virtual_dma_addr;
static int virtual_dma_mode;
static int doing_pdma;
static void floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
{
register unsigned char st;
......@@ -109,12 +109,14 @@ static void floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
#endif
doing_pdma = 0;
floppy_interrupt(irq, dev_id, regs);
return;
return IRQ_HANDLED;
}
#ifdef TRACE_FLPY_INT
if(!virtual_dma_count)
dma_wait++;
#endif
return IRQ_HANDLED;
}
static void fd_disable_dma(void)
......
......@@ -198,6 +198,8 @@ extern void mp_parse_prt (void);
#endif /*CONFIG_X86_IO_APIC*/
#endif
extern void mp_config_ioapic_for_sci(int irq);
extern int using_apic_timer;
#endif
......
......@@ -228,6 +228,9 @@ extern inline unsigned int cpuid_edx(unsigned int op)
/* VIA Cyrix defined MSRs*/
#define MSR_VIA_FCR 0x1107
#define MSR_VIA_LONGHAUL 0x110a
#define MSR_VIA_RNG 0x110b
#define MSR_VIA_BCR2 0x1147
/* Intel defined MSRs. */
#define MSR_IA32_P5_MC_ADDR 0
......
......@@ -304,11 +304,16 @@ extern inline void sync_core(void)
#define cpu_has_fpu 1
#if 0
/* disabled for now to work around opteron errata #91. Also gcc 3.2
doesn't like this in some cases. */
#define ARCH_HAS_PREFETCH
#define prefetch(x) __builtin_prefetch((x),0,1)
#endif
#define ARCH_HAS_PREFETCHW
#define ARCH_HAS_SPINLOCK_PREFETCH
#define prefetch(x) __builtin_prefetch((x),0,1)
#define prefetchw(x) __builtin_prefetch((x),1,1)
#define spin_lock_prefetch(x) prefetchw(x)
#define cpu_relax() rep_nop()
......
#ifndef _ASM_X86_64_VSYSCALL_H_
#define _ASM_X86_64_VSYSCALL_H_
#include <linux/time.h>
#include <linux/seqlock.h>
enum vsyscall_num {
......
......@@ -765,6 +765,7 @@ static inline void usb_fill_int_urb (struct urb *urb,
urb->start_frame = -1;
}
extern void usb_init_urb(struct urb *urb);
extern struct urb *usb_alloc_urb(int iso_packets, int mem_flags);
extern void usb_free_urb(struct urb *urb);
#define usb_put_urb usb_free_urb
......@@ -973,7 +974,7 @@ void usb_show_device(struct usb_device *);
void usb_show_string(struct usb_device *dev, char *id, int index);
#ifdef DEBUG
#define dbg(format, arg...) printk(KERN_DEBUG __FILE__ ": " format "\n" , ## arg)
#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg)
#else
#define dbg(format, arg...) do {} while (0)
#endif
......
......@@ -292,8 +292,11 @@ skip_copy_pmd_range: address = (address + PGDIR_SIZE) & PGDIR_MASK;
* and not mapped via rmap - duplicate the
* mapping as is.
*/
page = pfn_to_page(pfn);
if (!pfn_valid(pfn) || PageReserved(page)) {
page = NULL;
if (pfn_valid(pfn))
page = pfn_to_page(pfn);
if (!page || PageReserved(page)) {
set_pte(dst_pte, pte);
goto cont_copy_pte_range_noset;
}
......
......@@ -1247,7 +1247,7 @@ static void dealloc_dmabuf(struct cs_state *state)
mapend = virt_to_page(dmabuf->rawbuf +
(PAGE_SIZE << dmabuf->buforder) - 1);
for (map = virt_to_page(dmabuf->rawbuf); map <= mapend; map++)
cs4x_ClearPageReserved(map);
ClearPageReserved(map);
free_dmabuf(state->card, dmabuf);
}
......@@ -1256,7 +1256,7 @@ static void dealloc_dmabuf(struct cs_state *state)
mapend = virt_to_page(dmabuf->tmpbuff +
(PAGE_SIZE << dmabuf->buforder_tmpbuff) - 1);
for (map = virt_to_page(dmabuf->tmpbuff); map <= mapend; map++)
cs4x_ClearPageReserved(map);
ClearPageReserved(map);
free_dmabuf2(state->card, dmabuf);
}
......
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