Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhub/ports.c

    r361fcec rd0c060b  
    137137            &status, USB_HUB_FEATURE_C_PORT_OVER_CURRENT,false);
    138138        /// \TODO what about port power change?
     139        unsigned int bit_idx;
     140        for(bit_idx = 16;bit_idx<32;++bit_idx){
     141                if(status & (1<<bit_idx)){
     142                        usb_log_info(
     143                            "there was unsupported change on port %d: %d\n",
     144                        port, bit_idx);
     145                        int opResult = usb_hub_clear_port_feature(
     146                            hub->control_pipe,
     147                            port, USB_HUB_FEATURE_C_PORT_CONNECTION);
     148                        if (opResult != EOK) {
     149                                usb_log_warning(
     150                                    "could not clear port flag %d: %d\n",
     151                                    bit_idx, opResult
     152                                    );
     153                        }
     154                        usb_port_status_set_bit(
     155                            &status, bit_idx,false);
     156                }
     157        }
    139158        if (status >> 16) {
    140159                usb_log_info("there was unsupported change on port %d: %X\n",
    141160                        port, status);
    142 
    143161        }
    144162}
     
    222240                    "Port %zu reset complete but port not enabled.\n",
    223241                    (size_t) port);
     242        }
     243        /* Clear the port reset change. */
     244        int rc = usb_hub_clear_port_feature(hub->control_pipe,
     245            port, USB_HUB_FEATURE_C_PORT_RESET);
     246        if (rc != EOK) {
     247                usb_log_error("Failed to clear port %d reset feature: %s.\n",
     248                    port, str_error(rc));
    224249        }
    225250}
     
    319344        fibril_mutex_unlock(&my_port->reset_mutex);
    320345
    321         /* Clear the port reset change. */
    322         rc = usb_hub_clear_port_feature(hub->control_pipe,
    323             port_no, USB_HUB_FEATURE_C_PORT_RESET);
    324         if (rc != EOK) {
    325                 usb_log_error("Failed to clear port %d reset feature: %s.\n",
    326                     port_no, str_error(rc));
    327                 return rc;
    328         }
    329 
    330346        if (my_port->reset_okay) {
    331347                return EOK;
Note: See TracChangeset for help on using the changeset viewer.