Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / obp / obp / dev / usb2 / pkt-data.fth
CommitLineData
920dae64
AT
1\ ========== Copyright Header Begin ==========================================
2\
3\ Hypervisor Software File: pkt-data.fth
4\
5\ Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
6\
7\ - Do no alter or remove copyright notices
8\
9\ - Redistribution and use of this software in source and binary forms, with
10\ or without modification, are permitted provided that the following
11\ conditions are met:
12\
13\ - Redistribution of source code must retain the above copyright notice,
14\ this list of conditions and the following disclaimer.
15\
16\ - Redistribution in binary form must reproduce the above copyright notice,
17\ this list of conditions and the following disclaimer in the
18\ documentation and/or other materials provided with the distribution.
19\
20\ Neither the name of Sun Microsystems, Inc. or the names of contributors
21\ may be used to endorse or promote products derived from this software
22\ without specific prior written permission.
23\
24\ This software is provided "AS IS," without a warranty of any kind.
25\ ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
26\ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
27\ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
28\ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
29\ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
30\ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
31\ OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
32\ FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
33\ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
34\ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
35\ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
36\
37\ You acknowledge that this software is not designed, licensed or
38\ intended for use in the design, construction, operation or maintenance of
39\ any nuclear facility.
40\
41\ ========== Copyright Header End ============================================
42id: @(#)pkt-data.fth 1.1 07/01/24
43purpose: USB Data Packet Definitions
44\ See license at end of file
45
46hex
47headers
48
49d# 128 constant #max-dev
50d# 16 constant #max-endpoint
51
520 constant speed-full
531 constant speed-low
542 constant speed-high
55
56 8 constant /pipe0
571.0000 constant /cfg
58 100 constant /str
59
60\ Structure of devices requests as defined in USB spec.
61struct ( standard device requests )
621 field >dr-rtype \ bmRequestType
631 field >dr-request \ bRequest
642 field >dr-value \ wValue
652 field >dr-index \ wIndex
662 field >dr-len \ wLength
67 \ Data
68constant /dr
69
70\ >dr-type constants
7100 constant DR_OUT
7280 constant DR_IN
7300 constant DR_STANDARD
7420 constant DR_CLASS
7540 constant DR_VENDOR
7600 constant DR_DEVICE
7701 constant DR_INTERFACE
7802 constant DR_ENDPOINT
7903 constant DR_OTHERS
80DR_CLASS DR_DEVICE or constant DR_HUB
81DR_CLASS DR_OTHERS or constant DR_PORT
82DR_CLASS DR_INTERFACE or constant DR_HIDD
83
84\ >dr-request constants
8501 constant CLEAR_FEATURE
8608 constant GET_CONFIGURATION
8706 constant GET_DESCRIPTOR
880a constant GET_INTERFACE
8902 constant GET_STATE
9000 constant GET_STATUS
9105 constant SET_ADDRESS
9209 constant SET_CONFIGURATION
9307 constant SET_DESCRIPTOR
9403 constant SET_FEATURE
950b constant SET_INTERFACE
960c constant SYNCH_FRAME
97
98\ >dr-value (upper byte) for get-/set-descriptor constants
99\ lower-byte is descriptor index
10001 constant DEVICE
10102 constant CONFIGURATION
10203 constant STRING
10304 constant INTERFACE
10405 constant ENDPOINT
10529 constant HUB
106
107\ Hub Class Feature Selectors (dr-value)
10800 constant C_HUB_LOCAL_POWER
10901 constant C_HUB_OVER_CURRENT
11000 constant PORT_CONNECTION
11101 constant PORT_ENABLE
11202 constant PORT_SUSPEND
11303 constant PORT_OVER_CURRENT
11404 constant PORT_RESET
11508 constant PORT_POWER
11609 constant PORT_LOW_SPEED
11710 constant C_PORT_CONNECTION
11811 constant C_PORT_ENABLE
11912 constant C_PORT_SUSPEND
12013 constant C_PORT_OVER_CURRENT
12114 constant C_PORT_RESET
122
123\ Use tmp-l to make sure that le-l! and le-w! are atomic writes
124
125instance variable tmp-l
126: le-w@ ( a -- w ) dup c@ swap ca1+ c@ bwjoin ;
127: (le-w!) ( w a -- ) >r wbsplit r@ ca1+ c! r> c! ;
128: le-w! ( w a -- ) swap tmp-l (le-w!) tmp-l w@ swap w! ;
129
130: le-l@ ( a -- l ) >r r@ c@ r@ 1+ c@ r@ 2+ c@ r> 3 + c@ bljoin ;
131: (le-l!) ( l a -- ) >r lbsplit r@ 3 + c! r@ 2+ c! r@ 1+ c! r> c! ;
132: le-l! ( l a -- ) swap tmp-l (le-l!) tmp-l l@ swap l! ;
133
134
135headers
136
137\ LICENSE_BEGIN
138\ Copyright (c) 2006 FirmWorks
139\
140\ Permission is hereby granted, free of charge, to any person obtaining
141\ a copy of this software and associated documentation files (the
142\ "Software"), to deal in the Software without restriction, including
143\ without limitation the rights to use, copy, modify, merge, publish,
144\ distribute, sublicense, and/or sell copies of the Software, and to
145\ permit persons to whom the Software is furnished to do so, subject to
146\ the following conditions:
147\
148\ The above copyright notice and this permission notice shall be
149\ included in all copies or substantial portions of the Software.
150\
151\ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
152\ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
153\ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
154\ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
155\ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
156\ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
157\ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
158\
159\ LICENSE_END