Changeset 489c3e7 in mainline for uspace/drv/usbmouse/main.c


Ignore:
Timestamp:
2011-03-12T11:59:52Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
69334af
Parents:
6105fc0
Message:

USB mouse driver uses the new framework

The implementation was adjusted very roughly, but it looks that it
still works.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbmouse/main.c

    r6105fc0 r489c3e7  
    4444 * @return Error code.
    4545 */
    46 static int usbmouse_add_device(ddf_dev_t *dev)
     46static int usbmouse_add_device(usb_device_t *dev)
    4747{
    4848        int rc = usb_mouse_create(dev);
     
    5252                return rc;
    5353        }
     54
     55        usb_log_debug("Polling pipe at endpoint %d.\n", dev->pipes[0].pipe->endpoint_no);
    5456
    5557        fid_t poll_fibril = fibril_create(usb_mouse_polling_fibril, dev);
     
    6365
    6466        usb_log_info("controlling new mouse (handle %llu).\n",
    65             dev->handle);
     67            dev->ddf_dev->handle);
    6668
    6769        return EOK;
     
    6971
    7072/** USB mouse driver ops. */
    71 static driver_ops_t mouse_driver_ops = {
     73static usb_driver_ops_t mouse_driver_ops = {
    7274        .add_device = usbmouse_add_device,
    7375};
    7476
     77static usb_endpoint_description_t *endpoints[] = {
     78        &poll_endpoint_description,
     79        NULL
     80};
     81
    7582/** USB mouse driver. */
    76 static driver_t mouse_driver = {
     83static usb_driver_t mouse_driver = {
    7784        .name = NAME,
    78         .driver_ops = &mouse_driver_ops
     85        .ops = &mouse_driver_ops,
     86        .endpoints = endpoints
    7987};
    8088
     
    8391        usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
    8492
    85         return ddf_driver_main(&mouse_driver);
     93        return usb_driver_main(&mouse_driver);
    8694}
    8795
Note: See TracChangeset for help on using the changeset viewer.