Changeset c9ce62a in mainline


Ignore:
Timestamp:
2017-07-13T18:42:42Z (7 years ago)
Author:
Jaroslav Jindrak <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4fa5342
Parents:
665bf3c
Message:

Added sending function for the evaluate context command.

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

Legend:

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

    r665bf3c rc9ce62a  
    142142}
    143143
     144int xhci_send_evaluate_context_command(xhci_hc_t *hc, uint32_t slot_id,
     145                                       xhci_input_ctx_t *ictx)
     146{
     147        /**
     148         * Note: All Drop Context flags of the input context shall be 0,
     149         *       all Add Context flags shall be initialize to indicate IDs
     150         *       of the contexts affected by the command.
     151         *       Refer to sections 6.2.2.3 and 6.3.3.3 for further info.
     152         */
     153        xhci_trb_t trb;
     154        memset(&trb, 0, sizeof(trb));
     155
     156        uint64_t phys_addr = (uint64_t) addr_to_phys(ictx);
     157        trb.parameter = host2xhci(32, phys_addr & 0xFFFFFFFFFFFFFFF0);
     158
     159        trb.control = host2xhci(32, XHCI_TRB_TYPE_EVALUATE_CONTEXT_CMD << 10);
     160        trb.control |= host2xhci(32, hc->command_ring.pcs);
     161        trb.control |= host2xhci(32, slot_id << 24);
     162
     163        return enqueue_trb(hc, &trb, 0, 0);
     164}
     165
    144166static int report_error(int code)
    145167{
     
    209231        case XHCI_TRB_TYPE_CONFIGURE_ENDPOINT_CMD:
    210232                return EOK;
     233        case XHCI_TRB_TYPE_EVALUATE_CONTEXT_CMD:
     234                return EOK;
    211235        default:
    212236                usb_log_debug2("Unsupported command trb.");
  • uspace/drv/bus/usb/xhci/commands.h

    r665bf3c rc9ce62a  
    4646int xhci_send_address_device_command(xhci_hc_t *, uint32_t, xhci_input_ctx_t *);
    4747int xhci_send_configure_endpoint_command(xhci_hc_t *, uint32_t, xhci_input_ctx_t *);
     48int xhci_send_evaluate_context_command(xhci_hc_t *, uint32_t, xhci_input_ctx_t *);
    4849
    4950int xhci_handle_command_completion(xhci_hc_t *, xhci_trb_t *);
Note: See TracChangeset for help on using the changeset viewer.