Changeset b80c1ab in mainline for uspace/drv/bus/usb/xhci/transfers.c
- Timestamp:
- 2017-11-14T23:17:54Z (7 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/transfers.c
rcfe4852 rb80c1ab 34 34 */ 35 35 36 #include <usb/host/utils/malloc32.h>37 36 #include <usb/debug.h> 38 37 #include <usb/request.h> … … 113 112 assert(transfer); 114 113 115 if (transfer->hc_buffer) 116 free32(transfer->hc_buffer); 114 dma_buffer_free(&transfer->hc_buffer); 117 115 } 118 116 … … 156 154 xhci_trb_clean(trb_data); 157 155 158 trb_data->parameter = addr_to_phys(transfer->hc_buffer);156 trb_data->parameter = host2xhci(64, transfer->hc_buffer.phys); 159 157 160 158 // data size (sent for OUT, or buffer size) … … 196 194 xhci_trb_t trb; 197 195 xhci_trb_clean(&trb); 198 trb.parameter = addr_to_phys(transfer->hc_buffer);196 trb.parameter = host2xhci(64, transfer->hc_buffer.phys); 199 197 200 198 // data size (sent for OUT, or buffer size) … … 217 215 xhci_trb_t trb; 218 216 xhci_trb_clean(&trb); 219 trb.parameter = addr_to_phys(transfer->hc_buffer);217 trb.parameter = host2xhci(64, transfer->hc_buffer.phys); 220 218 221 219 // data size (sent for OUT, or buffer size) … … 282 280 assert(batch->buffer); 283 281 assert(batch->transfered_size <= batch->buffer_size); 284 memcpy(batch->buffer, transfer->hc_buffer , batch->transfered_size);282 memcpy(batch->buffer, transfer->hc_buffer.virt, batch->transfered_size); 285 283 } 286 284 … … 324 322 325 323 if (batch->buffer_size > 0) { 326 transfer->hc_buffer = malloc32(batch->buffer_size); 327 if (!transfer->hc_buffer) 324 if (dma_buffer_alloc(&transfer->hc_buffer, batch->buffer_size)) 328 325 return ENOMEM; 329 326 } … … 331 328 if (batch->dir != USB_DIRECTION_IN) { 332 329 // Sending stuff from host to device, we need to copy the actual data. 333 memcpy(transfer->hc_buffer , batch->buffer, batch->buffer_size);330 memcpy(transfer->hc_buffer.virt, batch->buffer, batch->buffer_size); 334 331 } 335 332
Note:
See TracChangeset
for help on using the changeset viewer.