Changeset a35b458 in mainline for uspace/drv/hid/usbhid
- Timestamp:
- 2018-03-02T20:10:49Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- Location:
- uspace/drv/hid/usbhid
- Files:
-
- 6 edited
-
blink1/blink1.c (modified) (9 diffs)
-
blink1/blink1.h (modified) (1 diff)
-
kbd/kbddev.h (modified) (3 diffs)
-
mouse/mousedev.h (modified) (1 diff)
-
multimedia/keymap.c (modified) (1 diff)
-
subdrivers.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/hid/usbhid/blink1/blink1.c
r3061bc1 ra35b458 67 67 return EINVAL; 68 68 } 69 69 70 70 blink1_report_t report; 71 71 72 72 report.id = BLINK1_REPORT_ID; 73 73 report.command = BLINK1_COMMAND_SET; … … 78 78 report.arg4 = 0; 79 79 report.arg5 = 0; 80 80 81 81 return usbhid_req_set_report( 82 82 usb_device_get_default_pipe(blink1_dev->hid_dev->usb_dev), … … 100 100 return EINVAL; 101 101 } 102 102 103 103 /* Create the exposed function. */ 104 104 ddf_fun_t *fun = usb_device_ddf_fun_create(hid_dev->usb_dev, … … 109 109 return ENOMEM; 110 110 } 111 111 112 112 usb_blink1_t *blink1_dev = (usb_blink1_t *) 113 113 ddf_fun_data_alloc(fun, sizeof(usb_blink1_t)); … … 118 118 return ENOMEM; 119 119 } 120 120 121 121 ddf_fun_set_ops(fun, &blink1_ops); 122 122 123 123 errno_t rc = ddf_fun_bind(fun); 124 124 if (rc != EOK) { … … 128 128 return rc; 129 129 } 130 130 131 131 rc = ddf_fun_add_to_category(fun, HID_BLINK1_CATEGORY); 132 132 if (rc != EOK) { 133 133 usb_log_error("Could not add DDF function to category %s: %s.", 134 134 HID_BLINK1_CATEGORY, str_error(rc)); 135 135 136 136 rc = ddf_fun_unbind(fun); 137 137 if (rc != EOK) { … … 140 140 return rc; 141 141 } 142 142 143 143 ddf_fun_destroy(fun); 144 144 return rc; 145 145 } 146 146 147 147 blink1_dev->fun = fun; 148 148 blink1_dev->hid_dev = hid_dev; 149 149 *data = blink1_dev; 150 150 151 151 return EOK; 152 152 } … … 156 156 if (data == NULL) 157 157 return; 158 158 159 159 usb_blink1_t *blink1_dev = (usb_blink1_t *) data; 160 160 161 161 errno_t rc = ddf_fun_unbind(blink1_dev->fun); 162 162 if (rc != EOK) { … … 165 165 return; 166 166 } 167 167 168 168 ddf_fun_destroy(blink1_dev->fun); 169 169 } -
uspace/drv/hid/usbhid/blink1/blink1.h
r3061bc1 ra35b458 44 44 /** DDF blink(1) function */ 45 45 ddf_fun_t *fun; 46 46 47 47 /** USB HID device */ 48 48 usb_hid_dev_t *hid_dev; -
uspace/drv/hid/usbhid/kbd/kbddev.h
r3061bc1 ra35b458 63 63 /** Link to HID device structure */ 64 64 usb_hid_dev_t *hid_dev; 65 65 66 66 /** Previously pressed keys (not translated to key codes). */ 67 67 int32_t *keys_old; … … 72 72 /** Currently pressed modifiers (bitmap). */ 73 73 uint8_t modifiers; 74 74 75 75 /** Currently active modifiers including locks. Sent to the console. */ 76 76 unsigned int mods; 77 77 78 78 /** Currently active lock keys. */ 79 79 unsigned int lock_keys; 80 80 81 81 /** IPC session to client (for sending key events). */ 82 82 async_sess_t *client_sess; 83 83 84 84 /** Information for auto-repeat of keys. */ 85 85 usb_kbd_repeat_t repeat; 86 86 87 87 /** Mutex for accessing the information about auto-repeat. */ 88 88 fibril_mutex_t repeat_mtx; 89 89 90 90 uint8_t *output_buffer; 91 91 92 92 size_t output_size; 93 93 94 94 size_t led_output_size; 95 95 96 96 usb_hid_report_path_t *led_path; 97 97 98 98 int32_t *led_data; 99 99 100 100 /** State of the structure (for checking before use). 101 101 * … … 105 105 */ 106 106 int initialized; 107 107 108 108 /** DDF function */ 109 109 ddf_fun_t *fun; -
uspace/drv/hid/usbhid/mouse/mousedev.h
r3061bc1 ra35b458 45 45 /** IPC session to consumer. */ 46 46 async_sess_t *mouse_sess; 47 47 48 48 /** Mouse buttons statuses. */ 49 49 int32_t *buttons; 50 50 size_t buttons_count; 51 51 52 52 /** DDF mouse function */ 53 53 ddf_fun_t *mouse_fun; -
uspace/drv/hid/usbhid/multimedia/keymap.c
r3061bc1 ra35b458 86 86 /*! @todo What if the usage is not in the table? */ 87 87 key = map[usage]; 88 88 89 89 return key; 90 90 } -
uspace/drv/hid/usbhid/subdrivers.h
r3061bc1 ra35b458 61 61 */ 62 62 const usb_hid_subdriver_usage_t *usage_path; 63 63 64 64 /** Report ID for which the path should apply. */ 65 65 int report_id; 66 66 67 67 /** Compare type for the usage path. */ 68 68 int compare; 69 69 70 70 /** Vendor ID (set to -1 if not specified). */ 71 71 int vendor_id; 72 72 73 73 /** Product ID (set to -1 if not specified). */ 74 74 int product_id; 75 75 76 76 /** Subdriver for controlling this device. */ 77 77 const usb_hid_subdriver_t subdriver;
Note:
See TracChangeset
for help on using the changeset viewer.
