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

Changeset 95285378 in mainline


Ignore:
Timestamp:
2011-05-07T13:45:39Z (11 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master
Children:
1866945
Parents:
192ba25
Message:

workaround for ohci root hub not needed and removed
some comments

File:
1 edited

Legend:

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

    r192ba25 r95285378  
    4545
    4646/**
    47  *      standart device descriptor for ohci root hub
     47 * standart device descriptor for ohci root hub
    4848 */
    4949static const usb_standard_device_descriptor_t ohci_rh_device_descriptor = {
     
    6969 */
    7070static const usb_standard_configuration_descriptor_t ohci_rh_conf_descriptor = {
    71         /// \TODO some values are default or guessed
    7271        .attributes = 1 << 7,
    7372        .configuration_number = 1,
     
    8786        .endpoint_count = 1,
    8887        .interface_class = USB_CLASS_HUB,
    89         /// \TODO is this correct?
    9088        .interface_number = 1,
    9189        .interface_protocol = 0,
     
    107105};
    108106
     107/**
     108 * bitmask of hub features that are valid to be cleared
     109 */
    109110static const uint32_t hub_clear_feature_valid_mask =
    110111    (1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER) |
    111112(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
    112113
     114/**
     115 * bitmask of hub features that are cleared by writing 1 (and not 0)
     116 */
    113117static const uint32_t hub_clear_feature_by_writing_one_mask =
    114118    1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER;
    115119
     120/**
     121 * bitmask of hub features that are valid to be set
     122 */
    116123static const uint32_t hub_set_feature_valid_mask =
    117124    (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT) |
    118125(1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
    119126
    120 
     127/**
     128 * bitmask of hub features that are set by writing 1 and cleared by writing 0
     129 */
    121130static const uint32_t hub_set_feature_direct_mask =
    122131    (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
    123132
     133/**
     134 * bitmask of port features that are valid to be set
     135 */
    124136static const uint32_t port_set_feature_valid_mask =
    125137    (1 << USB_HUB_FEATURE_PORT_ENABLE) |
     
    128140(1 << USB_HUB_FEATURE_PORT_POWER);
    129141
     142/**
     143 * bitmask of port features that can be cleared
     144 */
    130145static const uint32_t port_clear_feature_valid_mask =
    131146    (1 << USB_HUB_FEATURE_PORT_CONNECTION) |
     
    141156//USB_HUB_FEATURE_PORT_LOW_SPEED
    142157
     158/**
     159 * bitmask with port status changes
     160 */
    143161static const uint32_t port_status_change_mask =
    144162    (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) |
     
    152170
    153171static int rh_init_descriptors(rh_t *instance);
    154 
    155 static void rh_check_port_connectivity(rh_t * instance);
    156172
    157173static int process_get_port_status_request(rh_t *instance, uint16_t port,
     
    220236        if (!instance->interrupt_buffer)
    221237                return ENOMEM;
    222         rh_check_port_connectivity(instance);
    223 
    224 
    225         usb_log_info("OHCI root hub with %d ports.\n", instance->port_count);
     238
     239        usb_log_info("OHCI root hub with %d ports initialized.\n",
     240            instance->port_count);
    226241
    227242        return EOK;
     
    381396        return EOK;
    382397}
    383 /*----------------------------------------------------------------------------*/
    384 
    385 /**
    386  * check whether there are connected devices on ports and if yes, indicate
    387  * connection change
    388  *
    389  * @param instance
    390  */
    391 static void rh_check_port_connectivity(rh_t * instance) {
    392         size_t port;
    393         usb_log_debug("rh_check_port_connectivity\n");
    394         for (port = 1; port < instance->port_count; ++port) {
    395                 bool connected =
    396                     ((instance->registers->rh_port_status[port - 1]) &
    397                     (1 << USB_HUB_FEATURE_PORT_CONNECTION)) != 0;
    398                 if (connected) {
    399                         usb_log_debug("port %d has connected device\n", port);
    400                         instance->registers->rh_port_status[port - 1] =
    401                             instance->registers->rh_port_status[port - 1]
    402                             | (1 << USB_HUB_FEATURE_C_PORT_CONNECTION);
    403                         usb_log_debug("change indicated to status "
    404                             "register\n");
    405                 }
    406         }
    407 }
    408 
    409 
    410398/*----------------------------------------------------------------------------*/
    411399
Note: See TracChangeset for help on using the changeset viewer.