⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hid.h

📁 Axis 221 camera embedded programing interface
💻 H
📖 第 1 页 / 共 2 页
字号:
#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD        0x00008000#define HID_QUIRK_BAD_RELATIVE_KEYS		0x00010000/* * This is the global environment of the parser. This information is * persistent for main-items. The global environment can be saved and * restored with PUSH/POP statements. */struct hid_global {	unsigned usage_page;	__s32    logical_minimum;	__s32    logical_maximum;	__s32    physical_minimum;	__s32    physical_maximum;	__s32    unit_exponent;	unsigned unit;	unsigned report_id;	unsigned report_size;	unsigned report_count;};/* * This is the local environment. It is persistent up the next main-item. */#define HID_MAX_DESCRIPTOR_SIZE		4096#define HID_MAX_USAGES			1024#define HID_DEFAULT_NUM_COLLECTIONS	16struct hid_local {	unsigned usage[HID_MAX_USAGES]; /* usage array */	unsigned collection_index[HID_MAX_USAGES]; /* collection index array */	unsigned usage_index;	unsigned usage_minimum;	unsigned delimiter_depth;	unsigned delimiter_branch;};/* * This is the collection stack. We climb up the stack to determine * application and function of each field. */struct hid_collection {	unsigned type;	unsigned usage;	unsigned level;};struct hid_usage {	unsigned  hid;			/* hid usage code */	unsigned  collection_index;	/* index into collection array */	/* hidinput data */	__u16     code;			/* input driver code */	__u8      type;			/* input driver type */	__s8	  hat_min;		/* hat switch fun */	__s8	  hat_max;		/* ditto */	__s8	  hat_dir;		/* ditto */};struct hid_input;struct hid_field {	unsigned  physical;		/* physical usage for this field */	unsigned  logical;		/* logical usage for this field */	unsigned  application;		/* application usage for this field */	struct hid_usage *usage;	/* usage table for this function */	unsigned  maxusage;		/* maximum usage index */	unsigned  flags;		/* main-item flags (i.e. volatile,array,constant) */	unsigned  report_offset;	/* bit offset in the report */	unsigned  report_size;		/* size of this field in the report */	unsigned  report_count;		/* number of this field in the report */	unsigned  report_type;		/* (input,output,feature) */	__s32    *value;		/* last known value(s) */	__s32     logical_minimum;	__s32     logical_maximum;	__s32     physical_minimum;	__s32     physical_maximum;	__s32     unit_exponent;	unsigned  unit;	struct hid_report *report;	/* associated report */	unsigned index;			/* index into report->field[] */	/* hidinput data */	struct hid_input *hidinput;	/* associated input structure */	__u16 dpad;			/* dpad input code */};#define HID_MAX_FIELDS 64struct hid_report {	struct list_head list;	unsigned id;					/* id of this report */	unsigned type;					/* report type */	struct hid_field *field[HID_MAX_FIELDS];	/* fields of the report */	unsigned maxfield;				/* maximum valid field index */	unsigned size;					/* size of the report (bits) */	struct hid_device *device;			/* associated device */};struct hid_report_enum {	unsigned numbered;	struct list_head report_list;	struct hid_report *report_id_hash[256];};#define HID_REPORT_TYPES 3#define HID_MIN_BUFFER_SIZE	64		/* make sure there is at least a packet size of space */#define HID_MAX_BUFFER_SIZE	4096		/* 4kb */#define HID_CONTROL_FIFO_SIZE	256		/* to init devices with >100 reports */#define HID_OUTPUT_FIFO_SIZE	64struct hid_control_fifo {	unsigned char dir;	struct hid_report *report;};#define HID_CLAIMED_INPUT	1#define HID_CLAIMED_HIDDEV	2#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		6struct hid_input {	struct list_head list;	struct hid_report *report;	struct input_dev *input;};struct hid_device {							/* device report descriptor */	 __u8 *rdesc;	unsigned rsize;	struct hid_collection *collection;				/* List of HID collections */	unsigned collection_size;					/* Number of allocated hid_collections */	unsigned maxcollection;						/* Number of parsed collections */	unsigned maxapplication;					/* Number of applications */	unsigned short bus;                                             /* BUS ID */	unsigned short vendor;                                          /* Vendor ID */	unsigned short product;                                         /* Product ID */	unsigned version;						/* HID version */	unsigned country;						/* HID country */	struct hid_report_enum report_enum[HID_REPORT_TYPES];	struct device *dev;						/* device */	unsigned claimed;						/* Claimed by hidinput, hiddev? */	unsigned quirks;						/* Various quirks the device can pull on us */	struct list_head inputs;					/* The list of inputs */	void *hiddev;							/* The hiddev structure */	int minor;							/* Hiddev minor number */	wait_queue_head_t wait;						/* For sleeping */	int open;							/* is the device open by anyone? */	char name[128];							/* Device name */	char phys[64];							/* Device physical location */	char uniq[64];							/* Device unique identifier (serial #) */	void *driver_data;	/* device-specific function pointers */	int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int);	int (*hidinput_open) (struct input_dev *);	void (*hidinput_close) (struct input_dev *);	/* hiddev event handler */	void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,				  struct hid_usage *, __s32);	void (*hiddev_report_event) (struct hid_device *, struct hid_report *);#ifdef CONFIG_USB_HIDINPUT_POWERBOOK	unsigned long pb_pressed_fn[NBITS(KEY_MAX)];	unsigned long pb_pressed_numlock[NBITS(KEY_MAX)];#endif};#define HID_GLOBAL_STACK_SIZE 4#define HID_COLLECTION_STACK_SIZE 4struct hid_parser {	struct hid_global     global;	struct hid_global     global_stack[HID_GLOBAL_STACK_SIZE];	unsigned              global_stack_ptr;	struct hid_local      local;	unsigned              collection_stack[HID_COLLECTION_STACK_SIZE];	unsigned              collection_stack_ptr;	struct hid_device    *device;};struct hid_class_descriptor {	__u8  bDescriptorType;	__u16 wDescriptorLength;} __attribute__ ((packed));struct hid_descriptor {	__u8  bLength;	__u8  bDescriptorType;	__u16 bcdHID;	__u8  bCountryCode;	__u8  bNumDescriptors;	struct hid_class_descriptor desc[1];} __attribute__ ((packed));#ifdef DEBUG#include "hid-debug.h"#else#define hid_dump_input(a,b)	do { } while (0)#define hid_dump_device(c)	do { } while (0)#define hid_dump_field(a,b)	do { } while (0)#define resolv_usage(a)		do { } while (0)#define resolv_event(a,b)	do { } while (0)#endif/* Applications from HID Usage Tables 4/8/99 Version 1.1 *//* We ignore a few input applications that are not widely used */#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001))/* HID core API */extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);extern int hidinput_connect(struct hid_device *);extern void hidinput_disconnect(struct hid_device *);int hid_set_field(struct hid_field *, unsigned, __s32);int hid_input_report(struct hid_device *, int type, u8 *, int, int);int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt);void hid_output_report(struct hid_report *report, __u8 *data);void hid_free_device(struct hid_device *device);struct hid_device *hid_parse_report(__u8 *start, unsigned size);#ifdef CONFIG_HID_FFint hid_ff_init(struct hid_device *hid);int hid_lgff_init(struct hid_device *hid);int hid_tmff_init(struct hid_device *hid);int hid_zpff_init(struct hid_device *hid);#ifdef CONFIG_HID_PIDint hid_pidff_init(struct hid_device *hid);#elsestatic inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; }#endif#elsestatic inline int hid_ff_init(struct hid_device *hid) { return -1; }#endif#ifdef DEBUG#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \		__FILE__ , ## arg)#else#define dbg(format, arg...) do {} while (0)#endif#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \		__FILE__ , ## arg)#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -