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

Changeset f9a0cef in mainline


Ignore:
Timestamp:
2010-12-13T00:31:22Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
37f7cfe, ea5dbaf
Parents:
1e32a63
Message:

Add clearing status changes in hub driver

Also, both keyboard and hub driver question with interval of 1s.

Location:
uspace/drv
Files:
4 edited

Legend:

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

    r1e32a63 rf9a0cef  
    5050        while(true){
    5151                usb_hub_check_hub_changes();
    52                 async_usleep(100 * 1000);
     52                async_usleep(1000 * 1000);
    5353        }
    5454        return 0;
  • uspace/drv/usbhub/usbhub_private.h

    r1e32a63 rf9a0cef  
    182182}
    183183
     184static inline int usb_hub_clear_port_feature(int hc, usb_address_t address,
     185    int port_index,
     186    usb_hub_class_feature_t feature) {
     187        usb_target_t target = {
     188                .address = address,
     189                .endpoint = 0
     190        };
     191        usb_device_request_setup_packet_t clear_request = {
     192                .request_type = USB_HUB_REQ_TYPE_CLEAR_PORT_FEATURE,
     193                .request = USB_DEVREQ_CLEAR_FEATURE,
     194                .length = 0,
     195                .index = port_index
     196        };
     197        clear_request.value = feature;
     198        return usb_drv_psync_control_write(hc, target, &clear_request,
     199            sizeof(clear_request), NULL, 0);
     200}
     201
    184202
    185203
  • uspace/drv/usbhub/utils.c

    r1e32a63 rf9a0cef  
    508508        int opResult;
    509509        printf("[usb_hub] finalizing add device\n");
     510        opResult = usb_hub_clear_port_feature(hc, target.address,
     511            port, USB_HUB_FEATURE_C_PORT_RESET);
     512        if (opResult != EOK) {
     513                goto release;
     514        }
    510515
    511516        /* Request address at from host controller. */
     
    625630        //something connected/disconnected
    626631        if (usb_port_connect_change(&status)) {
     632                opResult = usb_hub_clear_port_feature(hc, target.address,
     633                    port, USB_HUB_FEATURE_C_PORT_CONNECTION);
     634                // TODO: check opResult
    627635                if (usb_port_dev_connected(&status)) {
    628636                        printf("[usb_hub] some connection changed\n");
  • uspace/drv/usbkbd/main.c

    r1e32a63 rf9a0cef  
    208208
    209209        while (true) {
    210                 async_usleep(10 * 1000);
     210                async_usleep(1000 * 1000);
    211211                rc = usb_drv_async_interrupt_in(kbd_dev->device->parent_phone,
    212212                    poll_target, buffer, BUFFER_SIZE, &actual_size, &handle);
Note: See TracChangeset for help on using the changeset viewer.