Changes in uspace/drv/usbhid/main.c [61257f4:b20de1d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/main.c
r61257f4 rb20de1d 42 42 43 43 #include <usb/devdrv.h> 44 #include <usb/devpoll.h> 44 45 45 46 #include "usbhid.h" … … 74 75 static int usb_hid_try_add_device(usb_device_t *dev) 75 76 { 77 assert(dev != NULL); 78 76 79 /* 77 80 * Initialize device (get and process descriptors, get address, etc.) … … 98 101 /* Create the function exposed under /dev/devices. */ 99 102 ddf_fun_t *hid_fun = ddf_fun_create(dev->ddf_dev, fun_exposed, 100 usb_hid_get_function_name(hid_dev ->device_type));103 usb_hid_get_function_name(hid_dev)); 101 104 if (hid_fun == NULL) { 102 105 usb_log_error("Could not create DDF function node.\n"); … … 111 114 hid_fun->ops = &hid_dev->ops; 112 115 hid_fun->driver_data = hid_dev; // TODO: maybe change to hid_dev->data 116 117 /* 118 * 1) subdriver vytvori vlastnu ddf_fun, vlastne ddf_dev_ops, ktore da 119 * do nej. 120 * 2) do tych ops do .interfaces[DEV_IFACE_USBHID (asi)] priradi 121 * vyplnenu strukturu usbhid_iface_t. 122 * 3) klientska aplikacia - musi si rucne vytvorit telefon 123 * (devman_device_connect() - cesta k zariadeniu (/hw/pci0/...) az 124 * k tej fcii. 125 * pouzit usb/classes/hid/iface.h - prvy int je telefon 126 */ 113 127 114 128 rc = ddf_fun_bind(hid_fun); … … 122 136 } 123 137 124 rc = ddf_fun_add_to_class(hid_fun, 125 usb_hid_get_class_name(hid_dev->device_type)); 138 rc = ddf_fun_add_to_class(hid_fun, usb_hid_get_class_name(hid_dev)); 126 139 if (rc != EOK) { 127 140 usb_log_error( … … 142 155 hid_dev->poll_pipe_index, 143 156 /* Callback when data arrives. */ 144 hid_dev->poll_callback,157 usb_hid_polling_callback, 145 158 /* How much data to request. */ 146 159 dev->pipes[hid_dev->poll_pipe_index].pipe->max_packet_size, … … 178 191 usb_log_debug("usb_hid_add_device()\n"); 179 192 193 if (dev == NULL) { 194 usb_log_warning("Wrong parameter given for add_device().\n"); 195 return EINVAL; 196 } 197 180 198 if (dev->interface_no < 0) { 181 199 usb_log_warning("Device is not a supported HID device.\n");
Note:
See TracChangeset
for help on using the changeset viewer.