Google
  Web www.spinics.net

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

[Newbies FAQ]     [Kernel List]     [Site Home]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Rubini]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Networking]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]     [DDR & Rambus]     [UNIX Filesystems]     [Linux Resources]

Add to Google Powered by Linux