/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_USB_HIDPARSER_IMPL_H
#define _SYS_USB_HIDPARSER_IMPL_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* This header file is only included by the hidparser. It contains
* implementation specifc information for the hidparser.
*/
/*
* This is for Global and Local items like Usage Page,
* Usage Min, Logical Min, Report Count, Report Size etc.
* "value" was declared as char array to handle
* the case of extended items which can be up to
* 255 bytes.
*/
typedef struct entity_attribute {
/* linked list of attributes */
/*
* This is for these entities: Collection, Input, Output,
* Feature and End Collection.
*/
typedef struct entity_item {
/* input, output, collection, feature or end collection */
int entity_item_type;
/* constant, variable, relative, etc... */
char *entity_item_params;
/*
* linked list of entity and control attributes. Parser is
* responsbile for handling entity attributes' inheritance,
* therefore this is NULL for end collection. But not for
* begin collection.
*/
/*
* linked list of children if this is a collection
*/
union info {
void *data;
} info;
/* pointer to the right sibling */
/* Use this typedef in defining the FIRSTs */
typedef int hidparser_terminal_t;
/*
* Hid parser handle
*/
typedef struct hidparser_handle_impl {
/* Pointer to the parser tree */
/* Pointer to the hid descriptor */
/*
* Additional items that are not defined in hid_parser.h because they should
* not be exposed to the hid streams modules.
*/
/*
* Additional Local Items
* See section 6.2.2.8 of the HID 1.0 specification for
* more details.
*/
/*
* Addtional Global Items
* See section 6.2.2.7 of the HID 1.0 specifations for
* more details.
*/
/*
* Main Items
* See section 6.2.2.5 of the HID 1.0 specification for
* more details.
*/
typedef struct entity_attribute_stack {
/*
* This structure is the interface between the parser
* and the scanner.
*/
typedef struct hidparser_tok {
/* Maximum buffer size */
/* Raw descriptor */
unsigned char *hidparser_tok_entity_descriptor;
/* Index to token currently being processed */
/* Current token being processed */
int hidparser_tok_token;
/* Pointer to the Global Item list */
/* Pointer to the Local Item list */
/* Stack for push|pop Items */
/* Entity Item Tags - HID 5.4.3 */
/* Entity Attribute Item Tags HID 5.4.4 */
/* Control Attribute Item Tags */
/* Tags used to find the FIRST tokens corresponding to a nonterminal */
#define HIDPARSER_ITEMS 0
/* Used for hidparser Error check */
/* other */
/*
* Debug printing
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_USB_HIDPARSER_IMPL_H */