Commit | Line | Data |
---|---|---|
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 ============================================ | |
42 | id: @(#)pkt-data.fth 1.1 07/01/24 | |
43 | purpose: USB Data Packet Definitions | |
44 | \ See license at end of file | |
45 | ||
46 | hex | |
47 | headers | |
48 | ||
49 | d# 128 constant #max-dev | |
50 | d# 16 constant #max-endpoint | |
51 | ||
52 | 0 constant speed-full | |
53 | 1 constant speed-low | |
54 | 2 constant speed-high | |
55 | ||
56 | 8 constant /pipe0 | |
57 | 1.0000 constant /cfg | |
58 | 100 constant /str | |
59 | ||
60 | \ Structure of devices requests as defined in USB spec. | |
61 | struct ( standard device requests ) | |
62 | 1 field >dr-rtype \ bmRequestType | |
63 | 1 field >dr-request \ bRequest | |
64 | 2 field >dr-value \ wValue | |
65 | 2 field >dr-index \ wIndex | |
66 | 2 field >dr-len \ wLength | |
67 | \ Data | |
68 | constant /dr | |
69 | ||
70 | \ >dr-type constants | |
71 | 00 constant DR_OUT | |
72 | 80 constant DR_IN | |
73 | 00 constant DR_STANDARD | |
74 | 20 constant DR_CLASS | |
75 | 40 constant DR_VENDOR | |
76 | 00 constant DR_DEVICE | |
77 | 01 constant DR_INTERFACE | |
78 | 02 constant DR_ENDPOINT | |
79 | 03 constant DR_OTHERS | |
80 | DR_CLASS DR_DEVICE or constant DR_HUB | |
81 | DR_CLASS DR_OTHERS or constant DR_PORT | |
82 | DR_CLASS DR_INTERFACE or constant DR_HIDD | |
83 | ||
84 | \ >dr-request constants | |
85 | 01 constant CLEAR_FEATURE | |
86 | 08 constant GET_CONFIGURATION | |
87 | 06 constant GET_DESCRIPTOR | |
88 | 0a constant GET_INTERFACE | |
89 | 02 constant GET_STATE | |
90 | 00 constant GET_STATUS | |
91 | 05 constant SET_ADDRESS | |
92 | 09 constant SET_CONFIGURATION | |
93 | 07 constant SET_DESCRIPTOR | |
94 | 03 constant SET_FEATURE | |
95 | 0b constant SET_INTERFACE | |
96 | 0c constant SYNCH_FRAME | |
97 | ||
98 | \ >dr-value (upper byte) for get-/set-descriptor constants | |
99 | \ lower-byte is descriptor index | |
100 | 01 constant DEVICE | |
101 | 02 constant CONFIGURATION | |
102 | 03 constant STRING | |
103 | 04 constant INTERFACE | |
104 | 05 constant ENDPOINT | |
105 | 29 constant HUB | |
106 | ||
107 | \ Hub Class Feature Selectors (dr-value) | |
108 | 00 constant C_HUB_LOCAL_POWER | |
109 | 01 constant C_HUB_OVER_CURRENT | |
110 | 00 constant PORT_CONNECTION | |
111 | 01 constant PORT_ENABLE | |
112 | 02 constant PORT_SUSPEND | |
113 | 03 constant PORT_OVER_CURRENT | |
114 | 04 constant PORT_RESET | |
115 | 08 constant PORT_POWER | |
116 | 09 constant PORT_LOW_SPEED | |
117 | 10 constant C_PORT_CONNECTION | |
118 | 11 constant C_PORT_ENABLE | |
119 | 12 constant C_PORT_SUSPEND | |
120 | 13 constant C_PORT_OVER_CURRENT | |
121 | 14 constant C_PORT_RESET | |
122 | ||
123 | \ Use tmp-l to make sure that le-l! and le-w! are atomic writes | |
124 | ||
125 | instance 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 | ||
135 | headers | |
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 |