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


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

Refactored some parts of RH to HC. Also moved some bus ops around.

File:
1 edited

Legend:

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

    rd1d7a92 r8ea7459  
    636636}
    637637
     638int hc_enable_slot(xhci_hc_t *hc, uint32_t *slot_id)
     639{
     640        assert(hc);
     641
     642        int err;
     643        xhci_cmd_t cmd;
     644        xhci_cmd_init(&cmd);
     645
     646        if ((err = xhci_send_enable_slot_command(hc, &cmd)) != EOK)
     647                return err;
     648
     649        if ((err = xhci_cmd_wait(&cmd, XHCI_DEFAULT_TIMEOUT)) != EOK)
     650                return err;
     651
     652        if (slot_id)
     653                *slot_id = cmd.slot_id;
     654
     655        xhci_cmd_fini(&cmd);
     656        return EOK;
     657}
     658
     659int hc_address_device(xhci_hc_t *hc, uint32_t slot_id, xhci_input_ctx_t *ictx)
     660{
     661        assert(hc);
     662       
     663        int err;
     664        xhci_cmd_t cmd;
     665        xhci_cmd_init(&cmd);
     666
     667        cmd.slot_id = slot_id;
     668
     669        if ((err = xhci_send_address_device_command(hc, &cmd, ictx)) != 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
    638679/**
    639680 * @}
Note: See TracChangeset for help on using the changeset viewer.