Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset c386d6d in mainline


Ignore:
Timestamp:
2018-01-09T18:23:47Z (4 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master
Children:
970f6e1
Parents:
cf5cbac4
git-author:
Petr Manek <petr.manek@…> (2018-01-09 18:23:40)
git-committer:
Petr Manek <petr.manek@…> (2018-01-09 18:23:47)
Message:

usbdev: refactoring

Polling syntax sugar API extended to allow custom error handlers. USB
hub polling changed to follow suit.

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhub/usbhub.c

    rcf5cbac4 rc386d6d  
    151151            &hub_status_change_endpoint_description,
    152152            hub_port_changes_callback, ((hub_dev->port_count + 1 + 7) / 8),
    153             -1, usb_hub_polling_terminated_callback, hub_dev);
     153            -1, NULL, usb_hub_polling_terminated_callback, hub_dev);
    154154        if (opResult != EOK) {
    155155                /* Function is already bound */
  • uspace/lib/usbdev/include/usb/dev/poll.h

    rcf5cbac4 rc386d6d  
    9393
    9494typedef bool (*usb_polling_callback_t)(usb_device_t *, uint8_t *, size_t, void *);
     95typedef bool (*usb_polling_error_callback_t)(usb_device_t *, int, void *);
    9596typedef void (*usb_polling_terminted_callback_t)(usb_device_t *, bool, void *);
    9697
     
    107108extern int usb_device_auto_poll_desc(usb_device_t *,
    108109    const usb_endpoint_description_t *, usb_polling_callback_t, size_t, int,
    109     usb_polling_terminted_callback_t, void *);
     110    usb_polling_error_callback_t, usb_polling_terminted_callback_t, void *);
    110111
    111112#endif
  • uspace/lib/usbdev/src/devpoll.c

    rcf5cbac4 rc386d6d  
    332332int usb_device_auto_poll_desc(usb_device_t * usb_dev,
    333333    const usb_endpoint_description_t *desc, usb_polling_callback_t callback,
    334     size_t req_size, int delay,
     334    size_t req_size, int delay, usb_polling_error_callback_t error_callback,
    335335    usb_polling_terminted_callback_t terminated_callback, void *arg)
    336336{
     
    342342                .on_data = callback,
    343343                .on_polling_end = terminated_callback,
    344                 .on_error = NULL,
     344                .on_error = error_callback,
    345345                .arg = arg,
    346346        };
Note: See TracChangeset for help on using the changeset viewer.