@@ -314,15 +314,6 @@ struct hid_item {
314314#define HID_BAT_ABSOLUTESTATEOFCHARGE 0x00850065
315315
316316#define HID_VD_ASUS_CUSTOM_MEDIA_KEYS 0xff310076
317- /*
318- * HID report types --- Ouch! HID spec says 1 2 3!
319- */
320-
321- #define HID_INPUT_REPORT 0
322- #define HID_OUTPUT_REPORT 1
323- #define HID_FEATURE_REPORT 2
324-
325- #define HID_REPORT_TYPES 3
326317
327318/*
328319 * HID connect requests
@@ -509,7 +500,7 @@ struct hid_report {
509500 struct list_head hidinput_list ;
510501 struct list_head field_entry_list ; /* ordered list of input fields */
511502 unsigned int id ; /* id of this report */
512- unsigned int type ; /* report type */
503+ enum hid_report_type type ; /* report type */
513504 unsigned int application ; /* application usage for this report */
514505 struct hid_field * field [HID_MAX_FIELDS ]; /* fields of the report */
515506 struct hid_field_entry * field_entries ; /* allocated memory of input field_entry */
@@ -658,6 +649,8 @@ struct hid_device { /* device report descriptor */
658649 struct list_head debug_list ;
659650 spinlock_t debug_list_lock ;
660651 wait_queue_head_t debug_wait ;
652+
653+ unsigned int id ; /* system unique id */
661654};
662655
663656#define to_hid_device (pdev ) \
@@ -924,20 +917,21 @@ extern int hidinput_connect(struct hid_device *hid, unsigned int force);
924917extern void hidinput_disconnect (struct hid_device * );
925918
926919int hid_set_field (struct hid_field * , unsigned , __s32 );
927- int hid_input_report (struct hid_device * , int type , u8 * , u32 , int );
920+ int hid_input_report (struct hid_device * hid , enum hid_report_type type , u8 * data , u32 size ,
921+ int interrupt );
928922struct hid_field * hidinput_get_led_field (struct hid_device * hid );
929923unsigned int hidinput_count_leds (struct hid_device * hid );
930924__s32 hidinput_calc_abs_res (const struct hid_field * field , __u16 code );
931925void hid_output_report (struct hid_report * report , __u8 * data );
932- int __hid_request (struct hid_device * hid , struct hid_report * rep , int reqtype );
926+ int __hid_request (struct hid_device * hid , struct hid_report * rep , enum hid_class_request reqtype );
933927u8 * hid_alloc_report_buf (struct hid_report * report , gfp_t flags );
934928struct hid_device * hid_allocate_device (void );
935929struct hid_report * hid_register_report (struct hid_device * device ,
936- unsigned int type , unsigned int id ,
930+ enum hid_report_type type , unsigned int id ,
937931 unsigned int application );
938932int hid_parse_report (struct hid_device * hid , __u8 * start , unsigned size );
939933struct hid_report * hid_validate_values (struct hid_device * hid ,
940- unsigned int type , unsigned int id ,
934+ enum hid_report_type type , unsigned int id ,
941935 unsigned int field_index ,
942936 unsigned int report_counts );
943937
@@ -1106,10 +1100,11 @@ void hid_hw_stop(struct hid_device *hdev);
11061100int __must_check hid_hw_open (struct hid_device * hdev );
11071101void hid_hw_close (struct hid_device * hdev );
11081102void hid_hw_request (struct hid_device * hdev ,
1109- struct hid_report * report , int reqtype );
1103+ struct hid_report * report , enum hid_class_request reqtype );
11101104int hid_hw_raw_request (struct hid_device * hdev ,
11111105 unsigned char reportnum , __u8 * buf ,
1112- size_t len , unsigned char rtype , int reqtype );
1106+ size_t len , enum hid_report_type rtype ,
1107+ enum hid_class_request reqtype );
11131108int hid_hw_output_report (struct hid_device * hdev , __u8 * buf , size_t len );
11141109
11151110/**
@@ -1137,7 +1132,7 @@ static inline int hid_hw_power(struct hid_device *hdev, int level)
11371132 * @reqtype: hid request type
11381133 */
11391134static inline int hid_hw_idle (struct hid_device * hdev , int report , int idle ,
1140- int reqtype )
1135+ enum hid_class_request reqtype )
11411136{
11421137 if (hdev -> ll_driver -> idle )
11431138 return hdev -> ll_driver -> idle (hdev , report , idle , reqtype );
@@ -1182,8 +1177,8 @@ static inline u32 hid_report_len(struct hid_report *report)
11821177 return DIV_ROUND_UP (report -> size , 8 ) + (report -> id > 0 );
11831178}
11841179
1185- int hid_report_raw_event (struct hid_device * hid , int type , u8 * data , u32 size ,
1186- int interrupt );
1180+ int hid_report_raw_event (struct hid_device * hid , enum hid_report_type type , u8 * data , u32 size ,
1181+ int interrupt );
11871182
11881183/* HID quirks API */
11891184unsigned long hid_lookup_quirk (const struct hid_device * hdev );
0 commit comments