Changeset cc29622 in mainline for uspace/drv/bus/usb/usbhid/main.c
- Timestamp:
- 2011-10-14T12:40:31Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e5024111
- Parents:
- 3002434
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhid/main.c
r3002434 rcc29622 76 76 { 77 77 assert(dev != NULL); 78 78 79 79 /* 80 80 * Initialize device (get and process descriptors, get address, etc.) 81 81 */ 82 82 usb_log_debug("Initializing USB/HID device...\n"); 83 83 84 84 usb_hid_dev_t *hid_dev = usb_hid_new(); 85 85 if (hid_dev == NULL) { … … 88 88 return ENOMEM; 89 89 } 90 90 91 91 int rc = usb_hid_init(hid_dev, dev); 92 92 93 93 if (rc != EOK) { 94 94 usb_log_error("Failed to initialize USB/HID device.\n"); … … 96 96 return rc; 97 97 } 98 98 99 99 usb_log_debug("USB/HID device structure initialized.\n"); 100 100 101 101 /* 102 102 * 1) subdriver vytvori vlastnu ddf_fun, vlastne ddf_dev_ops, ktore da … … 109 109 * pouzit usb/classes/hid/iface.h - prvy int je telefon 110 110 */ 111 111 112 112 /* Start automated polling function. 113 113 * This will create a separate fibril that will query the device … … 125 125 /* Custom argument. */ 126 126 hid_dev); 127 128 127 128 129 129 if (rc != EOK) { 130 130 usb_log_error("Failed to start polling fibril for `%s'.\n", … … 153 153 { 154 154 usb_log_debug("usb_hid_device_add()\n"); 155 155 156 156 if (dev == NULL) { 157 157 usb_log_warning("Wrong parameter given for add_device().\n"); 158 158 return EINVAL; 159 159 } 160 160 161 161 if (dev->interface_no < 0) { 162 162 usb_log_warning("Device is not a supported HID device.\n"); … … 165 165 return ENOTSUP; 166 166 } 167 167 168 168 int rc = usb_hid_try_add_device(dev); 169 169 170 170 if (rc != EOK) { 171 171 usb_log_warning("Device is not a supported HID device.\n"); … … 174 174 return rc; 175 175 } 176 176 177 177 usb_log_info("HID device `%s' ready to use.\n", dev->ddf_dev->name); 178 178
Note:
See TracChangeset
for help on using the changeset viewer.