Changeset 1d758fc in mainline for uspace/drv/bus/usb/xhci/scratchpad.c


Ignore:
Timestamp:
2018-02-12T10:11:47Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5fe3f954
Parents:
2f762a7
git-author:
Ondřej Hlavatý <aearsis@…> (2018-02-05 03:28:50)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-02-12 10:11:47)
Message:

usb: rethinking DMA buffers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/scratchpad.c

    r2f762a7 r1d758fc  
    7272        memset(hc->scratchpad_array.virt, 0, size);
    7373
    74         uint64_t phys_begin = hc->scratchpad_array.phys + array_size;
     74        const char *base = hc->scratchpad_array.virt + array_size;
    7575        uint64_t *array = hc->scratchpad_array.virt;
    7676
    77         for (unsigned i = 0; i < num_bufs; ++i)
    78                 array[i] = host2xhci(64, phys_begin + i * PAGE_SIZE);
     77        for (unsigned i = 0; i < num_bufs; ++i) {
     78                array[i] = host2xhci(64, dma_buffer_phys(&hc->scratchpad_array,
     79                            base + i * PAGE_SIZE));
     80        }
    7981
    80         hc->dcbaa[0] = host2xhci(64, hc->scratchpad_array.phys);
     82        hc->dcbaa[0] = host2xhci(64, dma_buffer_phys_base(&hc->scratchpad_array));
    8183
    8284        usb_log_debug("Allocated %d scratchpad buffers.", num_bufs);
Note: See TracChangeset for help on using the changeset viewer.