Changeset d7869d7e in mainline for uspace/drv/bus/usb/xhci/endpoint.c
- Timestamp:
- 2017-10-14T17:21:26Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 867b375
- Parents:
- 2297fab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/endpoint.c
r2297fab rd7869d7e 39 39 40 40 #include "bus.h" 41 #include "commands.h" 41 42 #include "endpoint.h" 42 43 … … 114 115 } 115 116 117 int xhci_device_configure(xhci_device_t *dev, xhci_hc_t *hc) 118 { 119 int err; 120 121 // Prepare input context. 122 xhci_input_ctx_t *ictx = malloc(sizeof(xhci_input_ctx_t)); 123 if (!ictx) { 124 return ENOMEM; 125 } 126 127 memset(ictx, 0, sizeof(xhci_input_ctx_t)); 128 129 // Quoting sec. 4.6.6: A1, D0, D1 are down, A0 is up. 130 XHCI_INPUT_CTRL_CTX_ADD_CLEAR(ictx->ctrl_ctx, 1); 131 XHCI_INPUT_CTRL_CTX_DROP_CLEAR(ictx->ctrl_ctx, 0); 132 XHCI_INPUT_CTRL_CTX_DROP_CLEAR(ictx->ctrl_ctx, 1); 133 XHCI_INPUT_CTRL_CTX_ADD_SET(ictx->ctrl_ctx, 0); 134 135 // TODO: Set slot context and other flags. (probably forgot a lot of 'em) 136 137 // Issue configure endpoint command (sec 4.3.5). 138 xhci_cmd_t cmd; 139 xhci_cmd_init(&cmd); 140 141 cmd.slot_id = dev->slot_id; 142 xhci_send_configure_endpoint_command(hc, &cmd, ictx); 143 if ((err = xhci_cmd_wait(&cmd, 100000)) != EOK) 144 goto err_cmd; 145 146 xhci_cmd_fini(&cmd); 147 return EOK; 148 149 err_cmd: 150 free(ictx); 151 return err; 152 } 153 116 154 /** 117 155 * @}
Note:
See TracChangeset
for help on using the changeset viewer.