OmerY
OmerY

Reputation: 41

implementing read/write file_operations in a pci device driver

I am writing a pci driver for a PCIe FPGA card.

I am not sure how to implement the "read" and "write" functions - How to use the arguments: struct file *filp, char _ _user *buff, size_t count, loff_t *offp, correctly in order to do reads and writes to pci memory space.

Can you give me examples of how to use these functions, along with an example of using open/release as well.

Upvotes: 4

Views: 2711

Answers (1)

msh
msh

Reputation: 2770

LDD3 includes a sample character driver "scull" which implements file operations (including read and write) on a memory area. Should be easy to adapt it for your purposes.

Upvotes: 3

Related Questions