[LIP] DMA data transfer
Kumar V <vhkumar95-/[email protected]>
| Newsgroups | gmane.user-groups.linux.india.programmers |
|---|---|
| Message-ID | <[email protected]> |
Hi All, I had gone through the Rubbini Book that to be perticularly chap-13 for DMA Data Transfer. Here is code for my driver for DMA transfer. At open entry dma_buff = __get_dma_pages(__GFP_DMA, get_order(1024)); flags = claim_dma_lock (); disable_dma (dma_ch); clear_dma_ff (dma_ch); //It Should be circular-Q that's the reason DMA_AUTOINIT. set_dma_mode (dma_ch, DMA_MODE_READ | DMA_AUTOINIT); set_dma_addr (dma_ch, virt_to_bus (dma_buff)); set_dma_count (dma_ch,1024 ); enable_dma (dma_ch); release_dma_lock (flags); ******************************* At Read Entry flags = claim_dma_lock (); residue = get_dma_residue (dma_ch); i = 1024 - residue; // Copying the acquired data to tmp buff of 128 bytes // mean time DMA can continue the data transfer for (i = 0; i < 128; i++) tbuff[i] = dma_buff[start + i]; __copy_to_user ((unsigned char *) buf, (unsigned char *) tbuff, sizeof (tbuff)); ******************************* The user program will read these bytes and dump into a file @ every one second. The system is hanging without giving any message at syslog/on console also. I would like to know What would be the reason, I am using the ReHat-8.0 with kernel-2.6.6 Any help or pointers/links is apreciated. Thanks in advance Regards V. Kumar. __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click