Changeset edc4c66 in mainline for uspace/drv
- Timestamp:
- 2011-04-10T08:16:04Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 86b4ee0
- Parents:
- a19a2d7 (diff), d824daf (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. - Location:
- uspace/drv
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/ports.c
ra19a2d7 redc4c66 181 181 */ 182 182 } else { 183 usb_log_warning("this is strange, disconnected device had " 184 "no address\n"); 185 //device was disconnected before it`s port was reset - 186 //return default address 187 usb_hub_release_default_address(hub); 183 // TODO: is this really reason to print a warning? 184 usb_log_warning("Device removed before being registered.\n"); 185 186 /* 187 * Device was removed before port reset completed. 188 * We will announce a failed port reset to unblock the 189 * port reset callback from new device wrapper. 190 */ 191 usb_hub_port_t *the_port = hub->ports + port; 192 fibril_mutex_lock(&the_port->reset_mutex); 193 the_port->reset_completed = true; 194 the_port->reset_okay = false; 195 fibril_condvar_broadcast(&the_port->reset_cv); 196 fibril_mutex_unlock(&the_port->reset_mutex); 188 197 } 189 198 } … … 207 216 fibril_mutex_lock(&the_port->reset_mutex); 208 217 the_port->reset_completed = true; 218 the_port->reset_okay = true; 209 219 fibril_condvar_broadcast(&the_port->reset_cv); 210 220 fibril_mutex_unlock(&the_port->reset_mutex); … … 319 329 } 320 330 321 return EOK; 331 if (my_port->reset_okay) { 332 return EOK; 333 } else { 334 return ESTALL; 335 } 322 336 } 323 337 -
uspace/drv/usbhub/ports.h
ra19a2d7 redc4c66 51 51 */ 52 52 bool reset_completed; 53 /** Whether to announce the port reset as successful. */ 54 bool reset_okay; 53 55 54 56 /** Information about attached device. */ -
uspace/drv/usbhub/usbhub.c
ra19a2d7 redc4c66 177 177 178 178 return true; 179 }180 181 /**182 * release default address used by given hub183 *184 * Also unsets hub->is_default_address_used. Convenience wrapper function.185 * @note hub->connection MUST be open for communication186 * @param hub hub representation187 * @return error code188 */189 int usb_hub_release_default_address(usb_hub_info_t * hub) {190 int opResult = usb_hc_release_default_address(&hub->connection);191 if (opResult != EOK) {192 usb_log_error("could not release default address, errno %d\n",193 opResult);194 return opResult;195 }196 hub->is_default_address_used = false;197 return EOK;198 179 } 199 180 -
uspace/drv/usbhub/usbhub.h
ra19a2d7 redc4c66 98 98 uint8_t *change_bitmap, size_t change_bitmap_size, void *arg); 99 99 100 int usb_hub_release_default_address(usb_hub_info_t * hub);101 102 100 #endif 103 101 /** -
uspace/drv/vhc/connhost.c
ra19a2d7 redc4c66 324 324 } 325 325 326 static int reserve_default_address(ddf_fun_t *fun, usb_speed_t ignored)327 {328 usb_address_keeping_reserve_default(&addresses);329 return EOK;330 }331 332 static int release_default_address(ddf_fun_t *fun)333 {334 usb_address_keeping_release_default(&addresses);335 return EOK;336 }337 338 326 static int request_address(ddf_fun_t *fun, usb_speed_t ignored, 339 327 usb_address_t *address) … … 388 376 389 377 usbhc_iface_t vhc_iface = { 390 .reserve_default_address = reserve_default_address,391 .release_default_address = release_default_address,392 378 .request_address = request_address, 393 379 .bind_address = bind_address,
Note:
See TracChangeset
for help on using the changeset viewer.