linux-mips
[Top] [All Lists]

pci_alloc_consistent() usage

To: linux-mips@linux-mips.org
Subject: pci_alloc_consistent() usage
From: "Vadivelan Mani" <daff_vadi@hotmail.com>
Date: Tue, 13 Jul 2004 18:31:01 +0530
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
hi,

I'm writing a wireless driver which requires 8 transmit and 8 receive buffers each of size 3KB approx.

These buffers should be in dma capable space.

I've allocated them using pci_alloc_consistent().

I've allocated 128KBytes just to make more space. I've got few doubts.

  1. Can pci_alloc_consistent() be used to allocate memory upto 128KBytes?

If this is not possible, how much can it allocate?



2.) I would also like to know the exact use of this allocated space to transmit or receive a packet.

During transmission i do the following. Plz correct me if i'm wrong because i'm new to driver writing.

The device has a register which should be loaded with the transmit buffers starting address.

I copy the packet coming from the Kernel in the form of sk_buff structure into one of the transmit buffers that i've allocated using memcpy().
And i set the register in the device to initiate transmission of the packet.

Where does the dma transfer concept come in this?
There is no mention of the direction of data transfer in pci_alloc_consistent().

I also assumed that allocating buffer in dma capable space was itself enough to start dma transfers.

Since i do not have the device now i'm not able to test the code. But i would like to write the code before i get the device.

Kindly help me in this.

thanking u in advance.

regards,
vadi.

_________________________________________________________________
Marriage by choice.... http://www.shaadi.com/ptnr.php?ptnr=hmltag Log onto Shaadi.com


<Prev in Thread] Current Thread [Next in Thread>