DMA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi everyone,

i am a beginner level in driver programming. please help to solve this problem.

 
this is a part of the internal modem driver coding. this is for intel chip set internal modem.

-------------------------------------------------------------------------------------------------------------------------------------------------------------

// ZT_MAX_CHUNKSIZE = 8


wc->writechunk = (int *)pci_alloc_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, &wc->writedma);
    if (!wc->writechunk) {
        printk("wcfxo: Unable to allocate DMA-able memory\n");
        if (wc->freeregion)
            release_region(wc->ioaddr, 0xff);
        return -ENOMEM;
    }

    wc->readchunk = wc->writechunk + ZT_MAX_CHUNKSIZE * 4;    /* in doublewords */
    wc->readdma = wc->writedma + ZT_MAX_CHUNKSIZE * 16;        /* in bytes */

---------------------------------------------------------------------------------------------------------------------------------------------------------------


here they are creating 2 chunks for writing and reading.


but i couldn't understand this line.
wc->readdma = wc->writedma + ZT_MAX_CHUNKSIZE * 16;

why are they using ZT_MAX_CHUNKSIZE * 16 for allocating read chunk?




-jeyram

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux