Changeset f270ecb in mainline


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.

Location:
uspace/drv/bus/usb/xhci
Files:
2 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;
  • uspace/drv/bus/usb/xhci/hc.h

    r8ea7459 rf270ecb  
    9999int hc_ring_doorbell(xhci_hc_t *, unsigned, unsigned);
    100100int hc_enable_slot(xhci_hc_t *, uint32_t *);
     101int hc_disable_slot(xhci_hc_t *, uint32_t);
    101102int hc_address_device(xhci_hc_t *, uint32_t, xhci_input_ctx_t *);
    102103
Note: See TracChangeset for help on using the changeset viewer.