ioctl in a module - sending more than one paramter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello , 
 I am writing a module which can get input from user space.

This module uses iocl to get the input from user space.

In order to use ioctl, I call register_chrdev(major_num,MY_DEVICE_NAME,my_fops) 
where my_fops is an instance of struct file_operations.
In this struct, the ioctl member is  my_ioctl. 
the ioctl  of struct file_operations is declared thus:
        ....
	int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
        ....
This mean , as I understand, that I can pass in fact only one 
parameter to ths ioctl (since the third argument is the IOCTL number, and the 
fourth argument is in fact the parameter I am passing). 

I want to pass 2 parameters to the ioctl, not only one. (the second
one can be also a long or int)
In the LDD3 book , chapter 6,they give an example of using 
ioctls and passing one parameter. They also say that you can pass more 
than one parameter but they don't give an example how to do it.

So how can I pass more than one parameter to an ioctl ? 

I want to empasize that my module is not a real char device driver, because 
it in fact does not use any hw.

So from my point of view , the register_chrdev is NOT a must, if 
something else will solve my problem.

Any idea? 

TIA,

Regards,
John

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux