Changes in uspace/drv/usbmouse/main.c [adfe5ec:a6add7a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbmouse/main.c
radfe5ec ra6add7a 44 44 * @return Error code. 45 45 */ 46 static int usbmouse_add_device( usb_device_t *dev)46 static int usbmouse_add_device(ddf_dev_t *dev) 47 47 { 48 48 int rc = usb_mouse_create(dev); … … 53 53 } 54 54 55 usb_log_debug("Polling pipe at endpoint %d.\n", dev->pipes[0].pipe->endpoint_no); 56 57 rc = usb_device_auto_poll(dev, 0, 58 usb_mouse_polling_callback, dev->pipes[0].pipe->max_packet_size, 59 usb_mouse_polling_ended_callback, dev->driver_data); 60 61 if (rc != EOK) { 62 usb_log_error("Failed to start polling fibril: %s.\n", 63 str_error(rc)); 64 return rc; 55 fid_t poll_fibril = fibril_create(usb_mouse_polling_fibril, dev); 56 if (poll_fibril == 0) { 57 usb_log_error("Failed to initialize polling fibril.\n"); 58 /* FIXME: free allocated resources. */ 59 return ENOMEM; 65 60 } 66 61 62 fibril_add_ready(poll_fibril); 63 67 64 usb_log_info("controlling new mouse (handle %llu).\n", 68 dev-> ddf_dev->handle);65 dev->handle); 69 66 70 67 return EOK; … … 72 69 73 70 /** USB mouse driver ops. */ 74 static usb_driver_ops_t mouse_driver_ops = {71 static driver_ops_t mouse_driver_ops = { 75 72 .add_device = usbmouse_add_device, 76 73 }; 77 74 78 static usb_endpoint_description_t *endpoints[] = {79 &poll_endpoint_description,80 NULL81 };82 83 75 /** USB mouse driver. */ 84 static usb_driver_t mouse_driver = {76 static driver_t mouse_driver = { 85 77 .name = NAME, 86 .ops = &mouse_driver_ops, 87 .endpoints = endpoints 78 .driver_ops = &mouse_driver_ops 88 79 }; 89 80 … … 92 83 usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME); 93 84 94 return usb_driver_main(&mouse_driver);85 return ddf_driver_main(&mouse_driver); 95 86 } 96 87
Note:
See TracChangeset
for help on using the changeset viewer.