1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22/*
23 * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#pragma ident	"%Z%%M%	%I%	%E% SMI"
28
29
30
31
32                  Hidparser: Solaris implementation
33		  _________________________________
34
35
36Report descriptors  are  basically  made of  items.   Items  can  be  'Main'
37items,  'Local' Items  and  'Global' Items. Local and  Global items  differ
38in their  scope. Local  items  hold their value only   within the main item
39in which  they are  defined  while global items retain their values through
40out all main items  unless *redefined*.
41
42Main Items  are  collection,  input, output and  feature and end collection
43items. Each  of  the  main  items are represented by an 'entity_item' struc-
44ture.  Solaris    maintains   global and  local items  as a  linked list of
45entity_attribute   structures  in the 'entity_item' structure.  Since local
46items are specific  to a main  item it   makes  sense to  keep  local items
47with in the main item.  List   of   global  items can't be kept as a single
48global list because they  can   get redefined in any  subsequent main  item
49and Solaris won't be able  to   know what  will  be the value for each main
50item. Hence they also  figure   in the list  maintained  by the entity_item
51structure.
52
53So how do we construct the tree ?
54
55Each main item forms a sibling or child of another main item except for the
56root  main  item which will  always be a Collection main item. Each collect-
57ion item  should be closed  by  an end  collection.  So  root  collection's
58sibling  will be an end  collection. Whatever  input,  output  and  feature
59items  which fall inside  a collection (please  see a collection as '{' and
60end  collection as '}' in  'C' language) will  form a child  of  the parent
61collection  with each of  them  forming  a sibling  of  each  other. i.e if
62an Input  main item comes  first within a  collection  then  it'll form the
63child of  the collection  with the subsequent  main  items  being linked as
64siblings  of each other.  When we reach an end collection, it must form the
65sibling of  the collection.  This applies for nested collections  also. i.e
66if a  collection falls within  another collection, it'll form  a  child  of
67the  parent collection with  the 'input','output' and 'feature' main  items
68falling within  the child collection forming a child  of child  collection.
69Whatever falls  outside the child collection,but inside a parent collection
70will form a sibling of the child collection.
71
72When  hidparser starts, it'll get the raw  descriptor in a structure called
73'hidparser_tok'  structure. Solaris  will  proceed by taking one byte first
74(which sort of forms a header and  indicates  how many  to  follow for each
75item for the 'item data') and then proceeds to take the  value for the item
76(which is the item data). This  'hidparser_tok'  structure  contains a list
77of global and local items. As  and when the parser encounters a global item
78it'll add it to the global item list. The same applies for local items also.
79The only difference is that if  a global item is getting redefined (i.e the
80global item is already present  in the gitem list),  then "the global item"
81(i.e one of the global item) is freed and the new one is put instead. Local
82items can get redefined without  disturbing the earlier  values.  This goes
83on till a main item is encountered. When a  main  item  is encountered  the
84global item list  is copied over to the entity_item structure and the local
85item list will start  where  the global item  list  stops ( in the 'entity_
86attribute' list). Before we start on the next item the local item list will
87be freed (in the hidparser_tok  structure) but the global item list will be
88maintained since their scope is through out the report descriptor.
89
90The two additions which has happened  in this  round  of  changes  are  the
91support for push|pop and delimiter items. 'push' basically asks the  parser
92to copy over the list of  global  items, while  'pop' takes the last pushed
93list as the current one. The entity_attribute_stack forms a stack of global
94item list pointers from which they can be pop-ed on the gitem list.'delimit-
95er'items basically allows you to interpret the data that is  being received
96differently depending on the way you use it and requires the parser to reco-
97gnize only the first 'usage' (which is what Solaris does with my changes).
98
99
100___________________________________________________________________________
101
102Example:
103
104
105Following is the report descriptor dump for Labtec Spaceball (you can  call
106it a mouse).
107
108hid1:   Index = 0       value =0x5
109hid1:   Index = 1       value =0x1
110hid1:   Index = 2       value =0x9
111hid1:   Index = 3       value =0x8
112hid1:   Index = 4       value =0xa1
113hid1:   Index = 5       value =0x1
114hid1:   Index = 6       value =0xa1
115hid1:   Index = 7       value =0x0
116hid1:   Index = 8       value =0x85
117hid1:   Index = 9       value =0x1
118hid1:   Index = 10      value =0x16
119hid1:   Index = 11      value =0x0
120hid1:   Index = 12      value =0x80
121hid1:   Index = 13      value =0x26
122hid1:   Index = 14      value =0xff
123hid1:   Index = 15      value =0x7f
124hid1:   Index = 16      value =0x9
125hid1:   Index = 17      value =0x30
126hid1:   Index = 18      value =0x9
127hid1:   Index = 19      value =0x31
128hid1:   Index = 20      value =0x9
129hid1:   Index = 21      value =0x32
130hid1:   Index = 22      value =0x75
131hid1:   Index = 23      value =0x10
132hid1:   Index = 24      value =0x95
133hid1:   Index = 25      value =0x3
134hid1:   Index = 26      value =0x81
135hid1:   Index = 27      value =0x2
136hid1:   Index = 28      value =0xc0
137hid1:   Index = 29      value =0xa1
138hid1:   Index = 30      value =0x0
139hid1:   Index = 31      value =0x85
140hid1:   Index = 32      value =0x2
141hid1:   Index = 33      value =0x9
142hid1:   Index = 34      value =0x33
143hid1:   Index = 35      value =0x9
144hid1:   Index = 36      value =0x34
145hid1:   Index = 37      value =0x9
146hid1:   Index = 38      value =0x35
147hid1:   Index = 39      value =0x75
148hid1:   Index = 40      value =0x10
149hid1:   Index = 41      value =0x95
150hid1:   Index = 42      value =0x3
151hid1:   Index = 43      value =0x81
152hid1:   Index = 44      value =0x2
153hid1:   Index = 45      value =0xc0
154hid1:   Index = 46      value =0xa1
155hid1:   Index = 47      value =0x2
156hid1:   Index = 48      value =0x85
157hid1:   Index = 49      value =0x3
158hid1:   Index = 50      value =0x5
159hid1:   Index = 51      value =0x1
160hid1:   Index = 52      value =0x9
161hid1:   Index = 53      value =0x3a
162hid1:   Index = 54      value =0x75
163hid1:   Index = 55      value =0x10
164hid1:   Index = 56      value =0x95
165hid1:   Index = 57      value =0x1
166hid1:   Index = 58      value =0x81
167hid1:   Index = 59      value =0x2
168hid1:   Index = 60      value =0x5
169hid1:   Index = 61      value =0x9
170hid1:   Index = 62      value =0x19
171hid1:   Index = 63      value =0x1
172hid1:   Index = 64      value =0x29
173hid1:   Index = 65      value =0xd
174hid1:   Index = 66      value =0x15
175hid1:   Index = 67      value =0x0
176hid1:   Index = 68      value =0x25
177hid1:   Index = 69      value =0x1
178hid1:   Index = 70      value =0x35
179hid1:   Index = 71      value =0x0
180hid1:   Index = 72      value =0x45
181hid1:   Index = 73      value =0x1
182hid1:   Index = 74      value =0x75
183hid1:   Index = 75      value =0x1
184hid1:   Index = 76      value =0x95
185hid1:   Index = 77      value =0xd
186hid1:   Index = 78      value =0x81
187hid1:   Index = 79      value =0x2
188hid1:   Index = 80      value =0x95
189hid1:   Index = 81      value =0x3
190hid1:   Index = 82      value =0x81
191hid1:   Index = 83      value =0x1
192hid1:   Index = 84      value =0xc0
193hid1:   Index = 85      value =0x5
194hid1:   Index = 86      value =0x1
195hid1:   Index = 87      value =0x9
196hid1:   Index = 88      value =0x3a
197hid1:   Index = 89      value =0xa1
198hid1:   Index = 90      value =0x2
199hid1:   Index = 91      value =0x15
200hid1:   Index = 92      value =0x80
201hid1:   Index = 93      value =0x25
202hid1:   Index = 94      value =0x7f
203hid1:   Index = 95      value =0x75
204hid1:   Index = 96      value =0x8
205hid1:   Index = 97      value =0x9
206hid1:   Index = 98      value =0x3a
207hid1:   Index = 99      value =0xa1
208hid1:   Index = 100     value =0x2
209hid1:   Index = 101     value =0x85
210hid1:   Index = 102     value =0x4
211hid1:   Index = 103     value =0x9
212hid1:   Index = 104     value =0x3a
213hid1:   Index = 105     value =0x95
214hid1:   Index = 106     value =0x4
215hid1:   Index = 107     value =0xb1
216hid1:   Index = 108     value =0x2
217hid1:   Index = 109     value =0xc0
218hid1:   Index = 110     value =0xa1
219hid1:   Index = 111     value =0x2
220hid1:   Index = 112     value =0x85
221hid1:   Index = 113     value =0x5
222hid1:   Index = 114     value =0x9
223hid1:   Index = 115     value =0x3a
224hid1:   Index = 116     value =0x95
225hid1:   Index = 117     value =0x1
226hid1:   Index = 118     value =0xb1
227hid1:   Index = 119     value =0x2
228hid1:   Index = 120     value =0xc0
229hid1:   Index = 121     value =0xa1
230hid1:   Index = 122     value =0x2
231hid1:   Index = 123     value =0x85
232hid1:   Index = 124     value =0x6
233hid1:   Index = 125     value =0x9
234hid1:   Index = 126     value =0x3a
235hid1:   Index = 127     value =0x95
236hid1:   Index = 128     value =0x1
237hid1:   Index = 129     value =0xb1
238hid1:   Index = 130     value =0x2
239hid1:   Index = 131     value =0xc0
240hid1:   Index = 132     value =0xa1
241hid1:   Index = 133     value =0x2
242hid1:   Index = 134     value =0x85
243hid1:   Index = 135     value =0x7
244hid1:   Index = 136     value =0x9
245hid1:   Index = 137     value =0x3a
246hid1:   Index = 138     value =0x95
247hid1:   Index = 139     value =0x10
248hid1:   Index = 140     value =0xb1
249hid1:   Index = 141     value =0x2
250hid1:   Index = 142     value =0xc0
251hid1:   Index = 143     value =0xa1
252hid1:   Index = 144     value =0x2
253hid1:   Index = 145     value =0x85
254hid1:   Index = 146     value =0x8
255hid1:   Index = 147     value =0x9
256hid1:   Index = 148     value =0x3a
257hid1:   Index = 149     value =0x95
258hid1:   Index = 150     value =0x10
259hid1:   Index = 151     value =0xb1
260hid1:   Index = 152     value =0x2
261hid1:   Index = 153     value =0xc0
262hid1:   Index = 154     value =0xa1
263hid1:   Index = 155     value =0x2
264hid1:   Index = 156     value =0x85
265hid1:   Index = 157     value =0x9
266hid1:   Index = 158     value =0x9
267hid1:   Index = 159     value =0x3a
268hid1:   Index = 160     value =0x95
269hid1:   Index = 161     value =0xc
270hid1:   Index = 162     value =0xb1
271hid1:   Index = 163     value =0x2
272hid1:   Index = 164     value =0xc0
273hid1:   Index = 165     value =0xa1
274hid1:   Index = 166     value =0x2
275hid1:   Index = 167     value =0x85
276hid1:   Index = 168     value =0xa
277hid1:   Index = 169     value =0x9
278hid1:   Index = 170     value =0x3a
279hid1:   Index = 171     value =0x95
280hid1:   Index = 172     value =0x1
281hid1:   Index = 173     value =0xb1
282hid1:   Index = 174     value =0x2
283hid1:   Index = 175     value =0xc0
284hid1:   Index = 176     value =0xa1
285hid1:   Index = 177     value =0x2
286hid1:   Index = 178     value =0x85
287hid1:   Index = 179     value =0xb
288hid1:   Index = 180     value =0x9
289hid1:   Index = 181     value =0x3a
290hid1:   Index = 182     value =0x95
291hid1:   Index = 183     value =0x1
292hid1:   Index = 184     value =0xb1
293hid1:   Index = 185     value =0x2
294hid1:   Index = 186     value =0xc0
295hid1:   Index = 187     value =0xa1
296hid1:   Index = 188     value =0x2
297hid1:   Index = 189     value =0x85
298hid1:   Index = 190     value =0xc
299hid1:   Index = 191     value =0x9
300hid1:   Index = 192     value =0x3a
301hid1:   Index = 193     value =0x95
302hid1:   Index = 194     value =0x1
303hid1:   Index = 195     value =0xb1
304hid1:   Index = 196     value =0x2
305hid1:   Index = 197     value =0xc0
306hid1:   Index = 198     value =0xa1
307hid1:   Index = 199     value =0x2
308hid1:   Index = 200     value =0x85
309hid1:   Index = 201     value =0xd
310hid1:   Index = 202     value =0x9
311hid1:   Index = 203     value =0x3a
312hid1:   Index = 204     value =0x95
313hid1:   Index = 205     value =0x2
314hid1:   Index = 206     value =0xb1
315hid1:   Index = 207     value =0x2
316hid1:   Index = 208     value =0xc0
317hid1:   Index = 209     value =0xc0
318hid1:   Index = 210     value =0xc0
319
320___________________________________________________________________________
321
322Item format:
323
324	------------------------------------
325	|data|data(8)|tag(4),type(2),size(2)|
326	------------------------------------
327                            |<------'ch'---------->|
328
329___________________________________________________________________________
330
331'hidparser_ReportDescriptor()' will call  'hidparser_scan()'  first.  Hence
332you will see the  'scanner'  output first.  The scanner will go through the
333first byte and set hidparser_tok_token to the tag|type value. hidparser_tok
334_leng  will be set to size and the 'data' part will be copied to tok_ text.
335'hidparser_ReportDescriptor'  will   call  'hidparser_ItemList()'  to  take
336charge of the rest of the parsing.
337
338___________________________________________________________________________
339
340hidparser:      scanner: index  = 0x0 ch = 0x5 [ = 0x00000101 = tag[0],
341                                               type[1], size[1] ]
342
343hidparser:      scanner: parsed_length = 1 <========size[1] [Type 1 = Global
344			Tag[0] = Usage Page ]
345
346___________________________________________________________________________
347
348Here the length of 1 indicates that the parameter or value associated  with
349the usage page is contained in the next character/byte.
350
351___________________________________________________________________________
352
353hidparser:      scanner: parsed_text[0] = 0x1,index = 0x1
354___________________________________________________________________________
355
356The next byte contains a value of 0x1. If you look at the usage table spec
357you can see that value of 1 stands for Generic Desktop.
358___________________________________________________________________________
359
360hidparser:      scanner: lexical analyzer found 0x5 before translation
361hidparser:      scanner: aindex  = 0x2
362___________________________________________________________________________
363
364Here  'hidparser_ItemList()'  would have  been called,   which  again calls
365'hidparser_Items()'. The purpose of 'hidparser_Items()'  is to  get through
366all the Items and break when it encounters a main item.  'hidparser_Items()
367will  again  call  'hidparser_GlobalItem()'  and 'hidparser_LocalItem()' to
368make a list of entity attributes in the hidparser_tok structure.
369___________________________________________________________________________
370
371hidparser:      hidparser_GlobalItem:index = 0x0 token = 0x4
372
373___________________________________________________________________________
374
375The above goes to gitem list.
376___________________________________________________________________________
377
378
379hidparser:      scanner: index  = 0x2 ch = 0x9 [ = 0x00001001 = tag[0],
380			type[2], size[1]]
381hidparser:      scanner: parsed_length = 1
382hidparser:      scanner: parsed_text[0] = 0x8,index = 0x3
383hidparser:      scanner: lexical analyzer found 0x9 before translation
384hidparser:      scanner: aindex  = 0x4
385hidparser:      hidparser_LocalItem:index = 0x2 token = 0x8
386___________________________________________________________________________
387
388The above goes to local item list in hidparser_tok_structure.
389___________________________________________________________________________
390
391hidparser:      scanner: index  = 0x4 ch = 0xa1 [= 0x10100001 = tag[a],
392			type[0], size[1]]
393hidparser:      scanner: parsed_length = 1	[ This is a main item ]
394hidparser:      scanner: parsed_text[0] = 0x1,index = 0x5
395hidparser:      scanner: lexical analyzer found 0xa1 before translation
396hidparser:      scanner: aindex  = 0x6
397
398____________________________________________________________________________
399
400Here 'hidparser_Items()' will break and pass the control back to 'hidparser_
401ItemList()' which will call 'hidparser_MainItem()'  to do things specific to
402a main item (like allocating  an entity_item  structure  and returning it in
403curr_ei).  'hidparser_MainItem()' will allocate an entity_item structure and
404copy the gitem list from hidparser tok structure and add the local item list
405to the end of global item list  (in  the  entity_item_attributes  member  of
406entity_item structure).
407
408____________________________________________________________________________
409
410hidparser:      hidparser_MainItem:index = 0x4 token = 0xa0
411hidparser:      scanner: index  = 0x6 ch = 0xa1
412hidparser:      scanner: parsed_length = 1
413hidparser:      scanner: parsed_text[0] = 0x0,index = 0x7
414hidparser:      scanner: lexical analyzer found 0xa1 before translation
415hidparser:      scanner: aindex  = 0x8
416hidparser:      Start Collection:cache_ei = 0xcab8d220, curr_ei = 0xcab8d220
417
418____________________________________________________________________________
419
420This forms the root collection.  'cache_ei'  or the cached  entity_item will
421always point to the last collection encountered.  Each entity_item structure
422will have a pointer to the previous collection.  This is basically to remove
423recursion when we support nested collections.  So if I have something like
424
425Collection
426	....
427	Collection
428		....
429		Collection
430		....
431		End Collection
432		....
433	End collection
434	....
435End Collection
436
437and if we assume  that  the parser is currently @ the third Collection item,
438then cache_ei will point to the third collection, it's prev_ei will point to
439the second collection and it's prev_ei will point to the root collection. As
440we move down the first end collection, cache_ei would have changed to second
441collection and so on.
442____________________________________________________________________________
443
444hidparser:      hidparser_MainItem:index = 0x6 token = 0xa0
445
446____________________________________________________________________________
447
448We encounter  another collection here [ so a nested collection ].  This   'ei'
449will have a  global  item  list (only,  as there are no local items. Remember
450that  we  preserve  global  item list  in  the  hidparser_tok_structure while
451blanking out the local item list as we encounter a main item).
452____________________________________________________________________________
453
454hidparser:      scanner: index  = 0x8 ch = 0x85
455hidparser:      scanner: parsed_length = 1
456hidparser:      scanner: parsed_text[0] = 0x1,index = 0x9
457hidparser:      scanner: lexical analyzer found 0x85 before translation
458hidparser:      scanner: aindex  = 0xa
459hidparser:      Start Collection:cache_ei = 0xcab84db0, curr_ei = 0xcab84db0
460
461
462hidparser:      hidparser_GlobalItem:index = 0x8 token = 0x84
463_____________________________________________________________________________
464
465This is a global item. Will get added to already existent Usage page GI in the
466'hidparser_tok' structure.
467
468hidparser:      scanner: index  = 0xa ch = 0x16
469hidparser:      scanner: parsed_length = 2
470hidparser:      scanner: parsed_text[0] = 0x0,index = 0xb
471hidparser:      scanner: parsed_text[1] = 0x80,index = 0xc
472hidparser:      scanner: lexical analyzer found 0x16 before translation
473hidparser:      scanner: aindex  = 0xd
474hidparser:      hidparser_GlobalItem:index = 0xa token = 0x14
475hidparser:      scanner: index  = 0xd ch = 0x26
476hidparser:      scanner: parsed_length = 2
477hidparser:      scanner: parsed_text[0] = 0xff,index = 0xe
478hidparser:      scanner: parsed_text[1] = 0x7f,index = 0xf
479hidparser:      scanner: lexical analyzer found 0x26 before translation
480hidparser:      scanner: aindex  = 0x10
481hidparser:      hidparser_GlobalItem:index = 0xd token = 0x24
482hidparser:      scanner: index  = 0x10 ch = 0x9
483hidparser:      scanner: parsed_length = 1
484hidparser:      scanner: parsed_text[0] = 0x30,index = 0x11
485hidparser:      scanner: lexical analyzer found 0x9 before translation
486hidparser:      scanner: aindex  = 0x12
487hidparser:      hidparser_LocalItem:index = 0x10 token = 0x8
488hidparser:      scanner: index  = 0x12 ch = 0x9
489hidparser:      scanner: parsed_length = 1
490hidparser:      scanner: parsed_text[0] = 0x31,index = 0x13
491hidparser:      scanner: lexical analyzer found 0x9 before translation
492hidparser:      scanner: aindex  = 0x14
493hidparser:      hidparser_LocalItem:index = 0x12 token = 0x8
494hidparser:      scanner: index  = 0x14 ch = 0x9
495hidparser:      scanner: parsed_length = 1
496hidparser:      scanner: parsed_text[0] = 0x32,index = 0x15
497hidparser:      scanner: lexical analyzer found 0x9 before translation
498hidparser:      scanner: aindex  = 0x16
499hidparser:      hidparser_LocalItem:index = 0x14 token = 0x8
500hidparser:      scanner: index  = 0x16 ch = 0x75
501hidparser:      scanner: parsed_length = 1
502hidparser:      scanner: parsed_text[0] = 0x10,index = 0x17
503hidparser:      scanner: lexical analyzer found 0x75 before translation
504hidparser:      scanner: aindex  = 0x18
505hidparser:      hidparser_GlobalItem:index = 0x16 token = 0x74
506hidparser:      scanner: index  = 0x18 ch = 0x95
507hidparser:      scanner: parsed_length = 1
508hidparser:      scanner: parsed_text[0] = 0x3,index = 0x19
509hidparser:      scanner: lexical analyzer found 0x95 before translation
510hidparser:      scanner: aindex  = 0x1a
511hidparser:      hidparser_GlobalItem:index = 0x18 token = 0x94
512hidparser:      scanner: index  = 0x1a ch = 0x81
513hidparser:      scanner: parsed_length = 1
514hidparser:      scanner: parsed_text[0] = 0x2,index = 0x1b
515hidparser:      scanner: lexical analyzer found 0x81 before translation
516hidparser:      scanner: aindex  = 0x1c
517hidparser:      hidparser_MainItem:index = 0x1a token = 0x80
518hidparser:      scanner: index  = 0x1c ch = 0xc0
519hidparser:      scanner: parsed_length = 0
520hidparser:      scanner: lexical analyzer found 0xc0 before translation
521hidparser:      scanner: aindex  = 0x1d
522hidparser:      Main Item: token = 0x80, curr_ei = 0xcab7ecf8  will be  the
523	child of prev_ei = 0xcab84db0, cache_ei being 0xcab84db0
524
525___________________________________________________________________________
526
527This is the Input main item and will form the child of collection @ 0xcab84-
528db0.
529___________________________________________________________________________
530
531hidparser:      hidparser_MainItem:index = 0x1c token = 0xc0
532hidparser:      scanner: index  = 0x1d ch = 0xa1
533hidparser:      scanner: parsed_length = 1
534hidparser:      scanner: parsed_text[0] = 0x0,index = 0x1e
535hidparser:      scanner: lexical analyzer found 0xa1 before translation
536hidparser:      scanner: aindex  = 0x1f
537hidparser:      End Collection: cache_ei = 0xcab84db0, curr_ei = 0xcab84630
538____________________________________________________________________________
539
540This  End collection and will for the right sibling of 0xcab84db0 which will
541make cache_ei point to root collection.
542____________________________________________________________________________
543
544hidparser:      hidparser_MainItem:index = 0x1d token = 0xa0
545hidparser:      scanner: index  = 0x1f ch = 0x85
546hidparser:      scanner: parsed_length = 1
547hidparser:      scanner: parsed_text[0] = 0x2,index = 0x20
548hidparser:      scanner: lexical analyzer found 0x85 before translation
549hidparser:      scanner: aindex  = 0x21
550hidparser:      Start Collection:cache_ei = 0xcab84750, curr_ei = 0xcab84750
551____________________________________________________________________________
552
553Again a Collection Item.
554
555The tree corresponding to the above list will be
556
557hidparser:      Usage Page(0x1) <---------------------- GI
558hidparser:      Usage(0x8) <--------------------------- LI
559hidparser:      Collection(0x1)<----------------------- MI
560hidparser:           Usage Page(0x1)<------------------ Carried over GI
561hidparser:           Collection(0x0)<------------------ MI
562hidparser:                Usage Page(0x1)<------------- Carried over GI
563hidparser:                Report Id(0x1)<-------------- GI [ New ]
564hidparser:                Logical Minimum(0x8000)<----- GI
565hidparser:                Logical Maximum(0x7FFF)<----- GI
566hidparser:                Report Size(0x10)<----------- GI
567hidparser:                Report Count(0x3)<----------- GI
568hidparser:                Usage(0x30)<----------------- LI
569hidparser:                Usage(0x31)<----------------- LI
570hidparser:                Usage(0x32)<----------------- LI
571hidparser:                Input(0x2)<------------------ MI
572hidparser:           End Collection(0x0)<-------------- MI
573hidparser:           Usage Page(0x1)<------------------ Carried over GI
574hidparser:           Report Id(0x1)<------------------- Carried over GI
575hidparser:           Logical Minimum(0x8000)<----------   " "
576hidparser:           Logical Maximum(0x7FFF)<----------   " "
577hidparser:           Report Size(0x10)<----------------   " "
578hidparser:           Report Count(0x3)<----------------   " "
579hidparser:           Collection(0x0)<------------------ MI
580
581The actual tree corresponding to a descriptor dump will be
582
583
584      0x5, 0x1,              /* Usage Page (Generic Desktop)             */
585      0x9, 0x8,              /* Usage (0x8:Multi-axis controller)        */
586      0xa1, 0x1,             /* Collection (Application)                 */
587      0xa1, 0,               /*     Collection (Physical)                */
588      0x85, 0x1,             /*         Report ID (0x1)                  */
589      0x16, 0, 0x80,         /*         Logical Minimum (0x8000)         */
590      0x26, 0xff, 0x7f,      /*         Logical Maximum (0x7fff)         */
591      0x9, 0x30,             /*         Usage (0x30:X)                   */
592      0x9, 0x31,             /*         Usage (0x31:Y)                   */
593      0x9, 0x32,             /*         Usage (0x32:Z)                   */
594      0x75, 0x10,            /*         Report Size (0x10)               */
595      0x95, 0x3,             /*         Report Count (0x3)               */
596      0x81, 0x2,             /*         Input (Data, Variable, Absolute) */
597      0xc0,                  /*     End Collection                       */
598      0xa1, 0,               /*     Collection (Physical)                */
599
600As can be seen, the tree that Solaris constructs have carried over GI extra
601which is the only difference. But that doesn't make a difference in the way
602we handle data.
603
604There are somethings to be noted at this point. If subsequently we encount-
605er another  global item  which has already been defined (say report size),
606then we  will go to the  global list  maintained in the 'hidparser_tok' st-
607ructure and replace the already existant one  (i.e report size(0x10)  with
608the new one ).
609
610For end collection  main item, we don't attach the global item list to the
611entity item structure.
612
613The rest of the document is a continuation of where we left off the parsing.
614The theory of operation is the same.
615
616___________________________________________________________________________
617
618
619hidparser:      hidparser_GlobalItem:index = 0x1f token = 0x84
620hidparser:      scanner: index  = 0x21 ch = 0x9
621hidparser:      scanner: parsed_length = 1
622hidparser:      scanner: parsed_text[0] = 0x33,index = 0x22
623hidparser:      scanner: lexical analyzer found 0x9 before translation
624hidparser:      scanner: aindex  = 0x23
625hidparser:      hidparser_LocalItem:index = 0x21 token = 0x8
626hidparser:      scanner: index  = 0x23 ch = 0x9
627hidparser:      scanner: parsed_length = 1
628hidparser:      scanner: parsed_text[0] = 0x34,index = 0x24
629hidparser:      scanner: lexical analyzer found 0x9 before translation
630hidparser:      scanner: aindex  = 0x25
631hidparser:      hidparser_LocalItem:index = 0x23 token = 0x8
632hidparser:      scanner: index  = 0x25 ch = 0x9
633hidparser:      scanner: parsed_length = 1
634hidparser:      scanner: parsed_text[0] = 0x35,index = 0x26
635hidparser:      scanner: lexical analyzer found 0x9 before translation
636hidparser:      scanner: aindex  = 0x27
637hidparser:      hidparser_LocalItem:index = 0x25 token = 0x8
638hidparser:      scanner: index  = 0x27 ch = 0x75
639hidparser:      scanner: parsed_length = 1
640hidparser:      scanner: parsed_text[0] = 0x10,index = 0x28
641hidparser:      scanner: lexical analyzer found 0x75 before translation
642hidparser:      scanner: aindex  = 0x29
643hidparser:      hidparser_GlobalItem:index = 0x27 token = 0x74
644hidparser:      scanner: index  = 0x29 ch = 0x95
645hidparser:      scanner: parsed_length = 1
646hidparser:      scanner: parsed_text[0] = 0x3,index = 0x2a
647hidparser:      scanner: lexical analyzer found 0x95 before translation
648hidparser:      scanner: aindex  = 0x2b
649hidparser:      hidparser_GlobalItem:index = 0x29 token = 0x94
650hidparser:      scanner: index  = 0x2b ch = 0x81
651hidparser:      scanner: parsed_length = 1
652hidparser:      scanner: parsed_text[0] = 0x2,index = 0x2c
653hidparser:      scanner: lexical analyzer found 0x81 before translation
654hidparser:      scanner: aindex  = 0x2d
655hidparser:      hidparser_MainItem:index = 0x2b token = 0x80
656hidparser:      scanner: index  = 0x2d ch = 0xc0
657hidparser:      scanner: parsed_length = 0
658hidparser:      scanner: lexical analyzer found 0xc0 before translation
659hidparser:      scanner: aindex  = 0x2e
660hidparser:      Main Item: token = 0x80, curr_ei = 0xcab7e098 will be the
661	 child of prev_ei = 0xcab84750, cache_ei being 0xcab84750
662hidparser:      hidparser_MainItem:index = 0x2d token = 0xc0
663hidparser:      scanner: index  = 0x2e ch = 0xa1
664hidparser:      scanner: parsed_length = 1
665hidparser:      scanner: parsed_text[0] = 0x2,index = 0x2f
666hidparser:      scanner: lexical analyzer found 0xa1 before translation
667hidparser:      scanner: aindex  = 0x30
668hidparser:      End Collection: cache_ei = 0xcab84750, curr_ei = 0xcab7af40
669hidparser:      hidparser_MainItem:index = 0x2e token = 0xa0
670hidparser:      scanner: index  = 0x30 ch = 0x85
671hidparser:      scanner: parsed_length = 1
672hidparser:      scanner: parsed_text[0] = 0x3,index = 0x31
673hidparser:      scanner: lexical analyzer found 0x85 before translation
674hidparser:      scanner: aindex  = 0x32
675hidparser:      Start Collection:cache_ei = 0xcab7ad30, curr_ei = 0xcab7ad30
676hidparser:      hidparser_GlobalItem:index = 0x30 token = 0x84
677hidparser:      scanner: index  = 0x32 ch = 0x5
678hidparser:      scanner: parsed_length = 1
679hidparser:      scanner: parsed_text[0] = 0x1,index = 0x33
680hidparser:      scanner: lexical analyzer found 0x5 before translation
681hidparser:      scanner: aindex  = 0x34
682hidparser:      hidparser_GlobalItem:index = 0x32 token = 0x4
683hidparser:      scanner: index  = 0x34 ch = 0x9
684hidparser:      scanner: parsed_length = 1
685hidparser:      scanner: parsed_text[0] = 0x3a,index = 0x35
686hidparser:      scanner: lexical analyzer found 0x9 before translation
687hidparser:      scanner: aindex  = 0x36
688hidparser:      hidparser_LocalItem:index = 0x34 token = 0x8
689hidparser:      scanner: index  = 0x36 ch = 0x75
690hidparser:      scanner: parsed_length = 1
691hidparser:      scanner: parsed_text[0] = 0x10,index = 0x37
692hidparser:      scanner: lexical analyzer found 0x75 before translation
693hidparser:      scanner: aindex  = 0x38
694hidparser:      hidparser_GlobalItem:index = 0x36 token = 0x74
695hidparser:      scanner: index  = 0x38 ch = 0x95
696hidparser:      scanner: parsed_length = 1
697hidparser:      scanner: parsed_text[0] = 0x1,index = 0x39
698hidparser:      scanner: lexical analyzer found 0x95 before translation
699hidparser:      scanner: aindex  = 0x3a
700hidparser:      hidparser_GlobalItem:index = 0x38 token = 0x94
701hidparser:      scanner: index  = 0x3a ch = 0x81
702hidparser:      scanner: parsed_length = 1
703hidparser:      scanner: parsed_text[0] = 0x2,index = 0x3b
704hidparser:      scanner: lexical analyzer found 0x81 before translation
705hidparser:      scanner: aindex  = 0x3c
706hidparser:      hidparser_MainItem:index = 0x3a token = 0x80
707hidparser:      scanner: index  = 0x3c ch = 0x5
708hidparser:      scanner: parsed_length = 1
709hidparser:      scanner: parsed_text[0] = 0x9,index = 0x3d
710hidparser:      scanner: lexical analyzer found 0x5 before translation
711hidparser:      scanner: aindex  = 0x3e
712hidparser:      Main Item: token = 0x80, curr_ei = 0xcab7ad60 will be the
713	 child of prev_ei = 0xcab7ad30, cache_ei being 0xcab7ad30
714hidparser:      hidparser_GlobalItem:index = 0x3c token = 0x4
715hidparser:      scanner: index  = 0x3e ch = 0x19
716hidparser:      scanner: parsed_length = 1
717hidparser:      scanner: parsed_text[0] = 0x1,index = 0x3f
718hidparser:      scanner: lexical analyzer found 0x19 before translation
719hidparser:      scanner: aindex  = 0x40
720hidparser:      hidparser_LocalItem:index = 0x3e token = 0x18
721hidparser:      scanner: index  = 0x40 ch = 0x29
722hidparser:      scanner: parsed_length = 1
723hidparser:      scanner: parsed_text[0] = 0xd,index = 0x41
724hidparser:      scanner: lexical analyzer found 0x29 before translation
725hidparser:      scanner: aindex  = 0x42
726hidparser:      hidparser_LocalItem:index = 0x40 token = 0x28
727hidparser:      scanner: index  = 0x42 ch = 0x15
728hidparser:      scanner: parsed_length = 1
729hidparser:      scanner: parsed_text[0] = 0x0,index = 0x43
730hidparser:      scanner: lexical analyzer found 0x15 before translation
731hidparser:      scanner: aindex  = 0x44
732hidparser:      hidparser_GlobalItem:index = 0x42 token = 0x14
733hidparser:      scanner: index  = 0x44 ch = 0x25
734hidparser:      scanner: parsed_length = 1
735hidparser:      scanner: parsed_text[0] = 0x1,index = 0x45
736hidparser:      scanner: lexical analyzer found 0x25 before translation
737hidparser:      scanner: aindex  = 0x46
738hidparser:      hidparser_GlobalItem:index = 0x44 token = 0x24
739hidparser:      scanner: index  = 0x46 ch = 0x35
740hidparser:      scanner: parsed_length = 1
741hidparser:      scanner: parsed_text[0] = 0x0,index = 0x47
742hidparser:      scanner: lexical analyzer found 0x35 before translation
743hidparser:      scanner: aindex  = 0x48
744hidparser:      hidparser_GlobalItem:index = 0x46 token = 0x34
745hidparser:      scanner: index  = 0x48 ch = 0x45
746hidparser:      scanner: parsed_length = 1
747hidparser:      scanner: parsed_text[0] = 0x1,index = 0x49
748hidparser:      scanner: lexical analyzer found 0x45 before translation
749hidparser:      scanner: aindex  = 0x4a
750hidparser:      hidparser_GlobalItem:index = 0x48 token = 0x44
751hidparser:      scanner: index  = 0x4a ch = 0x75
752hidparser:      scanner: parsed_length = 1
753hidparser:      scanner: parsed_text[0] = 0x1,index = 0x4b
754hidparser:      scanner: lexical analyzer found 0x75 before translation
755hidparser:      scanner: aindex  = 0x4c
756hidparser:      hidparser_GlobalItem:index = 0x4a token = 0x74
757hidparser:      scanner: index  = 0x4c ch = 0x95
758hidparser:      scanner: parsed_length = 1
759hidparser:      scanner: parsed_text[0] = 0xd,index = 0x4d
760hidparser:      scanner: lexical analyzer found 0x95 before translation
761hidparser:      scanner: aindex  = 0x4e
762hidparser:      hidparser_GlobalItem:index = 0x4c token = 0x94
763hidparser:      scanner: index  = 0x4e ch = 0x81
764hidparser:      scanner: parsed_length = 1
765hidparser:      scanner: parsed_text[0] = 0x2,index = 0x4f
766hidparser:      scanner: lexical analyzer found 0x81 before translation
767hidparser:      scanner: aindex  = 0x50
768hidparser:      hidparser_MainItem:index = 0x4e token = 0x80
769hidparser:      scanner: index  = 0x50 ch = 0x95
770hidparser:      scanner: parsed_length = 1
771hidparser:      scanner: parsed_text[0] = 0x3,index = 0x51
772hidparser:      scanner: lexical analyzer found 0x95 before translation
773hidparser:      scanner: aindex  = 0x52
774hidparser:      Main Item: token = 0x80, curr_ei = 0xcab7ecc8 will be the
775	 right sibling of prev_ei = 0xcab7ad60, cache_ei being 0xc
776ab7ad30
777hidparser:      hidparser_GlobalItem:index = 0x50 token = 0x94
778hidparser:      scanner: index  = 0x52 ch = 0x81
779hidparser:      scanner: parsed_length = 1
780hidparser:      scanner: parsed_text[0] = 0x1,index = 0x53
781hidparser:      scanner: lexical analyzer found 0x81 before translation
782hidparser:      scanner: aindex  = 0x54
783hidparser:      hidparser_MainItem:index = 0x52 token = 0x80
784hidparser:      scanner: index  = 0x54 ch = 0xc0
785hidparser:      scanner: parsed_length = 0
786hidparser:      scanner: lexical analyzer found 0xc0 before translation
787hidparser:      scanner: aindex  = 0x55
788hidparser:      Main Item: token = 0x80, curr_ei = 0xcab7ec98 will be the
789	 right sibling of prev_ei = 0xcab7ecc8, cache_ei being 0xc
790ab7ad30
791hidparser:      hidparser_MainItem:index = 0x54 token = 0xc0
792hidparser:      scanner: index  = 0x55 ch = 0x5
793hidparser:      scanner: parsed_length = 1
794hidparser:      scanner: parsed_text[0] = 0x1,index = 0x56
795hidparser:      scanner: lexical analyzer found 0x5 before translation
796hidparser:      scanner: aindex  = 0x57
797hidparser:      End Collection: cache_ei = 0xcab7ad30, curr_ei = 0xcab7ad00
798hidparser:      hidparser_GlobalItem:index = 0x55 token = 0x4
799hidparser:      scanner: index  = 0x57 ch = 0x9
800hidparser:      scanner: parsed_length = 1
801hidparser:      scanner: parsed_text[0] = 0x3a,index = 0x58
802hidparser:      scanner: lexical analyzer found 0x9 before translation
803hidparser:      scanner: aindex  = 0x59
804hidparser:      hidparser_LocalItem:index = 0x57 token = 0x8
805hidparser:      scanner: index  = 0x59 ch = 0xa1
806hidparser:      scanner: parsed_length = 1
807hidparser:      scanner: parsed_text[0] = 0x2,index = 0x5a
808hidparser:      scanner: lexical analyzer found 0xa1 before translation
809hidparser:      scanner: aindex  = 0x5b
810hidparser:      hidparser_MainItem:index = 0x59 token = 0xa0
811hidparser:      scanner: index  = 0x5b ch = 0x15
812hidparser:      scanner: parsed_length = 1
813hidparser:      scanner: parsed_text[0] = 0x80,index = 0x5c
814hidparser:      scanner: lexical analyzer found 0x15 before translation
815hidparser:      scanner: aindex  = 0x5d
816hidparser:      Start Collection:cache_ei = 0xcab7ea58, curr_ei = 0xcab7ea58
817hidparser:      hidparser_GlobalItem:index = 0x5b token = 0x14
818hidparser:      scanner: index  = 0x5d ch = 0x25
819hidparser:      scanner: parsed_length = 1
820hidparser:      scanner: parsed_text[0] = 0x7f,index = 0x5e
821hidparser:      scanner: lexical analyzer found 0x25 before translation
822hidparser:      scanner: aindex  = 0x5f
823hidparser:      hidparser_GlobalItem:index = 0x5d token = 0x24
824hidparser:      scanner: index  = 0x5f ch = 0x75
825hidparser:      scanner: parsed_length = 1
826hidparser:      scanner: parsed_text[0] = 0x8,index = 0x60
827hidparser:      scanner: lexical analyzer found 0x75 before translation
828hidparser:      scanner: aindex  = 0x61
829hidparser:      hidparser_GlobalItem:index = 0x5f token = 0x74
830hidparser:      scanner: index  = 0x61 ch = 0x9
831hidparser:      scanner: parsed_length = 1
832hidparser:      scanner: parsed_text[0] = 0x3a,index = 0x62
833hidparser:      scanner: lexical analyzer found 0x9 before translation
834hidparser:      scanner: aindex  = 0x63
835hidparser:      hidparser_LocalItem:index = 0x61 token = 0x8
836hidparser:      scanner: index  = 0x63 ch = 0xa1
837hidparser:      scanner: parsed_length = 1
838hidparser:      scanner: parsed_text[0] = 0x2,index = 0x64
839hidparser:      scanner: lexical analyzer found 0xa1 before translation
840hidparser:      scanner: aindex  = 0x65
841hidparser:      hidparser_MainItem:index = 0x63 token = 0xa0
842hidparser:      scanner: index  = 0x65 ch = 0x85
843hidparser:      scanner: parsed_length = 1
844hidparser:      scanner: parsed_text[0] = 0x4,index = 0x66
845hidparser:      scanner: lexical analyzer found 0x85 before translation
846hidparser:      scanner: aindex  = 0x67
847hidparser:      Start Collection:cache_ei = 0xcab7ea88, curr_ei = 0xcab7ea88
848hidparser:      hidparser_GlobalItem:index = 0x65 token = 0x84
849hidparser:      scanner: index  = 0x67 ch = 0x9
850hidparser:      scanner: parsed_length = 1
851hidparser:      scanner: parsed_text[0] = 0x3a,index = 0x68
852hidparser:      scanner: lexical analyzer found 0x9 before translation
853hidparser:      scanner: aindex  = 0x69
854hidparser:      hidparser_LocalItem:index = 0x67 token = 0x8
855hidparser:      scanner: index  = 0x69 ch = 0x95
856hidparser:      scanner: parsed_length = 1
857hidparser:      scanner: parsed_text[0] = 0x4,index = 0x6a
858hidparser:      scanner: lexical analyzer found 0x95 before translation
859hidparser:      scanner: aindex  = 0x6b
860hidparser:      hidparser_GlobalItem:index = 0x69 token = 0x94
861hidparser:      scanner: index  = 0x6b ch = 0xb1
862hidparser:      scanner: parsed_length = 1
863hidparser:      scanner: parsed_text[0] = 0x2,index = 0x6c
864hidparser:      scanner: lexical analyzer found 0xb1 before translation
865hidparser:      scanner: aindex  = 0x6d
866hidparser:      hidparser_MainItem:index = 0x6b token = 0xb0
867hidparser:      scanner: index  = 0x6d ch = 0xc0
868hidparser:      scanner: parsed_length = 0
869hidparser:      scanner: lexical analyzer found 0xc0 before translation
870hidparser:      scanner: aindex  = 0x6e
871hidparser:      Main Item: token = 0xb0, curr_ei = 0xcab7acd0 will be the
872		child of prev_ei = 0xcab7ea88, cache_ei being 0xcab7ea88
873hidparser:      hidparser_MainItem:index = 0x6d token = 0xc0
874hidparser:      scanner: index  = 0x6e ch = 0xa1
875hidparser:      scanner: parsed_length = 1
876hidparser:      scanner: parsed_text[0] = 0x2,index = 0x6f
877hidparser:      scanner: lexical analyzer found 0xa1 before translation
878hidparser:      scanner: aindex  = 0x70
879hidparser:      End Collection: cache_ei = 0xcab7ea88, curr_ei = 0xcab7ab20
880hidparser:      hidparser_MainItem:index = 0x6e token = 0xa0
881hidparser:      scanner: index  = 0x70 ch = 0x85
882hidparser:      scanner: parsed_length = 1
883hidparser:      scanner: parsed_text[0] = 0x5,index = 0x71
884hidparser:      scanner: lexical analyzer found 0x85 before translation
885hidparser:      scanner: aindex  = 0x72
886hidparser:      Start Collection:cache_ei = 0xcab7aaf0, curr_ei = 0xcab7aaf0
887hidparser:      hidparser_GlobalItem:index = 0x70 token = 0x84
888hidparser:      scanner: index  = 0x72 ch = 0x9
889hidparser:      scanner: parsed_length = 1
890hidparser:      scanner: parsed_text[0] = 0x3a,index = 0x73
891hidparser:      scanner: lexical analyzer found 0x9 before translation
892hidparser:      scanner: aindex  = 0x74
893hidparser:      hidparser_LocalItem:index = 0x72 token = 0x8
894hidparser:      scanner: index  = 0x74 ch = 0x95
895hidparser:      scanner: parsed_length = 1
896hidparser:      scanner: parsed_text[0] = 0x1,index = 0x75
897hidparser:      scanner: lexical analyzer found 0x95 before translation
898hidparser:      scanner: aindex  = 0x76
899hidparser:      hidparser_GlobalItem:index = 0x74 token = 0x94
900hidparser:      scanner: index  = 0x76 ch = 0xb1
901hidparser:      scanner: parsed_length = 1
902hidparser:      scanner: parsed_text[0] = 0x2,index = 0x77
903hidparser:      scanner: lexical analyzer found 0xb1 before translation
904hidparser:      scanner: aindex  = 0x78
905hidparser:      hidparser_MainItem:index = 0x76 token = 0xb0
906hidparser:      scanner: index  = 0x78 ch = 0xc0
907hidparser:      scanner: parsed_length = 0
908hidparser:      scanner: lexical analyzer found 0xc0 before translation
909hidparser:      scanner: aindex  = 0x79
910hidparser:      Main Item: token = 0xb0, curr_ei = 0xcab7aac0 will be the
911		child of prev_ei = 0xcab7aaf0, cache_ei being 0xcab7aaf0
912hidparser:      hidparser_MainItem:index = 0x78 token = 0xc0
913hidparser:      scanner: index  = 0x79 ch = 0xa1
914hidparser:      scanner: parsed_length = 1
915hidparser:      scanner: parsed_text[0] = 0x2,index = 0x7a
916hidparser:      scanner: lexical analyzer found 0xa1 before translation
917hidparser:      scanner: aindex  = 0x7b
918hidparser:      End Collection: cache_ei = 0xcab7aaf0, curr_ei = 0xcab7e548
919hidparser:      hidparser_MainItem:index = 0x79 token = 0xa0
920hidparser:      scanner: index  = 0x7b ch = 0x85
921hidparser:      scanner: parsed_length = 1
922hidparser:      scanner: parsed_text[0] = 0x6,index = 0x7c
923hidparser:      scanner: lexical analyzer found 0x85 before translation
924hidparser:      scanner: aindex  = 0x7d
925hidparser:      Start Collection:cache_ei = 0xcab7ea28, curr_ei = 0xcab7ea28
926hidparser:      hidparser_GlobalItem:index = 0x7b token = 0x84
927hidparser:      scanner: index  = 0x7d ch = 0x9
928hidparser:      scanner: parsed_length = 1
929hidparser:      scanner: parsed_text[0] = 0x3a,index = 0x7e
930hidparser:      scanner: lexical analyzer found 0x9 before translation
931hidparser:      scanner: aindex  = 0x7f
932hidparser:      hidparser_LocalItem:index = 0x7d token = 0x8
933hidparser:      scanner: index  = 0x7f ch = 0x95
934hidparser:      scanner: parsed_length = 1
935hidparser:      scanner: parsed_text[0] = 0x1,index = 0x80
936hidparser:      scanner: lexical analyzer found 0x95 before translation
937hidparser:      scanner: aindex  = 0x81
938hidparser:      hidparser_GlobalItem:index = 0x7f token = 0x94
939hidparser:      scanner: index  = 0x81 ch = 0xb1
940hidparser:      scanner: parsed_length = 1
941hidparser:      scanner: parsed_text[0] = 0x2,index = 0x82
942hidparser:      scanner: lexical analyzer found 0xb1 before translation
943hidparser:      scanner: aindex  = 0x83
944hidparser:      hidparser_MainItem:index = 0x81 token = 0xb0
945hidparser:      scanner: index  = 0x83 ch = 0xc0
946hidparser:      scanner: parsed_length = 0
947hidparser:      scanner: lexical analyzer found 0xc0 before translation
948hidparser:      scanner: aindex  = 0x84
949hidparser:      Main Item: token = 0xb0, curr_ei = 0xcab7e608 will be the
950		child of prev_ei = 0xcab7ea28, cache_ei being 0xcab7ea28
951hidparser:      hidparser_MainItem:index = 0x83 token = 0xc0
952hidparser:      scanner: index  = 0x84 ch = 0xa1
953hidparser:      scanner: parsed_length = 1
954hidparser:      scanner: parsed_text[0] = 0x2,index = 0x85
955hidparser:      scanner: lexical analyzer found 0xa1 before translation
956hidparser:      scanner: aindex  = 0x86
957hidparser:      End Collection: cache_ei = 0xcab7ea28, curr_ei = 0xcab7e5d8
958hidparser:      hidparser_MainItem:index = 0x84 token = 0xa0
959hidparser:      scanner: index  = 0x86 ch = 0x85
960hidparser:      scanner: parsed_length = 1
961hidparser:      scanner: parsed_text[0] = 0x7,index = 0x87
962hidparser:      scanner: lexical analyzer found 0x85 before translation
963hidparser:      scanner: aindex  = 0x88
964hidparser:      Start Collection:cache_ei = 0xcab7e5a8, curr_ei = 0xcab7e5a8
965hidparser:      hidparser_GlobalItem:index = 0x86 token = 0x84
966hidparser:      scanner: index  = 0x88 ch = 0x9
967hidparser:      scanner: parsed_length = 1
968hidparser:      scanner: parsed_text[0] = 0x3a,index = 0x89
969hidparser:      scanner: lexical analyzer found 0x9 before translation
970hidparser:      scanner: aindex  = 0x8a
971hidparser:      hidparser_LocalItem:index = 0x88 token = 0x8
972hidparser:      scanner: index  = 0x8a ch = 0x95
973hidparser:      scanner: parsed_length = 1
974hidparser:      scanner: parsed_text[0] = 0x10,index = 0x8b
975hidparser:      scanner: lexical analyzer found 0x95 before translation
976hidparser:      scanner: aindex  = 0x8c
977hidparser:      hidparser_GlobalItem:index = 0x8a token = 0x94
978hidparser:      scanner: index  = 0x8c ch = 0xb1
979hidparser:      scanner: parsed_length = 1
980hidparser:      scanner: parsed_text[0] = 0x2,index = 0x8d
981hidparser:      scanner: lexical analyzer found 0xb1 before translation
982hidparser:      scanner: aindex  = 0x8e
983hidparser:      hidparser_MainItem:index = 0x8c token = 0xb0
984hidparser:      scanner: index  = 0x8e ch = 0xc0
985hidparser:      scanner: parsed_length = 0
986hidparser:      scanner: lexical analyzer found 0xc0 before translation
987hidparser:      scanner: aindex  = 0x8f
988hidparser:      Main Item: token = 0xb0, curr_ei = 0xcab7e578 will be the
989		child of prev_ei = 0xcab7e5a8, cache_ei being 0xcab7e5a8
990hidparser:      hidparser_MainItem:index = 0x8e token = 0xc0
991hidparser:      scanner: index  = 0x8f ch = 0xa1
992hidparser:      scanner: parsed_length = 1
993hidparser:      scanner: parsed_text[0] = 0x2,index = 0x90
994hidparser:      scanner: lexical analyzer found 0xa1 before translation
995hidparser:      scanner: aindex  = 0x91
996hidparser:      End Collection: cache_ei = 0xcab7e5a8, curr_ei = 0xcab7af10
997hidparser:      hidparser_MainItem:index = 0x8f token = 0xa0
998hidparser:      scanner: index  = 0x91 ch = 0x85
999hidparser:      scanner: parsed_length = 1
1000hidparser:      scanner: parsed_text[0] = 0x8,index = 0x92
1001hidparser:      scanner: lexical analyzer found 0x85 before translation
1002hidparser:      scanner: aindex  = 0x93
1003hidparser:      Start Collection:cache_ei = 0xcab7aa60, curr_ei = 0xcab7aa60
1004hidparser:      hidparser_GlobalItem:index = 0x91 token = 0x84
1005hidparser:      scanner: index  = 0x93 ch = 0x9
1006hidparser:      scanner: parsed_length = 1
1007hidparser:      scanner: parsed_text[0] = 0x3a,index = 0x94
1008hidparser:      scanner: lexical analyzer found 0x9 before translation
1009hidparser:      scanner: aindex  = 0x95
1010hidparser:      hidparser_LocalItem:index = 0x93 token = 0x8
1011hidparser:      scanner: index  = 0x95 ch = 0x95
1012hidparser:      scanner: parsed_length = 1
1013hidparser:      scanner: parsed_text[0] = 0x10,index = 0x96
1014hidparser:      scanner: lexical analyzer found 0x95 before translation
1015hidparser:      scanner: aindex  = 0x97
1016hidparser:      hidparser_GlobalItem:index = 0x95 token = 0x94
1017hidparser:      scanner: index  = 0x97 ch = 0xb1
1018hidparser:      scanner: parsed_length = 1
1019hidparser:      scanner: parsed_text[0] = 0x2,index = 0x98
1020hidparser:      scanner: lexical analyzer found 0xb1 before translation
1021hidparser:      scanner: aindex  = 0x99
1022hidparser:      hidparser_MainItem:index = 0x97 token = 0xb0
1023hidparser:      scanner: index  = 0x99 ch = 0xc0
1024hidparser:      scanner: parsed_length = 0
1025hidparser:      scanner: lexical analyzer found 0xc0 before translation
1026hidparser:      scanner: aindex  = 0x9a
1027hidparser:      Main Item: token = 0xb0, curr_ei = 0xcab7aa30 will be the
1028		child of prev_ei = 0xcab7aa60, cache_ei being 0xcab7aa60
1029hidparser:      hidparser_MainItem:index = 0x99 token = 0xc0
1030hidparser:      scanner: index  = 0x9a ch = 0xa1
1031hidparser:      scanner: parsed_length = 1
1032hidparser:      scanner: parsed_text[0] = 0x2,index = 0x9b
1033hidparser:      scanner: lexical analyzer found 0xa1 before translation
1034hidparser:      scanner: aindex  = 0x9c
1035hidparser:      End Collection: cache_ei = 0xcab7aa60, curr_ei = 0xcab7aa00
1036hidparser:      hidparser_MainItem:index = 0x9a token = 0xa0
1037hidparser:      scanner: index  = 0x9c ch = 0x85
1038hidparser:      scanner: parsed_length = 1
1039hidparser:      scanner: parsed_text[0] = 0x9,index = 0x9d
1040hidparser:      scanner: lexical analyzer found 0x85 before translation
1041hidparser:      scanner: aindex  = 0x9e
1042hidparser:      Start Collection:cache_ei = 0xcab7a9d0, curr_ei = 0xcab7a9d0
1043hidparser:      hidparser_GlobalItem:index = 0x9c token = 0x84
1044hidparser:      scanner: index  = 0x9e ch = 0x9
1045hidparser:      scanner: parsed_length = 1
1046hidparser:      scanner: parsed_text[0] = 0x3a,index = 0x9f
1047hidparser:      scanner: lexical analyzer found 0x9 before translation
1048hidparser:      scanner: aindex  = 0xa0
1049hidparser:      hidparser_LocalItem:index = 0x9e token = 0x8
1050hidparser:      scanner: index  = 0xa0 ch = 0x95
1051hidparser:      scanner: parsed_length = 1
1052hidparser:      scanner: parsed_text[0] = 0xc,index = 0xa1
1053hidparser:      scanner: lexical analyzer found 0x95 before translation
1054hidparser:      scanner: aindex  = 0xa2
1055hidparser:      hidparser_GlobalItem:index = 0xa0 token = 0x94
1056hidparser:      scanner: index  = 0xa2 ch = 0xb1
1057hidparser:      scanner: parsed_length = 1
1058hidparser:      scanner: parsed_text[0] = 0x2,index = 0xa3
1059hidparser:      scanner: lexical analyzer found 0xb1 before translation
1060hidparser:      scanner: aindex  = 0xa4
1061hidparser:      hidparser_MainItem:index = 0xa2 token = 0xb0
1062hidparser:      scanner: index  = 0xa4 ch = 0xc0
1063hidparser:      scanner: parsed_length = 0
1064hidparser:      scanner: lexical analyzer found 0xc0 before translation
1065hidparser:      scanner: aindex  = 0xa5
1066hidparser:      Main Item: token = 0xb0, curr_ei = 0xcab7a9a0 will be the
1067		child of prev_ei = 0xcab7a9d0, cache_ei being 0xcab7a9d0
1068hidparser:      hidparser_MainItem:index = 0xa4 token = 0xc0
1069hidparser:      scanner: index  = 0xa5 ch = 0xa1
1070hidparser:      scanner: parsed_length = 1
1071hidparser:      scanner: parsed_text[0] = 0x2,index = 0xa6
1072hidparser:      scanner: lexical analyzer found 0xa1 before translation
1073hidparser:      scanner: aindex  = 0xa7
1074hidparser:      End Collection: cache_ei = 0xcab7a9d0, curr_ei = 0xcab7a970
1075hidparser:      hidparser_MainItem:index = 0xa5 token = 0xa0
1076hidparser:      scanner: index  = 0xa7 ch = 0x85
1077hidparser:      scanner: parsed_length = 1
1078hidparser:      scanner: parsed_text[0] = 0xa,index = 0xa8
1079hidparser:      scanner: lexical analyzer found 0x85 before translation
1080hidparser:      scanner: aindex  = 0xa9
1081hidparser:      Start Collection:cache_ei = 0xcab7a940, curr_ei = 0xcab7a940
1082hidparser:      hidparser_GlobalItem:index = 0xa7 token = 0x84
1083hidparser:      scanner: index  = 0xa9 ch = 0x9
1084hidparser:      scanner: parsed_length = 1
1085hidparser:      scanner: parsed_text[0] = 0x3a,index = 0xaa
1086hidparser:      scanner: lexical analyzer found 0x9 before translation
1087hidparser:      scanner: aindex  = 0xab
1088hidparser:      hidparser_LocalItem:index = 0xa9 token = 0x8
1089hidparser:      scanner: index  = 0xab ch = 0x95
1090hidparser:      scanner: parsed_length = 1
1091hidparser:      scanner: parsed_text[0] = 0x1,index = 0xac
1092hidparser:      scanner: lexical analyzer found 0x95 before translation
1093hidparser:      scanner: aindex  = 0xad
1094hidparser:      hidparser_GlobalItem:index = 0xab token = 0x94
1095hidparser:      scanner: index  = 0xad ch = 0xb1
1096hidparser:      scanner: parsed_length = 1
1097hidparser:      scanner: parsed_text[0] = 0x2,index = 0xae
1098hidparser:      scanner: lexical analyzer found 0xb1 before translation
1099hidparser:      scanner: aindex  = 0xaf
1100hidparser:      hidparser_MainItem:index = 0xad token = 0xb0
1101hidparser:      scanner: index  = 0xaf ch = 0xc0
1102hidparser:      scanner: parsed_length = 0
1103hidparser:      scanner: lexical analyzer found 0xc0 before translation
1104hidparser:      scanner: aindex  = 0xb0
1105hidparser:      Main Item: token = 0xb0, curr_ei = 0xcab7a910 will be the
1106	 	child of prev_ei = 0xcab7a940, cache_ei being 0xcab7a940
1107hidparser:      hidparser_MainItem:index = 0xaf token = 0xc0
1108hidparser:      scanner: index  = 0xb0 ch = 0xa1
1109hidparser:      scanner: parsed_length = 1
1110hidparser:      scanner: parsed_text[0] = 0x2,index = 0xb1
1111hidparser:      scanner: lexical analyzer found 0xa1 before translation
1112hidparser:      scanner: aindex  = 0xb2
1113hidparser:      End Collection: cache_ei = 0xcab7a940, curr_ei = 0xcab7a8e0
1114hidparser:      hidparser_MainItem:index = 0xb0 token = 0xa0
1115hidparser:      scanner: index  = 0xb2 ch = 0x85
1116hidparser:      scanner: parsed_length = 1
1117hidparser:      scanner: parsed_text[0] = 0xb,index = 0xb3
1118hidparser:      scanner: lexical analyzer found 0x85 before translation
1119hidparser:      scanner: aindex  = 0xb4
1120hidparser:      Start Collection:cache_ei = 0xcab7a8b0, curr_ei = 0xcab7a8b0
1121hidparser:      hidparser_GlobalItem:index = 0xb2 token = 0x84
1122hidparser:      scanner: index  = 0xb4 ch = 0x9
1123hidparser:      scanner: parsed_length = 1
1124hidparser:      scanner: parsed_text[0] = 0x3a,index = 0xb5
1125hidparser:      scanner: lexical analyzer found 0x9 before translation
1126hidparser:      scanner: aindex  = 0xb6
1127hidparser:      hidparser_LocalItem:index = 0xb4 token = 0x8
1128hidparser:      scanner: index  = 0xb6 ch = 0x95
1129hidparser:      scanner: parsed_length = 1
1130hidparser:      scanner: parsed_text[0] = 0x1,index = 0xb7
1131hidparser:      scanner: lexical analyzer found 0x95 before translation
1132hidparser:      scanner: aindex  = 0xb8
1133hidparser:      hidparser_GlobalItem:index = 0xb6 token = 0x94
1134hidparser:      scanner: index  = 0xb8 ch = 0xb1
1135hidparser:      scanner: parsed_length = 1
1136hidparser:      scanner: parsed_text[0] = 0x2,index = 0xb9
1137hidparser:      scanner: lexical analyzer found 0xb1 before translation
1138hidparser:      scanner: aindex  = 0xba
1139hidparser:      hidparser_MainItem:index = 0xb8 token = 0xb0
1140hidparser:      scanner: index  = 0xba ch = 0xc0
1141hidparser:      scanner: parsed_length = 0
1142hidparser:      scanner: lexical analyzer found 0xc0 before translation
1143hidparser:      scanner: aindex  = 0xbb
1144hidparser:      Main Item: token = 0xb0, curr_ei = 0xcab7a880 will be the
1145	 	child of prev_ei = 0xcab7a8b0, cache_ei being 0xcab7a8b0
1146hidparser:      hidparser_MainItem:index = 0xba token = 0xc0
1147hidparser:      scanner: index  = 0xbb ch = 0xa1
1148hidparser:      scanner: parsed_length = 1
1149hidparser:      scanner: parsed_text[0] = 0x2,index = 0xbc
1150hidparser:      scanner: lexical analyzer found 0xa1 before translation
1151hidparser:      scanner: aindex  = 0xbd
1152hidparser:      End Collection: cache_ei = 0xcab7a8b0, curr_ei = 0xcab7a850
1153hidparser:      hidparser_MainItem:index = 0xbb token = 0xa0
1154hidparser:      scanner: index  = 0xbd ch = 0x85
1155hidparser:      scanner: parsed_length = 1
1156hidparser:      scanner: parsed_text[0] = 0xc,index = 0xbe
1157hidparser:      scanner: lexical analyzer found 0x85 before translation
1158hidparser:      scanner: aindex  = 0xbf
1159hidparser:      Start Collection:cache_ei = 0xcab7a820, curr_ei = 0xcab7a820
1160hidparser:      hidparser_GlobalItem:index = 0xbd token = 0x84
1161hidparser:      scanner: index  = 0xbf ch = 0x9
1162hidparser:      scanner: parsed_length = 1
1163hidparser:      scanner: parsed_text[0] = 0x3a,index = 0xc0
1164hidparser:      scanner: lexical analyzer found 0x9 before translation
1165hidparser:      scanner: aindex  = 0xc1
1166hidparser:      hidparser_LocalItem:index = 0xbf token = 0x8
1167hidparser:      scanner: index  = 0xc1 ch = 0x95
1168hidparser:      scanner: parsed_length = 1
1169hidparser:      scanner: parsed_text[0] = 0x1,index = 0xc2
1170hidparser:      scanner: lexical analyzer found 0x95 before translation
1171hidparser:      scanner: aindex  = 0xc3
1172hidparser:      hidparser_GlobalItem:index = 0xc1 token = 0x94
1173hidparser:      scanner: index  = 0xc3 ch = 0xb1
1174hidparser:      scanner: parsed_length = 1
1175hidparser:      scanner: parsed_text[0] = 0x2,index = 0xc4
1176hidparser:      scanner: lexical analyzer found 0xb1 before translation
1177hidparser:      scanner: aindex  = 0xc5
1178hidparser:      hidparser_MainItem:index = 0xc3 token = 0xb0
1179hidparser:      scanner: index  = 0xc5 ch = 0xc0
1180hidparser:      scanner: parsed_length = 0
1181hidparser:      scanner: lexical analyzer found 0xc0 before translation
1182hidparser:      scanner: aindex  = 0xc6
1183hidparser:      Main Item: token = 0xb0, curr_ei = 0xcab7a7f0 will be the
1184	 	child of prev_ei = 0xcab7a820, cache_ei being 0xcab7a820
1185hidparser:      hidparser_MainItem:index = 0xc5 token = 0xc0
1186hidparser:      scanner: index  = 0xc6 ch = 0xa1
1187hidparser:      scanner: parsed_length = 1
1188hidparser:      scanner: parsed_text[0] = 0x2,index = 0xc7
1189hidparser:      scanner: lexical analyzer found 0xa1 before translation
1190hidparser:      scanner: aindex  = 0xc8
1191hidparser:      End Collection: cache_ei = 0xcab7a820, curr_ei = 0xcab7a7c0
1192hidparser:      hidparser_MainItem:index = 0xc6 token = 0xa0
1193hidparser:      scanner: index  = 0xc8 ch = 0x85
1194hidparser:      scanner: parsed_length = 1
1195hidparser:      scanner: parsed_text[0] = 0xd,index = 0xc9
1196hidparser:      scanner: lexical analyzer found 0x85 before translation
1197hidparser:      scanner: aindex  = 0xca
1198hidparser:      Start Collection:cache_ei = 0xcab7a790, curr_ei = 0xcab7a790
1199hidparser:      hidparser_GlobalItem:index = 0xc8 token = 0x84
1200hidparser:      scanner: index  = 0xca ch = 0x9
1201hidparser:      scanner: parsed_length = 1
1202hidparser:      scanner: parsed_text[0] = 0x3a,index = 0xcb
1203hidparser:      scanner: lexical analyzer found 0x9 before translation
1204hidparser:      scanner: aindex  = 0xcc
1205hidparser:      hidparser_LocalItem:index = 0xca token = 0x8
1206hidparser:      scanner: index  = 0xcc ch = 0x95
1207hidparser:      scanner: parsed_length = 1
1208hidparser:      scanner: parsed_text[0] = 0x2,index = 0xcd
1209hidparser:      scanner: lexical analyzer found 0x95 before translation
1210hidparser:      scanner: aindex  = 0xce
1211hidparser:      hidparser_GlobalItem:index = 0xcc token = 0x94
1212hidparser:      scanner: index  = 0xce ch = 0xb1
1213hidparser:      scanner: parsed_length = 1
1214hidparser:      scanner: parsed_text[0] = 0x2,index = 0xcf
1215hidparser:      scanner: lexical analyzer found 0xb1 before translation
1216hidparser:      scanner: aindex  = 0xd0
1217hidparser:      hidparser_MainItem:index = 0xce token = 0xb0
1218hidparser:      scanner: index  = 0xd0 ch = 0xc0
1219hidparser:      scanner: parsed_length = 0
1220hidparser:      scanner: lexical analyzer found 0xc0 before translation
1221hidparser:      scanner: aindex  = 0xd1
1222hidparser:      Main Item: token = 0xb0, curr_ei = 0xcab7a760 will be the
1223	 	child of prev_ei = 0xcab7a790, cache_ei being 0xcab7a790
1224hidparser:      hidparser_MainItem:index = 0xd0 token = 0xc0
1225hidparser:      scanner: index  = 0xd1 ch = 0xc0
1226hidparser:      scanner: parsed_length = 0
1227hidparser:      scanner: lexical analyzer found 0xc0 before translation
1228hidparser:      scanner: aindex  = 0xd2
1229hidparser:      End Collection: cache_ei = 0xcab7a790, curr_ei = 0xcab7a730
1230hidparser:      hidparser_MainItem:index = 0xd1 token = 0xc0
1231hidparser:      scanner: index  = 0xd2 ch = 0xc0
1232hidparser:      scanner: parsed_length = 0
1233hidparser:      scanner: lexical analyzer found 0xc0 before translation
1234hidparser:      scanner: aindex  = 0xd3
1235hidparser:      End Collection: cache_ei = 0xcab7ea58, curr_ei = 0xcab7a700
1236hidparser:      hidparser_MainItem:index = 0xd2 token = 0xc0
1237hidparser:      scanner: eindex  = 0xd3
1238hidparser:      End Collection: cache_ei = 0xcab8d220, curr_ei = 0xcab7a6d0
1239hidparser:      Usage Page(0x1)
1240hidparser:      Usage(0x8)
1241hidparser:      Collection(0x1)
1242hidparser:           Usage Page(0x1)
1243hidparser:           Collection(0x0)
1244hidparser:                Usage Page(0x1)
1245hidparser:                Report Id(0x1)
1246hidparser:                Logical Minimum(0x8000)
1247hidparser:                Logical Maximum(0x7FFF)
1248hidparser:                Report Size(0x10)
1249hidparser:                Report Count(0x3)
1250hidparser:                Usage(0x30)
1251hidparser:                Usage(0x31)
1252hidparser:                Usage(0x32)
1253hidparser:                Input(0x2)
1254hidparser:           End Collection(0x0)
1255hidparser:           Usage Page(0x1)
1256hidparser:           Report Id(0x1)
1257hidparser:           Logical Minimum(0x8000)
1258hidparser:           Logical Maximum(0x7FFF)
1259hidparser:           Report Size(0x10)
1260hidparser:           Report Count(0x3)
1261hidparser:           Collection(0x0)
1262hidparser:                Usage Page(0x1)
1263hidparser:                Logical Minimum(0x8000)
1264hidparser:                Logical Maximum(0x7FFF)
1265hidparser:                Report Id(0x2)
1266hidparser:                Report Size(0x10)
1267hidparser:                Report Count(0x3)
1268hidparser:                Usage(0x33)
1269hidparser:                Usage(0x34)
1270hidparser:                Usage(0x35)
1271hidparser:                Input(0x2)
1272hidparser:           End Collection(0x0)
1273hidparser:           Usage Page(0x1)
1274hidparser:           Logical Minimum(0x8000)
1275hidparser:           Logical Maximum(0x7FFF)
1276hidparser:           Report Id(0x2)
1277hidparser:           Report Size(0x10)
1278hidparser:           Report Count(0x3)
1279hidparser:           Collection(0x2)
1280hidparser:                Logical Minimum(0x8000)
1281hidparser:                Logical Maximum(0x7FFF)
1282hidparser:                Report Id(0x3)
1283hidparser:                Usage Page(0x1)
1284hidparser:                Report Size(0x10)
1285hidparser:                Report Count(0x1)
1286hidparser:                Usage(0x3A)
1287hidparser:                Input(0x2)
1288hidparser:                Report Id(0x3)
1289hidparser:                Usage Page(0x9)
1290hidparser:                Logical Minimum(0x0)
1291hidparser:                Logical Maximum(0x1)
1292hidparser:                Physical Minimum(0x0)
1293hidparser:                Physical Maximum(0x1)
1294hidparser:                Report Size(0x1)
1295hidparser:                Report Count(0xD)
1296hidparser:                Usage Minimum(0x1)
1297hidparser:                Usage Maximum(0xD)
1298hidparser:                Input(0x2)
1299hidparser:                Report Id(0x3)
1300hidparser:                Usage Page(0x9)
1301hidparser:                Logical Minimum(0x0)
1302hidparser:                Logical Maximum(0x1)
1303hidparser:                Physical Minimum(0x0)
1304hidparser:                Physical Maximum(0x1)
1305hidparser:                Report Size(0x1)
1306hidparser:                Report Count(0x3)
1307hidparser:                Input(0x1)
1308hidparser:           End Collection(0x0)
1309hidparser:           Report Id(0x3)
1310hidparser:           Logical Minimum(0x0)
1311hidparser:           Logical Maximum(0x1)
1312hidparser:           Physical Minimum(0x0)
1313hidparser:           Physical Maximum(0x1)
1314hidparser:           Report Size(0x1)
1315hidparser:           Report Count(0x3)
1316hidparser:           Usage Page(0x1)
1317hidparser:           Usage(0x3A)
1318hidparser:           Collection(0x2)
1319hidparser:                Report Id(0x3)
1320hidparser:                Physical Minimum(0x0)
1321hidparser:                Physical Maximum(0x1)
1322hidparser:                Report Count(0x3)
1323hidparser:                Usage Page(0x1)
1324hidparser:                Logical Minimum(0x80)
1325hidparser:                Logical Maximum(0x7F)
1326hidparser:                Report Size(0x8)
1327hidparser:                Usage(0x3A)
1328hidparser:                Collection(0x2)
1329hidparser:                     Physical Minimum(0x0)
1330hidparser:                     Physical Maximum(0x1)
1331hidparser:                     Usage Page(0x1)
1332hidparser:                     Logical Minimum(0x80)
1333hidparser:                     Logical Maximum(0x7F)
1334hidparser:                     Report Size(0x8)
1335hidparser:                     Report Id(0x4)
1336hidparser:                     Report Count(0x4)
1337hidparser:                     Usage(0x3A)
1338hidparser:                     Feature(0x2)
1339hidparser:                End Collection(0x0)
1340hidparser:                Physical Minimum(0x0)
1341hidparser:                Physical Maximum(0x1)
1342hidparser:                Usage Page(0x1)
1343hidparser:                Logical Minimum(0x80)
1344hidparser:                Logical Maximum(0x7F)
1345hidparser:                Report Size(0x8)
1346hidparser:                Report Id(0x4)
1347hidparser:                Report Count(0x4)
1348hidparser:                Collection(0x2)
1349hidparser:                     Physical Minimum(0x0)
1350hidparser:                     Physical Maximum(0x1)
1351hidparser:                     Usage Page(0x1)
1352hidparser:                     Logical Minimum(0x80)
1353hidparser:                     Logical Maximum(0x7F)
1354hidparser:                     Report Size(0x8)
1355hidparser:                     Report Id(0x5)
1356hidparser:                     Report Count(0x1)
1357hidparser:                     Usage(0x3A)
1358hidparser:                     Feature(0x2)
1359hidparser:                End Collection(0x0)
1360hidparser:                Physical Minimum(0x0)
1361hidparser:                Physical Maximum(0x1)
1362hidparser:                Usage Page(0x1)
1363hidparser:                Logical Minimum(0x80)
1364hidparser:                Logical Maximum(0x7F)
1365hidparser:                Report Size(0x8)
1366hidparser:                Report Id(0x5)
1367hidparser:                Report Count(0x1)
1368hidparser:                Collection(0x2)
1369hidparser:                     Physical Minimum(0x0)
1370hidparser:                     Physical Maximum(0x1)
1371hidparser:                     Usage Page(0x1)
1372hidparser:                     Logical Minimum(0x80)
1373hidparser:                     Logical Maximum(0x7F)
1374hidparser:                     Report Size(0x8)
1375hidparser:                     Report Id(0x6)
1376hidparser:                     Report Count(0x1)
1377hidparser:                     Usage(0x3A)
1378hidparser:                     Feature(0x2)
1379hidparser:                End Collection(0x0)
1380hidparser:                Physical Minimum(0x0)
1381hidparser:                Physical Maximum(0x1)
1382hidparser:                Usage Page(0x1)
1383hidparser:                Logical Minimum(0x80)
1384hidparser:                Logical Maximum(0x7F)
1385hidparser:                Report Size(0x8)
1386hidparser:                Report Id(0x6)
1387hidparser:                Report Count(0x1)
1388hidparser:                Collection(0x2)
1389hidparser:                     Physical Minimum(0x0)
1390hidparser:                     Physical Maximum(0x1)
1391hidparser:                     Usage Page(0x1)
1392hidparser:                     Logical Minimum(0x80)
1393hidparser:                     Logical Maximum(0x7F)
1394hidparser:                     Report Size(0x8)
1395hidparser:                     Report Id(0x7)
1396hidparser:                     Report Count(0x10)
1397hidparser:                     Usage(0x3A)
1398hidparser:                     Feature(0x2)
1399hidparser:                End Collection(0x0)
1400hidparser:                Physical Minimum(0x0)
1401hidparser:                Physical Maximum(0x1)
1402hidparser:                Usage Page(0x1)
1403hidparser:                Logical Minimum(0x80)
1404hidparser:                Logical Maximum(0x7F)
1405hidparser:                Report Size(0x8)
1406hidparser:                Report Id(0x7)
1407hidparser:                Report Count(0x10)
1408hidparser:                Collection(0x2)
1409hidparser:                     Physical Minimum(0x0)
1410hidparser:                     Physical Maximum(0x1)
1411hidparser:                     Usage Page(0x1)
1412hidparser:                     Logical Minimum(0x80)
1413hidparser:                     Logical Maximum(0x7F)
1414hidparser:                     Report Size(0x8)
1415hidparser:                     Report Id(0x8)
1416hidparser:                     Report Count(0x10)
1417hidparser:                     Usage(0x3A)
1418hidparser:                     Feature(0x2)
1419hidparser:                End Collection(0x0)
1420hidparser:                Physical Minimum(0x0)
1421hidparser:                Physical Maximum(0x1)
1422hidparser:                Usage Page(0x1)
1423hidparser:                Logical Minimum(0x80)
1424hidparser:                Logical Maximum(0x7F)
1425hidparser:                Report Size(0x8)
1426hidparser:                Report Id(0x8)
1427hidparser:                Report Count(0x10)
1428hidparser:                Collection(0x2)
1429hidparser:                     Physical Minimum(0x0)
1430hidparser:                     Physical Maximum(0x1)
1431hidparser:                     Usage Page(0x1)
1432hidparser:                     Logical Minimum(0x80)
1433hidparser:                     Logical Maximum(0x7F)
1434hidparser:                     Report Size(0x8)
1435hidparser:                     Report Id(0x9)
1436hidparser:                     Report Count(0xC)
1437hidparser:                     Usage(0x3A)
1438hidparser:                     Feature(0x2)
1439hidparser:                End Collection(0x0)
1440hidparser:                Physical Minimum(0x0)
1441hidparser:                Physical Maximum(0x1)
1442hidparser:                Usage Page(0x1)
1443hidparser:                Logical Minimum(0x80)
1444hidparser:                Logical Maximum(0x7F)
1445hidparser:                Report Size(0x8)
1446hidparser:                Report Id(0x9)
1447hidparser:                Report Count(0xC)
1448hidparser:                Collection(0x2)
1449hidparser:                     Physical Minimum(0x0)
1450hidparser:                     Physical Maximum(0x1)
1451hidparser:                     Usage Page(0x1)
1452hidparser:                     Logical Minimum(0x80)
1453hidparser:                     Logical Maximum(0x7F)
1454hidparser:                     Report Size(0x8)
1455hidparser:                     Report Id(0xA)
1456hidparser:                     Report Count(0x1)
1457hidparser:                     Usage(0x3A)
1458hidparser:                     Feature(0x2)
1459hidparser:                End Collection(0x0)
1460hidparser:                Physical Minimum(0x0)
1461hidparser:                Physical Maximum(0x1)
1462hidparser:                Usage Page(0x1)
1463hidparser:                Logical Minimum(0x80)
1464hidparser:                Logical Maximum(0x7F)
1465hidparser:                Report Size(0x8)
1466hidparser:                Report Id(0xA)
1467hidparser:                Report Count(0x1)
1468hidparser:                Collection(0x2)
1469hidparser:                     Physical Minimum(0x0)
1470hidparser:                     Physical Maximum(0x1)
1471hidparser:                     Usage Page(0x1)
1472hidparser:                     Logical Minimum(0x80)
1473hidparser:                     Logical Maximum(0x7F)
1474hidparser:                     Report Size(0x8)
1475hidparser:                     Report Id(0xB)
1476hidparser:                     Report Count(0x1)
1477hidparser:                     Usage(0x3A)
1478hidparser:                     Feature(0x2)
1479hidparser:                End Collection(0x0)
1480hidparser:                Physical Minimum(0x0)
1481hidparser:                Physical Maximum(0x1)
1482hidparser:                Usage Page(0x1)
1483hidparser:                Logical Minimum(0x80)
1484hidparser:                Logical Maximum(0x7F)
1485hidparser:                Report Size(0x8)
1486hidparser:                Report Id(0xB)
1487hidparser:                Report Count(0x1)
1488hidparser:                Collection(0x2)
1489hidparser:                     Physical Minimum(0x0)
1490hidparser:                     Physical Maximum(0x1)
1491hidparser:                     Usage Page(0x1)
1492hidparser:                     Logical Minimum(0x80)
1493hidparser:                     Logical Maximum(0x7F)
1494hidparser:                     Report Size(0x8)
1495hidparser:                     Report Id(0xC)
1496hidparser:                     Report Count(0x1)
1497hidparser:                     Usage(0x3A)
1498hidparser:                     Feature(0x2)
1499hidparser:                End Collection(0x0)
1500hidparser:                Physical Minimum(0x0)
1501hidparser:                Physical Maximum(0x1)
1502hidparser:                Usage Page(0x1)
1503hidparser:                Logical Minimum(0x80)
1504hidparser:                Logical Maximum(0x7F)
1505hidparser:                Report Size(0x8)
1506hidparser:                Report Id(0xC)
1507hidparser:                Report Count(0x1)
1508hidparser:                Collection(0x2)
1509hidparser:                     Physical Minimum(0x0)
1510hidparser:                     Physical Maximum(0x1)
1511hidparser:                     Usage Page(0x1)
1512hidparser:                     Logical Minimum(0x80)
1513hidparser:                     Logical Maximum(0x7F)
1514hidparser:                     Report Size(0x8)
1515hidparser:                     Report Id(0xD)
1516hidparser:                     Report Count(0x2)
1517hidparser:                     Usage(0x3A)
1518hidparser:                     Feature(0x2)
1519hidparser:                End Collection(0x0)
1520hidparser:           End Collection(0x0)
1521hidparser:      End Collection(0x0)
1522
1523The actual tree is
1524
1525
1526unsigned char hid_report_desc[] = {
1527	0x5, 0x1,              /* Usage Page (Generic Desktop)             */
1528	0x9, 0x8,              /* Usage (0x8:Multi-axis controller)        */
1529	0xa1, 0x1,             /* Collection (Application)                 */
1530	0xa1, 0,               /*     Collection (Physical)                */
1531	0x85, 0x1,             /*         Report ID (0x1)                  */
1532	0x16, 0, 0x80,         /*         Logical Minimum (0x8000)         */
1533	0x26, 0xff, 0x7f,      /*         Logical Maximum (0x7fff)         */
1534	0x9, 0x30,             /*         Usage (0x30:X)                   */
1535	0x9, 0x31,             /*         Usage (0x31:Y)                   */
1536	0x9, 0x32,             /*         Usage (0x32:Z)                   */
1537	0x75, 0x10,            /*         Report Size (0x10)               */
1538	0x95, 0x3,             /*         Report Count (0x3)               */
1539	0x81, 0x2,             /*         Input (Data, Variable, Absolute) */
1540	0xc0,                  /*     End Collection                       */
1541	0xa1, 0,               /*     Collection (Physical)                */
1542	0x85, 0x2,             /*         Report ID (0x2)                  */
1543	0x9, 0x33,             /*         Usage (0x33:Rx)                  */
1544	0x9, 0x34,             /*         Usage (0x34:Ry)                  */
1545	0x9, 0x35,             /*         Usage (0x35:Rz)                  */
1546	0x75, 0x10,            /*         Report Size (0x10)               */
1547	0x95, 0x3,             /*         Report Count (0x3)               */
1548	0x81, 0x2,             /*         Input (Data, Variable, Absolute) */
1549	0xc0,                  /*     End Collection                       */
1550	0xa1, 0x2,             /*     Collection (Logical)                 */
1551	0x85, 0x3,             /*         Report ID (0x3)                  */
1552	0x5, 0x1,              /*         Usage Page (Generic Desktop)     */
1553	0x9, 0x3a,             /*         Usage (0x3a: Counted Buffer)     */
1554	0x75, 0x10,            /*         Report Size (0x10)               */
1555	0x95, 0x1,             /*         Report Count (0x1)               */
1556	0x81, 0x2,             /*         Input (Data, Variable, Absolute) */
1557	0x5, 0x9,              /*         Usage Page (Button)              */
1558	0x19, 0x1,             /*         Usage Minimum (0x1)              */
1559	0x29, 0xd,             /*         Usage Maximum (0xd)              */
1560	0x15, 0,               /*         Logical Minimum (0)              */
1561	0x25, 0x1,             /*         Logical Maximum (0x1)            */
1562	0x35, 0,               /*         Physical Minimum (0)             */
1563	0x45, 0x1,             /*         Physical Maximum (0x1)           */
1564	0x75, 0x1,             /*         Report Size (0x1)                */
1565	0x95, 0xd,             /*         Report Count (0xd)               */
1566	0x81, 0x2,             /*         Input (Data, Variable, Absolute) */
1567	0x95, 0x3,             /*         Report Count (0x3)               */
1568	0x81, 0x1,             /*         Input (Constant, Array, Absolute) */
1569	0xc0,                  /*     End Collection                       */
1570	0x5, 0x1,              /*     Usage Page (Generic Desktop)         */
1571	0x9, 0x3a,             /*     Usage (0x3a: Counted Buffer)         */
1572	0xa1, 0x2,             /*     Collection (Logical)                 */
1573	0x15, 0x80,            /*         Logical Minimum (0x80)           */
1574	0x25, 0x7f,            /*         Logical Maximum (0x7f)           */
1575	0x75, 0x8,             /*         Report Size (0x8)                */
1576	0x9, 0x3a,             /*         Usage (0x3a: Counted Buffer)     */
1577	0xa1, 0x2,             /*         Collection (Logical)             */
1578	0x85, 0x4,             /*             Report ID (0x4)              */
1579	0x9, 0x3a,             /*             Usage (0x3a: Counted Buffer) */
1580	0x95, 0x4,             /*             Report Count (0x4)           */
1581	0xb1, 0x2,             /*             Feature (Data, Variable, Absolute) */
1582	0xc0,                  /*         End Collection                   */
1583	0xa1, 0x2,             /*         Collection (Logical)             */
1584	0x85, 0x5,             /*             Report ID (0x5)              */
1585	0x9, 0x3a,             /*             Usage (0x3a:Counted Buffer)  */
1586	0x95, 0x1,             /*             Report Count (0x1)           */
1587	0xb1, 0x2,             /*             Feature (Data, Variable, Absolute) */
1588	0xc0,                  /*         End Collection                   */
1589	0xa1, 0x2,             /*         Collection (Logical)             */
1590	0x85, 0x6,             /*             Report ID (0x6)              */
1591	0x9, 0x3a,             /*             Usage (0x3a: Counted Buffer) */
1592	0x95, 0x1,             /*             Report Count (0x1)           */
1593	0xb1, 0x2,             /*             Feature (Data, Variable, Absolute) */
1594	0xc0,                  /*         End Collection                   */
1595	0xa1, 0x2,             /*         Collection (Logical)             */
1596	0x85, 0x7,             /*             Report ID (0x7)              */
1597	0x9, 0x3a,             /*             Usage (0x3a: Counted Buffer) */
1598	0x95, 0x10,            /*             Report Count (0x10)          */
1599	0xb1, 0x2,             /*             Feature (Data, Variable, Absolute) */
1600	0xc0,                  /*         End Collection                   */
1601	0xa1, 0x2,             /*         Collection (Logical)             */
1602	0x85, 0x8,             /*             Report ID (0x8)              */
1603	0x9, 0x3a,             /*             Usage (0x3a: Counted Buffer) */
1604	0x95, 0x10,            /*             Report Count (0x10)          */
1605	0xb1, 0x2,             /*             Feature (Data, Variable, Absolute) */
1606	0xc0,                  /*         End Collection                   */
1607	0xa1, 0x2,             /*         Collection (Logical)             */
1608	0x85, 0x9,             /*             Report ID (0x9)              */
1609	0x9, 0x3a,             /*             Usage (0x3a: Counted Buffer) */
1610	0x95, 0xc,             /*             Report Count (0xc)           */
1611	0xb1, 0x2,             /*             Feature (Data, Variable, Absolute) */
1612	0xc0,                  /*         End Collection                   */
1613	0xa1, 0x2,             /*         Collection (Logical)             */
1614	0x85, 0xa,             /*             Report ID (0xa)              */
1615	0x9, 0x3a,             /*             Usage (0x3a: Counted Buffer) */
1616	0x95, 0x1,             /*             Report Count (0x1)           */
1617	0xb1, 0x2,             /*             Feature (Data, Variable, Absolute) */
1618	0xc0,                  /*         End Collection                   */
1619	0xa1, 0x2,             /*         Collection (Logical)             */
1620	0x85, 0xb,             /*             Report ID (0xb)              */
1621	0x9, 0x3a,             /*             Usage (0x3a: Counted Buffer) */
1622	0x95, 0x1,             /*             Report Count (0x1)           */
1623	0xb1, 0x2,             /*             Feature (Data, Variable, Absolute) */
1624	0xc0,                  /*         End Collection                   */
1625	0xa1, 0x2,             /*         Collection (Logical)             */
1626	0x85, 0xc,             /*             Report ID (0xc)              */
1627	0x9, 0x3a,             /*             Usage (0x3a: Counted Buffer) */
1628	0x95, 0x1,             /*             Report Count (0x1)           */
1629	0xb1, 0x2,             /*             Feature (Data, Variable, Absolute) */
1630	0xc0,                  /*         End Collection                   */
1631	0xa1, 0x2,             /*         Collection (Logical)             */
1632	0x85, 0xd,             /*             Report ID (0xd)              */
1633	0x9, 0x3a,             /*             Usage (0x3a: Counted Buffer) */
1634	0x95, 0x2,             /*             Report Count (0x2)           */
1635	0xb1, 0x2,             /*             Feature (Data, Variable, Absolute) */
1636	0xc0,                  /*         End Collection                   */
1637	0xc0,                  /*     End Collection                       */
1638	0xc0,                  /* End Collection                           */
1639};
1640
1641______________________________________________________________________________
1642