You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(135) |
Nov
(123) |
Dec
(83) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(244) |
Feb
(72) |
Mar
(221) |
Apr
(91) |
May
(104) |
Jun
(93) |
Jul
(78) |
Aug
(1) |
Sep
(1) |
Oct
(29) |
Nov
(98) |
Dec
(20) |
2003 |
Jan
|
Feb
(21) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(18) |
Sep
(18) |
Oct
(23) |
Nov
(12) |
Dec
(6) |
2004 |
Jan
(2) |
Feb
(32) |
Mar
|
Apr
(12) |
May
(11) |
Jun
(11) |
Jul
|
Aug
(9) |
Sep
|
Oct
(15) |
Nov
|
Dec
|
2005 |
Jan
|
Feb
(2) |
Mar
(11) |
Apr
(6) |
May
(1) |
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(2) |
Mar
|
Apr
(25) |
May
(2) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(13) |
Oct
|
Nov
(2) |
Dec
(2) |
2011 |
Jan
|
Feb
|
Mar
(10) |
Apr
(10) |
May
(1) |
Jun
(6) |
Jul
|
Aug
(2) |
Sep
(5) |
Oct
|
Nov
|
Dec
|
From: James S. <jsi...@us...> - 2002-04-15 23:37:14
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/usb/input In directory usw-pr-cvs1:/tmp/cvs-serv1317/input Log Message: Directory /cvsroot/linuxconsole/ruby/linux/drivers/usb/input added to the repository |
From: James S. <jsi...@us...> - 2002-04-15 23:34:14
|
Update of /cvsroot/linuxconsole/ruby/web/htdocs/paper In directory usw-pr-cvs1:/tmp/cvs-serv525 Modified Files: fbdev.html intro.html Log Message: Small changes. Index: fbdev.html =================================================================== RCS file: /cvsroot/linuxconsole/ruby/web/htdocs/paper/fbdev.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- fbdev.html 12 Apr 2002 19:11:16 -0000 1.1 +++ fbdev.html 15 Apr 2002 23:34:10 -0000 1.2 @@ -58,9 +58,11 @@ <P> - +The two major goals of the redesign was to remove all the console code out of the low +level framebuffer drivers. <P> + <BR><HR> <ADDRESS> James Simmons Index: intro.html =================================================================== RCS file: /cvsroot/linuxconsole/ruby/web/htdocs/paper/intro.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- intro.html 12 Apr 2002 19:11:16 -0000 1.1 +++ intro.html 15 Apr 2002 23:34:10 -0000 1.2 @@ -57,13 +57,13 @@ </H1> <P> -Ten years when Linus was written it was on a intel machine with basic VGA -support. Linus like other UNIX based operation systems developed a concept -of a virtual terminal. In the old mainframe days the only way to access the -mainframe was via a TTY (terminal teletype) device. They basically where a -monochrome, stylish green, display and a keyboard together that connected -to the mainframe by a serial line. With todays PC we still have a monitor -and a keyboard attached. So Linux simulates these type of TTYs. The +Ten years when Linus started Linux the machine it was written on was a intel +machine with basic VGA support. Linux like other UNIX based operation systems +developed a concept of a virtual terminal. In the old mainframe days the only +way to access the mainframe was via a TTY (terminal teletype) device. They +basically where a monochrome, stylish green, display and a keyboard together +that connected to the mainframe by a serial line. With todays PC we still have +a monitor and a keyboard attached. So Linux simulates these type of TTYs. The flexiablity of POSIX TTYs allows it to be applied to other types of hardware such as modems. |
From: johann d. <jd...@us...> - 2002-04-15 19:14:29
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv15969/include/linux Modified Files: input.h Log Message: Replaced __u16-style types by their more portable equivalents (uint16_t) in force feedback related structures. Index: input.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/input.h,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- input.h 10 Mar 2002 12:20:56 -0000 1.64 +++ input.h 15 Apr 2002 19:14:22 -0000 1.65 @@ -519,69 +519,65 @@ * Structures used in ioctls to upload effects to a device * The first structures are not passed directly by using ioctls. * They are sub-structures of the actually sent structure (called ff_effect) - * - * Ranges: - * 0 <= __u16 <= 65535 - * -32768 <= __s16 <= +32767 */ struct ff_replay { - __u16 length; /* Duration of an effect in ms. All other times are also expressed in ms */ - __u16 delay; /* Time to wait before to start playing an effect */ + uint16_t length; /* Duration of an effect in ms. All other times are also expressed in ms */ + uint16_t delay; /* Time to wait before to start playing an effect */ }; struct ff_trigger { - __u16 button; /* Number of button triggering an effect */ - __u16 interval; /* Time to wait before an effect can be re-triggered (ms) */ + uint16_t button; /* Number of button triggering an effect */ + uint16_t interval; /* Time to wait before an effect can be re-triggered (ms) */ }; struct ff_envelope { - __u16 attack_length; /* Duration of attack (ms) */ - __u16 attack_level; /* Level at beginning of attack */ - __u16 fade_length; /* Duration of fade (ms) */ - __u16 fade_level; /* Level at end of fade */ + uint16_t attack_length; /* Duration of attack (ms) */ + uint16_t attack_level; /* Level at beginning of attack */ + uint16_t fade_length; /* Duration of fade (ms) */ + uint16_t fade_level; /* Level at end of fade */ }; /* FF_CONSTANT */ struct ff_constant_effect { - __s16 level; /* Strength of effect. Negative values are OK */ + int16_t level; /* Strength of effect. Negative values are OK */ struct ff_envelope envelope; }; /* FF_RAMP */ struct ff_ramp_effect { - __s16 start_level; - __s16 end_level; + int16_t start_level; + int16_t end_level; struct ff_envelope envelope; }; /* FF_SPRING of FF_FRICTION */ struct ff_condition_effect { - __u16 right_saturation; /* Max level when joystick is on the right */ - __u16 left_saturation; /* Max level when joystick in on the left */ + uint16_t right_saturation; /* Max level when joystick is on the right */ + uint16_t left_saturation; /* Max level when joystick in on the left */ - __s16 right_coeff; /* Indicates how fast the force grows when the + int16_t right_coeff; /* Indicates how fast the force grows when the joystick moves to the right */ - __s16 left_coeff; /* Same for left side */ + int16_t left_coeff; /* Same for left side */ - __u16 deadband; /* Size of area where no force is produced */ - __s16 center; /* Position of dead zone */ + uint16_t deadband; /* Size of area where no force is produced */ + int16_t center; /* Position of dead zone */ }; /* FF_PERIODIC */ struct ff_periodic_effect { - __u16 waveform; /* Kind of wave (sine, square...) */ - __u16 period; /* in ms */ - __s16 magnitude; /* Peak value */ - __s16 offset; /* Mean value of wave (roughly) */ - __u16 phase; /* 'Horizontal' shift */ + uint16_t waveform; /* Kind of wave (sine, square...) */ + uint16_t period; /* in ms */ + int16_t magnitude; /* Peak value */ + int16_t offset; /* Mean value of wave (roughly) */ + uint16_t phase; /* 'Horizontal' shift */ struct ff_envelope envelope; /* Only used if waveform == FF_CUSTOM */ - __u32 custom_len; /* Number of samples */ - __s16 *custom_data; /* Buffer of samples */ + uint32_t custom_len; /* Number of samples */ + int16_t *custom_data; /* Buffer of samples */ /* Note: the data pointed by custom_data is copied by the driver. You can * therefore dispose of the memory after the upload/update */ }; @@ -592,22 +588,22 @@ by the heavy motor. */ struct ff_rumble_effect { - __u16 strong_magnitude; /* Magnitude of the heavy motor */ - __u16 weak_magnitude; /* Magnitude of the light one */ + uint16_t strong_magnitude; /* Magnitude of the heavy motor */ + uint16_t weak_magnitude; /* Magnitude of the light one */ }; /* * Structure sent through ioctl from the application to the driver */ struct ff_effect { - __u16 type; + uint16_t type; /* Following field denotes the unique id assigned to an effect. * If user sets if to -1, a new effect is created, and its id is returned in the same field * Else, the user sets it to the effect id it wants to update. */ - __s16 id; + int16_t id; - __u16 direction; /* Direction. 0 deg -> 0x0000 (down) + uint16_t direction; /* Direction. 0 deg -> 0x0000 (down) 90 deg -> 0x4000 (left) 180 deg -> 0x8000 (up) 270 deg -> 0xC000 (right) @@ -620,7 +616,7 @@ struct ff_constant_effect constant; struct ff_ramp_effect ramp; struct ff_periodic_effect periodic; - struct ff_condition_effect condition[2]; /* One for each axis */ + struct ff_condition_effect condition[2]; /* One for each axis */ struct ff_rumble_effect rumble; } u; }; |
From: johann d. <jd...@us...> - 2002-04-13 08:03:07
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/usb In directory usw-pr-cvs1:/tmp/cvs-serv29652/drivers/usb Added Files: pid.c pid.h Log Message: Added code by Rodrigo Damazio. --- NEW FILE: pid.c --- /* * PID Force feedback support for hid devices. * * Copyright (c) 2002 Rodrigo Damazio. * Portions by Johann Deneux and Bjorn Augustson */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Should you need to contact me, the author, you can do so by * e-mail - mail your message to <rda...@ls...> */ #include <linux/config.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/mm.h> #include <linux/smp_lock.h> #include <linux/spinlock.h> #include <linux/input.h> #include <linux/usb.h> #include "hid.h" #include "pid.h" #define DEBUG /* MODULE_AUTHOR("Rodrigo Damazio <rda...@ls...>"); MODULE_DESCRIPTION("USB PID(Physical Interface Device) Driver"); MODULE_LICENSE("GPL"); */ #define CHECK_OWNERSHIP(i, hid_pid) \ ((i) < FF_EFFECTS_MAX && i >= 0 && \ test_bit(FF_PID_FLAGS_USED, &hid_pid->effects[(i)].flags) && \ (current->pid == 0 || \ (hid_pid)->effects[(i)].owner == current->pid)) /* Called when a transfer is completed */ static void hid_pid_ctrl_out(struct urb *u) { } static void hid_pid_exit(struct hid_device* hid) { } static int pid_upload_periodic(struct hid_ff_pid *pid, struct ff_effect *effect, int is_update) { return -ENOMEM; } static int pid_upload_constant(struct hid_ff_pid *pid, struct ff_effect *effect, int is_update) { return -ENOMEM; } static int pid_upload_condition(struct hid_ff_pid *pid, struct ff_effect *effect, int is_update) { return -ENOMEM; } static int pid_upload_ramp(struct hid_ff_pid *pid, struct ff_effect *effect, int is_update) { return -ENOMEM; } static int hid_pid_event(struct hid_device *hid, struct input_dev *input, unsigned int type, unsigned int code, int value) { #ifdef DEBUG printk ("PID event received: type=%d,code=%d,value=%d.\n",type,code,value); #endif if (type != EV_FF) return -1; return 0; } static int hid_pid_flush(struct input_dev *input, struct file *file) { return 0; } static int hid_pid_upload_effect(struct input_dev *dev, struct ff_effect *effect) { struct hid_ff_pid* pid_private = (struct hid_ff_pid*)(dev->private); int id; int ret; int is_update; #ifdef DEBUG printk("Upload effect called: effect_type=%x\n",effect->type); #endif /* Check this effect type is supported by this device */ if (!test_bit(effect->type, dev->ffbit)) return -EINVAL; /* * If we want to create a new effect, get a free id */ if (effect->id == -1) { for (id=0; id < FF_EFFECTS_MAX; ++id) if (!test_and_set_bit(FF_PID_FLAGS_USED, &pid_private->effects[id].flags)) break; if ( id == FF_EFFECTS_MAX || id >= dev->ff_effects_max) return -ENOMEM; effect->id = id; #ifdef DEBUG printk("Effect ID is %d\n.",id); #endif pid_private->effects[id].owner = current->pid; pid_private->effects[id].flags = (1<<FF_PID_FLAGS_USED); is_update = FF_PID_FALSE; } else { /* We want to update an effect */ if (!CHECK_OWNERSHIP(effect->id, pid_private)) return -EACCES; /* Parameter type cannot be updated */ if (effect->type != pid_private->effects[effect->id].effect.type) return -EINVAL; /* Check the effect is not already being updated */ if (test_bit(FF_PID_FLAGS_UPDATING, &pid_private->effects[effect->id].flags)) { return -EAGAIN; } is_update = FF_PID_TRUE; } /* * Upload the effect */ switch (effect->type) { case FF_PERIODIC: ret = pid_upload_periodic(pid_private, effect, is_update); break; case FF_CONSTANT: ret = pid_upload_constant(pid_private, effect, is_update); break; case FF_SPRING: case FF_FRICTION: case FF_DAMPER: case FF_INERTIA: ret = pid_upload_condition(pid_private, effect, is_update); break; case FF_RAMP: ret = pid_upload_ramp(pid_private, effect, is_update); break; default: return -EINVAL; } if (ret == 0) { /* A packet was sent, forbid new updates until we are notified * that the packet was updated */ set_bit(FF_PID_FLAGS_UPDATING, &pid_private->effects[effect->id].flags); } pid_private->effects[effect->id].effect = *effect; return ret; } int hid_pid_init(struct hid_device *hid) { struct hid_ff_pid *private; private = hid->input.private = hid->ff_private = kmalloc(sizeof(struct hid_ff_pid), GFP_KERNEL); if (!private) return -1; memset(private,0,sizeof(struct hid_ff_pid)); private->hid = hid; hid->ff_exit = hid_pid_exit; hid->ff_event = hid_pid_event; /* Open output URB */ if (!(private->urbffout = usb_alloc_urb(0, GFP_KERNEL))) { kfree(private); return -1; } usb_fill_control_urb(private->urbffout, hid->dev,0,(void *) &private->ffcr,private->ctrl_buffer,8,hid_pid_ctrl_out,hid); hid->input.upload_effect = hid_pid_upload_effect; hid->input.flush = hid_pid_flush; set_bit(EV_FF, hid->input.evbit); set_bit(EV_FF_STATUS, hid->input.evbit); /* Retrieve specific device capabilities(types of effects it can play, etc.) */ // set_bit(FF_CONSTANT, hid->input.ffbit); printk(KERN_INFO "Force feedback driver for PID devices by Rodrigo Damazio <rda...@ls...>.\n"); return 0; } static int __init hid_pid_modinit(void) { return 0; } static void __exit hid_pid_modexit(void) { } //module_init(hid_pid_modinit); //module_exit(hid_pid_modexit); --- NEW FILE: pid.h --- /* * PID Force feedback support for hid devices. * * Copyright (c) 2002 Rodrigo Damazio. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Should you need to contact me, the author, you can do so by * e-mail - mail your message to <rda...@ls...> */ #define FF_EFFECTS_MAX 64 #define FF_PID_FLAGS_USED 1 #define FF_PID_FLAGS_UPDATING 2 #define FF_PID_FALSE 0 #define FF_PID_TRUE 1 struct hid_pid_effect { unsigned int flags; pid_t owner; struct ff_effect effect; }; struct hid_ff_pid { struct hid_device *hid; struct urb *urbffout; struct usb_ctrlrequest ffcr; char ctrl_buffer[8]; unsigned long int gain; unsigned int max_effects; struct hid_pid_effect effects[FF_EFFECTS_MAX]; }; |
From: James S. <jsi...@us...> - 2002-04-12 21:28:23
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/serial In directory usw-pr-cvs1:/tmp/cvs-serv4945 Modified Files: serial_core.c Log Message: Missing some needed exported sysmbols. Index: serial_core.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_core.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- serial_core.c 14 Mar 2002 20:02:07 -0000 1.20 +++ serial_core.c 12 Apr 2002 21:28:20 -0000 1.21 @@ -2573,6 +2573,8 @@ EXPORT_SYMBOL(uart_unregister_driver); EXPORT_SYMBOL(uart_register_port); EXPORT_SYMBOL(uart_unregister_port); +EXPORT_SYMBOL(uart_remove_one_port); +EXPORT_SYMBOL(uart_add_one_port); MODULE_DESCRIPTION("Serial driver core"); MODULE_LICENSE("GPL"); |
From: James S. <jsi...@us...> - 2002-04-12 21:19:35
|
Update of /cvsroot/linuxconsole/ruby/linux In directory usw-pr-cvs1:/tmp/cvs-serv2370/linux Modified Files: Makefile Log Message: Oops. problems building a kernel without serial support. Fixed now. Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/Makefile,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- Makefile 22 Mar 2002 20:13:56 -0000 1.49 +++ Makefile 12 Apr 2002 21:19:31 -0000 1.50 @@ -132,6 +132,7 @@ DRIVERS-$(CONFIG_ACPI) += drivers/acpi/acpi.o DRIVERS-$(CONFIG_PARPORT) += drivers/parport/driver.o DRIVERS-y += drivers/base/base.o \ + drivers/serial/serial.o \ drivers/char/char.o \ drivers/block/block.o \ drivers/misc/misc.o \ @@ -157,7 +158,6 @@ DRIVERS-y += drivers/cdrom/driver.o endif -DRIVERS-$(CONFIG_UART) += drivers/serial/uart.o DRIVERS-$(CONFIG_SOUND) += sound/sound.o DRIVERS-$(CONFIG_PCI) += drivers/pci/driver.o DRIVERS-$(CONFIG_MTD) += drivers/mtd/mtdlink.o |
From: James S. <jsi...@us...> - 2002-04-12 21:19:35
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/serial In directory usw-pr-cvs1:/tmp/cvs-serv2370/linux/drivers/serial Modified Files: Makefile Log Message: Oops. problems building a kernel without serial support. Fixed now. Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/Makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile 1 Nov 2001 21:38:35 -0000 1.9 +++ Makefile 12 Apr 2002 21:19:31 -0000 1.10 @@ -11,7 +11,7 @@ # $Id$ # -O_TARGET := uart.o +O_TARGET := serial.o export-objs := serial_core.o serial_8250.o obj-y := |
From: James S. <jsi...@us...> - 2002-04-12 21:19:35
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers In directory usw-pr-cvs1:/tmp/cvs-serv2370/linux/drivers Modified Files: Makefile Log Message: Oops. problems building a kernel without serial support. Fixed now. Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/Makefile,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- Makefile 22 Mar 2002 20:13:58 -0000 1.31 +++ Makefile 12 Apr 2002 21:19:31 -0000 1.32 @@ -8,10 +8,10 @@ mod-subdirs := dio mtd sbus macintosh usb input telephony sgi ide \ message/i2o message/fusion scsi md ieee1394 pnp isdn atm \ - fc4 net/hamradio i2c acpi bluetooth input/serio \ + fc4 net/hamradio i2c acpi bluetooth serial input/serio \ input/gameport parport hotplug -subdir-y := base char block net misc media cdrom video +subdir-y := base serial char block net misc media cdrom video subdir-m := $(subdir-y) subdir-$(CONFIG_PARPORT) += parport @@ -20,7 +20,6 @@ subdir-$(CONFIG_PCI) += pci subdir-$(CONFIG_PCMCIA) += pcmcia subdir-$(CONFIG_MTD) += mtd -subdir-$(CONFIG_UART) += serial subdir-$(CONFIG_SBUS) += sbus subdir-$(CONFIG_ZORRO) += zorro subdir-$(CONFIG_NUBUS) += nubus |
From: James S. <jsi...@us...> - 2002-04-12 19:30:58
|
Update of /cvsroot/linuxconsole/ruby/web/htdocs/paper In directory usw-pr-cvs1:/tmp/cvs-serv24525/paper Log Message: Directory /cvsroot/linuxconsole/ruby/web/htdocs/paper added to the repository |
From: James S. <jsi...@us...> - 2002-04-12 19:30:58
|
Update of /cvsroot/linuxconsole/ruby/web/htdocs/paper In directory usw-pr-cvs1:/tmp/cvs-serv25100 Added Files: contents.html contents.png fbdev.html index.html input.html intro.html next.png prev.png prev_g.png serial.html tty.html up.png up_g.png vt.html Log Message: Adding in paper for kernel summit so people can add what they like. --- NEW FILE: contents.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2K.1beta (1.48) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Contents</TITLE> <META NAME="description" CONTENT="Contents"> <META NAME="keywords" CONTENT="console_paper"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Generator" CONTENT="LaTeX2HTML v2K.1beta"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="console_paper.css"> <LINK REL="next" HREF="intro.html"> <LINK REL="previous" HREF="index.html"> <LINK REL="up" HREF="index.html"> <LINK REL="next" HREF="intro.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html51" HREF="intro.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html49" HREF="index.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html43" HREF="index.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <BR> <B> Next:</B> <A NAME="tex2html52" HREF="intro.html">Introduction</A> <B> Up:</B> <A NAME="tex2html50" HREF="index.html">Reconstructing of TTY layer for linux</A> <B> Previous:</B> <A NAME="tex2html44" HREF="index.html">Reconstructing of TTY layer for linux</A> <BR> <BR> <!--End of Navigation Panel--> <BR> <H2><A NAME="SECTION00010000000000000000"> Contents</A> </H2> <!--Table of Contents--> <UL> <LI><A NAME="tex2html21" HREF="intro.html">Introduction</A> <LI><A NAME="tex2html22" HREF="serial.html">New serial layer</A> <LI><A NAME="tex2html23" HREF="vt.html">Reworking Virtual Terminal Support</A> <UL> <LI><A NAME="tex2html24" HREF="input.html">Using the Input API</A> <LI><A NAME="tex2html25" HREF="fbdev.html">Restructing the framebuffer layer</A> </UL> <LI><A NAME="tex2html26" HREF="tty.html">Upper TTY layer management</A> <BR> <LI><A NAME="tex2html34" HREF="implement.html">Implementation: Ruby Dave Jones tree</A> <UL> <BR> <LI><A NAME="tex2html40" HREF="conclusion.html">Conclusion</A> <LI><A NAME="tex2html41" HREF="bio.html">Bibliography</A> </UL> <!--End of Table of Contents--> <P> <P> <P> <BR><HR> <ADDRESS> James Simmons 2002-4-5 </ADDRESS> </BODY> </HTML> --- NEW FILE: contents.png --- PNG iÇç¡T*Koï5b±»wÉô%©Ô±X']tw·m[ò'Oþ¤·÷/_þ±m½½^ sÅb¹íV87Y/ɬ¿Ñ°ó¿7×JJéòåë+¬!?tJÇHTWÛ2yæLåÇgðzGp8ÊX]Ípñ¢£®ÒÓsht ÉÉYZZp8ÊÈf×Y\\ÖüV«Í×;ÂêjFóÍN>Ù¼x<A ¤ªª\7.%H§³ÚÜýAFGZM³8å´´Û¬üBÂb1`³Øìϧ³§³\³#Yêë÷áóyðù.!I0:ÔîD"3ôõ¹ñù<X,¼Þa «µ5GªÏçÑp Mø|Z[ÄbËZ}Ñè2Ó×ç&Êr÷n.g[[UUåTUãóye ¯w7/mÔ¯aD·.ÝvBB(*ÂÌ"Iàñ¨È²Àf31>î#!ÕÔ2>îÃf3!˧ÓΫW˺|yeɲ »û CC¥Y(JCCο¢Å74ìÓå´XD£ï0% Ý =çðá:Tuááwñ##¿¡(ú§ß=ÀÎ&&&ÒßKó«j3ªÚÕjÔ|'ho¿ÛݯÅtuý°EÆïë µµÔÔTàv÷ã÷°k¿§¦ß?@MMÅÆ½U B«éСNÜî~Òéçøý´·_Öâkj*ðûôkk¾,Þ"K_JJ(P"Aý*T¹õÊLþ. --- NEW FILE: fbdev.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2K.1beta (1.48) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Restructing the framebuffer layer</TITLE> <META NAME="description" CONTENT="TTY and framebuffers"> <META NAME="keywords" CONTENT="console_paper"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Generator" CONTENT="LaTeX2HTML v2K.1beta"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="console_paper.css"> <LINK REL="next" HREF="tty.html"> <LINK REL="previous" HREF="input.html"> <LINK REL="up" HREF="input.html"> <LINK REL="next" HREF="implement.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html113" HREF="tty.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html109" HREF="input.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html103" HREF="input.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html111" HREF="contents.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <BR> <B> Next:</B> <A NAME="tex2html114" HREF="tty.html">Upper TTY layer management</A> <B> Up:</B> <A NAME="tex2html110" HREF="input.html">Using the Input API</A> <B> Previous:</B> <A NAME="tex2html104" HREF="input.html">Using the Input API</A>   <B> <A NAME="tex2html112" HREF="contents.html">Contents</A></B> <BR> <BR> <!--End of Navigation Panel--> <H2><A NAME="SECTION00031000000000000000"> Restructing the framebuffer layer</A> </H2> <P> <P> <BR><HR> <ADDRESS> James Simmons 2002-4-5 </ADDRESS> </BODY> </HTML> --- NEW FILE: index.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2K.1beta (1.48) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Reconstruction of the TTY layer for linux to deal with Embedded techology</TITLE> <META NAME="description" CONTENT="Reconstruction of the TTY layer for linux to deal with Embedded techology"> <META NAME="keywords" CONTENT="console_paper"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Generator" CONTENT="LaTeX2HTML v2K.1beta"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="console_paper.css"> <LINK REL="next" HREF="contents.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html18" HREF="contents.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_g.png"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev_g.png"> <A NAME="tex2html16" HREF="contents.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <BR> <B> Next:</B> <A NAME="tex2html19" HREF="contents.html">Contents</A>   <B> <A NAME="tex2html17" HREF="contents.html">Contents</A></B> <BR> <BR> <!--End of Navigation Panel--> <P> <P> <H1 ALIGN="CENTER">Reconstruction of the TTY layer for linux to deal with Embedded techology</H1> <P ALIGN="CENTER"><STRONG>James Simmons <BR> <TT>jsi...@tr...</TT></STRONG></P> <P ALIGN="CENTER"><STRONG> April 2002 <BR> <BR> <BR> <BR> <TT>http://linuxconsole.sf.net/</TT> </STRONG></P> <P> <BR> <P> <DIV ALIGN="CENTER"> <B>Acknowledgement</B> </DIV> <P> I would like to acknowledge my employer Transvirtual Technologies Inc, who granted me time to work on this project. Special thanks goes to Vojtech Buxton for his valuable assistance. <P> <BR> <BR> <P> <P> <BR> <P> <DIV ALIGN="CENTER"> <B>Licence</B> </DIV> <P> This paper is copyright 2002 James Simmons and is released under the terms of the GNU General Public Licence, a copy of which is distributed with the source for this document. <P> All trademarks and software are the property of their respective owners. <P> <P> <DIV ALIGN="CENTER"> <B>Presented</B> </DIV> <P> <I>Ottowa Linux Symposium</I> <BR> 25th - 28th July 2002 <BR> Ottowa Congress Centre <BR> Ottowa, Ontario, Canada <P> <P> <H3>Abstract:</H3> <DIV> <P> Linux continues to be ported to different types of hardware devices. As it expands into different hardware sectors we see that these different sectors have very different needs and are very different from the classical PC. The initial Linux kernel code was designed on the standard PC which had a large influence on the code design. As Linux appears on new types of hardware devices we begain to see limitations to some of the central designs. As Linux kept evolving and expanding to new platforms hardware was encountered that didn't fit the "PC" model. So instead often a extra interface of some kind either userland or in kernel space was developed to compensate. <P> One of the major areas of the kernel affected by this is the tty layer. Here we we witness things like the classical definition for a virtual terminal starting to break down and the handling of complex human input devices addressed by the tty layer. Also for embedded devices size is critical especially when dealing with boot loaders which often make certain assumptions or place certain limitations. Modular is also lacking. Often with modern embedded devices we have removable pieces of hardware including things like keyboards which where in a classic PC sense critical to have. <P> A major way of rethinking was needed to rework the tty layer. That way was to reverse the flow of developement. The current way of thinking is expand the tty features with new device interfaces that influence the behavior of the TTY. A example of this is for a framebuffer console we use a /dev/fb interface to resize a tty device. The proper method to resize would be to use a standard that already exist i.e the POSIX tty ioctl call TIOCSWINSZ. <P> </DIV> <P> <P> <BR><HR> <!--Table of Child-Links--> <A NAME="CHILD_LINKS"></A> <UL> <LI><A NAME="tex2html20" HREF="contents.html">Contents</A> <LI><A NAME="tex2html21" HREF="intro.html">Introduction</A> <LI><A NAME="tex2html22" HREF="serial.html">New serial layer</A> <LI><A NAME="tex2html23" HREF="vt.html">Reworking Virtual Terminal Support</A> <UL> <LI><A NAME="tex2html24" HREF="input.html">Using the Input API</A> <LI><A NAME="tex2html25" HREF="fbdev.html">Restructing the framebuffer layer</A> </UL> <LI><A NAME="tex2html26" HREF="tty.html">Upper TTY layer management</A> <BR> <LI><A NAME="tex2html34" HREF="implement.html">Implementation: Ruby Dave Jones tree</A> <UL> <BR> <LI><A NAME="tex2html40" HREF="conclusion.html">Conclusion</A> <LI><A NAME="tex2html41" HREF="bio.html">Bibliography</A> <!--End of Table of Child-Links--> <HR> <!--Navigation Panel--> <A NAME="tex2html18" HREF="contents.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_g.png"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev_g.png"> <A NAME="tex2html16" HREF="contents.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <BR> <B> Next:</B> <A NAME="tex2html19" HREF="contents.html">Contents</A>   <B> <A NAME="tex2html17" HREF="contents.html">Contents</A></B> <!--End of Navigation Panel--> <ADDRESS> James Simmons 2002-4-5 </ADDRESS> </BODY> </HTML> --- NEW FILE: input.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2K.1beta (1.48) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Restructing the framebuffer layer</TITLE> <META NAME="description" CONTENT="TTY and framebuffers"> <META NAME="keywords" CONTENT="console_paper"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Generator" CONTENT="LaTeX2HTML v2K.1beta"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="console_paper.css"> <LINK REL="next" HREF="tty.html"> <LINK REL="previous" HREF="input.html"> <LINK REL="up" HREF="input.html"> <LINK REL="next" HREF="implement.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html113" HREF="tty.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html109" HREF="input.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html103" HREF="input.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html111" HREF="contents.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <BR> <B> Next:</B> <A NAME="tex2html114" HREF="tty.html">Upper TTY layer management</A> <B> Up:</B> <A NAME="tex2html110" HREF="input.html">Using the Input API</A> <B> Previous:</B> <A NAME="tex2html104" HREF="input.html">Using the Input API</A>   <B> <A NAME="tex2html112" HREF="contents.html">Contents</A></B> <BR> <BR> <!--End of Navigation Panel--> <H2><A NAME="SECTION00031000000000000000"> Restructing the framebuffer layer</A> </H2> <P> <P> <BR><HR> <ADDRESS> James Simmons 2002-4-5 </ADDRESS> </BODY> </HTML> --- NEW FILE: intro.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2K.1beta (1.48) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Introduction</TITLE> <META NAME="description" CONTENT="Introduction"> <META NAME="keywords" CONTENT="console_paper"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Generator" CONTENT="LaTeX2HTML v2K.1beta"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="console_paper.css"> <LINK REL="next" HREF="node3.html"> <LINK REL="previous" HREF="intro.html"> <LINK REL="up" HREF="console_paper.html"> <LINK REL="next" HREF="node3.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html85" HREF="node3.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html81" HREF="ss_paper.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html75" HREF="intro.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html83" HREF="intro.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <BR> <B> Next:</B> <A NAME="tex2html86" HREF="node3.html">Using the Input API</A> <B> Up:</B> <A NAME="tex2html82" HREF="console_paper.html">New Linux Console System </A> <B> Previous:</B> <A NAME="tex2html76" HREF="intro.html">Contents</A>   <B> <A NAME="tex2html84" HREF="intro.html">Contents</A></B> <BR> <BR> <!--End of Navigation Panel--> <H1><A NAME="SECTION00020000000000000000"> Introduction</A> </H1> <P> Ten years when Linus was written it was on a intel machine with basic VGA support. Linus like other UNIX based operation systems developed a concept of a virtual terminal. In the old mainframe days the only way to access the mainframe was via a TTY (terminal teletype) device. They basically where a monochrome, stylish green, display and a keyboard together that connected to the mainframe by a serial line. With todays PC we still have a monitor and a keyboard attached. So Linux simulates these type of TTYs. The flexiablity of POSIX TTYs allows it to be applied to other types of hardware such as modems. <P> As you can see the TTY layer covers many types of pieces of hardware. Because it does cover so many types this presents very difficult issues. What we have seen is no clear boundaries between the various types of devices. You see things pieces of tty/console code sprinckled through out various low level drivers. This makes driver writing more complex than it needs to be. <P> The second issue is the new types of hardware Linux has encountered. For example is the Compaq iPAQ. It has a framebuffer display but no permenant keyboard. Having a built in VT makes no sense in this case. Having console code inside the framebuffer driver makes no sense. Have a pseudo keyboard make even less sense. <P> So the first step is to rework the lower device layers. Also in the process we form a uniform api for these layers. For various input devices we find we are lacking a standard api. So for one part of the project we begain the task of porting every human input device over to a universal api. The api choosen was the input api implemented for the USB layer. This migrates the VT code for keyboard handling from a PC centeric keyboard design to a more device indepedent format. <P> The second layer to rework is the framebuffer layer. The basic goal was to removal all the console code out of the lower level drivers and make the framebuffer layer be able to stand on it own to handle PDA type devices. <P> The final layer is the serial layer. The final goal is to model this layer after the parport layer. Here we with have device interface independent layer and have device interfaces register with the core code. The reason for this apporach is to deal with serial based input devices. Some platforms have serial keyboards and it is unacceptable to have to run a unserland application just to be able to use it via the tty layer. Again their is great code redundecy. <P> The final change was to the console layer itself. The main goal was to move away from the VGA text mode centric design. Also another goal was to allow the console and tty system more flexiable as I will point out later in this paper. <P> This paper will examine designing and implementing a new tty layer that is smaller, lighter weight and much more flexiable than the current system. <P> <HR> <!--Navigation Panel--> <A NAME="tex2html85" HREF="node3.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html81" HREF="ss_paper.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html75" HREF="intro.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html83" HREF="intro.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <BR> <B> Next:</B> <A NAME="tex2html86" HREF="node3.html">Using the Input API</A> <B> Up:</B> <A NAME="tex2html82" HREF="console_paper.html">New Linux Console System</A> <B> Previous:</B> <A NAME="tex2html76" HREF="intro.html">Contents</A>   <B> <A NAME="tex2html84" HREF="intro.html">Contents</A></B> <!--End of Navigation Panel--> <ADDRESS> jsimmons 2002-4-4 </ADDRESS> </BODY> </HTML> --- NEW FILE: next.png --- PNG Ñ¿¿ÿ¤[Ý««/´ÚÇ»»Ë,« --- NEW FILE: prev.png --- PNG ¯_¼øÝá°üêàâÅÏÎùDó¬¬üòèѯn÷àË81¼ó[ ùk ÑÝÒ{1è=Ò°ÛÍÔ39975u-]ºÆ²Æx<§_ºtéÝn^YùÙídY#õçråÉɹ|~=+Çã©þþiP<ºwoÑn7×juÐíÛÝn¦ùóùõbV¿©V«wu}¨/Ôfj ]M$65$AAÃ$©`Pp8Ì@"±É0`P¨ÕÔ7¿FW<öz/ÌÍEOR|4ºzùòç --- NEW FILE: prev_g.png --- PNG ¥¬P2¤Ú#°½7Ñe¨=¢¥Òhyú-Ôr5q³Ò8~=+¼ñìq»¹'Ó¼¨=¢Ny<Ö õ!ÃnîÑïjâæH0¾~¿æEÿ JåÅ/¾_õô[Zsa]z.â°Òü#Á¸!P©5g¸£ÔÖCõD{L- 25Ñ0^xVB SØ^fêù\k~üuúú²pÙi;?äýüÆíÑÐ ÅÏ//ö --- NEW FILE: serial.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2K.1beta (1.48) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Restructing the framebuffer layer</TITLE> <META NAME="description" CONTENT="TTY and framebuffers"> <META NAME="keywords" CONTENT="console_paper"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Generator" CONTENT="LaTeX2HTML v2K.1beta"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="console_paper.css"> <LINK REL="next" HREF="tty.html"> <LINK REL="previous" HREF="input.html"> <LINK REL="up" HREF="input.html"> <LINK REL="next" HREF="implement.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html113" HREF="tty.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html109" HREF="input.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html103" HREF="input.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html111" HREF="contents.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <BR> <B> Next:</B> <A NAME="tex2html114" HREF="tty.html">Upper TTY layer management</A> <B> Up:</B> <A NAME="tex2html110" HREF="input.html">Using the Input API</A> <B> Previous:</B> <A NAME="tex2html104" HREF="input.html">Using the Input API</A>   <B> <A NAME="tex2html112" HREF="contents.html">Contents</A></B> <BR> <BR> <!--End of Navigation Panel--> <H2><A NAME="SECTION00031000000000000000"> Restructing the framebuffer layer</A> </H2> <P> <P> <BR><HR> <ADDRESS> James Simmons 2002-4-5 </ADDRESS> </BODY> </HTML> --- NEW FILE: tty.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2K.1beta (1.48) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Restructing the framebuffer layer</TITLE> <META NAME="description" CONTENT="TTY and framebuffers"> <META NAME="keywords" CONTENT="console_paper"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Generator" CONTENT="LaTeX2HTML v2K.1beta"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="console_paper.css"> <LINK REL="next" HREF="tty.html"> <LINK REL="previous" HREF="input.html"> <LINK REL="up" HREF="input.html"> <LINK REL="next" HREF="implement.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html113" HREF="tty.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html109" HREF="input.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html103" HREF="input.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html111" HREF="contents.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <BR> <B> Next:</B> <A NAME="tex2html114" HREF="tty.html">Upper TTY layer management</A> <B> Up:</B> <A NAME="tex2html110" HREF="input.html">Using the Input API</A> <B> Previous:</B> <A NAME="tex2html104" HREF="input.html">Using the Input API</A>   <B> <A NAME="tex2html112" HREF="contents.html">Contents</A></B> <BR> <BR> <!--End of Navigation Panel--> <H2><A NAME="SECTION00031000000000000000"> Restructing the framebuffer layer</A> </H2> <P> <P> <BR><HR> <ADDRESS> James Simmons 2002-4-5 </ADDRESS> </BODY> </HTML> --- NEW FILE: up.png --- PNG õ g{II]¸pYäÕ«·/^¼16Öp\¸pCJJÎEOƾ¾ÆÆZ-[200¤§Â=~îܵ鯯ZgÏ^ÛºõàõpC?ÿϽºyó3WC¸éé¡ii¡RRиKKkðõu8{ö*DÁ-SµÁòêÕ'2yJJ£#uJ¬qE¡qL¸t1~þü}ÄÆ --- NEW FILE: up_g.png --- PNG õ --- NEW FILE: vt.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2K.1beta (1.48) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Restructing the framebuffer layer</TITLE> <META NAME="description" CONTENT="TTY and framebuffers"> <META NAME="keywords" CONTENT="console_paper"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Generator" CONTENT="LaTeX2HTML v2K.1beta"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="console_paper.css"> <LINK REL="next" HREF="tty.html"> <LINK REL="previous" HREF="input.html"> <LINK REL="up" HREF="input.html"> <LINK REL="next" HREF="implement.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html113" HREF="tty.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html109" HREF="input.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html103" HREF="input.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html111" HREF="contents.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <BR> <B> Next:</B> <A NAME="tex2html114" HREF="tty.html">Upper TTY layer management</A> <B> Up:</B> <A NAME="tex2html110" HREF="input.html">Using the Input API</A> <B> Previous:</B> <A NAME="tex2html104" HREF="input.html">Using the Input API</A>   <B> <A NAME="tex2html112" HREF="contents.html">Contents</A></B> <BR> <BR> <!--End of Navigation Panel--> <H2><A NAME="SECTION00031000000000000000"> Restructing the framebuffer layer</A> </H2> <P> <P> <BR><HR> <ADDRESS> James Simmons 2002-4-5 </ADDRESS> </BODY> </HTML> |
From: James S. <jsi...@us...> - 2002-04-12 18:08:13
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv6258 Modified Files: Config.in Makefile Log Message: Readded dummy console again. For testing purpose and X window handling. Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/Config.in,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- Config.in 14 Mar 2002 22:32:23 -0000 1.59 +++ Config.in 12 Apr 2002 18:08:09 -0000 1.60 @@ -260,6 +260,7 @@ if [ "$CONFIG_PCI" = "y" ]; then tristate 'NVIDIA hardware text console' CONFIG_NVIDIA_CONSOLE fi + tristate 'Dummy consolesupport' CONFIG_DUMMY_CONSOLE if [ "$CONFIG_FB" = "y" ]; then bool 'Support for frame buffer console' CONFIG_FRAMEBUFFER_CONSOLE if [ "$CONFIG_FRAMEBUFFER_CONSOLE" = "y" ]; then Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/Makefile,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- Makefile 23 Nov 2001 04:10:15 -0000 1.44 +++ Makefile 12 Apr 2002 18:08:09 -0000 1.45 @@ -22,6 +22,7 @@ obj-$(CONFIG_MDA_CONSOLE) += mdacon.o obj-$(CONFIG_NVIDIA_CONSOLE) += nvvgacon.o obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon.o +obj-$(CONFIG_DUMMY_CONSOLE) += dummycon.o subdir-$(CONFIG_FONTS) += fonts ifeq ($(CONFIG_FONTS),y) |
From: James S. <jsi...@us...> - 2002-04-12 18:06:21
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv5701 Added Files: dummycon.c Log Message: Readded dummy console again. For testing purpose and X window handling. |
From: johann d. <jd...@us...> - 2002-04-12 17:36:07
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/usb In directory usw-pr-cvs1:/tmp/cvs-serv28827/drivers/usb Modified Files: Config.help Config.in Makefile hid-ff.c hid-input.c Added Files: hid-lgff.c Log Message: PID additions by Rodrigo Damazio. Moved Logitech-specific code out of hid-ff.c to hid-lgff.c --- NEW FILE: hid-lgff.c --- /* * $$ * * Force feedback support for hid-compliant devices from Logitech. * * Copyright (c) 2002 Johann Deneux */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Should you need to contact me, the author, you can do so by * e-mail - mail your message to <de...@if...> */ #include <linux/input.h> #include <linux/sched.h> #define DEBUG #include <linux/usb.h> #include <linux/circ_buf.h> #include "hid.h" #define RUN_AT(t) (jiffies + (t)) /* Transmition state */ #define XMIT_RUNNING 0 /* Effect status */ #define EFFECT_STARTED 0 /* Effect is going to play after some time (ff_replay.delay) */ #define EFFECT_PLAYING 1 /* Effect is being played */ #define EFFECT_USED 2 /* Check that the current process can access an effect */ #define CHECK_OWNERSHIP(effect) (current->pid == 0 \ || effect.owner == current->pid) /* **************************************************************************/ /* Implements the protocol used by the Logitech WingMan Cordless rumble pad */ /* **************************************************************************/ #ifdef CONFIG_LOGITECH_RUMBLE #define LGFF_CHECK_OWNERSHIP(i, l) \ (i>=0 && i<LGFF_EFFECTS \ && test_bit(EFFECT_USED, l->effects[i].flags) \ && CHECK_OWNERSHIP(l->effects[i])) #define LGFF_BUFFER_SIZE 64 #define LGFF_EFFECTS 8 struct lgff_magnitudes { unsigned char left; unsigned char right; }; struct lgff_effect { int id; struct hid_ff_logitech* lgff; pid_t owner; unsigned char left; /* Magnitude of vibration for left motor */ unsigned char right; /* Magnitude of vibration for right motor */ struct ff_replay replay; unsigned int count; /* Number of times to play */ struct timer_list timer; unsigned long flags[1]; }; struct hid_ff_logitech { struct hid_device* hid; struct urb* urbffout; /* Output URB used to send ff commands */ struct usb_ctrlrequest ffcr; /* ff commands use control URBs */ char buf[8]; spinlock_t xmit_lock; unsigned int xmit_head, xmit_tail; struct lgff_magnitudes xmit_data[LGFF_BUFFER_SIZE]; long xmit_flags[1]; struct lgff_effect effects[LGFF_EFFECTS]; spinlock_t lock; /* device-level lock. Having locks on a per-effect basis could be nice, but isn't really necessary */ }; static void hid_lgff_ctrl_out(struct urb *urb); static void hid_lgff_exit(struct hid_device* hid); static int hid_lgff_event(struct hid_device *hid, struct input_dev *input, unsigned int type, unsigned int code, int value); static void hid_lgff_make_rumble(struct hid_device* hid); static int hid_lgff_flush(struct input_dev *input, struct file *file); static int hid_lgff_upload_effect(struct input_dev *input, struct ff_effect *effect); static int hid_lgff_erase(struct input_dev *input, int id); static void hid_lgff_ctrl_playback(struct hid_device* hid, struct lgff_effect*, int play); static void hid_lgff_timer(unsigned long timer_data); int hid_lgff_init(struct hid_device* hid) { struct hid_ff_logitech *private; int i; /* Private data */ hid->ff_private = kmalloc(sizeof(struct hid_ff_logitech), GFP_KERNEL); private = hid->ff_private; if (!private) return -1; memset(private, 0, sizeof(struct hid_ff_logitech)); hid->ff_private = private; private->hid = hid; spin_lock_init(&private->lock); spin_lock_init(&private->xmit_lock); private->buf[0] = 0x03; private->buf[1] = 0x42; for (i=0; i<LGFF_EFFECTS; ++i) { struct lgff_effect* effect = &private->effects[i]; struct timer_list* timer = &effect->timer; init_timer(timer); effect->id = i; effect->lgff = private; timer->data = (unsigned long)effect; timer->function = hid_lgff_timer; } /* Event and exit callbacks */ hid->ff_exit = hid_lgff_exit; hid->ff_event = hid_lgff_event; /* USB init */ if (!(private->urbffout = usb_alloc_urb(0, GFP_KERNEL))) { kfree(hid->ff_private); return -1; } usb_fill_control_urb(private->urbffout, hid->dev, 0, (void*) &private->ffcr, private->buf, 8, hid_lgff_ctrl_out, hid); dbg("Created ff output control urb"); /* Input init */ hid->input.upload_effect = hid_lgff_upload_effect; hid->input.flush = hid_lgff_flush; set_bit(FF_RUMBLE, hid->input.ffbit); set_bit(EV_FF, hid->input.evbit); hid->input.ff_effects_max = LGFF_EFFECTS; printk(KERN_INFO "Force feedback for Logitech rumble devices by Johann Deneux <de...@if...>\n"); return 0; } static void hid_lgff_exit(struct hid_device* hid) { struct hid_ff_logitech *lgff = hid->ff_private; if (lgff->urbffout) { usb_unlink_urb(lgff->urbffout); usb_free_urb(lgff->urbffout); } } static int hid_lgff_event(struct hid_device *hid, struct input_dev* input, unsigned int type, unsigned int code, int value) { struct hid_ff_logitech *lgff = hid->ff_private; struct lgff_effect *effect = lgff->effects + code; unsigned long flags; if (type != EV_FF) return -EINVAL; if (!LGFF_CHECK_OWNERSHIP(code, lgff)) return -EACCES; if (value < 0) return -EINVAL; spin_lock_irqsave(&lgff->lock, flags); if (value > 0) { if (test_bit(EFFECT_STARTED, effect->flags)) { spin_unlock_irqrestore(&lgff->lock, flags); return -EBUSY; } if (test_bit(EFFECT_PLAYING, effect->flags)) { spin_unlock_irqrestore(&lgff->lock, flags); return -EBUSY; } effect->count = value; if (effect->replay.delay) { set_bit(EFFECT_STARTED, effect->flags); effect->timer.expires = RUN_AT(effect->replay.delay * HZ / 1000); } else { hid_lgff_ctrl_playback(hid, effect, value); effect->timer.expires = RUN_AT(effect->replay.length * HZ / 1000); } add_timer(&effect->timer); } else { /* value == 0 */ if (test_and_clear_bit(EFFECT_STARTED, effect->flags)) { del_timer(&effect->timer); } else if (test_and_clear_bit(EFFECT_PLAYING, effect->flags)) { del_timer(&effect->timer); hid_lgff_ctrl_playback(hid, effect, value); } if (test_bit(EFFECT_PLAYING, effect->flags)) warn("Effect %d still playing", code); } spin_unlock_irqrestore(&lgff->lock, flags); return 0; } /* Erase all effects this process owns */ static int hid_lgff_flush(struct input_dev *dev, struct file *file) { struct hid_device *hid = dev->private; struct hid_ff_logitech *lgff = hid->ff_private; int i; for (i=0; i<dev->ff_effects_max; ++i) { /*NOTE: no need to lock here. The only times EFFECT_USED is modified is when effects are uploaded or when an effect is erased. But a process cannot close its dev/input/eventX fd and perform ioctls on the same fd all at the same time */ if ( current->pid == lgff->effects[i].owner && test_bit(EFFECT_USED, lgff->effects[i].flags)) { if (hid_lgff_erase(dev, i)) warn("erase effect %d failed", i); } } return 0; } static int hid_lgff_erase(struct input_dev *dev, int id) { struct hid_device *hid = dev->private; struct hid_ff_logitech *lgff = hid->ff_private; unsigned long flags; if (!LGFF_CHECK_OWNERSHIP(id, lgff)) return -EACCES; spin_lock_irqsave(&lgff->lock, flags); hid_lgff_ctrl_playback(hid, lgff->effects + id, 0); lgff->effects[id].flags[0] = 0; spin_unlock_irqrestore(&lgff->lock, flags); return 0; } static int hid_lgff_upload_effect(struct input_dev* input, struct ff_effect* effect) { struct hid_device *hid = input->private; struct hid_ff_logitech *lgff = hid->ff_private; struct lgff_effect new; int id; unsigned long flags; dbg("ioctl rumble"); if (!test_bit(effect->type, input->ffbit)) return -EINVAL; if (effect->type != FF_RUMBLE) return -EINVAL; spin_lock_irqsave(&lgff->lock, flags); if (effect->id == -1) { int i; for (i=0; i<LGFF_EFFECTS && test_bit(EFFECT_USED, lgff->effects[i].flags); ++i); if (i >= LGFF_EFFECTS) { spin_unlock_irqrestore(&lgff->lock, flags); return -ENOSPC; } effect->id = i; lgff->effects[i].owner = current->pid; lgff->effects[i].flags[0] = 0; set_bit(EFFECT_USED, lgff->effects[i].flags); } else if (!LGFF_CHECK_OWNERSHIP(effect->id, lgff)) { spin_unlock_irqrestore(&lgff->lock, flags); return -EACCES; } id = effect->id; new = lgff->effects[id]; new.right = effect->u.rumble.strong_magnitude >> 9; new.left = effect->u.rumble.weak_magnitude >> 9; new.replay = effect->replay; /* If we updated an effect that was being played, we need to remake the rumble effect */ if (test_bit(EFFECT_STARTED, lgff->effects[id].flags) || test_bit(EFFECT_STARTED, lgff->effects[id].flags)) { /* Changing replay parameters is not allowed (for the time being) */ if (new.replay.delay != lgff->effects[id].replay.delay || new.replay.length != lgff->effects[id].replay.length) { spin_unlock_irqrestore(&lgff->lock, flags); return -ENOSYS; } lgff->effects[id] = new; hid_lgff_make_rumble(hid); } else { lgff->effects[id] = new; } spin_unlock_irqrestore(&lgff->lock, flags); return 0; } static void hid_lgff_xmit(struct hid_device* hid) { struct hid_ff_logitech *lgff = hid->ff_private; int err; int tail; unsigned long flags; spin_lock_irqsave(&lgff->xmit_lock, flags); tail = lgff->xmit_tail; if (lgff->xmit_head == tail) { clear_bit(XMIT_RUNNING, lgff->xmit_flags); spin_unlock_irqrestore(&lgff->xmit_lock, flags); return; } lgff->buf[3] = lgff->xmit_data[tail].left; lgff->buf[4] = lgff->xmit_data[tail].right; tail++; tail &= LGFF_BUFFER_SIZE -1; lgff->xmit_tail = tail; spin_unlock_irqrestore(&lgff->xmit_lock, flags); lgff->urbffout->pipe = usb_sndctrlpipe(hid->dev, 0); lgff->ffcr.bRequestType = USB_TYPE_CLASS | USB_DIR_OUT | USB_RECIP_INTERFACE; lgff->urbffout->transfer_buffer_length = lgff->ffcr.wLength = 8; lgff->ffcr.bRequest = 9; lgff->ffcr.wValue = 0x0203; /*NOTE: Potential problem with little/big endian */ lgff->ffcr.wIndex = 0; lgff->urbffout->dev = hid->dev; if ((err=usb_submit_urb(lgff->urbffout, GFP_ATOMIC))) warn("usb_submit_urb returned %d", err); } static void hid_lgff_make_rumble(struct hid_device* hid) { struct hid_ff_logitech *lgff = hid->ff_private; int left = 0, right = 0; int i; int head, tail; unsigned long flags; for (i=0; i<LGFF_EFFECTS; ++i) { if (test_bit(EFFECT_USED, lgff->effects[i].flags) && test_bit(EFFECT_PLAYING, lgff->effects[i].flags)) { left += lgff->effects[i].left; right += lgff->effects[i].right; } } spin_lock_irqsave(&lgff->xmit_lock, flags); head = lgff->xmit_head; tail = lgff->xmit_tail; if (CIRC_SPACE(head, tail, LGFF_BUFFER_SIZE) < 1) { warn("not enough space in xmit buffer to send new packet"); spin_unlock_irqrestore(&lgff->xmit_lock, flags); return; } lgff->xmit_data[head].left = left > 0x7f ? 0x7f : left; lgff->xmit_data[head].right = right > 0x7f ? 0x7f : right; head++; head &= LGFF_BUFFER_SIZE -1; lgff->xmit_head = head; if (test_and_set_bit(XMIT_RUNNING, lgff->xmit_flags)) spin_unlock_irqrestore(&lgff->xmit_lock, flags); else { spin_unlock_irqrestore(&lgff->xmit_lock, flags); hid_lgff_xmit(hid); } } static void hid_lgff_ctrl_out(struct urb *urb) { struct hid_device *hid = urb->context; if (urb->status) warn("hid_irq_ffout status %d received", urb->status); hid_lgff_xmit(hid); } /* Lock must be held by caller */ static void hid_lgff_ctrl_playback(struct hid_device *hid, struct lgff_effect *effect, int play) { if (play) { set_bit(EFFECT_PLAYING, effect->flags); hid_lgff_make_rumble(hid); } else { clear_bit(EFFECT_PLAYING, effect->flags); hid_lgff_make_rumble(hid); } } static void hid_lgff_timer(unsigned long timer_data) { struct lgff_effect *effect = (struct lgff_effect*) timer_data; struct hid_ff_logitech* lgff = effect->lgff; int id = effect->id; unsigned long flags; dbg("in hid_lgff_timer"); if (id < 0 || id >= LGFF_EFFECTS) { warn("Bad effect id %d", id); return; } effect = lgff->effects + id; spin_lock_irqsave(&lgff->lock, flags); if (!test_bit(EFFECT_USED, effect->flags)) { warn("Unused effect id %d", id); } else if (test_bit(EFFECT_STARTED, effect->flags)) { clear_bit(EFFECT_STARTED, effect->flags); set_bit(EFFECT_PLAYING, effect->flags); hid_lgff_ctrl_playback(lgff->hid, effect, 1); effect->timer.expires = RUN_AT(effect->replay.length * HZ / 1000); add_timer(&effect->timer); dbg("Effect %d starts playing", id); } else if (test_bit(EFFECT_PLAYING, effect->flags)) { clear_bit(EFFECT_PLAYING, effect->flags); hid_lgff_ctrl_playback(lgff->hid, effect, 0); if (--effect->count > 0) { /*TODO: check that replay.delay is non-null */ set_bit(EFFECT_STARTED, effect->flags); effect->timer.expires = RUN_AT(effect->replay.delay * HZ / 1000); add_timer(&effect->timer); dbg("Effect %d restarted", id); } else { dbg("Effect %d stopped", id); } } else { warn("Effect %d is not started nor playing", id); } spin_unlock_irqrestore(&lgff->lock, flags); } #endif /* CONFIG_LOGITECH_RUMBLE */ Index: Config.help =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/Config.help,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Config.help 22 Mar 2002 20:13:58 -0000 1.3 +++ Config.help 12 Apr 2002 17:36:03 -0000 1.4 @@ -117,6 +117,11 @@ want to enable force feedback. Note: if you say N here, this device will still be supported, but without force feedback. +CONFIG_HID_PID + Say Y yes if you have a PID-compliant joystick and wish to enable force + feedback for it. The Microsoft Sidewinder Force Feedback 2 is one such + device. + CONFIG_USB_HIDDEV Say Y here if you want to support HID devices (from the USB specification standpoint) that aren't strictly user interface Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/Config.in,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Config.in 22 Mar 2002 20:13:58 -0000 1.22 +++ Config.in 12 Apr 2002 17:36:03 -0000 1.23 @@ -59,9 +59,10 @@ dep_tristate ' USB HIDBP Mouse (basic) support' CONFIG_USB_MOUSE $CONFIG_USB $CONFIG_INPUT fi dep_tristate ' Wacom Intuos/Graphire tablet support' CONFIG_USB_WACOM $CONFIG_USB $CONFIG_INPUT - dep_tristate ' Griffin Technology PowerMate support' CONFIG_USB_POWERMATE$CONFIG_USB $CONFIG_INPUT + dep_tristate ' Griffin Technology PowerMate support' CONFIG_USB_POWERMATE $CONFIG_USB $CONFIG_INPUT dep_mbool ' Force feedback support' CONFIG_HID_FF $CONFIG_USB_HID - dep_mbool ' Logitech RumblePad support' CONFIG_LOGITECH_RUMBLE $CONFIG_USB_HID $CONFIG_HID_FF + dep_mbool ' Logitech RumblePad support' CONFIG_LOGITECH_RUMBLE $CONFIG_USB_HID $CONFIG_HID_FF + dep_mbool ' PID Devices' CONFIG_HID_PID $CONFIG_USB_HID $CONFIG_HID_FF fi comment 'USB Imaging devices' Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/Makefile,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Makefile 22 Mar 2002 20:13:58 -0000 1.17 +++ Makefile 12 Apr 2002 17:36:03 -0000 1.18 @@ -30,7 +30,15 @@ hid-objs += hiddev.o endif +ifeq ($(CONFIG_HID_PID),y) + hid-objs += pid.o +endif + ifeq ($(CONFIG_LOGITECH_RUMBLE),y) + hid-objs += hid-lgff.o +endif + +ifeq ($(CONFIG_HID_FF),y) hid-objs += hid-ff.o endif Index: hid-ff.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/hid-ff.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- hid-ff.c 26 Mar 2002 21:41:12 -0000 1.9 +++ hid-ff.c 12 Apr 2002 17:36:03 -0000 1.10 @@ -28,33 +28,15 @@ */ #include <linux/input.h> -#include <linux/sched.h> #define DEBUG #include <linux/usb.h> -#include <linux/circ_buf.h> - #include "hid.h" -#define RUN_AT(t) (jiffies + (t)) - -/* Transmition state */ -#define XMIT_RUNNING 0 - -/* Effect status */ -#define EFFECT_STARTED 0 /* Effect is going to play after some time - (ff_replay.delay) */ -#define EFFECT_PLAYING 1 /* Effect is being played */ -#define EFFECT_USED 2 - -/* Check that the current process can access an effect */ -#define CHECK_OWNERSHIP(effect) (current->pid == 0 \ - || effect.owner == current->pid) - - /* Drivers' initializing functions */ -static int hid_lgff_init(struct hid_device* hid); +extern int hid_lgff_init(struct hid_device* hid); +extern int hid_pid_init(struct hid_device* hid); struct hid_ff_initializer { __u16 idVendor; @@ -66,6 +48,9 @@ #ifdef CONFIG_LOGITECH_RUMBLE {0x46d, 0xc211, hid_lgff_init}, #endif +#ifdef CONFIG_HID_PID + {0x45e, 0x001b, hid_pid_init}, +#endif {0, 0, NULL} /* Terminating entry */ }; @@ -91,453 +76,3 @@ return init? init->init(hid) : -ENOSYS; } - - - - -/* **************************************************************************/ -/* Implements the protocol used by the Logitech WingMan Cordless rumble pad */ -/* **************************************************************************/ - -#ifdef CONFIG_LOGITECH_RUMBLE - -#define LGFF_CHECK_OWNERSHIP(i, l) \ - (i>=0 && i<LGFF_EFFECTS \ - && test_bit(EFFECT_USED, l->effects[i].flags) \ - && CHECK_OWNERSHIP(l->effects[i])) - -#define LGFF_BUFFER_SIZE 64 -#define LGFF_EFFECTS 8 - -struct lgff_magnitudes { - unsigned char left; - unsigned char right; -}; - -struct lgff_effect { - int id; - struct hid_ff_logitech* lgff; - - pid_t owner; - unsigned char left; /* Magnitude of vibration for left motor */ - unsigned char right; /* Magnitude of vibration for right motor */ - struct ff_replay replay; - unsigned int count; /* Number of times to play */ - struct timer_list timer; - unsigned long flags[1]; -}; - -struct hid_ff_logitech { - struct hid_device* hid; - - struct urb* urbffout; /* Output URB used to send ff commands */ - struct usb_ctrlrequest ffcr; /* ff commands use control URBs */ - char buf[8]; - - spinlock_t xmit_lock; - unsigned int xmit_head, xmit_tail; - struct lgff_magnitudes xmit_data[LGFF_BUFFER_SIZE]; - long xmit_flags[1]; - - struct lgff_effect effects[LGFF_EFFECTS]; - spinlock_t lock; /* device-level lock. Having locks on - a per-effect basis could be nice, but - isn't really necessary */ -}; - -static void hid_lgff_ctrl_out(struct urb *urb); -static void hid_lgff_exit(struct hid_device* hid); -static int hid_lgff_event(struct hid_device *hid, struct input_dev *input, - unsigned int type, unsigned int code, int value); -static void hid_lgff_make_rumble(struct hid_device* hid); - -static int hid_lgff_flush(struct input_dev *input, struct file *file); -static int hid_lgff_upload_effect(struct input_dev *input, - struct ff_effect *effect); -static int hid_lgff_erase(struct input_dev *input, int id); -static void hid_lgff_ctrl_playback(struct hid_device* hid, struct lgff_effect*, - int play); -static void hid_lgff_timer(unsigned long timer_data); - - -static int hid_lgff_init(struct hid_device* hid) -{ - struct hid_ff_logitech *private; - int i; - - /* Private data */ - hid->ff_private = kmalloc(sizeof(struct hid_ff_logitech), GFP_KERNEL); - private = hid->ff_private; - if (!private) return -1; - - memset(private, 0, sizeof(struct hid_ff_logitech)); - - hid->ff_private = private; - - private->hid = hid; - spin_lock_init(&private->lock); - spin_lock_init(&private->xmit_lock); - - private->buf[0] = 0x03; - private->buf[1] = 0x42; - - for (i=0; i<LGFF_EFFECTS; ++i) { - struct lgff_effect* effect = &private->effects[i]; - struct timer_list* timer = &effect->timer; - - init_timer(timer); - effect->id = i; - effect->lgff = private; - timer->data = (unsigned long)effect; - timer->function = hid_lgff_timer; - } - - /* Event and exit callbacks */ - hid->ff_exit = hid_lgff_exit; - hid->ff_event = hid_lgff_event; - - /* USB init */ - if (!(private->urbffout = usb_alloc_urb(0, GFP_KERNEL))) { - kfree(hid->ff_private); - return -1; - } - - usb_fill_control_urb(private->urbffout, hid->dev, 0, - (void*) &private->ffcr, private->buf, 8, - hid_lgff_ctrl_out, hid); - dbg("Created ff output control urb"); - - /* Input init */ - hid->input.upload_effect = hid_lgff_upload_effect; - hid->input.flush = hid_lgff_flush; - set_bit(FF_RUMBLE, hid->input.ffbit); - set_bit(EV_FF, hid->input.evbit); - hid->input.ff_effects_max = LGFF_EFFECTS; - - printk(KERN_INFO "Force feedback for Logitech rumble devices by Johann Deneux <de...@if...>\n"); - - return 0; -} - -static void hid_lgff_exit(struct hid_device* hid) -{ - struct hid_ff_logitech *lgff = hid->ff_private; - - if (lgff->urbffout) { - usb_unlink_urb(lgff->urbffout); - usb_free_urb(lgff->urbffout); - } -} - -static int hid_lgff_event(struct hid_device *hid, struct input_dev* input, - unsigned int type, unsigned int code, int value) -{ - struct hid_ff_logitech *lgff = hid->ff_private; - struct lgff_effect *effect = lgff->effects + code; - unsigned long flags; - - if (type != EV_FF) return -EINVAL; - if (!LGFF_CHECK_OWNERSHIP(code, lgff)) return -EACCES; - if (value < 0) return -EINVAL; - - spin_lock_irqsave(&lgff->lock, flags); - - if (value > 0) { - if (test_bit(EFFECT_STARTED, effect->flags)) { - spin_unlock_irqrestore(&lgff->lock, flags); - return -EBUSY; - } - if (test_bit(EFFECT_PLAYING, effect->flags)) { - spin_unlock_irqrestore(&lgff->lock, flags); - return -EBUSY; - } - - effect->count = value; - - if (effect->replay.delay) { - set_bit(EFFECT_STARTED, effect->flags); - effect->timer.expires = RUN_AT(effect->replay.delay * HZ / 1000); - } else { - hid_lgff_ctrl_playback(hid, effect, value); - effect->timer.expires = RUN_AT(effect->replay.length * HZ / 1000); - } - - add_timer(&effect->timer); - } - else { /* value == 0 */ - if (test_and_clear_bit(EFFECT_STARTED, effect->flags)) { - del_timer(&effect->timer); - - } else if (test_and_clear_bit(EFFECT_PLAYING, effect->flags)) { - del_timer(&effect->timer); - hid_lgff_ctrl_playback(hid, effect, value); - } - - if (test_bit(EFFECT_PLAYING, effect->flags)) - warn("Effect %d still playing", code); - } - - spin_unlock_irqrestore(&lgff->lock, flags); - - return 0; - -} - -/* Erase all effects this process owns */ -static int hid_lgff_flush(struct input_dev *dev, struct file *file) -{ - struct hid_device *hid = dev->private; - struct hid_ff_logitech *lgff = hid->ff_private; - int i; - - for (i=0; i<dev->ff_effects_max; ++i) { - - /*NOTE: no need to lock here. The only times EFFECT_USED is - modified is when effects are uploaded or when an effect is - erased. But a process cannot close its dev/input/eventX fd - and perform ioctls on the same fd all at the same time */ - if ( current->pid == lgff->effects[i].owner - && test_bit(EFFECT_USED, lgff->effects[i].flags)) { - - if (hid_lgff_erase(dev, i)) - warn("erase effect %d failed", i); - } - - } - - return 0; -} - -static int hid_lgff_erase(struct input_dev *dev, int id) -{ - struct hid_device *hid = dev->private; - struct hid_ff_logitech *lgff = hid->ff_private; - unsigned long flags; - - if (!LGFF_CHECK_OWNERSHIP(id, lgff)) return -EACCES; - - spin_lock_irqsave(&lgff->lock, flags); - hid_lgff_ctrl_playback(hid, lgff->effects + id, 0); - lgff->effects[id].flags[0] = 0; - spin_unlock_irqrestore(&lgff->lock, flags); - - return 0; -} - -static int hid_lgff_upload_effect(struct input_dev* input, - struct ff_effect* effect) -{ - struct hid_device *hid = input->private; - struct hid_ff_logitech *lgff = hid->ff_private; - struct lgff_effect new; - int id; - unsigned long flags; - - dbg("ioctl rumble"); - - if (!test_bit(effect->type, input->ffbit)) return -EINVAL; - - if (effect->type != FF_RUMBLE) return -EINVAL; - - spin_lock_irqsave(&lgff->lock, flags); - - if (effect->id == -1) { - int i; - - for (i=0; i<LGFF_EFFECTS && test_bit(EFFECT_USED, lgff->effects[i].flags); ++i); - if (i >= LGFF_EFFECTS) { - spin_unlock_irqrestore(&lgff->lock, flags); - return -ENOSPC; - } - - effect->id = i; - lgff->effects[i].owner = current->pid; - lgff->effects[i].flags[0] = 0; - set_bit(EFFECT_USED, lgff->effects[i].flags); - } - else if (!LGFF_CHECK_OWNERSHIP(effect->id, lgff)) { - spin_unlock_irqrestore(&lgff->lock, flags); - return -EACCES; - } - - id = effect->id; - new = lgff->effects[id]; - - new.right = effect->u.rumble.strong_magnitude >> 9; - new.left = effect->u.rumble.weak_magnitude >> 9; - new.replay = effect->replay; - - /* If we updated an effect that was being played, we need to remake - the rumble effect */ - if (test_bit(EFFECT_STARTED, lgff->effects[id].flags) - || test_bit(EFFECT_STARTED, lgff->effects[id].flags)) { - - /* Changing replay parameters is not allowed (for the time - being) */ - if (new.replay.delay != lgff->effects[id].replay.delay - || new.replay.length != lgff->effects[id].replay.length) { - spin_unlock_irqrestore(&lgff->lock, flags); - return -ENOSYS; - } - - lgff->effects[id] = new; - hid_lgff_make_rumble(hid); - - } else { - lgff->effects[id] = new; - } - - spin_unlock_irqrestore(&lgff->lock, flags); - return 0; -} - -static void hid_lgff_xmit(struct hid_device* hid) -{ - struct hid_ff_logitech *lgff = hid->ff_private; - int err; - int tail; - unsigned long flags; - - spin_lock_irqsave(&lgff->xmit_lock, flags); - - tail = lgff->xmit_tail; - if (lgff->xmit_head == tail) { - clear_bit(XMIT_RUNNING, lgff->xmit_flags); - spin_unlock_irqrestore(&lgff->xmit_lock, flags); - return; - } - lgff->buf[3] = lgff->xmit_data[tail].left; - lgff->buf[4] = lgff->xmit_data[tail].right; - tail++; tail &= LGFF_BUFFER_SIZE -1; - lgff->xmit_tail = tail; - - spin_unlock_irqrestore(&lgff->xmit_lock, flags); - - lgff->urbffout->pipe = usb_sndctrlpipe(hid->dev, 0); - lgff->ffcr.bRequestType = USB_TYPE_CLASS | USB_DIR_OUT | USB_RECIP_INTERFACE; - lgff->urbffout->transfer_buffer_length = lgff->ffcr.wLength = 8; - lgff->ffcr.bRequest = 9; - lgff->ffcr.wValue = 0x0203; /*NOTE: Potential problem with - little/big endian */ - lgff->ffcr.wIndex = 0; - - lgff->urbffout->dev = hid->dev; - - if ((err=usb_submit_urb(lgff->urbffout, GFP_ATOMIC))) - warn("usb_submit_urb returned %d", err); -} - -static void hid_lgff_make_rumble(struct hid_device* hid) -{ - struct hid_ff_logitech *lgff = hid->ff_private; - int left = 0, right = 0; - int i; - int head, tail; - unsigned long flags; - - for (i=0; i<LGFF_EFFECTS; ++i) { - if (test_bit(EFFECT_USED, lgff->effects[i].flags) - && test_bit(EFFECT_PLAYING, lgff->effects[i].flags)) { - left += lgff->effects[i].left; - right += lgff->effects[i].right; - } - } - - spin_lock_irqsave(&lgff->xmit_lock, flags); - - head = lgff->xmit_head; - tail = lgff->xmit_tail; - - if (CIRC_SPACE(head, tail, LGFF_BUFFER_SIZE) < 1) { - warn("not enough space in xmit buffer to send new packet"); - spin_unlock_irqrestore(&lgff->xmit_lock, flags); - return; - } - - lgff->xmit_data[head].left = left > 0x7f ? 0x7f : left; - lgff->xmit_data[head].right = right > 0x7f ? 0x7f : right; - head++; head &= LGFF_BUFFER_SIZE -1; - lgff->xmit_head = head; - - if (test_and_set_bit(XMIT_RUNNING, lgff->xmit_flags)) - spin_unlock_irqrestore(&lgff->xmit_lock, flags); - else { - spin_unlock_irqrestore(&lgff->xmit_lock, flags); - hid_lgff_xmit(hid); - } -} - -static void hid_lgff_ctrl_out(struct urb *urb) -{ - struct hid_device *hid = urb->context; - - if (urb->status) - warn("hid_irq_ffout status %d received", urb->status); - - hid_lgff_xmit(hid); -} - -/* Lock must be held by caller */ -static void hid_lgff_ctrl_playback(struct hid_device *hid, - struct lgff_effect *effect, int play) -{ - if (play) { - set_bit(EFFECT_PLAYING, effect->flags); - hid_lgff_make_rumble(hid); - - } else { - clear_bit(EFFECT_PLAYING, effect->flags); - hid_lgff_make_rumble(hid); - } -} - -static void hid_lgff_timer(unsigned long timer_data) -{ - struct lgff_effect *effect = (struct lgff_effect*) timer_data; - struct hid_ff_logitech* lgff = effect->lgff; - int id = effect->id; - - unsigned long flags; - - dbg("in hid_lgff_timer"); - - if (id < 0 || id >= LGFF_EFFECTS) { - warn("Bad effect id %d", id); - return; - } - - effect = lgff->effects + id; - - spin_lock_irqsave(&lgff->lock, flags); - - if (!test_bit(EFFECT_USED, effect->flags)) { - warn("Unused effect id %d", id); - - } else if (test_bit(EFFECT_STARTED, effect->flags)) { - clear_bit(EFFECT_STARTED, effect->flags); - set_bit(EFFECT_PLAYING, effect->flags); - hid_lgff_ctrl_playback(lgff->hid, effect, 1); - effect->timer.expires = RUN_AT(effect->replay.length * HZ / 1000); - add_timer(&effect->timer); - - dbg("Effect %d starts playing", id); - } else if (test_bit(EFFECT_PLAYING, effect->flags)) { - clear_bit(EFFECT_PLAYING, effect->flags); - hid_lgff_ctrl_playback(lgff->hid, effect, 0); - if (--effect->count > 0) { - /*TODO: check that replay.delay is non-null */ - set_bit(EFFECT_STARTED, effect->flags); - effect->timer.expires = RUN_AT(effect->replay.delay * HZ / 1000); - add_timer(&effect->timer); - dbg("Effect %d restarted", id); - } else { - dbg("Effect %d stopped", id); - } - } else { - warn("Effect %d is not started nor playing", id); - } - - spin_unlock_irqrestore(&lgff->lock, flags); -} - -#endif /* CONFIG_LOGITECH_RUMBLE */ Index: hid-input.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/hid-input.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- hid-input.c 10 Mar 2002 12:26:40 -0000 1.22 +++ hid-input.c 12 Apr 2002 17:36:03 -0000 1.23 @@ -273,7 +273,57 @@ usage->type = EV_KEY; bit = input->keybit; max = KEY_MAX; break; + + case HID_UP_PID: + usage->type = EV_FF; bit = input->ffbit; max = FF_MAX; + + switch(usage->hid & HID_USAGE) { + case 0x26: set_bit(FF_CONSTANT, input->ffbit); break; + case 0x27: set_bit(FF_RAMP, input->ffbit); break; + case 0x28: set_bit(FF_CUSTOM, input->ffbit); break; + case 0x30: set_bit(FF_SQUARE, input->ffbit); + set_bit(FF_PERIODIC, input->ffbit); break; + case 0x31: set_bit(FF_SINE, input->ffbit); + set_bit(FF_PERIODIC, input->ffbit); break; + case 0x32: set_bit(FF_TRIANGLE, input->ffbit); + set_bit(FF_PERIODIC, input->ffbit); break; + case 0x33: set_bit(FF_SAW_UP, input->ffbit); + set_bit(FF_PERIODIC, input->ffbit); break; + case 0x34: set_bit(FF_SAW_DOWN, input->ffbit); + set_bit(FF_PERIODIC, input->ffbit); break; + case 0x40: set_bit(FF_SPRING, input->ffbit); break; + case 0x41: set_bit(FF_DAMPER, input->ffbit); break; + case 0x42: set_bit(FF_INERTIA , input->ffbit); break; + case 0x43: set_bit(FF_FRICTION, input->ffbit); break; + case 0x7e: usage->code = FF_GAIN; break; + case 0x83: /* Simultaneous Effects Max */ + input->ff_effects_max = (field->value[0]); + break; + case 0x98: /* Device Control */ + usage->code = FF_AUTOCENTER; break; + case 0xa4: /* Safety Switch */ + usage->code = BTN_DEAD; + bit = input->keybit; + usage->type = EV_KEY; + max = KEY_MAX; + break; +// case 0x94: /* Effect Playing */ +// usage->code = FF_STATUS_PLAYING; +// bit = input->ffbit; +// max = FF_STATUS_MAX; +// break; + case 0x9f: /* Device Paused */ + case 0xa0: /* Actuators Enabled */ +#ifdef DEBUG + printk("Not telling the input API about "); + resolv_usage(usage->hid); + printk("\n"); +#endif + return; + } +//AUG goto unknown; //AUG + break; default: unknown: @@ -363,6 +413,15 @@ int a = field->logical_minimum; int b = field->logical_maximum; input_event(input, EV_KEY, BTN_TOUCH, value > a + ((b - a) >> 3)); + } + + if (usage->hid == (HID_UP_PID | 0x83UL)) { /* Simultaneous Effects Max */ + input->ff_effects_max = value; + return; + } + if (usage->hid == (HID_UP_PID | 0x7fUL)) { + printk("PID Pool Report\n"); + return; } if((usage->type == EV_KEY) && (usage->code == 0)) /* Key 0 is "unassigned", not KEY_UKNOWN */ |
From: James S. <jsi...@us...> - 2002-04-12 17:03:28
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv19659 Modified Files: Config.in Log Message: Scaling of touchscreen driver interface. Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/Config.in,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- Config.in 25 Feb 2002 20:18:13 -0000 1.63 +++ Config.in 12 Apr 2002 17:03:24 -0000 1.64 @@ -17,6 +17,10 @@ fi dep_tristate ' Joystick interface' CONFIG_INPUT_JOYDEV $CONFIG_INPUT dep_tristate ' Touchscreen interface' CONFIG_INPUT_TSDEV $CONFIG_INPUT +if [ "$CONFIG_INPUT_TSDEV" != "n" ]; then + int ' Horizontal screen resolution' CONFIG_INPUT_TSDEV_SCREEN_X 240 + int ' Vertical screen resolution' CONFIG_INPUT_TSDEV_SCREEN_Y 320 +fi dep_tristate ' Event interface' CONFIG_INPUT_EVDEV $CONFIG_INPUT dep_tristate ' Event debugging' CONFIG_INPUT_EVBUG $CONFIG_INPUT |
From: James S. <jsi...@us...> - 2002-04-12 03:23:47
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/serial In directory usw-pr-cvs1:/tmp/cvs-serv21672 Modified Files: serial_8250_pci.c Log Message: More syncing. Index: serial_8250_pci.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250_pci.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 |
From: James S. <jsi...@us...> - 2002-04-10 18:32:01
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv27844 Modified Files: tsdev.c Log Message: Bug fixes. It works now :-) Index: tsdev.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/tsdev.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- tsdev.c 9 Apr 2002 23:59:01 -0000 1.14 +++ tsdev.c 10 Apr 2002 16:50:19 -0000 1.15 @@ -27,8 +27,8 @@ * e-mail - mail your message to <jsi...@tr...>. */ -#define TSDEV_MINOR_BASE 16 -#define TSDEV_MINORS 16 +#define TSDEV_MINOR_BASE 128 +#define TSDEV_MINORS 32 #define TSDEV_BUFFER_SIZE 64 #include <linux/slab.h> @@ -42,10 +42,10 @@ #include <linux/time.h> #ifndef CONFIG_INPUT_TSDEV_SCREEN_X -#define CONFIG_INPUT_TSDEV_SCREEN_X 240 +#define CONFIG_INPUT_TSDEV_SCREEN_X 240 #endif #ifndef CONFIG_INPUT_TSDEV_SCREEN_Y -#define CONFIG_INPUT_TSDEV_SCREEN_Y 320 +#define CONFIG_INPUT_TSDEV_SCREEN_Y 320 #endif struct tsdev { @@ -240,7 +240,8 @@ case EV_ABS: switch (code) { case ABS_X: - if (!list->pendown) return; + if (!list->pendown) + return; size = handle->dev->absmax[ABS_X] - @@ -256,7 +257,8 @@ handle->dev->absmin[ABS_X])); break; case ABS_Y: - if (!list->pendown) return; + if (!list->pendown) + return; size = handle->dev->absmax[ABS_Y] - @@ -284,7 +286,8 @@ case EV_REL: switch (code) { case REL_X: - if (!list->pendown) return; + if (!list->pendown) + return; list->oldx += value; if (list->oldx < 0) @@ -293,7 +296,8 @@ list->oldx = xres; break; case REL_Y: - if (!list->pendown) return; + if (!list->pendown) + return; list->oldy += value; if (list->oldy < 0) @@ -321,7 +325,7 @@ return; break; } - get_fast_time(&time); + do_gettimeofday(&time); list->event[list->head].millisecs = time.tv_usec / 100; list->event[list->head].pressure = list->pendown; list->event[list->head].x = list->oldx; @@ -388,22 +392,20 @@ static struct input_device_id tsdev_ids[] = { { - flags:INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | - INPUT_DEVICE_ID_MATCH_RELBIT, - evbit:{BIT(EV_KEY) | BIT(EV_REL)}, - keybit:{[LONG(BTN_LEFT)] = BIT(BTN_LEFT)}, - relbit:{BIT(REL_X) | BIT(REL_Y)}, - }, /* A mouse like device, at least one button, two relative axes */ + flags: INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | INPUT_DEVICE_ID_MATCH_RELBIT, + evbit: { BIT(EV_KEY) | BIT(EV_REL) }, + keybit: { [LONG(BTN_LEFT)] = BIT(BTN_LEFT) }, + relbit: { BIT(REL_X) | BIT(REL_Y) }, + },/* A mouse like device, at least one button, two relative axes */ { - flags:INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | - INPUT_DEVICE_ID_MATCH_ABSBIT, - evbit:{BIT(EV_KEY) | BIT(EV_ABS)}, - keybit:{[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH)}, - absbit:{BIT(ABS_X) | BIT(ABS_Y)}, - }, /* A tablet like device, at least touch detection, two absolute axes */ + flags: INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | INPUT_DEVICE_ID_MATCH_ABSBIT, + evbit: { BIT(EV_KEY) | BIT(EV_ABS) }, + keybit: { [LONG(BTN_TOUCH)] = BIT(BTN_TOUCH) }, + absbit: { BIT(ABS_X) | BIT(ABS_Y) }, + },/* A tablet like device, at least touch detection, two absolute axes */ - {}, /* Terminating entry */ + {},/* Terminating entry */ }; MODULE_DEVICE_TABLE(input, tsdev_ids); |
From: James S. <jsi...@us...> - 2002-04-09 23:59:04
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv27935 Modified Files: joydev.c tsdev.c Log Message: Divided up joystick space to share it with touchscreen space. Index: joydev.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joydev.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- joydev.c 20 Mar 2002 21:43:25 -0000 1.42 +++ joydev.c 9 Apr 2002 23:59:01 -0000 1.43 @@ -49,7 +49,7 @@ MODULE_LICENSE("GPL"); #define JOYDEV_MINOR_BASE 0 -#define JOYDEV_MINORS 32 +#define JOYDEV_MINORS 16 #define JOYDEV_BUFFER_SIZE 64 #define MSECS(t) (1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ) Index: tsdev.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/tsdev.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- tsdev.c 24 Jan 2002 19:54:08 -0000 1.13 +++ tsdev.c 9 Apr 2002 23:59:01 -0000 1.14 @@ -27,8 +27,8 @@ * e-mail - mail your message to <jsi...@tr...>. */ -#define TSDEV_MINOR_BASE 32 -#define TSDEV_MINORS 32 +#define TSDEV_MINOR_BASE 16 +#define TSDEV_MINORS 16 #define TSDEV_BUFFER_SIZE 64 #include <linux/slab.h> @@ -42,10 +42,10 @@ #include <linux/time.h> #ifndef CONFIG_INPUT_TSDEV_SCREEN_X -#define CONFIG_INPUT_TSDEV_SCREEN_X 1024 +#define CONFIG_INPUT_TSDEV_SCREEN_X 240 #endif #ifndef CONFIG_INPUT_TSDEV_SCREEN_Y -#define CONFIG_INPUT_TSDEV_SCREEN_Y 768 +#define CONFIG_INPUT_TSDEV_SCREEN_Y 320 #endif struct tsdev { @@ -61,10 +61,10 @@ /* From Compaq's Touch Screen Specification version 0.2 (draft) */ typedef struct { - short pressure; - short x; - short y; - short millisecs; + short pressure; + short x; + short y; + short millisecs; } TS_EVENT; struct tsdev_list { @@ -92,7 +92,7 @@ return retval < 0 ? retval : 0; } -static int tsdev_open(struct inode * inode, struct file * file) +static int tsdev_open(struct inode *inode, struct file *file) { int i = minor(inode->i_rdev) - TSDEV_MINOR_BASE; struct tsdev_list *list; @@ -110,12 +110,12 @@ file->private_data = list; if (!list->tsdev->open++) - if (list->tsdev->exist) + if (list->tsdev->exist) input_open_device(&list->tsdev->handle); return 0; } -static int tsdev_release(struct inode * inode, struct file * file) +static int tsdev_release(struct inode *inode, struct file *file) { struct tsdev_list *list = file->private_data; struct tsdev_list **listptr; @@ -140,7 +140,8 @@ return 0; } -static ssize_t tsdev_read(struct file * file, char * buffer, size_t count, loff_t *ppos) +static ssize_t tsdev_read(struct file *file, char *buffer, size_t count, + loff_t * ppos) { DECLARE_WAITQUEUE(wait, current); struct tsdev_list *list = file->private_data; @@ -152,9 +153,9 @@ while (list->head == list->tail) { if (!list->tsdev->exist) { - retval = -ENODEV; - break; - } + retval = -ENODEV; + break; + } if (file->f_flags & O_NONBLOCK) { retval = -EAGAIN; break; @@ -172,28 +173,31 @@ if (retval) return retval; - while (list->head != list->tail && retval+sizeof(TS_EVENT) <= count) { - if (copy_to_user(buffer + retval, list->event + list->tail, - sizeof(TS_EVENT))) return -EFAULT; - list->tail = (list->tail + 1) & (TSDEV_BUFFER_SIZE - 1); - retval += sizeof(TS_EVENT); - } - return retval; + while (list->head != list->tail + && retval + sizeof(TS_EVENT) <= count) { + if (copy_to_user + (buffer + retval, list->event + list->tail, + sizeof(TS_EVENT))) + return -EFAULT; + list->tail = (list->tail + 1) & (TSDEV_BUFFER_SIZE - 1); + retval += sizeof(TS_EVENT); + } + return retval; } /* No kernel lock - fine */ -static unsigned int tsdev_poll(struct file *file, poll_table *wait) +static unsigned int tsdev_poll(struct file *file, poll_table * wait) { struct tsdev_list *list = file->private_data; - + poll_wait(file, &list->tsdev->wait, wait); if (list->head != list->tail) return POLLIN | POLLRDNORM; return 0; } -static int tsdev_ioctl(struct inode *inode, struct file *file,unsigned int cmd, - unsigned long arg) +static int tsdev_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { /* struct tsdev_list *list = file->private_data; @@ -220,10 +224,11 @@ read: tsdev_read, poll: tsdev_poll, fasync: tsdev_fasync, - ioctl: tsdev_ioctl, + ioctl: tsdev_ioctl, }; -static void tsdev_event(struct input_handle *handle, unsigned int type, unsigned int code, int value) +static void tsdev_event(struct input_handle *handle, unsigned int type, + unsigned int code, int value) { struct tsdev *tsdev = handle->private; struct tsdev_list *list = tsdev->list; @@ -232,66 +237,92 @@ while (list) { switch (type) { - case EV_ABS: - switch (code) { - case ABS_X: - size = handle->dev->absmax[ABS_X] - handle->dev->absmin[ABS_X]; - if(size > 0) - list->oldx = ((value - handle->dev->absmin[ABS_X]) * xres / size); - else - list->oldx = ((value - handle->dev->absmin[ABS_X])); - break; - case ABS_Y: - size = handle->dev->absmax[ABS_Y] - handle->dev->absmin[ABS_Y]; - if(size > 0) - list->oldy = ((value - handle->dev->absmin[ABS_Y]) * yres / size); - else - list->oldy = ((value - handle->dev->absmin[ABS_Y])); - break; - case ABS_PRESSURE: - list->pendown = ((value > handle->dev->absmin[ABS_PRESSURE])) ? - value - handle->dev->absmin[ABS_PRESSURE] : 0; - break; - } + case EV_ABS: + switch (code) { + case ABS_X: + if (!list->pendown) return; + + size = + handle->dev->absmax[ABS_X] - + handle->dev->absmin[ABS_X]; + if (size > 0) + list->oldx = + ((value - + handle->dev->absmin[ABS_X]) * + xres / size); + else + list->oldx = + ((value - + handle->dev->absmin[ABS_X])); break; + case ABS_Y: + if (!list->pendown) return; - case EV_REL: - switch (code) { - case REL_X: - list->oldx += value; - if(list->oldx < 0) - list->oldx = 0; - else if(list->oldx > xres) - list->oldx = xres; - break; - case REL_Y: - list->oldy += value; - if(list->oldy < 0) - list->oldy = 0; - else if(list->oldy > xres) - list->oldy = xres; - break; - } + size = + handle->dev->absmax[ABS_Y] - + handle->dev->absmin[ABS_Y]; + if (size > 0) + list->oldy = + ((value - + handle->dev->absmin[ABS_Y]) * + yres / size); + else + list->oldy = + ((value - + handle->dev->absmin[ABS_Y])); + break; + case ABS_PRESSURE: + list->pendown = + ((value > + handle->dev-> + absmin[ABS_PRESSURE])) ? value - + handle->dev->absmin[ABS_PRESSURE] : 0; break; + } + break; - case EV_KEY: - if (code == BTN_TOUCH || code == BTN_MOUSE) { - switch (value) { - case 0: - list->pendown = 0; - break; - case 1: - if(!list->pendown) list->pendown = 1; - break; - case 2: - return; - } - } else - return; + case EV_REL: + switch (code) { + case REL_X: + if (!list->pendown) return; + + list->oldx += value; + if (list->oldx < 0) + list->oldx = 0; + else if (list->oldx > xres) + list->oldx = xres; + break; + case REL_Y: + if (!list->pendown) return; + + list->oldy += value; + if (list->oldy < 0) + list->oldy = 0; + else if (list->oldy > xres) + list->oldy = xres; break; + } + break; + + case EV_KEY: + if (code == BTN_TOUCH || code == BTN_MOUSE) { + switch (value) { + case 0: + list->pendown = 0; + break; + case 1: + if (!list->pendown) + list->pendown = 1; + break; + case 2: + return; + } + } else + return; + break; } get_fast_time(&time); - list->event[list->head].millisecs = time.tv_usec/100; + list->event[list->head].millisecs = time.tv_usec / 100; list->event[list->head].pressure = list->pendown; list->event[list->head].x = list->oldx; list->event[list->head].y = list->oldy; @@ -302,16 +333,20 @@ wake_up_interruptible(&tsdev->wait); } -static struct input_handle *tsdev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id) +static struct input_handle *tsdev_connect(struct input_handler *handler, + struct input_dev *dev, + struct input_device_id *id) { struct tsdev *tsdev; int minor; - for (minor = 0; minor < TSDEV_MINORS && tsdev_table[minor]; minor++); - if (minor == TSDEV_MINORS) { - printk(KERN_ERR "tsdev: You have way too many touchscreens\n"); - return NULL; - } + for (minor = 0; minor < TSDEV_MINORS && tsdev_table[minor]; + minor++); + if (minor == TSDEV_MINORS) { + printk(KERN_ERR + "tsdev: You have way too many touchscreens\n"); + return NULL; + } if (!(tsdev = kmalloc(sizeof(struct tsdev), GFP_KERNEL))) return NULL; @@ -320,14 +355,15 @@ tsdev->minor = minor; tsdev_table[minor] = tsdev; - sprintf(tsdev->name, "ts%d", minor); + sprintf(tsdev->name, "ts%d", minor); tsdev->handle.dev = dev; tsdev->handle.name = tsdev->name; tsdev->handle.handler = handler; tsdev->handle.private = tsdev; - tsdev->devfs = input_register_minor("ts%d", minor, TSDEV_MINOR_BASE); + tsdev->devfs = + input_register_minor("ts%d", minor, TSDEV_MINOR_BASE); tsdev->exist = 1; @@ -352,24 +388,26 @@ static struct input_device_id tsdev_ids[] = { { - flags: INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | INPUT_DEVICE_ID_MATCH_RELBIT, - evbit: { BIT(EV_KEY) | BIT(EV_REL) }, - keybit: { [LONG(BTN_LEFT)] = BIT(BTN_LEFT) }, - relbit: { BIT(REL_X) | BIT(REL_Y) }, - }, /* A mouse like device, at least one button, two relative axes */ + flags:INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | + INPUT_DEVICE_ID_MATCH_RELBIT, + evbit:{BIT(EV_KEY) | BIT(EV_REL)}, + keybit:{[LONG(BTN_LEFT)] = BIT(BTN_LEFT)}, + relbit:{BIT(REL_X) | BIT(REL_Y)}, + }, /* A mouse like device, at least one button, two relative axes */ { - flags: INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | INPUT_DEVICE_ID_MATCH_ABSBIT, - evbit: { BIT(EV_KEY) | BIT(EV_ABS) }, - keybit: { [LONG(BTN_TOUCH)] = BIT(BTN_TOUCH) }, - absbit: { BIT(ABS_X) | BIT(ABS_Y) }, - }, /* A tablet like device, at least touch detection, two absolute axes */ + flags:INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | + INPUT_DEVICE_ID_MATCH_ABSBIT, + evbit:{BIT(EV_KEY) | BIT(EV_ABS)}, + keybit:{[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH)}, + absbit:{BIT(ABS_X) | BIT(ABS_Y)}, + }, /* A tablet like device, at least touch detection, two absolute axes */ - { }, /* Terminating entry */ + {}, /* Terminating entry */ }; MODULE_DEVICE_TABLE(input, tsdev_ids); - + static struct input_handler tsdev_handler = { event: tsdev_event, connect: tsdev_connect, |
From: johann d. <jd...@us...> - 2002-04-09 21:56:51
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/usb In directory usw-pr-cvs1:/tmp/cvs-serv19650/drivers/usb Modified Files: hid-core.c Log Message: Fixed the hiddev_hid_event call. Number and types of arguments were wrong. The fix comes from the usbdevel tree. Not tried, but it compiles. Index: hid-core.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/hid-core.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- hid-core.c 10 Mar 2002 12:26:40 -0000 1.48 +++ hid-core.c 9 Apr 2002 21:56:47 -0000 1.49 @@ -745,8 +745,20 @@ if (hid->claimed & HID_CLAIMED_INPUT) hidinput_hid_event(hid, field, usage, value); #ifdef CONFIG_USB_HIDDEV - if (hid->claimed & HID_CLAIMED_HIDDEV) - hiddev_hid_event(hid, usage->hid, value); + if (hid->claimed & HID_CLAIMED_HIDDEV) { + struct hiddev_usage_ref uref; + unsigned type = field->report_type; + uref.report_type = + (type == HID_INPUT_REPORT) ? HID_REPORT_TYPE_INPUT : + ((type == HID_OUTPUT_REPORT) ? HID_REPORT_TYPE_OUTPUT : + ((type == HID_FEATURE_REPORT) ? HID_REPORT_TYPE_FEATURE:0)); + uref.report_id = field->report->id; + uref.field_index = field->index; + uref.usage_index = (usage - field->usage); + uref.usage_code = usage->hid; + uref.value = value; + hiddev_hid_event(hid, &uref); + } #endif } |
From: johann d. <jd...@us...> - 2002-04-09 21:08:17
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv25424/drivers/input Modified Files: mousedev.c Log Message: Fixes suggested by Rodrigo Damazio. Index: mousedev.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/mousedev.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- mousedev.c 22 Feb 2002 11:42:23 -0000 1.41 +++ mousedev.c 9 Apr 2002 20:51:26 -0000 1.42 @@ -38,6 +38,10 @@ #include <linux/config.h> #include <linux/smp_lock.h> #include <linux/random.h> +#include <linux/major.h> +#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX +#include <linux/miscdevice.h> +#endif MODULE_AUTHOR("Vojtech Pavlik <vo...@uc...>"); MODULE_DESCRIPTION("Mouse (ExplorerPS/2) device interfaces"); @@ -228,7 +232,7 @@ int i; #ifdef CONFIG_INPUT_MOUSEDEV_PSAUX - if (major(inode->i_rdev) == MISC_MAJOR)) + if (major(inode->i_rdev) == MISC_MAJOR) i = MOUSEDEV_MIX; else #endif @@ -518,7 +522,7 @@ mousedev_mix.minor = MOUSEDEV_MIX; mousedev_mix.devfs = input_register_minor("mice", MOUSEDEV_MIX, MOUSEDEV_MINOR_BASE); #ifdef CONFIG_INPUT_MOUSEDEV_PSAUX - misc_register(&psaux_mouse) + misc_register(&psaux_mouse); #endif printk(KERN_INFO "mice: PS/2 mouse device common for all mice\n"); @@ -529,7 +533,7 @@ static void __exit mousedev_exit(void) { #ifdef CONFIG_INPUT_MOUSEDEV_PSAUX - misc_deregister(&psaux_mouse) + misc_deregister(&psaux_mouse); #endif input_unregister_minor(mousedev_mix.devfs); input_unregister_handler(&mousedev_handler); |
From: johann d. <jd...@us...> - 2002-04-09 21:08:16
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv25424/drivers/char Modified Files: keyboard.c Log Message: Fixes suggested by Rodrigo Damazio. Index: keyboard.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/keyboard.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- keyboard.c 25 Mar 2002 19:39:02 -0000 1.75 +++ keyboard.c 9 Apr 2002 20:51:26 -0000 1.76 @@ -1066,6 +1066,7 @@ { struct input_handle *handle; struct vt_struct *vt = vt_cons; + struct vc_data *vc; int i; for (i = KEY_RESERVED; i < BTN_MISC; i++) @@ -1112,6 +1113,7 @@ static void kbd_disconnect(struct input_handle *handle) { struct vt_struct *vt = handle->private; + struct vc_data *vc; int i; if (vt && vt->keyboard == handle) { |
From: johann d. <jd...@us...> - 2002-04-08 21:16:17
|
Update of /cvsroot/linuxconsole/ruby/utils In directory usw-pr-cvs1:/tmp/cvs-serv28453 Modified Files: fftest.c Log Message: Added timing information to rumble effects Index: fftest.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/utils/fftest.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- fftest.c 10 Mar 2002 17:02:53 -0000 1.17 +++ fftest.c 8 Apr 2002 21:16:13 -0000 1.18 @@ -24,6 +24,7 @@ * Johann Deneux <de...@if...> */ +#include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> @@ -31,7 +32,6 @@ #include <unistd.h> #include <string.h> #include <sys/ioctl.h> -#include <stdio.h> #define BITS_PER_LONG (sizeof(long) * 8) #define OFF(x) ((x)%BITS_PER_LONG) @@ -195,6 +195,8 @@ effects[4].id = -1; effects[4].u.rumble.strong_magnitude = 0x8000; effects[4].u.rumble.weak_magnitude = 0; + effects[4].replay.length = 5000; + effects[4].replay.delay = 1000; if (ioctl(fd, EVIOCSFF, &effects[4]) == -1) { perror("Upload effects[4]"); @@ -205,6 +207,8 @@ effects[5].id = -1; effects[5].u.rumble.strong_magnitude = 0; effects[5].u.rumble.weak_magnitude = 0xc000; + effects[5].replay.length = 5000; + effects[5].replay.delay = 0; if (ioctl(fd, EVIOCSFF, &effects[5]) == -1) { perror("Upload effects[5]"); @@ -226,6 +230,11 @@ } printf("Now Playing: %s\n", effect_names[i]); + } + else if (i == -2) { + /* Crash test */ + int i = *((int *)0); + printf("Crash test: %d\n", i); } else { printf("No such effect\n"); |
From: Thomas H H. <th...@us...> - 2002-04-08 00:37:05
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv4435/linux/include/linux Modified Files: Tag: thomash-2002_04_07 input.h Log Message: BRANCH: thomash-2002_04_07 evdev.c: Added new IOCTL's to get and set the entire keymap in one shot. Added two helper functions for pointer-translation to eliminate some redundancies in the ioctl function. Added a LOT of comments to the file, mostly function headers. input.c: Added new IOCTL constants. Added new structure for use with the bulk-transfer keymap IOCTL constants. STATUS: compiles against 2.5.7 / Code is NOT Tested. Index: input.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/input.h,v retrieving revision 1.64 retrieving revision 1.64.2.1 diff -u -d -r1.64 -r1.64.2.1 --- input.h 10 Mar 2002 12:20:56 -0000 1.64 +++ input.h 8 Apr 2002 00:37:00 -0000 1.64.2.1 @@ -55,28 +55,61 @@ /* * IOCTLs (0x00 - 0x7f) */ +#define EVIOC_MAGIC 'E' -#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ -#define EVIOCGID _IOR('E', 0x02, short[4]) /* get device ID */ -#define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */ -#define EVIOCSREP _IOW('E', 0x03, int[2]) /* get repeat settings */ -#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */ -#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */ +/* get driver version */ +#define EVIOCGVERSION _IOR(EVIOC_MAGIC, 0x01, int) +/* Get Device ID */ +#define EVIOCGID _IOR(EVIOC_MAGIC, 0x02, short[4]) +/* Get/Set Repeat Settings */ +#define EVIOCGREP _IOR(EVIOC_MAGIC, 0x03, int[2]) +#define EVIOCSREP _IOW(EVIOC_MAGIC, 0x03, int[2]) +/* Get/Set Scan Code to Keycode Mappings */ +#define EVIOCGKEYCODE _IOR(EVIOC_MAGIC, 0x04, int[2]) +#define EVIOCSKEYCODE _IOW(EVIOC_MAGIC, 0x04, int[2]) +/* Get/Set Scan Code to Keycode Mappings all-at-once */ +#define EVIOCGKEYMAP _IOR(EVIOC_MAGIC, 0x05, struct input_keymap) +#define EVIOCSKEYMAP _IOW(EVIOC_MAGIC, 0x05, struct input_keymap) -#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ -#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ -#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ +/* Get Device Name */ +#define EVIOCGNAME(len) _IOC(_IOC_READ, EVIOC_MAGIC, 0x06, len) +/* Get Physical Location */ +#define EVIOCGPHYS(len) _IOC(_IOC_READ, EVIOC_MAGIC, 0x07, len) +/* Get Unique Identifier */ +#define EVIOCGUNIQ(len) _IOC(_IOC_READ, EVIOC_MAGIC, 0x08, len) -#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */ -#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ -#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ +/* Get Global Keystate */ +#define EVIOCGKEY(len) _IOC(_IOC_READ, EVIOC_MAGIC, 0x18, len) +/* Get All LEDS */ +#define EVIOCGLED(len) _IOC(_IOC_READ, EVIOC_MAGIC, 0x19, len) +/* Get all sounds status */ +#define EVIOCGSND(len) _IOC(_IOC_READ, EVIOC_MAGIC, 0x1a, len) -#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ -#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, int[5]) /* get abs value/limits */ +/* Get event bits */ +#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, EVIOC_MAGIC, 0x20 + ev, len) +/* Get abs value/limits */ +#define EVIOCGABS(abs) _IOR(EVIOC_MAGIC, 0x40 + abs, int[5]) -#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */ -#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */ -#define EVIOCGEFFECTS _IOR('E', 0x84, int) /* Report number of effects playable at the same time */ +/* send a force effect to a force feedback device */ +#define EVIOCSFF _IOW(EVIOC_MAGIC, 0x80, struct ff_effect) +/* Erase a Force Effect */ +#define EVIOCRMFF _IOW(EVIOC_MAGIC, 0x81, int) +/* Report number of effects playable at the same time */ +#define EVIOCGEFFECTS _IOR(EVIOC_MAGIC, 0x84, int) + +/* + * Constants defined for the input_keymap structure, and for scan=code to + * key-code mappings in general + */ +#define EVKEYMAP_MAXSIZE 512 + +/* + * Structure for the EVIOCGKEYMAP and EVIOCSKEYMAP ioctl's + */ +struct input_keymap { + __u32 ik_size; /* How many elements in the keymap */ + __u32 ik_keys[EVKEYMAP_MAXSIZE]; /* The key data */ +}; /* * Event types |
From: Thomas H H. <th...@us...> - 2002-04-08 00:37:05
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv4435/linux/drivers/input Modified Files: Tag: thomash-2002_04_07 evdev.c Log Message: BRANCH: thomash-2002_04_07 evdev.c: Added new IOCTL's to get and set the entire keymap in one shot. Added two helper functions for pointer-translation to eliminate some redundancies in the ioctl function. Added a LOT of comments to the file, mostly function headers. input.c: Added new IOCTL constants. Added new structure for use with the bulk-transfer keymap IOCTL constants. STATUS: compiles against 2.5.7 / Code is NOT Tested. Index: evdev.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/evdev.c,v retrieving revision 1.47 retrieving revision 1.47.2.1 diff -u -d -r1.47 -r1.47.2.1 --- evdev.c 20 Mar 2002 21:43:25 -0000 1.47 +++ evdev.c 8 Apr 2002 00:36:59 -0000 1.47.2.1 @@ -37,6 +37,10 @@ #include <linux/input.h> #include <linux/smp_lock.h> +/* + * This structure defines the event device for devices we have open. These + * represent the /dev/input/eventXXXX devices that the user may open. + */ struct evdev { int exist; int open; @@ -48,6 +52,7 @@ struct evdev_list *list; }; + struct evdev_list { struct input_event buffer[EVDEV_BUFFER_SIZE]; int head; @@ -57,8 +62,22 @@ struct evdev_list *next; }; +/* + * This is our internal list for the event devices (struct evdev) that we + * currently have defined. These will be created when event_connect is + * called for a device that we report events for + */ static struct evdev *evdev_table[EVDEV_MINORS] = { NULL, /* ... */ }; +/* ----------------------------------------------------------------- + * evdev_event + * + * This is defined by the INPUT interface, and is called when an event + * occurs on a device that we have registered a handler for. We create a + * structure (struct input_event), and we add it to the lists associated + * with the device. We then wake any syscalls waiting on data to be + * available. + * ----------------------------------------------------------------- */ static void evdev_event(struct input_handle *handle, unsigned int type, unsigned int code, int value) { struct evdev *evdev = handle->private; @@ -80,6 +99,10 @@ wake_up_interruptible(&evdev->wait); } +/* ----------------------------------------------------------------- + * evdev_fasync + * + * ----------------------------------------------------------------- */ static int evdev_fasync(int fd, struct file *file, int on) { int retval; @@ -88,6 +111,10 @@ return retval < 0 ? retval : 0; } +/* ----------------------------------------------------------------- + * evdev_flush + * + * ----------------------------------------------------------------- */ static int evdev_flush(struct file * file) { struct evdev_list *list = (struct evdev_list*)file->private_data; @@ -95,6 +122,13 @@ return input_flush_device(&list->evdev->handle, file); } +/* ----------------------------------------------------------------- + * evdev_release + * + * This is defined by the KERNEL CHARDEV interface. This is called when a + * process that has an open filehandle on one of our devices uses the + * syscall "close()" on the file descriptor. + * ----------------------------------------------------------------- */ static int evdev_release(struct inode * inode, struct file * file) { struct evdev_list *list = file->private_data; @@ -122,6 +156,12 @@ return 0; } +/* ----------------------------------------------------------------- + * evdev_open + * + * This is defined by the KERNEL CHARDEV interface, and is calle when a + * process uses the syscall "open" on one of our device files. + * ----------------------------------------------------------------- */ static int evdev_open(struct inode * inode, struct file * file) { struct evdev_list *list; @@ -153,6 +193,14 @@ return 0; } +/* ----------------------------------------------------------------- + * evdev_write + * + * This is defined by the KERNEL CHARDEV interface, and is called when a + * process uses the syscall "write" on an open filedescriptor that is + * associated with one of our devices. This can be used to "fake" input + * events on devices. + * ----------------------------------------------------------------- */ static ssize_t evdev_write(struct file * file, const char * buffer, size_t count, loff_t *ppos) { struct evdev_list *list = file->private_data; @@ -172,6 +220,13 @@ return retval; } +/* ----------------------------------------------------------------- + * evdev_read + * + * This is defined by the KERNEL CHARDEV interface, and is called when a + * process uses the syscall "read" on an open filedescriptor that is + * associated with one of our devices. + * ----------------------------------------------------------------- */ static ssize_t evdev_read(struct file * file, char * buffer, size_t count, loff_t *ppos) { DECLARE_WAITQUEUE(wait, current); @@ -219,6 +274,14 @@ } /* No kernel lock - fine */ + +/* ----------------------------------------------------------------- + * evdev_poll + * + * This is defined by the KERNEL CHARDEV interface, and is used by the + * kernel to implement both select() and poll(). This is called when a + * process calls select or poll on one of our devices. + * ----------------------------------------------------------------- */ static unsigned int evdev_poll(struct file *file, poll_table *wait) { struct evdev_list *list = file->private_data; @@ -228,6 +291,44 @@ return 0; } +/* + * key_to_keymap + * + * Helper function to eliminate redundant code in evdev_ioctl + */ +static int key_to_keymap( void *keys, int keysize, int offset, int key ) { + switch( keysize ) { + case 1: *(u8* )(keys + (offset)) = key; break; + case 2: *(u16*)(keys + (offset << 1)) = key; break; + case 4: *(u32*)(keys + (offset << 2)) = key; break; + default: return -EINVAL; + } + return 0; +} + +/* + * keymap_to_key + * + * Helper function to eliminate redundant code in evdev_ioctl + */ +static int keymap_to_key( void *keys, int keysize, int offset, int *key ) { + switch (keysize) { + case 1: *key = *(u8* )(keys + (offset)); break; + case 2: *key = *(u16*)(keys + (offset << 1)); break; + case 4: *key = *(u32*)(keys + (offset << 2)); break; + default: return -EINVAL; + } + return 0; +} + +/* ----------------------------------------------------------------- + * evdev_ioctl + * + * This is defined by the KERNEL CHARDEV interface, and is used by the + * kernel when a process calls "ioctl" on one of our open devices. This + * implements control commands such as getting versions, setting key + * mappings, and the like. + * ----------------------------------------------------------------- */ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { struct evdev_list *list = file->private_data; @@ -262,12 +363,8 @@ case EVIOCGKEYCODE: if ((retval = get_user(t, ((int *) arg) + 0))) return retval; if (t < 0 || t > dev->keycodemax) return -EINVAL; - switch (dev->keycodesize) { - case 1: u = *(u8*)(dev->keycode + t); break; - case 2: u = *(u16*)(dev->keycode + t * 2); break; - case 4: u = *(u32*)(dev->keycode + t * 4); break; - default: return -EINVAL; - } + if ((retval = keymap_to_key(dev->keycode, dev->keycodesize, t, &u))) + return retval; if ((retval = put_user(u, ((int *) arg) + 1))) return retval; return 0; @@ -275,13 +372,42 @@ if ((retval = get_user(t, ((int *) arg) + 0))) return retval; if (t < 0 || t > dev->keycodemax) return -EINVAL; if ((retval = get_user(u, ((int *) arg) + 1))) return retval; - switch (dev->keycodesize) { - case 1: *(u8*)(dev->keycode + t) = u; break; - case 2: *(u16*)(dev->keycode + t * 2) = u; break; - case 4: *(u32*)(dev->keycode + t * 4) = u; break; - default: return -EINVAL; - } - return 0; + return key_to_keymap( dev->keycode, dev->keycodesize, t, u ); + + case EVIOCGKEYMAP: + if( dev->keycode ) { + struct input_keymap keymap; + + keymap.ik_size = dev->keycodemax; + for( t = 0; t <= dev->keycodemax; t++ ) { + if((retval=keymap_to_key(dev->keycode, + dev->keycodesize, + t, + &(keymap.ik_keys[t])))) + return retval; + } + retval = copy_to_user((void*)(&keymap),(void*)arg,sizeof(keymap)); + return retval; + } + else return -ENOSYS; + + case EVIOCSKEYMAP: + if( dev->keycode) { + struct input_keymap keymap; + + retval = copy_from_user((void*)(&keymap),(void*)arg,sizeof(keymap)); + if(retval) return retval; + if( keymap.ik_size > EVKEYMAP_MAXSIZE ) return -EINVAL; + + for( t = 0; t <= dev->keycodemax; t++ ) { + if((retval=key_to_keymap(dev->keycode, + dev->keycodesize, + t, + keymap.ik_keys[t]))) + return retval; + } + } + else return -ENOSYS; case EVIOCSFF: if (dev->upload_effect) { @@ -395,18 +521,30 @@ return -EINVAL; } +/* + * This is our set of file operations that we use to register ourselves as + * a Character Device Driver. + */ static struct file_operations evdev_fops = { - owner: THIS_MODULE, - read: evdev_read, - write: evdev_write, - poll: evdev_poll, - open: evdev_open, - release: evdev_release, - ioctl: evdev_ioctl, - fasync: evdev_fasync, - flush: evdev_flush + owner: THIS_MODULE, + read: evdev_read, + write: evdev_write, + poll: evdev_poll, + open: evdev_open, + release: evdev_release, + ioctl: evdev_ioctl, + fasync: evdev_fasync, + flush: evdev_flush }; +/* ----------------------------------------------------------------- + * evdev_connect + * + * This is defined by the INPUT interface, and is called when a new input + * device has been connected, and is registered with the input module. We + * return a handler for all devices that are connected, since we are a raw + * interface to all device events. + * ----------------------------------------------------------------- */ static struct input_handle *evdev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id) { struct evdev *evdev; @@ -441,6 +579,13 @@ return &evdev->handle; } +/* ----------------------------------------------------------------- + * evdev_disconnect + * + * This is defined by the INPUT interface, and is called when a device has + * been removed from the system and has been unregistered with the input + * module. + * ----------------------------------------------------------------- */ static void evdev_disconnect(struct input_handle *handle) { struct evdev *evdev = handle->private; @@ -464,14 +609,17 @@ MODULE_DEVICE_TABLE(input, evdev_ids); +/* + * Used to register ourselves as an input handler + */ static struct input_handler evdev_handler = { - event: evdev_event, - connect: evdev_connect, + event: evdev_event, + connect: evdev_connect, disconnect: evdev_disconnect, - fops: &evdev_fops, - minor: EVDEV_MINOR_BASE, - name: "evdev", - id_table: evdev_ids, + fops: &evdev_fops, + minor: EVDEV_MINOR_BASE, + name: "evdev", + id_table: evdev_ids, }; static int __init evdev_init(void) |
From: Vojtech P. <vo...@us...> - 2002-04-07 20:13:41
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick In directory usw-pr-cvs1:/tmp/cvs-serv31336 Modified Files: db9.c Log Message: Fix Genesis 6 gamepad button mappings. Index: db9.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/db9.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- db9.c 22 Jan 2002 20:27:05 -0000 1.12 +++ db9.c 7 Apr 2002 20:13:37 -0000 1.13 @@ -199,7 +199,7 @@ data=parport_read_data(port); input_report_key(dev, BTN_A, ~data & DB9_FIRE1); - input_report_key(dev, BTN_X, ~data & DB9_FIRE2); + input_report_key(dev, BTN_START, ~data & DB9_FIRE2); parport_write_control(port, DB9_NOSELECT); /* 2 */ udelay(DB9_GENESIS6_DELAY); @@ -209,10 +209,10 @@ udelay(DB9_GENESIS6_DELAY); data=parport_read_data(port); - input_report_key(dev, BTN_Y, ~data & DB9_LEFT); - input_report_key(dev, BTN_Z, ~data & DB9_DOWN); - input_report_key(dev, BTN_MODE, ~data & DB9_UP); - input_report_key(dev, BTN_START, ~data & DB9_RIGHT); + input_report_key(dev, BTN_X, ~data & DB9_LEFT); + input_report_key(dev, BTN_Y, ~data & DB9_DOWN); + input_report_key(dev, BTN_Z, ~data & DB9_UP); + input_report_key(dev, BTN_MODE, ~data & DB9_RIGHT); parport_write_control(port, DB9_NORMAL); udelay(DB9_GENESIS6_DELAY); |
From: johann d. <jd...@us...> - 2002-04-07 11:49:43
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce In directory usw-pr-cvs1:/tmp/cvs-serv17194 Modified Files: iforce-main.c Log Message: Check that the device's memory is empty when we close it. Index: iforce-main.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce/iforce-main.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- iforce-main.c 18 Mar 2002 21:30:08 -0000 1.16 +++ iforce-main.c 7 Apr 2002 11:49:40 -0000 1.17 @@ -291,6 +291,16 @@ static void iforce_release(struct input_dev *dev) { struct iforce *iforce = dev->private; + int i; + + /* Check: no effect should be present in memory */ + for (i=0; i<dev->ff_effects_max; ++i) { + if (test_bit(FF_CORE_IS_USED, iforce->core_effects[i].flags)) + break; + } + if (i<dev->ff_effects_max) { + printk(KERN_WARNING "iforce_release: Device still owns effects\n"); + } /* Disable force feedback playback */ iforce_send_packet(iforce, FF_CMD_ENABLE, "\001"); |