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