Changeset 110d795 in mainline for uspace/drv/bus/usb/xhci/commands.h


Ignore:
Timestamp:
2017-07-22T23:07:40Z (7 years ago)
Author:
Jaroslav Jindrak <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aee352c
Parents:
9af3281
Message:

Overhauled command system, not a special structure is passed that can be kept and polled for completion.

File:
1 edited

Legend:

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

    r9af3281 r110d795  
    3737#define XHCI_COMMANDS_H
    3838
     39#include <adt/list.h>
     40#include <stdbool.h>
     41
    3942typedef struct xhci_hc xhci_hc_t;
    4043typedef struct xhci_trb xhci_trb_t;
    4144typedef struct xhci_input_ctx xhci_input_ctx_t;
    4245
    43 int xhci_send_no_op_command(xhci_hc_t *);
    44 int xhci_send_enable_slot_command(xhci_hc_t *);
    45 int xhci_send_disable_slot_command(xhci_hc_t *, uint32_t);
    46 int xhci_send_address_device_command(xhci_hc_t *, uint32_t, xhci_input_ctx_t *);
    47 int xhci_send_configure_endpoint_command(xhci_hc_t *, uint32_t, xhci_input_ctx_t *);
    48 int xhci_send_evaluate_context_command(xhci_hc_t *, uint32_t, xhci_input_ctx_t *);
    49 int xhci_send_reset_endpoint_command(xhci_hc_t *, uint32_t, uint32_t, uint8_t);
    50 int xhci_send_stop_endpoint_command(xhci_hc_t *, uint32_t, uint32_t, uint8_t);
     46typedef struct xhci_command {
     47        link_t link;
     48
     49        xhci_trb_t *trb;
     50        xhci_input_ctx_t *ictx;
     51        uint32_t slot_id;
     52        uint32_t status;
     53
     54        bool completed;
     55        bool has_owner;
     56} xhci_cmd_t;
     57
     58int xhci_init_commands(xhci_hc_t *);
     59int xhci_wait_for_command(xhci_hc_t *, xhci_cmd_t *, uint32_t);
     60xhci_cmd_t *xhci_alloc_command(void);
     61void xhci_free_command(xhci_cmd_t *);
     62
     63int xhci_send_no_op_command(xhci_hc_t *, xhci_cmd_t *);
     64int xhci_send_enable_slot_command(xhci_hc_t *, xhci_cmd_t *);
     65int xhci_send_disable_slot_command(xhci_hc_t *, xhci_cmd_t *);
     66int xhci_send_address_device_command(xhci_hc_t *, xhci_cmd_t *);
     67int xhci_send_configure_endpoint_command(xhci_hc_t *, xhci_cmd_t *);
     68int xhci_send_evaluate_context_command(xhci_hc_t *, xhci_cmd_t *);
     69int xhci_send_reset_endpoint_command(xhci_hc_t *, xhci_cmd_t *, uint32_t, uint8_t);
     70int xhci_send_stop_endpoint_command(xhci_hc_t *, xhci_cmd_t *, uint32_t, uint8_t);
    5171// TODO: Set dequeue ptr (section 4.6.10).
    52 int xhci_send_reset_device_command(xhci_hc_t *, uint32_t);
     72int xhci_send_reset_device_command(xhci_hc_t *, xhci_cmd_t *);
    5373// TODO: Force event (optional normative, for VMM, section 4.6.12).
    5474// TODO: Negotiate bandwidth (optional normative, section 4.6.13).
Note: See TracChangeset for help on using the changeset viewer.