Changeset 30f9f8f in mainline for uspace/drv/usbhid/main.c
- Timestamp:
- 2011-05-06T09:29:03Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9a884ed
- Parents:
- c709eb0 (diff), 310c4df (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/main.c
rc709eb0 r30f9f8f 99 99 usb_log_debug("USB/HID device structure initialized.\n"); 100 100 101 /* Create the function exposed under /dev/devices. */102 ddf_fun_t *hid_fun = ddf_fun_create(dev->ddf_dev, fun_exposed,103 usb_hid_get_function_name(hid_dev));104 if (hid_fun == NULL) {105 usb_log_error("Could not create DDF function node.\n");106 usb_hid_free(&hid_dev);107 return ENOMEM;108 }109 110 101 /* 111 * Store the initialized HID device and HID ops 112 * to the DDF function. 113 */ 114 hid_fun->ops = &hid_dev->ops; 115 hid_fun->driver_data = hid_dev; // TODO: maybe change to hid_dev->data 116 117 rc = ddf_fun_bind(hid_fun); 118 if (rc != EOK) { 119 usb_log_error("Could not bind DDF function: %s.\n", 120 str_error(rc)); 121 // TODO: Can / should I destroy the DDF function? 122 ddf_fun_destroy(hid_fun); 123 usb_hid_free(&hid_dev); 124 return rc; 125 } 126 127 rc = ddf_fun_add_to_class(hid_fun, usb_hid_get_class_name(hid_dev)); 128 if (rc != EOK) { 129 usb_log_error( 130 "Could not add DDF function to class 'hid': %s.\n", 131 str_error(rc)); 132 // TODO: Can / should I destroy the DDF function? 133 ddf_fun_destroy(hid_fun); 134 usb_hid_free(&hid_dev); 135 return rc; 136 } 102 * 1) subdriver vytvori vlastnu ddf_fun, vlastne ddf_dev_ops, ktore da 103 * do nej. 104 * 2) do tych ops do .interfaces[DEV_IFACE_USBHID (asi)] priradi 105 * vyplnenu strukturu usbhid_iface_t. 106 * 3) klientska aplikacia - musi si rucne vytvorit telefon 107 * (devman_device_connect() - cesta k zariadeniu (/hw/pci0/...) az 108 * k tej fcii. 109 * pouzit usb/classes/hid/iface.h - prvy int je telefon 110 */ 137 111 138 112 /* Start automated polling function.
Note:
See TracChangeset
for help on using the changeset viewer.