Changeset 9d3536e in mainline


Ignore:
Timestamp:
2018-01-20T22:17:40Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
defaab2
Parents:
d648e83
Message:

usbhub: clear ignored changes and report them only once

Location:
uspace/drv/bus/usb/usbhub
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhub/port.c

    rd648e83 r9d3536e  
    255255        }
    256256
    257         for (uint32_t feature = 0; feature < sizeof(usb_port_status_t) * 8; ++feature) {
     257        for (uint32_t feature = 16; feature < sizeof(usb_port_status_t) * 8; ++feature) {
    258258                uint32_t mask = 1 << feature;
    259259
     
    261261                        continue;
    262262
     263                /* Clear the change so it won't come again */
     264                usb_hub_clear_port_feature(port->hub, port->port_number, feature);
     265
    263266                if (!port_change_handlers[feature])
    264267                        continue;
     
    266269                /* ACK this change */
    267270                status &= ~mask;
    268                 usb_hub_clear_port_feature(port->hub, port->port_number, feature);
    269271
    270272                port_change_handlers[feature](port, status);
    271273        }
    272274
    273         port_log(debug2, port, "Port status after handling: %#08" PRIx32, status);
     275        /* Check for changes we ignored */
     276        if (status & 0xffff0000) {
     277                port_log(debug, port, "Port status change igored. Status: %#08" PRIx32, status);
     278        }
    274279}
    275280
  • uspace/drv/bus/usb/usbhub/usbhub.c

    rd648e83 r9d3536e  
    560560        size_t recv_size;
    561561
     562        uint32_t buffer;
    562563        const int rc = usb_pipe_control_read(hub->control_pipe,
    563564            &request, sizeof(usb_device_request_setup_packet_t),
    564             status, sizeof(*status), &recv_size);
     565            &buffer, sizeof(buffer), &recv_size);
    565566        if (rc != EOK)
    566567                return rc;
     
    569570                return ELIMIT;
    570571
     572        *status = uint32_usb2host(buffer);
    571573        return EOK;
    572574}
Note: See TracChangeset for help on using the changeset viewer.