6 #define L2CAP_PSM_HIDP_CTRL 0x11
7 #define L2CAP_PSM_HIDP_INTR 0x13
9 /* HIDP header masks */
10 #define HIDP_HEADER_TRANS_MASK 0xf0
11 #define HIDP_HEADER_PARAM_MASK 0x0f
13 /* HIDP transaction types */
14 #define HIDP_TRANS_HANDSHAKE 0x00
15 #define HIDP_TRANS_HID_CONTROL 0x10
16 #define HIDP_TRANS_GET_REPORT 0x40
17 #define HIDP_TRANS_SET_REPORT 0x50
18 #define HIDP_TRANS_GET_PROTOCOL 0x60
19 #define HIDP_TRANS_SET_PROTOCOL 0x70
20 #define HIDP_TRANS_GET_IDLE 0x80
21 #define HIDP_TRANS_SET_IDLE 0x90
22 #define HIDP_TRANS_DATA 0xa0
23 #define HIDP_TRANS_DATC 0xb0
25 /* HIDP handshake results */
26 #define HIDP_HSHK_SUCCESSFUL 0x00
27 #define HIDP_HSHK_NOT_READY 0x01
28 #define HIDP_HSHK_ERR_INVALID_REPORT_ID 0x02
29 #define HIDP_HSHK_ERR_UNSUPPORTED_REQUEST 0x03
30 #define HIDP_HSHK_ERR_INVALID_PARAMETER 0x04
31 #define HIDP_HSHK_ERR_UNKNOWN 0x0e
32 #define HIDP_HSHK_ERR_FATAL 0x0f
34 /* HIDP control operation parameters */
35 #define HIDP_CTRL_NOP 0x00
36 #define HIDP_CTRL_HARD_RESET 0x01
37 #define HIDP_CTRL_SOFT_RESET 0x02
38 #define HIDP_CTRL_SUSPEND 0x03
39 #define HIDP_CTRL_EXIT_SUSPEND 0x04
40 #define HIDP_CTRL_VIRTUAL_CABLE_UNPLUG 0x05
42 /* HIDP data transaction headers */
43 #define HIDP_DATA_RTYPE_MASK 0x03
44 #define HIDP_DATA_RSRVD_MASK 0x0c
45 #define HIDP_DATA_RTYPE_OTHER 0x00
46 #define HIDP_DATA_RTYPE_INPUT 0x01
47 #define HIDP_DATA_RTYPE_OUPUT 0x02
48 #define HIDP_DATA_RTYPE_FEATURE 0x03
50 /* HIDP protocol header parameters */
51 #define HIDP_PROTO_BOOT 0x00
52 #define HIDP_PROTO_REPORT 0x01
55 static const unsigned char keycode2hidp[256] = {
56 0,41,30,31,32,33,34,35,36,37,38,39,45,46,42,43,20,
57 26,8,21,23,28,24,12,18,19,47,48,40,224,4,22,7,
58 9,10,11,13,14,15,51,52,53,225,49,29,27,6,25,5,
59 17,16,54,55,56,229,85,226,44,57,58,59,60,61,62,63,
60 64,65,66,67,83,71,95,96,97,86,92,93,94,87,89,90,
61 91,98,99,0,148,100,68,69,135,146,147,138,136,139,140,88,
62 228,84,70,230,0,74,82,75,80,79,77,81,78,73,76,
63 0,127,129,128,102,103,0,72,0,133,144,145,137,227,231,101,120,
64 121,118,122,119,124,116,125,126,123,117,0,251,0,248,0,
65 0,0,0,0,0,0,240,0,249,0,0,0,0,0,241,242,
66 0,236,0,235,232,234,233,0,0,0,0,0,0,250,0,0,247,
67 245,246,0,0,0,0,104,105,106,107,108,109,110,111,112,113,
68 114,115,0,0,0,0,0,0,0,0,0,0,0,0,0,
69 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
70 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
71 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
74 static const unsigned char hidp2keycode[256] = {
75 0, 0, 0, 0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38,
76 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44, 2, 3,
77 4, 5, 6, 7, 8, 9, 10, 11, 28, 1, 14, 15, 57, 12, 13, 26,
78 27, 43, 43, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64,
79 65, 66, 67, 68, 87, 88, 99, 70,119,110,102,104,111,107,109,106,
80 105,108,103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75, 76, 77, 71,
81 72, 73, 82, 83, 86,127,116,117,183,184,185,186,187,188,189,190,
82 191,192,193,194,134,138,130,132,128,129,131,137,133,135,136,113,
83 115,114, 0, 0, 0,121, 0, 89, 93,124, 92, 94, 95, 0, 0, 0,
84 122,123, 90, 91, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
85 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
86 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
87 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
88 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
89 29, 42, 56,125, 97, 54,100,126,164,166,165,163,161,115,114,113,
90 150,158,159,128,136,177,178,176,142,152,173,140