Hi All, I am fairly New to Linux kernel Programming and i have few questions with respect to pci_alloc_consistent . 1) as we know pci_alloc_consistent allocates dma buffers which is visible to DMA controller as well as CPU. virt_add = pci_alloc_consistent(pdev, size, dma_addr_t bus_adrr); here it will allocate a buffer and return its virtual address and corresponding bus address. My question is do these two address ultimately point to similar location but from different perspectives ?. 2) After allocating these address, how do we proceed given that i have a ASIC register which has the dma_rx_desc_start address ? 3) Also does all the HW's which support dma have the descriptor data structures by provided by Vender or is there any specific format that dev has to be aware of for designing such descriptor for that particular driver ?
On Thu, Mar 28, 2013 at 1:14 AM, Dhananjay Maske < dhananjay.maske87@gmail.com> wrote:
Hi All, I am fairly New to Linux kernel Programming and i have few questions with respect to pci_alloc_consistent .
1) as we know pci_alloc_consistent allocates dma buffers which is visible to DMA controller as well as CPU. virt_add = pci_alloc_consistent(pdev, size, dma_addr_t bus_adrr);
here it will allocate a buffer and return its virtual address and corresponding bus address.
My question is do these two address ultimately point to similar location but from different perspectives ?.
2) After allocating these address, how do we proceed given that i have a ASIC register which has the dma_rx_desc_start address ?
3) Also does all the HW's which support dma have the descriptor data structures by provided by Vender or is there any specific format that dev has to be aware of for designing such descriptor for that particular driver ?
Hi Everyone, Can some one please help me with pci_alloc_consistent and how to use the buffer allocated by it ?. Thank you in Advance. Djay On Thu, Mar 28, 2013 at 10:08 AM, Dhananjay Maske < dhananjay.maske87@gmail.com> wrote:
On Thu, Mar 28, 2013 at 1:14 AM, Dhananjay Maske < dhananjay.maske87@gmail.com> wrote:
Hi All, I am fairly New to Linux kernel Programming and i have few questions with respect to pci_alloc_consistent .
1) as we know pci_alloc_consistent allocates dma buffers which is visible to DMA controller as well as CPU. virt_add = pci_alloc_consistent(pdev, size, dma_addr_t bus_adrr);
here it will allocate a buffer and return its virtual address and corresponding bus address.
My question is do these two address ultimately point to similar location but from different perspectives ?.
2) After allocating these address, how do we proceed given that i have a ASIC register which has the dma_rx_desc_start address ?
3) Also does all the HW's which support dma have the descriptor data structures by provided by Vender or is there any specific format that dev has to be aware of for designing such descriptor for that particular driver ?
On Sun, Mar 31, 2013 at 12:11 AM, Dhananjay Maske < dhananjay.maske87@gmail.com> wrote:
Hi Everyone, Can some one please help me with pci_alloc_consistent and how to use the buffer allocated by it ?.
Thank you in Advance. Djay
On Thu, Mar 28, 2013 at 10:08 AM, Dhananjay Maske < dhananjay.maske87@gmail.com> wrote:
On Thu, Mar 28, 2013 at 1:14 AM, Dhananjay Maske < dhananjay.maske87@gmail.com> wrote:
Hi All, I am fairly New to Linux kernel Programming and i have few questions with respect to pci_alloc_consistent .
1) as we know pci_alloc_consistent allocates dma buffers which is visible to DMA controller as well as CPU. virt_add = pci_alloc_consistent(pdev, size, dma_addr_t bus_adrr);
here it will allocate a buffer and return its virtual address and corresponding bus address.
My question is do these two address ultimately point to similar location but from different perspectives ?.
2) After allocating these address, how do we proceed given that i have a ASIC register which has the dma_rx_desc_start address ?
3) Also does all the HW's which support dma have the descriptor data structures by provided by Vender or is there any specific format that dev has to be aware of for designing such descriptor for that particular driver ?
AFAIK. 1) as we know pci_alloc_consistent allocates dma buffers which is visible to DMA controller as well as CPU. virt_add = pci_alloc_consistent(pdev, size, dma_addr_t bus_adrr); here it will allocate a buffer and return its virtual address and corresponding bus address. My question is do these two address ultimately point to similar location but from different perspectives ?. Avinash: Yes both virtual and physical addresses point to same location. BAR at the enumeration of PCI devices allocates specific address for PCI devices from RAM and your alloc_consistent uses these addresses. 2) After allocating these address, how do we proceed given that i have a ASIC register which has the dma_rx_desc_start address ? Avinash: Here is a link which can help you for creating rings, creating your ISR which handles different vendor specific interrupts etc http://netsecinfo.blogspot.in/search?q=PCIe Avinash: 3) Also does all the HW's which support dma have the descriptor data structures by provided by Vender or is there any specific format that dev has to be aware of for designing such descriptor for that particular driver ? Avinash: These structures are vendor specific which may contain physical address, length etc. On Thu, Mar 28, 2013 at 1:14 AM, Dhananjay Maske < dhananjay.maske87@gmail.com> wrote:
Hi All, I am fairly New to Linux kernel Programming and i have few questions with respect to pci_alloc_consistent .
1) as we know pci_alloc_consistent allocates dma buffers which is visible to DMA controller as well as CPU. virt_add = pci_alloc_consistent(pdev, size, dma_addr_t bus_adrr);
here it will allocate a buffer and return its virtual address and corresponding bus address.
My question is do these two address ultimately point to similar location but from different perspectives ?.
2) After allocating these address, how do we proceed given that i have a ASIC register which has the dma_rx_desc_start address ?
3) Also does all the HW's which support dma have the descriptor data structures by provided by Vender or is there any specific format that dev has to be aware of for designing such descriptor for that particular driver ?
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Dear All: 1> I found some placeuse two "!!", what's means if(button->gpio != INVALID_GPIO) state = !!((gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low); else state = !!button->adc_state; 2> is there some MSN group to study linux kernel or discuss it ? Thanks and Best Regards Ben Wu MSN:crayben@yahoo.cn
On Mon, 01 Apr 2013 15:10:46 +0800, Ben Wu said:
1> I found some placeuse two "!!", what's means if(button->gpio != INVALID_GPIO) state = !!((gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low); else
Gaah. That line of code fell out of the ugly tree and hit every branch on the way down. Use of "!!" *and* "? 1 :0 " in the same line of code to do the same thing. Ouch.
Please see my question inline. Thanks in Advance, Dhananjay On Mon, Apr 1, 2013 at 9:42 AM, Avinash Patil <avinashapatil@gmail.com>wrote:
AFAIK.
1) as we know pci_alloc_consistent allocates dma buffers which is visible to DMA controller as well as CPU. virt_add = pci_alloc_consistent(pdev, size, dma_addr_t bus_adrr);
here it will allocate a buffer and return its virtual address and corresponding bus address.
My question is do these two address ultimately point to similar location but from different perspectives ?.
Avinash: Yes both virtual and physical addresses point to same location. BAR at the enumeration of PCI devices allocates specific address for PCI devices from RAM and your alloc_consistent uses these addresses.
Dhananjay : I am quiet confused about what do you mean by "these" addresses here ?. Do you mean dma buffer bus address allocated by alloc_consistent or BAR bus addresses which can be seen in /proc/pci ?
2) After allocating these address, how do we proceed given that i have a ASIC register which has the dma_rx_desc_start address ? Avinash: Here is a link which can help you for creating rings, creating your ISR which handles different vendor specific interrupts etc
http://netsecinfo.blogspot.in/search?q=PCIe
Avinash: 3) Also does all the HW's which support dma have the descriptor data structures by provided by Vender or is there any specific format that dev has to be aware of for designing such descriptor for that particular driver ? Avinash: These structures are vendor specific which may contain physical address, length etc.
On Thu, Mar 28, 2013 at 1:14 AM, Dhananjay Maske < dhananjay.maske87@gmail.com> wrote:
Hi All, I am fairly New to Linux kernel Programming and i have few questions with respect to pci_alloc_consistent .
1) as we know pci_alloc_consistent allocates dma buffers which is visible to DMA controller as well as CPU. virt_add = pci_alloc_consistent(pdev, size, dma_addr_t bus_adrr);
here it will allocate a buffer and return its virtual address and corresponding bus address.
My question is do these two address ultimately point to similar location but from different perspectives ?.
2) After allocating these address, how do we proceed given that i have a ASIC register which has the dma_rx_desc_start address ?
3) Also does all the HW's which support dma have the descriptor data structures by provided by Vender or is there any specific format that dev has to be aware of for designing such descriptor for that particular driver ?
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
participants (4)
-
Avinash Patil -
Ben Wu -
Dhananjay Maske -
Valdis.Kletnieks@vt.edu