Changes in uspace/drv/usbkbd/main.c [252e30c:5e07e2b5] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbkbd/main.c
r252e30c r5e07e2b5 33 33 /** 34 34 * @file 35 * Main routines of USB HID driver.35 * Main routines of USB KBD driver. 36 36 */ 37 37 … … 42 42 43 43 #include <usb/devdrv.h> 44 #include <usb/devpoll.h> 44 45 45 46 #include "kbddev.h" … … 75 76 * @sa usb_kbd_fibril(), usb_kbd_repeat_fibril() 76 77 */ 77 static int usb hid_try_add_device(usb_device_t *dev)78 static int usb_kbd_try_add_device(usb_device_t *dev) 78 79 { 79 80 /* Create the function exposed under /dev/devices. */ … … 105 106 usb_kbd_free(&kbd_dev); 106 107 return rc; 107 } 108 } 108 109 109 110 usb_log_debug("USB/HID KBD device structure initialized.\n"); … … 195 196 * @retval EREFUSED if the device is not supported. 196 197 */ 197 static int usb hid_add_device(usb_device_t *dev)198 static int usb_kbd_add_device(usb_device_t *dev) 198 199 { 199 usb_log_debug("usb hid_add_device()\n");200 usb_log_debug("usb_kbd_add_device()\n"); 200 201 201 202 if (dev->interface_no < 0) { 202 203 usb_log_warning("Device is not a supported keyboard.\n"); 203 usb_log_error("Failed to add HID device: endpoint not found."204 " \n");204 usb_log_error("Failed to add USB KBD device: endpoint not " 205 "found.\n"); 205 206 return ENOTSUP; 206 207 } 207 208 208 int rc = usb hid_try_add_device(dev);209 int rc = usb_kbd_try_add_device(dev); 209 210 210 211 if (rc != EOK) { 211 212 usb_log_warning("Device is not a supported keyboard.\n"); 212 usb_log_error("Failed to add HID device: %s.\n",213 usb_log_error("Failed to add KBD device: %s.\n", 213 214 str_error(rc)); 214 215 return rc; … … 224 225 /* Currently, the framework supports only device adding. Once the framework 225 226 * supports unplug, more callbacks will be added. */ 226 static usb_driver_ops_t usb hid_driver_ops = {227 .add_device = usb hid_add_device,227 static usb_driver_ops_t usb_kbd_driver_ops = { 228 .add_device = usb_kbd_add_device, 228 229 }; 229 230 230 231 231 232 /* The driver itself. */ 232 static usb_driver_t usb hid_driver = {233 static usb_driver_t usb_kbd_driver = { 233 234 .name = NAME, 234 .ops = &usb hid_driver_ops,235 .ops = &usb_kbd_driver_ops, 235 236 .endpoints = usb_kbd_endpoints 236 237 }; … … 238 239 /*----------------------------------------------------------------------------*/ 239 240 240 //static driver_ops_t kbd_driver_ops = {241 // .add_device = usbhid_add_device,242 //};243 244 ///*----------------------------------------------------------------------------*/245 246 //static driver_t kbd_driver = {247 // .name = NAME,248 // .driver_ops = &kbd_driver_ops249 //};250 251 /*----------------------------------------------------------------------------*/252 253 241 int main(int argc, char *argv[]) 254 242 { 255 printf(NAME ": HelenOS USB HID driver.\n");243 printf(NAME ": HelenOS USB KBD driver.\n"); 256 244 257 245 usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME); 258 246 259 return usb_driver_main(&usb hid_driver);247 return usb_driver_main(&usb_kbd_driver); 260 248 } 261 249
Note:
See TracChangeset
for help on using the changeset viewer.