Changes in uspace/drv/usbhub/ports.c [192ba25:361fcec] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/ports.c
r192ba25 r361fcec 53 53 size_t port; 54 54 usb_speed_t speed; 55 };56 57 /**58 * count of port status changes that are not explicitly handled by59 * any function here and must be cleared by hand60 */61 static const unsigned int non_handled_changes_count = 2;62 63 /**64 * port status changes that are not explicitly handled by65 * any function here and must be cleared by hand66 */67 static const int non_handled_changes[] = {68 USB_HUB_FEATURE_C_PORT_ENABLE,69 USB_HUB_FEATURE_C_PORT_SUSPEND70 55 }; 71 56 … … 146 131 &status, USB_HUB_FEATURE_C_PORT_CONNECTION,false); 147 132 usb_port_status_set_bit( 133 &status, USB_HUB_FEATURE_PORT_RESET,false); 134 usb_port_status_set_bit( 148 135 &status, USB_HUB_FEATURE_C_PORT_RESET,false); 149 136 usb_port_status_set_bit( 150 137 &status, USB_HUB_FEATURE_C_PORT_OVER_CURRENT,false); 151 152 //clearing not yet handled changes 153 unsigned int feature_idx; 154 for(feature_idx = 0;feature_idx<non_handled_changes_count; 155 ++feature_idx){ 156 unsigned int bit_idx = non_handled_changes[feature_idx]; 157 if(status & (1<<bit_idx)){ 158 usb_log_info( 159 "there was not yet handled change on port %d: %d" 160 ";clearing it\n", 161 port, bit_idx); 162 int opResult = usb_hub_clear_port_feature( 163 hub->control_pipe, 164 port, bit_idx); 165 if (opResult != EOK) { 166 usb_log_warning( 167 "could not clear port flag %d: %d\n", 168 bit_idx, opResult 169 ); 170 } 171 usb_port_status_set_bit( 172 &status, bit_idx,false); 173 } 174 } 175 if(status>>16){ 176 usb_log_info("there is still some unhandled change %X\n", 177 status); 138 /// \TODO what about port power change? 139 if (status >> 16) { 140 usb_log_info("there was unsupported change on port %d: %X\n", 141 port, status); 142 178 143 } 179 144 } … … 257 222 "Port %zu reset complete but port not enabled.\n", 258 223 (size_t) port); 259 }260 /* Clear the port reset change. */261 int rc = usb_hub_clear_port_feature(hub->control_pipe,262 port, USB_HUB_FEATURE_C_PORT_RESET);263 if (rc != EOK) {264 usb_log_error("Failed to clear port %d reset feature: %s.\n",265 port, str_error(rc));266 224 } 267 225 } … … 361 319 fibril_mutex_unlock(&my_port->reset_mutex); 362 320 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 363 330 if (my_port->reset_okay) { 364 331 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.