kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* what does it use two "!!"
@ 2013-04-01  7:13 Ben Wu
  2013-04-01  7:18 ` anish singh
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ben Wu @ 2013-04-01  7:13 UTC (permalink / raw)
  To: 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 at yahoo.cn

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130401/92c770c5/attachment.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread
* pci_alloc_consistent doubt
@ 2013-04-01  4:12 Avinash Patil
  2013-04-01  7:10 ` what does it use two "!!" Ben Wu
  0 siblings, 1 reply; 6+ messages in thread
From: Avinash Patil @ 2013-04-01  4:12 UTC (permalink / raw)
  To: kernelnewbies

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 at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130401/134f5032/attachment.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-01 23:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-01  7:13 what does it use two "!!" Ben Wu
2013-04-01  7:18 ` anish singh
2013-04-01 13:47 ` Christopher Harvey
2013-04-01 23:36 ` Jonathan Neuschäfer
  -- strict thread matches above, loose matches on Subject: below --
2013-04-01  4:12 pci_alloc_consistent doubt Avinash Patil
2013-04-01  7:10 ` what does it use two "!!" Ben Wu
2013-04-01  9:37   ` Valdis.Kletnieks at vt.edu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).