Commit 0ac534e3 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.34pre2

parent eb101b30
......@@ -944,7 +944,7 @@ L: linux-usb@suse.com
W: http://www.linux-usb.org
S: Supported
USB HUB AND UHCI DRIVERS
USB HUB
P: Johannes Erdfelt
M: jerdfelt@sventech.com
L: linux-usb@suse.com
......@@ -958,6 +958,13 @@ L: linux-usb@suse.com
S: Maintained (not yet usable)
W: http://suitenine.com/usb/
USB UHCI DRIVER
P: Georg Acher
M: usb@in.tum.de
L: linux-usb@suse.com
W: http://usb.in.tum.de
S: Maintained
VFAT FILESYSTEM:
P: Gordon Chaffee
M: chaffee@cs.berkeley.edu
......
This diff is collapsed.
......@@ -106,7 +106,6 @@ CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_BLK_DEV_AEC6210 is not set
CONFIG_BLK_DEV_PIIX=y
# CONFIG_BLK_DEV_PIIX_TUNING is not set
# CONFIG_IDE_CHIPSETS is not set
# CONFIG_BLK_CPQ_DA is not set
......@@ -348,6 +347,11 @@ CONFIG_SERIAL=y
CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256
#
# I2C support
#
# CONFIG_I2C is not set
#
# Mice
#
......
......@@ -2805,7 +2805,6 @@ int __init ide_setup (char *s)
drive->scsi = 1;
goto done;
#else
#warning ide scsi-emulation selected but no SCSI-subsystem in kernel
drive->scsi = 0;
goto bad_option;
#endif /* defined(CONFIG_BLK_DEV_IDESCSI) && defined(CONFIG_SCSI) */
......
......@@ -78,6 +78,7 @@
* Released under terms of General Public License
*/
#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
......
......@@ -50,8 +50,7 @@ endif
ifeq ($(CONFIG_SK98LIN),y)
SUB_DIRS += sk98lin
MOD_IN_SUB_DIRS += sk98lin
L_OBJS += sk98lin/sk98lin.o
obj-y += sk98lin/sk98lin.o
else
ifeq ($(CONFIG_SK98LIN),m)
MOD_IN_SUB_DIRS += sk98lin
......
......@@ -2,7 +2,7 @@
# USB device configuration
#
mainmenu_option next_comment
comment 'Support for USB'
comment 'USB support'
tristate 'Support for USB' CONFIG_USB
if [ ! "$CONFIG_USB" = "n" ]; then
......@@ -15,7 +15,7 @@ comment 'USB Controllers'
comment 'Miscellaneous USB options'
if [ "$CONFIG_PROC_FS" != "n" ]; then
bool ' Preliminary /proc/bus/usb support' CONFIG_USB_PROC
bool ' /proc/bus/usb support' CONFIG_USB_PROC
fi
dep_tristate ' EZUSB Firmware downloader' CONFIG_USB_EZUSB $CONFIG_USB
......
This serial driver currently only works with the Belkin and Peracom USB
Serial devices. It should also work for the Etek converter, but I do
not know the vendor id, and device id of that device (if anyone does,
not know the vendor id and device id of that device (if anyone does,
please let me know.)
If your device is not compatible with the above models, you can try
......@@ -19,17 +19,15 @@ data from the converter. However, since I do not have a spec for the Belkin,
Peracom, and eTek devices, and the raw dumps from the Win98 driver are
confusing, and eTek keeps giving me the run around, no control signals are
currently handled, and the data will most likely come through on a baud
rate that you are not expecting.
The major number that the driver uses is 240 (in the local/experimental
range.) It will stay there until some agreements are reached on how to
handle the configuration problem that USB provides.
To use the driver, create the following nodes:
mknod /dev/ttyUSB0 c 240 0
mknod /dev/ttyUSB1 c 240 1
mknod /dev/ttyUSB2 c 240 2
mknod /dev/ttyUSB3 c 240 3
rate that you are not expecting. So if you have these devices, do not
expect the correct data to show up at either end.
The major number that the driver uses is 188 so to use the driver, create
the following nodes:
mknod /dev/ttyUSB0 c 188 0
mknod /dev/ttyUSB1 c 188 1
mknod /dev/ttyUSB2 c 188 2
mknod /dev/ttyUSB3 c 188 3
then plug in a device and use your friendly terminal program to see what
happens.
......
......@@ -139,7 +139,7 @@ static int acm_irq(int state, void *__buffer, int count, void *dev_id)
{
unsigned char *data;
struct acm_state *acm = (struct acm_state *)dev_id;
devrequest *dr;
devrequest *dr;
info("ACM_USB_IRQ\n");
......@@ -153,13 +153,13 @@ static int acm_irq(int state, void *__buffer, int count, void *dev_id)
if (!acm->active)
return 1;
dr = __buffer;
dr = __buffer;
data = __buffer;
data += sizeof(dr);
#if 0
printk("reqtype: %02X\n",dr->requesttype);
printk("request: %02X\n",dr->request);
printk("reqtype: %02X\n",dr->requesttype);
printk("request: %02X\n",dr->request);
printk("wValue: %02X\n",dr->value);
printk("wIndex: %02X\n",dr->index);
printk("wLength: %02X\n",dr->length);
......@@ -414,7 +414,7 @@ static void * acm_probe(struct usb_device *dev, unsigned int ifnum)
/* Only use CDC */
if (dev->descriptor.bDeviceClass != 2 ||
dev->descriptor.bDeviceSubClass != 0 ||
dev->descriptor.bDeviceProtocol != 0)
dev->descriptor.bDeviceProtocol != 0)
return NULL;
#define IFCLASS(if) ((if->bInterfaceClass << 24) | (if->bInterfaceSubClass << 16) | (if->bInterfaceProtocol << 8) | (if->bNumEndpoints))
......
This diff is collapsed.
......@@ -201,12 +201,14 @@ static int usb_cpia_set_sensor_fps(struct usb_device *dev, int sensorbaserate, i
(sensorbaserate << 8) + sensorclkdivisor, 0, NULL, 0, HZ);
}
#ifdef NOTUSED
static int usb_cpia_grab_frame(struct usb_device *dev, int streamstartline)
{
return usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
USB_REQ_CPIA_GRAB_FRAME, USB_TYPE_VENDOR | USB_RECIP_DEVICE,
streamstartline << 8, 0, NULL, 0, HZ);
}
#endif
static int usb_cpia_upload_frame(struct usb_device *dev, int forceupload)
{
......@@ -514,23 +516,24 @@ copylen += 6;
/*
* Make all of the blocks of data contiguous
*/
static int cpia_compress_isochronous(struct usb_cpia *cpia, struct usb_isoc_desc *isodesc)
static int cpia_compress_isochronous(struct usb_cpia *cpia, urb_t *urb)
{
unsigned char *cdata, *data;
int i, totlen = 0;
cdata = isodesc->data;
data = cpia->scratch + cpia->scratchlen;
for (i = 0; i < isodesc->frame_count; i++) {
int n = isodesc->frames[i].frame_length;
int st = isodesc->frames[i].frame_status;
for (i = 0; i < urb->number_of_packets; i++) {
int n = urb->iso_frame_desc[i].actual_length;
int st = urb->iso_frame_desc[i].status;
cdata = urb->transfer_buffer + urb->iso_frame_desc[i].offset;
if (st && debug >= 1)
printk(KERN_DEBUG "cpia data error: [%d] len=%d, status=%X\n",
i, n, st);
if ((cpia->scratchlen + n) > SCRATCH_BUF_SIZE) {
printk(KERN_DEBUG "cpia: scratch buf overflow!\n");
printk(KERN_DEBUG "cpia: scratch buf overflow!scr_len: %d, n: %d\n",cpia->scratchlen, n );
return totlen;
}
......@@ -540,30 +543,33 @@ static int cpia_compress_isochronous(struct usb_cpia *cpia, struct usb_isoc_desc
totlen += n;
cpia->scratchlen += n;
}
cdata += isodesc->frame_size;
}
return totlen;
}
static int cpia_isoc_irq(int status, void *__buffer, int len, void *isocdesc)
static void cpia_isoc_irq(struct urb *urb)
{
void *dev_id = ((struct usb_isoc_desc *)isocdesc)->context;
struct usb_cpia *cpia = (struct usb_cpia *)dev_id;
int len;
struct usb_cpia *cpia = urb->context;
struct cpia_sbuf *sbuf;
int i;
#if 0
printk("cpia_isoc_irq: %p status %d, errcount = %d, length = %d\n", urb, urb->status, urb->error_count, urb->actual_length);
#endif
if (!cpia->streaming) {
if (debug >= 1)
printk(KERN_DEBUG "cpia: oops, not streaming, but interrupt\n");
return 0;
return;
}
sbuf = &cpia->sbuf[cpia->cursbuf];
usb_kill_isoc(sbuf->isodesc);
// usb_kill_isoc(sbuf->isodesc);
/* Copy the data received into our scratch buffer */
len = cpia_compress_isochronous(cpia, sbuf->isodesc);
len = cpia_compress_isochronous(cpia, urb);
/* If we don't have a frame we're current working on, complain */
if (cpia->scratchlen) {
......@@ -574,22 +580,23 @@ static int cpia_isoc_irq(int status, void *__buffer, int len, void *isocdesc)
cpia_parse_data(cpia);
}
for (i = 0; i < FRAMES_PER_DESC; i++)
sbuf->isodesc->frames[i].frame_length = FRAME_SIZE_PER_DESC;
for (i = 0; i < FRAMES_PER_DESC; i++) {
sbuf->urb->iso_frame_desc[i].status = 0;
sbuf->urb->iso_frame_desc[i].actual_length = 0;
}
/* Move to the next sbuf */
cpia->cursbuf = (cpia->cursbuf + 1) % CPIA_NUMSBUF;
/* Reschedule this block of Isochronous desc */
usb_run_isoc(sbuf->isodesc, cpia->sbuf[cpia->cursbuf].isodesc);
// usb_run_isoc(sbuf->isodesc, cpia->sbuf[cpia->cursbuf].isodesc);
return -1;
return;
}
static int cpia_init_isoc(struct usb_cpia *cpia)
{
struct usb_device *dev = cpia->dev;
struct usb_isoc_desc *id;
urb_t *urb;
int fx, err;
cpia->compress = 0;
......@@ -598,57 +605,63 @@ static int cpia_init_isoc(struct usb_cpia *cpia)
cpia->scratchlen = 0;
/* Alternate interface 3 is is the biggest frame size */
if (usb_set_interface(cpia->dev, 1, 3) < 0) {
if (usb_set_interface(cpia->dev, cpia->iface, 3) < 0) {
printk(KERN_ERR "usb_set_interface error\n");
return -EBUSY;
}
/* We double buffer the Iso lists */
err = usb_init_isoc(dev, usb_rcvisocpipe(dev, 1), FRAMES_PER_DESC,
cpia, &cpia->sbuf[0].isodesc);
if (err) {
// err = usb_init_isoc(dev, usb_rcvisocpipe(dev, 1), FRAMES_PER_DESC, cpia, &cpia->sbuf[0].isodesc);
urb = usb_alloc_urb(FRAMES_PER_DESC);
if (!urb) {
printk(KERN_ERR "cpia_init_isoc: usb_init_isoc ret %d\n",
err);
0);
return -ENOMEM;
}
err = usb_init_isoc(dev, usb_rcvisocpipe(dev, 1), FRAMES_PER_DESC,
cpia, &cpia->sbuf[1].isodesc);
if (err) {
cpia->sbuf[0].urb = urb;
urb->dev = dev;
urb->context = cpia;
urb->pipe = usb_rcvisocpipe(dev, 1);
urb->transfer_flags = USB_ISO_ASAP;
urb->transfer_buffer = cpia->sbuf[0].data;
urb->complete = cpia_isoc_irq;
urb->number_of_packets = FRAMES_PER_DESC;
urb->transfer_buffer_length = FRAME_SIZE_PER_DESC * FRAMES_PER_DESC;
for (fx = 0; fx < FRAMES_PER_DESC; fx++) {
urb->iso_frame_desc[fx].offset = FRAME_SIZE_PER_DESC * fx;
urb->iso_frame_desc[fx].length = FRAME_SIZE_PER_DESC;
}
urb = usb_alloc_urb(FRAMES_PER_DESC);
if (!urb) {
printk(KERN_ERR "cpia_init_isoc: usb_init_isoc ret %d\n",
err);
usb_free_isoc (cpia->sbuf[0].isodesc);
0);
return -ENOMEM;
}
cpia->sbuf[1].urb = urb;
urb->dev = dev;
urb->context = cpia;
urb->pipe = usb_rcvisocpipe(dev, 1);
urb->transfer_flags = USB_ISO_ASAP;
urb->transfer_buffer = cpia->sbuf[1].data;
urb->complete = cpia_isoc_irq;
urb->number_of_packets = FRAMES_PER_DESC;
urb->transfer_buffer_length = FRAME_SIZE_PER_DESC * FRAMES_PER_DESC;
for (fx = 0; fx < FRAMES_PER_DESC; fx++) {
urb->iso_frame_desc[fx].offset = FRAME_SIZE_PER_DESC * fx;
urb->iso_frame_desc[fx].length = FRAME_SIZE_PER_DESC;
}
/* Set the Isoc. desc. parameters. */
/* First for desc. [0] */
id = cpia->sbuf[0].isodesc;
id->start_type = START_ASAP;
id->callback_frames = 10; /* on every 10th frame */
id->callback_fn = cpia_isoc_irq;
id->data = cpia->sbuf[0].data;
id->buf_size = FRAME_SIZE_PER_DESC * FRAMES_PER_DESC;
for (fx = 0; fx < FRAMES_PER_DESC; fx++)
id->frames[fx].frame_length = FRAME_SIZE_PER_DESC;
/* and for desc. [1] */
id = cpia->sbuf[1].isodesc;
id->start_type = 0; /* will follow the first desc. */
id->callback_frames = 10; /* on every 10th frame */
id->callback_fn = cpia_isoc_irq;
id->data = cpia->sbuf[1].data;
id->buf_size = FRAME_SIZE_PER_DESC * FRAMES_PER_DESC;
for (fx = 0; fx < FRAMES_PER_DESC; fx++)
id->frames[fx].frame_length = FRAME_SIZE_PER_DESC;
err = usb_run_isoc(cpia->sbuf[0].isodesc, NULL);
cpia->sbuf[1].urb->next = cpia->sbuf[0].urb;
cpia->sbuf[0].urb->next = cpia->sbuf[1].urb;
err = usb_submit_urb(cpia->sbuf[0].urb);
if (err)
printk(KERN_ERR "cpia_init_isoc: usb_run_isoc ret %d\n",
printk(KERN_ERR "cpia_init_isoc: usb_run_isoc(0) ret %d\n",
err);
err = usb_run_isoc(cpia->sbuf[1].isodesc, cpia->sbuf[0].isodesc);
err = usb_submit_urb(cpia->sbuf[1].urb);
if (err)
printk(KERN_ERR "cpia_init_isoc: usb_run_isoc ret %d\n",
printk(KERN_ERR "cpia_init_isoc: usb_run_isoc(1) ret %d\n",
err);
cpia->streaming = 1;
......@@ -668,20 +681,20 @@ static void cpia_stop_isoc(struct usb_cpia *cpia)
}
/* Set packet size to 0 */
if (usb_set_interface(cpia->dev, 1, 0) < 0) {
if (usb_set_interface(cpia->dev, cpia->iface, 0) < 0) {
printk(KERN_ERR "usb_set_interface error\n");
return /* -EINVAL */;
}
/* Unschedule all of the iso td's */
usb_kill_isoc(cpia->sbuf[1].isodesc);
usb_kill_isoc(cpia->sbuf[0].isodesc);
usb_unlink_urb(cpia->sbuf[1].urb);
usb_unlink_urb(cpia->sbuf[0].urb);
cpia->streaming = 0;
/* Delete them all */
usb_free_isoc(cpia->sbuf[1].isodesc);
usb_free_isoc(cpia->sbuf[0].isodesc);
usb_free_urb(cpia->sbuf[1].urb);
usb_free_urb(cpia->sbuf[0].urb);
}
static int cpia_new_frame(struct usb_cpia *cpia, int framenum)
......@@ -1197,12 +1210,8 @@ static int usb_cpia_configure(struct usb_cpia *cpia)
struct usb_device *dev = cpia->dev;
unsigned char version[4];
/* claim interface 1 */
usb_driver_claim_interface(&cpia_driver,
&dev->actconfig->interface[1], cpia);
/* Set altsetting 0 on interface 1 */
if (usb_set_interface(dev, 1, 0) < 0) {
/* Set altsetting 0 */
if (usb_set_interface(dev, cpia->iface, 0) < 0) {
printk(KERN_ERR "usb_set_interface error\n");
return -EBUSY;
}
......@@ -1273,7 +1282,7 @@ static int usb_cpia_configure(struct usb_cpia *cpia)
error:
video_unregister_device(&cpia->vdev);
usb_driver_release_interface(&cpia_driver,
&dev->actconfig->interface[1]);
&dev->actconfig->interface[0]);
kfree(cpia);
......@@ -1314,6 +1323,7 @@ static void * cpia_probe(struct usb_device *dev, unsigned int ifnum)
memset(cpia, 0, sizeof(*cpia));
cpia->dev = dev;
cpia->iface = interface->bInterfaceNumber;
if (!usb_cpia_configure(cpia)) {
cpia->user=0;
......@@ -1329,7 +1339,7 @@ static void cpia_disconnect(struct usb_device *dev, void *ptr)
video_unregister_device(&cpia->vdev);
usb_driver_release_interface(&cpia_driver,
&cpia->dev->actconfig->interface[1]);
&cpia->dev->actconfig->interface[0]);
/* Free the memory */
kfree(cpia);
......
......@@ -137,7 +137,7 @@ struct usb_device;
struct cpia_sbuf {
char *data;
struct usb_isoc_desc *isodesc;
urb_t *urb;
};
enum {
......@@ -179,6 +179,8 @@ struct usb_cpia {
/* Device structure */
struct usb_device *dev;
unsigned char iface;
struct semaphore lock;
int user; /* user count for exclusive use */
......
This diff is collapsed.
......@@ -36,7 +36,6 @@
/*****************************************************************************/
#include <linux/version.h>
#include <linux/config.h>
#include <linux/module.h>
#include <linux/socket.h>
#include <linux/miscdevice.h>
......@@ -96,34 +95,34 @@ static void free_async(struct async *as)
extern inline unsigned int ld2(unsigned int x)
{
unsigned int r = 0;
if (x >= 0x10000) {
x >>= 16;
r += 16;
}
if (x >= 0x100) {
x >>= 8;
r += 8;
}
if (x >= 0x10) {
x >>= 4;
r += 4;
}
if (x >= 4) {
x >>= 2;
r += 2;
}
if (x >= 2)
r++;
return r;
unsigned int r = 0;
if (x >= 0x10000) {
x >>= 16;
r += 16;
}
if (x >= 0x100) {
x >>= 8;
r += 8;
}
if (x >= 0x10) {
x >>= 4;
r += 4;
}
if (x >= 4) {
x >>= 2;
r += 2;
}
if (x >= 2)
r++;
return r;
}
#if 0
/* why doesn't this work properly on i386? */
extern inline unsigned int ld2(unsigned int x)
{
unsigned int r;
unsigned int r;
__asm__("bsrl %1,%0" : "=r" (r) : "g" (x));
return r;
......@@ -723,7 +722,7 @@ static int ezusb_asynccompl(struct async *as, void *arg)
static int ezusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
{
struct ezusb *ez = (struct ezusb *)file->private_data;
DECLARE_WAITQUEUE(wait, current);
DECLARE_WAITQUEUE(wait, current);
struct usb_proc_ctrltransfer pctrl;
struct usb_proc_bulktransfer pbulk;
struct usb_proc_old_ctrltransfer opctrl;
......@@ -976,13 +975,13 @@ static struct file_operations ezusb_fops = {
static void * ezusb_probe(struct usb_device *usbdev, unsigned int ifnum)
{
struct ezusb *ez = &ezusb[0];
struct usb_interface_descriptor *interface;
struct usb_endpoint_descriptor *endpoint;
struct usb_interface_descriptor *interface;
struct usb_endpoint_descriptor *endpoint;
#undef KERN_DEBUG
#define KERN_DEBUG ""
printk(KERN_DEBUG "ezusb: probe: vendor id 0x%x, device id 0x%x\n",
usbdev->descriptor.idVendor, usbdev->descriptor.idProduct);
printk(KERN_DEBUG "ezusb: probe: vendor id 0x%x, device id 0x%x\n",
usbdev->descriptor.idVendor, usbdev->descriptor.idProduct);
/* the 1234:5678 is just a self assigned test ID */
if ((usbdev->descriptor.idVendor != 0x0547 || usbdev->descriptor.idProduct != 0x2131)
......@@ -992,16 +991,16 @@ static void * ezusb_probe(struct usb_device *usbdev, unsigned int ifnum)
(usbdev->descriptor.idVendor != 0x1234 || usbdev->descriptor.idProduct != 0x5678)
#endif
)
return NULL;
return NULL;
/* We don't handle multiple configurations */
if (usbdev->descriptor.bNumConfigurations != 1)
return NULL;
/* We don't handle multiple configurations */
if (usbdev->descriptor.bNumConfigurations != 1)
return NULL;
#if 0
/* We don't handle multiple interfaces */
/* We don't handle multiple interfaces */
if (usbdev->config[0].bNumInterfaces != 1)
return NULL;
return NULL;
#endif
down(&ez->mutex);
......@@ -1023,7 +1022,7 @@ static void * ezusb_probe(struct usb_device *usbdev, unsigned int ifnum)
}
up(&ez->mutex);
MOD_INC_USE_COUNT;
return ez;
return ez;
err:
up(&ez->mutex);
......@@ -1044,10 +1043,10 @@ static void ezusb_disconnect(struct usb_device *usbdev, void *ptr)
}
static struct usb_driver ezusb_driver = {
"ezusb",
ezusb_probe,
ezusb_disconnect,
{ NULL, NULL },
"ezusb",
ezusb_probe,
ezusb_disconnect,
{ NULL, NULL },
&ezusb_fops,
192
};
......@@ -1069,7 +1068,7 @@ int ezusb_init(void)
}
/* register misc device */
usb_register(&ezusb_driver);
printk(KERN_INFO "ezusb: Anchorchip firmware download driver registered\n");
printk(KERN_INFO "ezusb: Anchorchip firmware download driver registered\n");
return 0;
}
......
//$Id: firmware.c,v 1.4 1999/12/13 14:15:28 fliegl Exp $
//$Id: firmware.h,v 1.1 1999/12/17 08:55:05 fliegl Exp $
static INTEL_HEX_RECORD firmware[] = {
{ 2,
0x0,
......
......@@ -121,8 +121,10 @@ static int usb_hub_configure(struct usb_hub *hub)
if (!bitmap)
return -1;
if (usb_get_hub_descriptor(dev, bitmap, header->bLength) < 0)
if (usb_get_hub_descriptor(dev, bitmap, header->bLength) < 0) {
kfree(bitmap);
return -1;
}
descriptor = (struct usb_hub_descriptor *)bitmap;
......@@ -321,10 +323,10 @@ static void usb_hub_port_connect_change(struct usb_device *hub, int port)
/* We're done now, we already disconnected the device */
return;
}
wait_ms(500);
wait_ms(400);
/* Reset the port */
usb_set_port_feature(hub, port + 1, USB_PORT_FEAT_RESET);
wait_ms(500);
wait_ms(100);
/* Allocate a new device struct for it */
usb = usb_alloc_dev(hub, hub->bus);
if (!usb) {
......
This diff is collapsed.
......@@ -164,9 +164,7 @@ static int release_mouse(struct inode * inode, struct file * file)
mouse->suspended = 0;
/* stop polling the mouse while its not in use */
usb_unlink_urb(mouse->urb);
/* never keep a reference to a released IRQ! */
mouse->irq_handle = NULL;
}
}
return 0;
}
......@@ -248,6 +246,8 @@ static ssize_t read_mouse(struct file * file, char * buffer, size_t count, loff_
static int state = 0;
struct mouse_state *mouse = &static_mouse_state;
if (!mouse->present)
return 0;
/*
* FIXME - Other mouse drivers handle blocking and nonblocking reads
* differently here...
......@@ -417,8 +417,6 @@ static void mouse_disconnect(struct usb_device *dev, void *priv)
usb_unlink_urb(mouse->urb);
}
mouse->irq_handle = NULL;
/* this might need work */
mouse->present = 0;
printk("Mouse disconnected\n");
......@@ -438,13 +436,14 @@ int usb_mouse_init(void)
struct mouse_state *mouse = &static_mouse_state;
mouse->present = mouse->active = mouse->suspended = 0;
mouse->irq_handle = NULL;
mouse->buffer=kmalloc(64,GFP_KERNEL);
if (!mouse->buffer)
return -ENOMEM;
mouse->urb=usb_alloc_urb(0);
if (!mouse->urb)
printk(KERN_DEBUG MODSTR"URB allocation failed\n");
init_waitqueue_head(&mouse->wait);
mouse->fasync = NULL;
......@@ -461,10 +460,8 @@ void usb_mouse_cleanup(void)
/* stop the usb interrupt transfer */
if (mouse->present) {
usb_unlink_urb(mouse->urb);
/* never keep a reference to a released IRQ! */
mouse->irq_handle = NULL;
}
usb_unlink_urb(mouse->urb);
}
kfree(mouse->urb);
kfree(mouse->buffer);
/* this, too, probably needs work */
......
This diff is collapsed.
......@@ -30,7 +30,7 @@ static int cc_to_error[16] = {
/* BufferOver */ USB_ST_BUFFEROVERRUN,
/* BuffUnder */ USB_ST_BUFFERUNDERRUN,
/* Not Access */ USB_ST_NORESPONSE,
/* Not Access */ USB_ST_NORESPONSE
/* Not Access */ USB_ST_NORESPONSE
};
#else /* error codes */
......@@ -75,7 +75,7 @@ typedef struct ed {
__u32 hwHeadP;
__u32 hwNextED;
struct ed *ed_prev;
struct ed * ed_prev;
__u8 int_period;
__u8 int_branch;
__u8 int_load;
......@@ -85,7 +85,7 @@ typedef struct ed {
__u16 last_iso;
struct ed * ed_rm_list;
} ed_t, * ped_t;
} ed_t;
/* TD info field */
......@@ -124,7 +124,7 @@ typedef struct ed {
#define TD_NOTACCESSED 0x0F
#define MAXPSW 8
#define MAXPSW 1
typedef struct td {
__u32 hwINFO;
......@@ -135,10 +135,10 @@ typedef struct td {
__u8 type;
__u8 index;
struct ed *ed;
struct td *next_dl_td;
purb_t urb;
} td_t, * ptd_t;
struct ed * ed;
struct td * next_dl_td;
urb_t * urb;
} td_t;
/* TD types */
......@@ -321,14 +321,14 @@ struct virt_root_hub {
/* urb */
typedef struct
{
ped_t ed;
ed_t * ed;
__u16 length; // number of tds associated with this request
__u16 td_cnt; // number of tds already serviced
int state;
void * wait;
ptd_t td[0]; // list pointer to all corresponding TDs associated with this request
td_t * td[0]; // list pointer to all corresponding TDs associated with this request
} urb_priv_t, *purb_priv_t;
} urb_priv_t;
#define URB_DEL 1
/*
......@@ -343,24 +343,24 @@ typedef struct ohci {
struct ohci_hcca hcca; /* hcca */
int irq;
struct ohci_regs *regs; /* OHCI controller's memory */
struct ohci_regs * regs; /* OHCI controller's memory */
struct list_head ohci_hcd_list; /* list of all ohci_hcd */
struct ohci *next; // chain of uhci device contexts
struct ohci * next; // chain of uhci device contexts
struct list_head urb_list; // list of all pending urbs
spinlock_t urb_list_lock; // lock to keep consistency
int ohci_int_load[32]; /* load of the 32 Interrupt Chains (for load ballancing)*/
ped_t ed_rm_list[2]; /* lists of all endpoints to be removed */
ped_t ed_bulktail; /* last endpoint of bulk list */
ped_t ed_controltail; /* last endpoint of control list */
ped_t ed_isotail; /* last endpoint of iso list */
ed_t * ed_rm_list[2]; /* lists of all endpoints to be removed */
ed_t * ed_bulktail; /* last endpoint of bulk list */
ed_t * ed_controltail; /* last endpoint of control list */
ed_t * ed_isotail; /* last endpoint of iso list */
int intrstatus;
__u32 hc_control; /* copy of the hc control reg */
struct usb_bus *bus;
struct usb_bus * bus;
struct usb_device * dev[128];
struct virt_root_hub rh;
} ohci_t, * pohci_t;
} ohci_t;
#define NUM_TDS 0 /* num of preallocated transfer descriptors */
......@@ -377,17 +377,17 @@ struct ohci_device {
/* hcd */
/* endpoint */
static int ep_link(pohci_t ohci, ped_t ed);
static int ep_unlink(pohci_t ohci, ped_t ed);
static ped_t ep_add_ed(struct usb_device * usb_dev, unsigned int pipe, int interval, int load);
static void ep_rm_ed(struct usb_device * usb_dev, ped_t ed);
static int ep_link(ohci_t * ohci, ed_t * ed);
static int ep_unlink(ohci_t * ohci, ed_t * ed);
static ed_t * ep_add_ed(struct usb_device * usb_dev, unsigned int pipe, int interval, int load);
static void ep_rm_ed(struct usb_device * usb_dev, ed_t * ed);
/* td */
static void td_fill(unsigned int info, void * data, int len, purb_t purb, int type, int index);
static void td_submit_urb(purb_t purb);
static void td_fill(unsigned int info, void * data, int len, urb_t * urb, int type, int index);
static void td_submit_urb(urb_t * urb);
/* root hub */
static int rh_submit_urb(purb_t purb);
static int rh_unlink_urb(purb_t purb);
static int rh_init_int_timer(purb_t purb);
static int rh_submit_urb(urb_t * urb);
static int rh_unlink_urb(urb_t * urb);
static int rh_init_int_timer(urb_t * urb);
#ifdef DEBUG
#define OHCI_FREE(x) kfree(x); printk("OHCI FREE: %d: %4x\n", -- __ohci_free_cnt, (unsigned int) x)
......
This diff is collapsed.
/*
* $Id: uhci-debug.c,v 1.12 1999/12/13 15:24:42 fliegl Exp $
*/
#include <linux/config.h>
#include <linux/version.h>
#include <linux/kernel.h>
#include <asm/io.h>
......
This diff is collapsed.
......@@ -2,10 +2,10 @@
#define __LINUX_UHCI_H
/*
$Id: uhci.h,v 1.28 1999/12/14 18:38:26 fliegl Exp $
$Id: uhci.h,v 1.30 1999/12/15 17:57:25 fliegl Exp $
*/
#define MODSTR "uhci: "
#define MODNAME "usb-uhci"
#define MODSTR MODNAME": "
#define VERSTR "version v0.9 time " __TIME__ " " __DATE__
/* Command register */
......@@ -145,7 +145,6 @@ typedef struct {
int short_control_packet;
} urb_priv_t, *purb_priv_t;
#ifdef VROOTHUB
struct virt_root_hub {
int devnum; /* Address of Root Hub endpoint */
void *urb;
......@@ -157,17 +156,12 @@ struct virt_root_hub {
struct timer_list rh_int_timer;
};
#endif
typedef struct uhci {
int irq;
unsigned int io_addr;
unsigned int io_size;
unsigned int maxports;
int control_pid;
int control_running;
int control_continue;
int apm_state;
struct uhci *next; // chain of uhci device contexts
......@@ -188,9 +182,7 @@ typedef struct uhci {
uhci_desc_t *chain_end;
spinlock_t qh_lock;
spinlock_t td_lock;
#ifdef VROOTHUB
struct virt_root_hub rh; //private data of the virtual root hub
#endif
} uhci_t, *puhci_t;
......@@ -201,7 +193,6 @@ typedef struct uhci {
/* ------------------------------------------------------------------------------------
Virtual Root HUB
------------------------------------------------------------------------------------ */
#ifdef VROOTHUB
/* destination of request */
#define RH_INTERFACE 0x01
#define RH_ENDPOINT 0x02
......@@ -257,8 +248,5 @@ typedef struct uhci {
#define RH_NACK 0x00
#define min(a,b) (((a)<(b))?(a):(b))
static int rh_submit_urb (purb_t purb);
static int rh_unlink_urb (purb_t purb);
#endif /* VROOTHUB */
#endif
......@@ -14,6 +14,13 @@
*
* See README.serial for more information on using this driver.
*
* version 0.2.2 (12/16/99) gkh
* Changed major number to the new allocated number. We're legal now!
*
* version 0.2.1 (12/14/99) gkh
* Fixed bug that happens when device node is opened when there isn't a
* device attached to it. Thanks to marek@webdesign.no for noticing this.
*
* version 0.2.0 (11/10/99) gkh
* Split up internals to make it easier to add different types of serial
* converters to the code.
......@@ -83,7 +90,7 @@ MODULE_PARM_DESC(product, "User specified USB idProduct");
#define PERACOM_SERIAL_CONVERTER 0x0001
#define SERIAL_MAJOR 240
#define SERIAL_MAJOR 188 /* Nice legal number now */
#define NUM_PORTS 4 /* Have to pick a number for now. Need to look */
/* into dynamically creating them at insertion time. */
......@@ -640,7 +647,7 @@ static int etek_serial_open (struct tty_struct *tty, struct file *filp)
/* Need to do device specific setup here (control lines, baud rate, etc.) */
/* FIXME!!! */
return (0);
}
......@@ -715,7 +722,7 @@ static void etek_serial_put_char (struct tty_struct *tty, unsigned char ch)
serial->bulk_out_transfer = usb_request_bulk (serial->dev, serial->bulk_out_pipe, serial_write_irq, serial->bulk_out_buffer, 1, serial);
return;
}
}
static int etek_write_room (struct tty_struct *tty)
......@@ -798,7 +805,7 @@ static int generic_serial_open (struct tty_struct *tty, struct file *filp)
serial->bulk_in_inuse = 1;
serial->bulk_in_transfer = usb_request_bulk (serial->dev, serial->bulk_in_pipe, serial_read_irq, serial->bulk_in_buffer, serial->bulk_in_size, serial);
}
return (0);
}
......@@ -877,7 +884,7 @@ static void generic_serial_put_char (struct tty_struct *tty, unsigned char ch)
}
return;
}
}
static int generic_write_room (struct tty_struct *tty)
......
This diff is collapsed.
......@@ -26,7 +26,6 @@
*
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
......
This diff is collapsed.
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