#ifndef _SYS_USB_USB_AH_H
#define _SYS_USB_USB_AH_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/stream.h>
#define USB_AH_RPT_NUMBER 3
#define USB_AH_INPUT_RPT 0
#define USB_AH_OUTPUT_RPT 1
#define USB_AH_FEATURE_RPT 2
#define USB_AH_OPEN 0x00000001
#define USB_AH_QWAIT 0x00000002
typedef struct usb_ah_button_descr {
uint_t location;
uint_t offset;
uint_t no_of_bits;
uint_t pressed;
mblk_t *mblk;
void *uahp;
} usb_ah_button_descr_t;
typedef struct usb_ah_rpt {
hidparser_rpt_t hid_rpt;
usb_ah_button_descr_t button_descr[USAGE_MAX];
} usb_ah_rpt_t;
typedef struct usb_ah_state {
queue_t *usb_ah_readq;
queue_t *usb_ah_writeq;
kmutex_t usb_ah_mutex;
int usb_ah_flags;
uint_t usb_ah_packet_size;
int usb_ah_uses_report_ids;
int usb_ah_report_id;
timeout_id_t usb_ah_tid;
usb_ah_button_descr_t *usb_ah_cur_bd;
hidparser_handle_t usb_ah_report_descr;
usb_ah_rpt_t usb_ah_report[USB_AH_RPT_NUMBER];
} usb_ah_state_t;
_NOTE(MUTEX_PROTECTS_DATA(usb_ah_state_t::usb_ah_mutex, usb_ah_state_t))
_NOTE(SCHEME_PROTECTS_DATA("unique per call", usb_ah_state_t::usb_ah_readq))
_NOTE(SCHEME_PROTECTS_DATA("unique per call", usb_ah_state_t::usb_ah_flags))
_NOTE(SCHEME_PROTECTS_DATA("unique per call", usb_ah_state_t::usb_ah_tid))
_NOTE(SCHEME_PROTECTS_DATA("unique per call", usb_ah_state_t::usb_ah_writeq))
_NOTE(SCHEME_PROTECTS_DATA("unique per call",
usb_ah_state_t::usb_ah_packet_size))
_NOTE(SCHEME_PROTECTS_DATA("unique per call",
usb_ah_state_t::usb_ah_uses_report_ids))
_NOTE(SCHEME_PROTECTS_DATA("unique per call",
usb_ah_state_t::usb_ah_report_id))
_NOTE(SCHEME_PROTECTS_DATA("unique per call",
usb_ah_state_t::usb_ah_report_descr))
_NOTE(SCHEME_PROTECTS_DATA("unique per call",
usb_ah_state_t::usb_ah_cur_bd))
_NOTE(SCHEME_PROTECTS_DATA("unique per call",
usb_ah_state_t::usb_ah_report))
_NOTE(SCHEME_PROTECTS_DATA("unique per call", usb_ah_button_descr_t))
_NOTE(SCHEME_PROTECTS_DATA("unique per call", usb_ah_rpt_t))
_NOTE(SCHEME_PROTECTS_DATA("unique per call", hidparser_rpt_t))
_NOTE(SCHEME_PROTECTS_DATA("unique per call", hidparser_usage_info_t))
#define USB_AH_TIMEOUT 50000
#ifdef __cplusplus
}
#endif
#endif