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-01-22 19:16:48
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/serio In directory usw-pr-cvs1:/tmp/cvs-serv10049 Added Files: Tag: 1.8 parkbd.c Log Message: moving stuff around. --- NEW FILE: parkbd.c --- /* * $Id: parkbd.c,v 1.8 2002/01/22 19:16:44 jsimmons Exp $ * * Copyright (c) 1999-2001 Vojtech Pavlik */ /* * Parallel port to Keyboard port adapter driver for Linux */ /* * 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 either by * e-mail - mail your message to <vo...@uc...>, or by paper mail: * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ #include <linux/module.h> #include <linux/parport.h> #include <linux/init.h> #include <linux/serio.h> MODULE_AUTHOR("Vojtech Pavlik <vo...@uc...>"); MODULE_DESCRIPTION("Parallel port to Keyboard port adapter driver"); MODULE_LICENSE("GPL"); MODULE_PARM(parkbd, "1i"); MODULE_PARM(parkbd_mode, "1i"); #define PARKBD_CLOCK 0x01 /* Strobe & Ack */ #define PARKBD_DATA 0x02 /* AutoFd & Busy */ static int parkbd = 0; static int parkbd_mode = SERIO_8042; static int parkbd_buffer = 0; static int parkbd_counter = 0; static int parkbd_last = 0; static int parkbd_writing = 0; static unsigned long parkbd_start = 0; static struct pardevice *parkbd_dev; static char parkbd_name[] = "PARKBD AT/XT keyboard adapter"; static char parkbd_phys[32]; static int parkbd_readlines(void) { return (parport_read_status(parkbd_dev->port) >> 6) ^ 2; } static void parkbd_writelines(int data) { parport_write_control(parkbd_dev->port, (~data & 3) | 0x10); } static int parkbd_write(struct serio *port, unsigned char c) { unsigned char p; if (!parkbd_mode) return -1; p = c ^ (c >> 4); p = p ^ (p >> 2); p = p ^ (p >> 1); parkbd_counter = 0; parkbd_writing = 1; parkbd_buffer = c | (((int) (~p & 1)) << 8) | 0x600; parkbd_writelines(2); return 0; } static int parkbd_open(struct serio *port) { return 0; } static void parkbd_close(struct serio *port) { } static struct serio parkbd_port = { write: parkbd_write, open: parkbd_open, close: parkbd_close, name: parkbd_name, phys: parkbd_phys, }; static void parkbd_interrupt(int irq, void *dev_id, struct pt_regs *regs) { if (parkbd_writing) { if (parkbd_counter && ((parkbd_counter == 11) || (jiffies - parkbd_last > 1))) { parkbd_counter = 0; parkbd_buffer = 0; parkbd_writing = 0; parkbd_writelines(3); return; } parkbd_writelines(((parkbd_buffer >> parkbd_counter++) & 1) | 2); if (parkbd_counter == 11) { parkbd_counter = 0; parkbd_buffer = 0; parkbd_writing = 0; parkbd_writelines(3); } } else { if ((parkbd_counter == parkbd_mode + 10) || (jiffies - parkbd_last > 1)) { parkbd_counter = 0; parkbd_buffer = 0; } parkbd_buffer |= (parkbd_readlines() >> 1) << parkbd_counter++; if (parkbd_counter == parkbd_mode + 10) { if (parkbd_port.dev) parkbd_port.dev->interrupt(&parkbd_port, (parkbd_buffer >> (2 - parkbd_mode)) & 0xff, 0); } } parkbd_last = jiffies; } static int parkbd_getport(void) { struct parport *pp; if (parkbd < 0) { printk(KERN_ERR "parkbd: no port specified\n"); return -ENODEV; } for (pp = parport_enumerate(); pp != NULL && (parkbd > 0); pp = pp->next) parkbd--; if (pp == NULL) { printk(KERN_ERR "parkbd: no such parport\n"); return -ENODEV; } parkbd_dev = parport_register_device(pp, "parkbd", NULL, NULL, parkbd_interrupt, PARPORT_DEV_EXCL, NULL); if (!parkbd_dev) return -ENODEV; if (parport_claim(parkbd_dev)) { parport_unregister_device(parkbd_dev); return -EBUSY; } parkbd_start = jiffies; return 0; } int __init parkbd_init(void) { if (parkbd_getport()) return -1; parkbd_writelines(3); parkbd_port.type = parkbd_mode; sprintf(parkbd_phys, "%s/serio0", parkbd_dev->port->name); serio_register_port(&parkbd_port); printk(KERN_INFO "serio: PARKBD %s adapter on %s\n", parkbd_mode ? "AT" : "XT", parkbd_dev->port->name); return 0; } void __exit parkbd_exit(void) { parport_release(parkbd_dev); serio_unregister_port(&parkbd_port); parport_unregister_device(parkbd_dev); } module_init(parkbd_init); module_exit(parkbd_exit); |
From: James S. <jsi...@us...> - 2002-01-22 19:16:17
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/serio In directory usw-pr-cvs1:/tmp/cvs-serv9852 Added Files: Tag: 1.15 i8042.c Log Message: moving stuff around. --- NEW FILE: i8042.c --- /* * $Id: i8042.c,v 1.15 2002/01/22 19:16:15 jsimmons Exp $ * * Copyright (c) 1999-2001 Vojtech Pavlik */ /* * i8042 keyboard and mouse controller driver for Linux */ /* * 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 either by * e-mail - mail your message to <vo...@uc...>, or by paper mail: * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ #include <asm/io.h> #include <linux/delay.h> #include <linux/module.h> #include <linux/ioport.h> #include <linux/config.h> #include <linux/reboot.h> #include <linux/init.h> #include <linux/serio.h> #include "i8042.h" MODULE_AUTHOR("Vojtech Pavlik <vo...@uc...>"); MODULE_DESCRIPTION("i8042 keyboard and mouse controller driver"); MODULE_LICENSE("GPL"); MODULE_PARM(i8042_noaux, "1i"); MODULE_PARM(i8042_unlock, "1i"); MODULE_PARM(i8042_reset, "1i"); MODULE_PARM(i8042_direct, "1i"); static int i8042_noaux; static int i8042_unlock; static int i8042_reset; static int i8042_direct; spinlock_t i8042_lock = SPIN_LOCK_UNLOCKED; struct i8042_values { int irq; unsigned char disable; unsigned char irqen; unsigned char exists; unsigned char *name; unsigned char *phys; }; static struct serio i8042_kbd_port; static struct serio i8042_aux_port; static unsigned char i8042_initial_ctr; static unsigned char i8042_ctr; #ifdef I8042_DEBUG_IO static unsigned long i8042_start; #endif static unsigned long i8042_unxlate_seen[128 / BITS_PER_LONG]; static unsigned char i8042_unxlate_table[128] = { 0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13, 21, 29, 36, 45, 44, 53, 60, 67, 68, 77, 84, 91, 90, 20, 28, 27, 35, 43, 52, 51, 59, 66, 75, 76, 82, 14, 18, 93, 26, 34, 33, 42, 50, 49, 58, 65, 73, 74, 89,124, 17, 41, 88, 5, 6, 4, 12, 3, 11, 2, 10, 1, 9,119,126,108,117,125,123,107,115,116,121,105, 114,122,112,113,127, 96, 97,120, 7, 15, 23, 31, 39, 47, 55, 63, 71, 79, 86, 94, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 87,111, 19, 25, 57, 81, 83, 92, 95, 98, 99,100,101,103,104,106,109,110 }; static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs); /* * The i8042_wait_read() and i8042_wait_write functions wait for the i8042 to * be ready for reading values from it / writing values to it. */ static int i8042_wait_read(void) { int i = 0; while ((~inb(I8042_STATUS_REG) & I8042_STR_OBF) && (i < I8042_CTL_TIMEOUT)) i++; return -(i == I8042_CTL_TIMEOUT); } static int i8042_wait_write(void) { int i = 0; while ((inb(I8042_STATUS_REG) & I8042_STR_IBF) && (i < I8042_CTL_TIMEOUT)) i++; return -(i == I8042_CTL_TIMEOUT); } /* * i8042_flush() flushes all data that may be in the keyboard and mouse buffers * of the i8042 down the toilet. */ static int i8042_flush(void) { unsigned long flags; int i = 0; spin_lock_irqsave(&i8042_lock, flags); while ((inb(I8042_STATUS_REG) & I8042_STR_OBF) && (i++ < I8042_BUFFER_SIZE)) #ifdef I8042_DEBUG_IO printk(KERN_DEBUG "i8042.c: %02x <- i8042 (flush) [%d]\n", inb(I8042_DATA_REG), (int) (jiffies - i8042_start)); #else inb(I8042_DATA_REG); #endif spin_unlock_irqrestore(&i8042_lock, flags); return i; } /* * i8042_command() executes a command on the i8042. It also sends the input parameter(s) * of the commands to it, and receives the output value(s). The parameters are to be * stored in the param array, and the output is placed into the same array. The number * of the parameters and output values is encoded in bits 8-11 of the command * number. */ static int i8042_command(unsigned char *param, int command) { unsigned long flags; int retval = 0, i = 0; spin_lock_irqsave(&i8042_lock, flags); retval = i8042_wait_write(); if (!retval) { #ifdef I8042_DEBUG_IO printk(KERN_DEBUG "i8042.c: %02x -> i8042 (command) [%d]\n", command & 0xff, (int) (jiffies - i8042_start)); #endif outb(command & 0xff, I8042_COMMAND_REG); } if (!retval) for (i = 0; i < ((command >> 12) & 0xf); i++) { if ((retval = i8042_wait_write())) break; #ifdef I8042_DEBUG_IO printk(KERN_DEBUG "i8042.c: %02x -> i8042 (parameter) [%d]\n", param[i], (int) (jiffies - i8042_start)); #endif outb(param[i], I8042_DATA_REG); } if (!retval) for (i = 0; i < ((command >> 8) & 0xf); i++) { if ((retval = i8042_wait_read())) break; if (inb(I8042_STATUS_REG) & I8042_STR_AUXDATA) param[i] = ~inb(I8042_DATA_REG); else param[i] = inb(I8042_DATA_REG); #ifdef I8042_DEBUG_IO printk(KERN_DEBUG "i8042.c: %02x <- i8042 (return) [%d]\n", param[i], (int) (jiffies - i8042_start)); #endif } spin_unlock_irqrestore(&i8042_lock, flags); return retval; } /* * i8042_kbd_write() sends a byte out through the keyboard interface. * It also automatically refreshes the CTR value, since some i8042's * trash their CTR after attempting to send data to an nonexistent * device. */ static int i8042_kbd_write(struct serio *port, unsigned char c) { unsigned long flags; int retval = 0; spin_lock_irqsave(&i8042_lock, flags); if(!(retval = i8042_wait_write())) { #ifdef I8042_DEBUG_IO printk(KERN_DEBUG "i8042.c: %02x -> i8042 (kbd-data) [%d]\n", c, (int) (jiffies - i8042_start)); #endif outb(c, I8042_DATA_REG); } spin_unlock_irqrestore(&i8042_lock, flags); return retval; } /* * i8042_aux_write() sends a byte out through the aux interface. */ static int i8042_aux_write(struct serio *port, unsigned char c) { int retval; /* * Send the byte out. */ retval = i8042_command(&c, I8042_CMD_AUX_SEND); /* * Here we restore the CTR value. I don't know why, but i8042's in half-AT * mode tend to trash their CTR when doing the AUX_SEND command. */ retval += i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR); /* * Make sure the interrupt happens and the character is received even * in the case the IRQ isn't wired, so that we can receive further * characters later. */ i8042_interrupt(0, port, NULL); return retval; } /* * i8042_open() is called when a port is open by the higher layer. * It allocates an interrupt and enables the port. */ static int i8042_open(struct serio *port) { struct i8042_values *values = port->driver; /* * Allocate the interrupt */ if (request_irq(values->irq, i8042_interrupt, 0, "i8042", NULL)) { printk(KERN_ERR "i8042.c: Can't get irq %d for %s\n", values->irq, values->name); return -1; } /* * Enable the device and its interrupt. */ i8042_ctr |= values->irqen; i8042_ctr &= ~values->disable; if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) { printk(KERN_ERR "i8042.c: Can't write CTR while opening %s.\n", values->name); return -1; } /* * Flush buffers */ i8042_flush(); return 0; } /* * i8042_close() frees the interrupt, and disables the interface when the * upper layer doesn't need it anymore. */ static void i8042_close(struct serio *port) { struct i8042_values *values = port->driver; /* * Disable the device and its interrupt. */ i8042_ctr &= ~values->irqen; i8042_ctr |= values->disable; if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) { printk(KERN_ERR "i8042.c: Can't write CTR while closing %s.\n", values->name); return; } /* * Free the interrupt */ free_irq(values->irq, NULL); } /* * Structures for registering the devices in the serio.c module. */ static struct i8042_values i8042_kbd_values = { irq: I8042_KBD_IRQ, irqen: I8042_CTR_KBDINT, disable: I8042_CTR_KBDDIS, name: "KBD", exists: 0, }; static struct serio i8042_kbd_port = { type: SERIO_8042, write: i8042_kbd_write, open: i8042_open, close: i8042_close, driver: &i8042_kbd_values, name: "i8042 Kbd Port", phys: "isa0060/serio0", }; static struct i8042_values i8042_aux_values = { irq: I8042_AUX_IRQ, irqen: I8042_CTR_AUXINT, disable: I8042_CTR_AUXDIS, name: "AUX", exists: 0, }; static struct serio i8042_aux_port = { type: SERIO_8042, write: i8042_aux_write, open: i8042_open, close: i8042_close, driver: &i8042_aux_values, name: "i8042 Aux Port", phys: "isa0060/serio1", }; /* * i8042_interrupt() is the most important function in this driver - * it handles the interrupts from the i8042, and sends incoming bytes * to the upper layers. */ static void i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned long flags; unsigned char str, data; spin_lock_irqsave(&i8042_lock, flags); while ((str = inb(I8042_STATUS_REG)) & I8042_STR_OBF) { data = inb(I8042_DATA_REG); #ifdef I8042_DEBUG_IO printk(KERN_DEBUG "i8042.c: %02x <- i8042 (interrupt-%s) [%d]\n", data, (str & I8042_STR_AUXDATA) ? "aux" : "kbd", (int) (jiffies - i8042_start)); #endif if (i8042_aux_values.exists && (str & I8042_STR_AUXDATA)) { if (i8042_aux_port.dev) i8042_aux_port.dev->interrupt(&i8042_aux_port, data, 0); } else { if (i8042_kbd_values.exists && i8042_kbd_port.dev) { if (!i8042_direct) { if (data > 0x7f) { if (test_and_clear_bit(data & 0x7f, i8042_unxlate_seen)) { i8042_kbd_port.dev->interrupt(&i8042_kbd_port, 0xf0, 0); data = i8042_unxlate_table[data & 0x7f]; } } else { set_bit(data, i8042_unxlate_seen); data = i8042_unxlate_table[data]; } } i8042_kbd_port.dev->interrupt(&i8042_kbd_port, data, 0); } } } spin_unlock_irqrestore(&i8042_lock, flags); } /* * i8042_controller init initializes the i8042 controller, and, * most importantly, sets it into non-xlated mode. */ static int __init i8042_controller_init(void) { /* * Check the i/o region before we touch it. */ #if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__) if (check_region(I8042_DATA_REG, 16)) { printk(KERN_ERR "i8042.c: %#x port already in use!\n", I8042_DATA_REG); return -1; } #endif /* * Test the i8042. We need to know if it thinks it's working correctly * before doing anything else. */ i8042_flush(); if (i8042_reset) { unsigned char param; if (i8042_command(¶m, I8042_CMD_CTL_TEST)) { printk(KERN_ERR "i8042.c: i8042 controller self test timeout.\n"); return -1; } if (param != I8042_RET_CTL_TEST) { printk(KERN_ERR "i8042.c: i8042 controller selftest failed. (%#x != %#x)\n", param, I8042_RET_CTL_TEST); return -1; } } /* * Read the CTR. */ if (i8042_command(&i8042_ctr, I8042_CMD_CTL_RCTR)) { printk(KERN_ERR "i8042.c: Can't read CTR while initializing i8042.\n"); return -1; } /* * Save the CTR for restoral on unload / reboot. */ i8042_initial_ctr = i8042_ctr; /* * Disable both interfaces and their interrupts. */ i8042_ctr |= I8042_CTR_KBDDIS; i8042_ctr &= ~I8042_CTR_KBDINT; /* * Handle keylock. */ if (~inb(I8042_STATUS_REG) & I8042_STR_KEYLOCK) { if (i8042_unlock) { i8042_ctr |= I8042_CTR_IGNKEYLOCK; } else { printk(KERN_WARNING "i8042.c: Warning: Keylock active.\n"); } } /* * Set nontranslated mode for the kbd interface. This is vital for a working * scancode set 2/3 support. After this the kbd interface becomes a simple serial * in/out, like the aux interface is. If the user doesn't wish this, the driver * tries to untranslate the values after the i8042 translates them. */ if (i8042_direct) i8042_ctr &= ~I8042_CTR_XLATE; /* * Write CTR back. */ if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) { printk(KERN_ERR "i8042.c: Can't write CTR while initializing i8042.\n"); return -1; } return 0; } /* * Here we try to reset everything back to a state in which the BIOS will be * able to talk to the hardware when rebooting. */ void i8042_controller_cleanup(void) { /* * Reset the controller. */ if (i8042_reset) { unsigned char param; if (i8042_command(¶m, I8042_CMD_CTL_TEST)) printk(KERN_ERR "i8042.c: i8042 controller reset timeout.\n"); } /* * Restore the original control register setting. */ i8042_ctr = i8042_initial_ctr; if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) printk(KERN_WARNING "i8042.c: Can't restore CTR.\n"); /* * Reset anything that is connected to the ports if the ports * are enabled in the original config. */ if (i8042_kbd_values.exists) i8042_kbd_write(&i8042_kbd_port, 0xff); if (i8042_aux_values.exists) i8042_aux_write(&i8042_aux_port, 0xff); } /* * i8042_check_aux() applies as much paranoia as it can at detecting * the presence of an AUX interface. */ static int __init i8042_check_aux(struct i8042_values *values, struct serio *port) { unsigned char param; i8042_flush(); /* * Internal loopback test - filters out AT-type i8042's */ param = 0x5a; if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param != 0xa5) return -1; /* * External connection test - filters out AT-soldered PS/2 i8042's */ if (i8042_command(¶m, I8042_CMD_AUX_TEST) || param) return -1; /* * Bit assignment test - filters out PS/2 i8042's in AT mode */ if (i8042_command(¶m, I8042_CMD_AUX_DISABLE)) return -1; if (i8042_command(¶m, I8042_CMD_CTL_RCTR) || (~param & I8042_CTR_AUXDIS)) return -1; if (i8042_command(¶m, I8042_CMD_AUX_TEST) || param) { /* * We've got an old AMI i8042 with 'Bad Cache' commands. */ i8042_command(¶m, I8042_CMD_AUX_ENABLE); return -1; } if (i8042_command(¶m, I8042_CMD_AUX_ENABLE)) return -1; if (i8042_command(¶m, I8042_CMD_CTL_RCTR) || (param & I8042_CTR_AUXDIS)) return -1; /* * Disable the interface. */ i8042_ctr |= I8042_CTR_AUXDIS; i8042_ctr &= ~I8042_CTR_AUXINT; if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) return -1; return 0; } /* * i8042_port_register() marks the device as existing, * registers it, and reports to the user. */ static int __init i8042_port_register(struct i8042_values *values, struct serio *port) { values->exists = 1; serio_register_port(port); printk(KERN_INFO "serio: i8042 %s port at %#x,%#x irq %d\n", values->name, I8042_DATA_REG, I8042_COMMAND_REG, values->irq); return 0; } /* * Module init and cleanup functions. */ void __init i8042_setup(char *str, int *ints) { if (!strcmp(str, "i8042_reset=1")) i8042_reset = 1; if (!strcmp(str, "i8042_noaux=1")) i8042_noaux = 1; if (!strcmp(str, "i8042_unlock=1")) i8042_unlock = 1; if (!strcmp(str, "i8042_direct=1")) i8042_direct = 1; } /* * Reset the 8042 back to original mode. */ static int i8042_notify_sys(struct notifier_block *this, unsigned long code, void *unused) { if (code==SYS_DOWN || code==SYS_HALT) i8042_controller_cleanup(); return NOTIFY_DONE; } static struct notifier_block i8042_notifier= { i8042_notify_sys, NULL, 0 }; int __init i8042_init(void) { #ifdef I8042_DEBUG_IO i8042_start = jiffies; #endif if (i8042_controller_init()) return -ENODEV; i8042_port_register(&i8042_kbd_values, &i8042_kbd_port); if (!i8042_noaux && !i8042_check_aux(&i8042_aux_values, &i8042_aux_port)) i8042_port_register(&i8042_aux_values, &i8042_aux_port); /* * On ix86 platforms touching the i8042 data register region can do really * bad things. Because of this the region is always reserved on ix86 boxes. */ #if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__) request_region(I8042_DATA_REG, 16, "i8042"); #endif register_reboot_notifier(&i8042_notifier); return 0; } void __exit i8042_exit(void) { unregister_reboot_notifier(&i8042_notifier); if (i8042_kbd_values.exists) serio_unregister_port(&i8042_kbd_port); if (i8042_aux_values.exists) serio_unregister_port(&i8042_aux_port); i8042_controller_cleanup(); #if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__) release_region(I8042_DATA_REG, 16); #endif } module_init(i8042_init); module_exit(i8042_exit); |
From: James S. <jsi...@us...> - 2002-01-22 19:15:40
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/serio In directory usw-pr-cvs1:/tmp/cvs-serv9553 Added Files: Tag: 1.7 i8042.h Log Message: moving stuff around. --- NEW FILE: i8042.h --- #ifndef _I8042_H #define _I8042_H /* * $Id: i8042.h,v 1.7 2002/01/22 19:15:37 jsimmons Exp $ * * Copyright (c) 1999-2001 Vojtech Pavlik */ /* * 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 either by * e-mail - mail your message to <vo...@uc...>, or by paper mail: * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ /* * If you want to reset your i8042 upon boot, define this. */ #undef I8042_RESET /* * If you want to trace all the i/o the i8042 module does for * debugging purposes, define this. */ #undef I8042_DEBUG_IO /* * On most PC based systems the keyboard IRQ is 1. */ #define I8042_KBD_IRQ CONFIG_I8042_KBD_IRQ /* * On most PC based systems the aux port IRQ is 12. There are exceptions, * though. Unfortunately IRQ probing is not possible without touching * the device attached to the port. */ #define I8042_AUX_IRQ CONFIG_I8042_AUX_IRQ /* * The speed of the i8042's varies. This timeout equals 100 ms on a system * with 8.3 MHz i8042 clock, which should be most common. It should not need * to be raised / lowered. */ #define I8042_CTL_TIMEOUT 83000 /* * Register numbers. */ #define I8042_COMMAND_REG CONFIG_I8042_REG_BASE + 4 #define I8042_STATUS_REG CONFIG_I8042_REG_BASE + 4 #define I8042_DATA_REG CONFIG_I8042_REG_BASE /* * Status register bits. */ #define I8042_STR_PARITY 0x80 #define I8042_STR_TIMEOUT 0x40 #define I8042_STR_AUXDATA 0x20 #define I8042_STR_KEYLOCK 0x10 #define I8042_STR_CMDDAT 0x08 #define I8042_STR_IBF 0x02 #define I8042_STR_OBF 0x01 /* * Control register bits. */ #define I8042_CTR_KBDINT 0x01 #define I8042_CTR_AUXINT 0x02 #define I8042_CTR_IGNKEYLOCK 0x08 #define I8042_CTR_KBDDIS 0x10 #define I8042_CTR_AUXDIS 0x20 #define I8042_CTR_XLATE 0x40 /* * Commands. */ #define I8042_CMD_CTL_RCTR 0x0120 #define I8042_CMD_CTL_WCTR 0x1060 #define I8042_CMD_CTL_TEST 0x01aa #define I8042_CMD_KBD_DISABLE 0x00ad #define I8042_CMD_KBD_ENABLE 0x00ae #define I8042_CMD_KBD_TEST 0x01ab #define I8042_CMD_KBD_LOOP 0x11d2 #define I8042_CMD_AUX_DISABLE 0x00a7 #define I8042_CMD_AUX_ENABLE 0x00a8 #define I8042_CMD_AUX_TEST 0x01a9 #define I8042_CMD_AUX_SEND 0x10d4 #define I8042_CMD_AUX_LOOP 0x11d3 /* * Return codes. */ #define I8042_RET_CTL_TEST 0x55 /* * Expected maximum internal i8042 buffer size. This is used for flushing * the i8042 buffers. 32 should be more than enough. */ #define I8042_BUFFER_SIZE 32 #endif _I8042_H |
From: James S. <jsi...@us...> - 2002-01-22 19:14:08
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/serio In directory usw-pr-cvs1:/tmp/cvs-serv8928 Added Files: Tag: 1.11 ct82c710.c Log Message: moving stuff around. --- NEW FILE: ct82c710.c --- /* * $Id: ct82c710.c,v 1.11 2002/01/22 19:14:05 jsimmons Exp $ * * Copyright (c) 1999-2001 Vojtech Pavlik */ /* * 82C710 C&T mouse port chip driver for Linux */ /* * 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 either by * e-mail - mail your message to <vo...@uc...>, or by paper mail: * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ #include <asm/io.h> #include <linux/delay.h> #include <linux/module.h> #include <linux/ioport.h> #include <linux/config.h> #include <linux/init.h> #include <linux/serio.h> MODULE_AUTHOR("Vojtech Pavlik <vo...@uc...>"); MODULE_DESCRIPTION("82C710 C&T mouse port chip driver"); MODULE_LICENSE("GPL"); static char ct82c710_name[] = "C&T 82c710 mouse port"; static char ct82c710_phys[16]; /* * ct82c710 interface */ #define CT82C710_DEV_IDLE 0x01 /* Device Idle */ #define CT82C710_RX_FULL 0x02 /* Device Char received */ #define CT82C710_TX_IDLE 0x04 /* Device XMIT Idle */ #define CT82C710_RESET 0x08 /* Device Reset */ #define CT82C710_INTS_ON 0x10 /* Device Interrupt On */ #define CT82C710_ERROR_FLAG 0x20 /* Device Error */ #define CT82C710_CLEAR 0x40 /* Device Clear */ #define CT82C710_ENABLE 0x80 /* Device Enable */ #define CT82C710_IRQ 12 static int ct82c710_data = 0; static int ct82c710_status = 0; static void ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs); /* * Wait for device to send output char and flush any input char. */ static int ct82c170_wait(void) { int timeout = 60000; while ((inb(ct82c710_status) & (CT82C710_RX_FULL | CT82C710_TX_IDLE | CT82C710_DEV_IDLE)) != (CT82C710_DEV_IDLE | CT82C710_TX_IDLE) && timeout) { if (inb_p(ct82c710_status) & CT82C710_RX_FULL) inb_p(ct82c710_data); udelay(1); timeout--; } return !timeout; } static void ct82c710_close(struct serio *serio) { if (ct82c170_wait()) printk(KERN_WARNING "ct82c710.c: Device busy in close()\n"); outb_p(inb_p(ct82c710_status) & ~(CT82C710_ENABLE | CT82C710_INTS_ON), ct82c710_status); if (ct82c170_wait()) printk(KERN_WARNING "ct82c710.c: Device busy in close()\n"); free_irq(CT82C710_IRQ, NULL); } static int ct82c710_open(struct serio *serio) { unsigned char status; if (request_irq(CT82C710_IRQ, ct82c710_interrupt, 0, "ct82c710", NULL)) return -1; status = inb_p(ct82c710_status); status |= (CT82C710_ENABLE | CT82C710_RESET); outb_p(status, ct82c710_status); status &= ~(CT82C710_RESET); outb_p(status, ct82c710_status); status |= CT82C710_INTS_ON; outb_p(status, ct82c710_status); /* Enable interrupts */ while (ct82c170_wait()) { printk(KERN_ERR "ct82c710: Device busy in open()\n"); status &= ~(CT82C710_ENABLE | CT82C710_INTS_ON); outb_p(status, ct82c710_status); free_irq(CT82C710_IRQ, NULL); return -1; } return 0; } /* * Write to the 82C710 mouse device. */ static int ct82c710_write(struct serio *port, unsigned char c) { if (ct82c170_wait()) return -1; outb_p(c, ct82c710_data); return 0; } static struct serio ct82c710_port = { type: SERIO_8042, name: ct82c710_name, phys: ct82c710_phys, write: ct82c710_write, open: ct82c710_open, close: ct82c710_close, }; /* * Interrupt handler for the 82C710 mouse port. A character * is waiting in the 82C710. */ static void ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs) { if (ct82c710_port.dev) ct82c710_port.dev->interrupt(&ct82c710_port, inb(ct82c710_data), 0); } /* * See if we can find a 82C710 device. Read mouse address. */ static int __init ct82c710_probe(void) { outb_p(0x55, 0x2fa); /* Any value except 9, ff or 36 */ outb_p(0xaa, 0x3fa); /* Inverse of 55 */ outb_p(0x36, 0x3fa); /* Address the chip */ outb_p(0xe4, 0x3fa); /* 390/4; 390 = config address */ outb_p(0x1b, 0x2fa); /* Inverse of e4 */ outb_p(0x0f, 0x390); /* Write index */ if (inb_p(0x391) != 0xe4) /* Config address found? */ return -1; /* No: no 82C710 here */ outb_p(0x0d, 0x390); /* Write index */ ct82c710_data = inb_p(0x391) << 2; /* Get mouse I/O address */ ct82c710_status = ct82c710_data + 1; outb_p(0x0f, 0x390); outb_p(0x0f, 0x391); /* Close config mode */ return 0; } int __init ct82c710_init(void) { if (ct82c710_probe()) return -ENODEV; if (request_region(ct82c710_data, 2, "ct82c710")) return -EBUSY; sprintf(ct82c710_phys, "isa%04x/serio0", ct82c710_data); serio_register_port(&ct82c710_port); printk(KERN_INFO "serio: C&T 82c710 mouse port at %#x irq %d\n", ct82c710_data, CT82C710_IRQ); return 0; } void __exit ct82c710_exit(void) { serio_unregister_port(&ct82c710_port); release_region(ct82c710_data, 2); } module_init(ct82c710_init); module_exit(ct82c710_exit); |
From: James S. <jsi...@us...> - 2002-01-22 19:09:50
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/serio In directory usw-pr-cvs1:/tmp/cvs-serv6447/serio Log Message: Directory /cvsroot/linuxconsole/ruby/linux/drivers/input/serio added to the repository |
From: James S. <jsi...@us...> - 2002-01-22 19:09:41
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/mouse In directory usw-pr-cvs1:/tmp/cvs-serv6334/mouse Log Message: Directory /cvsroot/linuxconsole/ruby/linux/drivers/input/mouse added to the repository |
From: James S. <jsi...@us...> - 2002-01-22 19:09:20
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/gameport In directory usw-pr-cvs1:/tmp/cvs-serv6160/gameport Log Message: Directory /cvsroot/linuxconsole/ruby/linux/drivers/input/gameport added to the repository |
From: James S. <jsi...@us...> - 2002-01-22 19:08:31
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/keyboard In directory usw-pr-cvs1:/tmp/cvs-serv5845/keyboard Log Message: Directory /cvsroot/linuxconsole/ruby/linux/drivers/input/keyboard added to the repository |
From: James S. <jsi...@us...> - 2002-01-22 19:07:49
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce In directory usw-pr-cvs1:/tmp/cvs-serv5542/iforce Log Message: Directory /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce added to the repository |
From: James S. <jsi...@us...> - 2002-01-22 18:46:10
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick In directory usw-pr-cvs1:/tmp/cvs-serv29565 Added Files: Tag: 1.20 a3d.c Log Message: Moving files around --- NEW FILE: a3d.c --- /* * $Id: a3d.c,v 1.20 2002/01/22 18:46:06 jsimmons Exp $ * * Copyright (c) 1998-2001 Vojtech Pavlik */ /* * FP-Gaming Assasin 3D joystick driver for Linux */ /* * 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 either by * e-mail - mail your message to <vo...@uc...>, or by paper mail: * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/init.h> #include <linux/gameport.h> #include <linux/input.h> MODULE_AUTHOR("Vojtech Pavlik <vo...@uc...>"); MODULE_DESCRIPTION("FP-Gaming Assasin 3D joystick driver"); MODULE_LICENSE("GPL"); #define A3D_MAX_START 400 /* 400 us */ #define A3D_MAX_STROBE 60 /* 40 us */ #define A3D_DELAY_READ 3 /* 3 ms */ #define A3D_MAX_LENGTH 40 /* 40*3 bits */ #define A3D_REFRESH_TIME HZ/50 /* 20 ms */ #define A3D_MODE_A3D 1 /* Assassin 3D */ #define A3D_MODE_PAN 2 /* Panther */ #define A3D_MODE_OEM 3 /* Panther OEM version */ #define A3D_MODE_PXL 4 /* Panther XL */ char *a3d_names[] = { NULL, "FP-Gaming Assassin 3D", "MadCatz Panther", "OEM Panther", "MadCatz Panther XL", "MadCatz Panther XL w/ rudder" }; struct a3d { struct gameport *gameport; struct gameport adc; struct input_dev dev; struct timer_list timer; int axes[4]; int buttons; int mode; int length; int used; int reads; int bads; char phys[32]; char adcphys[32]; }; /* * a3d_read_packet() reads an Assassin 3D packet. */ static int a3d_read_packet(struct gameport *gameport, int length, char *data) { unsigned long flags; unsigned char u, v; unsigned int t, s; int i; i = 0; t = gameport_time(gameport, A3D_MAX_START); s = gameport_time(gameport, A3D_MAX_STROBE); __save_flags(flags); __cli(); gameport_trigger(gameport); v = gameport_read(gameport); while (t > 0 && i < length) { t--; u = v; v = gameport_read(gameport); if (~v & u & 0x10) { data[i++] = v >> 5; t = s; } } __restore_flags(flags); return i; } /* * a3d_csum() computes checksum of triplet packet */ static int a3d_csum(char *data, int count) { int i, csum = 0; for (i = 0; i < count - 2; i++) csum += data[i]; return (csum & 0x3f) != ((data[count - 2] << 3) | data[count - 1]); } static void a3d_read(struct a3d *a3d, unsigned char *data) { struct input_dev *dev = &a3d->dev; switch (a3d->mode) { case A3D_MODE_A3D: case A3D_MODE_OEM: case A3D_MODE_PAN: input_report_rel(dev, REL_X, ((data[5] << 6) | (data[6] << 3) | data[ 7]) - ((data[5] & 4) << 7)); input_report_rel(dev, REL_Y, ((data[8] << 6) | (data[9] << 3) | data[10]) - ((data[8] & 4) << 7)); input_report_key(dev, BTN_RIGHT, data[2] & 1); input_report_key(dev, BTN_LEFT, data[3] & 2); input_report_key(dev, BTN_MIDDLE, data[3] & 4); a3d->axes[0] = ((signed char)((data[11] << 6) | (data[12] << 3) | (data[13]))) + 128; a3d->axes[1] = ((signed char)((data[14] << 6) | (data[15] << 3) | (data[16]))) + 128; a3d->axes[2] = ((signed char)((data[17] << 6) | (data[18] << 3) | (data[19]))) + 128; a3d->axes[3] = ((signed char)((data[20] << 6) | (data[21] << 3) | (data[22]))) + 128; a3d->buttons = ((data[3] << 3) | data[4]) & 0xf; return; case A3D_MODE_PXL: input_report_rel(dev, REL_X, ((data[ 9] << 6) | (data[10] << 3) | data[11]) - ((data[ 9] & 4) << 7)); input_report_rel(dev, REL_Y, ((data[12] << 6) | (data[13] << 3) | data[14]) - ((data[12] & 4) << 7)); input_report_key(dev, BTN_RIGHT, data[2] & 1); input_report_key(dev, BTN_LEFT, data[3] & 2); input_report_key(dev, BTN_MIDDLE, data[3] & 4); input_report_key(dev, BTN_SIDE, data[7] & 2); input_report_key(dev, BTN_EXTRA, data[7] & 4); input_report_abs(dev, ABS_X, ((signed char)((data[15] << 6) | (data[16] << 3) | (data[17]))) + 128); input_report_abs(dev, ABS_Y, ((signed char)((data[18] << 6) | (data[19] << 3) | (data[20]))) + 128); input_report_abs(dev, ABS_RUDDER, ((signed char)((data[21] << 6) | (data[22] << 3) | (data[23]))) + 128); input_report_abs(dev, ABS_THROTTLE, ((signed char)((data[24] << 6) | (data[25] << 3) | (data[26]))) + 128); input_report_abs(dev, ABS_HAT0X, ( data[5] & 1) - ((data[5] >> 2) & 1)); input_report_abs(dev, ABS_HAT0Y, ((data[5] >> 1) & 1) - ((data[6] >> 2) & 1)); input_report_abs(dev, ABS_HAT1X, ((data[4] >> 1) & 1) - ( data[3] & 1)); input_report_abs(dev, ABS_HAT1Y, ((data[4] >> 2) & 1) - ( data[4] & 1)); input_report_key(dev, BTN_TRIGGER, data[8] & 1); input_report_key(dev, BTN_THUMB, data[8] & 2); input_report_key(dev, BTN_TOP, data[8] & 4); input_report_key(dev, BTN_PINKIE, data[7] & 1); return; } } /* * a3d_timer() reads and analyzes A3D joystick data. */ static void a3d_timer(unsigned long private) { struct a3d *a3d = (void *) private; unsigned char data[A3D_MAX_LENGTH]; a3d->reads++; if (a3d_read_packet(a3d->gameport, a3d->length, data) != a3d->length || data[0] != a3d->mode || a3d_csum(data, a3d->length)) a3d->bads++; else a3d_read(a3d, data); mod_timer(&a3d->timer, jiffies + A3D_REFRESH_TIME); } /* * a3d_adc_cooked_read() copies the acis and button data to the * callers arrays. It could do the read itself, but the caller could * call this more than 50 times a second, which would use too much CPU. */ int a3d_adc_cooked_read(struct gameport *gameport, int *axes, int *buttons) { struct a3d *a3d = gameport->driver; int i; for (i = 0; i < 4; i++) axes[i] = (a3d->axes[i] < 254) ? a3d->axes[i] : -1; *buttons = a3d->buttons; return 0; } /* * a3d_adc_open() is the gameport open routine. It refuses to serve * any but cooked data. */ int a3d_adc_open(struct gameport *gameport, int mode) { struct a3d *a3d = gameport->driver; if (mode != GAMEPORT_MODE_COOKED) return -1; if (!a3d->used++) mod_timer(&a3d->timer, jiffies + A3D_REFRESH_TIME); return 0; } /* * a3d_adc_close() is a callback from the input close routine. */ static void a3d_adc_close(struct gameport *gameport) { struct a3d *a3d = gameport->driver; if (!--a3d->used) del_timer(&a3d->timer); } /* * a3d_open() is a callback from the input open routine. */ static int a3d_open(struct input_dev *dev) { struct a3d *a3d = dev->private; if (!a3d->used++) mod_timer(&a3d->timer, jiffies + A3D_REFRESH_TIME); return 0; } /* * a3d_close() is a callback from the input close routine. */ static void a3d_close(struct input_dev *dev) { struct a3d *a3d = dev->private; if (!--a3d->used) del_timer(&a3d->timer); } /* * a3d_connect() probes for A3D joysticks. */ static void a3d_connect(struct gameport *gameport, struct gameport_dev *dev) { struct a3d *a3d; unsigned char data[A3D_MAX_LENGTH]; int i; if (!(a3d = kmalloc(sizeof(struct a3d), GFP_KERNEL))) return; memset(a3d, 0, sizeof(struct a3d)); gameport->private = a3d; a3d->gameport = gameport; init_timer(&a3d->timer); a3d->timer.data = (long) a3d; a3d->timer.function = a3d_timer; if (gameport_open(gameport, dev, GAMEPORT_MODE_RAW)) goto fail1; i = a3d_read_packet(gameport, A3D_MAX_LENGTH, data); if (!i || a3d_csum(data, i)) goto fail2; a3d->mode = data[0]; if (!a3d->mode || a3d->mode > 5) { printk(KERN_WARNING "a3d.c: Unknown A3D device detected " "(%s, id=%d), contact <vo...@uc...>\n", gameport->phys, a3d->mode); goto fail2; } sprintf(a3d->phys, "%s/input0", gameport->phys); sprintf(a3d->adcphys, "%s/gameport0", gameport->phys); if (a3d->mode == A3D_MODE_PXL) { int axes[] = { ABS_X, ABS_Y, ABS_THROTTLE, ABS_RUDDER }; a3d->length = 33; a3d->dev.evbit[0] |= BIT(EV_ABS) | BIT(EV_KEY) | BIT(EV_REL); a3d->dev.relbit[0] |= BIT(REL_X) | BIT(REL_Y); a3d->dev.absbit[0] |= BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_THROTTLE) | BIT(ABS_RUDDER) | BIT(ABS_HAT0X) | BIT(ABS_HAT0Y) | BIT(ABS_HAT1X) | BIT(ABS_HAT1Y); a3d->dev.keybit[LONG(BTN_MOUSE)] |= BIT(BTN_RIGHT) | BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_SIDE) | BIT(BTN_EXTRA); a3d->dev.keybit[LONG(BTN_JOYSTICK)] |= BIT(BTN_TRIGGER) | BIT(BTN_THUMB) | BIT(BTN_TOP) | BIT(BTN_PINKIE); a3d_read(a3d, data); for (i = 0; i < 4; i++) { if (i < 2) { a3d->dev.absmin[axes[i]] = 48; a3d->dev.absmax[axes[i]] = a3d->dev.abs[axes[i]] * 2 - 48; a3d->dev.absflat[axes[i]] = 8; } else { a3d->dev.absmin[axes[i]] = 2; a3d->dev.absmax[axes[i]] = 253; } a3d->dev.absmin[ABS_HAT0X + i] = -1; a3d->dev.absmax[ABS_HAT0X + i] = 1; } } else { a3d->length = 29; a3d->dev.evbit[0] |= BIT(EV_KEY) | BIT(EV_REL); a3d->dev.relbit[0] |= BIT(REL_X) | BIT(REL_Y); a3d->dev.keybit[LONG(BTN_MOUSE)] |= BIT(BTN_RIGHT) | BIT(BTN_LEFT) | BIT(BTN_MIDDLE); a3d->adc.driver = a3d; a3d->adc.open = a3d_adc_open; a3d->adc.close = a3d_adc_close; a3d->adc.cooked_read = a3d_adc_cooked_read; a3d->adc.fuzz = 1; a3d->adc.name = a3d_names[a3d->mode]; a3d->adc.phys = a3d->adcphys; a3d->adc.idbus = BUS_GAMEPORT; a3d->adc.idvendor = GAMEPORT_ID_VENDOR_MADCATZ; a3d->adc.idproduct = a3d->mode; a3d->adc.idversion = 0x0100; a3d_read(a3d, data); gameport_register_port(&a3d->adc); printk(KERN_INFO "gameport: %s on %s\n", a3d_names[a3d->mode], gameport->phys); } a3d->dev.private = a3d; a3d->dev.open = a3d_open; a3d->dev.close = a3d_close; a3d->dev.name = a3d_names[a3d->mode]; a3d->dev.phys = a3d->phys; a3d->dev.idbus = BUS_GAMEPORT; a3d->dev.idvendor = GAMEPORT_ID_VENDOR_MADCATZ; a3d->dev.idproduct = a3d->mode; a3d->dev.idversion = 0x0100; input_register_device(&a3d->dev); printk(KERN_INFO "input: %s on %s\n", a3d_names[a3d->mode], a3d->phys); return; fail2: gameport_close(gameport); fail1: kfree(a3d); } static void a3d_disconnect(struct gameport *gameport) { struct a3d *a3d = gameport->private; input_unregister_device(&a3d->dev); if (a3d->mode < A3D_MODE_PXL) gameport_unregister_port(&a3d->adc); gameport_close(gameport); kfree(a3d); } static struct gameport_dev a3d_dev = { connect: a3d_connect, disconnect: a3d_disconnect, }; int __init a3d_init(void) { gameport_register_device(&a3d_dev); return 0; } void __exit a3d_exit(void) { gameport_unregister_device(&a3d_dev); } module_init(a3d_init); module_exit(a3d_exit); |
From: James S. <jsi...@us...> - 2002-01-22 18:44:42
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick In directory usw-pr-cvs1:/tmp/cvs-serv28981/joystick Log Message: Directory /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick added to the repository |
From: johann d. <jd...@us...> - 2002-01-21 22:37:53
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv753 Modified Files: input.h Log Message: Removed only_one_driver flag from struct input_dev. I introduced a flag named only_one_writer some long time ago. It turned out I did not need it, and nobody uses it. I should have wiped this one out earlier. Index: input.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/input.h,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- input.h 2002/01/02 11:59:56 1.57 +++ input.h 2002/01/21 22:37:50 1.58 @@ -701,8 +701,6 @@ int absfuzz[ABS_MAX + 1]; int absflat[ABS_MAX + 1]; - int only_one_writer; - int (*open)(struct input_dev *dev); void (*close)(struct input_dev *dev); int (*accept)(struct input_dev *dev, struct file *file); |
From: Vojtech P. <vo...@us...> - 2002-01-20 17:54:48
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv24490 Modified Files: joystick.h Log Message: Move the joystick.h to LGPL, so that the joystick API can be implemented under other OSes as well. Index: joystick.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/joystick.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- joystick.h 2001/09/25 09:37:57 1.6 +++ joystick.h 2002/01/20 17:54:44 1.7 @@ -10,23 +10,23 @@ */ /* - * 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 header file is free software; you can redistribute it and/or modify it + * under the terms of the GNU Library 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. + * 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 Library 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 + * You should have received a copy of the GNU Library 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 either by - * e-mail - mail your message to <vo...@uc...>, or by paper mail: - * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic + * Should you need to contact me, the author, you can do so either by e-mail - + * mail your message to <vo...@uc...>, or by paper mail: Vojtech Pavlik, + * Simunkova 1594, Prague 8, 182 00 Czech Republic */ #include <asm/types.h> |
From: johann d. <jd...@us...> - 2002-01-20 16:18:29
|
Update of /cvsroot/linuxconsole/ruby/linux/Documentation/input In directory usw-pr-cvs1:/tmp/cvs-serv29044 Modified Files: iforce-protocol.txt Log Message: Added description of packets sent by the device to the computer. Index: iforce-protocol.txt =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/Documentation/input/iforce-protocol.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- iforce-protocol.txt 2001/10/26 21:10:35 1.12 +++ iforce-protocol.txt 2002/01/20 16:18:26 1.13 @@ -1,21 +1,58 @@ ** Introduction -This document describes what I managed to discover about the protocole used to specify force effects to I-Force 2.0 devices. -None of this information comes from Immerse. That's why you should not trust what is written in this document. This document is intended to help undertstanding the protocole. -This is not a reference. Comments and corrections are welcome. I made all these tests on my Boeder I-Force ForceFeedback Wheel. Please note I haven't made any test on joysticks. -To contact me, send email to: de...@if... +This document describes what I managed to discover about the protocol used to +specify force effects to I-Force 2.0 devices. None of this information comes +from Immerse. That's why you should not trust what is written in this +document. This document is intended to help understanding the protocol. +This is not a reference. Comments and corrections are welcome. To contact me, +send an email to: de...@if... ** WARNING ** -I may not be held responsible for any dammage or harm caused if you try to send data to your I-Force device based on what you read in this document. +I may not be held responsible for any dammage or harm caused if you try to +send data to your I-Force device based on what you read in this document. ** Preliminary Notes: -All values are hexadecimal with big-endian encoding (msb on the left). Beware, values inside packets are encoded using little-endian. -Bytes whose roles are unknown are marked ??? -Information that needs deeper inspection is marked (?) +All values are hexadecimal with big-endian encoding (msb on the left). Beware, +values inside packets are encoded using little-endian. Bytes whose roles are +unknown are marked ??? Information that needs deeper inspection is marked (?) ** General form of a packet ** +This is how packets look when the device uses the rs232 to communicate. 2B OP LEN DATA CS CS is the checksum. It is equal to the exclusive or of all bytes. +When using USB: +OP DATA +The 2B, LEN and CS fields have disappeared, probably because USB handles frames and +data corruption is handled or unsignificant. + +First, I describe effects that are sent by the device to the computer + +** Device input state +This packet is used to indicate the state of each button and the value of each +axis +OP= 01 for a joystick, 03 for a wheel +LEN= Varies from device to device +00 X-Axis lsb +01 X-Axis msb +02 Y-Axis lsb, or gas pedal for a wheel +03 Y-Axis msb, or brake pedal for a wheel +04 Throttle +05 Buttons +06 Lower 4 bits: Buttons + Upper 4 bits: Hat +07 Rudder + +** Device effects states +OP= 02 +LEN= Varies +00 ? Bit 1 (Value 2) is the value of the deadman switch +01 Bit 8 is set if the effect is playing. Bits 0 to 7 are the effect id. +02 ?? +03 Address of parameter block changed (lsb) +04 Address of parameter block changed (msb) +05 Address of second parameter block changed (lsb) +... depending on the number of parameter blocks updated + ** Force effect ** OP= 01 LEN= 0e @@ -206,7 +243,6 @@ Remember it's free (as in free beer) and alpha! ** URLS ** -Well, I don't have them at hand (unluckyly, I do not have internet at home). Check www.immerse.com for Immersion Studio, and www.fcoder.com for ComPortSpy. ** Author of this document ** |
From: James S. <jsi...@us...> - 2002-01-20 03:54:52
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv23561/drivers/input Modified Files: evdev.c hid-core.c hiddev.c input.c joydev.c mousedev.c tsdev.c usbkbd.c Log Message: Synced to 2.5.X. Index: evdev.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/evdev.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- evdev.c 2002/01/02 11:59:56 1.42 +++ evdev.c 2002/01/20 03:54:46 1.43 @@ -124,7 +124,7 @@ static int evdev_open(struct inode * inode, struct file * file) { struct evdev_list *list; - int i = MINOR(inode->i_rdev) - EVDEV_MINOR_BASE; + int i = minor(inode->i_rdev) - EVDEV_MINOR_BASE; int accept_err; if (i >= EVDEV_MINORS || !evdev_table[i]) Index: hid-core.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/hid-core.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- hid-core.c 2001/12/27 10:37:41 1.35 +++ hid-core.c 2002/01/20 03:54:46 1.36 @@ -977,11 +977,11 @@ hid->urbctrl.pipe = dir ? usb_rcvctrlpipe(hid->dev, 0) : usb_sndctrlpipe(hid->dev, 0); hid->urbctrl.dev = hid->dev; - hid->dr.length = cpu_to_le16(hid->urbctrl.transfer_buffer_length); - hid->dr.requesttype = USB_TYPE_CLASS | USB_RECIP_INTERFACE | dir; - hid->dr.request = dir ? HID_REQ_GET_REPORT : HID_REQ_SET_REPORT; - hid->dr.index = cpu_to_le16(hid->ifnum); - hid->dr.value = ((report->type + 1) << 8) | report->id; + hid->dr.wLength = cpu_to_le16(hid->urbctrl.transfer_buffer_length); + hid->dr.bRequestType = USB_TYPE_CLASS | USB_RECIP_INTERFACE | dir; + hid->dr.bRequest = dir ? HID_REQ_GET_REPORT : HID_REQ_SET_REPORT; + hid->dr.wIndex = cpu_to_le16(hid->ifnum); + hid->dr.wValue = ((report->type + 1) << 8) | report->id; dbg("submitting ctrl urb"); Index: hiddev.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/hiddev.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- hiddev.c 2001/12/26 21:08:33 1.8 +++ hiddev.c 2002/01/20 03:54:46 1.9 @@ -218,7 +218,7 @@ static int hiddev_open(struct inode * inode, struct file * file) { struct hiddev_list *list; - int i = MINOR(inode->i_rdev) - HIDDEV_MINOR_BASE; + int i = minor(inode->i_rdev) - HIDDEV_MINOR_BASE; if (i >= HIDDEV_MINORS || !hiddev_table[i]) return -ENODEV; Index: input.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/input.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- input.c 2001/12/26 21:08:33 1.48 +++ input.c 2002/01/20 03:54:46 1.49 @@ -618,7 +618,7 @@ static int input_open_file(struct inode *inode, struct file *file) { - struct input_handler *handler = input_table[MINOR(inode->i_rdev) >> 5]; + struct input_handler *handler = input_table[minor(inode->i_rdev) >> 5]; struct file_operations *old_fops, *new_fops = NULL; int err; Index: joydev.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joydev.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- joydev.c 2001/12/27 10:37:41 1.38 +++ joydev.c 2002/01/20 03:54:46 1.39 @@ -29,7 +29,6 @@ #include <asm/io.h> #include <asm/system.h> -#include <asm/segment.h> #include <linux/delay.h> #include <linux/errno.h> #include <linux/joystick.h> @@ -191,7 +190,7 @@ static int joydev_open(struct inode *inode, struct file *file) { struct joydev_list *list; - int i = MINOR(inode->i_rdev) - JOYDEV_MINOR_BASE; + int i = minor(inode->i_rdev) - JOYDEV_MINOR_BASE; if (i >= JOYDEV_MINORS || !joydev_table[i]) return -ENODEV; Index: mousedev.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/mousedev.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- mousedev.c 2001/12/26 21:08:33 1.38 +++ mousedev.c 2002/01/20 03:54:46 1.39 @@ -225,7 +225,7 @@ static int mousedev_open(struct inode * inode, struct file * file) { struct mousedev_list *list; - int i = MINOR(inode->i_rdev) - MOUSEDEV_MINOR_BASE; + int i = minor(inode->i_rdev) - MOUSEDEV_MINOR_BASE; if (i >= MOUSEDEV_MINORS || !mousedev_table[i]) return -ENODEV; Index: tsdev.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/tsdev.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- tsdev.c 2001/12/26 21:08:33 1.10 +++ tsdev.c 2002/01/20 03:54:46 1.11 @@ -94,7 +94,7 @@ static int tsdev_open(struct inode * inode, struct file * file) { - int i = MINOR(inode->i_rdev) - TSDEV_MINOR_BASE; + int i = minor(inode->i_rdev) - TSDEV_MINOR_BASE; struct tsdev_list *list; if (i >= TSDEV_MINORS || !tsdev_table[i]) Index: usbkbd.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/usbkbd.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- usbkbd.c 2002/01/18 19:01:03 1.28 +++ usbkbd.c 2002/01/20 03:54:46 1.29 @@ -4,6 +4,8 @@ * Copyright (c) 1999-2001 Vojtech Pavlik * * USB HIDBP Keyboard support + * + * Sponsored by SuSE */ /* @@ -22,8 +24,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Should you need to contact me, the author, you can do so either by - * e-mail - mail your message to <vo...@uc...>, or by paper mail: - * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic + * e-mail - mail your message to <vo...@su...>, or by paper mail: + * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic */ #include <linux/kernel.h> @@ -32,19 +34,20 @@ #include <linux/input.h> #include <linux/init.h> #include <linux/usb.h> -#include "usbpath.h" +#define _HID_BOOT_PROTOCOL +#include "hid.h" + /* * Version Information */ #define DRIVER_VERSION "" -#define DRIVER_AUTHOR "Vojtech Pavlik <vo...@uc...>" +#define DRIVER_AUTHOR "Vojtech Pavlik <vo...@su...>" #define DRIVER_DESC "USB HID Boot Protocol keyboard driver" -#define DRIVER_LICENSE "GPL" -MODULE_AUTHOR(DRIVER_AUTHOR); -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_LICENSE(DRIVER_LICENSE); +MODULE_AUTHOR( DRIVER_AUTHOR ); +MODULE_DESCRIPTION( DRIVER_DESC ); +MODULE_LICENSE("GPL"); static unsigned char usb_kbd_keycode[256] = { 0, 0, 0, 0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, @@ -74,7 +77,6 @@ struct usb_ctrlrequest dr; unsigned char leds, newleds; char name[128]; - char phys[64]; int open; }; @@ -179,7 +181,6 @@ struct usb_endpoint_descriptor *endpoint; struct usb_kbd *kbd; int i, pipe, maxp; - char path[64]; char *buf; iface = &dev->actconfig->interface[ifnum]; @@ -194,6 +195,9 @@ pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe)); + hid_set_protocol(dev, interface->bInterfaceNumber, 0); + hid_set_idle(dev, interface->bInterfaceNumber, 0, 0); + if (!(kbd = kmalloc(sizeof(struct usb_kbd), GFP_KERNEL))) return NULL; memset(kbd, 0, sizeof(struct usb_kbd)); @@ -215,16 +219,12 @@ usb_kbd_irq, kbd, endpoint->bInterval); kbd->dr.bRequestType = USB_TYPE_CLASS | USB_RECIP_INTERFACE; - kbd->dr.bRequest = 0x09; + kbd->dr.bRequest = HID_REQ_SET_REPORT; kbd->dr.wValue = 0x200; kbd->dr.wIndex = interface->bInterfaceNumber; kbd->dr.wLength = 1; - usb_make_path(dev, path, 64); - sprintf(kbd->phys, "%s/input0", path); - kbd->dev.name = kbd->name; - kbd->dev.phys = kbd->phys; kbd->dev.idbus = BUS_USB; kbd->dev.idvendor = dev->descriptor.idVendor; kbd->dev.idproduct = dev->descriptor.idProduct; @@ -253,7 +253,8 @@ input_register_device(&kbd->dev); - printk(KERN_INFO "input: %s on %s\n", kbd->name, path); + printk(KERN_INFO "input%d: %s on usb%d:%d.%d\n", + kbd->dev.number, kbd->name, dev->bus->busnum, dev->devnum, ifnum); return kbd; } |
From: James S. <jsi...@us...> - 2002-01-20 03:54:52
|
Update of /cvsroot/linuxconsole/ruby/linux/lib In directory usw-pr-cvs1:/tmp/cvs-serv23561/lib Modified Files: Makefile Log Message: Synced to 2.5.X. Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/lib/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 2001/10/06 16:11:14 1.2 +++ Makefile 2002/01/20 03:54:46 1.3 @@ -8,7 +8,7 @@ L_TARGET := lib.a -export-objs := cmdline.o dec_and_lock.o rwsem-spinlock.o rwsem.o bust_spinlocks.o +export-objs := cmdline.o dec_and_lock.o rwsem-spinlock.o rwsem.o crc32.o bust_spinlocks.o obj-y := errno.o ctype.o string.o vsprintf.o brlock.o cmdline.o bust_spinlocks.o rbtree.o @@ -18,5 +18,10 @@ ifneq ($(CONFIG_HAVE_DEC_LOCK),y) obj-y += dec_and_lock.o endif + +obj-$(CONFIG_CRC32) += crc32.o +include $(TOPDIR)/drivers/net/Makefile.lib +include $(TOPDIR)/drivers/usb/Makefile.lib +include $(TOPDIR)/fs/Makefile.lib include $(TOPDIR)/Rules.make |
From: James S. <jsi...@us...> - 2002-01-20 03:54:51
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv23561/include/linux Modified Files: console.h fb.h kernel.h keyboard.h tty.h vt_kern.h Log Message: Synced to 2.5.X. Index: console.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/console.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- console.h 2001/12/07 00:17:55 1.6 +++ console.h 2002/01/20 03:54:46 1.7 @@ -45,7 +45,6 @@ void (*write)(struct console *, const char *, unsigned); int (*read)(struct console *, const char *, unsigned); kdev_t (*device)(struct console *); - int (*wait_key)(struct console *); int (*setup)(struct console *, char *); struct semaphore lock; short flags; Index: fb.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/fb.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- fb.h 2001/11/25 05:16:47 1.45 +++ fb.h 2002/01/20 03:54:46 1.46 @@ -306,8 +306,6 @@ #ifdef __KERNEL__ -#define GET_FB_IDX(node) (MINOR(node)) - #include <linux/fs.h> #include <linux/poll.h> #include <linux/init.h> Index: kernel.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/kernel.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- kernel.h 2001/12/26 21:08:33 1.9 +++ kernel.h 2002/01/20 03:54:46 1.10 @@ -37,16 +37,6 @@ #define KERN_INFO "<6>" /* informational */ #define KERN_DEBUG "<7>" /* debug-level messages */ -# define NORET_TYPE /**/ -# define ATTRIB_NORET __attribute__((noreturn)) -# define NORET_AND noreturn, - -#ifdef __i386__ -#define FASTCALL(x) x __attribute__((regparm(3))) -#else -#define FASTCALL(x) x -#endif - struct completion; extern struct notifier_block *panic_notifier_list; Index: keyboard.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/keyboard.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- keyboard.h 2000/04/04 22:26:14 1.1 +++ keyboard.h 2002/01/20 03:54:46 1.2 @@ -27,7 +27,6 @@ extern const int max_vals[]; extern unsigned short *key_maps[MAX_NR_KEYMAPS]; extern unsigned short plain_map[NR_KEYS]; -extern wait_queue_head_t keypress_wait; extern unsigned char keyboard_type; #endif Index: tty.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/tty.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- tty.h 2001/12/06 23:32:51 1.11 +++ tty.h 2002/01/20 03:54:46 1.12 @@ -5,16 +5,6 @@ * 'tty.h' defines some structures used by tty_io.c and some defines. */ -/* - * These constants are also useful for user-level apps (e.g., VC - * resizing). - */ -#define MIN_NR_CONSOLES 1 /* must be at least 1 */ -#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */ -#define MAX_NR_USER_CONSOLES 16 /* must be root to allocate above this */ - /* Note: the ioctl VT_GETSTATE does not work for - consoles 16 and higher (since it returns a short) */ - #ifdef __KERNEL__ #include <linux/config.h> #include <linux/fs.h> Index: vt_kern.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/vt_kern.h,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- vt_kern.h 2001/12/23 00:04:18 1.63 +++ vt_kern.h 2002/01/20 03:54:46 1.64 @@ -13,6 +13,10 @@ #include <linux/kbd_kern.h> #include <linux/input.h> +#define MIN_NR_CONSOLES 1 /* must be at least 1 */ +#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */ +#define MAX_NR_USER_CONSOLES 16 /* number of VCs per VT */ + /* scroll */ #define SM_UP (1) #define SM_DOWN (2) |
From: James S. <jsi...@us...> - 2002-01-20 03:54:51
|
Update of /cvsroot/linuxconsole/ruby/linux/include/asm-sparc64 In directory usw-pr-cvs1:/tmp/cvs-serv23561/include/asm-sparc64 Modified Files: page.h Log Message: Synced to 2.5.X. Index: page.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/asm-sparc64/page.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- page.h 2001/09/02 23:21:37 1.1 +++ page.h 2002/01/20 03:54:46 1.2 @@ -18,13 +18,19 @@ #ifndef __ASSEMBLY__ -#define BUG() bust_spinlocks(1); __builtin_trap(); +#ifdef CONFIG_DEBUG_BUGVERBOSE +#define BUG() do { \ + do_BUG(__FILE__, __LINE__); \ + __builtin_trap(); \ +} while (0) +#else +#define BUG() bust_spinlocks(1); __builtin_trap() +#endif + #define PAGE_BUG(page) BUG() extern void _clear_page(void *page); -extern void _copy_page(void *to, void *from); #define clear_page(X) _clear_page((void *)(X)) -#define copy_page(X,Y) _copy_page((void *)(X), (void *)(Y)) extern void clear_user_page(void *page, unsigned long vaddr); extern void copy_user_page(void *to, void *from, unsigned long vaddr); |
From: James S. <jsi...@us...> - 2002-01-20 03:54:51
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/sparc In directory usw-pr-cvs1:/tmp/cvs-serv23561/arch/sparc Modified Files: config.in Log Message: Synced to 2.5.X. Index: config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/sparc/config.in,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- config.in 2001/07/08 00:41:51 1.22 +++ config.in 2002/01/20 03:54:45 1.23 @@ -259,3 +259,5 @@ bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ endmenu + +source lib/Config.in |
From: James S. <jsi...@us...> - 2002-01-20 03:54:51
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv23561/drivers/video Modified Files: fbmem.c Log Message: Synced to 2.5.X. Index: fbmem.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/fbmem.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- fbmem.c 2001/11/14 23:32:37 1.56 +++ fbmem.c 2002/01/20 03:54:46 1.57 @@ -21,6 +21,7 @@ #include <linux/kernel.h> #include <linux/major.h> #include <linux/slab.h> +#include <linux/mm.h> #include <linux/mman.h> #include <linux/tty.h> #include <linux/init.h> @@ -376,7 +377,7 @@ for (fi = registered_fb; fi < ®istered_fb[FB_MAX] && len < 4000; fi++) if (*fi) clen += sprintf(buf + clen, "%d %s\n", - GET_FB_IDX((*fi)->node), + minor((*fi)->node), (*fi)->fix.id); *start = buf + offset; if (clen > offset) @@ -391,7 +392,7 @@ { unsigned long p = *ppos; struct inode *inode = file->f_dentry->d_inode; - int fbidx = GET_FB_IDX(inode->i_rdev); + int fbidx = minor(inode->i_rdev); struct fb_info *info = registered_fb[fbidx]; struct fb_ops *fb = info->fbops; @@ -421,7 +422,7 @@ { unsigned long p = *ppos; struct inode *inode = file->f_dentry->d_inode; - int fbidx = GET_FB_IDX(inode->i_rdev); + int fbidx = minor(inode->i_rdev); struct fb_info *info = registered_fb[fbidx]; struct fb_ops *fb = info->fbops; int err; @@ -455,7 +456,7 @@ fb_poll(struct file *file, poll_table *wait) { struct inode *inode = file->f_dentry->d_inode; - int fbidx = GET_FB_IDX(inode->i_rdev); + int fbidx = minor(inode->i_rdev); struct fb_info *info = registered_fb[fbidx]; struct fb_ops *fb = info->fbops; @@ -480,7 +481,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { - int fbidx = GET_FB_IDX(inode->i_rdev); + int fbidx = minor(inode->i_rdev); struct fb_info *info = registered_fb[fbidx]; struct fb_ops *fb = info->fbops; struct fb_var_screeninfo var; @@ -584,7 +585,7 @@ static int fb_mmap(struct file *file, struct vm_area_struct * vma) { - int fbidx = GET_FB_IDX(file->f_dentry->d_inode->i_rdev); + int fbidx = minor(file->f_dentry->d_inode->i_rdev); struct fb_info *info = registered_fb[fbidx]; struct fb_ops *fb = info->fbops; unsigned long off; @@ -634,12 +635,13 @@ return -EINVAL; off += start; vma->vm_pgoff = off >> PAGE_SHIFT; + /* This is an IO map - tell maydump to skip this VMA */ + vma->vm_flags |= VM_IO; #if defined(__sparc_v9__) vma->vm_flags |= (VM_SHM | VM_LOCKED); if (io_remap_page_range(vma->vm_start, off, vma->vm_end - vma->vm_start, vma->vm_page_prot, 0)) return -EAGAIN; - vma->vm_flags |= VM_IO; #else #if defined(__mc68000__) #if defined(CONFIG_SUN3) @@ -665,8 +667,6 @@ pgprot_val(vma->vm_page_prot) |= _CACHE_UNCACHED; #elif defined(__arm__) vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); - /* This is an IO map - tell maydump to skip this VMA */ - vma->vm_flags |= VM_IO; #elif defined(__sh__) pgprot_val(vma->vm_page_prot) &= ~_PAGE_CACHABLE; #else @@ -683,7 +683,7 @@ static int fb_open(struct inode *inode, struct file *file) { - int fbidx = GET_FB_IDX(inode->i_rdev); + int fbidx = minor(inode->i_rdev); #ifdef CONFIG_VT struct tty_struct *tty = current->tty; #endif @@ -719,7 +719,7 @@ static int fb_release(struct inode *inode, struct file *file) { - int fbidx = GET_FB_IDX(inode->i_rdev); + int fbidx = minor(inode->i_rdev); #ifdef CONFIG_VT struct tty_struct *tty = current->tty; #endif @@ -866,7 +866,7 @@ for (i = 0 ; i < FB_MAX; i++) if (!registered_fb[i]) break; - fb_info->node = MKDEV(FB_MAJOR, i); + fb_info->node = mk_kdev(FB_MAJOR, i); registered_fb[i] = fb_info; init_waitqueue_head(&fb_info->wait); sprintf (name_buf, "%d", i); @@ -876,7 +876,7 @@ &fb_fops, NULL); printk(KERN_INFO "fb%d: %s frame buffer device\n", - GET_FB_IDX(fb_info->node), fb_info->fix.id); + minor(fb_info->node), fb_info->fix.id); #ifdef CONFIG_MTRR /* @@ -909,7 +909,7 @@ { int i; - i = GET_FB_IDX(fb_info->node); + i = minor(fb_info->node); if (fb_info->open) return -EBUSY; if (!registered_fb[i]) |
From: James S. <jsi...@us...> - 2002-01-20 03:54:51
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv23561/drivers/char Modified Files: Config.in mem.c misc.c n_tty.c sysrq.c tty_io.c vc_screen.c vt.c Log Message: Synced to 2.5.X. Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/Config.in,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- Config.in 2001/12/26 17:28:11 1.35 +++ Config.in 2002/01/20 03:54:46 1.36 @@ -23,7 +23,7 @@ tristate ' Dual serial port support' CONFIG_DUALSP_SERIAL fi fi - if [ "$CONFIG_ACPI" = "y" ]; then + if [ "$CONFIG_ACPI" = "y" -a "$CONFIG_IA64" = "y" ]; then bool ' Support for serial ports defined by ACPI tables' CONFIG_SERIAL_ACPI fi dep_mbool 'Extended dumb serial driver options' CONFIG_SERIAL_EXTENDED $CONFIG_SERIAL Index: mem.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/mem.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- mem.c 2001/10/06 16:11:13 1.17 +++ mem.c 2002/01/20 03:54:46 1.18 @@ -532,7 +532,7 @@ static int memory_open(struct inode * inode, struct file * filp) { - switch (MINOR(inode->i_rdev)) { + switch (minor(inode->i_rdev)) { case 1: filp->f_op = &mem_fops; break; Index: misc.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/misc.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- misc.c 2001/11/13 19:38:22 1.16 +++ misc.c 2002/01/20 03:54:46 1.17 @@ -100,7 +100,7 @@ static int misc_open(struct inode * inode, struct file * file) { - int minor = MINOR(inode->i_rdev); + int minor = minor(inode->i_rdev); struct miscdevice *c; int err = -ENODEV; struct file_operations *old_fops, *new_fops = NULL; Index: n_tty.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/n_tty.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- n_tty.c 2001/10/17 17:00:13 1.5 +++ n_tty.c 2002/01/20 03:54:46 1.6 @@ -45,7 +45,7 @@ #include <asm/system.h> #include <asm/bitops.h> -#define SYSCONS_DEV MKDEV(TTYAUX_MAJOR,1) +#define IS_SYSCONS_DEV(dev) (kdev_val(dev) == __mkdev(TTYAUX_MAJOR,1)) #ifndef MIN #define MIN(a,b) ((a) < (b) ? (a) : (b)) @@ -954,7 +954,7 @@ /* NOTE: not yet done after every sleep pending a thorough check of the logic of this change. -- jlc */ /* don't stop on /dev/console */ - if (file->f_dentry->d_inode->i_rdev != SYSCONS_DEV && + if (!IS_SYSCONS_DEV(file->f_dentry->d_inode->i_rdev) && current->tty == tty) { if (tty->pgrp <= 0) printk("read_chan: tty->pgrp <= 0!\n"); @@ -1133,7 +1133,7 @@ /* Job control check -- must be done at start (POSIX.1 7.1.1.4). */ if (L_TOSTOP(tty) && - file->f_dentry->d_inode->i_rdev != SYSCONS_DEV) { + !IS_SYSCONS_DEV(file->f_dentry->d_inode->i_rdev)) { retval = tty_check_change(tty); if (retval) return retval; Index: sysrq.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/sysrq.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- sysrq.c 2001/10/29 00:10:59 1.16 +++ sysrq.c 2002/01/20 03:54:46 1.17 @@ -110,7 +110,7 @@ /* Guesses if the device is a local hard drive */ static int is_local_disk(kdev_t dev) { unsigned int major; - major = MAJOR(dev); + major = major(dev); switch (major) { case IDE0_MAJOR: @@ -211,7 +211,7 @@ for (sb = sb_entry(super_blocks.next); sb != sb_entry(&super_blocks); sb = sb_entry(sb->s_list.next)) - if (!is_local_disk(sb->s_dev) && MAJOR(sb->s_dev)) + if (!is_local_disk(sb->s_dev) && major(sb->s_dev)) go_sync(sb, remount_flag); unlock_kernel(); Index: tty_io.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/tty_io.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- tty_io.c 2001/12/09 01:43:35 1.42 +++ tty_io.c 2002/01/20 03:54:46 1.43 @@ -95,16 +95,16 @@ #include <asm/system.h> #include <asm/bitops.h> -#include <linux/devfs_fs_kernel.h> -#include <linux/kmod.h> - #ifdef CONFIG_VT #include <linux/vt_kern.h> #endif +#include <linux/devfs_fs_kernel.h> -#define TTY_DEV MKDEV(TTYAUX_MAJOR,0) -#define SYSCONS_DEV MKDEV(TTYAUX_MAJOR,1) -#define PTMX_DEV MKDEV(TTYAUX_MAJOR,2) +#include <linux/kmod.h> + +#define IS_TTY_DEV(dev) (kdev_val(dev) == __mkdev(TTYAUX_MAJOR,0)) +#define IS_SYSCONS_DEV(dev) (kdev_val(dev) == __mkdev(TTYAUX_MAJOR,1)) +#define IS_PTMX_DEV(dev) (kdev_val(dev) == __mkdev(TTYAUX_MAJOR,2)) #undef TTY_DEBUG_HANGUP @@ -183,7 +183,7 @@ static char * _tty_make_name(struct tty_struct *tty, const char *name, char *buf) { - int idx = (tty)?MINOR(tty->device) - tty->driver.minor_start:0; + int idx = (tty)? minor(tty->device) - tty->driver.minor_start:0; if (!tty) /* Hmm. NULL pointer. That's fun. */ strcpy(buf, "NULL tty"); @@ -194,7 +194,7 @@ return buf; } -#define TTY_NUMBER(tty) (MINOR((tty)->device) - (tty)->driver.minor_start + \ +#define TTY_NUMBER(tty) (minor((tty)->device) - (tty)->driver.minor_start + \ (tty)->driver.name_base) char *tty_name(struct tty_struct *tty, char *buf) @@ -329,8 +329,8 @@ int major, minor; struct tty_driver *p; - minor = MINOR(device); - major = MAJOR(device); + minor = minor(device); + major = major(device); for (p = tty_drivers; p; p = p->next) { if (p->major != major) @@ -440,7 +440,7 @@ file_list_lock(); for (l = tty->tty_files.next; l != &tty->tty_files; l = l->next) { struct file * filp = list_entry(l, struct file, f_list); - if (filp->f_dentry->d_inode->i_rdev == SYSCONS_DEV) { + if (IS_SYSCONS_DEV(filp->f_dentry->d_inode->i_rdev)) { cons_filp = filp; continue; } @@ -594,12 +594,6 @@ read_unlock(&tasklist_lock); } -void wait_for_keypress(void) -{ - struct console *c = console_drivers; - if (c) c->wait_key(c); -} - void stop_tty(struct tty_struct *tty) { if (tty->stopped) @@ -655,7 +649,7 @@ moved it to there. This should only be done for the N_TTY line discipline, anyway. Same goes for write_chan(). -- jlc. */ #if 0 - if ((inode->i_rdev != SYSCONS_DEV) && /* don't stop on /dev/console */ + if (!IS_SYSCONS_DEV(inode->i_rdev) && /* don't stop on /dev/console */ (tty->pgrp > 0) && (current->tty == tty) && (tty->pgrp != current->pgrp)) @@ -740,10 +734,10 @@ return -ESPIPE; /* - * For now, we redirect writes from /dev/console. + * For now, we redirect writes from /dev/console. */ inode = file->f_dentry->d_inode; - is_console = (inode->i_rdev == SYSCONS_DEV); + is_console = IS_SYSCONS_DEV(inode->i_rdev); if (is_console && redirect) tty = redirect; @@ -804,7 +798,7 @@ if (!driver) return -ENODEV; - idx = MINOR(device) - driver->minor_start; + idx = minor(device) - driver->minor_start; /* * Check whether we need to acquire the tty semaphore to avoid @@ -858,7 +852,7 @@ if (!o_tty) goto free_mem_out; initialize_tty_struct(o_tty); - o_tty->device = (kdev_t) MKDEV(driver->other->major, + o_tty->device = mk_kdev(driver->other->major, driver->other->minor_start + idx); o_tty->driver = *driver->other; @@ -1050,7 +1044,7 @@ tty_fasync(-1, filp, 0); - idx = MINOR(tty->device) - tty->driver.minor_start; + idx = minor(tty->device) - tty->driver.minor_start; pty_master = (tty->driver.type == TTY_DRIVER_TYPE_PTY && tty->driver.subtype == PTY_TYPE_MASTER); o_tty = tty->link; @@ -1286,15 +1280,14 @@ retry_open: noctty = filp->f_flags & O_NOCTTY; device = inode->i_rdev; - if (device == TTY_DEV) { + if (IS_TTY_DEV(device)) { if (!current->tty) return -ENXIO; device = current->tty->device; filp->f_flags |= O_NONBLOCK; /* Don't let /dev/tty block */ /* noctty = 1; */ } - - if (device == SYSCONS_DEV) { + if (IS_SYSCONS_DEV(device)) { struct console *c = console_drivers; while(c && !c->device) c = c->next; @@ -1305,7 +1298,7 @@ noctty = 1; } - if (device == PTMX_DEV) { + if (IS_PTMX_DEV(device)) { #ifdef CONFIG_UNIX98_PTYS /* find a free pty. */ @@ -1319,7 +1312,7 @@ for (minor = driver->minor_start ; minor < driver->minor_start + driver->num ; minor++) { - device = MKDEV(driver->major, minor); + device = mk_kdev(driver->major, minor); if (!init_dev(device, &tty)) goto ptmx_found; /* ok! */ } } @@ -1327,8 +1320,8 @@ ptmx_found: set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */ minor -= driver->minor_start; - devpts_pty_new(driver->other->name_base + minor, MKDEV(driver->other->major, minor + driver->other->minor_start)); - tty_register_devfs(&pts_driver[major], DEVFS_FL_NO_PERSISTENCE, + devpts_pty_new(driver->other->name_base + minor, mk_kdev(driver->other->major, minor + driver->other->minor_start)); + tty_register_devfs(&pts_driver[major], DEVFS_FL_DEFAULT, pts_driver[major].minor_start + minor); noctty = 1; goto init_dev_done; @@ -1489,12 +1482,12 @@ if (!memcmp(&tmp_ws, &tty->winsize, sizeof(*arg))) return 0; #ifdef CONFIG_VT - if (tty->driver.type == TTY_DRIVER_TYPE_CONSOLE) { - struct vc_data *vc = (struct vc_data *) tty->driver_data; + if (tty->driver.type == TTY_DRIVER_TYPE_CONSOLE) { + struct vc_data *vc = (struct vc_data *) tty->driver_data; - if (!vc || vc_resize(vc, tmp_ws.ws_col, tmp_ws.ws_row)) - return -ENXIO; - } + if (!vc || vc_resize(vc, tmp_ws.ws_col, tmp_ws.ws_row)) + return -ENXIO; + } #endif if (tty->pgrp > 0) kill_pg(tty->pgrp, SIGWINCH, 1); @@ -1508,7 +1501,7 @@ static int tioccons(struct inode *inode, struct tty_struct *tty, struct tty_struct *real_tty) { - if (inode->i_rdev == SYSCONS_DEV) { + if (IS_SYSCONS_DEV(inode->i_rdev)) { if (!suser()) return -EPERM; redirect = NULL; @@ -2004,19 +1997,15 @@ { #ifdef CONFIG_DEVFS_FS umode_t mode = S_IFCHR | S_IRUSR | S_IWUSR; - kdev_t device = MKDEV (driver->major, minor); + kdev_t device = mk_kdev(driver->major, minor); int idx = minor - driver->minor_start; char buf[32]; - switch (device) { - case TTY_DEV: - case PTMX_DEV: + if (IS_TTY_DEV(device) || IS_PTMX_DEV(device)) + mode |= S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; + else { + if (driver->major == PTY_MASTER_MAJOR) mode |= S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; - break; - default: - if (driver->major == PTY_MASTER_MAJOR) - mode |= S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; - break; } if ( (minor < driver->minor_start) || (minor >= driver->minor_start + driver->num) ) { @@ -2082,7 +2071,7 @@ if (!driver->console) { driver->tty_lock = kmalloc(sizeof(struct semaphore),GFP_KERNEL); init_MUTEX(driver->tty_lock); - } else + } else driver->tty_lock = &driver->console->lock; if ( !(driver->flags & TTY_DRIVER_NO_DEVFS) ) { @@ -2246,9 +2235,6 @@ */ void __init tty_init(void) { - struct tty_driver *p; - int i; - /* * dev_tty_driver and dev_console_driver are actually magic * devices which get redirected at open time. Nevertheless, @@ -2280,33 +2266,23 @@ if (tty_register_driver(&dev_syscons_driver)) panic("Couldn't register /dev/console driver\n"); - /* - * Some console calls tty_register_driver() before kmalloc() works. - * Thus, we can't devfs_register() then. Do so now, instead. - */ - for (p = tty_drivers; p; p = p->next) { - if (p->flags && TTY_DRIVER_NO_DEVFS) { - for (i = 0; i < p->num; i++) - tty_register_devfs(p, DEVFS_FL_AOPEN_NOTIFY, p->minor_start + i); - } - } - #ifdef CONFIG_UNIX98_PTYS dev_ptmx_driver = dev_tty_driver; dev_ptmx_driver.driver_name = "/dev/ptmx"; dev_ptmx_driver.name = dev_ptmx_driver.driver_name + 5; - dev_ptmx_driver.major= MAJOR(PTMX_DEV); - dev_ptmx_driver.minor_start = MINOR(PTMX_DEV); + dev_ptmx_driver.major= TTYAUX_MAJOR; + dev_ptmx_driver.minor_start = 2; dev_ptmx_driver.type = TTY_DRIVER_TYPE_SYSTEM; dev_ptmx_driver.subtype = SYSTEM_TYPE_SYSPTMX; if (tty_register_driver(&dev_ptmx_driver)) panic("Couldn't register /dev/ptmx driver\n"); #endif - + #ifdef CONFIG_VT - vty_init(); + vty_init(); #endif + #ifdef CONFIG_ESPSERIAL /* init ESP before rs, so rs doesn't see the port */ espserial_init(); #endif Index: vc_screen.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/vc_screen.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- vc_screen.c 2001/08/05 22:58:18 1.18 +++ vc_screen.c 2002/01/20 03:54:46 1.19 @@ -33,7 +33,7 @@ #include <linux/init.h> #include <linux/vt_kern.h> #include <linux/selection.h> -#include <linux/console.h> +#include <linux/kbd_kern.h> #include <asm/uaccess.h> #include <asm/byteorder.h> #include <asm/unaligned.h> @@ -46,35 +46,35 @@ /* note the word offset */ unsigned short *screen_pos(struct vc_data *vc, int w_offset, int viewed) { - return screenpos(vc, 2 * w_offset, viewed); + return screenpos(vc, 2 * w_offset, viewed); } void getconsxy(struct vc_data *vc, char *p) { - p[0] = vc->vc_x; - p[1] = vc->vc_y; + p[0] = vc->vc_x; + p[1] = vc->vc_y; } void putconsxy(struct vc_data *vc, char *p) { - gotoxy(vc, p[0], p[1]); - set_cursor(vc); + gotoxy(vc, p[0], p[1]); + set_cursor(vc); } u16 vcs_scr_readw(struct vc_data *vc, const u16 *org) { - if ((unsigned long)org == vc->vc_pos && vc->display_fg->cursor_original != -1) - return vc->display_fg->cursor_original; - return scr_readw(org); + if ((unsigned long)org == vc->vc_pos && vc->display_fg->cursor_original != -1) + return vc->display_fg->cursor_original; + return scr_readw(org); } void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org) { - scr_writew(val, org); - if ((unsigned long)org == vc->vc_pos) { - vc->display_fg->cursor_original = -1; - add_softcursor(vc); - } + scr_writew(val, org); + if ((unsigned long)org == vc->vc_pos) { + vc->display_fg->cursor_original = -1; + add_softcursor(vc); + } } static loff_t vcs_lseek(struct file *file, loff_t offset, int orig) @@ -89,11 +89,11 @@ return -ENXIO; vc = vt_cons->fg_console; } - + size = vc->vc_rows * vc->vc_cols; - if (MINOR(inode->i_rdev) & 128) - size = 2*size + HEADER_SIZE; + if (minor(inode->i_rdev) & 128) + size = 2*size + HEADER_SIZE; switch (orig) { default: @@ -112,14 +112,12 @@ return file->f_pos; } -#define CON_BUF_SIZE PAGE_SIZE - static ssize_t vcs_read(struct file *file, char *buf, size_t count, loff_t *ppos) { struct vc_data *vc = (struct vc_data *) file->private_data; struct inode *inode = file->f_dentry->d_inode; - unsigned int currcons = MINOR(inode->i_rdev); + unsigned int currcons = minor(inode->i_rdev); long pos = *ppos; long viewed, attr, read; int col, maxcol; @@ -136,13 +134,12 @@ attr = (currcons & 128); currcons = (currcons & 127); if (currcons == 0) { - vc = vt_cons->fg_console; + vc = vt_cons->fg_console; viewed = 1; - } else { - vc = (struct vc_data *) file->private_data; + } else { + vc = (struct vc_data *) file->private_data; viewed = 0; - } - + } ret = -ENXIO; if (!vc) goto unlock_out; @@ -163,8 +160,8 @@ * could sleep. */ size = vc->vc_rows * vc->vc_cols; - if (MINOR(inode->i_rdev) & 128) - size = 2*size + HEADER_SIZE; + if (minor(inode->i_rdev) & 128) + size = 2*size + HEADER_SIZE; if (pos >= size) break; @@ -175,7 +172,7 @@ if (this_round > CON_BUF_SIZE) this_round = CON_BUF_SIZE; - /* Perform the whole read into the current VT's con_buf. + /* Perform the whole read into the current VC's con_buf. * Then we can drop the console spinlock and safely * attempt to move it to userspace. */ @@ -217,7 +214,7 @@ /* Advance state pointers and move on. */ this_round -= tmp_count; p = HEADER_SIZE; - con_buf0 = vc->display_fg->con_buf+HEADER_SIZE; + con_buf0 = vc->display_fg->con_buf + HEADER_SIZE; /* If this_round >= 0, then p is even... */ } else if (p & 1) { /* Skip first byte for output if start address is odd @@ -258,9 +255,13 @@ } } - /* Finally, temporarily drop the console lock and push + /* Finally, release the console semaphore while we push * all the data to userspace from our temporary buffer. + * + * AKPM: Even though it's a semaphore, we should drop it because + * the pagefault handling code may want to call printk(). */ + release_console_sem(vc->vc_tty->device); ret = copy_to_user(buf, con_buf_start, orig_count); acquire_console_sem(vc->vc_tty->device); @@ -289,7 +290,7 @@ { struct vc_data *vc = (struct vc_data *) file->private_data; struct inode *inode = file->f_dentry->d_inode; - unsigned int currcons = MINOR(inode->i_rdev); + unsigned int currcons = minor(inode->i_rdev); long pos = *ppos; long viewed, attr, size, written; char *con_buf0; @@ -308,20 +309,19 @@ currcons = (currcons & 127); if (currcons == 0) { - vc = vt_cons->fg_console; + vc = vt_cons->fg_console; viewed = 1; - } else { - vc = (struct vc_data *) file->private_data; + } else { + vc = (struct vc_data *) file->private_data; viewed = 0; - } - + } ret = -ENXIO; if (!vc) goto unlock_out; size = vc->vc_rows * vc->vc_cols; - if (MINOR(inode->i_rdev) & 128) - size = 2*size + HEADER_SIZE; + if (minor(inode->i_rdev) & 128) + size = 2*size + HEADER_SIZE; ret = -EINVAL; if (pos < 0 || pos > size) @@ -357,13 +357,13 @@ } } - /* The vcs size might have changed while we slept to grab + /* The vcs_size might have changed while we slept to grab * the user buffer, so recheck. * Return data written up to now on failure. */ size = vc->vc_rows * vc->vc_cols; - if (MINOR(inode->i_rdev) & 128) - size = 2*size + HEADER_SIZE; + if (minor(inode->i_rdev) & 128) + size = 2*size + HEADER_SIZE; if (pos >= size) break; @@ -387,7 +387,7 @@ unsigned char c = *con_buf0++; this_round--; - vcs_scr_writew(vc, (vcs_scr_readw(vc, org) & 0xff00) | c, org); + vcs_scr_writew(vc, (vcs_scr_readw(vc, org) & 0xff00) | c, org); org++; if (++col == maxcol) { org = screen_pos(vc, p, viewed); @@ -417,7 +417,8 @@ this_round--; c = *con_buf0++; #ifdef __BIG_ENDIAN - vcs_scr_writew(vc, c | (vcs_scr_readw(vc, org) & 0xff00), org); + vcs_scr_writew(vc, c | + (vcs_scr_readw(vc, org) & 0xff00), org); #else vcs_scr_writew(vc, (c << 8) | (vcs_scr_readw(vc, org) & 0xff), org); @@ -475,7 +476,7 @@ static int vcs_open(struct inode *inode, struct file *filp) { - unsigned int currcons = (MINOR(inode->i_rdev) & 127); + unsigned int currcons = (minor(inode->i_rdev) & 127); struct vc_data *vc; if (currcons) { @@ -484,7 +485,7 @@ filp->private_data = vc; else return -ENXIO; - } + } return 0; } @@ -503,12 +504,15 @@ char name[8]; sprintf (name, "a%u", index + 1); - if (unregister) { - devfs_unregister ( devfs_find_handle (devfs_handle, name + 1, 0, 0, + if (unregister) + { + devfs_unregister ( devfs_find_handle (devfs_handle, name + 1, 0, 0, DEVFS_SPECIAL_CHR, 0) ); - devfs_unregister ( devfs_find_handle (devfs_handle, name, 0, 0, + devfs_unregister ( devfs_find_handle (devfs_handle, name, 0, 0, DEVFS_SPECIAL_CHR, 0) ); - } else { + } + else + { devfs_register (devfs_handle, name + 1, DEVFS_FL_DEFAULT, VCS_MAJOR, index + 1, S_IFCHR | S_IRUSR | S_IWUSR, &vcs_fops, NULL); Index: vt.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/vt.c,v retrieving revision 1.116 retrieving revision 1.117 diff -u -d -r1.116 -r1.117 --- vt.c 2001/12/23 00:04:18 1.116 +++ vt.c 2002/01/20 03:54:46 1.117 @@ -1204,7 +1204,7 @@ /* Allocate the console screen memory. */ static int vt_open(struct tty_struct *tty, struct file * filp) { - unsigned int currcons = MINOR(tty->device); + unsigned int currcons = minor(tty->device); struct vc_data *vc = (struct vc_data *) tty->driver_data; if (!vc) { @@ -1232,7 +1232,7 @@ if (!tty) return; if (tty->count != 1) return; - vcs_make_devfs(MINOR(tty->device), 1); + vcs_make_devfs(minor(tty->device), 1); tty->driver_data = 0; } @@ -1423,14 +1423,13 @@ static kdev_t vt_console_device(struct console *c) { - return MKDEV(TTY_MAJOR, c->index ? c->index : admin_vt->fg_console->vc_num); + return mk_dev(TTY_MAJOR, c->index ? c->index : admin_vt->fg_console->vc_num); } struct console vt_console_driver = { name: "tty", write: vt_console_print, device: vt_console_device, - wait_key: keyboard_wait_for_keypress, flags: CON_PRINTBUFFER, index: -1, }; |
From: James S. <jsi...@us...> - 2002-01-20 03:54:50
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/sparc64 In directory usw-pr-cvs1:/tmp/cvs-serv23561/arch/sparc64 Modified Files: config.in Log Message: Synced to 2.5.X. Index: config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/sparc64/config.in,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- config.in 2001/12/26 17:28:11 1.20 +++ config.in 2002/01/20 03:54:46 1.21 @@ -32,6 +32,8 @@ # Identify this as a Sparc64 build define_bool CONFIG_SPARC64 y +bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG + # Global things across all Sun machines. define_bool CONFIG_HAVE_DEC_LOCK y define_bool CONFIG_RWSEM_GENERIC_SPINLOCK n @@ -84,8 +86,8 @@ fi endmenu -source drivers/input/Config.in source drivers/usb/Config.in +source drivers/input/Config.in source drivers/sbus/char/Config.in source drivers/sbus/audio/Config.in @@ -185,21 +187,21 @@ if [ "$CONFIG_SCSI_SYM53C8XX_2" != "y" ]; then dep_tristate 'NCR53C8XX SCSI support' CONFIG_SCSI_NCR53C8XX $CONFIG_SCSI dep_tristate 'SYM53C8XX SCSI support' CONFIG_SCSI_SYM53C8XX $CONFIG_SCSI - fi - if [ "$CONFIG_SCSI_NCR53C8XX" != "n" -o "$CONFIG_SCSI_SYM53C8XX" != "n" ]; then - int 'default tagged command queue depth' CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS 8 - int 'maximum number of queued commands' CONFIG_SCSI_NCR53C8XX_MAX_TAGS 32 - int 'synchronous transfers frequency in MHz' CONFIG_SCSI_NCR53C8XX_SYNC 10 - bool ' enable profiling' CONFIG_SCSI_NCR53C8XX_PROFILE - if [ "$CONFIG_SCSI_SYM53C8XX" != "n" ]; then - bool ' include support for the NCR PQS/PDS SCSI card' CONFIG_SCSI_NCR53C8XX_PQS_PDS + if [ "$CONFIG_SCSI_NCR53C8XX" != "n" -o "$CONFIG_SCSI_SYM53C8XX" != "n" ]; then + int 'default tagged command queue depth' CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS 8 + int 'maximum number of queued commands' CONFIG_SCSI_NCR53C8XX_MAX_TAGS 32 + int 'synchronous transfers frequency in MHz' CONFIG_SCSI_NCR53C8XX_SYNC 10 + bool ' enable profiling' CONFIG_SCSI_NCR53C8XX_PROFILE + if [ "$CONFIG_SCSI_SYM53C8XX" != "n" ]; then + bool ' include support for the NCR PQS/PDS SCSI card' CONFIG_SCSI_NCR53C8XX_PQS_PDS + fi + if [ "$CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS" = "0" ]; then + bool ' not allow targets to disconnect' CONFIG_SCSI_NCR53C8XX_NO_DISCONNECT + fi + if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + bool ' assume boards are SYMBIOS compatible (EXPERIMENTAL)' CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT + fi fi - if [ "$CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS" = "0" ]; then - bool ' not allow targets to disconnect' CONFIG_SCSI_NCR53C8XX_NO_DISCONNECT - fi - if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - bool ' assume boards are SYMBIOS compatible (EXPERIMENTAL)' CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT - fi fi dep_tristate 'Qlogic ISP SCSI support' CONFIG_SCSI_QLOGIC_ISP $CONFIG_SCSI dep_tristate 'Qlogic ISP FC SCSI support' CONFIG_SCSI_QLOGIC_FC $CONFIG_SCSI @@ -287,6 +289,15 @@ mainmenu_option next_comment comment 'Kernel hacking' -bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ -#bool 'ECache flush trap support at ta 0x72' CONFIG_EC_FLUSH_TRAP +bool 'Kernel debugging' CONFIG_DEBUG_KERNEL +if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then + bool ' Debug memory allocations' CONFIG_DEBUG_SLAB + bool ' Magic SysRq key' CONFIG_MAGIC_SYSRQ + bool ' Spinlock debugging' CONFIG_DEBUG_SPINLOCK + bool ' Verbose BUG() reporting (adds 70K)' CONFIG_DEBUG_BUGVERBOSE + bool ' D-cache flush debugging' CONFIG_DEBUG_DCFLUSH +fi + endmenu + +source lib/Config.in |
From: James S. <jsi...@us...> - 2002-01-20 03:54:50
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/sh/kernel In directory usw-pr-cvs1:/tmp/cvs-serv23561/arch/sh/kernel Modified Files: setup.c Log Message: Synced to 2.5.X. Index: setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/sh/kernel/setup.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- setup.c 2001/12/26 17:28:11 1.5 +++ setup.c 2002/01/20 03:54:45 1.6 @@ -138,15 +138,6 @@ sh_bios_console_write(s, count); } -/* - * Receive character from the serial port - */ -static int sh_console_wait_key(struct console *co) -{ - /* Not implemented yet */ - return 0; -} - static kdev_t sh_console_device(struct console *c) { /* TODO: this is totally bogus */ @@ -181,7 +172,6 @@ name: "bios", write: sh_console_write, device: sh_console_device, - wait_key: sh_console_wait_key, setup: sh_console_setup, flags: CON_PRINTBUFFER, index: -1, |
From: James S. <jsi...@us...> - 2002-01-20 03:54:50
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/mips64 In directory usw-pr-cvs1:/tmp/cvs-serv23561/arch/mips64 Modified Files: config.in Log Message: Synced to 2.5.X. Index: config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/mips64/config.in,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- config.in 2001/10/06 16:11:12 1.16 +++ config.in 2002/01/20 03:54:45 1.17 @@ -261,3 +261,5 @@ bool 'Run uncached' CONFIG_MIPS_UNCACHED fi endmenu + +source lib/Config.in |
From: James S. <jsi...@us...> - 2002-01-20 03:54:50
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/mips In directory usw-pr-cvs1:/tmp/cvs-serv23561/arch/mips Modified Files: config.in Log Message: Synced to 2.5.X. Index: config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/mips/config.in,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- config.in 2001/10/29 00:10:58 1.15 +++ config.in 2002/01/20 03:54:45 1.16 @@ -477,3 +477,5 @@ bool 'Run uncached' CONFIG_MIPS_UNCACHED fi endmenu + +source lib/Config.in |