#ifndef __USBHID_H
#define __USBHID_H
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/timer.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
#include <linux/input.h>
void usbhid_init_reports(struct hid_device *hid);
struct usb_interface *usbhid_find_interface(int minor);
#define HID_CTRL_RUNNING 1
#define HID_OUT_RUNNING 2
#define HID_IN_RUNNING 3
#define HID_RESET_PENDING 4
#define HID_SUSPENDED 5
#define HID_CLEAR_HALT 6
#define HID_DISCONNECTED 7
#define HID_STARTED 8
#define HID_KEYS_PRESSED 10
#define HID_NO_BANDWIDTH 11
#define HID_RESUME_RUNNING 12
#define HID_OPENED 13
#define HID_IN_POLLING 14
struct usbhid_device {
struct hid_device *hid;
struct usb_interface *intf;
int ifnum;
unsigned int bufsize;
struct urb *urbin;
char *inbuf;
dma_addr_t inbuf_dma;
struct urb *urbctrl;
struct usb_ctrlrequest *cr;
struct hid_control_fifo ctrl[HID_CONTROL_FIFO_SIZE];
unsigned char ctrlhead, ctrltail;
char *ctrlbuf;
dma_addr_t ctrlbuf_dma;
unsigned long last_ctrl;
struct urb *urbout;
struct hid_output_fifo out[HID_CONTROL_FIFO_SIZE];
unsigned char outhead, outtail;
char *outbuf;
dma_addr_t outbuf_dma;
unsigned long last_out;
struct mutex mutex;
spinlock_t lock;
unsigned long iofl;
struct timer_list io_retry;
unsigned long stop_retry;
unsigned int retry_delay;
struct work_struct reset_work;
wait_queue_head_t wait;
};
#define hid_to_usb_dev(hid_dev) \
to_usb_device(hid_dev->dev.parent->parent)
#endif