Changeset a38d504 in mainline


Ignore:
Timestamp:
2024-06-11T09:00:20Z (3 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
9739b5a
Parents:
645d3832
git-author:
Jiri Svoboda <jiri@…> (2024-06-10 17:59:56)
git-committer:
Jiri Svoboda <jiri@…> (2024-06-11 09:00:20)
Message:

Limit I/O operations not to exceed DMA buffer size

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/pci-ide/pci-ide.c

    r645d3832 ra38d504  
    226226        params.have_irq = (chan->irq >= 0) ? true : false;
    227227        params.use_dma = true;
     228        params.max_dma_xfer = chan->dma_buf_size;
    228229        params.write_data_16 = pci_ide_write_data_16;
    229230        params.read_data_16 = pci_ide_read_data_16;
  • uspace/lib/ata/include/ata/ata.h

    r645d3832 ra38d504  
    6363        /** Use DMA transfers */
    6464        bool use_dma;
     65        /** Maximum number of bytes that we can DMA in one I/O operation */
     66        size_t max_dma_xfer;
    6567        /** Read 16 bits from the data port */
    6668        void (*write_data_16)(void *, uint16_t *, size_t);
  • uspace/lib/ata/src/ata.c

    r645d3832 ra38d504  
    14191419{
    14201420        size_t maxnb;
     1421        size_t dma_maxnb;
    14211422
    14221423        maxnb = 0;
     
    14411442         * exceed DMA buffer size.
    14421443         */
     1444        dma_maxnb = d->chan->params.max_dma_xfer / d->block_size;
     1445        if (dma_maxnb < maxnb)
     1446                maxnb = dma_maxnb;
     1447
    14431448        return maxnb;
    14441449}
Note: See TracChangeset for help on using the changeset viewer.