diff options
author | davem <davem> | 2002-02-07 15:06:38 +0000 |
---|---|---|
committer | davem <davem> | 2002-02-07 15:06:38 +0000 |
commit | 5342038eb9f9f8f6918ce43c47420ceba55dc39f (patch) | |
tree | f50388dcf068a0b89a61cfcca7401ad9325204f5 | |
parent | d90dd365c478667e07c53bb8269405771ca659cd (diff) | |
download | netdev-vger-cvs-5342038eb9f9f8f6918ce43c47420ceba55dc39f.tar.gz |
Merge mainline to 2.5.4-pre1
110 files changed, 1432 insertions, 1262 deletions
diff --git a/Documentation/Changes b/Documentation/Changes index bb72248f1..a4ac11940 100644 --- a/Documentation/Changes +++ b/Documentation/Changes @@ -106,8 +106,8 @@ assembling the 16-bit boot code, removing the need for as86 to compile your kernel. This change does, however, mean that you need a recent release of binutils. -System utililities -================== +System utilities +================ Architectural changes --------------------- diff --git a/MAINTAINERS b/MAINTAINERS index fb448b6b2..f716e1a64 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1582,8 +1582,8 @@ L: linux-usb-devel@lists.sourceforge.net S: Maintained USB KAWASAKI LSI DRIVER -P: Brad Hards -M: bradh@frogmouth.net +P: Oliver Neukum +M: drivers@neukum.org L: linux-usb-users@lists.sourceforge.net L: linux-usb-devel@lists.sourceforge.net S: Maintained @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 5 -SUBLEVEL = 3 -EXTRAVERSION = +SUBLEVEL = 4 +EXTRAVERSION =-pre1 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) @@ -178,6 +178,8 @@ DRIVERS-$(CONFIG_HAMRADIO) += drivers/net/hamradio/hamradio.o DRIVERS-$(CONFIG_TC) += drivers/tc/tc.a DRIVERS-$(CONFIG_USB) += drivers/usb/usbdrv.o DRIVERS-$(CONFIG_INPUT) += drivers/input/inputdrv.o +DRIVERS-$(CONFIG_GAMEPORT) += drivers/input/gameport/gamedrv.o +DRIVERS-$(CONFIG_SERIO) += drivers/input/serio/seriodrv.o DRIVERS-$(CONFIG_I2O) += drivers/message/i2o/i2o.o DRIVERS-$(CONFIG_IRDA) += drivers/net/irda/irda.o DRIVERS-$(CONFIG_I2C) += drivers/i2c/i2c.o diff --git a/arch/i386/boot/bootsect.S b/arch/i386/boot/bootsect.S index f72d7e55b..a99ffbbbe 100644 --- a/arch/i386/boot/bootsect.S +++ b/arch/i386/boot/bootsect.S @@ -158,9 +158,7 @@ got_sectors: movw $sread, %si # the boot sector has already been read movw %ax, (%si) - xorw %ax, %ax # reset FDC - xorb %dl, %dl - int $0x13 + call kill_motor # reset FDC movw $0x0200, %bx # address = 512, in INITSEG next_step: movb setup_sects, %al diff --git a/arch/i386/defconfig b/arch/i386/defconfig index 48a29fe45..4f292da94 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig @@ -404,7 +404,6 @@ CONFIG_NET_ETHERNET=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNBMAC is not set # CONFIG_SUNQE is not set -# CONFIG_SUNLANCE is not set # CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set # CONFIG_LANCE is not set @@ -518,13 +517,23 @@ CONFIG_PCMCIA_RAYCS=y # CONFIG_CD_NO_IDESCSI is not set # -# Input core support +# Input device support # # CONFIG_INPUT is not set # CONFIG_INPUT_KEYBDEV is not set # CONFIG_INPUT_MOUSEDEV is not set # CONFIG_INPUT_JOYDEV is not set # CONFIG_INPUT_EVDEV is not set +# CONFIG_GAMEPORT is not set +CONFIG_SOUND_GAMEPORT=y +# CONFIG_GAMEPORT_NS558 is not set +# CONFIG_GAMEPORT_L4 is not set +# CONFIG_INPUT_EMU10K1 is not set +# CONFIG_GAMEPORT_PCIGAME is not set +# CONFIG_GAMEPORT_FM801 is not set +# CONFIG_GAMEPORT_CS461x is not set +# CONFIG_SERIO is not set +# CONFIG_SERIO_SERPORT is not set # # Character devices @@ -551,19 +560,6 @@ CONFIG_MOUSE=y CONFIG_PSMOUSE=y # CONFIG_82C710_MOUSE is not set # CONFIG_PC110_PAD is not set - -# -# Joysticks -# -# CONFIG_INPUT_GAMEPORT is not set - -# -# Input core support is needed for gameports -# - -# -# Input core support is needed for joysticks -# # CONFIG_QIC02_TAPE is not set # @@ -721,6 +717,7 @@ CONFIG_SOUND_ES1371=y # CONFIG_MIDI_VIA82CXXX is not set # CONFIG_SOUND_OSS is not set # CONFIG_SOUND_TVMIXER is not set +CONFIG_INPUT_GAMEPORT=y # # USB support diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig index 42d377cf1..8ec7b357f 100644 --- a/arch/sparc64/defconfig +++ b/arch/sparc64/defconfig @@ -456,7 +456,6 @@ CONFIG_SUNLANCE=y CONFIG_HAPPYMEAL=y CONFIG_SUNBMAC=m CONFIG_SUNQE=m -CONFIG_SUNLANCE=y CONFIG_SUNGEM=y CONFIG_NET_VENDOR_3COM=y # CONFIG_EL1 is not set @@ -575,7 +574,7 @@ CONFIG_DRM_TDFX=m # CONFIG_DRM_R128 is not set # -# Input core support +# Input device support # CONFIG_INPUT=y CONFIG_INPUT_KEYBDEV=y @@ -584,6 +583,36 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_INPUT_JOYDEV is not set CONFIG_INPUT_EVDEV=y +# CONFIG_GAMEPORT is not set +CONFIG_SOUND_GAMEPORT=y +# CONFIG_GAMEPORT_NS558 is not set +# CONFIG_GAMEPORT_L4 is not set +# CONFIG_INPUT_EMU10K1 is not set +# CONFIG_GAMEPORT_PCIGAME is not set +# CONFIG_GAMEPORT_FM801 is not set +# CONFIG_GAMEPORT_CS461x is not set +# CONFIG_SERIO is not set +# CONFIG_SERIO_SERPORT is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_JOYSTICK_ANALOG is not set +# CONFIG_JOYSTICK_A3D is not set +# CONFIG_JOYSTICK_ADI is not set +# CONFIG_JOYSTICK_COBRA is not set +# CONFIG_JOYSTICK_GF2K is not set +# CONFIG_JOYSTICK_GRIP is not set +# CONFIG_JOYSTICK_INTERACT is not set +# CONFIG_JOYSTICK_SIDEWINDER is not set +# CONFIG_JOYSTICK_TMDC is not set +# CONFIG_JOYSTICK_IFORCE_USB is not set +# CONFIG_JOYSTICK_IFORCE_232 is not set +# CONFIG_JOYSTICK_WARRIOR is not set +# CONFIG_JOYSTICK_MAGELLAN is not set +# CONFIG_JOYSTICK_SPACEORB is not set +# CONFIG_JOYSTICK_SPACEBALL is not set +# CONFIG_JOYSTICK_STINGER is not set +# CONFIG_JOYSTICK_DB9 is not set +# CONFIG_JOYSTICK_GAMECON is not set +# CONFIG_JOYSTICK_TURBOGRAFX is not set # # File systems @@ -659,7 +688,6 @@ CONFIG_LOCKD_V4=y # CONFIG_NCPFS_NLS is not set # CONFIG_NCPFS_EXTRAS is not set # CONFIG_ZISOFS_FS is not set -# CONFIG_ZLIB_FS_INFLATE is not set # # Partition Types @@ -887,3 +915,5 @@ CONFIG_MAGIC_SYSRQ=y # Library routines # CONFIG_CRC32=y +# CONFIG_ZLIB_INFLATE is not set +# CONFIG_ZLIB_DEFLATE is not set diff --git a/drivers/Makefile b/drivers/Makefile index 4d2f078d6..aa1e43f64 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -8,7 +8,7 @@ mod-subdirs := dio mtd sbus video macintosh usb input telephony sgi ide \ message/i2o message/fusion scsi md ieee1394 pnp isdn atm \ - fc4 net/hamradio i2c acpi bluetooth + fc4 net/hamradio i2c acpi bluetooth input/serio input/gameport subdir-y := base parport char block net sound misc media cdrom hotplug subdir-m := $(subdir-y) @@ -27,6 +27,8 @@ subdir-$(CONFIG_MAC) += macintosh subdir-$(CONFIG_ALL_PPC) += macintosh subdir-$(CONFIG_USB) += usb subdir-$(CONFIG_INPUT) += input +subdir-$(CONFIG_SERIO) += input/serio +subdir-$(CONFIG_GAMEPORT) += input/gameport subdir-$(CONFIG_PHONE) += telephony subdir-$(CONFIG_SGI) += sgi subdir-$(CONFIG_IDE) += ide diff --git a/drivers/base/core.c b/drivers/base/core.c index 83c81fbd5..0cc155572 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -18,10 +18,7 @@ # define DBG(x...) #endif -static struct iobus device_root = { - bus_id: "root", - name: "Logical System Root", -}; +static struct device * device_root; int (*platform_notify)(struct device * dev) = NULL; int (*platform_notify_remove)(struct device * dev) = NULL; @@ -29,9 +26,6 @@ int (*platform_notify_remove)(struct device * dev) = NULL; extern int device_make_dir(struct device * dev); extern void device_remove_dir(struct device * dev); -extern int iobus_make_dir(struct iobus * iobus); -extern void iobus_remove_dir(struct iobus * iobus); - static spinlock_t device_lock; /** @@ -48,19 +42,23 @@ int device_register(struct device *dev) if (!dev || !strlen(dev->bus_id)) return -EINVAL; - BUG_ON(!dev->parent); spin_lock(&device_lock); INIT_LIST_HEAD(&dev->node); + INIT_LIST_HEAD(&dev->children); spin_lock_init(&dev->lock); atomic_set(&dev->refcount,2); - get_iobus(dev->parent); - list_add_tail(&dev->node,&dev->parent->devices); + if (dev != device_root) { + if (!dev->parent) + dev->parent = device_root; + get_device(dev->parent); + list_add_tail(&dev->node,&dev->parent->children); + } spin_unlock(&device_lock); - DBG("DEV: registering device: ID = '%s', name = %s, parent = %s\n", - dev->bus_id, dev->name, parent->bus_id); + DBG("DEV: registering device: ID = '%s', name = %s\n", + dev->bus_id, dev->name); if ((error = device_make_dir(dev))) goto register_done; @@ -71,8 +69,8 @@ int device_register(struct device *dev) register_done: put_device(dev); - if (error) - put_iobus(dev->parent); + if (error && dev->parent) + put_device(dev->parent); return error; } @@ -101,9 +99,6 @@ void put_device(struct device * dev) /* remove the driverfs directory */ device_remove_dir(dev); - if (dev->subordinate) - iobus_remove_dir(dev->subordinate); - /* Notify the platform of the removal, in case they * need to do anything... */ @@ -117,73 +112,21 @@ void put_device(struct device * dev) if (dev->driver && dev->driver->remove) dev->driver->remove(dev,REMOVE_FREE_RESOURCES); - put_iobus(dev->parent); -} - -int iobus_register(struct iobus *bus) -{ - int error; - - if (!bus || !strlen(bus->bus_id)) - return -EINVAL; - - spin_lock(&device_lock); - atomic_set(&bus->refcount,2); - spin_lock_init(&bus->lock); - INIT_LIST_HEAD(&bus->node); - INIT_LIST_HEAD(&bus->devices); - INIT_LIST_HEAD(&bus->children); - - if (bus != &device_root) { - if (!bus->parent) - bus->parent = &device_root; - get_iobus(bus->parent); - list_add_tail(&bus->node,&bus->parent->children); - } - spin_unlock(&device_lock); - - DBG("DEV: registering bus. ID = '%s' name = '%s' parent = %p\n", - bus->bus_id,bus->name,bus->parent); - - error = iobus_make_dir(bus); - - put_iobus(bus); - if (error && bus->parent) - put_iobus(bus->parent); - return error; -} - -/** - * iobus_unregister - remove bus and children from device tree - * @bus: pointer to bus structure - * - * Remove device from parent's list of children and decrement - * reference count on controlling device. That should take care of - * the rest of the cleanup. - */ -void put_iobus(struct iobus * iobus) -{ - if (!atomic_dec_and_lock(&iobus->refcount,&device_lock)) - return; - list_del_init(&iobus->node); - spin_unlock(&device_lock); - - if (!list_empty(&iobus->devices) || - !list_empty(&iobus->children)) - BUG(); - - put_iobus(iobus->parent); - /* unregister itself */ - put_device(iobus->self); + put_device(dev->parent); } static int __init device_init_root(void) { - /* initialize parent bus lists */ - return iobus_register(&device_root); + device_root = kmalloc(sizeof(*device_root),GFP_KERNEL); + if (!device_root) + return -ENOMEM; + memset(device_root,0,sizeof(*device_root)); + strcpy(device_root->bus_id,"root"); + strcpy(device_root->name,"System Root"); + return device_register(device_root); } -int __init device_driver_init(void) +static int __init device_driver_init(void) { int error = 0; @@ -208,8 +151,7 @@ int __init device_driver_init(void) return error; } +subsys_initcall(device_driver_init); + EXPORT_SYMBOL(device_register); EXPORT_SYMBOL(put_device); -EXPORT_SYMBOL(iobus_register); -EXPORT_SYMBOL(put_iobus); -EXPORT_SYMBOL(device_driver_init); diff --git a/drivers/base/fs.c b/drivers/base/fs.c index dfc51aa79..363ac8a1b 100644 --- a/drivers/base/fs.c +++ b/drivers/base/fs.c @@ -104,28 +104,6 @@ int device_make_dir(struct device * dev) return 0; } -void iobus_remove_dir(struct iobus * iobus) -{ - if (iobus) - driverfs_remove_dir(&iobus->dir); -} - -int iobus_make_dir(struct iobus * iobus) -{ - struct driver_dir_entry * parent = NULL; - int error; - - INIT_LIST_HEAD(&iobus->dir.files); - iobus->dir.mode = (S_IFDIR| S_IRWXU | S_IRUGO | S_IXUGO); - iobus->dir.name = iobus->bus_id; - - if (iobus->parent) - parent = &iobus->parent->dir; - - error = driverfs_create_dir(&iobus->dir,parent); - return error; -} - EXPORT_SYMBOL(device_create_file); EXPORT_SYMBOL(device_remove_file); diff --git a/drivers/base/interface.c b/drivers/base/interface.c index b7c5c94db..61a3fa599 100644 --- a/drivers/base/interface.c +++ b/drivers/base/interface.c @@ -19,15 +19,7 @@ */ static ssize_t device_read_status(struct device * dev, char * page, size_t count, loff_t off) { - char *str = page; - - if (off) - return 0; - - str += sprintf(str,"Name: %s\n",dev->name); - str += sprintf(str,"Bus ID: %s\n",dev->bus_id); - - return (str - page); + return off ? 0 : sprintf(page,"%s\n",dev->bus_id); } /** @@ -84,17 +76,21 @@ static struct driver_file_entry device_status_entry = { store: device_write_status, }; -static ssize_t -device_read_power(struct device * dev, char * page, size_t count, loff_t off) +static ssize_t device_read_name(struct device * dev, char * buf, size_t count, loff_t off) { - char * str = page; - - if (off) - return 0; + return off ? 0 : sprintf(buf,"%s\n",dev->name); +} - str += sprintf(str,"State: %d\n",dev->current_state); +static struct driver_file_entry device_name_entry = { + name: "name", + mode: S_IRUGO, + show: device_read_name, +}; - return (str - page); +static ssize_t +device_read_power(struct device * dev, char * page, size_t count, loff_t off) +{ + return off ? 0 : sprintf(page,"%d\n",dev->current_state); } static ssize_t @@ -169,6 +165,7 @@ static struct driver_file_entry device_power_entry = { struct driver_file_entry * device_default_files[] = { &device_status_entry, + &device_name_entry, &device_power_entry, NULL, }; diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 740e5c8b8..c58f72557 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -155,14 +155,15 @@ void nbd_send_req(struct socket *sock, struct request *req) unsigned long size = req->nr_sectors << 9; DEBUG("NBD: sending control, "); + + rw = rq_data_dir(req); + request.magic = htonl(NBD_REQUEST_MAGIC); - request.type = htonl(req->flags); + request.type = htonl((rw & WRITE) ? 1 : 0); request.from = cpu_to_be64( (u64) req->sector << 9); request.len = htonl(size); memcpy(request.handle, &req, sizeof(req)); - rw = rq_data_dir(req); - result = nbd_xmit(1, sock, (char *) &request, sizeof(request), rw & WRITE ? MSG_MORE : 0); if (result <= 0) FAIL("Sendmsg failed for control."); diff --git a/drivers/char/Config.in b/drivers/char/Config.in index eed80ec1a..6358b6aa8 100644 --- a/drivers/char/Config.in +++ b/drivers/char/Config.in @@ -127,8 +127,6 @@ if [ "$CONFIG_MOUSE" != "n" ]; then fi endmenu -source drivers/char/joystick/Config.in - tristate 'QIC-02 tape support' CONFIG_QIC02_TAPE if [ "$CONFIG_QIC02_TAPE" != "n" ]; then bool ' Do you want runtime configuration for QIC-02' CONFIG_QIC02_DYNCONF diff --git a/drivers/char/Makefile b/drivers/char/Makefile index ddffec9a0..cae9ed934 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile @@ -25,7 +25,7 @@ export-objs := busmouse.o console.o keyboard.o sysrq.o \ misc.o pty.o random.o selection.o serial.o \ sonypi.o tty_io.o tty_ioctl.o generic_serial.o -mod-subdirs := joystick ftape drm pcmcia +mod-subdirs := ftape drm pcmcia list-multi := @@ -166,16 +166,11 @@ obj-$(CONFIG_BVME6000_SCC) += generic_serial.o vme_scc.o obj-$(CONFIG_SERIAL_TX3912) += generic_serial.o serial_tx3912.o subdir-$(CONFIG_RIO) += rio -subdir-$(CONFIG_INPUT) += joystick obj-$(CONFIG_ATIXL_BUSMOUSE) += atixlmouse.o obj-$(CONFIG_LOGIBUSMOUSE) += logibusmouse.o obj-$(CONFIG_PRINTER) += lp.o -ifeq ($(CONFIG_INPUT),y) -obj-y += joystick/js.o -endif - obj-$(CONFIG_BUSMOUSE) += busmouse.o obj-$(CONFIG_DTLK) += dtlk.o obj-$(CONFIG_R3964) += n_r3964.o diff --git a/drivers/char/joystick/Config.help b/drivers/char/joystick/Config.help deleted file mode 100644 index 58d7110ed..000000000 --- a/drivers/char/joystick/Config.help +++ /dev/null @@ -1,300 +0,0 @@ -CONFIG_INPUT_GAMEPORT - Gameport support is for the standard 15-pin PC gameport. If you - have a joystick, gamepad, gameport card, a soundcard with a gameport - or anything else that uses the gameport, say Y or M here and also to - at least one of the hardware specific drivers. - Please read the file <file:Documentation/input/joystick.txt> which - contains more information and the location of the joystick package - that you'll need if you use the gameport with a joystick. - - This driver 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 gameport.o. If you want to compile it as - a module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_NS558 - Say Y here if you have an ISA or PnP gameport. - For more information on how to use the driver please read - <file:Documentation/input/joystick.txt>. - - This driver 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 ns558.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_LIGHTNING - Say Y here if you have a PDPI Lightning 4 gamecard. For more - information on how to use the driver please read - <file:Documentation/input/joystick.txt>. - - This driver 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 lightning.o. If you want to compile it as - a module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_CS461X - Say Y here if you have a Cirrus CS461x aka "Crystal SoundFusion" - PCI audio accelerator. A product page for the CS4614 is at - <http://www.cirrus.com/design/products/overview/index.cfm?ProductID=40>. - - This driver 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 cs461x.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_PCIGAME - Say Y here if you have a Trident 4DWave DX/NX or Aureal Vortex 1/2 - card. For more information on how to use the driver please read - <file:Documentation/input/joystick.txt>. - - This driver 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 pcigame.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_EMU10K1 - Say Y here if you have a SoundBlaster Live! card and want to use - its gameport. For more information on how to use the driver - please read <file:Documentation/input/joystick.txt>. - - This driver 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 emu10k1-gp.o. If you want to compile it as - a module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_ANALOG - Say Y here if you have a controller that connects to the PC - gameport. This supports many different types, including joysticks - with throttle control, with rudders, or with extensions like - additional hats and buttons compatible with CH Flightstick Pro, - ThrustMaster FCS, 6 and 8 button gamepads, or Saitek Cyborg - joysticks. For more information on how to use the driver please - read <file:Documentation/input/joystick.txt>. - - This driver 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 analog.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_A3D - Say Y here if you have an FPGaming or MadCatz controller using the - A3D protocol over the PC gameport. For more information on how to - use the driver please read <file:Documentation/input/joystick.txt>. - - This driver 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 a3d.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_ADI - Say Y here if you have a Logitech controller using the ADI - protocol over the PC gameport. For more information on how to use - the driver please read <file:Documentation/input/joystick.txt>. - - This driver 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 adi.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_COBRA - Say Y here if you have a Creative Labs Blaster Cobra gamepad. - For more information on how to use the driver please read - <file:Documentation/input/joystick.txt>. - - This driver 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 cobra.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_GF2K - Say Y here if you have a Genius Flight2000 or MaxFighter digitally - communicating joystick or gamepad. For more information on how to - use the driver please read <file:Documentation/input/joystick.txt>. - - This driver 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 gf2k.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_GRIP - Say Y here if you have a Gravis controller using the GrIP protocol - over the PC gameport. For more information on how to use the driver - please read <file:Documentation/input/joystick.txt>. - - This driver 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 grip.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_INTERACT - Say Y hereif you have an InterAct gameport or joystick - communicating digitally over the gameport. For more information on - how to use the driver please read <file:Documentation/input/joystick.txt>. - - This driver 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 interact.o. If you want to compile it as - a module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_TMDC - Say Y here if you have a ThrustMaster controller using the - DirectConnect (BSP) protocol over the PC gameport. For more - information on how to use the driver please read - <file:Documentation/input/joystick.txt>. - - This driver 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 tmdc.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_SIDEWINDER - Say Y here if you have a Microsoft controller using the Digital - Overdrive protocol over PC gameport. For more information on how to - use the driver please read <file:Documentation/input/joystick.txt>. - - This driver 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 sidewinder.o. If you want to compile it - as a module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_SERIO - Say Y here and to the Serial port input line discipline option if - you plan to use a joystick that communicates over the serial (COM) - port. For more information on how to use the driver please read - <file:Documentation/input/joystick.txt>. - - This driver 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 sidewinder.o. If you want to compile it - as a module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_SERPORT - Say Y here if you plan to use a joystick that communicates over the - serial (COM) port. For more information on how to use the driver - please read <file:Documentation/input/joystick.txt>. - - This driver 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 serport.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_WARRIOR - Say Y here if you have a Logitech WingMan Warrior joystick connected - to your computer's serial port. For more information on how to use - the driver please read <file:Documentation/input/joystick.txt>. - - This driver 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 warrior.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_MAGELLAN - Say Y here if you have a Magellan or Space Mouse 6DOF controller - connected to your computer's serial port. For more information on - how to use the driver please read <file:Documentation/input/joystick.txt>. - - This driver 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 magellan.o. If you want to compile it as - a module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_SPACEORB - Say Y here if you have a SpaceOrb 360 or SpaceBall Avenger 6DOF - controller connected to your computer's serial port. For more - information on how to use the driver please read - <file:Documentation/input/joystick.txt>. - - This driver 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 spaceorb.o. If you want to compile it as - a module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_SPACEBALL - Say Y here if you have a SpaceTec SpaceBall 4000 FLX controller - connected to your computer's serial port. For more information on - how to use the driver please read <file:Documentation/input/joystick.txt>. - - This driver 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 spaceball.o. If you want to compile it as - a module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_STINGER - Say Y here if you have a Gravis Stinger connected to one of your - serial ports. For more information on how to use the driver please - read <file:Documentation/input/joystick.txt>. - - This driver 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 stinger.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_IFORCE_232 - Say Y here if you have an I-Force joystick or steering wheel - connected to your serial (COM) port. For more information on how - to use the driver please read <file:Documentation/input/joystick.txt>. - - This driver 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 iforce.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_IFORCE_USB - Say Y here if you have an I-Force joystick or steering wheel - connected to your USB port. For more information on how to use the - driver please read <file:Documentation/input/joystick.txt>. - - This driver 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 iforce.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_DB9 - Say Y here if you have a Sega Master System gamepad, Sega Genesis - gamepad, Sega Saturn gamepad, or a Multisystem -- Atari, Amiga, - Commodore, Amstrad CPC joystick connected to your parallel port. - For more information on how to use the driver please read - <file:Documentation/input/joystick.txt> and - <file:Documentation/input/joystick-parport.txt>. - - This driver 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 db9.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_GAMECON - Say Y here if you have a Nintendo Entertainment System gamepad, - Super Nintendo Entertainment System gamepad, Nintendo 64 gamepad, - Sony PlayStation gamepad or a Multisystem -- Atari, Amiga, - Commodore, Amstrad CPC joystick connected to your parallel port. - For more information on how to use the driver please read - <file:Documentation/input/joystick.txt> and - <file:Documentation/input/joystick-parport.txt>. - - This driver 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 gamecon.o. If you want to compile it as a - module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_TURBOGRAFX - Say Y here if you have the TurboGraFX interface by Steffen Schwenke, - and want to use it with Multisystem -- Atari, Amiga, Commodore, - Amstrad CPC joystick. For more information on how to use the driver - please read <file:Documentation/input/joystick.txt> and - <file:Documentation/input/joystick-parport.txt>. - - This driver 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 turbografx.o. If you want to compile it - as a module, say M here and read <file:Documentation/modules.txt>. - -CONFIG_INPUT_AMIJOY - Say Y here if you have an Amiga with a digital joystick connected - to it. For more information on how to use the driver please read - <file:Documentation/input/joystick.txt>. - - This driver 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 joy-amiga.o. If you want to compile it as - a module, say M here and read <file:Documentation/modules.txt>. - diff --git a/drivers/char/joystick/Config.in b/drivers/char/joystick/Config.in deleted file mode 100644 index 7e4185b6c..000000000 --- a/drivers/char/joystick/Config.in +++ /dev/null @@ -1,53 +0,0 @@ -# -# Joystick driver configuration -# - -mainmenu_option next_comment -comment 'Joysticks' - -if [ "$CONFIG_INPUT" != "n" ]; then - dep_tristate 'Game port support' CONFIG_INPUT_GAMEPORT $CONFIG_INPUT - dep_tristate ' Classic ISA/PnP gameports' CONFIG_INPUT_NS558 $CONFIG_INPUT_GAMEPORT - dep_tristate ' PDPI Lightning 4 gamecard' CONFIG_INPUT_LIGHTNING $CONFIG_INPUT_GAMEPORT - dep_tristate ' Aureal Vortex and Trident 4DWave gameports' CONFIG_INPUT_PCIGAME $CONFIG_INPUT_GAMEPORT - dep_tristate ' Crystal SoundFusion gameports' CONFIG_INPUT_CS461X $CONFIG_INPUT_GAMEPORT - dep_tristate ' SoundBlaster Live! gameports' CONFIG_INPUT_EMU10K1 $CONFIG_INPUT_GAMEPORT - tristate 'Serial port device support' CONFIG_INPUT_SERIO - dep_tristate ' Serial port input line discipline' CONFIG_INPUT_SERPORT $CONFIG_INPUT_SERIO -else - # Must explicitly set to n for drivers/sound/Config.in - define_tristate CONFIG_INPUT_GAMEPORT n - comment 'Input core support is needed for gameports' -fi - -if [ "$CONFIG_INPUT" != "n" ]; then - comment 'Joysticks' - - dep_tristate ' Classic PC analog joysticks and gamepads' CONFIG_INPUT_ANALOG $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT - dep_tristate ' Assasin 3D and MadCatz Panther devices' CONFIG_INPUT_A3D $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT - dep_tristate ' Logitech ADI digital joysticks and gamepads' CONFIG_INPUT_ADI $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT - dep_tristate ' Creative Labs Blaster Cobra gamepad' CONFIG_INPUT_COBRA $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT - dep_tristate ' Genius Flight2000 Digital joysticks and gamepads' CONFIG_INPUT_GF2K $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT - dep_tristate ' Gravis GrIP joysticks and gamepads' CONFIG_INPUT_GRIP $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT - dep_tristate ' InterAct digital joysticks and gamepads' CONFIG_INPUT_INTERACT $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT - dep_tristate ' ThrustMaster DirectConnect joysticks and gamepads' CONFIG_INPUT_TMDC $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT - dep_tristate ' Microsoft SideWinder digital joysticks and gamepads' CONFIG_INPUT_SIDEWINDER $CONFIG_INPUT $CONFIG_INPUT_GAMEPORT - dep_tristate ' I-Force USB joysticks and wheels' CONFIG_INPUT_IFORCE_USB $CONFIG_INPUT $CONFIG_USB - dep_tristate ' I-Force Serial joysticks and wheels' CONFIG_INPUT_IFORCE_232 $CONFIG_INPUT $CONFIG_INPUT_SERIO - dep_tristate ' Logitech WingMan Warrior joystick' CONFIG_INPUT_WARRIOR $CONFIG_INPUT $CONFIG_INPUT_SERIO - dep_tristate ' LogiCad3d Magellan/SpaceMouse 6dof controller' CONFIG_INPUT_MAGELLAN $CONFIG_INPUT $CONFIG_INPUT_SERIO - dep_tristate ' SpaceTec SpaceOrb/Avenger 6dof controller' CONFIG_INPUT_SPACEORB $CONFIG_INPUT $CONFIG_INPUT_SERIO - dep_tristate ' SpaceTec SpaceBall 4000 FLX 6dof controller' CONFIG_INPUT_SPACEBALL $CONFIG_INPUT $CONFIG_INPUT_SERIO - dep_tristate ' Gravis Stinger gamepad' CONFIG_INPUT_STINGER $CONFIG_INPUT $CONFIG_INPUT_SERIO - dep_tristate ' Multisystem, Sega Genesis, Saturn joysticks and gamepads' CONFIG_INPUT_DB9 $CONFIG_INPUT $CONFIG_PARPORT - dep_tristate ' Multisystem, NES, SNES, N64, PSX joysticks and gamepads' CONFIG_INPUT_GAMECON $CONFIG_INPUT $CONFIG_PARPORT - dep_tristate ' Multisystem joysticks via TurboGraFX device' CONFIG_INPUT_TURBOGRAFX $CONFIG_INPUT $CONFIG_PARPORT - - if [ "$CONFIG_AMIGA" = "y" ]; then - dep_tristate ' Amiga joysticks' CONFIG_INPUT_AMIJOY $CONFIG_INPUT - fi -else - comment 'Input core support is needed for joysticks' -fi - -endmenu diff --git a/drivers/char/joystick/Makefile b/drivers/char/joystick/Makefile deleted file mode 100644 index 4d018b184..000000000 --- a/drivers/char/joystick/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -# -# Makefile for the joystick drivers. -# - -O_TARGET := js.o - -# Objects that export symbols. - -export-objs := serio.o gameport.o - -# I-Force may need both USB and RS-232 - -ifeq ($(CONFIG_INPUT_IFORCE_232),m) - ifeq ($(CONFIG_INPUT_IFORCE_USB),y) - CONFIG_INPUT_IFORCE_USB := m - endif -endif -ifeq ($(CONFIG_INPUT_IFORCE_USB),m) - ifeq ($(CONFIG_INPUT_IFORCE_232),y) - CONFIG_INPUT_IFORCE_232 := m - endif -endif - -# Object file lists. - -obj-y := -obj-m := -obj-n := -obj- := - -# Each configuration option enables a list of files. - -obj-$(CONFIG_INPUT_GAMEPORT) += gameport.o -obj-$(CONFIG_INPUT_SERIO) += serio.o - -obj-$(CONFIG_INPUT_SERPORT) += serport.o - -obj-$(CONFIG_INPUT_NS558) += ns558.o -obj-$(CONFIG_INPUT_LIGHTNING) += lightning.o -obj-$(CONFIG_INPUT_PCIGAME) += pcigame.o -obj-$(CONFIG_INPUT_CS461X) += cs461x.o -obj-$(CONFIG_INPUT_EMU10K1) += emu10k1-gp.o - -obj-$(CONFIG_INPUT_WARRIOR) += warrior.o -obj-$(CONFIG_INPUT_MAGELLAN) += magellan.o -obj-$(CONFIG_INPUT_SPACEORB) += spaceorb.o -obj-$(CONFIG_INPUT_SPACEBALL) += spaceball.o -obj-$(CONFIG_INPUT_STINGER) += stinger.o -obj-$(CONFIG_INPUT_IFORCE_232) += iforce.o -obj-$(CONFIG_INPUT_IFORCE_USB) += iforce.o - -obj-$(CONFIG_INPUT_ANALOG) += analog.o -obj-$(CONFIG_INPUT_A3D) += a3d.o -obj-$(CONFIG_INPUT_ADI) += adi.o -obj-$(CONFIG_INPUT_COBRA) += cobra.o -obj-$(CONFIG_INPUT_GF2K) += gf2k.o -obj-$(CONFIG_INPUT_GRIP) += grip.o -obj-$(CONFIG_INPUT_INTERACT) += interact.o -obj-$(CONFIG_INPUT_TMDC) += tmdc.o -obj-$(CONFIG_INPUT_SIDEWINDER) += sidewinder.o - -obj-$(CONFIG_INPUT_DB9) += db9.o -obj-$(CONFIG_INPUT_GAMECON) += gamecon.o -obj-$(CONFIG_INPUT_TURBOGRAFX) += turbografx.o - -obj-$(CONFIG_INPUT_AMIJOY) += amijoy.o - -# The global Rules.make. - -include $(TOPDIR)/Rules.make diff --git a/drivers/char/lp.c b/drivers/char/lp.c index f71e3fa09..667f2e6b4 100644 --- a/drivers/char/lp.c +++ b/drivers/char/lp.c @@ -648,7 +648,7 @@ static void lp_console_write (struct console *co, const char *s, do { /* Write the data, converting LF->CRLF as we go. */ ssize_t canwrite = count; - char *lf = strchr (s, '\n'); + char *lf = memchr (s, '\n', count); if (lf) canwrite = lf - s; diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index bdebe0aee..6dc3fc655 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -320,6 +320,7 @@ static int pp_ioctl(struct inode *inode, struct file *file, case PPCLAIM: { struct ieee1284_info *info; + int ret; if (pp->flags & PP_CLAIMED) { printk (KERN_DEBUG CHRDEV @@ -335,7 +336,10 @@ static int pp_ioctl(struct inode *inode, struct file *file, } } - parport_claim_or_block (pp->pdev); + ret = parport_claim_or_block (pp->pdev); + if (ret < 0) + return ret; + pp->flags |= PP_CLAIMED; /* For interrupt-reporting to work, we need to be @@ -429,8 +433,12 @@ static int pp_ioctl(struct inode *inode, struct file *file, { unsigned int modes; - modes = pp->pdev->port->modes; - if (copy_to_user ((unsigned int *)arg, &modes, sizeof (port->modes))) { + port = parport_find_number (minor); + if (!port) + return -ENODEV; + + modes = port->modes; + if (copy_to_user ((unsigned int *)arg, &modes, sizeof (modes))) { return -EFAULT; } return 0; diff --git a/drivers/input/Config.help b/drivers/input/Config.help index 981eb6f0f..15bc1aab5 100644 --- a/drivers/input/Config.help +++ b/drivers/input/Config.help @@ -1,27 +1,35 @@ CONFIG_INPUT - Say Y here if you want to enable any of the following options for - USB Human Interface Device (HID) support. + Say Y here if you have any input device (mouse, keyboard, tablet, + joystick, steering wheel ...) connected to your system and want + it to be available to applications. This includes standard PS/2 + keyboard and mouse. - Say Y here if you want to enable any of the USB HID options in the - USB support section which require Input core support. + Say N here if you have a headless (no monitor, no keyboard) system. - Otherwise, say N. + More information is available: <file:Documentation/input/input.txt> + + If unsure, say Y. + + This driver 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 input.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. CONFIG_INPUT_KEYBDEV - Say Y here if you want your USB HID keyboard (or an ADB keyboard - handled by the input layer) to be able to serve as a system - keyboard. + Say Y here if you want your keyboard to be able to serve as a system + keyboard. This is needed in most cases. The only exceptions are + headless and embedded systems. This driver 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 keybdev.o. If you want to compile it as a + The module will be called keybdev.o. If you want to compile it as a module, say M here and read <file:Documentation/modules.txt>. CONFIG_INPUT_MOUSEDEV - Say Y here if you want your USB HID mouse (or ADB mouse handled by - the input layer) to be accessible as char devices 13:32+ - - /dev/input/mouseX and 13:63 - /dev/input/mice as an emulated ImPS/2 - mouse. That way, all user space programs will be able to use your + Say Y here if you want your mouse to be accessible as char devices + 13:32+ - /dev/input/mouseX and 13:63 - /dev/input/mice as an + emulated IntelliMouse Explorer PS/2 mouse. That way, all user space + programs (includung SVGAlib, GPM and X) will be able to use your mouse. If unsure, say Y. @@ -44,16 +52,23 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y you're not using a digitizer, this value is ignored. CONFIG_INPUT_JOYDEV - Say Y here if you want your USB HID joystick or gamepad to be + Say Y here if you want your joystick or gamepad to be accessible as char device 13:0+ - /dev/input/jsX device. + If unsure, say Y. + + More information is available: <file:Documentation/input/joystick.txt> + This driver 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 joydev.o. If you want to compile it as a module, say M here and read <file:Documentation/modules.txt>. CONFIG_INPUT_EVDEV - Say Y here if you want your USB or ADB HID device events be - accessible under char device 13:64+ - /dev/input/eventX in a generic - way. This is the future ... + Say Y here if you want your input device events be accessible + under char device 13:64+ - /dev/input/eventX in a generic way. + This driver 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 evdev.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. diff --git a/drivers/input/Config.in b/drivers/input/Config.in index fb9eceff2..66b2aa728 100644 --- a/drivers/input/Config.in +++ b/drivers/input/Config.in @@ -1,18 +1,25 @@ # -# Input core configuration +# Input device configuration # mainmenu_option next_comment -comment 'Input core support' +comment 'Input device support' tristate 'Input core support' CONFIG_INPUT -dep_tristate ' Keyboard support' CONFIG_INPUT_KEYBDEV $CONFIG_INPUT -dep_tristate ' Mouse support' CONFIG_INPUT_MOUSEDEV $CONFIG_INPUT +dep_tristate ' Keyboard interface' CONFIG_INPUT_KEYBDEV $CONFIG_INPUT +dep_tristate ' Mouse interface' CONFIG_INPUT_MOUSEDEV $CONFIG_INPUT if [ "$CONFIG_INPUT_MOUSEDEV" != "n" ]; then int ' Horizontal screen resolution' CONFIG_INPUT_MOUSEDEV_SCREEN_X 1024 int ' Vertical screen resolution' CONFIG_INPUT_MOUSEDEV_SCREEN_Y 768 fi -dep_tristate ' Joystick support' CONFIG_INPUT_JOYDEV $CONFIG_INPUT -dep_tristate ' Event interface support' CONFIG_INPUT_EVDEV $CONFIG_INPUT +dep_tristate ' Joystick interface' CONFIG_INPUT_JOYDEV $CONFIG_INPUT +dep_tristate ' Event interface' CONFIG_INPUT_EVDEV $CONFIG_INPUT + +source drivers/input/gameport/Config.in +source drivers/input/serio/Config.in + +if [ "$CONFIG_INPUT" != "n" ]; then + source drivers/input/joystick/Config.in +fi endmenu diff --git a/drivers/input/Makefile b/drivers/input/Makefile index 4e60129dc..69d9bc379 100644 --- a/drivers/input/Makefile +++ b/drivers/input/Makefile @@ -8,15 +8,9 @@ O_TARGET := inputdrv.o # Objects that export symbols. +mod-subdirs := joystick export-objs := input.o -# Object file lists. - -obj-y := -obj-m := -obj-n := -obj- := - # Each configuration option enables a list of files. obj-$(CONFIG_INPUT) += input.o @@ -25,6 +19,12 @@ obj-$(CONFIG_INPUT_MOUSEDEV) += mousedev.o obj-$(CONFIG_INPUT_JOYDEV) += joydev.o obj-$(CONFIG_INPUT_EVDEV) += evdev.o +subdir-$(CONFIG_INPUT_JOYSTICK) += joystick + +ifeq ($(CONFIG_INPUT_JOYSTICK),y) + obj-y += joystick/joydrv.o +endif + # The global Rules.make. include $(TOPDIR)/Rules.make diff --git a/drivers/input/gameport/Config.help b/drivers/input/gameport/Config.help new file mode 100644 index 000000000..54cac2482 --- /dev/null +++ b/drivers/input/gameport/Config.help @@ -0,0 +1,62 @@ +CONFIG_GAMEPORT + Gameport support is for the standard 15-pin PC gameport. If you + have a joystick, gamepad, gameport card, a soundcard with a gameport + or anything else that uses the gameport, say Y or M here and also to + at least one of the hardware specific drivers. + + For Ensoniq AudioPCI (ES1370), AudioPCI 97 (ES1371), ESS Solo1, + S3 SonicVibes, Trident 4DWave, SiS7018, and ALi 5451 gameport + support is provided by the sound drivers, so you won't need any + from the below listed modules. You still need to say Y here. + + If unsure, say Y. + + This driver 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 gameport.o. If you want to compile it as + a module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_GAMEPORT_NS558 + Say Y here if you have an ISA or PnP gameport. + + If unsure, say Y. + + This driver 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 ns558.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_GAMEPORT_L4 + Say Y here if you have a PDPI Lightning 4 gamecard. + + This driver 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 lightning.o. If you want to compile it as + a module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_GAMEPORT_EMU10K1 + Say Y here if you have a SoundBlaster Live! or SoundBlaster + Audigy card and want to use its gameport. + + This driver 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 emu10k1-gp.o. If you want to compile it as + a module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_GAMEPORT_PCIGAME + Say Y here if you have an Aureal Vortex 1 or 2 or a Trident + 4DWave NX or DX card and want to use its gameport. + + This driver 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 pcigame.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_GAMEPORT_CS461X + Say Y here if you have a Cirrus CS461x aka "Crystal SoundFusion" + PCI audio accelerator and want to use its gameport. + + This driver 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 cs461x.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. diff --git a/drivers/input/gameport/Config.in b/drivers/input/gameport/Config.in new file mode 100644 index 000000000..df89f6a6f --- /dev/null +++ b/drivers/input/gameport/Config.in @@ -0,0 +1,19 @@ +# +# Gameport configuration +# + +tristate 'Gameport support' CONFIG_GAMEPORT + +if [ "$CONFIG_GAMEPORT" = "m" ]; then + define_tristate CONFIG_SOUND_GAMEPORT m +fi +if [ "$CONFIG_GAMEPORT" != "m" ]; then + define_tristate CONFIG_SOUND_GAMEPORT y +fi + +dep_tristate ' Classic ISA and PnP gameport support' CONFIG_GAMEPORT_NS558 $CONFIG_GAMEPORT +dep_tristate ' PDPI Lightning 4 gamecard support' CONFIG_GAMEPORT_L4 $CONFIG_GAMEPORT +dep_tristate ' SB Live and Audigy gameport support' CONFIG_INPUT_EMU10K1 $CONFIG_GAMEPORT +dep_tristate ' Aureal Vortex, Vortex 2 and Trident 4DWave NX/DX gameport support' CONFIG_GAMEPORT_PCIGAME $CONFIG_GAMEPORT +dep_tristate ' ForteMedia FM801 gameport support' CONFIG_GAMEPORT_FM801 $CONFIG_GAMEPORT +dep_tristate ' Crystal SoundFusion gameport support' CONFIG_GAMEPORT_CS461x $CONFIG_GAMEPORT diff --git a/drivers/input/gameport/Makefile b/drivers/input/gameport/Makefile new file mode 100644 index 000000000..a15bcbbef --- /dev/null +++ b/drivers/input/gameport/Makefile @@ -0,0 +1,24 @@ +# +# Makefile for the gameport drivers. +# + +# The target object and module list name. + +O_TARGET := gamedrv.o + +# Objects that export symbols. + +export-objs := gameport.o + +# Each configuration option enables a list of files. + +obj-$(CONFIG_GAMEPORT) += gameport.o +obj-$(CONFIG_GAMEPORT_CS461X) += cs461x.o +obj-$(CONFIG_GAMEPORT_EMU10K1) += emu10k1-gp.o +obj-$(CONFIG_GAMEPORT_L4) += lightning.o +obj-$(CONFIG_GAMEPORT_NS558) += ns558.o +obj-$(CONFIG_GAMEPORT_PCIGAME) += pcigame.o + +# The global Rules.make. + +include $(TOPDIR)/Rules.make diff --git a/drivers/char/joystick/cs461x.c b/drivers/input/gameport/cs461x.c index 7116b3453..7116b3453 100644 --- a/drivers/char/joystick/cs461x.c +++ b/drivers/input/gameport/cs461x.c diff --git a/drivers/char/joystick/emu10k1-gp.c b/drivers/input/gameport/emu10k1-gp.c index 2489b11c6..2489b11c6 100644 --- a/drivers/char/joystick/emu10k1-gp.c +++ b/drivers/input/gameport/emu10k1-gp.c diff --git a/drivers/char/joystick/gameport.c b/drivers/input/gameport/gameport.c index 5eacff466..5eacff466 100644 --- a/drivers/char/joystick/gameport.c +++ b/drivers/input/gameport/gameport.c diff --git a/drivers/char/joystick/lightning.c b/drivers/input/gameport/lightning.c index 68b79ff90..68b79ff90 100644 --- a/drivers/char/joystick/lightning.c +++ b/drivers/input/gameport/lightning.c diff --git a/drivers/char/joystick/ns558.c b/drivers/input/gameport/ns558.c index 4cefeabd7..4cefeabd7 100644 --- a/drivers/char/joystick/ns558.c +++ b/drivers/input/gameport/ns558.c diff --git a/drivers/char/joystick/pcigame.c b/drivers/input/gameport/pcigame.c index 04e1bee04..04e1bee04 100644 --- a/drivers/char/joystick/pcigame.c +++ b/drivers/input/gameport/pcigame.c diff --git a/drivers/input/joystick/Config.help b/drivers/input/joystick/Config.help new file mode 100644 index 000000000..1b4187bbb --- /dev/null +++ b/drivers/input/joystick/Config.help @@ -0,0 +1,205 @@ +CONFIG_JOYSTICK + If you have a joystick, 6dof controller, gamepad, steering wheel, + weapon control system or something like that you can say Y here + and the list of supported devices will be displayed. This option + doesn't affect the kernel. + + Please read the file <file:Documentation/input/joystick.txt> which + contains more information. + +CONFIG_JOYSTICK_ANALOG + Say Y here if you have a joystick that connects to the PC + gameport. In addition to the usual PC analog joystick, this driver + supports many extensions, including joysticks with throttle control, + with rudders, additional hats and buttons compatible with CH + Flightstick Pro, ThrustMaster FCS, 6 and 8 button gamepads, or + Saitek Cyborg joysticks. + + Please read the file <file:Documentation/input/joystick.txt> which + contains more information. + + This driver 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 analog.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_A3D + Say Y here if you have an FPGaming or MadCatz controller using the + A3D protocol over the PC gameport. + + This driver 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 a3d.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_ADI + Say Y here if you have a Logitech controller using the ADI + protocol over the PC gameport. + + This driver 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 adi.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_COBRA + Say Y here if you have a Creative Labs Blaster Cobra gamepad. + + This driver 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 cobra.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_GF2K + Say Y here if you have a Genius Flight2000 or MaxFighter digitally + communicating joystick or gamepad. + + This driver 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 gf2k.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_GRIP + Say Y here if you have a Gravis controller using the GrIP protocol + over the PC gameport. + + This driver 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 grip.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_INTERACT + Say Y here if you have an InterAct gameport or joystick + communicating digitally over the gameport. + + This driver 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 interact.o. If you want to compile it as + a module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_SIDEWINDER + Say Y here if you have a Microsoft controller using the Digital + Overdrive protocol over PC gameport. + + This driver 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 sidewinder.o. If you want to compile it + as a module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_TMDC + Say Y here if you have a ThrustMaster controller using the + DirectConnect (BSP) protocol over the PC gameport. + + This driver 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 tmdc.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_IFORCE_USB + Say Y here if you have an I-Force joystick or steering wheel + connected to your USB port. + + This driver 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 iforce.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_IFORCE_232 + Say Y here if you have an I-Force joystick or steering wheel + connected to your serial (COM) port. + + This driver 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 iforce.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_WARRIOR + Say Y here if you have a Logitech WingMan Warrior joystick connected + to your computer's serial port. + + This driver 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 warrior.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_MAGELLAN + Say Y here if you have a Magellan or Space Mouse 6DOF controller + connected to your computer's serial port. + + This driver 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 magellan.o. If you want to compile it as + a module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_SPACEORB + Say Y here if you have a SpaceOrb 360 or SpaceBall Avenger 6DOF + controller connected to your computer's serial port. + + This driver 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 spaceorb.o. If you want to compile it as + a module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_SPACEBALL + Say Y here if you have a SpaceTec SpaceBall 2003/3003/4000 FLX + controller connected to your computer's serial port. For the + SpaceBall 4000 USB model, use the USB HID driver. + + This driver 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 spaceball.o. If you want to compile it as + a module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_STINGER + Say Y here if you have a Gravis Stinger connected to one of your + serial ports. + + This driver 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 stinger.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_DB9 + Say Y here if you have a Sega Master System gamepad, Sega Genesis + gamepad, Sega Saturn gamepad, or a Multisystem -- Atari, Amiga, + Commodore, Amstrad CPC joystick connected to your parallel port. + For more information on how to use the driver please read + <file:Documentation/input/joystick-parport.txt>. + + This driver 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 db9.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_GAMECON + Say Y here if you have a Nintendo Entertainment System gamepad, + Super Nintendo Entertainment System gamepad, Nintendo 64 gamepad, + Sony PlayStation gamepad or a Multisystem -- Atari, Amiga, + Commodore, Amstrad CPC joystick connected to your parallel port. + For more information on how to use the driver please read + <file:Documentation/input/joystick-parport.txt>. + + This driver 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 gamecon.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_TURBOGRAFX + Say Y here if you have the TurboGraFX interface by Steffen Schwenke, + and want to use it with Multisystem -- Atari, Amiga, Commodore, + Amstrad CPC joystick. For more information on how to use the driver + please read <file:Documentation/input/joystick-parport.txt>. + + This driver 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 turbografx.o. If you want to compile it + as a module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_JOYSTICK_AMIJOY + Say Y here if you have an Amiga with a digital joystick connected + to it. + + This driver 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 joy-amiga.o. If you want to compile it as + a module, say M here and read <file:Documentation/modules.txt>. + diff --git a/drivers/input/joystick/Config.in b/drivers/input/joystick/Config.in new file mode 100644 index 000000000..afd07b89d --- /dev/null +++ b/drivers/input/joystick/Config.in @@ -0,0 +1,31 @@ +# +# Joystick driver configuration +# + +bool 'Joysticks' CONFIG_INPUT_JOYSTICK + +dep_tristate ' Classic PC analog joysticks and gamepads' CONFIG_JOYSTICK_ANALOG $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_GAMEPORT +dep_tristate ' Assasin 3D and MadCatz Panther devices' CONFIG_JOYSTICK_A3D $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_GAMEPORT +dep_tristate ' Logitech ADI digital joysticks and gamepads' CONFIG_JOYSTICK_ADI $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_GAMEPORT +dep_tristate ' Creative Labs Blaster Cobra gamepad' CONFIG_JOYSTICK_COBRA $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_GAMEPORT +dep_tristate ' Genius Flight2000 Digital joysticks and gamepads' CONFIG_JOYSTICK_GF2K $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_GAMEPORT +dep_tristate ' Gravis GrIP joysticks and gamepads' CONFIG_JOYSTICK_GRIP $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_GAMEPORT +dep_tristate ' InterAct digital joysticks and gamepads' CONFIG_JOYSTICK_INTERACT $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_GAMEPORT +dep_tristate ' Microsoft SideWinder digital joysticks and gamepads' CONFIG_JOYSTICK_SIDEWINDER $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_GAMEPORT +dep_tristate ' ThrustMaster DirectConnect joysticks and gamepads' CONFIG_JOYSTICK_TMDC $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_GAMEPORT + +dep_tristate ' I-Force USB joysticks and wheels' CONFIG_JOYSTICK_IFORCE_USB $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_USB +dep_tristate ' I-Force Serial joysticks and wheels' CONFIG_JOYSTICK_IFORCE_232 $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_SERIO +dep_tristate ' Logitech WingMan Warrior joystick' CONFIG_JOYSTICK_WARRIOR $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_SERIO +dep_tristate ' LogiCad3d Magellan/SpaceMouse 6dof controllers' CONFIG_JOYSTICK_MAGELLAN $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_SERIO +dep_tristate ' SpaceTec SpaceOrb/Avenger 6dof controllers' CONFIG_JOYSTICK_SPACEORB $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_SERIO +dep_tristate ' SpaceTec SpaceBall 6dof controllers' CONFIG_JOYSTICK_SPACEBALL $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_SERIO +dep_tristate ' Gravis Stinger gamepad' CONFIG_JOYSTICK_STINGER $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_SERIO + +dep_tristate ' Multisystem, Sega Genesis, Saturn joysticks and gamepads' CONFIG_JOYSTICK_DB9 $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_PARPORT +dep_tristate ' Multisystem, NES, SNES, N64, PSX joysticks and gamepads' CONFIG_JOYSTICK_GAMECON $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_PARPORT +dep_tristate ' Multisystem joysticks via TurboGraFX device' CONFIG_JOYSTICK_TURBOGRAFX $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK $CONFIG_PARPORT + +if [ "$CONFIG_AMIGA" = "y" ]; then + dep_tristate ' Amiga joysticks' CONFIG_JOYSTICK_AMIJOY $CONFIG_INPUT $CONFIG_INPUT_JOYSTICK +fi diff --git a/drivers/input/joystick/Makefile b/drivers/input/joystick/Makefile new file mode 100644 index 000000000..8b2cdd21e --- /dev/null +++ b/drivers/input/joystick/Makefile @@ -0,0 +1,51 @@ +# +# Makefile for the input core drivers. +# + +# The target object and module list name. + +O_TARGET := joydrv.o + +# I-Force may need both USB and RS-232 + +CONFIG_JOYSTICK_IFORCE := n + +ifeq ($(CONFIG_JOYSTICK_IFORCE_232),y) + ifeq ($(CONFIG_JOYSTICK_IFORCE_USB),y) + CONFIG_JOYSTICK_IFORCE := y + endif +endif + +ifeq ($(CONFIG_JOYSTICK_IFORCE_232),m) + CONFIG_JOYSTICK_IFORCE := m +endif + +ifeq ($(CONFIG_JOYSTICK_IFORCE_USB),m) + CONFIG_JOYSTICK_IFORCE := m +endif + +# Each configuration option enables a list of files. + +obj-$(CONFIG_JOYSTICK_A3D) += a3d.o +obj-$(CONFIG_JOYSTICK_ADI) += adi.o +obj-$(CONFIG_JOYSTICK_AMIGA) += amijoy.o +obj-$(CONFIG_JOYSTICK_ANALOG) += analog.o +obj-$(CONFIG_JOYSTICK_COBRA) += cobra.o +obj-$(CONFIG_JOYSTICK_DB9) += db9.o +obj-$(CONFIG_JOYSTICK_GAMECON) += gamecon.o +obj-$(CONFIG_JOYSTICK_GF2K) += gf2k.o +obj-$(CONFIG_JOYSTICK_GRIP) += grip.o +obj-$(CONFIG_JOYSTICK_IFORCE) += iforce.o +obj-$(CONFIG_JOYSTICK_INTERACT) += interact.o +obj-$(CONFIG_JOYSTICK_MAGELLAN) += magellan.o +obj-$(CONFIG_JOYSTICK_SIDEWINDER) += sidewinder.o +obj-$(CONFIG_JOYSTICK_SPACEBALL) += spaceball.o +obj-$(CONFIG_JOYSTICK_SPACEORB) += spaceorb.o +obj-$(CONFIG_JOYSTICK_STINGER) += stinger.o +obj-$(CONFIG_JOYSTICK_TMDC) += tmdc.o +obj-$(CONFIG_JOYSTICK_TURBOGRAFX) += turbografx.o +obj-$(CONFIG_JOYSTICK_WARRIOR) += warrior.o + +# The global Rules.make. + +include $(TOPDIR)/Rules.make diff --git a/drivers/char/joystick/a3d.c b/drivers/input/joystick/a3d.c index a560ccffd..a560ccffd 100644 --- a/drivers/char/joystick/a3d.c +++ b/drivers/input/joystick/a3d.c diff --git a/drivers/char/joystick/adi.c b/drivers/input/joystick/adi.c index 777d4b943..777d4b943 100644 --- a/drivers/char/joystick/adi.c +++ b/drivers/input/joystick/adi.c diff --git a/drivers/char/joystick/amijoy.c b/drivers/input/joystick/amijoy.c index 6134e1f1e..6134e1f1e 100644 --- a/drivers/char/joystick/amijoy.c +++ b/drivers/input/joystick/amijoy.c diff --git a/drivers/char/joystick/analog.c b/drivers/input/joystick/analog.c index b45127ed4..b45127ed4 100644 --- a/drivers/char/joystick/analog.c +++ b/drivers/input/joystick/analog.c diff --git a/drivers/char/joystick/cobra.c b/drivers/input/joystick/cobra.c index 5356160dd..5356160dd 100644 --- a/drivers/char/joystick/cobra.c +++ b/drivers/input/joystick/cobra.c diff --git a/drivers/char/joystick/db9.c b/drivers/input/joystick/db9.c index 2244a9a2d..2244a9a2d 100644 --- a/drivers/char/joystick/db9.c +++ b/drivers/input/joystick/db9.c diff --git a/drivers/char/joystick/gamecon.c b/drivers/input/joystick/gamecon.c index e7b4a7996..e7b4a7996 100644 --- a/drivers/char/joystick/gamecon.c +++ b/drivers/input/joystick/gamecon.c diff --git a/drivers/char/joystick/gf2k.c b/drivers/input/joystick/gf2k.c index dbb364f23..dbb364f23 100644 --- a/drivers/char/joystick/gf2k.c +++ b/drivers/input/joystick/gf2k.c diff --git a/drivers/char/joystick/grip.c b/drivers/input/joystick/grip.c index bcd73aca7..bcd73aca7 100644 --- a/drivers/char/joystick/grip.c +++ b/drivers/input/joystick/grip.c diff --git a/drivers/char/joystick/iforce.c b/drivers/input/joystick/iforce.c index d967c3725..bc9569fcc 100644 --- a/drivers/char/joystick/iforce.c +++ b/drivers/input/joystick/iforce.c @@ -51,10 +51,10 @@ MODULE_LICENSE("GPL"); #define IFORCE_MAX_LENGTH 16 -#if defined(CONFIG_INPUT_IFORCE_232) || defined(CONFIG_INPUT_IFORCE_232_MODULE) +#if defined(CONFIG_JOYSTICK_IFORCE_232) || defined(CONFIG_JOYSTICK_IFORCE_232_MODULE) #define IFORCE_232 1 #endif -#if defined(CONFIG_INPUT_IFORCE_USB) || defined(CONFIG_INPUT_IFORCE_USB_MODULE) +#if defined(CONFIG_JOYSTICK_IFORCE_USB) || defined(CONFIG_JOYSTICK_IFORCE_USB_MODULE) #define IFORCE_USB 2 #endif diff --git a/drivers/char/joystick/interact.c b/drivers/input/joystick/interact.c index 9dec620a1..9dec620a1 100644 --- a/drivers/char/joystick/interact.c +++ b/drivers/input/joystick/interact.c diff --git a/drivers/char/joystick/magellan.c b/drivers/input/joystick/magellan.c index e22c831c2..e22c831c2 100644 --- a/drivers/char/joystick/magellan.c +++ b/drivers/input/joystick/magellan.c diff --git a/drivers/char/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c index 29fa6f7e1..29fa6f7e1 100644 --- a/drivers/char/joystick/sidewinder.c +++ b/drivers/input/joystick/sidewinder.c diff --git a/drivers/char/joystick/spaceball.c b/drivers/input/joystick/spaceball.c index d7614d5fe..d7614d5fe 100644 --- a/drivers/char/joystick/spaceball.c +++ b/drivers/input/joystick/spaceball.c diff --git a/drivers/char/joystick/spaceorb.c b/drivers/input/joystick/spaceorb.c index 0ec9c72b3..0ec9c72b3 100644 --- a/drivers/char/joystick/spaceorb.c +++ b/drivers/input/joystick/spaceorb.c diff --git a/drivers/char/joystick/stinger.c b/drivers/input/joystick/stinger.c index f520fc375..f520fc375 100644 --- a/drivers/char/joystick/stinger.c +++ b/drivers/input/joystick/stinger.c diff --git a/drivers/char/joystick/tmdc.c b/drivers/input/joystick/tmdc.c index 85d2e6979..85d2e6979 100644 --- a/drivers/char/joystick/tmdc.c +++ b/drivers/input/joystick/tmdc.c diff --git a/drivers/char/joystick/turbografx.c b/drivers/input/joystick/turbografx.c index 3e8431c00..3e8431c00 100644 --- a/drivers/char/joystick/turbografx.c +++ b/drivers/input/joystick/turbografx.c diff --git a/drivers/char/joystick/warrior.c b/drivers/input/joystick/warrior.c index 2acfed20d..2acfed20d 100644 --- a/drivers/char/joystick/warrior.c +++ b/drivers/input/joystick/warrior.c diff --git a/drivers/input/serio/Config.help b/drivers/input/serio/Config.help new file mode 100644 index 000000000..a82785414 --- /dev/null +++ b/drivers/input/serio/Config.help @@ -0,0 +1,26 @@ +CONFIG_SERIO + Say Yes here if you have any input device that uses serial I/O to + communicate with the system. This includes the + * standard AT keyboard and PS/2 mouse * + as well as serial mice, Sun keyboards, some joysticks and 6dof + devices and more. + + If unsure, say Y. + + This driver 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 serio.o. If you want to compile it + as a module, say M here and read <file:Documentation/modules.txt>. + +CONFIG_SERIO_SERPORT + Say Y here if you plan to use an input device (mouse, joystick, + tablet, 6dof) that communicates over the RS232 serial (COM) port. + + More information is available: <file:Documentation/input/input.txt> + + If unsure, say Y. + + This driver 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 serport.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. diff --git a/drivers/input/serio/Config.in b/drivers/input/serio/Config.in new file mode 100644 index 000000000..cc566ad20 --- /dev/null +++ b/drivers/input/serio/Config.in @@ -0,0 +1,7 @@ +# +# Input core configuration +# + +tristate 'Serial i/o support' CONFIG_SERIO + +dep_tristate ' Serial port line discipline' CONFIG_SERIO_SERPORT $CONFIG_SERIO diff --git a/drivers/input/serio/Makefile b/drivers/input/serio/Makefile new file mode 100644 index 000000000..9287af0ba --- /dev/null +++ b/drivers/input/serio/Makefile @@ -0,0 +1,20 @@ +# +# Makefile for the input core drivers. +# + +# The target object and module list name. + +O_TARGET := seriodrv.o + +# Objects that export symbols. + +export-objs := serio.o + +# Each configuration option enables a list of files. + +obj-$(CONFIG_SERIO) += serio.o +obj-$(CONFIG_SERIO_SERPORT) += serport.o + +# The global Rules.make. + +include $(TOPDIR)/Rules.make diff --git a/drivers/char/joystick/serio.c b/drivers/input/serio/serio.c index 98111dad9..98111dad9 100644 --- a/drivers/char/joystick/serio.c +++ b/drivers/input/serio/serio.c diff --git a/drivers/char/joystick/serport.c b/drivers/input/serio/serport.c index efe94e679..efe94e679 100644 --- a/drivers/char/joystick/serport.c +++ b/drivers/input/serio/serport.c diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c index 7fdeb01c9..65043e636 100644 --- a/drivers/isdn/hisax/elsa.c +++ b/drivers/isdn/hisax/elsa.c @@ -396,7 +396,8 @@ elsa_interrupt_ipac(int intno, void *dev_id, struct pt_regs *regs) } if (cs->subtyp == ELSA_QS1000PCI || cs->subtyp == ELSA_QS3000PCI) { val = bytein(cs->hw.elsa.cfg + 0x4c); /* PCI IRQ */ - if (!(val & ELSA_PCI_IRQ_MASK)) + if (!test_bit(FLG_BUGGY_PLX9050, &cs->HW_Flags) && + !(val & ELSA_PCI_IRQ_MASK)) return; } #if ARCOFI_USE @@ -868,7 +869,7 @@ setup_elsa(struct IsdnCard *card) { long flags; int bytecnt; - u_char val; + u_char val, pci_rev; struct IsdnCardState *cs = card->cs; char tmp[64]; @@ -992,6 +993,7 @@ setup_elsa(struct IsdnCard *card) cs->irq = dev_qs1000->irq; cs->hw.elsa.cfg = pci_resource_start(dev_qs1000, 1); cs->hw.elsa.base = pci_resource_start(dev_qs1000, 3); + pci_read_config_byte(dev_qs1000, PCI_REVISION_ID, &pci_rev); } else if ((dev_qs3000 = pci_find_device(PCI_VENDOR_ID_ELSA, PCI_DEVICE_ID_ELSA_QS3000, dev_qs3000))) { if (pci_enable_device(dev_qs3000)) @@ -1000,6 +1002,7 @@ setup_elsa(struct IsdnCard *card) cs->irq = dev_qs3000->irq; cs->hw.elsa.cfg = pci_resource_start(dev_qs3000, 1); cs->hw.elsa.base = pci_resource_start(dev_qs3000, 3); + pci_read_config_byte(dev_qs1000, PCI_REVISION_ID, &pci_rev); } else { printk(KERN_WARNING "Elsa: No PCI card found\n"); return(0); @@ -1013,15 +1016,9 @@ setup_elsa(struct IsdnCard *card) printk(KERN_WARNING "Elsa: No IO-Adr for PCI card found\n"); return(0); } - if ((cs->hw.elsa.cfg & 0xff) || (cs->hw.elsa.base & 0xf)) { - printk(KERN_WARNING "Elsa: You may have a wrong PCI bios\n"); - printk(KERN_WARNING "Elsa: If your system hangs now, read\n"); - printk(KERN_WARNING "Elsa: Documentation/isdn/README.HiSax\n"); - printk(KERN_WARNING "Elsa: Waiting 5 sec to sync discs\n"); - save_flags(flags); - sti(); - HZDELAY(500); /* wait 500*10 ms */ - restore_flags(flags); + if (cs->hw.elsa.cfg & 0x80 && pci_rev == 1) { + printk(KERN_INFO "Elsa: PLX9050 rev1 workaround activated"); + set_bit(FLG_BUGGY_PLX9050, &cs->HW_Flags); } cs->hw.elsa.ale = cs->hw.elsa.base; cs->hw.elsa.isac = cs->hw.elsa.base +1; diff --git a/drivers/isdn/hisax/gazel.c b/drivers/isdn/hisax/gazel.c index 0cdd30860..a99fc45e1 100644 --- a/drivers/isdn/hisax/gazel.c +++ b/drivers/isdn/hisax/gazel.c @@ -382,12 +382,16 @@ reset_gazel(struct IsdnCardState *cs) outb(INT_ISAC_EN + INT_HSCX_EN + INT_PCI_EN, addr + PLX_INCSR); break; case R753: - plxcntrl = inl(addr + PLX_CNTRL); + if (test_bit(FLG_BUGGY_PLX9050, &cs->HW_Flags)) + /* we can't read, assume the default */ + plxcntrl = 0x18784db6; + else + plxcntrl = inl(addr + PLX_CNTRL); plxcntrl |= (RESET_9050 + RESET_GAZEL); outl(plxcntrl, addr + PLX_CNTRL); - plxcntrl &= ~(RESET_9050 + RESET_GAZEL); WriteISAC(cs, IPAC_POTA2 - 0x80, 0x20); HZDELAY(4); + plxcntrl &= ~(RESET_9050 + RESET_GAZEL); outl(plxcntrl, addr + PLX_CNTRL); HZDELAY(10); WriteISAC(cs, IPAC_POTA2 - 0x80, 0x00); @@ -549,6 +553,7 @@ setup_gazelpci(struct IsdnCardState *cs) u_int pci_ioaddr0 = 0, pci_ioaddr1 = 0; u_char pci_irq = 0, found; u_int nbseek, seekcard; + u_char pci_rev; printk(KERN_WARNING "Gazel: PCI card automatic recognition\n"); @@ -623,6 +628,18 @@ setup_gazelpci(struct IsdnCardState *cs) printk(KERN_INFO "Gazel: config irq:%d ipac:0x%X cfg:0x%X\n", cs->irq, cs->hw.gazel.ipac, cs->hw.gazel.cfg_reg); + /* + * Erratum for PLX9050, revision 1: + * If bit 7 of BAR 0/1 is set, local config registers + * can not be read (write is okay) + */ + if (cs->hw.gazel.cfg_reg & 0x80) { + pci_read_config_byte(dev_tel, PCI_REVISION_ID, &pci_rev); + if (pci_rev == 1) { + printk(KERN_INFO "Gazel: PLX9050 rev1 workaround activated"); + set_bit(FLG_BUGGY_PLX9050, &cs->HW_Flags); + } + } break; } diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h index 4915d01ad..646dbd374 100644 --- a/drivers/isdn/hisax/hisax.h +++ b/drivers/isdn/hisax/hisax.h @@ -859,6 +859,7 @@ struct icc_chip { #define FLG_ARCOFI_TIMER 8 #define FLG_ARCOFI_ERROR 9 #define FLG_HW_L1_UINT 10 +#define FLG_BUGGY_PLX9050 11 struct IsdnCardState { unsigned char typ; diff --git a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c index a8359bb81..3c5d54353 100644 --- a/drivers/isdn/hisax/hisax_fcpcipnp.c +++ b/drivers/isdn/hisax/hisax_fcpcipnp.c @@ -20,6 +20,7 @@ * * o POWER PC * o clean up debugging + * o tx_skb at PH_DEACTIVATE time */ #include <linux/version.h> @@ -368,10 +369,7 @@ static void hdlc_fill_fifo(struct fritz_bcs *bcs) unsigned long flags; unsigned char *p; - DBG(0x40, "hdlc_fill_fifo"); - - if (!skb) - BUG(); + DBG(0x40, ""); if (skb->len == 0) BUG(); @@ -581,14 +579,14 @@ static void modehdlc(struct fritz_bcs *bcs, int mode) adapter->write_ctrl(bcs, 5); break; case L1_MODE_TRANS: - bcs->ctrl.sr.mode = HDLC_MODE_TRANS; - adapter->write_ctrl(bcs, 5); - bcs->ctrl.sr.cmd = HDLC_CMD_XRS; - adapter->write_ctrl(bcs, 1); - bcs->ctrl.sr.cmd = 0; - break; case L1_MODE_HDLC: - bcs->ctrl.sr.mode = HDLC_MODE_ITF_FLG; + bcs->rcvidx = 0; + bcs->tx_cnt = 0; + bcs->tx_skb = NULL; + if (mode == L1_MODE_TRANS) + bcs->ctrl.sr.mode = HDLC_MODE_TRANS; + else + bcs->ctrl.sr.mode = HDLC_MODE_ITF_FLG; adapter->write_ctrl(bcs, 5); bcs->ctrl.sr.cmd = HDLC_CMD_XRS; adapter->write_ctrl(bcs, 1); diff --git a/drivers/isdn/isdn_audio.c b/drivers/isdn/isdn_audio.c index 164d3a160..7f848fe7b 100644 --- a/drivers/isdn/isdn_audio.c +++ b/drivers/isdn/isdn_audio.c @@ -227,8 +227,10 @@ isdn_audio_tlookup(const u_char *table, u_char *buff, unsigned long n) : "0"((long) table), "1"(n), "2"((long) buff), "3"((long) buff) : "memory", "ax"); #else - while (n--) - *buff++ = table[*(unsigned char *)buff]; + while (n--) { + *buff = table[*buff]; + buff++; + } #endif } diff --git a/drivers/isdn/isdn_common.c b/drivers/isdn/isdn_common.c index ae1f624f7..dc7779583 100644 --- a/drivers/isdn/isdn_common.c +++ b/drivers/isdn/isdn_common.c @@ -2178,7 +2178,6 @@ static void isdn_register_devfs(int k) static void isdn_unregister_devfs(int k) { - devfs_unregister (dev->devfs_handle_isdnX[k]); devfs_unregister (dev->devfs_handle_isdnctrlX[k]); } @@ -2226,22 +2225,18 @@ static void isdn_cleanup_devfs(void) #else /* CONFIG_DEVFS_FS */ static void isdn_register_devfs(int dummy) { - return; } static void isdn_unregister_devfs(int dummy) { - return; } static void isdn_init_devfs(void) { - return; } static void isdn_cleanup_devfs(void) { - return; } #endif /* CONFIG_DEVFS_FS */ diff --git a/drivers/isdn/isdn_net.c b/drivers/isdn/isdn_net.c index 907c8711f..cde540b0c 100644 --- a/drivers/isdn/isdn_net.c +++ b/drivers/isdn/isdn_net.c @@ -369,8 +369,7 @@ isdn_net_autohup() l->name, l->chargetime, l->chargeint); isdn_net_hangup(&p->dev); } - } else - isdn_net_hangup(&p->dev); + } } else if (l->hupflags & ISDN_INHUP) isdn_net_hangup(&p->dev); } @@ -2872,7 +2871,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg) else lp->hupflags &= ~ISDN_INHUP; if (cfg->chargeint > 10) { - lp->hupflags |= ISDN_CHARGEHUP | ISDN_HAVECHARGE | ISDN_MANCHARGE; + lp->hupflags |= ISDN_HAVECHARGE | ISDN_MANCHARGE; lp->chargeint = cfg->chargeint * HZ; } if (cfg->p_encap != lp->p_encap) { diff --git a/drivers/parport/ChangeLog b/drivers/parport/ChangeLog index f5ed5694b..9a3d73fd7 100644 --- a/drivers/parport/ChangeLog +++ b/drivers/parport/ChangeLog @@ -1,3 +1,61 @@ +2002-01-21 Tim Waugh <twaugh@redhat.com> + + * daisy.c: Apply patch from Max Vorobiev to make parport_daisy_select + work for ECP/EPP modes. + +2002-01-04 Tim Waugh <twaugh@redhat.com> + + * share.c (parport_claim_or_block): Sleep interruptibly to prevent + a possible deadlock. + +2002-01-13 Niels Kristian Bech Jensen <nkbj@image.dk> + + * parport_pc.c: Change some occurrences of frob_set_mode to + ECR_WRITE. This fixes PLIP. + +2001-10-25 Damian Gruszka <damian.gruszka@VisionSystems.de> + + * parport_pc.c (ECR_WRITE): Define. If there are forbidden bits + in the ECR register for some chips, this will be a useful place to + put that knowledge. + (change_mode): Use ECR_WRITE. + (parport_pc_restore_state): Likewise. + (parport_ECPPS2_supported): Likewise. + (parport_ECPEPP_supported): Likewise. + (irq_probe_EPP): Likewise. + (programmable_irq_support): Likewise. + (programmable_dma_support): Likewise. + (parport_pc_probe_port): Likewise. + + (frob_set_mode): New function. Set the mode bits of the ECR. + (get_fifo_residue): Use frob_set_mode. + (parport_pc_ecpepp_read_data): Likewise. + (parport_pc_ecpepp_write_data): Likewise. + (parport_pc_ecpepp_read_addr): Likewise. + (parport_pc_ecpepp_write_addr): Likewise. + (parport_pc_compat_write_block_pio): Likewise. + (parport_pc_ecp_write_block_pio): Likewise. + (parport_ECR_present): Likewise. + (parport_ECP_supported): Likewise. + (parport_EPP_supported): Likewise. + (parport_ECPEPP_supported): Likewise. + (programmable_irq_support): Likewise. + (irq_probe_ECP): Likewise. + (programmable_dma_support): Likewise. + + (parport_pc_enable_irq): Only enable interrupts if we know which + IRQ line they will come from. + (parport_pc_init_state): Set nErrIntrEn at initialisation. + (parport_pc_restore_state): Only write writable bits of CTR. + (parport_irq_probe): If no IRQ is found, take ackIntEn out of the + writable bit set. + +2001-10-25 Tim Waugh <twaugh@redhat.com> + + * parport_pc.c (parport_pc_fifo_write_block_pio): Correct typo. + (parport_pc_init_state): Only set ackIntEn if we know which IRQ + line the interrupts will come from. + 2001-12-07 Tim Waugh <twaugh@redhat.com> * ieee1284_ops.c (parport_ieee1284_epp_write_addr, diff --git a/drivers/parport/daisy.c b/drivers/parport/daisy.c index 573c5ef20..dddba9713 100644 --- a/drivers/parport/daisy.c +++ b/drivers/parport/daisy.c @@ -406,8 +406,33 @@ void parport_daisy_deselect_all (struct parport *port) int parport_daisy_select (struct parport *port, int daisy, int mode) { - /* mode is currently ignored. FIXME? */ - return cpp_daisy (port, 0xe0 + daisy) & PARPORT_STATUS_ERROR; + switch (mode) + { + // For these modes we should switch to EPP mode: + case IEEE1284_MODE_EPP: + case IEEE1284_MODE_EPPSL: + case IEEE1284_MODE_EPPSWE: + return (cpp_daisy (port, 0x20 + daisy) & + PARPORT_STATUS_ERROR); + + // For these modes we should switch to ECP mode: + case IEEE1284_MODE_ECP: + case IEEE1284_MODE_ECPRLE: + case IEEE1284_MODE_ECPSWE: + return (cpp_daisy (port, 0xd0 + daisy) & + PARPORT_STATUS_ERROR); + + // Nothing was told for BECP in Daisy chain specification. + // May be it's wise to use ECP? + case IEEE1284_MODE_BECP: + // Others use compat mode + case IEEE1284_MODE_NIBBLE: + case IEEE1284_MODE_BYTE: + case IEEE1284_MODE_COMPAT: + default: + return (cpp_daisy (port, 0xe0 + daisy) & + PARPORT_STATUS_ERROR); + } } static int mux_present (struct parport *port) diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index 45e1abded..e32df6966 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c @@ -73,6 +73,8 @@ #define ECR_VND 05 #define ECR_TST 06 #define ECR_CNF 07 +#define ECR_MODE_MASK 0xe0 +#define ECR_WRITE(p,v) frob_econtrol((p),0xff,(v)) #undef DEBUG @@ -100,13 +102,22 @@ static int registered_parport; static void frob_econtrol (struct parport *pb, unsigned char m, unsigned char v) { - unsigned char ectr = inb (ECONTROL (pb)); + unsigned char ectr = 0; + + if (m != 0xff) + ectr = inb (ECONTROL (pb)); + DPRINTK (KERN_DEBUG "frob_econtrol(%02x,%02x): %02x -> %02x\n", m, v, ectr, (ectr & ~m) ^ v); outb ((ectr & ~m) ^ v, ECONTROL (pb)); } +static void __inline__ frob_set_mode (struct parport *p, int mode) +{ + frob_econtrol (p, ECR_MODE_MASK, mode << 5); +} + #ifdef CONFIG_PARPORT_PC_FIFO /* Safely change the mode bits in the ECR Returns: @@ -117,7 +128,6 @@ static void frob_econtrol (struct parport *pb, unsigned char m, static int change_mode(struct parport *p, int m) { const struct parport_pc_private *priv = p->physport->private_data; - int ecr = ECONTROL(p); unsigned char oecr; int mode; @@ -129,7 +139,7 @@ static int change_mode(struct parport *p, int m) } /* Bits <7:5> contain the mode. */ - oecr = inb (ecr); + oecr = inb (ECONTROL (p)); mode = (oecr >> 5) & 0x7; if (mode == m) return 0; @@ -166,13 +176,13 @@ static int change_mode(struct parport *p, int m) /* We have to go through mode 001 */ oecr &= ~(7 << 5); oecr |= ECR_PS2 << 5; - outb (oecr, ecr); + ECR_WRITE (p, oecr); } /* Set the mode. */ oecr &= ~(7 << 5); oecr |= m << 5; - outb (oecr, ecr); + ECR_WRITE (p, oecr); return 0; } @@ -197,10 +207,10 @@ static int get_fifo_residue (struct parport *p) residue); /* Reset the FIFO. */ - frob_econtrol (p, 0xe0, ECR_PS2 << 5); + frob_set_mode (p, ECR_PS2); /* Now change to config mode and clean up. FIXME */ - frob_econtrol (p, 0xe0, ECR_CNF << 5); + frob_set_mode (p, ECR_CNF); cnfga = inb (CONFIGA (p)); printk (KERN_DEBUG "%s: cnfgA contains 0x%02x\n", p->name, cnfga); @@ -213,7 +223,7 @@ static int get_fifo_residue (struct parport *p) * PWord != 1 byte. */ /* Back to PS2 mode. */ - frob_econtrol (p, 0xe0, ECR_PS2 << 5); + frob_set_mode (p, ECR_PS2); DPRINTK (KERN_DEBUG "*** get_fifo_residue: done residue collecting (ecr = 0x%2.2x)\n", inb (ECONTROL (p))); return residue; @@ -331,7 +341,8 @@ void parport_pc_disable_irq(struct parport *p) void parport_pc_enable_irq(struct parport *p) { - __parport_pc_frob_control (p, 0x10, 0x10); + if (p->irq != PARPORT_IRQ_NONE) + __parport_pc_frob_control (p, 0x10, 0x10); } void parport_pc_data_forward (struct parport *p) @@ -346,8 +357,14 @@ void parport_pc_data_reverse (struct parport *p) void parport_pc_init_state(struct pardevice *dev, struct parport_state *s) { - s->u.pc.ctr = 0xc | (dev->irq_func ? 0x10 : 0x0); - s->u.pc.ecr = 0x24; + s->u.pc.ctr = 0xc; + if (dev->irq_func && + dev->port->irq != PARPORT_IRQ_NONE) + /* Set ackIntEn */ + s->u.pc.ctr |= 0x10; + + s->u.pc.ecr = 0x34; /* NetMos chip can cause problems 0x24; + * D.Gruszka VScom */ } void parport_pc_save_state(struct parport *p, struct parport_state *s) @@ -361,10 +378,11 @@ void parport_pc_save_state(struct parport *p, struct parport_state *s) void parport_pc_restore_state(struct parport *p, struct parport_state *s) { struct parport_pc_private *priv = p->physport->private_data; - outb (s->u.pc.ctr, CONTROL (p)); - priv->ctr = s->u.pc.ctr; + register unsigned char c = s->u.pc.ctr & priv->ctr_writable; + outb (c, CONTROL (p)); + priv->ctr = c; if (priv->ecr) - outb (s->u.pc.ecr, ECONTROL (p)); + ECR_WRITE (p, s->u.pc.ecr); } #ifdef CONFIG_PARPORT_1284 @@ -516,11 +534,11 @@ static size_t parport_pc_ecpepp_read_data (struct parport *port, void *buf, { size_t got; - frob_econtrol (port, 0xe0, ECR_EPP << 5); + frob_set_mode (port, ECR_EPP); parport_pc_data_reverse (port); parport_pc_write_control (port, 0x4); got = parport_pc_epp_read_data (port, buf, length, flags); - frob_econtrol (port, 0xe0, ECR_PS2 << 5); + frob_set_mode (port, ECR_PS2); return got; } @@ -531,11 +549,11 @@ static size_t parport_pc_ecpepp_write_data (struct parport *port, { size_t written; - frob_econtrol (port, 0xe0, ECR_EPP << 5); + frob_set_mode (port, ECR_EPP); parport_pc_write_control (port, 0x4); parport_pc_data_forward (port); written = parport_pc_epp_write_data (port, buf, length, flags); - frob_econtrol (port, 0xe0, ECR_PS2 << 5); + frob_set_mode (port, ECR_PS2); return written; } @@ -545,11 +563,11 @@ static size_t parport_pc_ecpepp_read_addr (struct parport *port, void *buf, { size_t got; - frob_econtrol (port, 0xe0, ECR_EPP << 5); + frob_set_mode (port, ECR_EPP); parport_pc_data_reverse (port); parport_pc_write_control (port, 0x4); got = parport_pc_epp_read_addr (port, buf, length, flags); - frob_econtrol (port, 0xe0, ECR_PS2 << 5); + frob_set_mode (port, ECR_PS2); return got; } @@ -560,11 +578,11 @@ static size_t parport_pc_ecpepp_write_addr (struct parport *port, { size_t written; - frob_econtrol (port, 0xe0, ECR_EPP << 5); + frob_set_mode (port, ECR_EPP); parport_pc_write_control (port, 0x4); parport_pc_data_forward (port); written = parport_pc_epp_write_addr (port, buf, length, flags); - frob_econtrol (port, 0xe0, ECR_PS2 << 5); + frob_set_mode (port, ECR_PS2); return written; } @@ -612,7 +630,7 @@ static size_t parport_pc_fifo_write_block_pio (struct parport *port, /* FIFO is full. Wait for interrupt. */ /* Clear serviceIntr */ - outb (ecrval & ~(1<<2), ECONTROL (port)); + ECR_WRITE (port, ecrval & ~(1<<2)); false_alarm: ret = parport_wait_event (port, HZ); if (ret < 0) break; @@ -663,7 +681,7 @@ static size_t parport_pc_fifo_write_block_pio (struct parport *port, left--; } -dump_parport_state ("leave fifo_write_block_dma", port); +dump_parport_state ("leave fifo_write_block_pio", port); return length - left; } @@ -837,7 +855,7 @@ size_t parport_pc_compat_write_block_pio (struct parport *port, printk (KERN_DEBUG "%s: FIFO is stuck\n", port->name); /* Prevent further data transfer. */ - frob_econtrol (port, 0xe0, ECR_TST << 5); + frob_set_mode (port, ECR_TST); /* Adjust for the contents of the FIFO. */ for (written -= priv->fifo_depth; ; written++) { @@ -849,7 +867,7 @@ size_t parport_pc_compat_write_block_pio (struct parport *port, } /* Reset the FIFO and return to PS2 mode. */ - frob_econtrol (port, 0xe0, ECR_PS2 << 5); + frob_set_mode (port, ECR_PS2); } r = parport_wait_peripheral (port, @@ -934,7 +952,7 @@ size_t parport_pc_ecp_write_block_pio (struct parport *port, printk (KERN_DEBUG "%s: FIFO is stuck\n", port->name); /* Prevent further data transfer. */ - frob_econtrol (port, 0xe0, ECR_TST << 5); + frob_set_mode (port, ECR_TST); /* Adjust for the contents of the FIFO. */ for (written -= priv->fifo_depth; ; written++) { @@ -946,7 +964,7 @@ size_t parport_pc_ecp_write_block_pio (struct parport *port, } /* Reset the FIFO and return to PS2 mode. */ - frob_econtrol (port, 0xe0, ECR_PS2 << 5); + frob_set_mode (port, ECR_PS2); /* Host transfer recovery. */ parport_pc_data_reverse (port); /* Must be in PS2 mode */ @@ -1113,7 +1131,7 @@ dump_parport_state ("FIFO empty", port); } /* Clear serviceIntr */ - outb (ecrval & ~(1<<2), ECONTROL (port)); + ECR_WRITE (port, ecrval & ~(1<<2)); false_alarm: dump_parport_state ("waiting", port); ret = parport_wait_event (port, HZ); @@ -1716,7 +1734,7 @@ static int __devinit parport_ECR_present(struct parport *pb) if ((inb (ECONTROL (pb)) & 0x3 ) != 0x1) goto no_reg; - outb (0x34, ECONTROL (pb)); + ECR_WRITE (pb, 0x34); if (inb (ECONTROL (pb)) != 0x35) goto no_reg; @@ -1724,7 +1742,7 @@ static int __devinit parport_ECR_present(struct parport *pb) outb (0xc, CONTROL (pb)); /* Go to mode 000 */ - frob_econtrol (pb, 0xe0, ECR_SPP << 5); + frob_set_mode (pb, ECR_SPP); return 1; @@ -1794,8 +1812,8 @@ static int __devinit parport_ECP_supported(struct parport *pb) return 0; /* Find out FIFO depth */ - outb (ECR_SPP << 5, ECONTROL (pb)); /* Reset FIFO */ - outb (ECR_TST << 5, ECONTROL (pb)); /* TEST FIFO */ + ECR_WRITE (pb, ECR_SPP << 5); /* Reset FIFO */ + ECR_WRITE (pb, ECR_TST << 5); /* TEST FIFO */ for (i=0; i < 1024 && !(inb (ECONTROL (pb)) & 0x02); i++) outb (0xaa, FIFO (pb)); @@ -1804,7 +1822,7 @@ static int __devinit parport_ECP_supported(struct parport *pb) * it doesn't support ECP or FIFO MODE */ if (i == 1024) { - outb (ECR_SPP << 5, ECONTROL (pb)); + ECR_WRITE (pb, ECR_SPP << 5); return 0; } @@ -1834,9 +1852,9 @@ static int __devinit parport_ECP_supported(struct parport *pb) priv->writeIntrThreshold = i; /* Find out readIntrThreshold */ - frob_econtrol (pb, 0xe0, ECR_PS2 << 5); /* Reset FIFO and enable PS2 */ + frob_set_mode (pb, ECR_PS2); /* Reset FIFO and enable PS2 */ parport_pc_data_reverse (pb); /* Must be in PS2 mode */ - frob_econtrol (pb, 0xe0, ECR_TST << 5); /* Test FIFO */ + frob_set_mode (pb, ECR_TST); /* Test FIFO */ frob_econtrol (pb, 1<<2, 1<<2); frob_econtrol (pb, 1<<2, 0); for (i = 1; i <= priv->fifo_depth; i++) { @@ -1855,8 +1873,8 @@ static int __devinit parport_ECP_supported(struct parport *pb) priv->readIntrThreshold = i; - outb (ECR_SPP << 5, ECONTROL (pb)); /* Reset FIFO */ - outb (0xf4, ECONTROL (pb)); /* Configuration mode */ + ECR_WRITE (pb, ECR_SPP << 5); /* Reset FIFO */ + ECR_WRITE (pb, 0xf4); /* Configuration mode */ config = inb (CONFIGA (pb)); pword = (config >> 4) & 0x7; switch (pword) { @@ -1901,7 +1919,7 @@ static int __devinit parport_ECP_supported(struct parport *pb) } /* Go back to mode 000 */ - frob_econtrol (pb, 0xe0, ECR_SPP << 5); + frob_set_mode (pb, ECR_SPP); return 1; } @@ -1917,11 +1935,9 @@ static int __devinit parport_ECPPS2_supported(struct parport *pb) return 0; oecr = inb (ECONTROL (pb)); - outb (ECR_PS2 << 5, ECONTROL (pb)); - + ECR_WRITE (pb, ECR_PS2 << 5); result = parport_PS2_supported(pb); - - outb (oecr, ECONTROL (pb)); + ECR_WRITE (pb, oecr); return result; } @@ -1953,7 +1969,7 @@ static int __devinit parport_EPP_supported(struct parport *pb) if (priv->ecr) { unsigned char i; for (i = 0x00; i < 0x80; i += 0x20) { - outb (i, ECONTROL (pb)); + ECR_WRITE (pb, i); if (clear_epp_timeout (pb)) { /* Phony EPP in ECP. */ return 0; @@ -1984,11 +2000,11 @@ static int __devinit parport_ECPEPP_supported(struct parport *pb) oecr = inb (ECONTROL (pb)); /* Search for SMC style EPP+ECP mode */ - outb (0x80, ECONTROL (pb)); + ECR_WRITE (pb, 0x80); outb (0x04, CONTROL (pb)); result = parport_EPP_supported(pb); - outb (oecr, ECONTROL (pb)); + ECR_WRITE (pb, oecr); if (result) { /* Set up access functions to use ECP+EPP hardware. */ @@ -2025,12 +2041,12 @@ static int __devinit programmable_irq_support(struct parport *pb) PARPORT_IRQ_NONE, 7, 9, 10, 11, 14, 15, 5 }; - outb (ECR_CNF << 5, ECONTROL (pb)); /* Configuration MODE */ + ECR_WRITE (pb, ECR_CNF << 5); /* Configuration MODE */ intrLine = (inb (CONFIGB (pb)) >> 3) & 0x07; irq = lookup[intrLine]; - outb (oecr, ECONTROL (pb)); + ECR_WRITE (pb, oecr); return irq; } @@ -2042,16 +2058,16 @@ static int __devinit irq_probe_ECP(struct parport *pb) sti(); irqs = probe_irq_on(); - outb (ECR_SPP << 5, ECONTROL (pb)); /* Reset FIFO */ - outb ((ECR_TST << 5) | 0x04, ECONTROL (pb)); - outb (ECR_TST << 5, ECONTROL (pb)); + ECR_WRITE (pb, ECR_SPP << 5); /* Reset FIFO */ + ECR_WRITE (pb, (ECR_TST << 5) | 0x04); + ECR_WRITE (pb, ECR_TST << 5); /* If Full FIFO sure that writeIntrThreshold is generated */ for (i=0; i < 1024 && !(inb (ECONTROL (pb)) & 0x02) ; i++) outb (0xaa, FIFO (pb)); pb->irq = probe_irq_off(irqs); - outb (ECR_SPP << 5, ECONTROL (pb)); + ECR_WRITE (pb, ECR_SPP << 5); if (pb->irq <= 0) pb->irq = PARPORT_IRQ_NONE; @@ -2093,7 +2109,7 @@ static int __devinit irq_probe_EPP(struct parport *pb) pb->irq = probe_irq_off (irqs); if (pb->modes & PARPORT_MODE_PCECR) - outb (oecr, ECONTROL (pb)); + ECR_WRITE (pb, oecr); parport_pc_write_control(pb, 0xc); if (pb->irq <= 0) @@ -2118,7 +2134,9 @@ static int __devinit irq_probe_SPP(struct parport *pb) */ static int __devinit parport_irq_probe(struct parport *pb) { - const struct parport_pc_private *priv = pb->private_data; + struct parport_pc_private *priv = pb->private_data; + + priv->ctr_writable |= 0x10; if (priv->ecr) { pb->irq = programmable_irq_support(pb); @@ -2144,6 +2162,9 @@ static int __devinit parport_irq_probe(struct parport *pb) if (pb->irq == PARPORT_IRQ_NONE) pb->irq = get_superio_irq(pb); + if (pb->irq == PARPORT_IRQ_NONE) + priv->ctr_writable &= ~0x10; + return pb->irq; } @@ -2155,7 +2176,7 @@ static int __devinit programmable_dma_support (struct parport *p) unsigned char oecr = inb (ECONTROL (p)); int dma; - frob_econtrol (p, 0xe0, ECR_CNF << 5); + frob_set_mode (p, ECR_CNF); dma = inb (CONFIGB(p)) & 0x07; /* 000: Indicates jumpered 8-bit DMA if read-only. @@ -2163,7 +2184,7 @@ static int __devinit programmable_dma_support (struct parport *p) if ((dma & 0x03) == 0) dma = PARPORT_DMA_NONE; - outb (oecr, ECONTROL (p)); + ECR_WRITE (p, oecr); return dma; } @@ -2209,7 +2230,7 @@ struct parport *parport_pc_probe_port (unsigned long int base, } memcpy (ops, &parport_pc_ops, sizeof (struct parport_operations)); priv->ctr = 0xc; - priv->ctr_writable = 0xff; + priv->ctr_writable = ~0x10; priv->ecr = 0; priv->fifo_depth = 0; priv->dma_buf = 0; @@ -2371,7 +2392,7 @@ struct parport *parport_pc_probe_port (unsigned long int base, * Put the ECP detected port in PS2 mode. * Do this also for ports that have ECR but don't do ECP. */ - outb (0x34, ECONTROL (p)); + ECR_WRITE (p, 0x34); parport_pc_write_data(p, 0); parport_pc_data_forward (p); diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 39bd9a6bd..49ab78ba1 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -1011,7 +1011,11 @@ int parport_claim_or_block(struct pardevice *dev) /* If dev->waiting is clear now, an interrupt gave us the port and we would deadlock if we slept. */ if (dev->waiting) { - sleep_on(&dev->wait_q); + interruptible_sleep_on (&dev->wait_q); + if (signal_pending (current)) { + restore_flags (flags); + return -EINTR; + } r = 1; } else { r = 0; @@ -1084,7 +1088,7 @@ void parport_release(struct pardevice *dev) if (pd->waiting & 2) { /* sleeping in claim_or_block */ parport_claim(pd); if (waitqueue_active(&pd->wait_q)) - wake_up(&pd->wait_q); + wake_up_interruptible(&pd->wait_q); return; } else if (pd->wakeup) { pd->wakeup(pd->private); diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 685cb1f7b..01e890afe 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1086,13 +1086,7 @@ struct pci_bus * __devinit pci_add_new_bus(struct pci_bus *parent, struct pci_de child->parent = parent; child->ops = parent->ops; child->sysdata = parent->sysdata; - - /* init generic fields */ - child->iobus.self = &dev->dev; - child->iobus.parent = &parent->iobus; - dev->dev.subordinate = &child->iobus; - - strcpy(child->iobus.name,dev->dev.name); + child->dev = &dev->dev; /* * Set up the primary, secondary and subordinate @@ -1361,16 +1355,11 @@ unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus) DBG("Scanning bus %02x\n", bus->number); max = bus->secondary; - /* we should know for sure what the bus number is, so set the bus ID - * for the bus and make sure it's registered in the device tree */ - sprintf(bus->iobus.bus_id,"pci%d",bus->number); - iobus_register(&bus->iobus); - /* Create a device template */ memset(&dev0, 0, sizeof(dev0)); dev0.bus = bus; dev0.sysdata = bus->sysdata; - dev0.dev.parent = &bus->iobus; + dev0.dev.parent = bus->dev; dev0.dev.driver = &pci_device_driver; /* Go find them, Rover! */ @@ -1430,9 +1419,11 @@ struct pci_bus * __devinit pci_alloc_primary_bus(int bus) return NULL; list_add_tail(&b->node, &pci_root_buses); - sprintf(b->iobus.bus_id,"pci%d",bus); - strcpy(b->iobus.name,"Host/PCI Bridge"); - iobus_register(&b->iobus); + b->dev = kmalloc(sizeof(*(b->dev)),GFP_KERNEL); + memset(b->dev,0,sizeof(*(b->dev))); + sprintf(b->dev->bus_id,"pci%d",bus); + strcpy(b->dev->name,"Host/PCI Bridge"); + device_register(b->dev); b->number = b->secondary = bus; b->resource[0] = &ioport_resource; diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index 3516d445e..81ad81454 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c @@ -371,6 +371,47 @@ static struct seq_operations proc_bus_pci_devices_op = { static struct proc_dir_entry *proc_bus_pci_dir; +/* driverfs files */ +static ssize_t pci_show_irq(struct device * dev, char * buf, size_t count, loff_t off) +{ + struct pci_dev * pci_dev = list_entry(dev,struct pci_dev,dev); + return off ? 0 : sprintf(buf,"%u",pci_dev->irq); +} + +static struct driver_file_entry pci_irq_entry = { + name: "irq", + mode: S_IRUGO, + show: pci_show_irq, +}; + +static ssize_t pci_show_resources(struct device * dev, char * buf, size_t count, loff_t off) +{ + struct pci_dev * pci_dev = list_entry(dev,struct pci_dev,dev); + char * str = buf; + int i; + + if (off && off < DEVICE_COUNT_RESOURCE) { + str += sprintf(str,LONG_FORMAT LONG_FORMAT LONG_FORMAT "\n", + pci_resource_start(pci_dev,off), + pci_resource_end(pci_dev,off), + pci_resource_flags(pci_dev,off)); + } else if (!off) { + for (i = 0; i < DEVICE_COUNT_RESOURCE && pci_resource_start(pci_dev,i); i++) { + str += sprintf(str,LONG_FORMAT LONG_FORMAT LONG_FORMAT "\n", + pci_resource_start(pci_dev,i), + pci_resource_end(pci_dev,i), + pci_resource_flags(pci_dev,i)); + } + } + return (str - buf); +} + +static struct driver_file_entry pci_resource_entry = { + name: "resources", + mode: S_IRUGO, + show: pci_show_resources, +}; + int pci_proc_attach_device(struct pci_dev *dev) { struct pci_bus *bus = dev->bus; @@ -390,6 +431,9 @@ int pci_proc_attach_device(struct pci_dev *dev) e->proc_fops = &proc_bus_pci_operations; e->data = dev; e->size = PCI_CFG_SPACE_SIZE; + + device_create_file(&dev->dev,&pci_irq_entry); + device_create_file(&dev->dev,&pci_resource_entry); return 0; } diff --git a/drivers/scsi/megaraid.h b/drivers/scsi/megaraid.h index 31183c3e5..c7f011222 100644 --- a/drivers/scsi/megaraid.h +++ b/drivers/scsi/megaraid.h @@ -30,7 +30,7 @@ #define M_RD_IOCTL_CMD_NEW 0x81 #define M_RD_DRIVER_IOCTL_INTERFACE 0x82 -#define MEGARAID_VERSION "v1.18 (Release Date: Thu Oct 11 15:02:53 EDT 2001\n)" +#define MEGARAID_VERSION "v1.18 (Release Date: Thu Oct 11 15:02:53 EDT 2001)\n" #define MEGARAID_IOCTL_VERSION 114 diff --git a/drivers/sound/Config.in b/drivers/sound/Config.in index f52174182..aa65d567e 100644 --- a/drivers/sound/Config.in +++ b/drivers/sound/Config.in @@ -34,14 +34,14 @@ dep_tristate ' Creative SBLive! (EMU10K1)' CONFIG_SOUND_EMU10K1 $CONFIG_SOUND $ dep_mbool ' Creative SBLive! MIDI' CONFIG_MIDI_EMU10K1 $CONFIG_SOUND_EMU10K1 $CONFIG_EXPERIMENTAL dep_tristate ' Crystal SoundFusion (CS4280/461x)' CONFIG_SOUND_FUSION $CONFIG_SOUND dep_tristate ' Crystal Sound CS4281' CONFIG_SOUND_CS4281 $CONFIG_SOUND -dep_tristate ' Ensoniq AudioPCI (ES1370)' CONFIG_SOUND_ES1370 $CONFIG_SOUND $CONFIG_PCI -dep_tristate ' Creative Ensoniq AudioPCI 97 (ES1371)' CONFIG_SOUND_ES1371 $CONFIG_SOUND $CONFIG_PCI -dep_tristate ' ESS Technology Solo1' CONFIG_SOUND_ESSSOLO1 $CONFIG_SOUND +dep_tristate ' Ensoniq AudioPCI (ES1370)' CONFIG_SOUND_ES1370 $CONFIG_SOUND $CONFIG_PCI $CONFIG_SOUND_GAMEPORT +dep_tristate ' Creative Ensoniq AudioPCI 97 (ES1371)' CONFIG_SOUND_ES1371 $CONFIG_SOUND $CONFIG_PCI $CONFIG_SOUND_GAMEPORT +dep_tristate ' ESS Technology Solo1' CONFIG_SOUND_ESSSOLO1 $CONFIG_SOUND $CONFIG_SOUND_GAMEPORT dep_tristate ' ESS Maestro, Maestro2, Maestro2E driver' CONFIG_SOUND_MAESTRO $CONFIG_SOUND dep_tristate ' ESS Maestro3/Allegro driver (EXPERIMENTAL)' CONFIG_SOUND_MAESTRO3 $CONFIG_SOUND $CONFIG_PCI $CONFIG_EXPERIMENTAL dep_tristate ' Intel ICH (i8xx) audio support' CONFIG_SOUND_ICH $CONFIG_PCI dep_tristate ' RME Hammerfall (RME96XX) support' CONFIG_SOUND_RME96XX $CONFIG_SOUND $CONFIG_PCI $CONFIG_EXPERIMENTAL -dep_tristate ' S3 SonicVibes' CONFIG_SOUND_SONICVIBES $CONFIG_SOUND +dep_tristate ' S3 SonicVibes' CONFIG_SOUND_SONICVIBES $CONFIG_SOUND $CONFIG_SOUND_GAMEPORT if [ "$CONFIG_VISWS" = "y" ]; then dep_tristate ' SGI Visual Workstation Sound' CONFIG_SOUND_VWSND $CONFIG_SOUND fi diff --git a/drivers/usb/Config.help b/drivers/usb/Config.help index 8f1db0a1b..c3a8bc953 100644 --- a/drivers/usb/Config.help +++ b/drivers/usb/Config.help @@ -578,14 +578,14 @@ CONFIG_USB_MICROTEK Support for anything but the X6 is experimental. Please report failures and successes. The scanner will appear as a scsi generic device to the rest - of the system. Scsi support is required for this driver to compile - and work. SANE 1.0.4 or newer is needed to make use of your scanner. - This driver can be compiled as a module. + of the system. Scsi support is required. + This driver can be compiled as a module, called microtek.o. CONFIG_USB_HPUSBSCSI Say Y here if you want support for the HP 53xx series of scanners and the Minolta Scan Dual. This driver is experimental. The scanner will be accessible as a SCSI device. + This can be compiled as a module, called hpusbscsi.o. CONFIG_USB_BLUETOOTH Say Y here if you want to connect a USB Bluetooth device to your diff --git a/drivers/usb/hcd/ohci-dbg.c b/drivers/usb/hcd/ohci-dbg.c index 350ae3b6d..7984b00ff 100644 --- a/drivers/usb/hcd/ohci-dbg.c +++ b/drivers/usb/hcd/ohci-dbg.c @@ -2,9 +2,9 @@ * OHCI HCD (Host Controller Driver) for USB. * * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> - * (C) Copyright 2000-2001 David Brownell <dbrownell@users.sourceforge.net> + * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> * - * This file is licenced under GPL + * This file is licenced under the GPL. * $Id: ohci-dbg.c,v 1.2 2002/01/19 00:15:45 dbrownell Exp $ */ @@ -74,27 +74,34 @@ static void urb_print (struct urb * urb, char * str, int small) static inline struct ed * dma_to_ed (struct ohci_hcd *hc, dma_addr_t ed_dma); +#ifdef OHCI_VERBOSE_DEBUG /* print non-empty branches of the periodic ed tree */ -void ep_print_int_eds (struct ohci_hcd *ohci, char * str) +void ohci_dump_periodic (struct ohci_hcd *ohci, char *label) { int i, j; - __u32 * ed_p; + u32 *ed_p; + int printed = 0; + for (i= 0; i < 32; i++) { j = 5; ed_p = &(ohci->hcca->int_table [i]); if (*ed_p == 0) - continue; - printk (KERN_DEBUG __FILE__ ": %s branch int %2d(%2x):", - str, i, i); + continue; + printed = 1; + printk (KERN_DEBUG "%s, ohci %s frame %2d:", + label, ohci->hcd.bus_name, i); while (*ed_p != 0 && j--) { struct ed *ed = dma_to_ed (ohci, le32_to_cpup(ed_p)); - printk (" ed: %4x;", ed->hwINFO); + printk (" %p/%08x;", ed, ed->hwINFO); ed_p = &ed->hwNextED; } printk ("\n"); } + if (!printed) + printk (KERN_DEBUG "%s, ohci %s, empty periodic schedule\n", + label, ohci->hcd.bus_name); } - +#endif static void ohci_dump_intr_mask (char *label, __u32 mask) { @@ -137,8 +144,9 @@ static void ohci_dump_status (struct ohci_hcd *controller) __u32 temp; temp = readl (®s->revision) & 0xff; - if (temp != 0x10) - dbg ("spec %d.%d", (temp >> 4), (temp & 0x0f)); + dbg ("OHCI %d.%d, %s legacy support registers", + 0x03 & (temp >> 4), (temp & 0x0f), + (temp & 0x10) ? "with" : "NO"); temp = readl (®s->control); dbg ("control: 0x%08x%s%s%s HCFS=%s%s%s%s%s CBSR=%d", temp, @@ -225,8 +233,10 @@ static void ohci_dump (struct ohci_hcd *controller, int verbose) // dumps some of the state we know about ohci_dump_status (controller); +#ifdef OHCI_VERBOSE_DEBUG if (verbose) - ep_print_int_eds (controller, "hcca"); + ohci_dump_periodic (controller, "hcca"); +#endif dbg ("hcca frame #%04x", controller->hcca->frame_no); ohci_dump_roothub (controller, 1); } diff --git a/drivers/usb/hcd/ohci-hcd.c b/drivers/usb/hcd/ohci-hcd.c index 0f14a6001..48576302f 100644 --- a/drivers/usb/hcd/ohci-hcd.c +++ b/drivers/usb/hcd/ohci-hcd.c @@ -2,7 +2,7 @@ * OHCI HCD (Host Controller Driver) for USB. * * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> - * (C) Copyright 2000-2001 David Brownell <dbrownell@users.sourceforge.net> + * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> * * [ Initialisation is based on Linus' ] * [ uhci code and gregs ohci fragments ] @@ -55,7 +55,7 @@ * v2.0 1999/05/04 * v1.0 1999/04/27 initial release * - * This file is licenced under GPL + * This file is licenced under the GPL. * $Id: ohci-hcd.c,v 1.7 2002/01/19 00:20:56 dbrownell Exp $ */ @@ -74,10 +74,6 @@ #include <linux/list.h> #include <linux/interrupt.h> /* for in_interrupt () */ -#ifndef CONFIG_USB_DEBUG - #define CONFIG_USB_DEBUG /* this is still experimental! */ -#endif - #ifdef CONFIG_USB_DEBUG #define DEBUG #else @@ -258,7 +254,9 @@ static int ohci_urb_enqueue ( if (ed->state != ED_OPER) ep_link (ohci, ed); - /* fill the TDs and link it to the ed */ + /* fill the TDs and link them to the ed; and + * enable that part of the schedule, if needed + */ td_submit_urb (urb); spin_unlock_irqrestore (&ohci->lock, flags); @@ -357,7 +355,9 @@ static int ohci_get_frame (struct usb_hcd *hcd) { struct ohci_hcd *ohci = hcd_to_ohci (hcd); +#ifdef OHCI_VERBOSE_DEBUG dbg ("%s: ohci_get_frame", hcd->bus_name); +#endif return le16_to_cpu (ohci->hcca->frame_no); } @@ -841,9 +841,10 @@ static int ohci_resume (struct usb_hcd *hcd) dl_done_list (ohci, dl_reverse_done_list (ohci)); writel (OHCI_INTR_WDH, &ohci->regs->intrenable); -// writel (OHCI_BLF, &ohci->regs->cmdstatus); -// writel (OHCI_CLF, &ohci->regs->cmdstatus); -ohci_dump_status (ohci); + /* assume there are TDs on the bulk and control lists */ + writel (OHCI_BLF | OHCI_CLF, &ohci->regs->cmdstatus); + +// ohci_dump_status (ohci); dbg ("sleeping = %d, disabled = %d", ohci->sleeping, ohci->disabled); break; diff --git a/drivers/usb/hcd/ohci-hub.c b/drivers/usb/hcd/ohci-hub.c index f54fcd4f3..879e1abc0 100644 --- a/drivers/usb/hcd/ohci-hub.c +++ b/drivers/usb/hcd/ohci-hub.c @@ -2,7 +2,7 @@ * OHCI HCD (Host Controller Driver) for USB. * * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> - * (C) Copyright 2000-2001 David Brownell <dbrownell@users.sourceforge.net> + * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> * * This file is licenced under GPL * $Id: ohci-hub.c,v 1.2 2002/01/19 00:21:49 dbrownell Exp $ diff --git a/drivers/usb/hcd/ohci-mem.c b/drivers/usb/hcd/ohci-mem.c index e41c7bdea..b775c7111 100644 --- a/drivers/usb/hcd/ohci-mem.c +++ b/drivers/usb/hcd/ohci-mem.c @@ -2,9 +2,9 @@ * OHCI HCD (Host Controller Driver) for USB. * * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> - * (C) Copyright 2000-2001 David Brownell <dbrownell@users.sourceforge.net> + * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> * - * This file is licenced under GPL + * This file is licenced under the GPL. * $Id: ohci-mem.c,v 1.2 2002/01/19 00:22:13 dbrownell Exp $ */ @@ -42,7 +42,7 @@ static void ohci_hcd_free (struct usb_hcd *hcd) /*-------------------------------------------------------------------------*/ -#ifdef DEBUG +#ifdef CONFIG_DEBUG_SLAB # define OHCI_MEM_FLAGS SLAB_POISON #else # define OHCI_MEM_FLAGS 0 @@ -64,16 +64,17 @@ dma_to_ed_td (struct hash_list_t * entry, dma_addr_t dma) return scan->virt; } -static inline struct ed * +static struct ed * dma_to_ed (struct ohci_hcd *hc, dma_addr_t ed_dma) { return (struct ed *) dma_to_ed_td(&(hc->ed_hash [ED_HASH_FUNC(ed_dma)]), ed_dma); } -static inline struct td * +static struct td * dma_to_td (struct ohci_hcd *hc, dma_addr_t td_dma) { + td_dma &= TD_MASK; return (struct td *) dma_to_ed_td(&(hc->td_hash [TD_HASH_FUNC(td_dma)]), td_dma); } @@ -214,7 +215,7 @@ td_alloc (struct ohci_hcd *hc, int mem_flags) return td; } -static inline void +static void td_free (struct ohci_hcd *hc, struct td *td) { hash_free_td (hc, td); @@ -242,7 +243,7 @@ ed_alloc (struct ohci_hcd *hc, int mem_flags) return ed; } -static inline void +static void ed_free (struct ohci_hcd *hc, struct ed *ed) { hash_free_ed (hc, ed); diff --git a/drivers/usb/hcd/ohci-q.c b/drivers/usb/hcd/ohci-q.c index f89cdc554..642e84b7a 100644 --- a/drivers/usb/hcd/ohci-q.c +++ b/drivers/usb/hcd/ohci-q.c @@ -2,9 +2,9 @@ * OHCI HCD (Host Controller Driver) for USB. * * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> - * (C) Copyright 2000-2001 David Brownell <dbrownell@users.sourceforge.net> + * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> * - * This file is licenced under GPL + * This file is licenced under the GPL. * $Id: ohci-q.c,v 1.6 2002/01/19 00:23:15 dbrownell Exp $ */ @@ -95,11 +95,11 @@ static int return_urb (struct ohci_hcd *hc, struct urb *urb) urb_print (urb, "RET", usb_pipeout (urb->pipe)); #endif -// FIXME: but if urb->status says it was was unlinked ... - switch (usb_pipetype (urb->pipe)) { case PIPE_INTERRUPT: #ifdef CONFIG_PCI +// FIXME rewrite this resubmit path. use pci_dma_sync_single() +// and requeue more cheaply, and only if needed. pci_unmap_single (hc->hcd.pdev, urb_priv->td [0]->data_dma, urb->transfer_buffer_length, @@ -107,16 +107,22 @@ static int return_urb (struct ohci_hcd *hc, struct urb *urb) ? PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE); #endif + /* FIXME: MP race. If another CPU partially unlinks + * this URB (urb->status was updated, hasn't yet told + * us to dequeue) before we call complete() here, an + * extra "unlinked" completion will be reported... + */ urb->complete (urb); - /* implicitly requeued */ + /* always requeued, but ED_SKIP if complete() unlinks. + * removed from periodic table only at SOF intr. + */ urb->actual_length = 0; - urb->status = -EINPROGRESS; - if (urb_priv->state != URB_DEL) { - spin_lock_irqsave (&hc->lock, flags); - td_submit_urb (urb); - spin_unlock_irqrestore (&hc->lock, flags); - } + if (urb_priv->state != URB_DEL) + urb->status = -EINPROGRESS; + spin_lock_irqsave (&hc->lock, flags); + td_submit_urb (urb); + spin_unlock_irqrestore (&hc->lock, flags); break; case PIPE_ISOCHRONOUS: @@ -126,7 +132,7 @@ static int return_urb (struct ohci_hcd *hc, struct urb *urb) continue; if (urbt) { /* send the reply and requeue URB */ #ifdef CONFIG_PCI -// FIXME this style unmap is only done on this route ... +// FIXME rewrite this resubmit path too pci_unmap_single (hc->hcd.pdev, urb_priv->td [0]->data_dma, urb->transfer_buffer_length, @@ -290,8 +296,8 @@ static int ep_link (struct ohci_hcd *ohci, struct ed *edi) ed->hwNextED = *ed_p; *ed_p = cpu_to_le32 (ed->dma); } -#ifdef DEBUG - ep_print_int_eds (ohci, "LINK_INT"); +#ifdef OHCI_VERBOSE_DEBUG + ohci_dump_periodic (ohci, "LINK_INT"); #endif break; @@ -313,8 +319,8 @@ static int ep_link (struct ohci_hcd *ohci, struct ed *edi) ed->ed_prev = NULL; } ohci->ed_isotail = edi; -#ifdef DEBUG - ep_print_int_eds (ohci, "LINK_ISO"); +#ifdef OHCI_VERBOSE_DEBUG + ohci_dump_periodic (ohci, "LINK_ISO"); #endif break; } @@ -336,7 +342,7 @@ static int ep_unlink (struct ohci_hcd *ohci, struct ed *ed) int interval; __u32 *ed_p; - ed->hwINFO |= __constant_cpu_to_le32 (OHCI_ED_SKIP); + ed->hwINFO |= ED_SKIP; switch (ed->type) { case PIPE_CONTROL: @@ -394,8 +400,8 @@ static int ep_unlink (struct ohci_hcd *ohci, struct ed *ed) } for (i = int_branch; i < NUM_INTS; i += interval) ohci->ohci_int_load [i] -= ed->int_load; -#ifdef DEBUG - ep_print_int_eds (ohci, "UNLINK_INT"); +#ifdef OHCI_VERBOSE_DEBUG + ohci_dump_periodic (ohci, "UNLINK_INT"); #endif break; @@ -421,11 +427,15 @@ static int ep_unlink (struct ohci_hcd *ohci, struct ed *ed) } } } -#ifdef DEBUG - ep_print_int_eds (ohci, "UNLINK_ISO"); +#ifdef OHCI_VERBOSE_DEBUG + ohci_dump_periodic (ohci, "UNLINK_ISO"); #endif break; } + + /* FIXME ED's "unlink" state is indeterminate; + * the HC might still be caching it (till SOF). + */ ed->state = ED_UNLINK; return 0; } @@ -478,7 +488,7 @@ static struct ed *ep_add_ed ( } if (ed->state == ED_NEW) { - ed->hwINFO = __constant_cpu_to_le32 (OHCI_ED_SKIP); + ed->hwINFO = ED_SKIP; /* dummy td; end of td list for ed */ td = td_alloc (ohci, SLAB_ATOMIC); if (!td) { @@ -492,8 +502,6 @@ static struct ed *ep_add_ed ( ed->type = usb_pipetype (pipe); } - ohci->dev [usb_pipedevice (pipe)] = udev; - // FIXME: don't do this if it's linked to the HC, // we might clobber data toggle or other state ... @@ -531,7 +539,7 @@ static void ed_unlink (struct usb_device *usb_dev, struct ed *ed) return; ed->state |= ED_URB_DEL; - ed->hwINFO |= __constant_cpu_to_le32 (OHCI_ED_SKIP); + ed->hwINFO |= ED_SKIP; switch (ed->type) { case PIPE_CONTROL: /* stop control list */ @@ -582,7 +590,7 @@ td_fill (struct ohci_hcd *ohci, unsigned int info, /* fill the old dummy TD */ td = urb_priv->td [index] = dma_to_td (ohci, - le32_to_cpup (&urb_priv->ed->hwTailP) & ~0xf); + le32_to_cpup (&urb_priv->ed->hwTailP)); td->ed = urb_priv->ed; td->next_dl_td = NULL; @@ -795,7 +803,7 @@ static struct td *dl_reverse_done_list (struct ohci_hcd *ohci) spin_lock_irqsave (&ohci->lock, flags); - td_list_hc = le32_to_cpup (&ohci->hcca->done_head) & 0xfffffff0; + td_list_hc = le32_to_cpup (&ohci->hcca->done_head); ohci->hcca->done_head = 0; while (td_list_hc) { @@ -806,26 +814,24 @@ static struct td *dl_reverse_done_list (struct ohci_hcd *ohci) dbg (" USB-error/status: %x : %p", TD_CC_GET (le32_to_cpup (&td_list->hwINFO)), td_list); - if (td_list->ed->hwHeadP - & __constant_cpu_to_le32 (0x1)) { + /* typically the endpoint halted too */ + if (td_list->ed->hwHeadP & ED_H) { if (urb_priv && ((td_list->index + 1) < urb_priv->length)) { td_list->ed->hwHeadP = (urb_priv->td [urb_priv->length - 1]->hwNextTD - & __constant_cpu_to_le32 (0xfffffff0)) - | (td_list->ed->hwHeadP - & __constant_cpu_to_le32 (0x2)); + & __constant_cpu_to_le32 (TD_MASK)) + | (td_list->ed->hwHeadP & ED_C); urb_priv->td_cnt += urb_priv->length - td_list->index - 1; } else - td_list->ed->hwHeadP &= - __constant_cpu_to_le32 (0xfffffff2); + td_list->ed->hwHeadP &= ~ED_H; } } td_list->next_dl_td = td_rev; td_rev = td_list; - td_list_hc = le32_to_cpup (&td_list->hwNextTD) & 0xfffffff0; + td_list_hc = le32_to_cpup (&td_list->hwNextTD); } spin_unlock_irqrestore (&ohci->lock, flags); return td_list; @@ -851,10 +857,8 @@ static void dl_del_list (struct ohci_hcd *ohci, unsigned int frame) for (ed = ohci->ed_rm_list [frame]; ed != NULL; ed = ed->ed_rm_list) { - tdTailP = dma_to_td (ohci, - le32_to_cpup (&ed->hwTailP) & 0xfffffff0); - tdHeadP = dma_to_td (ohci, - le32_to_cpup (&ed->hwHeadP) & 0xfffffff0); + tdTailP = dma_to_td (ohci, le32_to_cpup (&ed->hwTailP)); + tdHeadP = dma_to_td (ohci, le32_to_cpup (&ed->hwHeadP)); edINFO = le32_to_cpup (&ed->hwINFO); td_p = &ed->hwHeadP; @@ -863,7 +867,7 @@ static void dl_del_list (struct ohci_hcd *ohci, unsigned int frame) urb_priv_t *urb_priv = td->urb->hcpriv; td_next = dma_to_td (ohci, - le32_to_cpup (&td->hwNextTD) & 0xfffffff0); + le32_to_cpup (&td->hwNextTD)); if ((urb_priv->state == URB_DEL)) { tdINFO = le32_to_cpup (&td->hwINFO); if (TD_CC_GET (tdINFO) < 0xE) @@ -882,17 +886,16 @@ static void dl_del_list (struct ohci_hcd *ohci, unsigned int frame) } ed->state &= ~ED_URB_DEL; - tdHeadP = dma_to_td (ohci, - le32_to_cpup (&ed->hwHeadP) & 0xfffffff0); + tdHeadP = dma_to_td (ohci, le32_to_cpup (&ed->hwHeadP)); if (tdHeadP == tdTailP) { if (ed->state == ED_OPER) ep_unlink (ohci, ed); td_free (ohci, tdTailP); - ed->hwINFO = __constant_cpu_to_le32 (OHCI_ED_SKIP); + ed->hwINFO = ED_SKIP; ed->state = ED_NEW; } else - ed->hwINFO &= ~__constant_cpu_to_le32 (OHCI_ED_SKIP); + ed->hwINFO &= ~ED_SKIP; switch (ed->type) { case PIPE_CONTROL: @@ -938,7 +941,7 @@ static void dl_done_list (struct ohci_hcd *ohci, struct td *td_list) int cc = 0; struct urb *urb; urb_priv_t *urb_priv; - __u32 tdINFO, edHeadP, edTailP; + __u32 tdINFO; unsigned long flags; @@ -968,7 +971,7 @@ static void dl_done_list (struct ohci_hcd *ohci, struct td *td_list) /* * Except for periodic transfers, both branches do * the same thing. Periodic urbs get reissued until - * they're "deleted" with usb_unlink_urb. + * they're "deleted" (in SOF intr) by usb_unlink_urb. */ if ((ed->state & (ED_OPER | ED_UNLINK)) && (urb_priv->state != URB_DEL)) { @@ -983,13 +986,11 @@ static void dl_done_list (struct ohci_hcd *ohci, struct td *td_list) spin_lock_irqsave (&ohci->lock, flags); if (ed->state != ED_NEW) { - edHeadP = le32_to_cpup (&ed->hwHeadP) & 0xfffffff0; - edTailP = le32_to_cpup (&ed->hwTailP); - -// FIXME: ED_UNLINK is very fuzzy w.r.t. what the hc knows... + u32 edHeadP = ed->hwHeadP; /* unlink eds if they are not busy */ - if ((edHeadP == edTailP) && (ed->state == ED_OPER)) + edHeadP &= __constant_cpu_to_le32 (ED_MASK); + if ((edHeadP == ed->hwTailP) && (ed->state == ED_OPER)) ep_unlink (ohci, ed); } spin_unlock_irqrestore (&ohci->lock, flags); diff --git a/drivers/usb/hcd/ohci.h b/drivers/usb/hcd/ohci.h index 8b2fbff24..0a4ae8e24 100644 --- a/drivers/usb/hcd/ohci.h +++ b/drivers/usb/hcd/ohci.h @@ -2,86 +2,102 @@ * OHCI HCD (Host Controller Driver) for USB. * * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> - * (C) Copyright 2000-2001 David Brownell <dbrownell@users.sourceforge.net> + * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> * - * This file is licenced under GPL + * This file is licenced under the GPL. * $Id: ohci.h,v 1.5 2002/01/19 00:24:01 dbrownell Exp $ */ -static const int cc_to_error [16] = { - -/* map OHCI status to errno values */ - /* No Error */ 0, - /* CRC Error */ -EILSEQ, - /* Bit Stuff */ -EPROTO, - /* Data Togg */ -EILSEQ, - /* Stall */ -EPIPE, - /* DevNotResp */ -ETIMEDOUT, - /* PIDCheck */ -EPROTO, - /* UnExpPID */ -EPROTO, - /* DataOver */ -EOVERFLOW, - /* DataUnder */ -EREMOTEIO, - /* (for hw) */ -EIO, - /* (for hw) */ -EIO, - /* BufferOver */ -ECOMM, - /* BuffUnder */ -ENOSR, - /* (for HCD) */ -EALREADY, - /* (for HCD) */ -EALREADY -}; - - -/* ED States */ - +/* + * OHCI Endpoint Descriptor (ED) ... holds TD queue + * See OHCI spec, section 4.2 + */ +struct ed { + /* first fields are hardware-specified, le32 */ + __u32 hwINFO; /* endpoint config bitmap */ +#define ED_ISO __constant_cpu_to_le32(1 << 15) +#define ED_SKIP __constant_cpu_to_le32(1 << 14) +#define ED_LOWSPEED __constant_cpu_to_le32(1 << 13) +#define ED_OUT __constant_cpu_to_le32(0x01 << 11) +#define ED_IN __constant_cpu_to_le32(0x10 << 11) + __u32 hwTailP; /* tail of TD list */ + __u32 hwHeadP; /* head of TD list */ +#define ED_C __constant_cpu_to_le32(0x02) /* toggle carry */ +#define ED_H __constant_cpu_to_le32(0x01) /* halted */ + __u32 hwNextED; /* next ED in list */ + + /* rest are purely for the driver's use */ + struct ed *ed_prev; + __u8 int_period; + __u8 int_branch; + __u8 int_load; + __u8 int_interval; + __u8 state; // ED_{NEW,UNLINK,OPER} #define ED_NEW 0x00 /* unused, no dummy td */ #define ED_UNLINK 0x01 /* dummy td, maybe linked to hc */ #define ED_OPER 0x02 /* dummy td, _is_ linked to hc */ +#define ED_URB_DEL 0x08 /* for unlinking; masked in */ -#define ED_URB_DEL 0x08 /* masked in */ + __u8 type; + __u16 last_iso; + struct ed *ed_rm_list; -/* usb_ohci_ed */ -struct ed { - /* first fields are hardware-specified */ - __u32 hwINFO; - __u32 hwTailP; - __u32 hwHeadP; - __u32 hwNextED; - - struct ed * ed_prev; - __u8 int_period; - __u8 int_branch; - __u8 int_load; - __u8 int_interval; - __u8 state; // ED_{NEW,UNLINK,OPER} - __u8 type; - __u16 last_iso; - struct ed * ed_rm_list; - - dma_addr_t dma; - __u32 unused [3]; -} __attribute((aligned(16))); + dma_addr_t dma; /* addr of ED */ +} __attribute__ ((aligned(16))); + +#define ED_MASK ((u32)~0x0f) /* strip hw status in low addr bits */ -/* TD info field */ -#define TD_CC 0xf0000000 +/* + * OHCI Transfer Descriptor (TD) ... one per transfer segment + * See OHCI spec, sections 4.3.1 (general = control/bulk/interrupt) + * and 4.3.2 (iso) + */ +struct td { + /* first fields are hardware-specified, le32 */ + __u32 hwINFO; /* transfer info bitmask */ +#define TD_CC 0xf0000000 /* condition code */ #define TD_CC_GET(td_p) ((td_p >>28) & 0x0f) -#define TD_CC_SET(td_p, cc) (td_p) = ((td_p) & 0x0fffffff) | (((cc) & 0x0f) << 28) -#define TD_EC 0x0C000000 -#define TD_T 0x03000000 -#define TD_T_DATA0 0x02000000 -#define TD_T_DATA1 0x03000000 -#define TD_T_TOGGLE 0x00000000 -#define TD_R 0x00040000 -#define TD_DI 0x00E00000 -#define TD_DI_SET(X) (((X) & 0x07)<< 21) -#define TD_DP 0x00180000 -#define TD_DP_SETUP 0x00000000 -#define TD_DP_IN 0x00100000 -#define TD_DP_OUT 0x00080000 - -#define TD_ISO 0x00010000 -#define TD_DEL 0x00020000 - -/* CC Codes */ +//#define TD_CC_SET(td_p, cc) (td_p) = ((td_p) & 0x0fffffff) | (((cc) & 0x0f) << 28) +#define TD_EC 0x0C000000 /* error count */ +#define TD_T 0x03000000 /* data toggle state */ +#define TD_T_DATA0 0x02000000 /* DATA0 */ +#define TD_T_DATA1 0x03000000 /* DATA1 */ +#define TD_T_TOGGLE 0x00000000 /* uses ED_C */ +#define TD_DI 0x00E00000 /* frames before interrupt */ +//#define TD_DI_SET(X) (((X) & 0x07)<< 21) +#define TD_DP 0x00180000 /* direction/pid */ +#define TD_DP_SETUP 0x00000000 /* SETUP pid */ +#define TD_DP_IN 0x00100000 /* IN pid */ +#define TD_DP_OUT 0x00080000 /* OUT pid */ + /* 0x00180000 rsvd */ +#define TD_R 0x00040000 /* round: short packets OK? */ + /* bits 0x1ffff are defined by HCD */ +#define TD_ISO 0x00010000 /* copy of ED_ISO */ + + __u32 hwCBP; /* Current Buffer Pointer (or 0) */ + __u32 hwNextTD; /* Next TD Pointer */ + __u32 hwBE; /* Memory Buffer End Pointer */ + + /* PSW is only for ISO */ +#define MAXPSW 1 /* hardware allows 8 */ + __u16 hwPSW [MAXPSW]; + + /* rest are purely for the driver's use */ + __u8 index; + struct ed *ed; + struct td *next_dl_td; + struct urb *urb; + + dma_addr_t td_dma; /* addr of this TD */ + dma_addr_t data_dma; /* addr of data it points to */ +} __attribute__ ((aligned(32))); /* c/b/i need 16; only iso needs 32 */ + +#define TD_MASK ((u32)~0x1f) /* strip hw status in low addr bits */ + +/* + * Hardware transfer status codes -- CC from td->hwINFO or td->hwPSW + */ #define TD_CC_NOERROR 0x00 #define TD_CC_CRC 0x01 #define TD_CC_BITSTUFFING 0x02 @@ -99,57 +115,50 @@ struct ed { #define TD_NOTACCESSED 0x0F -#define MAXPSW 1 - -struct td { - /* first hardware fields are in all tds */ - __u32 hwINFO; - __u32 hwCBP; /* Current Buffer Pointer */ - __u32 hwNextTD; /* Next TD Pointer */ - __u32 hwBE; /* Memory Buffer End Pointer */ - - __u16 hwPSW [MAXPSW]; /* PSW is only for ISO */ - - __u8 unused; - __u8 index; - struct ed *ed; - struct td *next_dl_td; - struct urb *urb; - - dma_addr_t td_dma; - dma_addr_t data_dma; - __u32 unused2 [2]; -} __attribute((aligned(32))); /* iso needs 32 */ +/* map OHCI TD status codes (CC) to errno values */ +static const int cc_to_error [16] = { + /* No Error */ 0, + /* CRC Error */ -EILSEQ, + /* Bit Stuff */ -EPROTO, + /* Data Togg */ -EILSEQ, + /* Stall */ -EPIPE, + /* DevNotResp */ -ETIMEDOUT, + /* PIDCheck */ -EPROTO, + /* UnExpPID */ -EPROTO, + /* DataOver */ -EOVERFLOW, + /* DataUnder */ -EREMOTEIO, + /* (for hw) */ -EIO, + /* (for hw) */ -EIO, + /* BufferOver */ -ECOMM, + /* BuffUnder */ -ENOSR, + /* (for HCD) */ -EALREADY, + /* (for HCD) */ -EALREADY +}; -#define OHCI_ED_SKIP (1 << 14) /* * The HCCA (Host Controller Communications Area) is a 256 byte - * structure defined in the OHCI spec. The host controller is + * structure defined section 4.4.1 of the OHCI spec. The HC is * told the base address of it. It must be 256-byte aligned. */ -#define NUM_INTS 32 /* part of the OHCI standard */ struct ohci_hcca { - __u32 int_table [NUM_INTS]; /* Interrupt ED table */ +#define NUM_INTS 32 + __u32 int_table [NUM_INTS]; /* periodic schedule */ __u16 frame_no; /* current frame number */ __u16 pad1; /* set to 0 on each frame_no change */ __u32 done_head; /* info returned for an interrupt */ u8 reserved_for_hc [116]; -} __attribute((aligned(256))); + u8 what [4]; /* spec only identifies 252 bytes :) */ +} __attribute__ ((aligned(256))); /* - * Maximum number of root hub ports. - */ -#define MAX_ROOT_PORTS 15 /* maximum OHCI root hub ports */ - -/* - * This is the structure of the OHCI controller's memory mapped I/O - * region. This is Memory Mapped I/O. You must use the readl() and - * writel() macros defined in asm/io.h to access these!! + * This is the structure of the OHCI controller's memory mapped I/O region. + * You must use readl() and writel() (in <asm/io.h>) to access these fields!! + * Layout is in section 7 (and appendix B) of the spec. */ struct ohci_regs { - /* control and status registers */ + /* control and status registers (section 7.1) */ __u32 revision; __u32 control; __u32 cmdstatus; @@ -157,7 +166,7 @@ struct ohci_regs { __u32 intrenable; __u32 intrdisable; - /* memory pointers */ + /* memory pointers (section 7.2) */ __u32 hcca; __u32 ed_periodcurrent; __u32 ed_controlhead; @@ -166,23 +175,25 @@ struct ohci_regs { __u32 ed_bulkcurrent; __u32 donehead; - /* frame counters */ + /* frame counters (section 7.3) */ __u32 fminterval; __u32 fmremaining; __u32 fmnumber; __u32 periodicstart; __u32 lsthresh; - /* Root hub ports */ + /* Root hub ports (section 7.4) */ struct ohci_roothub_regs { __u32 a; __u32 b; __u32 status; +#define MAX_ROOT_PORTS 15 /* maximum OHCI root hub ports (RH_A_NDP) */ __u32 portstatus [MAX_ROOT_PORTS]; } roothub; - /* and some optional registers for legacy compatibility */ -} __attribute((aligned(32))); + /* and optional "legacy support" registers (appendix B) at 0x0100 */ + +} __attribute__ ((aligned(32))); /* OHCI CONTROL AND STATUS REGISTER MASKS */ @@ -270,9 +281,8 @@ struct ohci_regs { #define RH_A_POTPGT (0xff << 24) /* power on to power good time */ -/* urb */ -typedef struct urb_priv -{ +/* hcd-private per-urb state */ +typedef struct urb_priv { struct ed *ed; __u16 length; // # tds in this request __u16 td_cnt; // tds already serviced @@ -345,7 +355,6 @@ struct ohci_hcd { int sleeping; int ohci_int_load [NUM_INTS]; u32 hc_control; /* copy of hc control reg */ - struct usb_device *dev [128]; unsigned long flags; /* for HC bugs */ #define OHCI_QUIRK_AMD756 0x01 /* erratum #4 */ diff --git a/drivers/usb/kaweth.c b/drivers/usb/kaweth.c index 046674d34..8d89ba87c 100644 --- a/drivers/usb/kaweth.c +++ b/drivers/usb/kaweth.c @@ -155,6 +155,7 @@ MODULE_DEVICE_TABLE (usb, usb_klsi_table); * kaweth_driver ****************************************************************/ static struct usb_driver kaweth_driver = { + owner: THIS_MODULE, name: "kaweth", probe: kaweth_probe, disconnect: kaweth_disconnect, @@ -238,8 +239,7 @@ static int kaweth_control(struct kaweth_device *kaweth, return -EBUSY; } - dr = kmalloc(sizeof(struct usb_ctrlrequest), - in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); + dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); if (!dr) { kaweth_dbg("kmalloc() failed"); @@ -586,14 +586,10 @@ static void kaweth_usb_transmit_complete(struct urb *urb) { struct kaweth_device *kaweth = urb->context; - spin_lock(&kaweth->device_lock); - - if (urb->status) + if (unlikely(urb->status != 0)) kaweth_dbg("%s: TX status %d.", kaweth->net->name, urb->status); netif_wake_queue(kaweth->net); - - spin_unlock(&kaweth->device_lock); } /**************************************************************** @@ -757,9 +753,7 @@ static void *kaweth_probe( memset(kaweth, 0, sizeof(struct kaweth_device)); kaweth->dev = dev; - kaweth->status = 0; - kaweth->net = NULL; - kaweth->device_lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&kaweth->device_lock); kaweth_dbg("Resetting."); @@ -824,6 +818,7 @@ static void *kaweth_probe( /* Device will now disappear for a moment... */ kaweth_info("Firmware loaded. I'll be back..."); + kfree(kaweth); return NULL; } @@ -925,6 +920,8 @@ static void kaweth_disconnect(struct usb_device *dev, void *ptr) kaweth_warn("unregistering non-existant device"); return; } + usb_unlink_urb(kaweth->tx_urb); + usb_unlink_urb(kaweth->rx_urb); if(kaweth->net) { if(kaweth->net->flags & IFF_UP) { diff --git a/drivers/usb/pegasus.c b/drivers/usb/pegasus.c index ef89fc6a8..96e28260c 100644 --- a/drivers/usb/pegasus.c +++ b/drivers/usb/pegasus.c @@ -53,7 +53,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v0.4.22 (2001/12/07)" +#define DRIVER_VERSION "v0.4.23 (2002/02/01)" #define DRIVER_AUTHOR "Petko Manolov <pmanolov@lnxw.com>" #define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver" @@ -115,7 +115,7 @@ static void ctrl_callback( struct urb *urb ) case -ENOENT: break; default: - warn( __FUNCTION__ " status %d", urb->status); + warn("%s: status %d", __FUNCTION__, urb->status); } pegasus->flags &= ~ETH_REGS_CHANGED; wake_up(&pegasus->ctrl_wait ); @@ -158,7 +158,7 @@ static int get_registers(pegasus_t *pegasus, __u16 indx, __u16 size, void *data) set_current_state( TASK_UNINTERRUPTIBLE ); if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) { - err( __FUNCTION__ " BAD CTRLs %d", ret); + err("%s: BAD CTRLs %d", __FUNCTION__, ret); goto out; } @@ -208,7 +208,7 @@ static int set_registers(pegasus_t *pegasus, __u16 indx, __u16 size, void *data) set_current_state( TASK_UNINTERRUPTIBLE ); if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) { - err( __FUNCTION__ " BAD CTRL %d", ret); + err("%s: BAD CTRL %d", __FUNCTION__, ret); goto out; } @@ -258,7 +258,7 @@ static int set_register( pegasus_t *pegasus, __u16 indx, __u8 data ) set_current_state( TASK_UNINTERRUPTIBLE ); if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) { - err( __FUNCTION__ " BAD CTRL %d", ret); + err("%s: BAD CTRL %d", __FUNCTION__, ret); goto out; } @@ -288,7 +288,7 @@ static int update_eth_regs_async( pegasus_t *pegasus ) pegasus->eth_regs, 3, ctrl_callback, pegasus ); if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) - err( __FUNCTION__ " BAD CTRL %d, flags %x",ret,pegasus->flags ); + err("%s: BAD CTRL %d, flgs %x",__FUNCTION__,ret,pegasus->flags); return ret; } @@ -313,7 +313,7 @@ static int read_mii_word( pegasus_t *pegasus, __u8 phy, __u8 indx, __u16 *regd ) *regd = le16_to_cpu(regdi); return 0; } - warn( __FUNCTION__ " failed" ); + warn("%s: failed", __FUNCTION__); return 1; } @@ -335,7 +335,7 @@ static int write_mii_word( pegasus_t *pegasus, __u8 phy, __u8 indx, __u16 regd ) } if ( i < REG_TIMEOUT ) return 0; - warn( __FUNCTION__ " failed" ); + warn("%s: failed", __FUNCTION__); return 1; } @@ -361,7 +361,7 @@ static int read_eprom_word( pegasus_t *pegasus, __u8 index, __u16 *retdata ) *retdata = le16_to_cpu (retdatai); return 0; } - warn( __FUNCTION__ " failed" ); + warn("%s: failed", __FUNCTION__); return -1; } @@ -405,7 +405,7 @@ static int write_eprom_word( pegasus_t *pegasus, __u8 index, __u16 data ) disable_eprom_write( pegasus ); if ( i < REG_TIMEOUT ) return 0; - warn( __FUNCTION__ " failed" ); + warn("%s: failed", __FUNCTION__); return -1; } #endif /* PEGASUS_WRITE_EEPROM */ @@ -574,7 +574,7 @@ goon: pegasus->rx_buff, PEGASUS_MAX_MTU, read_bulk_callback, pegasus ); if ( (res = usb_submit_urb(pegasus->rx_urb)) ) - warn( __FUNCTION__ " failed submint rx_urb %d", res); + warn("%s: failed submint rx_urb %d", __FUNCTION__, res); pegasus->flags &= ~PEGASUS_RX_BUSY; } @@ -722,14 +722,14 @@ static int pegasus_open(struct net_device *net) pegasus->rx_buff, PEGASUS_MAX_MTU, read_bulk_callback, pegasus ); if ( (res = usb_submit_urb(pegasus->rx_urb)) ) - warn( __FUNCTION__ " failed rx_urb %d", res ); + warn("%s: failed rx_urb %d", __FUNCTION__, res); #ifdef PEGASUS_USE_INTR FILL_INT_URB( pegasus->intr_urb, pegasus->usb, usb_rcvintpipe(pegasus->usb, 3), pegasus->intr_buff, sizeof(pegasus->intr_buff), intr_callback, pegasus, pegasus->intr_interval ); if ( (res = usb_submit_urb(pegasus->intr_urb)) ) - warn( __FUNCTION__ " failed intr_urb %d", res); + warn("%s: failed intr_urb %d", __FUNCTION__, res); #endif netif_start_queue( net ); pegasus->flags |= PEGASUS_RUNNING; @@ -885,6 +885,9 @@ static void * pegasus_probe( struct usb_device *dev, unsigned int ifnum, net = init_etherdev( NULL, 0 ); if ( !net ) { + usb_free_urb (pegasus->tx_urb); + usb_free_urb (pegasus->rx_urb); + usb_free_urb (pegasus->ctrl_urb); kfree( pegasus ); return NULL; } @@ -910,6 +913,9 @@ static void * pegasus_probe( struct usb_device *dev, unsigned int ifnum, if ( reset_mac(pegasus) ) { err("can't reset MAC"); unregister_netdev( pegasus->net ); + usb_free_urb (pegasus->tx_urb); + usb_free_urb (pegasus->rx_urb); + usb_free_urb (pegasus->ctrl_urb); kfree(pegasus->net); kfree(pegasus); pegasus = NULL; @@ -947,10 +953,14 @@ static void pegasus_disconnect( struct usb_device *dev, void *ptr ) pegasus->flags |= PEGASUS_UNPLUG; unregister_netdev( pegasus->net ); usb_dec_dev_use( dev ); - usb_free_urb (pegasus->intr_urb); - usb_free_urb (pegasus->tx_urb); - usb_free_urb (pegasus->rx_urb); - usb_free_urb (pegasus->ctrl_urb); + usb_unlink_urb(pegasus->intr_urb); + usb_unlink_urb(pegasus->tx_urb); + usb_unlink_urb(pegasus->rx_urb); + usb_unlink_urb(pegasus->ctrl_urb); + usb_free_urb(pegasus->intr_urb); + usb_free_urb(pegasus->tx_urb); + usb_free_urb(pegasus->rx_urb); + usb_free_urb(pegasus->ctrl_urb); kfree( pegasus->net ); kfree( pegasus ); pegasus = NULL; diff --git a/drivers/usb/printer.c b/drivers/usb/printer.c index 3b12890a4..a77f41a10 100644 --- a/drivers/usb/printer.c +++ b/drivers/usb/printer.c @@ -20,6 +20,7 @@ * v0.7 - fixed bulk-IN read and poll (David Paschal, paschal@rcsis.com) * v0.8 - add devfs support * v0.9 - fix unplug-while-open paths + * v0.10- remove sleep_on, fix error on oom (oliver@neukum.org) */ /* @@ -54,7 +55,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v0.8" +#define DRIVER_VERSION "v0.10" #define DRIVER_AUTHOR "Michael Gee, Pavel Machek, Vojtech Pavlik, Randy Dunlap" #define DRIVER_DESC "USB Printer Device Class driver" @@ -95,6 +96,8 @@ struct usblp { int readcount; /* Counter for reads */ int ifnum; /* Interface number */ int minor; /* minor number of device */ + int wcomplete; /* writing is completed */ + int rcomplete; /* reading is completed */ unsigned int quirks; /* quirks flags */ unsigned char used; /* True if open */ unsigned char bidir; /* interface is bidirectional */ @@ -151,17 +154,31 @@ static int usblp_ctrl_msg(struct usblp *usblp, int request, int dir, int recip, * URB callback. */ -static void usblp_bulk(struct urb *urb) +static void usblp_bulk_read(struct urb *urb) { struct usblp *usblp = urb->context; if (!usblp || !usblp->dev || !usblp->used) return; - if (urb->status) + if (unlikely(urb->status)) warn("usblp%d: nonzero read/write bulk status received: %d", usblp->minor, urb->status); + usblp->rcomplete = 1; + wake_up_interruptible(&usblp->wait); +} +static void usblp_bulk_write(struct urb *urb) +{ + struct usblp *usblp = urb->context; + + if (!usblp || !usblp->dev || !usblp->used) + return; + + if (unlikely(urb->status)) + warn("usblp%d: nonzero read/write bulk status received: %d", + usblp->minor, urb->status); + usblp->wcomplete = 1; wake_up_interruptible(&usblp->wait); } @@ -238,6 +255,8 @@ static int usblp_open(struct inode *inode, struct file *file) usblp->writeurb.transfer_buffer_length = 0; usblp->writeurb.status = 0; + usblp->wcomplete = 1; /* we begin writeable */ + usblp->rcomplete = 0; if (usblp->bidir) { usblp->readcount = 0; @@ -369,26 +388,33 @@ done: static ssize_t usblp_write(struct file *file, const char *buffer, size_t count, loff_t *ppos) { + DECLARE_WAITQUEUE(wait, current); struct usblp *usblp = file->private_data; int timeout, err = 0, writecount = 0; while (writecount < count) { - - // FIXME: only use urb->status inside completion - // callbacks; this way is racey... - if (usblp->writeurb.status == -EINPROGRESS) { - + if (!usblp->wcomplete) { + barrier(); if (file->f_flags & O_NONBLOCK) return -EAGAIN; timeout = USBLP_WRITE_TIMEOUT; - while (timeout && usblp->writeurb.status == -EINPROGRESS) { + add_wait_queue(&usblp->wait, &wait); + while ( 1==1 ) { - if (signal_pending(current)) + if (signal_pending(current)) { + remove_wait_queue(&usblp->wait, &wait); return writecount ? writecount : -EINTR; - - timeout = interruptible_sleep_on_timeout(&usblp->wait, timeout); + } + set_current_state(TASK_INTERRUPTIBLE); + if (timeout && !usblp->wcomplete) { + timeout = schedule_timeout(timeout); + } else { + set_current_state(TASK_RUNNING); + break; + } } + remove_wait_queue(&usblp->wait, &wait); } down (&usblp->sem); @@ -399,7 +425,7 @@ static ssize_t usblp_write(struct file *file, const char *buffer, size_t count, if (usblp->writeurb.status != 0) { if (usblp->quirks & USBLP_QUIRK_BIDIR) { - if (usblp->writeurb.status != -EINPROGRESS) + if (!usblp->wcomplete) err("usblp%d: error %d writing to printer", usblp->minor, usblp->writeurb.status); err = usblp->writeurb.status; @@ -429,7 +455,12 @@ static ssize_t usblp_write(struct file *file, const char *buffer, size_t count, usblp->writeurb.transfer_buffer_length)) return -EFAULT; usblp->writeurb.dev = usblp->dev; - usb_submit_urb(&usblp->writeurb); + usblp->wcomplete = 0; + if (usb_submit_urb(&usblp->writeurb)) { + count = -EIO; + up (&usblp->sem); + break; + } up (&usblp->sem); } @@ -439,6 +470,7 @@ static ssize_t usblp_write(struct file *file, const char *buffer, size_t count, static ssize_t usblp_read(struct file *file, char *buffer, size_t count, loff_t *ppos) { struct usblp *usblp = file->private_data; + DECLARE_WAITQUEUE(wait, current); if (!usblp->bidir) return -EINVAL; @@ -449,7 +481,8 @@ static ssize_t usblp_read(struct file *file, char *buffer, size_t count, loff_t goto done; } - if (usblp->readurb.status == -EINPROGRESS) { + if (!usblp->rcomplete) { + barrier(); if (file->f_flags & O_NONBLOCK) { count = -EAGAIN; @@ -458,15 +491,24 @@ static ssize_t usblp_read(struct file *file, char *buffer, size_t count, loff_t // FIXME: only use urb->status inside completion // callbacks; this way is racey... - while (usblp->readurb.status == -EINPROGRESS) { + add_wait_queue(&usblp->wait, &wait); + while (1==1) { if (signal_pending(current)) { count = -EINTR; + remove_wait_queue(&usblp->wait, &wait); goto done; } up (&usblp->sem); - interruptible_sleep_on(&usblp->wait); + set_current_state(TASK_INTERRUPTIBLE); + if (!usblp->rcomplete) { + schedule(); + } else { + set_current_state(TASK_RUNNING); + break; + } down (&usblp->sem); } + remove_wait_queue(&usblp->wait, &wait); } if (!usblp->dev) { @@ -495,7 +537,11 @@ static ssize_t usblp_read(struct file *file, char *buffer, size_t count, loff_t if ((usblp->readcount += count) == usblp->readurb.actual_length) { usblp->readcount = 0; usblp->readurb.dev = usblp->dev; - usb_submit_urb(&usblp->readurb); + usblp->rcomplete = 0; + if (usb_submit_urb(&usblp->readurb)) { + count = -EIO; + goto done; + } } done: @@ -636,11 +682,11 @@ static void *usblp_probe(struct usb_device *dev, unsigned int ifnum, } FILL_BULK_URB(&usblp->writeurb, dev, usb_sndbulkpipe(dev, epwrite->bEndpointAddress), - buf, 0, usblp_bulk, usblp); + buf, 0, usblp_bulk_write, usblp); if (bidir) FILL_BULK_URB(&usblp->readurb, dev, usb_rcvbulkpipe(dev, epread->bEndpointAddress), - buf + USBLP_BUF_SIZE, USBLP_BUF_SIZE, usblp_bulk, usblp); + buf + USBLP_BUF_SIZE, USBLP_BUF_SIZE, usblp_bulk_read, usblp); /* Get the device_id string if possible. FIXME: Could make this kmalloc(length). */ err = usblp_get_id(usblp, 0, usblp->device_id_string, DEVICE_ID_SIZE - 1); @@ -715,6 +761,7 @@ static struct usb_device_id usblp_ids [] = { MODULE_DEVICE_TABLE (usb, usblp_ids); static struct usb_driver usblp_driver = { + owner: THIS_MODULE, name: "usblp", probe: usblp_probe, disconnect: usblp_disconnect, diff --git a/drivers/usb/stv680.c b/drivers/usb/stv680.c index fad991e9a..e5f89a3de 100644 --- a/drivers/usb/stv680.c +++ b/drivers/usb/stv680.c @@ -50,6 +50,12 @@ * improve quality. Got rid of green line around * frame. Fix brightness reset when changing size * bug. Adjusted gamma filters slightly. + * + * ver 0.25 Jan, 2002 (kjs) + * Fixed a bug in which the driver sometimes attempted + * to set to a non-supported size. This allowed + * gnomemeeting to work. + * Fixed proc entry removal bug. */ #include <linux/config.h> @@ -87,7 +93,7 @@ static unsigned int debug = 0; /* * Version Information */ -#define DRIVER_VERSION "v0.24" +#define DRIVER_VERSION "v0.25" #define DRIVER_AUTHOR "Kevin Sisson <kjsisson@bellsouth.net>" #define DRIVER_DESC "STV0680 USB Camera Driver" @@ -659,7 +665,7 @@ static void proc_stv680_destroy (void) if (stv680_proc_entry == NULL) return; - remove_proc_entry ("stv", video_proc_entry); + remove_proc_entry ("stv680", video_proc_entry); } #endif /* CONFIG_PROC_FS && CONFIG_VIDEO_PROC_FS */ @@ -862,20 +868,23 @@ static int stv680_set_size (struct usb_stv *stv680, int width, int height) if ((width < (stv680->maxwidth / 2)) || (height < (stv680->maxheight / 2))) { width = stv680->maxwidth / 2; height = stv680->maxheight / 2; - } else if ((width >= 158) && (width <= 166)) { + } else if ((width >= 158) && (width <= 166) && (stv680->QVGA == 1)) { width = 160; height = 120; - } else if ((width >= 172) && (width <= 180)) { + } else if ((width >= 172) && (width <= 180) && (stv680->CIF == 1)) { width = 176; height = 144; - } else if ((width >= 318) && (width <= 350)) { + } else if ((width >= 318) && (width <= 350) && (stv680->QVGA == 1)) { width = 320; height = 240; - } else if ((width >= 350) && (width <= 358)) { + } else if ((width >= 350) && (width <= 358) && (stv680->CIF == 1)) { width = 352; height = 288; + } else { + PDEBUG (1, "STV(e): request for non-supported size: request: v.width = %i, v.height = %i actual: stv.width = %i, stv.height = %i", width, height, stv680->vwidth, stv680->vheight); + return 1; } - + /* Stop a current stream and start it again at the new size */ if (wasstreaming) stv680_stop_stream (stv680); diff --git a/drivers/usb/usb.c b/drivers/usb/usb.c index a6dfc4e70..06b8c6623 100644 --- a/drivers/usb/usb.c +++ b/drivers/usb/usb.c @@ -1100,7 +1100,7 @@ struct urb *usb_alloc_urb(int iso_packets) } memset(urb, 0, sizeof(*urb)); - atomic_inc(&urb->count); + urb->count = (atomic_t)ATOMIC_INIT(1); spin_lock_init(&urb->lock); return urb; @@ -2283,7 +2283,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate) /* 9.4.10 says devices don't need this, if the interface only has one alternate setting */ if (iface->num_altsetting == 1) { - warn("ignoring set_interface for dev %d, iface %d, alt %d", + dbg("ignoring set_interface for dev %d, iface %d, alt %d", dev->devnum, interface, alternate); return 0; } diff --git a/drivers/usb/vicam.c b/drivers/usb/vicam.c index 069383fac..d7dc679d5 100644 --- a/drivers/usb/vicam.c +++ b/drivers/usb/vicam.c @@ -79,7 +79,7 @@ static int video_nr = -1; /* next avail video device */ static struct usb_driver vicam_driver; static char *buf, *buf2; -static int change_pending = 0; +static volatile int change_pending = 0; static int vicam_parameters(struct usb_vicam *vicam); @@ -330,8 +330,14 @@ static int vicam_get_picture(struct usb_vicam *vicam, struct video_picture *p) static void synchronize(struct usb_vicam *vicam) { + DECLARE_WAITQUEUE(wait, current); change_pending = 1; - interruptible_sleep_on(&vicam->wait); + set_current_state(TASK_INTERRUPTIBLE); + add_wait_queue(&vicam->wait, &wait); + if (change_pending) + schedule(); + remove_wait_queue(&vicam->wait, &wait); + set_current_state(TASK_RUNNING); vicam_sndctrl(1, vicam, VICAM_REQ_CAMERA_POWER, 0x00, NULL, 0); mdelay(10); vicam_sndctrl(1, vicam, VICAM_REQ_LED_CONTROL, 0x00, NULL, 0); diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index f4423fd21..bc193639e 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -402,6 +402,21 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir) } /* + * A check for whether or not the parent directory has changed. + * In the case it has, we assume that the dentries are untrustworthy + * and may need to be looked up again. + */ +static inline +int nfs_check_verifier(struct inode *dir, struct dentry *dentry) +{ + if (IS_ROOT(dentry)) + return 1; + if (nfs_revalidate_inode(NFS_SERVER(dir), dir)) + return 0; + return time_after(dentry->d_time, NFS_MTIME_UPDATE(dir)); +} + +/* * Whenever an NFS operation succeeds, we know that the dentry * is valid, so we update the revalidation timestamp. */ @@ -410,48 +425,31 @@ static inline void nfs_renew_times(struct dentry * dentry) dentry->d_time = jiffies; } -static inline int nfs_dentry_force_reval(struct dentry *dentry, int flags) +static inline +int nfs_lookup_verify_inode(struct inode *inode, int flags) { - struct inode *inode = dentry->d_inode; - unsigned long timeout = NFS_ATTRTIMEO(inode); - + struct nfs_server *server = NFS_SERVER(inode); /* - * If it's the last lookup in a series, we use a stricter - * cache consistency check by looking at the parent mtime. - * - * If it's been modified in the last hour, be really strict. - * (This still means that we can avoid doing unnecessary - * work on directories like /usr/share/bin etc which basically - * never change). + * If we're interested in close-to-open cache consistency, + * then we revalidate the inode upon lookup. */ - if (!(flags & LOOKUP_CONTINUE)) { - long diff = CURRENT_TIME - dentry->d_parent->d_inode->i_mtime; - - if (diff < 15*60) - timeout = 0; - } - - return time_after(jiffies,dentry->d_time + timeout); + if (!(server->flags & NFS_MOUNT_NOCTO) && !(flags & LOOKUP_CONTINUE)) + NFS_CACHEINV(inode); + return nfs_revalidate_inode(server, inode); } /* * We judge how long we want to trust negative * dentries by looking at the parent inode mtime. * - * If mtime is close to present time, we revalidate - * more often. + * If parent mtime has changed, we revalidate, else we wait for a + * period corresponding to the parent's attribute cache timeout value. */ -#define NFS_REVALIDATE_NEGATIVE (1 * HZ) -static inline int nfs_neg_need_reval(struct dentry *dentry) +static inline int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry) { - struct inode *dir = dentry->d_parent->d_inode; - unsigned long timeout = NFS_ATTRTIMEO(dir); - long diff = CURRENT_TIME - dir->i_mtime; - - if (diff < 5*60 && timeout > NFS_REVALIDATE_NEGATIVE) - timeout = NFS_REVALIDATE_NEGATIVE; - - return time_after(jiffies, dentry->d_time + timeout); + if (!nfs_check_verifier(dir, dentry)) + return 1; + return time_after(jiffies, dentry->d_time + NFS_ATTRTIMEO(dir)); } /* @@ -462,9 +460,8 @@ static inline int nfs_neg_need_reval(struct dentry *dentry) * NOTE! The hit can be a negative hit too, don't assume * we have an inode! * - * If the dentry is older than the revalidation interval, - * we do a new lookup and verify that the dentry is still - * correct. + * If the parent directory is seen to have changed, we throw out the + * cached dentry and do a new lookup. */ static int nfs_lookup_revalidate(struct dentry * dentry, int flags) { @@ -477,13 +474,9 @@ static int nfs_lookup_revalidate(struct dentry * dentry, int flags) lock_kernel(); dir = dentry->d_parent->d_inode; inode = dentry->d_inode; - /* - * If we don't have an inode, let's look at the parent - * directory mtime to get a hint about how often we - * should validate things.. - */ + if (!inode) { - if (nfs_neg_need_reval(dentry)) + if (nfs_neg_need_reval(dir, dentry)) goto out_bad; goto out_valid; } @@ -494,48 +487,39 @@ static int nfs_lookup_revalidate(struct dentry * dentry, int flags) goto out_bad; } - if (!nfs_dentry_force_reval(dentry, flags)) + /* Force a full look up iff the parent directory has changed */ + if (nfs_check_verifier(dir, dentry)) { + if (nfs_lookup_verify_inode(inode, flags)) + goto out_bad; goto out_valid; - - if (IS_ROOT(dentry)) { - __nfs_revalidate_inode(NFS_SERVER(inode), inode); - goto out_valid_renew; } - /* - * Do a new lookup and check the dentry attributes. - */ + if (NFS_STALE(inode)) + goto out_bad; + error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, &fhandle, &fattr); if (error) goto out_bad; - - /* Inode number matches? */ - if (!(fattr.valid & NFS_ATTR_FATTR) || - NFS_FSID(inode) != fattr.fsid || - NFS_FILEID(inode) != fattr.fileid) + if (memcmp(NFS_FH(inode), &fhandle, sizeof(struct nfs_fh))!= 0) goto out_bad; - - /* Ok, remember that we successfully checked it.. */ - nfs_refresh_inode(inode, &fattr); - - if (nfs_inode_is_stale(inode, &fhandle, &fattr)) + if ((error = nfs_refresh_inode(inode, &fattr)) != 0) goto out_bad; - out_valid_renew: nfs_renew_times(dentry); -out_valid: + out_valid: unlock_kernel(); return 1; -out_bad: - shrink_dcache_parent(dentry); - /* If we have submounts, don't unhash ! */ - if (have_submounts(dentry)) - goto out_valid; - d_drop(dentry); - /* Purge readdir caches. */ - nfs_zap_caches(dir); - if (inode && S_ISDIR(inode->i_mode)) + out_bad: + NFS_CACHEINV(dir); + if (inode && S_ISDIR(inode->i_mode)) { + /* Purge readdir caches. */ nfs_zap_caches(inode); + /* If we have submounts, don't unhash ! */ + if (have_submounts(dentry)) + goto out_valid; + shrink_dcache_parent(dentry); + } + d_drop(dentry); unlock_kernel(); return 0; } @@ -565,6 +549,7 @@ static void nfs_dentry_iput(struct dentry *dentry, struct inode *inode) { if (dentry->d_flags & DCACHE_NFSFS_RENAMED) { lock_kernel(); + inode->i_nlink--; nfs_complete_unlink(dentry); unlock_kernel(); } @@ -604,9 +589,9 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry) if (inode) { no_entry: d_add(dentry, inode); - nfs_renew_times(dentry); error = 0; } + nfs_renew_times(dentry); } out: return ERR_PTR(error); diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index dc50e798c..261cadb58 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -630,39 +630,18 @@ nfs_find_actor(struct inode *inode, unsigned long ino, void *opaque) struct nfs_fh *fh = desc->fh; struct nfs_fattr *fattr = desc->fattr; - if (NFS_FSID(inode) != fattr->fsid) - return 0; if (NFS_FILEID(inode) != fattr->fileid) return 0; if (memcmp(NFS_FH(inode), fh, sizeof(struct nfs_fh)) != 0) return 0; + if (is_bad_inode(inode)) + return 0; /* Force an attribute cache update if inode->i_count == 0 */ if (!atomic_read(&inode->i_count)) NFS_CACHEINV(inode); return 1; } -int -nfs_inode_is_stale(struct inode *inode, struct nfs_fh *fh, struct nfs_fattr *fattr) -{ - /* Empty inodes are not stale */ - if (!inode->i_mode) - return 0; - - if ((fattr->mode & S_IFMT) != (inode->i_mode & S_IFMT)) - return 1; - - if (is_bad_inode(inode) || NFS_STALE(inode)) - return 1; - - /* Has the filehandle changed? If so is the old one stale? */ - if (memcmp(NFS_FH(inode), fh, sizeof(struct nfs_fh)) != 0 && - __nfs_revalidate_inode(NFS_SERVER(inode),inode) == -ESTALE) - return 1; - - return 0; -} - /* * This is our own version of iget that looks up inodes by file handle * instead of inode number. We use this technique instead of using @@ -713,7 +692,6 @@ __nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) /* We can't support UPDATE_ATIME(), since the server will reset it */ NFS_FLAGS(inode) &= ~NFS_INO_NEW; NFS_FILEID(inode) = fattr->fileid; - NFS_FSID(inode) = fattr->fsid; memcpy(NFS_FH(inode), fh, sizeof(struct nfs_fh)); inode->i_flags |= S_NOATIME; inode->i_mode = fattr->mode; @@ -787,7 +765,7 @@ nfs_notify_change(struct dentry *dentry, struct iattr *attr) /* * Make sure the inode is up-to-date. */ - error = nfs_revalidate(dentry); + error = nfs_revalidate_inode(NFS_SERVER(inode),inode); if (error) { #ifdef NFS_PARANOIA printk("nfs_notify_change: revalidate failed, error=%d\n", error); @@ -1025,12 +1003,11 @@ __nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr) inode->i_sb->s_id, inode->i_ino, atomic_read(&inode->i_count), fattr->valid); - if (NFS_FSID(inode) != fattr->fsid || - NFS_FILEID(inode) != fattr->fileid) { + if (NFS_FILEID(inode) != fattr->fileid) { printk(KERN_ERR "nfs_refresh_inode: inode number mismatch\n" - "expected (0x%Lx/0x%Lx), got (0x%Lx/0x%Lx)\n", - (long long)NFS_FSID(inode), (long long)NFS_FILEID(inode), - (long long)fattr->fsid, (long long)fattr->fileid); + "expected (%s/0x%Lx), got (%s/0x%Lx)\n", + inode->i_sb->s_id, (long long)NFS_FILEID(inode), + inode->i_sb->s_id, (long long)fattr->fileid); goto out_err; } @@ -1100,8 +1077,11 @@ __nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr) inode->i_atime = new_atime; - NFS_CACHE_MTIME(inode) = new_mtime; - inode->i_mtime = nfs_time_to_secs(new_mtime); + if (NFS_CACHE_MTIME(inode) != new_mtime) { + NFS_MTIME_UPDATE(inode) = jiffies; + NFS_CACHE_MTIME(inode) = new_mtime; + inode->i_mtime = nfs_time_to_secs(new_mtime); + } NFS_CACHE_ISIZE(inode) = new_size; inode->i_size = new_isize; @@ -1175,10 +1155,6 @@ static struct inode *nfs_alloc_inode(struct super_block *sb) if (!nfsi) return NULL; nfsi->flags = NFS_INO_NEW; - /* do we need the next 4 lines? */ - nfsi->hash_next = NULL; - nfsi->hash_prev = NULL; - nfsi->nextscan = 0; nfsi->mm_cred = NULL; return &nfsi->vfs_inode; } diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 2c9987eba..d8e9b491c 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -80,7 +80,8 @@ nfs3_proc_lookup(struct inode *dir, struct qstr *name, status = rpc_call(NFS_CLIENT(dir), NFS3PROC_GETATTR, fhandle, fattr, 0); dprintk("NFS reply lookup: %d\n", status); - nfs_refresh_inode(dir, &dir_attr); + if (status >= 0) + status = nfs_refresh_inode(dir, &dir_attr); return status; } diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 4196c397e..129b277a0 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -53,7 +53,7 @@ static int nfs_try_to_free_pages(struct nfs_server *); /** * nfs_create_request - Create an NFS read/write request. - * @file: file that owns this request + * @cred: RPC credential to use * @inode: inode to which the request is attached * @page: page to write * @offset: starting offset within the page for the write @@ -66,7 +66,7 @@ static int nfs_try_to_free_pages(struct nfs_server *); * User should ensure it is safe to sleep in this function. */ struct nfs_page * -nfs_create_request(struct file *file, struct inode *inode, +nfs_create_request(struct rpc_cred *cred, struct inode *inode, struct page *page, unsigned int offset, unsigned int count) { @@ -107,34 +107,49 @@ nfs_create_request(struct file *file, struct inode *inode, req->wb_offset = offset; req->wb_bytes = count; - /* If we have a struct file, use its cached credentials */ - if (file) { - req->wb_file = file; - get_file(file); - req->wb_cred = nfs_file_cred(file); - } + if (cred) + req->wb_cred = get_rpccred(cred); req->wb_inode = inode; req->wb_count = 1; return req; } +/** + * nfs_clear_request - Free up all resources allocated to the request + * @req: + * + * Release all resources associated with a write request after it + * has completed. + */ +void nfs_clear_request(struct nfs_page *req) +{ + /* Release struct file or cached credential */ + if (req->wb_file) { + fput(req->wb_file); + req->wb_file = NULL; + } + if (req->wb_cred) { + put_rpccred(req->wb_cred); + req->wb_cred = NULL; + } + if (req->wb_page) { + page_cache_release(req->wb_page); + req->wb_page = NULL; + atomic_dec(&NFS_REQUESTLIST(req->wb_inode)->nr_requests); + } +} + /** * nfs_release_request - Release the count on an NFS read/write request * @req: request to release * - * Release all resources associated with a write request after it - * has been committed to stable storage - * * Note: Should never be called with the spinlock held! */ void nfs_release_request(struct nfs_page *req) { - struct inode *inode = req->wb_inode; - struct nfs_reqlist *cache = NFS_REQUESTLIST(inode); - spin_lock(&nfs_wreq_lock); if (--req->wb_count) { spin_unlock(&nfs_wreq_lock); @@ -142,7 +157,6 @@ nfs_release_request(struct nfs_page *req) } __nfs_del_lru(req); spin_unlock(&nfs_wreq_lock); - atomic_dec(&cache->nr_requests); #ifdef NFS_PARANOIA if (!list_empty(&req->wb_list)) @@ -151,16 +165,12 @@ nfs_release_request(struct nfs_page *req) BUG(); if (NFS_WBACK_BUSY(req)) BUG(); - if (atomic_read(&cache->nr_requests) < 0) + if (atomic_read(&NFS_REQUESTLIST(req->wb_inode)->nr_requests) < 0) BUG(); #endif /* Release struct file or cached credential */ - if (req->wb_file) - fput(req->wb_file); - else if (req->wb_cred) - put_rpccred(req->wb_cred); - page_cache_release(req->wb_page); + nfs_clear_request(req); nfs_page_free(req); } diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 919b2c5b5..909f44712 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -171,7 +171,7 @@ nfs_readpage_async(struct file *file, struct inode *inode, struct page *page) struct nfs_inode *nfsi = NFS_I(inode); struct nfs_page *new; - new = nfs_create_request(file, inode, page, 0, PAGE_CACHE_SIZE); + new = nfs_create_request(nfs_file_cred(file), inode, page, 0, PAGE_CACHE_SIZE); if (IS_ERR(new)) return PTR_ERR(new); nfs_mark_request_read(new); @@ -227,8 +227,9 @@ nfs_async_read_error(struct list_head *head) nfs_list_remove_request(req); SetPageError(page); UnlockPage(page); - nfs_unlock_request(req); + nfs_clear_request(req); nfs_release_request(req); + nfs_unlock_request(req); } } @@ -433,6 +434,7 @@ nfs_readpage_result(struct rpc_task *task) (long long)NFS_FILEID(req->wb_inode), req->wb_bytes, (long long)(page_offset(page) + req->wb_offset)); + nfs_clear_request(req); nfs_release_request(req); nfs_unlock_request(req); } @@ -450,19 +452,9 @@ nfs_readpage_result(struct rpc_task *task) int nfs_readpage(struct file *file, struct page *page) { - struct inode *inode; + struct inode *inode = page->mapping->host; int error; - if (!file) { - struct address_space *mapping = page->mapping; - if (!mapping) - BUG(); - inode = mapping->host; - } else - inode = file->f_dentry->d_inode; - if (!inode) - BUG(); - dprintk("NFS: nfs_readpage (%p %ld@%lu)\n", page, PAGE_CACHE_SIZE, page->index); /* diff --git a/fs/nfs/write.c b/fs/nfs/write.c index b3774c964..c9be75040 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -239,17 +239,11 @@ nfs_writepage_async(struct file *file, struct inode *inode, struct page *page, int nfs_writepage(struct page *page) { - struct inode *inode; + struct inode *inode = page->mapping->host; unsigned long end_index; unsigned offset = PAGE_CACHE_SIZE; int err; - struct address_space *mapping = page->mapping; - if (!mapping) - BUG(); - inode = mapping->host; - if (!inode) - BUG(); end_index = inode->i_size >> PAGE_CACHE_SHIFT; /* Ensure we've flushed out any previous writes */ @@ -354,6 +348,7 @@ nfs_inode_remove_request(struct nfs_page *req) iput(inode); } else spin_unlock(&nfs_wreq_lock); + nfs_clear_request(req); nfs_release_request(req); } @@ -684,9 +679,13 @@ nfs_update_request(struct file* file, struct inode *inode, struct page *page, } spin_unlock(&nfs_wreq_lock); - new = nfs_create_request(file, inode, page, offset, bytes); + new = nfs_create_request(nfs_file_cred(file), inode, page, offset, bytes); if (IS_ERR(new)) return new; + if (file) { + new->wb_file = file; + get_file(file); + } /* If the region is locked, adjust the timeout */ if (region_locked(inode, new)) new->wb_timeout = jiffies + NFS_WRITEBACK_LOCKDELAY; @@ -764,7 +763,7 @@ nfs_strategy(struct inode *inode) int nfs_flush_incompatible(struct file *file, struct page *page) { - struct inode *inode = file->f_dentry->d_inode; + struct inode *inode = page->mapping->host; struct nfs_page *req; int status = 0; /* @@ -794,7 +793,7 @@ int nfs_updatepage(struct file *file, struct page *page, unsigned int offset, unsigned int count) { struct dentry *dentry = file->f_dentry; - struct inode *inode = dentry->d_inode; + struct inode *inode = page->mapping->host; struct nfs_page *req; loff_t end; int status = 0; diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c index ca9393ea5..fcc59fddf 100644 --- a/fs/reiserfs/dir.c +++ b/fs/reiserfs/dir.c @@ -76,7 +76,7 @@ static int reiserfs_readdir (struct file * filp, void * dirent, filldir_t filldi /* we must have found item, that is item of this directory, */ RFALSE( COMP_SHORT_KEYS (&(ih->ih_key), &pos_key), - "vs-9000: found item %h does not match to dir we readdir %k", + "vs-9000: found item %h does not match to dir we readdir %K", ih, &pos_key); RFALSE( item_num > B_NR_ITEMS (bh) - 1, "vs-9005 item_num == %d, item amount == %d", diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c index f2f2754ca..5444f25fe 100644 --- a/fs/reiserfs/fix_node.c +++ b/fs/reiserfs/fix_node.c @@ -2356,7 +2356,6 @@ int fix_nodes (int n_op_mode, for ( n_h = 0; n_h < MAX_HEIGHT && p_s_tb->insert_size[n_h]; n_h++ ) { if ( (n_ret_value = get_direct_parent(p_s_tb, n_h)) != CARRY_ON ) { goto repeat; - return n_ret_value; } if ( (n_ret_value = check_balance (n_op_mode, p_s_tb, n_h, n_item_num, @@ -2365,7 +2364,6 @@ int fix_nodes (int n_op_mode, /* No balancing for higher levels needed. */ if ( (n_ret_value = get_neighbors(p_s_tb, n_h)) != CARRY_ON ) { goto repeat; - return n_ret_value; } if ( n_h != MAX_HEIGHT - 1 ) p_s_tb->insert_size[n_h + 1] = 0; @@ -2373,17 +2371,14 @@ int fix_nodes (int n_op_mode, break; } goto repeat; - return n_ret_value; } if ( (n_ret_value = get_neighbors(p_s_tb, n_h)) != CARRY_ON ) { goto repeat; - return n_ret_value; } if ( (n_ret_value = get_empty_nodes(p_s_tb, n_h)) != CARRY_ON ) { - goto repeat; - return n_ret_value; /* No disk space, or schedule occurred and + goto repeat; /* No disk space, or schedule occurred and analysis may be invalid and needs to be redone. */ } diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index c10bb3a66..4fe8843c5 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -743,7 +743,8 @@ int reiserfs_get_block (struct inode * inode, sector_t block, retval = convert_tail_for_hole(inode, bh_result, tail_offset) ; if (retval) { - printk("clm-6004: convert tail failed inode %lu, error %d\n", inode->i_ino, retval) ; + if ( retval != -ENOSPC ) + printk("clm-6004: convert tail failed inode %lu, error %d\n", inode->i_ino, retval) ; if (allocated_block_nr) reiserfs_free_block (&th, allocated_block_nr); goto failure ; @@ -888,6 +889,8 @@ static void init_inode (struct inode * inode, struct path * path) copy_key (INODE_PKEY (inode), &(ih->ih_key)); inode->i_blksize = PAGE_SIZE; + INIT_LIST_HEAD(&(REISERFS_I(inode)->i_prealloc_list )); + if (stat_data_v1 (ih)) { struct stat_data_v1 * sd = (struct stat_data_v1 *)B_I_PITEM (bh, ih); unsigned long blocks; @@ -1152,6 +1155,7 @@ void reiserfs_read_inode2 (struct inode * inode, void *p) /* a stale NFS handle can trigger this without it being an error */ pathrelse (&path_to_sd); make_bad_inode(inode) ; + inode->i_nlink = 0; return; } @@ -1184,6 +1188,27 @@ void reiserfs_read_inode2 (struct inode * inode, void *p) } +/** + * reiserfs_find_actor() - "find actor" reiserfs supplies to iget4(). + * + * @inode: inode from hash table to check + * @inode_no: inode number we are looking for + * @opaque: "cookie" passed to iget4(). This is &reiserfs_iget4_args. + * + * This function is called by iget4() to distinguish reiserfs inodes + * having the same inode numbers. Such inodes can only exist due to some + * error condition. One of them should be bad. Inodes with identical + * inode numbers (objectids) are distinguished by parent directory ids. + * + */ +static int reiserfs_find_actor( struct inode *inode, + unsigned long inode_no, void *opaque ) +{ + struct reiserfs_iget4_args *args; + + args = opaque; + return INODE_PKEY( inode ) -> k_dir_id == args -> objectid; +} struct inode * reiserfs_iget (struct super_block * s, const struct cpu_key * key) { @@ -1191,7 +1216,8 @@ struct inode * reiserfs_iget (struct super_block * s, const struct cpu_key * key struct reiserfs_iget4_args args ; args.objectid = key->on_disk_key.k_dir_id ; - inode = iget4 (s, key->on_disk_key.k_objectid, 0, (void *)(&args)); + inode = iget4 (s, key->on_disk_key.k_objectid, + reiserfs_find_actor, (void *)(&args)); if (!inode) return ERR_PTR(-ENOMEM) ; @@ -1532,6 +1558,7 @@ struct inode * reiserfs_new_inode (struct reiserfs_transaction_handle *th, REISERFS_I(inode)->i_first_direct_byte = S_ISLNK(mode) ? 1 : U32_MAX/*NO_BYTES_IN_DIRECT_ITEM*/; + INIT_LIST_HEAD(&(REISERFS_I(inode)->i_prealloc_list )); REISERFS_I(inode)->i_flags = 0; REISERFS_I(inode)->i_prealloc_block = 0; REISERFS_I(inode)->i_prealloc_count = 0; diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 306e9bcd7..199678292 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c @@ -797,7 +797,7 @@ static void remove_all_from_journal_list(struct super_block *p_s_sb, struct reis while(cn) { if (cn->blocknr != 0) { if (debug) { - printk("block %lu, bh is %d, state %d\n", cn->blocknr, cn->bh ? 1: 0, + printk("block %lu, bh is %d, state %ld\n", cn->blocknr, cn->bh ? 1: 0, cn->state) ; } cn->state = 0 ; diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index 6eeec4940..9d2d24bd1 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c @@ -470,7 +470,7 @@ static int reiserfs_add_entry (struct reiserfs_transaction_handle *th, struct in if (gen_number != 0) { /* we need to re-search for the insertion point */ if (search_by_entry_key (dir->i_sb, &entry_key, &path, &de) != NAME_NOT_FOUND) { reiserfs_warning ("vs-7032: reiserfs_add_entry: " - "entry with this key (%k) already exists\n", &entry_key); + "entry with this key (%K) already exists\n", &entry_key); if (buffer != small_buf) reiserfs_kfree (buffer, buflen, dir->i_sb); diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c index 242e7b294..b6ef3e5a4 100644 --- a/fs/reiserfs/procfs.c +++ b/fs/reiserfs/procfs.c @@ -465,7 +465,7 @@ int reiserfs_journal_in_proc( char *buffer, char **start, off_t offset, "jp_journal_max_trans_age: \t%i\n" /* incore fields */ "j_1st_reserved_block: \t%i\n" - "j_state: \t%i\n" + "j_state: \t%li\n" "j_trans_id: \t%lu\n" "j_mount_id: \t%lu\n" "j_start: \t%lu\n" diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index ff771dee9..5d3eee75a 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c @@ -126,19 +126,19 @@ inline int comp_keys (const struct key * le_key, const struct cpu_key * cpu_key retval = comp_short_keys (le_key, cpu_key); if (retval) return retval; - if (le_key_k_offset (cpu_key->version, le_key) < cpu_key_k_offset (cpu_key)) + if (le_key_k_offset (le_key_version(le_key), le_key) < cpu_key_k_offset (cpu_key)) return -1; - if (le_key_k_offset (cpu_key->version, le_key) > cpu_key_k_offset (cpu_key)) + if (le_key_k_offset (le_key_version(le_key), le_key) > cpu_key_k_offset (cpu_key)) return 1; if (cpu_key->key_length == 3) return 0; /* this part is needed only when tail conversion is in progress */ - if (le_key_k_type (cpu_key->version, le_key) < cpu_key_k_type (cpu_key)) + if (le_key_k_type (le_key_version(le_key), le_key) < cpu_key_k_type (cpu_key)) return -1; - if (le_key_k_type (cpu_key->version, le_key) > cpu_key_k_type (cpu_key)) + if (le_key_k_type (le_key_version(le_key), le_key) > cpu_key_k_type (cpu_key)) return 1; return 0; @@ -166,7 +166,7 @@ inline int comp_cpu_keys (const struct cpu_key * key1, if (cpu_key_k_offset (key1) > cpu_key_k_offset (key2)) return 1; - reiserfs_warning ("comp_cpu_keys: type are compared for %k and %k\n", + reiserfs_warning ("comp_cpu_keys: type are compared for %K and %K\n", key1, key2); if (cpu_key_k_type (key1) < cpu_key_k_type (key2)) @@ -1338,8 +1338,10 @@ void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th, } if (retval != ITEM_FOUND) { pathrelse (&path); - reiserfs_warning ("vs-5355: reiserfs_delete_solid_item: %k not found", - key); + // No need for a warning, if there is just no free space to insert '..' item into the newly-created subdir + if ( !( (unsigned long long) GET_HASH_VALUE (le_key_k_offset (le_key_version (key), key)) == 0 && \ + (unsigned long long) GET_GENERATION_NUMBER (le_key_k_offset (le_key_version (key), key)) == 1 ) ) + reiserfs_warning ("vs-5355: reiserfs_delete_solid_item: %k not found", key); break; } if (!tb_init) { @@ -1522,7 +1524,7 @@ int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th, set_cpu_key_k_offset (p_s_item_key, n_new_file_size + 1); if ( search_for_position_by_key(p_s_sb, p_s_item_key, p_s_path) == POSITION_NOT_FOUND ){ print_block (PATH_PLAST_BUFFER (p_s_path), 3, PATH_LAST_POSITION (p_s_path) - 1, PATH_LAST_POSITION (p_s_path) + 1); - reiserfs_panic(p_s_sb, "PAP-5580: reiserfs_cut_from_item: item to convert does not exist (%k)", p_s_item_key); + reiserfs_panic(p_s_sb, "PAP-5580: reiserfs_cut_from_item: item to convert does not exist (%K)", p_s_item_key); } continue; } @@ -1716,7 +1718,7 @@ void reiserfs_do_truncate (struct reiserfs_transaction_handle *th, } RFALSE( n_deleted > n_file_size, - "PAP-5670: reiserfs_truncate_file returns too big number: deleted %d, file_size %lu, item_key %k", + "PAP-5670: reiserfs_truncate_file returns too big number: deleted %d, file_size %lu, item_key %K", n_deleted, n_file_size, &s_item_key); /* Change key to search the last file item. */ diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 07ce420bd..e1ac7050e 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -284,7 +284,8 @@ void add_save_link (struct reiserfs_transaction_handle * th, /* look for its place in the tree */ retval = search_item (inode->i_sb, &key, &path); if (retval != ITEM_NOT_FOUND) { - reiserfs_warning ("vs-2100: add_save_link:" + if ( retval != -ENOSPC ) + reiserfs_warning ("vs-2100: add_save_link:" "search_by_key (%K) returned %d\n", &key, retval); pathrelse (&path); return; @@ -748,6 +749,14 @@ static int read_super_block (struct super_block * s, int offset) return 1; } + if ( rs->s_v1.s_root_block == -1 ) { + brelse(bh) ; + printk("dev %s: Unfinished reiserfsck --rebuild-tree run detected. Please run\n" + "reiserfsck --rebuild-tree and wait for a completion. If that fais\n" + "get newer reiserfsprogs package\n", kdevname (s->s_dev)); + return 1; + } + SB_BUFFER_WITH_SB (s) = bh; SB_DISK_SUPER_BLOCK (s) = rs; diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c index 3d83a5696..18f1bda12 100644 --- a/fs/reiserfs/tail_conversion.c +++ b/fs/reiserfs/tail_conversion.c @@ -90,10 +90,10 @@ int direct2indirect (struct reiserfs_transaction_handle *th, struct inode * inod last item of the file */ if ( search_for_position_by_key (sb, &end_key, path) == POSITION_FOUND ) reiserfs_panic (sb, "PAP-14050: direct2indirect: " - "direct item (%k) not found", &end_key); + "direct item (%K) not found", &end_key); p_le_ih = PATH_PITEM_HEAD (path); RFALSE( !is_direct_le_ih (p_le_ih), - "vs-14055: direct item expected(%k), found %h", + "vs-14055: direct item expected(%K), found %h", &end_key, p_le_ih); tail_size = (le_ih_k_offset (p_le_ih) & (n_blk_size - 1)) + ih_item_len(p_le_ih) - 1; @@ -228,7 +228,7 @@ int indirect2direct (struct reiserfs_transaction_handle *th, /* re-search indirect item */ if ( search_for_position_by_key (p_s_sb, p_s_item_key, p_s_path) == POSITION_NOT_FOUND ) reiserfs_panic(p_s_sb, "PAP-5520: indirect2direct: " - "item to be converted %k does not exist", p_s_item_key); + "item to be converted %K does not exist", p_s_item_key); copy_item_head(&s_ih, PATH_PITEM_HEAD(p_s_path)); #ifdef CONFIG_REISERFS_CHECK pos = le_ih_k_offset (&s_ih) - 1 + diff --git a/include/linux/device.h b/include/linux/device.h index 284b52f5a..1e4ad1508 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -66,10 +66,8 @@ struct device_driver { struct device { struct list_head node; /* node in sibling list */ - struct iobus *parent; /* parent bus */ - - struct iobus *subordinate; /* only valid if this device is a - bridge device */ + struct list_head children; + struct device * parent; char name[DEVICE_NAME_SIZE]; /* descriptive ascii string */ char bus_id[BUS_ID_SIZE]; /* position on parent bus */ @@ -113,36 +111,12 @@ struct iobus_driver { int (*add_device) (struct iobus*, char*); }; -struct iobus { - spinlock_t lock; /* lock for bus */ - atomic_t refcount; - - struct list_head node; /* node in sibling list */ - struct iobus *parent; /* parent bus */ - struct list_head children; /* children buses */ - struct list_head devices; /* children devices */ - - struct device *self; /* pointer to controlling device */ - struct driver_dir_entry dir; /* driverfs directory */ - - char name[DEVICE_NAME_SIZE]; - char bus_id[BUS_ID_SIZE]; - - struct iobus_driver *driver; /* bus operations */ -}; - static inline struct device * list_to_dev(struct list_head *node) { return list_entry(node, struct device, node); } -static inline struct iobus * -list_to_iobus(const struct list_head *node) -{ - return list_entry(node, struct iobus, node); -} - /* * High level routines for use by the bus drivers */ @@ -163,9 +137,6 @@ extern int (*platform_notify)(struct device * dev); extern int (*platform_notify_remove)(struct device * dev); -extern int device_driver_init(void); - - /* device and bus locking helpers. * * FIXME: Is there anything else we need to do? @@ -192,22 +163,4 @@ static inline void get_device(struct device * dev) extern void put_device(struct device * dev); -static inline void lock_iobus(struct iobus * iobus) -{ - spin_lock(&iobus->lock); -} - -static inline void unlock_iobus(struct iobus * iobus) -{ - spin_unlock(&iobus->lock); -} - -static inline void get_iobus(struct iobus * iobus) -{ - BUG_ON(!atomic_read(&iobus->refcount)); - atomic_inc(&iobus->refcount); -} - -extern void put_iobus(struct iobus * iobus); - #endif /* _DEVICE_H_ */ diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 37b728071..5e741a18c 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h @@ -70,7 +70,7 @@ int gameport_open(struct gameport *gameport, struct gameport_dev *dev, int mode) void gameport_close(struct gameport *gameport); void gameport_rescan(struct gameport *gameport); -#if defined(CONFIG_INPUT_GAMEPORT) || defined(CONFIG_INPUT_GAMEPORT_MODULE) +#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) void gameport_register_port(struct gameport *gameport); void gameport_unregister_port(struct gameport *gameport); #else diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 93aae0c5f..eda80eca8 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -92,7 +92,6 @@ struct nfs_inode { /* * The 64bit 'inode number' */ - __u64 fsid; __u64 fileid; /* @@ -130,6 +129,12 @@ struct nfs_inode { unsigned long attrtimeo_timestamp; /* + * Timestamp that dates the change made to read_cache_mtime. + * This is of use for dentry revalidation + */ + unsigned long cache_mtime_jiffies; + + /* * This is the cookie verifier used for NFSv3 readdir * operations */ @@ -148,11 +153,6 @@ struct nfs_inode { ncommit, npages; - /* Flush daemon info */ - struct inode *hash_next, - *hash_prev; - unsigned long nextscan; - /* Credentials for shared mmap */ struct rpc_cred *mm_cred; @@ -183,6 +183,7 @@ static inline struct nfs_inode *NFS_I(struct inode *inode) #define NFS_CONGESTED(inode) (RPC_CONGESTED(NFS_CLIENT(inode))) #define NFS_COOKIEVERF(inode) (NFS_I(inode)->cookieverf) #define NFS_READTIME(inode) (NFS_I(inode)->read_cache_jiffies) +#define NFS_MTIME_UPDATE(inode) (NFS_I(inode)->cache_mtime_jiffies) #define NFS_CACHE_CTIME(inode) (NFS_I(inode)->read_cache_ctime) #define NFS_CACHE_MTIME(inode) (NFS_I(inode)->read_cache_mtime) #define NFS_CACHE_ISIZE(inode) (NFS_I(inode)->read_cache_isize) @@ -206,7 +207,6 @@ do { \ #define NFS_NEW(inode) (NFS_FLAGS(inode) & NFS_INO_NEW) #define NFS_FILEID(inode) (NFS_I(inode)->fileid) -#define NFS_FSID(inode) (NFS_I(inode)->fsid) /* Inode Flags */ #define NFS_USE_READDIRPLUS(inode) ((NFS_FLAGS(inode) & NFS_INO_ADVISE_RDPLUS) ? 1 : 0) @@ -250,7 +250,9 @@ extern struct address_space_operations nfs_file_aops; static __inline__ struct rpc_cred * nfs_file_cred(struct file *file) { - struct rpc_cred *cred = (struct rpc_cred *)(file->private_data); + struct rpc_cred *cred = NULL; + if (file) + cred = (struct rpc_cred *)file->private_data; #ifdef RPC_DEBUG if (cred && cred->cr_magic != RPCAUTH_CRED_MAGIC) BUG(); diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index 59150c0a7..d339e29a6 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h @@ -41,9 +41,10 @@ struct nfs_page { #define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) -extern struct nfs_page *nfs_create_request(struct file *, struct inode *, +extern struct nfs_page *nfs_create_request(struct rpc_cred *, struct inode *, struct page *, unsigned int, unsigned int); +extern void nfs_clear_request(struct nfs_page *req); extern void nfs_release_request(struct nfs_page *req); diff --git a/include/linux/pci.h b/include/linux/pci.h index 6c9bd9e3f..c47781da1 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -432,8 +432,7 @@ struct pci_bus { unsigned char productver; /* product version */ unsigned char checksum; /* if zero - checksum passed */ unsigned char pad1; - - struct iobus iobus; /* Generic device interface */ + struct device * dev; }; #define pci_bus_b(n) list_entry(n, struct pci_bus, node) diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 9c0015031..67e5b9493 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h @@ -381,7 +381,7 @@ static inline void set_offset_v2_k_type( struct offset_v2 *v2, int type ) offset_v2_esafe_overlay *tmp = (offset_v2_esafe_overlay *)v2; tmp->linear = le64_to_cpu(tmp->linear); tmp->offset_v2.k_type = type; - tmp->linear = le64_to_cpu(tmp->linear); + tmp->linear = cpu_to_le64(tmp->linear); } static inline loff_t offset_v2_k_offset( const struct offset_v2 *v2 ) @@ -395,7 +395,7 @@ static inline void set_offset_v2_k_offset( struct offset_v2 *v2, loff_t offset ) offset_v2_esafe_overlay *tmp = (offset_v2_esafe_overlay *)v2; tmp->linear = le64_to_cpu(tmp->linear); tmp->offset_v2.k_offset = offset; - tmp->linear = le64_to_cpu(tmp->linear); + tmp->linear = cpu_to_le64(tmp->linear); } #else # define offset_v2_k_type(v2) ((v2)->k_type) diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index edcb0f973..0d8ed8d7e 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h @@ -131,7 +131,7 @@ struct reiserfs_journal_cnode { struct buffer_head *bh ; /* real buffer head */ struct super_block *sb ; /* dev of real buffer head */ unsigned long blocknr ; /* block number of real buffer head, == 0 when buffer on disk */ - int state ; + long state ; struct reiserfs_journal_list *jlist ; /* journal list this cnode lives in */ struct reiserfs_journal_cnode *next ; /* next in transaction list */ struct reiserfs_journal_cnode *prev ; /* prev in transaction list */ @@ -199,7 +199,7 @@ struct reiserfs_journal { struct block_device *j_dev_bd; int j_1st_reserved_block; /* first block on s_dev of reserved area journal */ - int j_state ; + long j_state ; unsigned long j_trans_id ; unsigned long j_mount_id ; unsigned long j_start ; /* start of current waiting commit (index into j_ap_blocks) */ diff --git a/init/main.c b/init/main.c index f4f7ccc42..64f4c2990 100644 --- a/init/main.c +++ b/init/main.c @@ -31,8 +31,6 @@ #include <asm/io.h> #include <asm/bugs.h> -#include <linux/device.h> - #if defined(CONFIG_ARCH_S390) #include <asm/s390mach.h> #include <asm/ccwcache.h> @@ -446,10 +444,6 @@ static void __init do_basic_setup(void) #if defined(CONFIG_ARCH_S390) s390_init_machine_check(); #endif - - /* bring up the device tree */ - device_driver_init(); - /* Networking initialization needs a process context */ sock_init(); diff --git a/lib/crc32.c b/lib/crc32.c index c0470a25d..ef9f5caef 100644 --- a/lib/crc32.c +++ b/lib/crc32.c @@ -564,7 +564,7 @@ static void __exit cleanup_crc32(void) crc32cleanup_be(); } -module_init(init_crc32); +fs_initcall(init_crc32); module_exit(cleanup_crc32); EXPORT_SYMBOL(crc32_le); diff --git a/scripts/header.tk b/scripts/header.tk index 2cc9c7e53..959cc2ffd 100644 --- a/scripts/header.tk +++ b/scripts/header.tk @@ -449,29 +449,24 @@ proc dohelp {w var parent} { catch {destroy $w} toplevel $w -class Dialog - set filefound 0 set found 0 - set lineno 0 - - if { [file readable Documentation/Configure.help] == 1} then { - set filefound 1 - # First escape sed regexp special characters in var: - set var [exec echo "$var" | sed s/\[\]\[\/.^$*\]/\\\\&/g] - # Now pick out right help text: - set message [exec sed -n " - /^$var\[ \]*\$/,\${ - /^$var\[ \]*\$/c\\ + + # First escape sed regexp special characters in var: + set var [exec echo "$var" | sed s/\[\]\[\/.^$*\]/\\\\&/g] + # Now pick out right help text: + set message [exec find . -name Config.help | xargs sed -n " + /^$var\[ \]*\$/,\${ + /^$var\[ \]*\$/c\\ ${var}:\\ - /^#/b - /^\[^ \]/q - s/^ // - /<file:\\(\[^>\]*\\)>/s//\\1/g - p - } - " Documentation/Configure.help] - set found [expr [string length "$message"] > 0] - } + /^#/b + /^\[^ \]/q + s/^ // + /<file:\\(\[^>\]*\\)>/s//\\1/g + p + } + " /dev/null ] + set found [expr [string length "$message"] > 0] frame $w.f1 pack $w.f1 -fill both -expand on @@ -494,13 +489,8 @@ ${var}:\\ pack $w.f1.canvas -side right -fill y -expand on if { $found == 0 } then { - if { $filefound == 0 } then { - message $w.f1.f.m -width 750 -aspect 300 -relief flat -text \ - "No help available - unable to open file Documentation/Configure.help. This file should have come with your kernel." - } else { message $w.f1.f.m -width 400 -aspect 300 -relief flat -text \ "No help available for $var" - } label $w.f1.bm -bitmap error wm title $w "RTFM" } else { |