c - functionality of pci_set_dma_mask -


i bit confused pci_set_dma_mask. can explain me happens in below code.

#define dma_64bit_mask dma_bit_mask(64) pci_set_dma_mask(dev, dma_64bit_mask) 

regards rabinarayan

basically dma_bit_mask(64) macro returns 64bit address of '1's. ie. 0xffff ffff ffff ffff

if dma_bit_mask(32) used, 0xffff ffff

pci_set_dma_mask(dev, dma_64bit_mask) used query pcie device represented dev : support 64-bit dma? dev provided when standard kernel driver initialization routines called.

from kernel documentation :

it returns 0 if card can perform dma on machine given address mask provided. in general, device struct of device embedded in bus-specific device struct of device. example, &pdev->dev pointer device struct of pci device (pdev pointer pci device struct of device).

if returns non-zero, device cannot perform dma on platform, , attempting result in undefined behavior. must either use different mask, or not use dma.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -