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

Changeset 9f0b6cc in mainline


Ignore:
Timestamp:
2010-12-12T17:35:02Z (11 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master
Children:
f46f8e3
Parents:
8e8289d
Message:

fixes for port count

Location:
uspace/drv/usbhub
Files:
2 edited

Legend:

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

    r8e8289d r9f0b6cc  
    5050        while(true){
    5151                usb_hub_check_hub_changes();
    52                 async_usleep(10000);
     52                async_usleep(10000000);
    5353        }
    5454        return 0;
  • uspace/drv/usbhub/utils.c

    r8e8289d r9f0b6cc  
    352352        result->port_count = descriptor->ports_count;
    353353        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));
    355355        int i;
    356         for(i=0;i<result->port_count;++i){
     356        for(i=0;i<result->port_count+1;++i){
    357357                result->attached_devs[i].devman_handle=0;
    358358                result->attached_devs[i].address=0;
     
    428428
    429429
    430         for (port = 0; port < hub_info->port_count; ++port) {
     430        for (port = 1; port < hub_info->port_count+1; ++port) {
    431431                usb_hub_set_power_port_request(&request, port);
    432432                opResult = usb_drv_sync_control_write(hc, target, &request, NULL, 0);
     
    687687
    688688                // FIXME: count properly
    689                 size_t byte_length = (port_count / 8) + 1;
     689                size_t byte_length = ((port_count+1) / 8) + 1;
    690690
    691691                void *change_bitmap = malloc(byte_length);
     
    707707                }
    708708                unsigned int port;
    709                 for (port = 0; port < port_count; ++port) {
     709                for (port = 1; port < port_count+1; ++port) {
    710710                        bool interrupt = (((uint8_t*) change_bitmap)[port / 8] >> (port % 8)) % 2;
    711711                        if (interrupt) {
Note: See TracChangeset for help on using the changeset viewer.