Changeset 1c89f74 in mainline for uspace/drv/usbhub/usbhub.c


Ignore:
Timestamp:
2011-04-07T09:00:00Z (13 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9d06563
Parents:
d7f3040
Message:

fix attempt #3

File:
1 edited

Legend:

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

    rd7f3040 r1c89f74  
    344344         * these lines allow to reset hub once more, it can be used as
    345345         * brute-force initialization for non-removable devices
    346          *
     346         */
    347347        opResult = usb_request_set_configuration(hub_info->control_pipe,
    348348                1);
     
    351351                        opResult);
    352352                return opResult;
    353         }*/
     353        }
    354354
    355355
    356356        size_t received_size;
    357         opResult = usb_request_get_descriptor(&hub_info->usb_device->ctrl_pipe,
     357        opResult = usb_request_get_descriptor(hub_info->control_pipe,
    358358                USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_DEVICE,
    359359                USB_DESCTYPE_HUB,
     
    376376        usb_log_debug("setting port count to %d\n", descriptor->ports_count);
    377377        hub_info->port_count = descriptor->ports_count;
     378        /// \TODO check attached_devices array: this is not semantically correct
    378379        hub_info->attached_devs = (usb_hc_attached_device_t*)
    379380                malloc((hub_info->port_count + 1) *
     
    381382                );
    382383        int i;
    383         for (i = 0; i < hub_info->port_count + 1; ++i) {
     384        for (i = 1; i <= hub_info->port_count; ++i) {
    384385                hub_info->attached_devs[i].handle = 0;
    385386                hub_info->attached_devs[i].address = 0;
     387                usb_log_info("powering port %d\n",i);
     388                opResult = usb_hub_set_port_feature(
     389                        hub_info->control_pipe,
     390                        i,
     391                        USB_HUB_FEATURE_PORT_POWER);
     392                if(opResult!=EOK)
     393                        usb_log_warning("could not power port %d\n",i);
     394
    386395        }
    387396        //handle non-removable devices
Note: See TracChangeset for help on using the changeset viewer.