Changeset 706a3e2 in mainline
- Timestamp:
- 2017-08-18T16:21:33Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5ff9e1d
- Parents:
- e439f468
- Location:
- uspace/drv/bus/usb/xhci
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/hc.c
re439f468 r706a3e2 483 483 static void hc_dcbaa_fini(xhci_hc_t *hc) 484 484 { 485 xhci_trb_ring_t* trb_ring; 485 486 xhci_scratchpad_free(hc); 486 487 487 488 /* Idx 0 already deallocated by xhci_scratchpad_free. */ 488 489 for (unsigned i = 1; i < hc->max_slots + 1; ++i) { 489 if (hc->dcbaa_virt[i] != NULL) { 490 if (hc->dcbaa_virt[i]) { 491 if (hc->dcbaa_virt[i]->dev_ctx) 492 free32(hc->dcbaa_virt[i]->dev_ctx); 493 494 for (unsigned i = 0; i < XHCI_EP_COUNT; ++i) { 495 trb_ring = hc->dcbaa_virt[i]->trs[i]; 496 if (trb_ring) { 497 xhci_trb_ring_fini(trb_ring); 498 free32(trb_ring); 499 } 500 } 501 490 502 free32(hc->dcbaa_virt[i]); 491 503 hc->dcbaa_virt[i] = NULL; -
uspace/drv/bus/usb/xhci/hc.h
re439f468 r706a3e2 43 43 #include "trb_ring.h" 44 44 45 typedef struct xhci_virt_device_ctx { 46 xhci_device_ctx_t *dev_ctx; 47 xhci_trb_ring_t *trs[XHCI_EP_COUNT]; 48 } xhci_virt_device_ctx_t; 49 45 50 /** 46 51 * xHCI lets the controller define speeds of ports it controls. … … 67 72 xhci_event_ring_t event_ring; 68 73 uint64_t *dcbaa; 69 xhci_ device_ctx_t **dcbaa_virt;74 xhci_virt_device_ctx_t **dcbaa_virt; 70 75 xhci_scratchpad_t *scratchpad; 71 76 -
uspace/drv/bus/usb/xhci/hw_struct/context.h
re439f468 r706a3e2 51 51 xhci_dword_t data[5]; 52 52 xhci_dword_t reserved[3]; 53 54 #define XHCI_EP_COUNT 31 53 55 54 56 #define XHCI_EP_TYPE_ISOCH_OUT 1 … … 132 134 typedef struct xhci_device_ctx { 133 135 xhci_slot_ctx_t slot_ctx; 134 xhci_ep_ctx_t endpoint_ctx [31];136 xhci_ep_ctx_t endpoint_ctx[XHCI_EP_COUNT]; 135 137 } __attribute__((packed)) xhci_device_ctx_t; 136 138 … … 165 167 166 168 #define XHCI_INPUT_CTRL_CTX_ADD_SET(ctx, idx) (ctx).data[1] |= (1 << (idx)) 167 169 168 170 #define XHCI_INPUT_CTRL_CTX_CONFIG_VALUE(ctx) XHCI_DWORD_EXTRACT((ctx).data[7], 7, 0) 169 171 #define XHCI_INPUT_CTRL_CTX_IFACE_NUMBER(ctx) XHCI_DWORD_EXTRACT((ctx).data[7], 15, 8) … … 177 179 xhci_input_ctrl_ctx_t ctrl_ctx; 178 180 xhci_slot_ctx_t slot_ctx; 179 xhci_ep_ctx_t endpoint_ctx [31];181 xhci_ep_ctx_t endpoint_ctx[XHCI_EP_COUNT]; 180 182 } __attribute__((packed)) xhci_input_ctx_t; 181 183 -
uspace/drv/bus/usb/xhci/rh.c
re439f468 r706a3e2 115 115 116 116 hc->dcbaa[slot_id] = addr_to_phys(dctx); 117 hc->dcbaa_virt[slot_id] = dctx;117 hc->dcbaa_virt[slot_id]->dev_ctx = dctx; 118 118 119 119 cmd = xhci_alloc_command();
Note:
See TracChangeset
for help on using the changeset viewer.