最終更新:2014-05-08 (木) 12:59:58 (3640d)  

hid_device
Top / hid_device

http://lxr.onakasuita.org/source/include/linux/hid.h#L446

定義

  • struct hid_device {                                                     /* device report descriptor */
            __u8 *dev_rdesc;
            unsigned dev_rsize;
            __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 */
            __u16 bus;                                                      /* BUS ID */
            __u16 group;                                                    /* Report group */
            __u32 vendor;                                                   /* Vendor ID */
            __u32 product;                                                  /* Product ID */
            __u32 version;                                                  /* HID version */
            enum hid_type type;                                             /* device type (mouse, kbd, ...) */
            unsigned country;                                               /* HID country */
            struct hid_report_enum report_enum[HID_REPORT_TYPES];
            struct work_struct led_work;                                    /* delayed LED worker */
    
            struct semaphore driver_lock;                                   /* protects the current driver, except during input */
            struct semaphore driver_input_lock;                             /* protects the current driver */
            struct device dev;                                              /* device */
            struct hid_driver *driver;
            struct hid_ll_driver *ll_driver;
    
    #ifdef CONFIG_HID_BATTERY_STRENGTH
            /*
             * Power supply information for HID devices which report
             * battery strength. power_supply is registered iff
             * battery.name is non-NULL.
             */
            struct power_supply battery;
            __s32 battery_min;
            __s32 battery_max;
            __s32 battery_report_type;
            __s32 battery_report_id;
    #endif
    
            unsigned int status;                                            /* see STAT flags above */
            unsigned claimed;                                               /* Claimed by hidinput, hiddev? */
            unsigned quirks;                                                /* Various quirks the device can pull on us */
            bool io_started;                                                /* Protected by driver_lock. If IO has started */
    
            struct list_head inputs;                                        /* The list of inputs */
            void *hiddev;                                                   /* The hiddev structure */
            void *hidraw;
            int minor;                                                      /* Hiddev minor number */
    
            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;
    
            /* temporary hid_ff handling (until moved to the drivers) */
            int (*ff_init)(struct hid_device *);
    
            /* hiddev event handler */
            int (*hiddev_connect)(struct hid_device *, unsigned int);
            void (*hiddev_disconnect)(struct hid_device *);
            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 *);
    
            /* handler for raw input (Get_Report) data, used by hidraw */
            int (*hid_get_raw_report) (struct hid_device *, unsigned char, __u8 *, size_t, unsigned char);
    
            /* handler for raw output data, used by hidraw */
            int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t, unsigned char);
    
            /* debugging support via debugfs */
            unsigned short debug;
            struct dentry *debug_dir;
            struct dentry *debug_rdesc;
            struct dentry *debug_events;
            struct list_head debug_list;
            spinlock_t  debug_list_lock;
            wait_queue_head_t debug_wait;
    };

関連