Changeset b80c1ab in mainline for uspace/drv/bus/usb/xhci/endpoint.c
- Timestamp:
- 2017-11-14T23:17:54Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e76c0ea
- Parents:
- cfe4852
- git-author:
- Aearsis <Hlavaty.Ondrej@…> (2017-11-14 23:15:24)
- git-committer:
- Aearsis <Hlavaty.Ondrej@…> (2017-11-14 23:17:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/endpoint.c
rcfe4852 rb80c1ab 34 34 */ 35 35 36 #include <usb/host/utils/malloc32.h>37 36 #include <usb/host/endpoint.h> 38 37 #include <usb/descriptor.h> … … 135 134 136 135 XHCI_EP_MAX_P_STREAMS_SET(*ctx, pstreams); 137 XHCI_EP_TR_DPTR_SET(*ctx, addr_to_phys(xhci_ep->primary_stream_ctx_array));136 XHCI_EP_TR_DPTR_SET(*ctx, xhci_ep->primary_stream_ctx_dma.phys); 138 137 // TODO: set HID? 139 138 XHCI_EP_LSA_SET(*ctx, 1); … … 167 166 usb_log_debug2("Allocating primary stream context array of size %u for endpoint " XHCI_EP_FMT, 168 167 count, XHCI_EP_ARGS(*xhci_ep)); 169 xhci_ep->primary_stream_ctx_array = malloc32(count * sizeof(xhci_stream_ctx_t)); 170 if (!xhci_ep->primary_stream_ctx_array) { 168 if ((dma_buffer_alloc(&xhci_ep->primary_stream_ctx_dma, count * sizeof(xhci_stream_ctx_t)))) 171 169 return ENOMEM; 172 }170 xhci_ep->primary_stream_ctx_array = xhci_ep->primary_stream_ctx_dma.virt; 173 171 174 172 xhci_ep->primary_stream_rings = calloc(count, sizeof(xhci_trb_ring_t)); 175 173 if (!xhci_ep->primary_stream_rings) { 176 free32(xhci_ep->primary_stream_ctx_array);174 dma_buffer_free(&xhci_ep->primary_stream_ctx_dma); 177 175 return ENOMEM; 178 176 } … … 227 225 // FIXME: Get the trb ring associated with stream [index] and fini it 228 226 } 229 free32(xhci_ep->primary_stream_ctx_array);227 dma_buffer_free(&xhci_ep->primary_stream_ctx_dma); 230 228 } else { 231 229 usb_log_debug2("Freeing main transfer ring of endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep));
Note:
See TracChangeset
for help on using the changeset viewer.