\ ========== Copyright Header Begin ==========================================
\ Hypervisor Software File: usbdefs.fth
\ Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
\ - Do no alter or remove copyright notices
\ - Redistribution and use of this software in source and binary forms, with
\ or without modification, are permitted provided that the following
\ - Redistribution of source code must retain the above copyright notice,
\ this list of conditions and the following disclaimer.
\ - Redistribution in binary form must reproduce the above copyright notice,
\ this list of conditions and the following disclaimer in the
\ documentation and/or other materials provided with the distribution.
\ Neither the name of Sun Microsystems, Inc. or the names of contributors
\ may be used to endorse or promote products derived from this software
\ without specific prior written permission.
\ This software is provided "AS IS," without a warranty of any kind.
\ ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
\ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
\ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
\ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
\ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
\ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
\ OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
\ FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
\ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
\ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
\ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
\ You acknowledge that this software is not designed, licensed or
\ intended for use in the design, construction, operation or maintenance of
\ ========== Copyright Header End ============================================
\ id: @(#)usbdefs.fth 1.9 00/06/01
\ copyright: Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved
\ This file holds usb-specific definitions.
\ headers \ XXX for debugging
\ debug stuff from here - take out later
\ ************************************
\ ************************************
\ debug stuff to here - take out later
\ 3 constant GET-PROTOCOL
\ 4 - 8 are reserved, according to the USB HID doc
\ b constant SET-PROTOCOL
\ 0 constant BootProtocol
\ 1 constant ReportProtocol
\ 21 constant HID-Descriptor-Type
\ 22 constant REPORT-Descriptor-Type
\ 23 constant PHYSICAL-Descriptor-Type
\ 81 constant ReqType-HID-Cl-Descr
\ 6 constant GET-DESCRIPTOR
\ 1 constant GET-CLASS-DESCR
defer turn-me-off ' noop is turn-me-off
defer toggle-mon ' noop is toggle-mon
0 instance value unstall-cnt
instance variable our-ha-token
0 instance value set-prtcl-buff^v
0 instance value get-descr-buff^v
0 instance value hid-descr-buff^v
0 instance value std-pkt-buff^v
\ The following struct is designed to keep track of the down keys - up to
\ 6 per report, plus related information. The code is not currently
\ doing anything with the modifier byte or the reserved byte, but
\ including those makes it very convenient because the key# information
\ coming back from the USB report fits directly into the struct format.
\ The #keys-down and #regl-keys-dn bytes are not filled in by the USB
\ boot report but instead are calculated sometime after receiving the
\ Note: fields >kbd-in-byte7, >kbd-in-byte8, and >kbd-in-byte9 are used
\ to potentially hold the shift, cntrl and altgraph, which are
\ actually reported as status bits in the >kbd-in-modkeys byte.
1 field >kbd-in-modkeys \ bmRequestType
1 field >kbd-in-reserved \ bmRequestType
1 field >kbd-in-byte1 \ bmRequestType
1 field >kbd-in-byte2 \ bmRequestType
1 field >kbd-in-byte3 \ bmRequestType
1 field >kbd-in-byte4 \ bmRequestType
1 field >kbd-in-byte5 \ bmRequestType
1 field >kbd-in-byte6 \ bmRequestType
1 field >kbd-in-byte7 \ bmRequestType
1 field >kbd-in-byte8 \ bmRequestType
1 field >kbd-in-byte9 \ bmRequestType
1 field >#regl-keys-dn \ Can determine #spcl keys dn by subtracting
\ #regl-keys-dn from #keys-down.
0 instance value keybuff-curr^v
/key-info-buff buffer: keybuff-prev
0 value curr-byte1-bfaddr
0 value curr-#ksdn-bfaddr
0 value prev-byte1-bfaddr
\ These offsets are used frequently enough to have global variables
\ that hold the offset to the indicated locations in the key buffers.
\ Various keyboard flags;
-1 instance value shiftflag \ True if the shift key is down
-1 instance value ctrlflag \ True if the ctrl key is down
-1 instance value altgflag \ True if the alt graph key is down
-1 instance value powerflag \ True if the power key is down
-1 instance value monflag \ True if the monitor key is down
-1 instance value stopflag \ True if the stop (L1) key is down
\ Following indicate special flags for "previous" report;
-1 instance value pr-shiftflag \ True if the shift key is down
-1 instance value pr-ctrlflag \ True if the ctrl key is down
-1 instance value pr-altgflag \ True if the alt graph key is down
-1 instance value pr-powerflag \ True if the power key is down
-1 instance value pr-monflag \ True if the monitor key is down
-1 instance value pr-stopflag \ True if the stop (L1) key is down
0 instance value key-repeat-time \ Time of next repeat
\ 0 instance value key-click
nokey instance value curr-repeat-key
\ curr-repeat-key will hold the converted keyvalue which represents
\ the currently repeating key.
\ Following will be set if several special keys have been entered
\ but the control key was given the highest priority. Without this
\ flag we end up applying the control offset if the control key is
\ down - even if shift (a higher priority key) is down.
0 instance value ctrl-in-effect