From: Kumar V <vhkumar95@yahoo.com>
To: linux-kernel@vger.kernel.org
Subject: DMA-ACQ-HELP
Date: Tue, 15 Jun 2004 02:03:30 -0700 (PDT) [thread overview]
Message-ID: <20040615090330.81780.qmail@web54101.mail.yahoo.com> (raw)
Hi All,
I would like to acquire the data through DMA @1kbps
contineously.
I am not able to acquire the data correctly, I am
missing the data.
What would be the reason. From H/W side there is no
problem.
Here Idea is to divide 4k into 128 block of data i.e.
4096/128=32 blocks and I would like to take previously
acquired
block of data. After 4kb it should roll back to
starting, like circular
Q.
Here is the driver code for the same.
Please help me what would be the problem.
Thanks in advance.
Regards
V. Kumar.
*********************************
At open entry
dma_buff = __get_dma_pages(__GFP_DMA, 0); //
1-page(4096 byte)
flags = claim_dma_lock ();
disable_dma (dma_ch);
clear_dma_ff (dma_ch);
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,4096 );
enable_dma (dma_ch);
release_dma_lock (flags);
*******************************
At Read Entry
flags = claim_dma_lock ();
residue = get_dma_residue (dma_ch);
// just to wait for at least 1k bytes to acquire
if (( prev_cntr-residue) < 128 )
{
prevcntr = residue ;
return 0 ;
}
prev_cntr = residue ;
i = 4096 - residue;
// Copying the acquired data to tmp buff of 128 bytes
// mean time DMA can continue the data transfer
start = (int)(i / 128);
start = start * 128;
for (i = 0; i < 128; i++)
tbuff[i] = dma_buff[start + i];
__copy_to_user ((unsigned char *) buf, (unsigned char
*) tbuff,
sizeof (tbuff));
*******************************
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
reply other threads:[~2004-06-15 9:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040615090330.81780.qmail@web54101.mail.yahoo.com \
--to=vhkumar95@yahoo.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®