diff -Naur linux.225/Documentation/Configure.help linux.225.visws/Documentation/Configure.help --- linux.225/Documentation/Configure.help Fri Mar 26 13:23:20 1999 +++ linux.225.visws/Documentation/Configure.help Thu Apr 15 17:51:21 1999 @@ -9066,6 +9066,170 @@ UART chip. This interface is rarely found on sound cards. It's safe to answer N to this question. +Universal Serial Bus +CONFIG_USB + The Universal Serial Bus (USB) is a new kind of bus which allows + true Plug'n'Play, hot plug and dynamic configuration, following a + tiered star topology. Devices such as keyboards, mice, joysticks, + video cameras, speakers, game-pads ... etc may use this bus, as long + as they are prepared for it. Note you can ONLY compile this as a + MODULE [this will change in a future]. + + In case of doubt, is safe to say Y/M. + +Modular drivers load on demand +CONFIG_USB_LOD + The USB driver stack supports dynamic configuration, and to achieve + it, there's a register of supported drivers. When it is not possible + to configure a device with any of the drivers in that register, the + kernel can request to load modules which could do it. + + Modular drivers register themselves the first time they are loaded, + so if you disable this option, you need to manually insert the + driver modules (eg: at boot) and then unload them if you will not + use them. This is needed for the stack to know which drivers are + available. IN A FUTURE, the stack will automagically load the + drivers it knows that should be there [due to configuration + settings], but it is not implemented yet. + + Note that when saying Y, you will find many messages on device + attachment in your daemon log [from modprobe] indicating it cannot + find module 'usb-VVVV.IIII.CC.SS.PP'. Those are the driver + combinations, and normally are harmless and can be ignored. + + It is safe [and recommended] to say Y. + +Universal Host Controller Interface (UHCI) support +CONFIG_USB_UHCI + The USB host controllers come in two flavors. This is the UHCI, + which is the standard HCI (Host Controller Interface) used by + Intel. In overall performance, OHCI (Open Host Controller Interface) + is better then UHCI, UHCI is cheaper. Note you can ONLY compile this + as a module. + + In case of doubt, is safe to say Y/M. + + +Open Host Controller Interface (OHCI) support +CONFIG_USB_OHCI + The USB host controllers come in two flavors. This is the OHCI, + which is the standard HCI (Host Controller Interface) used by + anyone who is not Intel. Note you can ONLY compile this as a module. + + In case of doubt, is safe to say Y/M. + + +Hub Devices Class (AUD) 1.0 support +CONFIG_USB_HUBD + Hubs are one of the basic elements of the USB bus topology. They are + the `nodes' which allow you to connect as much as 127 devices to the + same host card. Note you'll always have a root hub embedded in your + USB host adapter card (which exposes normally two ports); this + driver is for non-root hubs. Only if you don't plan to use non-root + hubs, should you say N here. + + In case of doubt, is safe to say Y/M. + + +Audio Devices Class (AUD) 1.0 support +CONFIG_USB_AUDD + The USB defines classes of devices. Enable this option to have + generic driver for devices which follow the Audio Class. These + devices may be all kind of speakers, microphones, recorders, mixing + banks, sequencers, etc ... + + In case of doubt, is safe to say Y/M. + + +Human Interface Devices (HID) 1.0 support +CONFIG_USB_HIDD + The USB defines classes of devices. Enable this option to have a + generic driver for HID Class devices. These devices are the ones we + humans use to communicate (interface) data to the computer, such as + keyboards, mice, tablets, game-pad, joysticks, VR globes, etc ... + + In case of doubt, is safe to say Y/M. + + +Human Interface Devices Boot Protocol (HIDBP) 1.0 support +CONFIG_USB_HIDBP + The HID Class defines a boot protocol for keyboards and mice. This + makes an smaller driver for those who only need minimal support + (mainly for boot time). Enable this option to have the driver + compiled. + + Note this driver *requires* the Miscellaneous User Drivers option, + CONFIG_UMISC, which will be activated auto-magically if you select + it. You may need to rebuild your kernel if it wasn't previously + selected. + + In case of doubt, is safe to say Y/M. + + +Boot Protocol keyboard support +CONFIG_USB_HIDBP_KBD + Enable this option for compiling in support for keyboards in the + HIDBP driver. YOU NEED THE MULTIPLE KEYBOARDS PATCH FOR THIS TO + COMPILE; please don't report as a bug if the driver doesn't compile + for not having applied the patch; that's normal; you can find the + patch at the UUSBD web page or at + ftp://samba.anu.edu.au/pub/linux-pmac/imac/kbd-2.2.0-final.patch.gz. + + It is recommended to say Y here [if you patched the kernel]. + + +Boot Protocol mouse +CONFIG_USB_HIDBP_MSE + Enable this option for compiling in support for mice in the HIDBP + driver. + + It is recommended to say Y here. + + +Boot Protocol Genius EasyPen Tablet +CONFIG_USB_HIDBP_GENIUS_EASYPEN + Enable this option for compiling in support for Genius EasyPen in + Boot Protocol mode. + + It is recommended to say Y here only if you have it. It is not + dangerous if you say Y and don't have it. + + +Communication Devices Class (CDC) 1.0 Support +CONFIG_USB_CDCD + The USB defines classes of devices. Enable this option to have a + generic driver for communication devices. This definition englobes + modems, ISDN adapters, network interfaces (Ethernet, ATM, remote + NDIS) and telephony devices. + + In case of doubt is safe to say Y/M. + + +CDC ISDN support +CONFIG_USB_CDCD_ISDN + The CDC supports many sub-models. This options enables the creation + of a generic driver for USB ISDN (Integrated Services Digital + Network) adapters. + + In case of doubt, it is safe to say Y/M. + + +CDC ISDN support for CAPI 2.0 compliant adapters +CONFIG_USB_CDCD_ISDN_CAPI + Enable this option support CAPI 2.0 compliant ISDN adapters. CAPI is + the `Common ISDN API', which enables adapters of many different + brands to be operated with the same drivers. + + In case of doubt, it is safe to say Y/M. + + +Raw Driver Support +CONFIG_USB_RAWD + Use this driver to be able to read/write directly to device + endpoints from userland, using normal file operations. NOTE THIS + DRIVER IS NOT FINISHED YET!!!!! + + In case of doubt is safe to say Y/M. VIDC Sound CONFIG_VIDC_SOUND Say Y here for ARM systems with the VIDC video controller and 16-bit @@ -11267,3 +11431,6 @@ # LocalWords: alphalinux GOBIOS csn chemnitz nat ACARD AMI MegaRAID megaraid # LocalWords: QNXFS ISI isicom xterms Apollos VPN RCPCI rcpci sgi visws pcmcia # LocalWords: IrLPT UIRCC Tecra +# LocalWords: USB HCI UHCI OHCI AUD HID KBD MSE CDC +# LocalWords: MSDD AUDD HIDD HIDBP CDCD RAWD GENIUS TABLET +# LocalWords: LOD diff -Naur linux.225/arch/alpha/config.in linux.225.visws/arch/alpha/config.in --- linux.225/arch/alpha/config.in Mon Feb 1 12:03:20 1999 +++ linux.225.visws/arch/alpha/config.in Thu Apr 15 17:51:21 1999 @@ -276,6 +276,20 @@ fi endmenu +# USB Support +# +# FIXME: the USB support should be at General Setup on _all_ archs, +# and the drivers scattered on their directories. + +mainmenu_option next_comment +comment 'Universal Serial Bus (USB)' +tristate 'USB Support' CONFIG_USB +if [ "$CONFIG_USB" != "n" ] +then + source drivers/uusbd/Config.in +fi +endmenu + mainmenu_option next_comment comment 'Kernel hacking' diff -Naur linux.225/arch/arm/config.in linux.225.visws/arch/arm/config.in --- linux.225/arch/arm/config.in Thu Jan 14 10:29:28 1999 +++ linux.225.visws/arch/arm/config.in Thu Apr 15 17:51:21 1999 @@ -211,6 +211,20 @@ source fs/Config.in +# USB Support +# +# FIXME: the USB support should be at General Setup on _all_ archs, +# and the drivers scattered on their directories. + +mainmenu_option next_comment +comment 'Universal Serial Bus (USB)' +tristate 'USB Support' CONFIG_USB +if [ "$CONFIG_USB" != "n" ] +then + source drivers/uusbd/Config.in +fi +endmenu + mainmenu_option next_comment comment 'Kernel hacking' diff -Naur linux.225/arch/i386/config.in linux.225.visws/arch/i386/config.in --- linux.225/arch/i386/config.in Fri Mar 12 17:39:50 1999 +++ linux.225.visws/arch/i386/config.in Thu Apr 15 17:51:21 1999 @@ -192,6 +192,20 @@ fi endmenu +# USB Support +# +# FIXME: the USB support should be at General Setup on _all_ archs, +# and the drivers scattered on their directories. + +mainmenu_option next_comment +comment 'Universal Serial Bus (USB)' +tristate 'USB Support' CONFIG_USB +if [ "$CONFIG_USB" != "n" ] +then + source drivers/uusbd/Config.in +fi +endmenu + mainmenu_option next_comment comment 'Kernel hacking' diff -Naur linux.225/arch/m68k/config.in linux.225.visws/arch/m68k/config.in --- linux.225/arch/m68k/config.in Mon Feb 1 12:03:20 1999 +++ linux.225.visws/arch/m68k/config.in Thu Apr 15 17:51:21 1999 @@ -357,6 +357,20 @@ endmenu fi +# USB Support +# +# FIXME: the USB support should be at General Setup on _all_ archs, +# and the drivers scattered on their directories. + +mainmenu_option next_comment +comment 'Universal Serial Bus (USB)' +tristate 'USB Support' CONFIG_USB +if [ "$CONFIG_USB" != "n" ] +then + source drivers/uusbd/Config.in +fi +endmenu + mainmenu_option next_comment comment 'Kernel hacking' diff -Naur linux.225/arch/mips/config.in linux.225.visws/arch/mips/config.in --- linux.225/arch/mips/config.in Mon Feb 1 12:03:20 1999 +++ linux.225.visws/arch/mips/config.in Thu Apr 15 17:51:21 1999 @@ -208,6 +208,20 @@ source drivers/sgi/char/Config.in fi +# USB Support +# +# FIXME: the USB support should be at General Setup on _all_ archs, +# and the drivers scattered on their directories. + +mainmenu_option next_comment +comment 'Universal Serial Bus (USB)' +tristate 'USB Support' CONFIG_USB +if [ "$CONFIG_USB" != "n" ] +then + source drivers/uusbd/Config.in +fi +endmenu + mainmenu_option next_comment comment 'Kernel hacking' diff -Naur linux.225/arch/ppc/config.in linux.225.visws/arch/ppc/config.in --- linux.225/arch/ppc/config.in Wed Mar 10 21:30:31 1999 +++ linux.225.visws/arch/ppc/config.in Thu Apr 15 17:51:21 1999 @@ -168,6 +168,20 @@ source drivers/char/Config.in source fs/Config.in +# USB Support +# +# FIXME: the USB support should be at General Setup on _all_ archs, +# and the drivers scattered on their directories. + +mainmenu_option next_comment +comment 'Universal Serial Bus (USB)' +tristate 'USB Support' CONFIG_USB +if [ "$CONFIG_USB" != "n" ] +then + source drivers/uusbd/Config.in +fi +endmenu + mainmenu_option next_comment comment 'Sound' tristate 'Sound card support' CONFIG_SOUND diff -Naur linux.225/arch/sparc/config.in linux.225.visws/arch/sparc/config.in --- linux.225/arch/sparc/config.in Mon Mar 15 16:10:43 1999 +++ linux.225.visws/arch/sparc/config.in Thu Apr 15 17:51:21 1999 @@ -194,6 +194,20 @@ tristate 'Software watchdog' CONFIG_SOFT_WATCHDOG endmenu +# USB Support +# +# FIXME: the USB support should be at General Setup on _all_ archs, +# and the drivers scattered on their directories. + +mainmenu_option next_comment +comment 'Universal Serial Bus (USB)' +tristate 'USB Support' CONFIG_USB +if [ "$CONFIG_USB" != "n" ] +then + source drivers/uusbd/Config.in +fi +endmenu + mainmenu_option next_comment comment 'Kernel hacking' diff -Naur linux.225/arch/sparc64/config.in linux.225.visws/arch/sparc64/config.in --- linux.225/arch/sparc64/config.in Mon Mar 15 16:10:43 1999 +++ linux.225.visws/arch/sparc64/config.in Thu Apr 15 17:51:21 1999 @@ -245,6 +245,20 @@ tristate 'Software watchdog' CONFIG_SOFT_WATCHDOG endmenu +# USB Support +# +# FIXME: the USB support should be at General Setup on _all_ archs, +# and the drivers scattered on their directories. + +mainmenu_option next_comment +comment 'Universal Serial Bus (USB)' +tristate 'USB Support' CONFIG_USB +if [ "$CONFIG_USB" != "n" ] +then + source drivers/uusbd/Config.in +fi +endmenu + mainmenu_option next_comment comment 'Kernel hacking' diff -Naur linux.225/drivers/Makefile linux.225.visws/drivers/Makefile --- linux.225/drivers/Makefile Fri Nov 20 08:59:01 1998 +++ linux.225.visws/drivers/Makefile Thu Apr 15 17:51:21 1999 @@ -10,7 +10,7 @@ SUB_DIRS := block char net misc sound MOD_SUB_DIRS := $(SUB_DIRS) ALL_SUB_DIRS := $(SUB_DIRS) pci scsi sbus cdrom isdn pnp \ - macintosh video dio zorro fc4 + macintosh video dio zorro fc4 uusbd ifdef CONFIG_DIO SUB_DIRS += dio @@ -100,5 +100,16 @@ SUB_DIRS += net/hamradio MOD_SUB_DIRS += net/hamradio endif +# If CONFIG_USB is set, core USB support is compiled in, but we want +# to allow having stuff as modules. +ifeq ($(CONFIG_USB),y) +SUB_DIRS += uusbd +MOD_SUB_DIRS += uusbd +else + ifeq ($(CONFIG_USB),m) + MOD_SUB_DIRS += uusbd + endif +endif + include $(TOPDIR)/Rules.make diff -Naur linux.225/drivers/char/Makefile linux.225.visws/drivers/char/Makefile --- linux.225/drivers/char/Makefile Wed Mar 24 11:46:00 1999 +++ linux.225.visws/drivers/char/Makefile Fri Apr 16 10:12:03 1999 @@ -42,7 +42,7 @@ ifndef CONFIG_SUN_KEYBOARD ifdef CONFIG_VT -L_OBJS += keyboard.o +LX_OBJS += keyboard.o endif ifneq ($(ARCH),m68k) L_OBJS += pc_keyb.o defkeymap.o diff -Naur linux.225/drivers/char/keyboard.c linux.225.visws/drivers/char/keyboard.c --- linux.225/drivers/char/keyboard.c Fri Jan 8 11:11:45 1999 +++ linux.225.visws/drivers/char/keyboard.c Thu Apr 15 17:43:19 1999 @@ -24,6 +24,7 @@ */ #include +#include #include #include #include @@ -31,6 +32,7 @@ #include #include #include +#include #include #include @@ -71,35 +73,55 @@ } /* - * global state includes the following, and various static variables - * in this module: prev_scancode, shift_state, diacr, npadch, dead_key_next. - * (last_console is now a global variable) + * Per-keyboard state. + * At present all keyboards are connected to the current fg_console - + * this needs to be generalized a bit. */ +struct keyboard_state { + struct keyboard_state *next; + struct kbd_ll_operations *k_op; + void *devid; + ushort **key_maps; + struct kbd_struct *kbd; + struct tty_struct *tty; + int last_scancode; + struct timer_list repeat_timer; + int dead_key_next; + int shift_state; + int npadch; /* -1 or number assembled on pad */ +#ifdef CONFIG_MAGIC_SYSRQ + int sysrq_pressed; +#endif + char rep; /* flag telling character repeat */ + unsigned char diacr; + unsigned char k_down[NR_SHIFT]; /* shift state counters.. */ + unsigned long key_down[256/BITS_PER_LONG]; /* keyboard key bitmap */ +}; -/* shift state counters.. */ -static unsigned char k_down[NR_SHIFT] = {0, }; -/* keyboard key bitmap */ -static unsigned long key_down[256/BITS_PER_LONG] = { 0, }; +/* + * List of all keyboards (and a spinlock for it). + */ +static struct keyboard_state *all_kbds; +static spinlock_t all_kbds_lock = SPIN_LOCK_UNLOCKED; -static int dead_key_next = 0; /* * In order to retrieve the shift_state (for the mouse server), either * the variable must be global, or a new procedure must be created to * return the value. I chose the former way. + * This now reflects the shift_state of the last keyboard + * whose shift_state changed - paulus. */ int shift_state = 0; -static int npadch = -1; /* -1 or number assembled on pad */ -static unsigned char diacr = 0; -static char rep = 0; /* flag telling character repeat */ + struct kbd_struct kbd_table[MAX_NR_CONSOLES]; static struct tty_struct **ttytab; -static struct kbd_struct * kbd = kbd_table; -static struct tty_struct * tty = NULL; -void compute_shiftstate(void); +void kbd_compute_shiftstate(struct keyboard_state *); -typedef void (*k_hand)(unsigned char value, char up_flag); -typedef void (k_handfn)(unsigned char value, char up_flag); +typedef void (*k_hand)(struct keyboard_state *, unsigned char value, + char up_flag); +typedef void (k_handfn)(struct keyboard_state *, unsigned char value, + char up_flag); static k_handfn do_self, do_fn, do_spec, do_pad, do_dead, do_cons, do_cur, do_shift, @@ -116,16 +138,17 @@ #define TYPES_ALLOWED_IN_RAW_MODE ((1 << KT_SPEC) | (1 << KT_SHIFT)) -typedef void (*void_fnp)(void); -typedef void (void_fn)(void); +typedef void (*void_fnp)(struct keyboard_state *); +typedef void (void_fn)(struct keyboard_state *); static void_fn do_null, enter, show_ptregs, send_intr, lastcons, caps_toggle, num, hold, scroll_forw, scroll_back, boot_it, caps_on, compose, - SAK, decr_console, incr_console, spawn_console, bare_num; + SAK, decr_console, incr_console, spawn_console, bare_num, + do_show_mem, do_show_state; static void_fnp spec_fn_table[] = { - do_null, enter, show_ptregs, show_mem, - show_state, send_intr, lastcons, caps_toggle, + do_null, enter, show_ptregs, do_show_mem, + do_show_state, send_intr, lastcons, caps_toggle, num, hold, scroll_forw, scroll_back, boot_it, caps_on, compose, SAK, decr_console, incr_console, spawn_console, bare_num @@ -143,33 +166,28 @@ const int NR_TYPES = SIZE(max_vals); -/* N.B. drivers/macintosh/mac_keyb.c needs to call put_queue */ -void put_queue(int); -static unsigned char handle_diacr(unsigned char); +static void put_queue(struct tty_struct *, int); +static unsigned char handle_diacr(struct keyboard_state *, unsigned char); /* kbd_pt_regs - set by keyboard_interrupt(), used by show_ptregs() */ struct pt_regs * kbd_pt_regs; -#ifdef CONFIG_MAGIC_SYSRQ -static int sysrq_pressed; -#endif - /* * Many other routines do put_queue, but I think either * they produce ASCII, or they produce some user-assigned * string, and in both cases we might assume that it is * in utf-8 already. */ -void to_utf8(ushort c) { +void to_utf8(struct tty_struct *tty, ushort c) { if (c < 0x80) - put_queue(c); /* 0******* */ + put_queue(tty, c); /* 0******* */ else if (c < 0x800) { - put_queue(0xc0 | (c >> 6)); /* 110***** 10****** */ - put_queue(0x80 | (c & 0x3f)); + put_queue(tty, 0xc0 | (c >> 6)); /* 110***** 10****** */ + put_queue(tty, 0x80 | (c & 0x3f)); } else { - put_queue(0xe0 | (c >> 12)); /* 1110**** 10****** 10****** */ - put_queue(0x80 | ((c >> 6) & 0x3f)); - put_queue(0x80 | (c & 0x3f)); + put_queue(tty, 0xe0 | (c >> 12)); /* 1110**** 10****** 10****** */ + put_queue(tty, 0x80 | ((c >> 6) & 0x3f)); + put_queue(tty, 0x80 | (c & 0x3f)); } /* UTF-8 is defined for words of up to 31 bits, but we need only 16 bits here */ @@ -178,29 +196,60 @@ /* * Translation of escaped scancodes to keycodes. * This is now user-settable (for machines were it makes sense). + * (XXX It doesn't make much sense with multiple keyboards :-() */ int setkeycode(unsigned int scancode, unsigned int keycode) { - return kbd_setkeycode(scancode, keycode); + struct keyboard_state *ks; + int err = 0; + + spin_lock(&all_kbds_lock); + for (ks = all_kbds; ks != NULL && err == 0; ks = ks->next) + if (ks->key_maps == key_maps) + err = ks->k_op->setkeycode(ks->devid, scancode, keycode); + spin_unlock(&all_kbds_lock); + return err; } +/* XXX and this makes even less sense... :-* */ int getkeycode(unsigned int scancode) { - return kbd_getkeycode(scancode); + struct keyboard_state *ks = all_kbds; + + if (ks == NULL) + return -ENODEV; + return ks->k_op->getkeycode(ks->devid, scancode); +} + +static void kbd_repeat(unsigned long devid) +{ + struct keyboard_state *ks = (struct keyboard_state *) devid; + unsigned long flags; + + save_flags(flags); + cli(); + kbd_handle_scancode((void *)ks, ks->last_scancode); + restore_flags(flags); } -void handle_scancode(unsigned char scancode) +void kbd_handle_scancode(void *kbdid, int scancode) { + struct keyboard_state *ks = (struct keyboard_state *) kbdid; unsigned char keycode; char up_flag; /* 0 or 0200 */ - char raw_mode; + char raw_mode, rep; + struct kbd_struct *kbd; + struct tty_struct *tty; do_poke_blanked_console = 1; mark_bh(CONSOLE_BH); add_keyboard_randomness(scancode); - tty = ttytab? ttytab[fg_console]: NULL; + del_timer(&ks->repeat_timer); + + ks->tty = tty = ttytab? ttytab[fg_console]: NULL; + ks->kbd = kbd = kbd_table + fg_console; if (tty && (!tty->driver_data)) { /* * We touch the tty structure via the the ttytab array @@ -211,53 +260,65 @@ */ tty = NULL; } - kbd = kbd_table + fg_console; + if ((raw_mode = (kbd->kbdmode == VC_RAW))) { - put_queue(scancode); + put_queue(tty, scancode); /* we do not return yet, because we want to maintain the key_down array, so that we have the correct values when finishing RAW mode or when changing VT's */ } - if (!kbd_pretranslate(scancode, raw_mode)) - return; + if (!ks->k_op->pretranslate(ks->devid, scancode, raw_mode)) + return; + /* * Convert scancode to keycode */ up_flag = (scancode & 0200); scancode &= 0x7f; - if (!kbd_translate(scancode, &keycode, raw_mode)) - return; + if (!ks->k_op->translate(ks->devid, scancode, &keycode, raw_mode)) + return; /* * At this point the variable `keycode' contains the keycode. - * Note: the keycode must not be 0 (++Geert: on m68k 0 is valid). * We keep track of the up/down status of the key, and * return the keycode if in MEDIUMRAW mode. */ if (up_flag) { rep = 0; - if(!test_and_clear_bit(keycode, key_down)) - up_flag = kbd_unexpected_up(keycode); + if (!test_and_clear_bit(keycode, ks->key_down)) + up_flag = ks->k_op->unexpected_up(ks->devid, keycode); } else - rep = test_and_set_bit(keycode, key_down); + rep = test_and_set_bit(keycode, ks->key_down); + ks->rep = rep; + + if (!raw_mode && !up_flag + && ks->k_op->dont_repeat && !ks->k_op->dont_repeat[keycode]) { + ks->last_scancode = scancode; + ks->repeat_timer.function = kbd_repeat; + ks->repeat_timer.data = (unsigned long) ks; + ks->repeat_timer.expires = jiffies + + (rep? ks->k_op->repeat_delay: ks->k_op->repeat_initial); + add_timer(&ks->repeat_timer); + } #ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */ - if (keycode == SYSRQ_KEY) { - sysrq_pressed = !up_flag; + if (keycode == ks->k_op->sysrq_key) { + ks->sysrq_pressed = !up_flag; return; - } else if (sysrq_pressed) { + } else if (ks->sysrq_pressed) { if (!up_flag) - handle_sysrq(kbd_sysrq_xlate[keycode], kbd_pt_regs, kbd, tty); + handle_sysrq(ks->k_op->sysrq_xlate[keycode], + kbd_pt_regs, kbd, tty); return; } #endif if (kbd->kbdmode == VC_MEDIUMRAW) { /* soon keycodes will require more than one byte */ - put_queue(keycode + up_flag); + put_queue(tty, keycode + up_flag); raw_mode = 1; /* Most key classes will be ignored */ } @@ -281,8 +342,8 @@ u_char type; /* the XOR below used to be an OR */ - int shift_final = shift_state ^ kbd->lockstate ^ kbd->slockstate; - ushort *key_map = key_maps[shift_final]; + int shift_final = ks->shift_state ^ kbd->lockstate ^ kbd->slockstate; + ushort *key_map = ks->key_maps[shift_final]; if (key_map != NULL) { keysym = key_map[keycode]; @@ -295,36 +356,36 @@ if (type == KT_LETTER) { type = KT_LATIN; if (vc_kbd_led(kbd, VC_CAPSLOCK)) { - key_map = key_maps[shift_final ^ (1<key_maps[shift_final ^ (1<slockstate = 0; } else { /* maybe only if (kbd->kbdmode == VC_UNICODE) ? */ if (!up_flag && !raw_mode) - to_utf8(keysym); + to_utf8(tty, keysym); } } else { /* maybe beep? */ /* we have at least to update shift_state */ #if 1 /* how? two almost equivalent choices follow */ - compute_shiftstate(); + kbd_compute_shiftstate(ks); #else - keysym = U(plain_map[keycode]); + keysym = U(ks->key_maps[0][keycode]); type = KTYP(keysym); if (type == KT_SHIFT) - (*key_handler[type])(keysym & 0xff, up_flag); + (*key_handler[type])(ks, keysym & 0xff, up_flag); #endif } } } -void put_queue(int ch) +static void put_queue(struct tty_struct *tty, int ch) { wake_up(&keypress_wait); if (tty) { @@ -333,7 +394,7 @@ } } -static void puts_queue(char *cp) +static void puts_queue(struct tty_struct *tty, char *cp) { wake_up(&keypress_wait); if (!tty) @@ -346,49 +407,61 @@ con_schedule_flip(tty); } -static void applkey(int key, char mode) +static void applkey(struct tty_struct *tty, int key, char mode) { static char buf[] = { 0x1b, 'O', 0x00, 0x00 }; buf[1] = (mode ? 'O' : '['); buf[2] = key; - puts_queue(buf); + puts_queue(tty, buf); } -static void enter(void) +static void enter(struct keyboard_state *ks) { - if (diacr) { - put_queue(diacr); - diacr = 0; + if (ks->diacr) { + put_queue(ks->tty, ks->diacr); + ks->diacr = 0; } - put_queue(13); - if (vc_kbd_mode(kbd,VC_CRLF)) - put_queue(10); + put_queue(ks->tty, 13); + if (vc_kbd_mode(ks->kbd, VC_CRLF)) + put_queue(ks->tty, 10); } -static void caps_toggle(void) +static void caps_toggle(struct keyboard_state *ks) { - if (rep) + if (ks->rep) return; - chg_vc_kbd_led(kbd, VC_CAPSLOCK); + chg_vc_kbd_led(ks->kbd, VC_CAPSLOCK); } -static void caps_on(void) +static void caps_on(struct keyboard_state *ks) { - if (rep) + if (ks->rep) return; - set_vc_kbd_led(kbd, VC_CAPSLOCK); + set_vc_kbd_led(ks->kbd, VC_CAPSLOCK); } -static void show_ptregs(void) +static void show_ptregs(struct keyboard_state *ks) { if (kbd_pt_regs) show_regs(kbd_pt_regs); } -static void hold(void) +static void do_show_mem(struct keyboard_state *ks) +{ + show_mem(); +} + +static void do_show_state(struct keyboard_state *ks) { - if (rep || !tty) + show_state(); +} + +static void hold(struct keyboard_state *ks) +{ + struct tty_struct *tty = ks->tty; + + if (ks->rep || !tty) return; /* @@ -402,12 +475,12 @@ stop_tty(tty); } -static void num(void) +static void num(struct keyboard_state *ks) { - if (vc_kbd_mode(kbd,VC_APPLIC)) - applkey('P', 1); + if (vc_kbd_mode(ks->kbd, VC_APPLIC)) + applkey(ks->tty, 'P', 1); else - bare_num(); + bare_num(ks); } /* @@ -416,19 +489,19 @@ * Bind this to NumLock if you prefer that the NumLock key always * changes the NumLock flag. */ -static void bare_num(void) +static void bare_num(struct keyboard_state *ks) { - if (!rep) - chg_vc_kbd_led(kbd,VC_NUMLOCK); + if (!ks->rep) + chg_vc_kbd_led(ks->kbd, VC_NUMLOCK); } -static void lastcons(void) +static void lastcons(struct keyboard_state *ks) { /* switch to the last used console, ChN */ set_console(last_console); } -static void decr_console(void) +static void decr_console(struct keyboard_state *ks) { int i; @@ -441,7 +514,7 @@ set_console(i); } -static void incr_console(void) +static void incr_console(struct keyboard_state *ks) { int i; @@ -454,45 +527,49 @@ set_console(i); } -static void send_intr(void) +static void send_intr(struct keyboard_state *ks) { + struct tty_struct *tty = ks->tty; + if (!tty) return; tty_insert_flip_char(tty, 0, TTY_BREAK); con_schedule_flip(tty); } -static void scroll_forw(void) +static void scroll_forw(struct keyboard_state *ks) { scrollfront(0); } -static void scroll_back(void) +static void scroll_back(struct keyboard_state *ks) { scrollback(0); } -static void boot_it(void) +static void boot_it(struct keyboard_state *ks) { ctrl_alt_del(); } -static void compose(void) +static void compose(struct keyboard_state *ks) { - dead_key_next = 1; + ks->dead_key_next = 1; } int spawnpid, spawnsig; -static void spawn_console(void) +static void spawn_console(struct keyboard_state *ks) { if (spawnpid) if(kill_proc(spawnpid, spawnsig, 1)) spawnpid = 0; } -static void SAK(void) +static void SAK(struct keyboard_state *ks) { + struct tty_struct *tty = ks->tty; + /* * SAK should also work in all raw modes and reset * them properly. @@ -505,17 +582,19 @@ #endif } -static void do_ignore(unsigned char value, char up_flag) +static void do_ignore(struct keyboard_state *ks, unsigned char value, char up_flag) { } -static void do_null() +static void do_null(struct keyboard_state *ks) { - compute_shiftstate(); + kbd_compute_shiftstate(ks); } -static void do_spec(unsigned char value, char up_flag) +static void do_spec(struct keyboard_state *ks, unsigned char value, char up_flag) { + struct kbd_struct *kbd = ks->kbd; + if (up_flag) return; if (value >= SIZE(spec_fn_table)) @@ -523,29 +602,29 @@ if ((kbd->kbdmode == VC_RAW || kbd->kbdmode == VC_MEDIUMRAW) && !(SPECIALS_ALLOWED_IN_RAW_MODE & (1 << value))) return; - spec_fn_table[value](); + spec_fn_table[value](ks); } -static void do_lowercase(unsigned char value, char up_flag) +static void do_lowercase(struct keyboard_state *ks, unsigned char value, char up_flag) { printk(KERN_ERR "keyboard.c: do_lowercase was called - impossible\n"); } -static void do_self(unsigned char value, char up_flag) +static void do_self(struct keyboard_state *ks, unsigned char value, char up_flag) { if (up_flag) return; /* no action, if this is a key release */ - if (diacr) - value = handle_diacr(value); + if (ks->diacr) + value = handle_diacr(ks, value); - if (dead_key_next) { - dead_key_next = 0; - diacr = value; + if (ks->dead_key_next) { + ks->dead_key_next = 0; + ks->diacr = value; return; } - put_queue(value); + put_queue(ks->tty, value); } #define A_GRAVE '`' @@ -558,10 +637,10 @@ {A_GRAVE, A_ACUTE, A_CFLEX, A_TILDE, A_DIAER, A_CEDIL }; /* Obsolete - for backwards compatibility only */ -static void do_dead(unsigned char value, char up_flag) +static void do_dead(struct keyboard_state *ks, unsigned char value, char up_flag) { value = ret_diacr[value]; - do_dead2(value,up_flag); + do_dead2(ks, value, up_flag); } /* @@ -569,12 +648,12 @@ * dead keys modifying the same character. Very useful * for Vietnamese. */ -static void do_dead2(unsigned char value, char up_flag) +static void do_dead2(struct keyboard_state *ks, unsigned char value, char up_flag) { if (up_flag) return; - diacr = (diacr ? handle_diacr(value) : value); + ks->diacr = (ks->diacr ? handle_diacr(ks, value) : value); } @@ -585,12 +664,12 @@ * Otherwise, conclude that DIACR was not combining after all, * queue it and return CH. */ -unsigned char handle_diacr(unsigned char ch) +unsigned char handle_diacr(struct keyboard_state *ks, unsigned char ch) { - int d = diacr; + int d = ks->diacr; int i; - diacr = 0; + ks->diacr = 0; for (i = 0; i < accent_table_size; i++) { if (accent_table[i].diacr == d && accent_table[i].base == ch) @@ -600,30 +679,31 @@ if (ch == ' ' || ch == d) return d; - put_queue(d); + put_queue(ks->tty, d); return ch; } -static void do_cons(unsigned char value, char up_flag) +static void do_cons(struct keyboard_state *ks, unsigned char value, char up_flag) { if (up_flag) return; set_console(value); } -static void do_fn(unsigned char value, char up_flag) +static void do_fn(struct keyboard_state *ks, unsigned char value, char up_flag) { if (up_flag) return; if (value < SIZE(func_table)) { if (func_table[value]) - puts_queue(func_table[value]); + puts_queue(ks->tty, func_table[value]); } else printk(KERN_ERR "do_fn called with value=%d\n", value); } -static void do_pad(unsigned char value, char up_flag) +static void do_pad(struct keyboard_state *ks, unsigned char value, char up_flag) { + struct kbd_struct *kbd = ks->kbd; static const char *pad_chars = "0123456789+-*/\015,.?()"; static const char *app_map = "pqrstuvwxylSRQMnnmPQ"; @@ -631,8 +711,8 @@ return; /* no action, if this is a key release */ /* kludge... shift forces cursor/number keys */ - if (vc_kbd_mode(kbd,VC_APPLIC) && !k_down[KG_SHIFT]) { - applkey(app_map[value], 1); + if (vc_kbd_mode(kbd,VC_APPLIC) && !ks->k_down[KG_SHIFT]) { + applkey(ks->tty, app_map[value], 1); return; } @@ -640,59 +720,60 @@ switch (value) { case KVAL(K_PCOMMA): case KVAL(K_PDOT): - do_fn(KVAL(K_REMOVE), 0); + do_fn(ks, KVAL(K_REMOVE), 0); return; case KVAL(K_P0): - do_fn(KVAL(K_INSERT), 0); + do_fn(ks, KVAL(K_INSERT), 0); return; case KVAL(K_P1): - do_fn(KVAL(K_SELECT), 0); + do_fn(ks, KVAL(K_SELECT), 0); return; case KVAL(K_P2): - do_cur(KVAL(K_DOWN), 0); + do_cur(ks, KVAL(K_DOWN), 0); return; case KVAL(K_P3): - do_fn(KVAL(K_PGDN), 0); + do_fn(ks, KVAL(K_PGDN), 0); return; case KVAL(K_P4): - do_cur(KVAL(K_LEFT), 0); + do_cur(ks, KVAL(K_LEFT), 0); return; case KVAL(K_P6): - do_cur(KVAL(K_RIGHT), 0); + do_cur(ks, KVAL(K_RIGHT), 0); return; case KVAL(K_P7): - do_fn(KVAL(K_FIND), 0); + do_fn(ks, KVAL(K_FIND), 0); return; case KVAL(K_P8): - do_cur(KVAL(K_UP), 0); + do_cur(ks, KVAL(K_UP), 0); return; case KVAL(K_P9): - do_fn(KVAL(K_PGUP), 0); + do_fn(ks, KVAL(K_PGUP), 0); return; case KVAL(K_P5): - applkey('G', vc_kbd_mode(kbd, VC_APPLIC)); + applkey(ks->tty, 'G', vc_kbd_mode(kbd, VC_APPLIC)); return; } - put_queue(pad_chars[value]); + put_queue(ks->tty, pad_chars[value]); if (value == KVAL(K_PENTER) && vc_kbd_mode(kbd, VC_CRLF)) - put_queue(10); + put_queue(ks->tty, 10); } -static void do_cur(unsigned char value, char up_flag) +static void do_cur(struct keyboard_state *ks, unsigned char value, char up_flag) { static const char *cur_chars = "BDCA"; if (up_flag) return; - applkey(cur_chars[value], vc_kbd_mode(kbd,VC_CKMODE)); + applkey(ks->tty, cur_chars[value], vc_kbd_mode(ks->kbd,VC_CKMODE)); } -static void do_shift(unsigned char value, char up_flag) +static void do_shift(struct keyboard_state *ks, unsigned char value, char up_flag) { - int old_state = shift_state; + struct kbd_struct *kbd = ks->kbd; + int old_state = ks->shift_state; - if (rep) + if (ks->rep) return; /* Mimic typewriter: @@ -706,23 +787,23 @@ if (up_flag) { /* handle the case that two shift or control keys are depressed simultaneously */ - if (k_down[value]) - k_down[value]--; + if (ks->k_down[value]) + ks->k_down[value]--; } else - k_down[value]++; + ks->k_down[value]++; - if (k_down[value]) - shift_state |= (1 << value); + if (ks->k_down[value]) + ks->shift_state |= (1 << value); else - shift_state &= ~ (1 << value); + ks->shift_state &= ~ (1 << value); /* kludge */ - if (up_flag && shift_state != old_state && npadch != -1) { + if (up_flag && ks->shift_state != old_state && ks->npadch != -1) { if (kbd->kbdmode == VC_UNICODE) - to_utf8(npadch & 0xffff); + to_utf8(ks->tty, ks->npadch & 0xffff); else - put_queue(npadch & 0xff); - npadch = -1; + put_queue(ks->tty, ks->npadch & 0xff); + ks->npadch = -1; } } @@ -731,42 +812,55 @@ /* maybe called when keymap is undefined, so that shiftkey release is seen */ void compute_shiftstate(void) { + struct keyboard_state *ks; + + spin_lock(&all_kbds_lock); + for (ks = all_kbds; ks != NULL; ks = ks->next) + kbd_compute_shiftstate(ks); + spin_unlock(&all_kbds_lock); +} + +void kbd_compute_shiftstate(struct keyboard_state *ks) +{ int i, j, k, sym, val; - shift_state = 0; - for(i=0; i < SIZE(k_down); i++) - k_down[i] = 0; - - for(i=0; i < SIZE(key_down); i++) - if(key_down[i]) { /* skip this word if not a single bit on */ - k = i*BITS_PER_LONG; - for(j=0; jshift_state = 0; + for (i = 0; i < SIZE(ks->k_down); i++) + ks->k_down[i] = 0; + + for (i = 0; i < SIZE(ks->key_down); i++) { + if (ks->key_down[i] == 0) + continue; /* skip this word if not a single bit on */ + k = i * BITS_PER_LONG; + for (j = 0; j < BITS_PER_LONG; j++, k++) { + if (test_bit(k, ks->key_down) == 0) + continue; + sym = U(ks->key_maps[0][k]); + if (KTYP(sym) == KT_SHIFT) { + val = KVAL(sym); + if (val == KVAL(K_CAPSSHIFT)) + val = KVAL(K_SHIFT); + ks->k_down[val]++; + ks->shift_state |= (1<shift_state; /* XXX */ } -static void do_meta(unsigned char value, char up_flag) +static void do_meta(struct keyboard_state *ks, unsigned char value, char up_flag) { if (up_flag) return; - if (vc_kbd_mode(kbd, VC_META)) { - put_queue('\033'); - put_queue(value); + if (vc_kbd_mode(ks->kbd, VC_META)) { + put_queue(ks->tty, '\033'); + put_queue(ks->tty, value); } else - put_queue(value | 0x80); + put_queue(ks->tty, value | 0x80); } -static void do_ascii(unsigned char value, char up_flag) +static void do_ascii(struct keyboard_state *ks, unsigned char value, char up_flag) { int base; @@ -774,30 +868,30 @@ return; if (value < 10) /* decimal input of code, while Alt depressed */ - base = 10; + base = 10; else { /* hexadecimal input of code, while AltGr depressed */ - value -= 10; - base = 16; + value -= 10; + base = 16; } - if (npadch == -1) - npadch = value; + if (ks->npadch == -1) + ks->npadch = value; else - npadch = npadch * base + value; + ks->npadch = ks->npadch * base + value; } -static void do_lock(unsigned char value, char up_flag) +static void do_lock(struct keyboard_state *ks, unsigned char value, char up_flag) { - if (up_flag || rep) + if (up_flag || ks->rep) return; - chg_vc_kbd_lock(kbd, value); + chg_vc_kbd_lock(ks->kbd, value); } -static void do_slock(unsigned char value, char up_flag) +static void do_slock(struct keyboard_state *ks, unsigned char value, char up_flag) { - if (up_flag || rep) + if (up_flag || ks->rep) return; - chg_vc_kbd_slock(kbd, value); + chg_vc_kbd_slock(ks->kbd, value); } /* @@ -886,13 +980,74 @@ static void kbd_bh(void) { unsigned char leds = getleds(); + struct keyboard_state *ks; if (leds != ledstate) { ledstate = leds; - kbd_leds(leds); + spin_lock(&all_kbds_lock); + for (ks = all_kbds; ks != NULL; ks = ks->next) + ks->k_op->leds(ks, leds); + spin_unlock(&all_kbds_lock); } } +#ifndef NEW_STYLE_KEYBOARD +int oldkbd_setkeycode(void *devid, unsigned int scancode, unsigned int keycode) +{ + return kbd_setkeycode(scancode, keycode); +} + +int oldkbd_getkeycode(void *devid, unsigned int scancode) +{ + return kbd_getkeycode(scancode); +} + +int oldkbd_pretranslate(void *devid, unsigned char scancode, char raw_mode) +{ + return kbd_pretranslate(scancode, raw_mode); +} + +int oldkbd_translate(void *devid, unsigned char scancode, + unsigned char *keycode, char raw_mode) +{ + return kbd_translate(scancode, keycode, raw_mode); +} + +int oldkbd_unexpected_up(void *devid, unsigned char keycode) +{ + return kbd_unexpected_up(keycode); +} + +void oldkbd_leds(void *devid, unsigned char leds) +{ + return kbd_leds(leds); +} + +struct kbd_ll_operations oldkbd_operations = { + oldkbd_setkeycode, + oldkbd_getkeycode, + oldkbd_pretranslate, + oldkbd_translate, + oldkbd_unexpected_up, + oldkbd_leds, +#ifdef CONFIG_MAGIC_SYSRQ + SYSRQ_KEY, + kbd_sysrq_xlate, +#else + -1, NULL, +#endif + 0, 0, NULL +}; + +void *old_kbdid; + +void handle_scancode(unsigned char scancode) +{ + if (old_kbdid) + kbd_handle_scancode(old_kbdid, scancode); +} +#endif /* NEW_STYLE_KEYBOARD */ + __initfunc(int kbd_init(void)) { int i; @@ -912,7 +1067,58 @@ ttytab = console_driver.table; kbd_init_hw(); + +#ifndef NEW_STYLE_KEYBOARD + old_kbdid = register_keyboard(oldkbd_operations, NULL, key_maps); +#endif /* NEW_STYLE_KEYBOARD */ + init_bh(KEYBOARD_BH, kbd_bh); mark_bh(KEYBOARD_BH); return 0; } + +void *register_keyboard(struct kbd_ll_operations *ops, void *devid, + ushort **kmaps) +{ + struct keyboard_state *ks, **ksp; + + ks = (struct keyboard_state *) kmalloc(sizeof(*ks), GFP_KERNEL); + if (ks == 0) + return NULL; + memset(ks, 0, sizeof(*ks)); + + ks->next = NULL; + ks->k_op = ops; + ks->devid = devid; + ks->key_maps = kmaps; + ks->npadch = -1; + + if (all_kbds == NULL && kmaps != key_maps) + memcpy(key_maps, kmaps, sizeof(key_maps)); + + spin_lock(&all_kbds_lock); + for (ksp = &all_kbds; *ksp != NULL; ksp = &(*ksp)->next) + ; + *ksp = ks; + spin_unlock(&all_kbds_lock); + + return (void *) ks; +} + +void unregister_keyboard(void *kbdid) +{ + struct keyboard_state **ksp; + + spin_lock(&all_kbds_lock); + for (ksp = &all_kbds; *ksp != NULL; ksp = &(*ksp)->next) { + if (*ksp == kbdid) { + *ksp = (*ksp)->next; + kfree(kbdid); + break; + } + } +} + +EXPORT_SYMBOL(register_keyboard); +EXPORT_SYMBOL(unregister_keyboard); +EXPORT_SYMBOL(kbd_handle_scancode); diff -Naur linux.225/drivers/char/pc_keyb.c linux.225.visws/drivers/char/pc_keyb.c --- linux.225/drivers/char/pc_keyb.c Sun Feb 7 00:23:04 1999 +++ linux.225.visws/drivers/char/pc_keyb.c Thu Apr 15 17:43:19 1999 @@ -15,6 +15,10 @@ * */ +/* Uncomment this if you have keyboard in ps/2 port, not mouse */ + +/*#define KEYBOARD_IN_PSAUX*/ + #include #include @@ -27,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +60,8 @@ "\206\207\210\211\212\000\000789-456+1" /* 0x40 - 0x4f */ "230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */ "\r\000/"; /* 0x60 - 0x6f */ +#else +#define pckbd_sysrq_xlate NULL #endif static void kbd_write(int address, int data); @@ -91,6 +98,30 @@ #endif /* CONFIG_PSMOUSE */ +extern int pckbd_setkeycode(void *, unsigned int scancode, + unsigned int keycode); +extern int pckbd_getkeycode(void *, unsigned int scancode); +extern int pckbd_pretranslate(void *, unsigned char scancode, char raw_mode); +extern int pckbd_translate(void *, unsigned char scancode, + unsigned char *keycode, char raw_mode); +extern char pckbd_unexpected_up(void *, unsigned char keycode); +extern void pckbd_leds(void *, unsigned char leds); +#define SYSRQ_KEY 0x54 + +struct kbd_ll_operations pckbd_operations = { + pckbd_setkeycode, + pckbd_getkeycode, + pckbd_pretranslate, + pckbd_translate, + pckbd_unexpected_up, + pckbd_leds, + SYSRQ_KEY, + pckbd_sysrq_xlate, + 0, 0, NULL +}; + +static void *pckbd_id; + /* * Wait for keyboard controller input buffer to drain. * @@ -242,7 +273,7 @@ static unsigned int prev_scancode = 0; /* remember E0, E1 */ -int pckbd_setkeycode(unsigned int scancode, unsigned int keycode) +int pckbd_setkeycode(void *devid, unsigned int scancode, unsigned int keycode) { if (scancode < SC_LIM || scancode > 255 || keycode > 127) return -EINVAL; @@ -253,7 +284,7 @@ return 0; } -int pckbd_getkeycode(unsigned int scancode) +int pckbd_getkeycode(void *devid, unsigned int scancode) { return (scancode < SC_LIM || scancode > 255) ? -EINVAL : @@ -294,7 +325,7 @@ return 1; } -int pckbd_pretranslate(unsigned char scancode, char raw_mode) +int pckbd_pretranslate(void *devid, unsigned char scancode, char raw_mode) { if (scancode == 0xff) { /* in scancode mode 1, my ESC key generates 0xff */ @@ -316,8 +347,8 @@ return 1; } -int pckbd_translate(unsigned char scancode, unsigned char *keycode, - char raw_mode) +int pckbd_translate(void *devid, unsigned char scancode, + unsigned char *keycode, char raw_mode) { if (prev_scancode) { /* @@ -395,7 +426,7 @@ return 1; } -char pckbd_unexpected_up(unsigned char keycode) +char pckbd_unexpected_up(void *devid, unsigned char keycode) { /* unexpected, but this can happen: maybe this was a key release for a FOCUS 9000 PF key; if we want to see it, we have to clear up_flag */ @@ -416,6 +447,9 @@ mouse_reply_expected = 0; } +#ifdef KEYBOARD_IN_PSAUX + handle_strangecode (scancode); +#else add_mouse_randomness(scancode); if (aux_count) { int head = queue->head; @@ -430,7 +464,54 @@ } } #endif +#endif +} + +#ifdef KEYBOARD_IN_PSAUX +static void *psaux_id; + +static char strange_xlat[ 256 ] = { +/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ +/* 0 */ 0x00,0x43,0x00,0x3f,0x3d,0x3b,0x3c,0x58,0x00,0x44,0x42,0x40,0x3e,0x0f,0x29,0x00, +/* 1 */ 0x00, 56,0x2a,0x00, 29,0x10,0x02,0x00,0x00,0x00,0x2c,0x1f,0x1e,0x11,0x03,0x00, +/* 2 */ 0x00,0x2e,0x2d,0x20,0x12,0x05,0x04,0x00,0x00, 57,0x2f,0x21,0x14,0x13,0x06,0x00, +/* 3 */ 0x00,0x31,0x30,0x23,0x22,0x15,0x07,0x00,0x00,0x00,0x32,0x24,0x16,0x08,0x09,0x00, +/* 4 */ 0x00,0x33,0x25,0x17,0x18,0x0b,0x0a,0x00,0x00,0x34,0x35,0x26,0x27,0x19,0x0c,0x00, +/* 5 */ 0x00,0x00,0x28,0x00,0x1a,0x0d,0x00,0x00,0x3a,0x36,0x1c,0x1b,0x00,0x2b,0x00,0x00, +/* 6 */ 0x00,0x00,0x00,0x00,0x00,0x00, 14,0x00,0x00,0x4f,0x00,0x4b,0x47,0x00,0x00,0x00, +/* 7 */ 0x52,0x53,0x50,0x00,0x4d,0x48,0x01,0x00,0x57,0x00,0x51,0x00,0x37,0x49,0x46,0x00, +/* 8 */ 0x00,0x00,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +/* 9 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +/* a */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +/* b */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +/* c */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +/* d */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +/* e */ 0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +/* f */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; + +static void handle_strangecode(int c) +{ + static int or = 0, i; + + switch (c) { + case 0xf0: + or = 0x80; + return; + } + + i = strange_xlat[c]; + if (!i) + printk( "Unknown strangecode %x\n", c ); +#if 0 + else + printk( "Known strangecode %x = %x\n", c, i ); +#endif + kbd_handle_scancode( psaux_id, i|or ); + or = 0; } +#endif + /* * This reads the keyboard status port, and does the @@ -452,7 +533,7 @@ handle_mouse_event(scancode); } else { if (do_acknowledge(scancode)) - handle_scancode(scancode); + kbd_handle_scancode(pckbd_id, scancode); mark_bh(KEYBOARD_BH); } @@ -512,7 +593,7 @@ return 0; } -void pckbd_leds(unsigned char leds) +void pckbd_leds(void *devid, unsigned char leds) { if (!send_data(KBD_CMD_SET_LEDS) || !send_data(leds)) send_data(KBD_CMD_ENABLE); /* re-enable kbd if any errors */ @@ -724,6 +805,10 @@ /* Ok, finally allocate the IRQ, and off we go.. */ request_irq(KEYBOARD_IRQ, keyboard_interrupt, 0, "keyboard", NULL); + + pckbd_id = register_keyboard(&pckbd_operations, NULL, key_maps); + if (pckbd_id == NULL) + printk(KERN_ERR "Couldn't register PC keyboard!\n"); } #if defined CONFIG_PSMOUSE @@ -859,7 +944,7 @@ return 0; } queue->head = queue->tail = 0; /* Flush input queue */ - if (request_irq(AUX_IRQ, keyboard_interrupt, SA_SHIRQ, "PS/2 Mouse", AUX_DEV)) { + if (request_irq(AUX_IRQ, keyboard_interrupt, SA_SHIRQ, "PS/2 Auxiliary", AUX_DEV)) { aux_count--; return -EBUSY; } @@ -992,6 +1077,12 @@ kbd_write(KBD_CNTL_REG, KBD_CCMD_MOUSE_DISABLE); /* Disable aux device. */ kbd_write_cmd(AUX_INTS_OFF); /* Disable controller ints. */ +#ifdef KEYBOARD_IN_PSAUX + open_aux(NULL, NULL); + psaux_id = register_keyboard(&pckbd_operations, NULL, key_maps); + if (psaux_id == NULL) + printk(KERN_ERR "Couldn't register keyboard in PS/2 mouse port!\n"); +#endif return 0; } diff -Naur linux.225/drivers/uusbd/ANNOUNCE linux.225.visws/drivers/uusbd/ANNOUNCE --- linux.225/drivers/uusbd/ANNOUNCE Wed Dec 31 16:00:00 1969 +++ linux.225.visws/drivers/uusbd/ANNOUNCE Sun Apr 4 18:46:26 1999 @@ -0,0 +1,131 @@ + + Hi! + + This is the 19990405 release of the UUSBD. + + Long time to have it, but this brings a lot of changes and +enhancements, and more are to come. + + I wanted to comment on the messages we've been seeing on the +mailing list lately about difficulty and how slow is development and +etc, etc, etc ... as I don't know enough english as to express it, +I'll do it in Spanish: + + Estoy hasta la puntal ciruelo de que la peña que más + se queja sea la que menos se moja el culo a la hora de + colaborar, así que me empezaré a pasar por el arco del triunfo + a todo capullei que siga dando la vara sin contribuir, porque + es que me raya mazo; al menos que se lean la puta + documentación. Al que no le mole, que curre para que mejore, + que de esto al final chupamos todos. + + Having said this, I'm more relaxed and can think more +carefully :). I've added a sort note at the README on how to start +reading the USB source. Not too much, but it's a readme file, right? + + And on the complex code, well, as I commented someone, once +you understand destructors (easy if you've done 'serious' C++/OO +sometime) and that when a usecount of zero is reached it is +automatically fired, or that you can use it to destroy a used +structure, it's easy to follow. + + Anyway, I plan some simplifications, one of them as suggested +by Linus. I thought of it but didn't want to change it as it was +working; now that the general feeling prefers things more simple, I'll +do it. I also plan to (someday) modify the UHCI driver to follow +Linus' design. It's much simpler ... I don't know why I rejected that +idea last summer. + + I've been working all the time on UHCI, so I had no time to +keep on with HID. When? I dunno, I really want it. The parser is +complicated and it's challenging me more as time goes by. + + So, let's go with a change summary: + + - Added ability to disable dynamic load on demand of drivers + (at config time); instead you have to load all drivers at + the very beginning and then unload them. This way they are + registered, and uusbd won't try to find any other + different. + + This is only really useful if you want to get rid of those + 'modprobe: can't locate module usb-VVVV.IIII.CC.SS.PP' + messages. + + - Added hacky support for the Genius EasyPen tablet, in boot + protocol mode. + + - Trimmed logs in source files, trying to reduce overall + package size. + + - Modified the ts_usb_pipe structure. The transaction list has + gone to the endpoint structure, and the host pointer is away + for ever. The endpoint now keeps a list of the transactions + queued for it and the descriptors open to it. + + Note that now the ts_usb_pipe, as member of a list, has a + ts_snode and a destructor (which is automagically set at + usb_pipe_endp_set()), so, when using it in another structure + (statically, not as a pointer) ts_snode_ref() it, to evitate + it's destruction (see it at ts_usb_device and + ts_usb_device_nozero()). + + The descriptors list at the endpoint could seem complicate, + and perhaps it may go away in the future; Linus' suggestion + was just to mark the device as 'unreachable', unregister it + from everywhere and keep going until all references are + gone. This way there's not much need for the list. + + Anyway, there is the foundation for shared endpoints. Now + you can open multiple pipes to the same endpoint. I have to + add code to be able to open one exclusively. + + - The usb_pipe_*() functions have been simplified and it's + semantics changed, so that the stupid step of going trough + addresses lookup is gone, as we almost always had the + pointer available directly before calling. + + - The transaction list has been reworked to make sense, using + a linear order which is much easier to track and maintain. + + - khubdd has been renamed to kusbdd, because it was doing more + then hub managing ... esthetical. + + - Now you can unload a module even if there are devices + plugged in. You have to start by the drivers, but it + works. Only when some file is opened by a process into a + driver (eg. gpm), as normal, the module is not unloadable. + + - Solved some clashes between the UHCI and OHCI modules + (static symbols are good :), but they still clash and cannot + be loaded at the same time [or the box freezes]. Even two + OHCI controllers clash when using the same module as driver. + + - Fixed to allow compilation with CONFIG_PCI undefined + ... though quite useles now ... + + - Catched why UHCI was loosing packets [and thus mice and kbd + where flaky]. It's related to incorrect synchronization of + the data toggle. Solved using a fast hack, but have to + rework part of the scheduling code to have that finely + tuned. + + Still I cannot plug devices trough hubs to UHCI controllers, + they don't work [CRC/Timeout error]. Should verify the + cables ... and the sw. + + Also modified the UHCI code so that cou can remove a + transaction from the transaction list from its callback + function. Thanks! + + So, that's all folks. Tomorrow I have full day with PSpice +simulating little stupid digital circuits, and perhaps this week I'll +have to fly again to the little Mountain View at the SV, so I don't +know how much will advance, and where, but I'd like to push HID a wee +bit. + + BTW, for those who still didn't notice, when I said 'boycott +him [to Linus]' I was kidding, ironizing, etc ... is fun :), and what +the fuck? Ain't I free enough as to ask it if I wished? + + Have a nice night ... I'll try to :) diff -Naur linux.225/drivers/uusbd/BUG-REPORTING linux.225.visws/drivers/uusbd/BUG-REPORTING --- linux.225/drivers/uusbd/BUG-REPORTING Wed Dec 31 16:00:00 1969 +++ linux.225.visws/drivers/uusbd/BUG-REPORTING Mon Dec 7 06:20:50 1998 @@ -0,0 +1,63 @@ + + Bugs? any? are you sure? really, really, _really_ sure? Ok, I +believe you :). Did you brush your teeth? HAVE YOU CHECKED THE KERNEL +VERSION IS OK? [visit the INSTALL file to see which kversion I'm using +to develop]; modutils version is also ok to the kernel? + + REMEMBER: NON-SMP KERNELS. SMP WILL FAIL. + + Fine, so you've found a bug [no, you ain't the only one :)], +please follow these guidelines and do a bug report [e-mail is +recommended, but if you wan't to do the report via post-card, you're +free]. + + Sooo ... when reporting bugs or whatever [I welcome every +class of report, if it worked or not], please send me: + + - version of the UUSBD driver you are using + + - kernel version (`uname -a') + + - kernel configuration (linux/.config) + + - compiler you're using [gcc | egcs + versions] + + - the kernel logs + + The best way to get'em is to redirect kernel (all levels) + logs to a single file inserting the line: + + kern.* /var/log/kernel.log + + at /etc/syslog.conf (remember to do `killall -HUP syslogd' + to restart syslogd after changing it). On Debian systems, + `/etc/init.d/sysklogd restart' will do. + + IT IS _VERY_ IMPORTANT TO HAVE _ALL_ THE LOG LEVELS. IF YOU + ONLY MAIL ME THE NON-DEBUG LEVELS [I.E. ONLY ERRORS], I + WON'T BE ABLE TO DIAGNOSE THE PROBLEM AS FAST AS OTHERWISE. + + It uses to also help if you force the symbol `GDLF_FNTRACE' + to be defined for all source code files, what will generate + bulks of trace information [to do that, on file + include/uusbd/gdlf.h, section `/* 1 to override global + settings */', change `#undef GDLF_FNTRACE' to `#define + GDLF_FNTRACE'. + + - your `lspci -vv' [if you don't have `lspci', `cat /proc/pci' + is ok]. + + - if there are crashes, the `System.map' file generated by + executing `make sysmap' in the UUSBD directory _after_ + loading the modules. + + NOTE I WONT BE ABLE TO DEBUG ANYTHING IF I DONT HAVE ALL THIS +INFO [specially System.map for crashes]. And yes, I'm shouting :) + + PLEASE, COMPRESS _ALL_ FILES, with `gzip -9' or best, `bzip2 +-9'. I get my mail trough a modem link and it's a pain to pay to the +phone co. every coin :) + + Just in case, my e-mail is inaky@peloncho.fis.ucm.es. + + Thanks diff -Naur linux.225/drivers/uusbd/COPYING linux.225.visws/drivers/uusbd/COPYING --- linux.225/drivers/uusbd/COPYING Wed Dec 31 16:00:00 1969 +++ linux.225.visws/drivers/uusbd/COPYING Fri Dec 26 18:06:59 1997 @@ -0,0 +1,340 @@ + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff -Naur linux.225/drivers/uusbd/COPYRIGHT linux.225.visws/drivers/uusbd/COPYRIGHT --- linux.225/drivers/uusbd/COPYRIGHT Wed Dec 31 16:00:00 1969 +++ linux.225.visws/drivers/uusbd/COPYRIGHT Sat Feb 20 14:53:55 1999 @@ -0,0 +1,15 @@ + + The work under this package is copyrighted 1996, 1997 and 1998 +by Iñaky Pérez González and others where +noted so; however, it is distributed and released under the GNU Public +License (visit the file COPYING) in hope it will be useful for anybody +who may need it and to encourage public contributions to these efforts +we call Linux and Free Software/Open Source Software. + + All trademarks are copyrighted (or registered, or owned, or +whatever right they've got over it) by their respective owners. + + Other persons who have contributed significant parts of code: + +- Paul MacKerras [hidbp stuff + ohci fixes and code] +- Rasca Gmelch [raw driver] diff -Naur linux.225/drivers/uusbd/Config.in linux.225.visws/drivers/uusbd/Config.in --- linux.225/drivers/uusbd/Config.in Wed Dec 31 16:00:00 1969 +++ linux.225.visws/drivers/uusbd/Config.in Sun Apr 4 17:31:30 1999 @@ -0,0 +1,97 @@ +# +# UUSBD Configuration +# + +#if [ "$CONFIG_PROCFS" = "y" ] +#then +# bool 'Support procfs status reports' CONFIG_USB_PROCFS +#fi +bool 'Enable modular drivers load on demand?' CONFIG_USB_LOD + +# HCis +dep_tristate 'Universal Host Controller Interface (UHCI) support' CONFIG_USB_UHCI $CONFIG_USB +dep_tristate 'Open Host Controller Interface (OHCI) support' CONFIG_USB_OHCI $CONFIG_USB + + +# +# Class drivers +# ------------- + +# Hub +dep_tristate 'Hub Devices Class (HUBD) 1.0 support' CONFIG_USB_HUBD $CONFIG_USB +# Audio +dep_tristate 'Audio Devices Class (AUDD) 1.0 support' CONFIG_USB_AUDD $CONFIG_USB +# HID +dep_tristate 'Human Interface Devices (HID) 1.0 support' CONFIG_USB_HIDD $CONFIG_USB +dep_tristate 'Human Interface Devices Boot Protocol (HIDBP) 1.0 support' CONFIG_USB_HIDBP $CONFIG_USB +if [ "$CONFIG_USB_HIDBP" != "n" ] +then + if [ "$CONFIG_UMISC" = "n" -a "$CONFIG_USB_HIDBP" = "m" ]; then + define_bool CONFIG_UMISC m + fi + if [ "$CONFIG_UMISC" != "y" -a "$CONFIG_USB_HIDBP" = "y" ]; then + define_bool CONFIG_UMISC y + fi +# if [ "$CONFIG_UMISC" == "n" ]; then +# if [ "$CONFIG_USB_HIDBP" = "m" ]; then +# define_bool CONFIG_UMISC m +# else +# define_bool CONFIG_UMISC y +# fi +# fi + bool ' Boot Protocol Keyboard support' CONFIG_USB_HIDBP_KBD + bool ' Boot Protocol Mouse support' CONFIG_USB_HIDBP_MSE + bool ' Boot Protocol Genius EasyPen support' CONFIG_USB_HIDBP_GENIUS_EASYPEN + if [ "$CONFIG_USB_HIDBP_GENIUS_EASYPEN" = "y" -a "$CONFIG_USB_HIDBP_MSE" = "n" ]; then + define_bool CONFIG_USB_HIDBP_MSE y + fi +fi + +# Communications +# +# FIXME: add checks for CONFIG_SERIAL, CONFIG_ISDN_CAPI, .. etc + +dep_tristate 'Communication Devices Class 1.0 support' CONFIG_USB_CDCD $CONFIG_USB + +if [ "$CONFIG_USB_CDCD" != "n" ] +then + +# dep_tristate ' POTS Model' CONFIG_USB_CDCD_POTS $CONFIG_USB_CDCD +# if [ "$CONFIG_USB_CDCD_POTS" != "n" ] +# then +# dep_tristate ' Direct Line Model' CONFIG_USB_CDCD_POTS_DL $CONFIG_USB_CDCD +# dep_tristate ' Datapump Model' CONFIG_USB_CDCD_POTS_DP $CONFIG_USB_CDCD +# dep_tristate ' Abstract Control Model' CONFIG_USB_CDCD_POTS_AC $CONFIG_USB_CDCD +# if [ "$CONFIG_USB_CDCD_POTS_AC" != "n" ] +# then +# dep_tristate ' Abstract Control Model Serial Emulation' CONFIG_USB_CDCD_AC_POTS_SE $CONFIG_USB_CDCD +# fi +# dep_tristate ' Telephone Model' CONFIG_USB_CDCD_POTS_TM $CONFIG_USB_CDCD +# fi + + dep_tristate ' ISDN Model' CONFIG_USB_CDCD_ISDN $CONFIG_USB_CDCD + if [ "$CONFIG_USB_CDCD_ISDN" != "n" ] + then +# dep_tristate ' Multi Channel Model' CONFIG_USB_CDCD_ISDN_MC $CONFIG_USB_CDCD + dep_tristate ' CAPI 2.0 Model' CONFIG_USB_CDCD_ISDN_CAPI $CONFIG_USB_CDCD + fi + +# dep_tristate ' Networking Model' CONFIG_USB_CDCD_NET $CONFIG_USB_CDCD +# if [ "$CONFIG_USB_CDCD_NET" != "n" ] +# then +# dep_tristate ' Ethernet' CONFIG_USB_CDCD_NET_ETH $CONFIG_USB_CDCD +# dep_tristate ' ATM' CONFIG_USB_CDCD_NET_ATM $CONFIG_USB_CDCD +# dep_tristate ' Remote NDIS' CONFIG_USB_CDCD_NET_RNDIS $CONFIG_USB_CDCD +# fi + +fi + +# Mass +dep_tristate 'Mass Storage Devices (MSD) 1.0 support' CONFIG_USB_MSDD $CONFIG_USB + +# Raw device access +dep_tristate 'Raw Device Access (experimental)' CONFIG_USB_RAWD $CONFIG_USB + +# Local variables: +# mode: shell-script +# End: diff -Naur linux.225/drivers/uusbd/INSTALL linux.225.visws/drivers/uusbd/INSTALL --- linux.225/drivers/uusbd/INSTALL Wed Dec 31 16:00:00 1969 +++ linux.225.visws/drivers/uusbd/INSTALL Sun Feb 28 12:16:35 1999 @@ -0,0 +1,228 @@ + + You require: + + - kernel version: 2.2.0 [ok, -pre9] + + - latest modutils for the kernel + + - NON SMP kernel LOCK CODE IS BROKEN!!! Don't use + CONFIG_SMP!!! (btw, Martin Schaller + an adventurous user tried and + found trouble, related to the re-routing of IRQ's by the + IO-APIC; he's already contacted Ingo Molnar in order to + handle it) + + You may install in two different ways; I'll prepend A or B to +each shell command line (i.e. "A$ " or "B$ ") to denote each method; +if nothing prepended (just "$ "), that's a common step. + + One [method A] is extracting the uusbd-VERSION.tar.gz package +at the Linux kernel subdirectory linux/drivers, for linking into the +kernel: + +$ export LINUXDIR=/usr/src/linux +A$ export UUSBDDIR=$LINUXDIR/drivers/uusbd +A$ tar xzf uusbd-VERSION.tar.gz -C $LINUXDIR/drivers + + Other is [method B] extracting on a directory by itself: + +B$ export UUSBDDIR=~yogurcito/uusbd +B$ tar xzf uusbd-VERSION.tar.gz -C $UUSBDDIR/.. + + Note all scripts look at the LINUXDIR environment for a +placement of Linux Kernel sources. If not found, they assume they are +at `/usr/src/linux'. + + Now we generate a patch to modify the kernel source tree, in +order to enable using the Linux configuration system to configure the +UUSBD. You require it always, never care if you compile into the +kernel or outside it: + +B$ cd $LINUXDIR/drivers +B$ rm -f uusbd +B$ ln -s $UUSBDDIR uusbd +B$ cd $LINUXDIR/include +B$ rm -f uusbd +B$ ln -s $UUSBDDIR/include/uusbd uusbd +$ cd $UUSBDDIR/patches +A$ ./install-headers +$ ./mkcfgpatch > /tmp/usb-patch +$ cd $LINUXDIR/.. +$ patch -p0 < /tmp/usb-patch +$ rm /tmp/usb-patch +$ cd $LINUXDIR +$ make menuconfig + +[or `make xconfig' or `make oldconfig', up to you]. + + If you plan to use the keyboard support, you MUST install the +multiple keyboard patch. See the comment for ./hidbp/usb-hidbp.o +below. + + Before starting to compile, take a look at +$UUSBDDIR/Makefile.inc and fix anything you could need to [normally +everything should be setup ok already]. Then, for method A [standard +kernel build method]: + +A$ cd $LINUXDIR +A$ make dep # generate dependencies +A$ make clean # do cleanings +A$ make modules # compile modules +A$ make modules_install # install modules + + for method B: + +B$ cd $UUSBDDIR +B$ make dep +B$ make modules +B$ make modules_install + + What you should have now [at the $UUSBDDIR directory or at +/lib/modules/KVERSION/uusbd]: + +./usb.o The core USB driver and hub manager + +./uhci/usb-uhci.o The HCD (Host Controller Driver) for UHCI + controllers (on most motherboards with Intel + chipset). UHCI generally sucks, but it is a + cheap solution, and in some cases, it is + worth the effort. However, I recommend OHCI + controllers [read next]. + + You can tell if your controller is UHCI or + OHCI by looking at the output of 'lspci' or + 'cat /proc/pci'. If the USB controller it + shows there has I/O range assigned, then + that's UHCI. If it has memory, then it is + OHCI. + +./ohci/usb-ohci.o The HCD for OHCI controllers. Found on other + platforms [i.e., Compaqs, non-Intel ...] and + starting to be seen on a lot of PC + motherboards. Fine controllers. + +./audd/usb-audd.o The USB Audio Devices Driver [SKELETON + IMPLEMENTED ONLY]; a driver for audio + devices. Note this is just an skeleton, it + does nothing useful yet. + +./audd/usb-msdd.o The USB Mass Storage Devices Driver [SKELETON + IMPLEMENTED ONLY]; a driver for mass storage + devices. Note this is just an skeleton, it + does nothing useful yet. + +./audd/usb-cdcd.o The USB Communication Devices Class Driver + [SKELETON IMPLEMENTED ONLY]; a driver for + communication devices. Note this is just an + skeleton, it does nothing useful yet. + +./hidd/usb-hidd.o The USB Human Interface Devices Driver, not + implemented fully yet. + +./hidbp/usb-hidbp.o The USB Human Interface Devices Driver Boot + Protocol. This is a simplified, smaller driver + for use of HID keyboards and mice which + support the Boot Protocol. + + This driver uses the misc character devices, + with minors 16 up to 48. So: + + $ mknod /dev/hidbp-kbd-0 c 10 16 + $ mknod /dev/hidbp-kbd-1 c 10 17 + $ ... + $ mknod /dev/hidbp-kbd-15 c 10 31 + + $ mknod /dev/hidbp-mse-0 c 10 32 + $ mknod /dev/hidbp-mse-1 c 10 33 + $ ... + $ mknod /dev/hidbp-mse-15 c 10 47 + + Where the hidbp-?-0 is the first detected kbd or + mouse, hidbp-?-1 the second ... + + You can use the little programs + hidbp/b(kbd|mse)-test to see some output [in + form of hex codes]. You can also use the + mouse, by using the corresponding device file + and using protocol type 'busmouse'. IANF we'll + develop a new protocol exchanging method to + allow high resollution and more enhancements. + + MULTIPLE!! --> Keyboard is being integrated into the kernel + KEYBOARDS!! --> ... stay tuned. In the mean time, you require + the keyboard integration patch you can get + from the web page. If you don't use it, + HIDBP_kbd won't compile. + +./hubd/usb-hubd.o The USB Hub Driver; driver for USB hubs, + backbone of the USB topology. Half tested, but + works. + +./rawd/usb-rawd.o Foundations for a raw access driver, to access + the USB devices from userland directly to the + endpoints. Not finished yet. Thanks to Rasca + Gmelch for working on this. + +./skeld/usb-skeld.o Skeleton driver. You should be able of + creating a very basic driver starting out of + this one. + + To ease module loading, you can use the file +$UUSBDDIR/patches/uusbd-conf.modules. If using Debian +modutils-2.1.121 or higher, just do: + +$ cp $UUSBDDIR/patches/uusbd-conf.modules /etc/modutils/uusbd +$ update-modules + + if you ain't using Debian, you can get by with: + +$ cat $UUSBDDIR/patches/uusbd-conf.modules >> /etc/conf.modules + + After any of them, do: + +$ depmod -av + +to regenerate the module dependencies for the UUSBD modules. Make sure +you see uusbd stuff on the output. + + If you look at that file, you'll see something like: + +alias usb-0000.0000.08.00.00 usb-msdd.o +alias usb-0000.0000.09.00.00 usb-hubd.o + +These little numbers are codes. First four hex digits are vendor code, +next is product ID, then USB class, subclass and protocol. The UUSBD +core uses these names to load the modules needed to configure a +device. 0x9 is the HUB class and 0x8 the Mass Storage class. + + Now you just can + +$ modprobe usb + +this will automatically load the host controller drivers you compiled +in (if so requested), for UHCI and OHCI controllers and start +enumerating. + + Most people just have one controller, so you only have to +compile UHCI or OHCI support. To guess which one you should compile, +use '/sbin/lspci -v | grep USB'. This shows your controllers. If they +have the text '(prog-if 10)' appended, that's an OHCI controller; else +it is an UHCI controller. + + WARNING!! I'm still trying to hunt why it _freezes_ when you +load and run, at the same time, the usb-uhci and usb-ohci drivers, so +_never_ load them both [unless you plan to debug it]. + + Be sure to have USB enabled on your motherboard, as on `old' +ones it comes disabled. Go to the BIOS and enable everything that's +USB related. I dunno if with new kernel's PCI code that's necessary, +but just in case (there has been some traffic on the mailing list +about this issue lately; there're some BIOSes which doesn't permit +enabling the USB support). + + Iñaky + + inaky@peloncho.fis.ucm.es + http://peloncho.fis.ucm.es/~inaky + http://peloncho.fis.ucm.es/~inaky/USB + diff -Naur linux.225/drivers/uusbd/MIRRORS linux.225.visws/drivers/uusbd/MIRRORS --- linux.225/drivers/uusbd/MIRRORS Wed Dec 31 16:00:00 1969 +++ linux.225.visws/drivers/uusbd/MIRRORS Sat Feb 27 10:45:20 1999 @@ -0,0 +1,47 @@ + + The project's web is located at these URLs: + +[U = URL, M = maintainer, P = mirroring period, L = location] + +U: http://peloncho.fis.ucm.es/~inaky/uusbd-www +M: inaky@peloncho.fis.ucm.es +P: master +L: Spain/RUNET + +U: http://club.idecnet.com/~pegon/uusbd-www +M: pegon@idecnet.com +P: daily, at 02:00 CET +L: Spain/IdecNet + +U: http://wwwhome.cs.utwente.nl/~ia_ric/USB +M: Ric Klaren +P: unknown +L: The Netherlands + +U: http://www.bcinternet.com/~inaky/USB +M: Mike Wood +P: daily, at 03:00 EST +L: Canada + +U: http://darwin.igeofcu.unam.mx/USB +M: esteban@igeofcu.unam.mx +P: daily +L: Mexico + +U: http://nv.org/linux/USB +M: Steven Byrnes +P: unknown +L: Houston and Maryland, USA + +U: http://electricrain.com/Linux/USB +M: Gregory P. Smith +P: daily, at 01:42 PST +L: Mountain View, California USA + +U: http://josefine.ben.tuwien.ac.at/~mfischer/mirrors/peloncho.fis.ucm.es/~inaky/uusbd-www +M: Markus Fischer +P: daily, at 00:00 CET +L: Vienna, Austria + + Thanks to all the people who provided mirror space! + diff -Naur linux.225/drivers/uusbd/Makefile linux.225.visws/drivers/uusbd/Makefile --- linux.225/drivers/uusbd/Makefile Wed Dec 31 16:00:00 1969 +++ linux.225.visws/drivers/uusbd/Makefile Sun Feb 7 05:11:19 1999 @@ -0,0 +1,211 @@ +# +# Makefile for the Universal USB Driver, Linux flavour +# ---------------------------------------------------- +# +# Distributed under the terms of the GNU Public License Version 2 +# See files COPYRIGHT and COPYING at the root distribution directory +# +# all_targets: Makes O_TARGET and L_TARGET +# fastdep: To remake quickly and recursively the dependencies +# sub_dirs: Creates the sub directories SUB_DIRS +# modules: Makes M_OBJS, MX_OBJS, MI_OBJS and MIX_OBJS, +# recursively in MOD_SUB_DIRS and MOD_IN_SUB_DIRS. Also +# makes the module's list name and links'em to +# $(TOPDIR)/modules. + +# Subdirs to run into +# ------------------- + +CLEANSTUFF += System.map .modules-list TAGS +SUBDIRS := audd cdcd hidd hidbp hubd msdd ohci quirks rawd \ + skeld uhci +SUB_DIRS = quirks +MOD_IN_SUB_DIRS := quirks +ALL_SUB_DIRS := $(SUBDIRS) +MOD_LIST_NAME := UUSBD_MODULES + +MOD_TO_LIST = $(shell test -r $(MODULES_FILE) && \ + sed -e 's/^.*\///g' -e 's/dummy_module//' \ + $(MODULES_FILE)) +export UUSBDDIR := $(shell pwd) + +# This line must be here for it to interpretate the *DIR and also to +# define all the CONFIG_* and stuff needed below. +include Makefile.inc +ifdef NOT_IN_LINUX_KERNEL +export EXTRA_CFLAGS += -I./include/ +endif + +# Object and module specification + +USB_OBJS := generic.o \ + hcd.o \ + hubm-stch.o \ + hubm-hkeep.o \ + hubm-generic.o \ + kernel-interface.o \ + khubdd.o \ + misc.o \ + slist.o \ + mm.o \ + usbd-3slist.o \ + usbd-cfg.o \ + usbd-descr.o \ + usbd-endp.o \ + usbd-iface.o \ + usbd-ops.o \ + usbd-device.o \ + usbd-drv.o \ + usbd-host.o \ + usbd-tr.o \ + usbd.o + +ifeq ($(CONFIG_PCI),y) + USB_OBJS += pci.o +endif + +ifeq ($(CONFIG_USB_PROCFS),y) + USB_OBJS += procfs.o +endif + +O_OBJS := $(USB_OBJS) +OX_OBJS := usb-symtab.o +O_TARGET := usb.o + +M_OBJS := dummy_module + +# Playing with the values of the configuration statements, [n, m, y], +# set up what to compile. + +ifeq ($(CONFIG_USB),y) + L_TARGET := usb.a + L_OBJS := usb.o +endif + +ifeq ($(CONFIG_USB),m) + M_OBJS += usb.o +endif + + +ifeq ($(CONFIG_USB_UHCI),y) + SUB_DIRS += uhci + L_OBJS += uhci/usb-uhci.o +endif + +ifeq ($(CONFIG_USB_UHCI),m) + MOD_IN_SUB_DIRS += uhci +endif + + +ifeq ($(CONFIG_USB_OHCI),y) + SUB_DIRS += ohci + L_OBJS += ohci/usb-ohci.o +endif + +ifeq ($(CONFIG_USB_OHCI),m) + MOD_IN_SUB_DIRS += ohci +endif + + +ifeq ($(CONFIG_USB_HUBD),y) + SUB_DIRS += hubd + L_OBJS += hubd/usb-hubd.o +endif + +ifeq ($(CONFIG_USB_HUBD),m) + MOD_IN_SUB_DIRS += hubd +endif + + +ifeq ($(CONFIG_USB_SKELD),y) + SUB_DIRS += skeld + L_OBJS += skeld/usb-skeld.o +endif + +ifeq ($(CONFIG_USB_SKELD),m) + MOD_IN_SUB_DIRS += skeld +endif + + +ifeq ($(CONFIG_USB_HIDD),y) + SUB_DIRS += hidd + L_OBJS += hidd/usb-hidd.o +endif + +ifeq ($(CONFIG_USB_HIDD),m) + MOD_IN_SUB_DIRS += hidd +endif + + +ifeq ($(CONFIG_USB_HIDBP),y) + SUB_DIRS += hidbp + L_OBJS += hidbp/usb-hidbp.o +endif + +ifeq ($(CONFIG_USB_HIDBP),m) + MOD_IN_SUB_DIRS += hidbp +endif + + +ifeq ($(CONFIG_USB_AUDD),y) + SUB_DIRS += audd + L_OBJS += audd/usb-audd.o +endif + +ifeq ($(CONFIG_USB_AUDD),m) + MOD_IN_SUB_DIRS += audd +endif + + +ifeq ($(CONFIG_USB_CDCD),y) + SUB_DIRS += cdcd + L_OBJS += cdcd/usb-cdcd.o +endif + +ifeq ($(CONFIG_USB_CDCD),m) + MOD_IN_SUB_DIRS += cdcd +endif + + +ifeq ($(CONFIG_USB_MSDD),y) + SUB_DIRS += msdd + L_OBJS += msdd/usb-msdd.o +endif + +ifeq ($(CONFIG_USB_MSDD),m) + MOD_IN_SUB_DIRS += msdd +endif + + +ifeq ($(CONFIG_USB_RAWD),y) + SUB_DIRS += rawd + L_OBJS += rawd/usb-rawd.o +endif +ifeq ($(CONFIG_USB_RAWD),m) + MOD_IN_SUB_DIRS += rawd +endif + + +include $(TOPDIR)/Rules.make +include Makefile-rules.inc + +.PHONY: dummy_module +dummy_module: +ifeq ($(CONFIG_USB),m) + rm -f $(MODULES_FILE) + for v in $(M_OBJS); do echo `pwd`/$$v; done >> $(MODULES_FILE) +endif + +ifndef IN_LINUX_KERNEL +modules_install: + @( set -e; \ + MODLIB=$(INSTALL_MOD_PATH)/lib/modules/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION); \ + inst_mod() { These="`cat $$1`"; \ + mkdir -p $$MODLIB/$$2; cp $$These $$MODLIB/$$2; \ + echo Installing modules under $$MODLIB/$$2; \ + }; \ + grep -v dummy_module .modules-list > .modules-list.$$$$; \ + mv .modules-list.$$$$ .modules-list; \ + if [ -f .modules-list ]; then inst_mod .modules-list uusbd; fi; \ + ) +endif diff -Naur linux.225/drivers/uusbd/Makefile-rules.inc linux.225.visws/drivers/uusbd/Makefile-rules.inc --- linux.225/drivers/uusbd/Makefile-rules.inc Wed Dec 31 16:00:00 1969 +++ linux.225.visws/drivers/uusbd/Makefile-rules.inc Fri Dec 11 17:56:22 1998 @@ -0,0 +1,117 @@ +# +# Universal USB Driver +# -------------------- +# +# Distributed under the terms of the GNU Public License Version 2 +# See files COPYRIGHT and COPYING at the root distribution directory +# +# PPC Stuff for iMac by Paul Mackerras +# +# Common make rules for stand-alone compilation + + +# no user-serviceable parts below this line + +ifndef IN_LINUX_KERNEL +.PHONY: TAGS tags dep clean distclean realclean doc docs tar cvstar love + +%.i: %.c + $(CPP) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $^ -o $@ + +.PRECIOUS: %.i +%.ci: %.i + -grep -v -e "^#" -e "^ *$$" $^ | indent > $@ + mv -f $@ $^ + +%.s: %.c + $(CC) -S $(CFLAGS) $(EXTRA_CFLAGS) -c $^ -o $@ + +%.io: %.i + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $^ -o $@ + +dep: +ifneq "$(strip $(SUBDIRS))" "" + set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done +endif +ifneq "$(strip $(SUB_DIRS))" "" + set -e; for i in $(SUB_DIRS); do $(MAKE) -C $$i $@; done +endif +ifneq "$(strip $(MOD_SUB_DIRS))" "" + set -e; for i in $(MOD_SUB_DIRS); do $(MAKE) -C $$i $@; done +endif + -$(CPP) -M $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) *.c > .depend + +CLEANSTUFF += *~ *.[aios] *.bak *.ci *.io +DISTCLEANSTUFF += .depend \\\#*\\\# .*.flags +REALCLEANSTUFF += TAGS + +clean: + rm -f $(CLEANSTUFF) +ifneq "$(strip $(SUBDIRS))" "" + set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done +endif + +distclean: + rm -f $(DISTCLEANSTUFF) $(CLEANSTUFF) +ifneq "$(strip $(SUBDIRS))" "" + set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done +endif + +realclean: + rm -f $(REALCLEANSTUFF) $(DISTCLEANSTUFF) $(CLEANSTUFF) +ifneq "$(strip $(SUBDIRS))" "" + set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done +endif + +doc docs: +ifneq "$(strip $(SUBDIRS))" "" + set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done +endif + +TAGS: *.c *.h +TAGS tags: + find . -name "*.[ch]" | etags - + +# archive + +ifeq "$(TARNAME)" "" +TARNAME=uusbd +TARDIR=uusbd +endif + +tar: + tar c -C .. \ + --exclude '*~' --exclude '*.bak' \ + --exclude '*.[aios]' --exclude '*.ci' --exclude '*.io' \ + --exclude '*/System.map' --exclude '.*flags' \ + --exclude '*./TAGS' --exclude '*/.depend' \ + --exclude '#*#' \ + -f - $(TARDIR) \ + | bzip2 -9f \ + > ../$(TARNAME)-$$(date +%Y%m%d%H%M).tar.bz2 + +cvstar: + tar c -C $$CVSROOT \ + --exclude '*~' --exclude '*.bak' \ + --exclude '*.[aios]' --exclude '*.ci' --exclude '*.io' \ + --exclude '*/System.map' --exclude '.*flags' \ + --exclude '*./TAGS' --exclude '*/.depend' \ + --exclude '#*#' \ + -f - $(TARDIR) \ + | bzip2 -9f \ + > ../$(TARNAME)-$$(date +%Y%m%d%H%M).CVS.tar.bz2 + +# Flower Power :) + +love: + @echo "not war!" + +# Symbols +KVER=$(shell uname -r) +sysmap System.map: /boot/System.map-$(KVER) + patches/make_sysmap \ + /boot/System.map-$(KVER) /proc/ksyms \ + /lib/modules/$(KVER)/*/*.o \ + > System.map + +endif # !IN_LINUX_KERNEL diff -Naur linux.225/drivers/uusbd/Makefile.inc linux.225.visws/drivers/uusbd/Makefile.inc --- linux.225/drivers/uusbd/Makefile.inc Wed Dec 31 16:00:00 1969 +++ linux.225.visws/drivers/uusbd/Makefile.inc Sun Apr 4 18:04:26 1999 @@ -0,0 +1,67 @@ +# +# Universal USB Driver +# -------------------- +# +# Distributed under the terms of the GNU Public License Version 2 +# See files COPYRIGHT and COPYING at the root distribution directory +# +# PPC Stuff for iMac by Paul Mackerras +# +# Common make stuff for compiling stand-alone modules + +ifndef TOPDIR +export NOT_IN_LINUX_KERNEL := 1 +else +# Check this when recursive making ... +ifndef NOT_IN_LINUX_KERNEL +export IN_LINUX_KERNEL := 1 +endif +endif + + +ifdef NOT_IN_LINUX_KERNEL + +ifdef LINUXDIR +export TOPDIR := $(LINUXDIR) +else +export TOPDIR := /usr/src/linux +endif + +VERSION = $(shell $(CONFIG_SHELL) grep ^VERSION $(TOPDIR)/Makefile | sed -e 's/ //g' | cut -d'=' -f2) +PATCHLEVEL = $(shell $(CONFIG_SHELL) grep ^PATCHLEVEL $(TOPDIR)/Makefile | sed -e 's/ //g' | cut -d'=' -f2) +SUBLEVEL = $(shell $(CONFIG_SHELL) grep ^SUBLEVEL $(TOPDIR)/Makefile | sed -e 's/ //g' | cut -d'=' -f2) +EXTRAVERSION = $(shell $(CONFIG_SHELL) grep ^EXTRAVERSION $(TOPDIR)/Makefile | sed -e 's/ //g' | cut -d'=' -f2) + +export KERNEL_OPT = -D__KERNEL__ -I$(TOPDIR)/include +export KERNEL_OPT += -DEXPORT_SYMTAB -DMODULE -DMODVERSIONS -include $(TOPDIR)/include/linux/modversions.h +export WARNINGS = -Wall -Wstrict-prototypes +ifdef CONFIG_PPC +export COMPILE = -O2 -fomit-frame-pointer -D__powerpc__ -fsigned-char +export COMPILE += -msoft-float -pipe -fno-builtin -ffixed-r2 +export COMPILE += -mmultiple -mstring +else +export COMPILE = -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -m486 +export COMPILE += -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586 +endif +export LD = ld +export LD_RFLAG = -r +export LD_OPT = -r +export CFLAGS = $(KERNEL_OPT) $(WARNINGS) $(COMPILE) +# for genksyms to work +export CFLAGS += -I. +export HOSTCC = gcc +export HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer +export GENKSYMS=/sbin/genksyms +ifeq ($(TOPDIR)/.config,$(wildcard $(TOPDIR)/.config)) +include $(TOPDIR)/.config +endif + +endif # NOT_IN_LINUX_KERNEL + + +# USB Options +# ----------- + +export EXTRA_CFLAGS += -g -D__UUSBD__ #-DUSB_HWDB +export MODULES_FILE := $(TOPDIR)/drivers/uusbd/.modules-list + diff -Naur linux.225/drivers/uusbd/README linux.225.visws/drivers/uusbd/README --- linux.225/drivers/uusbd/README Wed Dec 31 16:00:00 1969 +++ linux.225.visws/drivers/uusbd/README Sun Apr 4 18:10:51 1999 @@ -0,0 +1,112 @@ + + Hi :) + + [PLEASE READ FULLY, OR AT LEAST UNTIL 5th PARAGRAPH :)] + + FOR INFO ON BUG REPORTING, SEE FILE `BUG-REPORTING' + + FOR INFO ON BUREOCRATIC STUFF, SEE FILE `COPYRIGHT' + + FOR INFO ON INSTALLING, SEE FILE `INSTALL' + + This is an snapshot of the work we are doing on Linux-USB. + + Note that this project has involved the creation of a new +whole subsystem, like SCSI. I don't know if as complicated, but it's +been for me :), a little kernel nerd. It may also be optimized in a +lot of places, but I'm mainly concerned to first make it +work. Optimization will come later. + + Currently there are drivers for UHCI and OHCI host controllers +(without isochronous support, but we'll code that soon). Mice works in +Boot Protocol mode; so do keyboards [need an special patch to have the +kernel using it]; we are working at the same time in drivers for HID, +audio, ISDN CAPI interface and the FDU (floppy) drivers. + + Also the hub driver is done, and tested to some extent; it +works :). + + Note that everything gives *bulks* of debug info. This is +intentionated; however, you may loose messages if you have all of them +activated. To solve this, you can increase the klog buffer length +[#define LOG_BUF_LEN ...] in linux/kernel/printk.c. I've set it up to +131072 [way too big, isn't it? :)]. Also, if you're using Debian, +chances are `emerg' messages are sent to everyone logged in. You may +want to turn this off, as function traces use the `emerg' level and it +would clutter your console/terminals [on /etc/syslog.conf comment out +`*.emerg *' and exec '/etc/init.d/sysklogd reload']. + + I must recognize I spend too much time documenting and making +things look somehow fancy, instead of 'wasting' that time coding. This +may sound as bad, but it's been what has made Linux-USB more compact, +as I've been always to track down what is each thing (believe it or +not, there are functions I wrote a month ago I'd won't know what do +they do if it weren't for the docs). + + I'm using 2.2.x to run this; 2.0.x won't work, nor I intend +to. + + Note that all the known craps are marked with a FIXME tag, and +all the things which should be taken in consideration with a NOTE +tag. Warnings, (you guessed!) marked with WARNING tags. Also at the +TODO file there's a list of things to do (that's the name for). There +are some more sticked to the wall behind my monitor. + + Also take into account that the code is getting fairly +complex. I come from C++ fanatism :), and that's what made me develop +the ideas on destructors and use counts for the linked lists. They +need a *lot* of hard-core debugging and stress testing (and +optimization in some places). Thus, take it easy when messing with +them. Also needs optimization the trillion checks done all around the +code as some will be unnecessary when assertions are disabled (this is +marked at the TODO file). + + IF YOU INTEND to understand the code, start at the kernel usb +driver daemon (kusbdd) at khubdd.c. It's an asynch kernel process +which does almost all the interesting stuff. It is started from +usb_init() at kernel-interface.c, which makes kusbdd start enumerating +by calling function usb_hub_host_enum() [which is at khubdd.c]. The +enumerating function finally calls (via pointers) the +[ou]hci_enumerate() functions at uusbd/[ou]hci. NOTE THAT, ANYHOW, YOU +NEED TO HAVE AT LEAST USB BASICS UNDERSTOOD. + + I also need feedback on the documentation. I'd like to have a +lot more of docs and not as disconnected as actual, but it's quite +difficult for me to keep everything on the bleeding edge. I try it, +anyway. Someday I should bundle all the docs in a big, boring document +:) + + Please, send me (or to the list) any ideas, suggestions, +patches, flames (> /dev/null :), and remember I'm a poor rookie kernel +coder! + + I'm trying to keep the code fairly architecture-independent, +(ok, there are some craps here and there, but I think they're all +marked as FIXME tags). If anybody would like to get this thing ported +to BSD/Mach/Hurd/"any FREE os" when it is done, I'd love it, but I +have no idea of those systems, and so I could only help to the guy +doing the porting. However, please send me any sugerences to keep the +code more or less OS independent (in fact, this is why I renamed the +package to uusbd, trying to mean Universal USB Driver). Always remind +the only license method will be GPL, at least for the code I own. + + The SCRATCH file is where my disconnected ideas finally sink, +as well as all the suggestions and stuff. It is a black board to write +everything down so it is not forgotten. Please, take a look at it, but +don't take everything serious :) + + BTW, the USBDI standard has shut off their doors to us (we +cannot pay to certify our intellectual openness ...). We stay tuned +for a sollution suitable for Free Software. + + Iñaky + + inaky@peloncho.fis.ucm.es + http://peloncho.fis.ucm.es/~inaky + http://peloncho.fis.ucm.es/~inaky/USB + +P.D.: the mailing list is at linux-usb@peloncho.fis.ucm.es, subscribe + with: + + $ echo subscribe linux-usb | mail majordomo@peloncho.fis.ucm.es + diff -Naur linux.225/drivers/uusbd/SCRATCH linux.225.visws/drivers/uusbd/SCRATCH --- linux.225/drivers/uusbd/SCRATCH Wed Dec 31 16:00:00 1969 +++ linux.225.visws/drivers/uusbd/SCRATCH Sat Feb 27 10:45:42 1999 @@ -0,0 +1,391 @@ + + + All the stuff in this file are ideas, scratches and things I +write down as a poor and anarchical TO-DO list ... somethings are +useful, some not, some are bad, some outdated ... anarchy in action! + + ---- + + When scheduling iso pipes on UHCI, add a table which maps the +expected frame count when it should be finishing, so is easier to keep +track of it. + + Also add BWR based on how many hi-speed ctl or bulk xfers are +queued. + + + ---- + + Remove dev_set(up|dn), as UHCI won't use and add +endp_set(up|dn), as OHCI will use. Add an 'ts_dtor* hci' field to +ts_usb_endp with a #if defined (CONFIG_USB_OHCI) || defined +(CONFIG_USB_OHCI_MODULE) so it won't be compiled in for UHCI +systems. + +typedef struct s_ohci_endp ts_ohci_endp; /* 16 byte aligned */ +struct s_ohci_endp +{ + ts_ohci_ed ed; /* must be first, 16 byte aligned */ + /* Info? Statistics ... */ +}; + + ---- + + Statistics + + So, I want to gather statistics. They make you look cool, +nice, good-looking and suits like them. However, first of all, they +waste resources, but they can also be useful to allow the software to +auto tune (ie: UHCI) or to help you doing it better. + + Per endpoint: + + - Transactions done (not packets sent, but whole +transactions). + + - Transacion Period (mean period in which a transaction is +executed [usb_tr_run()]) - [1/s]. + + - Byte Speed [bytes/second] + + - Errors + + - Error density [errors/bytes] + + We just have to store an initial timestamp each time we open +the endpoint, a transaction count and a byte count (cleared also when +opening). Counts may overflow, perhaps will have to add to the means +directly [guess how :)] + + These statistics should be taken from the transaction +statistics, and it should be a cooperative effort between HCD and +USBD. + + Device wide statistics should be these ones too, adding all +endpoint wide statistics. Perhaps they should be cleared when a +configuration is changed and reinitialized with endpoint 0 values +... think more about this. + + BTW, statistics could be optionally left out at compilation +time [if performance is an issue and statistics not]. However, some +functionality could be lost [like auto-tuning and the like]. + + ---- + + Scanning configuration descriptor blocks. + + First pass: + + We scan number the of real interfaces storing it in +cfg->bNumInterfaces or returning it [I prefer this one]. + + We also scan for each interface the number of alternate +settings and store it into iface->bAlternateSetting [as we know, by +USB 1.0 Spec 9.6.3, that first alternate setting is always number +zero, we can recover later from this modification]. + + There's no need for a second pass. The code which uses the +cooked interfaces must be aware of this and act in consequence. + + On storing the vendor/class specific info found on the +descriptor block, I'd bet for letting it up to the driver to search +for it. It can even use the [yet to be coded] persistence system to +keep track of where is it on identical devices, and thus save time +when locating it. + + ---- + + More on persistence (for loadable modules) + + The device is connected, a driver searched, driver loads, ok? +then it configure cfels [and the goodies should be that every +non-active cfel auto-unconfigures, so we have less resource +waste]. Then we have this module loaded who's configured some cfels, +attaching structures to them. But it is not used [it's use count is +zero], so it's candidate for unload. When it unloads, it could leave +the data structures plugged to the cfel structs. Then, if the user +uses it again [i.e., open(2)], it reloads and using a list of devices +and cfels provided by it's driver structure [which was kept on +memory], he can relocate the devices he had configured, ACTUALIZE THE +DESTRUCTOR FUNCTION POINTERS [very important! they may have changed +address] and use it, skeeping the reconfiguration process. + + When the device is to be unconfigured, the driver is reloaded, +it does all it's stuff and it'll be auto-unloaded again ... + + Even more, the linked list that each device should have +linking all it's structures linked to cfels data structures +[ts_usb_cfel->d_*] could be kept in the driver structure, so that no +other list has to be kept to configured elements to faslty access +them. + + This has an obvious disadvantage: the structures are kept +memory. It's ugly enough we have this big structs [device, cfgs, +ifaces, asets] and then we add, per driver, an struct, and a list of +other structs, perhaps one per device [suppossing the inactive cfels +ain't configured]; we have a very respectable amount of data structs +on memory. + + Ok, there're advantages too: FAST. Little bus transactions on +reload. + + ---- + + Another approach: the KGDBM, a generic persistence system in +the form of a completely independent module which implements the GNU +DBM interface in the kernel. + + It would consist of a GDBM compatible API in the kernel which +would redirect all requests to a user land daemon who would do the +hard work. Thus we have independent databases, etc ... available under +/var/lib/kgdbm/`uname -r`/. + + Would be nice to have it working also without user land +daemon, but it'd be quite too hard, so first try would require the +user land daemon. + + This should be completely modular, and not interfere the +kernel _for_ anything. The kgdbm_open() function should be able to +detect if the user-land daemon is not working and start it [as kmod +does with modprobe]. Similarly, the kgdbm_close() function should kill +the daemon if it is not being used by anybody else. + + I don't know how the fuck to do the interfacing with the +daemon. Will have to lurk around ... + + + Advantages: + + - We spend less memory, as we store short keys and data + + - It is reboot-proof, so we keep the data over reboots + + - Helps to keep track of topology changes + + + Disadvantages: + + - Slower + + - Races [database stored on a USB disk and module wants to + access the database to know the disk's data: deadlock]. + Sollution for this case could be use one or other sollution + [even mixed and controlled via proc/sysctl] based on the + device. For storage media, it'd be advisable to use previous + method. + + - Reentrancy problems on kernel. + + ---- + + + ---- + + From the comments to USBDI v0.7 3.3.1, on device +configuration. Complete it: + + The way I propose is: when a device is plugged into the USB + system, the matching driver(s) is(are) loaded and configure the + device. However, they must keep themselves in a zero-reference + count state, so they can be auto unloaded by the OS for not being + used. Note the device keeps in the same configured state. + + Later, when the device is going to be used [some program opens + it], the OS automagically loads the device driver again, which + knows [via a persistence system] which devices he was managing and + then may access them [also note it knows the device's state]. + + When a device is unplugged, all currently open + handles/descriptors to it are invalidated, and the unconfiguration + procedures for each involved driver called. This may cause again a + re-load of the driver if unloaded to make it update it's device + information. + + This way we guarantee minimal resource waste for modular + drivers, as well as direct support for hadly-linked in drivers. + + On Linux USB, I'm using a quite simple system for driver + registration. On system boot time [or whenever new drivers are + available], all usb drivers are loaded. They register within the + USBD system [and try to configure unconfigured matching devices] + and then go to zero-reference count state. Then Linux unloads them + if unused. Thus, the USBD always knows in a fast lookup list which + driver's are available to load. As a fallback method there's [not + yet finished] a generic module loading system. There's also a hooks + system which uses this logic to call functions/load modules when + any device is attached/detached to the bus. + + Note this interface is not yet completed. + + ---- + +Add: + +#MODULE_PARM(usb,"xxx"); +MODULE_AUTHOR(USB_AUTHOR/MAINTAINER); +MODULE_SUPPORTED_DEVICE("usb"); + + ---- + + Using the module persistency system, we could make the hosts +keep their address number, as well as devices keep their +configurations and alternate settings between module +load/unloads. Also device's could keep their 'virtual address' in the +UUSBD system (being the 'virtual address' a way to locate'em +independently of the host/hub where they're connected). + + ---- + + Got to make volatile all the fields on structs which are +modified by the [OU]HCI controllers + + ---- DEPRECATED/IMPLEMENTED + + The read/write functions interface + + Each time somebody tries to read from a USB device, it has got +to provide and ts_usb_open structure describing the endpoint to read +from (we'll consider the read operation from now), a buffer to read to +and a number of bytes to read. + + The sequence then is to allocate a kernel buffer to hold the +data read from the endpoint and start to schedule USB reads. As soon +as the read is complete, the read function should return. This seems +troublefree, but ... what'd happen if the user requests to read 1.6 +GB? Trouble, we can't allocate a kernel buffer of 1.6 GB (ok, we could +if we had the pysical memory, but it'd be quite an stupid sollution +with today's computers ... ). + + So the sollution should be to allocate an smaller buffer of a +predefined {sysctl,/proc}-tunable (on a per-device and endpoint +basis?) size -- multiple of the endpoint's transfer size and optimized +to consume as little kmemory as possible --. Thus, we'd schedule reads +to that buffer and when the buffer is full, copy it to the one +provided by the function. + + However this may imply latencies (when copying the buffer we +can't schedule more transfers) that aren't allowable for isochronous +and interrupt transfers (though interrupt transfers are less likely to +suffer this problem). So it should be made to copy the already +transfered data when a percentage of the buffer is full and after +schedule more transfers to that part of the buffer we've just copied +while the rest of the buffer is being filled. What's the correct +percentage of the buffer to trigger the copy? I guess it'll depend on +the time we take to schedule the new xfers and copy the data (in this +order). I'd vote to set it in the middle and allow it to be +tunable. Ahead on time I'll try to write an optimizing function (based +in something like increase the percentage until a timeout failure is +found, then lower it a bit ... some auto-adapting stuff). + + ---- + + Little endian GCC aligns structs & bitfields with first +element being the lowest significant. + +aka: struct { char x, y, z, k;} would yield the 32 bits integer + k << 24 + z << 16 + y << 8 + x + + ---- + + Endpoints should be shareable between two or more people +wishing to write/read. Quite something like the dup() syscall. + + ---- + + /* Sample IRQ handler */ + +static void lp_interrupt (int irq, void *dev_id, struct pt_regs *regs) +{ + struct lp_struct *lp = &lp_table[0]; + + while (irq != lp->irq) + if (++lp >= &lp_table[LP_NO]) + return; + + wake_up(&lp->lp_wait_q); +} + + + ---- + + How to (raw) read/write from a USB device (we suppose it's configured): + + We can only set the destination host && device once. When set, +if we want to write to another host/device, have to open another +descriptor. However, destination interfaces/endpoints may be set, as +they may coexist. + +fd = open ("/dev/usb1", O_RDONLY | O_WRONLY); this creates an struct at the kernel for keeping track of the + open file (problem: dup() really duplicates or reopens? fix + this). +ioctl (fd, USB_IOCTL_SET_IFACE, ts_usb_addr, t_usb_aset); Set an interface's alternate setting +ioctl (fd, USB_IOCTL_SET_DEST, ts_usb_addr); Set the address/iface/endpoint device we want to write to (reset dest + enpoint to 0; FIXME: really should?) Return error if + unexistant addr. +ioctl (fd, USB_IOCTL_SET_DEST, This could be kind of a "logical" way to open a device, + VendorId-ProductId-Cookie); hiding the topology of the bus(es) from the client +ioctl (fd, USB_IOCTL_SET_DEST, The same, but more abstract even, using classes. + ClassId-SubClassId-ProtocolID-Cookie); Should the Cookie be the same as the one for the VendorId-ProductId? +read/write (fd, buffer, size); Read/write to the addressed device, numbered endpoint with + the defined transfer method. Error if writing in interrupt + transfer type ... etc. On overrun, return -ENOSPC. +close (fd); + + --- + + +* IDEA: virtual mappings for persistence of bus/device topology + +* IDEA (Oren Tirosh): chroot of USB for consoles + +* IDEA (Oren Tirosh): use a daemon (usbd :) for detecting change of + state, do enumeration .. etc + +* TODO: Contact Thrustmaster again. Also applies for Fujitsu (the guy + at the HQ at Japan) an the ICL local representative here at Madrid. + The ICL local representative has said nay ... thanks, Fujitsu Spain :-P + +* TODO: OHCI should be implemented one of these days + + --- + + Virtual addresses. + +How to uniquely identify devices (and keep them with the same ID from +boot to boot): + + The background on this is quite simple; imagine the following scenario: +you've got four video cards, four work-station kits (composed of monitors +-which are compounded of a monitor and a pair of stereo speakers-, keyboards, +video camera and mice (all tied up to a single hub, and thus, you have each +work-station kit connected by a single USB line). You install everything, and +now, you move one of the kits three meters left, and it's a lot better to use +another hub located over there. How'd we tell the software that though they've +change locations, the device's are the same we meant to be, let's say, +/dev/monitor2, /dev/camera2, /dev/kbd2, /dev/mouse2, /dev/audio2? + + + Sollutions? Ideas? + + - Serial number in device descriptor (iSerialNumber) may be not +implemented (it is an string descriptor). It could be used for devices which DO +implement it + + - Analize (somehow) the structure from which the device is hanging. This +would be only ok for compounds. If the whole compound is the same, it's +ok. However, this loops back to the same problem, but with bigger devices :) + + - Store a kind of "virtual" or "logical" structure on disk and load it +on boot, such that it maps the actual physical topology to the constant one ... + + - Related to this, Oren Tirosh suggests that something could be +implemented for each process having something like it's own root hub (analog to +the root directory). + + - Using the vendor id/device id pair sounds cool. Then problem +now comes as soon as you got two identical devices connected. This is +the big problem. Also using class/subclass/protocol. Grrr. + + - Would be cool to use the persistent stuff of the new +modutils. Could be useful for this. + diff -Naur linux.225/drivers/uusbd/THANKS linux.225.visws/drivers/uusbd/THANKS --- linux.225/drivers/uusbd/THANKS Wed Dec 31 16:00:00 1969 +++ linux.225.visws/drivers/uusbd/THANKS Wed Dec 30 10:43:37 1998 @@ -0,0 +1,144 @@ + + The following corporations have helped us in the development +of Linux USB / UUSBD: + + - USAR Systems provided us with one of their excellent USB + Evaluation Kits. It allows us to test the Linux-USB driver + for compilance with the latest USB specification. USAR + Systems recognized the importance of an up-to-date open + Operating System and supports this project with + Hardware. Thanks!. + + - Thanks to Intel Corporation for their precious help. + + - We teamed up with Cherry to make Linux the first OS with + built-in USB support. Cherry is one of the biggest keyboard + makers in the world. + + - CMD Technology, Inc. sponsored us kindly donating a CSA-6700 + PCI-to-USB Controller Board to test the OHCI implementation. + + - Due to their support to us, Keytronic can be sure that they + will sell keyboards to some of the 3 million (at least) + Linux users. + + - Many thanks to ing büro h doran [http://www.ibhdoran.com]! + It was almost imposible to get a PC backplate USB connector + for the motherboard here at Europe (mine, home-made, was + quite lowsy :). Now I know where to adquire nice USB stuff! + + - Genius Germany donated a USB mouse to test the mouse boot + protocol. They've also donated a F-23 digital joystick and a + NetMouse Pro. Thanks! + + - AVM GmbH Berlin is supporting the development of the Linux + USB driver for the AVM ISDN Controller B1 USB. AVM is a + leading manufacturer for active and passive ISDN Controllers + and CAPI 2.0-based software. The active design of the AVM B1 + is open for all OS platforms, including Linux. + + - Thanks to Y-E Data, Inc. for donating their FlashBuster-U + USB Floppy Disk Drive, so we could test the bulk transfer + code. + + - Many thanks to Logitech for contributing a three axis USB + mouse. + + Logitech designs, manufactures and markets + Human Interface Devices, having a long history and + experience in making devices such as keyboards, mice, + trackballs, cameras, loudspeakers and control devices for + gaming and professional use. + + Being a recognized vendor and seller for all these devices, + they have donated USB mice, a joystick and a scanner, as a + way to acknowledge the importance of Linux and to allow + Logitech customers to enjoy support in their favorite + operating systems and all Linux users to use Logitech and + other USB hardware. + + Logitech is official sponsor of the Linux Conference on + Feb. 11th 1999 in Vienna, where we'll will present the + current state of the Linux USB effort. + + - CATC has provided means to uncover dark corners of the UHCI + inner workings with a USB Inspector. + + - Thanks to Entrega for providing PCI to USB cards, hubs and + converter products for development. + + + And thanks go to (hey! in no particular order :) + + - Oren Tirosh , for standing so patiently + all my doubts'bout USB and giving lots of cool ideas. + + - Jochen Karrer , for + pointing out mortal bugs and giving advice. + + - Edmund Humemberger , for it's great work on + public relationships and general management stuff for the + Linux-USB effort. + + - Alberto Menegazzi is starting the + documentation for the UUSBD. Go for it! + + - Ric Klaren for doing nice + introductory documents (compiting with Alberto's :). + + - Christian Groessler , for it's help on those + itchy bits ... :) + + - Paul MacKerras for polishing OHCI and pushing me harder for + the iMac support, giving improvements and enhancements. + + - Fernando Herrera has taken + charge of composing, maintaining and feeding the + long-awaited, unique and marvelous UUSBD FAQ! Tadaaaa!!! + + - All the Free Software and Linux community, the FSF & the GNU + project, the MIT X consortium, the TeX people ... everyone! + You know who you are! + + - Big thanks to Richard Stallman for creating Emacs! + + - The people at the linux-usb mailing list, for reading so + many messages :) Ok, no more kidding; for all your advices! + + - All the people at the USB Implementors Forum for their + help and assistance. + + - Nathan Myers , for his advice! (hope you + liked Cibeles' party). + + - Linus Torvalds, for starting, developing and managing Linux. + + - Mike Smith, Craig Keithley, Thierry Giron and Janet Schank + for convincing me USB Standard hubs are not that standard + and that's good to allow for vendor specific quirks on the + standard hub driver. + + I should invite all of you to have some beers (or whatever), +so if sometime you come around Madrid and I've money, gimme a call and +I'll invite you :) + + + Special thanks & hellos go to my cool friends: + + María (lot's of kisses 2 U), Mon (no puidorl), Mon, Las Jakas, +Potxokin, Noemi, l'Amico, Alberto, Alfonso, Eviki, Edu (¡qué fea +era!), El Primo, la penya de Benicàssim (salut y força al canut!), +Mayche (com estem, xiqueta?), the people at AFU and CDEP/CCFF, Josete, +la parejita felís, Teknoland, Kernel Panic, Enrique Melero & Santiago +Vila ... bfff, lot's, could fill megabytes with a name list +... they're too many! Don't feel missed if you ain't here :) and you +think you should, just tell me [whep!]. + + Yeah, my family too ... + + Thousand kisses to Gretchen Garmendia, wherever you are. + + + + The War isn't over ... many battles to go yet + diff -Naur linux.225/drivers/uusbd/TODO linux.225.visws/drivers/uusbd/TODO --- linux.225/drivers/uusbd/TODO Wed Dec 31 16:00:00 1969 +++ linux.225.visws/drivers/uusbd/TODO Sat Feb 20 14:54:10 1999 @@ -0,0 +1,544 @@ + +Legend: - [->] + + * To do + + Almost done + ! Gotta check it + - Done + YYYYMMDDHHMM + + +- ------------ ------------ --------- +* 199902201818 - Alpha rocks ... and cracks + UUSBD/OHCI. See message by Christian + Groessler and fix as much as possible. + +* 199901242026 - After setting SOF, make sure it's ok, by + reading back _from_the_host_ it's value + and comparing it. + +* 199901031957 - Make HCIs register for APM events and + send a global suspend on bus when a +