linux - Connecting character device and physical PCIe driver -


i modifying existing linux device driver , library api. modification allow multiple devices (it hard-coded 1 device). 1 concept don't understand mapping between character device , pcie device itself.

when initializing driver in probe method, create character device (or multiple). library api makes ioctl call using file descriptor character device. in driver itself, maintaining global variable device contains pci information. next step maintain state information pci device.

what don't understand link between character devices created , pcie state information in driver. understanding character device created, , when open it, or ioctl it, commands mapped through driver. not sure how link character device receiving through device structure want control though.

you can use minor device number so.

when being probed, can register char devices same major number , different minor number , map own struct minor number. when ioctl called, can minor number cdev->dev can find own struct.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -