Changeset 9f0b6cc in mainline
- Timestamp:
- 2010-12-12T17:35:02Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f46f8e3
- Parents:
- 8e8289d
- Location:
- uspace/drv/usbhub
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/main.c
r8e8289d r9f0b6cc 50 50 while(true){ 51 51 usb_hub_check_hub_changes(); 52 async_usleep(10000 );52 async_usleep(10000000); 53 53 } 54 54 return 0; -
uspace/drv/usbhub/utils.c
r8e8289d r9f0b6cc 352 352 result->port_count = descriptor->ports_count; 353 353 result->attached_devs = (usb_hub_attached_device_t*) 354 malloc( result->port_count* sizeof(usb_hub_attached_device_t));354 malloc((result->port_count+1) * sizeof(usb_hub_attached_device_t)); 355 355 int i; 356 for(i=0;i<result->port_count ;++i){356 for(i=0;i<result->port_count+1;++i){ 357 357 result->attached_devs[i].devman_handle=0; 358 358 result->attached_devs[i].address=0; … … 428 428 429 429 430 for (port = 0; port < hub_info->port_count; ++port) {430 for (port = 1; port < hub_info->port_count+1; ++port) { 431 431 usb_hub_set_power_port_request(&request, port); 432 432 opResult = usb_drv_sync_control_write(hc, target, &request, NULL, 0); … … 687 687 688 688 // FIXME: count properly 689 size_t byte_length = ( port_count/ 8) + 1;689 size_t byte_length = ((port_count+1) / 8) + 1; 690 690 691 691 void *change_bitmap = malloc(byte_length); … … 707 707 } 708 708 unsigned int port; 709 for (port = 0; port < port_count; ++port) {709 for (port = 1; port < port_count+1; ++port) { 710 710 bool interrupt = (((uint8_t*) change_bitmap)[port / 8] >> (port % 8)) % 2; 711 711 if (interrupt) {
Note:
See TracChangeset
for help on using the changeset viewer.