Changeset ea30cc1 in mainline


Ignore:
Timestamp:
2013-01-06T02:36:27Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c95c00e
Parents:
dc1d499
Message:

libsubdev: Add delay parameter to autopol.

usbhub: Set delay to 255 ms . Maximum allowed for endpoint.
This will be useful for devices that don't NAK poll requests.

Location:
uspace
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhid/main.c

    rdc1d499 rea30cc1  
    9696           /* How much data to request. */
    9797           dev->pipes[hid_dev->poll_pipe_index].pipe.max_packet_size,
     98           /* Delay */
     99           0,
    98100           /* Callback when the polling ends. */
    99101           usb_hid_polling_ended_callback,
  • uspace/drv/bus/usb/usbhub/usbhub.c

    rdc1d499 rea30cc1  
    147147        /* Start hub operation. */
    148148        opResult = usb_device_auto_poll(hub_dev->usb_device, 0,
    149             hub_port_changes_callback, ((hub_dev->port_count + 1 + 8) / 8),
     149            hub_port_changes_callback, ((hub_dev->port_count + 1 + 7) / 8),
     150            255000,
    150151            usb_hub_polling_terminated_callback, hub_dev);
    151152        if (opResult != EOK) {
     
    247248
    248249        /* N + 1 bit indicates change on port N */
    249         for (size_t port = 0; port < hub->port_count + 1; port++) {
     250        for (size_t port = 0; port < hub->port_count; ++port) {
    250251                const size_t bit = port + 1;
    251252                const bool change = (change_bitmap[bit / 8] >> (bit % 8)) & 1;
  • uspace/lib/usbdev/include/usb/dev/poll.h

    rdc1d499 rea30cc1  
    9595
    9696int usb_device_auto_poll(usb_device_t *, size_t,
    97     usb_polling_callback_t, size_t, usb_polling_terminted_callback_t, void *);
     97    usb_polling_callback_t, size_t, int, usb_polling_terminted_callback_t, void *);
    9898
    9999#endif
  • uspace/lib/usbdev/src/devpoll.c

    rdc1d499 rea30cc1  
    194194 */
    195195int usb_device_auto_poll(usb_device_t *dev, size_t pipe_index,
    196     usb_polling_callback_t callback, size_t request_size,
     196    usb_polling_callback_t callback, size_t request_size, int delay,
    197197    usb_polling_terminted_callback_t terminated_callback, void *arg)
    198198{
     
    200200                .debug = 1,
    201201                .auto_clear_halt = true,
    202                 .delay = 0,
     202                .delay = delay,
    203203                .max_failures = MAX_FAILED_ATTEMPTS,
    204204                .on_data = callback,
Note: See TracChangeset for help on using the changeset viewer.