Changeset f270ecb in mainline for uspace/drv/bus/usb/xhci/hc.c


Ignore:
Timestamp:
2017-10-21T12:31:00Z (7 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f45c78f
Parents:
8ea7459
Message:

Implemented disable slot for device detachment.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/hc.c

    r8ea7459 rf270ecb  
    657657}
    658658
    659 int hc_address_device(xhci_hc_t *hc, uint32_t slot_id, xhci_input_ctx_t *ictx)
     659int hc_disable_slot(xhci_hc_t *hc, uint32_t slot_id)
    660660{
    661661        assert(hc);
    662        
     662
    663663        int err;
    664664        xhci_cmd_t cmd;
     
    667667        cmd.slot_id = slot_id;
    668668
     669        if ((err = xhci_send_disable_slot_command(hc, &cmd)) != EOK)
     670                return err;
     671
     672        if ((err = xhci_cmd_wait(&cmd, XHCI_DEFAULT_TIMEOUT)) != EOK)
     673                return err;
     674
     675        xhci_cmd_fini(&cmd);
     676        return EOK;
     677}
     678
     679int hc_address_device(xhci_hc_t *hc, uint32_t slot_id, xhci_input_ctx_t *ictx)
     680{
     681        assert(hc);
     682
     683        int err;
     684        xhci_cmd_t cmd;
     685        xhci_cmd_init(&cmd);
     686
     687        cmd.slot_id = slot_id;
     688
    669689        if ((err = xhci_send_address_device_command(hc, &cmd, ictx)) != EOK)
    670690                return err;
Note: See TracChangeset for help on using the changeset viewer.