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

Changeset 64a36e2 in mainline


Ignore:
Timestamp:
2011-05-13T13:36:25Z (9 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
master
Children:
8fcaeed
Parents:
c372e03 (diff), aca3489 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

usb_hub_polling_terminated_callback added, so that hub driver fibril cleans hub data after being stopped
this feature was removed after new usb polling api was introduced. feature is not tested.

Location:
uspace/drv
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/root_hub.c

    rc372e03 r64a36e2  
    110110static const uint32_t hub_clear_feature_valid_mask =
    111111    (1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER) |
    112 (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
     112    (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
    113113
    114114/**
     
    123123static const uint32_t hub_set_feature_valid_mask =
    124124    (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT) |
    125 (1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
     125    (1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
    126126
    127127/**
     
    136136static const uint32_t port_set_feature_valid_mask =
    137137    (1 << USB_HUB_FEATURE_PORT_ENABLE) |
    138 (1 << USB_HUB_FEATURE_PORT_SUSPEND) |
    139 (1 << USB_HUB_FEATURE_PORT_RESET) |
    140 (1 << USB_HUB_FEATURE_PORT_POWER);
     138    (1 << USB_HUB_FEATURE_PORT_SUSPEND) |
     139    (1 << USB_HUB_FEATURE_PORT_RESET) |
     140    (1 << USB_HUB_FEATURE_PORT_POWER);
    141141
    142142/**
     
    145145static const uint32_t port_clear_feature_valid_mask =
    146146    (1 << USB_HUB_FEATURE_PORT_CONNECTION) |
    147 (1 << USB_HUB_FEATURE_PORT_SUSPEND) |
    148 (1 << USB_HUB_FEATURE_PORT_OVER_CURRENT) |
    149 (1 << USB_HUB_FEATURE_PORT_POWER) |
    150 (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) |
    151 (1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
    152 (1 << USB_HUB_FEATURE_C_PORT_SUSPEND) |
    153 (1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
    154 (1 << USB_HUB_FEATURE_C_PORT_RESET);
     147    (1 << USB_HUB_FEATURE_PORT_SUSPEND) |
     148    (1 << USB_HUB_FEATURE_PORT_OVER_CURRENT) |
     149    (1 << USB_HUB_FEATURE_PORT_POWER) |
     150    (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) |
     151    (1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
     152    (1 << USB_HUB_FEATURE_C_PORT_SUSPEND) |
     153    (1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
     154    (1 << USB_HUB_FEATURE_C_PORT_RESET);
    155155//note that USB_HUB_FEATURE_PORT_POWER bit is translated into
    156156//USB_HUB_FEATURE_PORT_LOW_SPEED
     
    161161static const uint32_t port_status_change_mask =
    162162    (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) |
    163 (1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
    164 (1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
    165 (1 << USB_HUB_FEATURE_C_PORT_RESET) |
    166 (1 << USB_HUB_FEATURE_C_PORT_SUSPEND);
     163    (1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
     164    (1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
     165    (1 << USB_HUB_FEATURE_C_PORT_RESET) |
     166    (1 << USB_HUB_FEATURE_C_PORT_SUSPEND);
    167167
    168168
  • uspace/drv/usbhub/usbhub.c

    rc372e03 r64a36e2  
    7171
    7272static void usb_hub_process_global_interrupt(usb_hub_info_t * hub_info);
     73
     74static void usb_hub_polling_terminted_callback(usb_device_t * device,
     75    bool was_error, void * data);
    7376
    7477
     
    351354        rc = usb_device_auto_poll(hub_info->usb_device, 0,
    352355            hub_port_changes_callback, ((hub_info->port_count + 1) / 8) + 1,
    353             NULL, hub_info);
     356            usb_hub_polling_terminted_callback, hub_info);
    354357        if (rc != EOK) {
    355358                usb_log_error("Failed to create polling fibril: %s.\n",
     
    489492
    490493/**
     494 * callback called from hub polling fibril when the fibril terminates
     495 *
     496 * Should perform a cleanup - deletes hub_info.
     497 * @param device usb device afected
     498 * @param was_error indicates that the fibril is stoped due to an error
     499 * @param data pointer to usb_hub_info_t structure
     500 */
     501static void usb_hub_polling_terminted_callback(usb_device_t * device,
     502    bool was_error, void * data){
     503        usb_hub_info_t * hub_info = data;
     504        if(!hub_info) return;
     505        free(hub_info->ports);
     506        free(hub_info);
     507}
     508
     509
     510
     511
     512/**
    491513 * @}
    492514 */
Note: See TracChangeset for help on using the changeset viewer.