unlocked_ioctl vs normal ioctl

后端 未结 3 1596
难免孤独
难免孤独 2021-02-05 12:33

In my driver\'s file_operations structure, I have:

struct file_operations Fops = {
  read:    device_read,
  write:   device_write,
  unlocked_ioctl:   device_io         


        
3条回答
  •  囚心锁ツ
    2021-02-05 13:10

    Uhm, I solved this. It is also required to change signature of device_ioctl function. There is no inode parameter, and also the function should return long. Just like in following patch:

    -static int st_ioctl(struct inode *inode, struct file *file,
    - unsigned int cmd_in, unsigned long arg)
    +static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
    {
    

    (from: http://linux.derkeiler.com/Mailing-Lists/Kernel/2008-01/msg06799.html)

提交回复
热议问题