ioctl driver call additional info

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

 



This issue appears to be related to the amount of data that I am 
attempting to pass in ioctl calls.

Question 1:  I am confused about the true use of the _IOWR macro, is the 
third argument the type of the data being passed or is it the type of 
the pointer being used to pass the data eg

typedef struct
{
long one;
long two
int three;
} DMA;<==== this struct is 625 bytes long FYI


#define THECALL _IOWR(UNIQUEMAGIC, 0x0d, DMA)

OR

#define THECALL _IOWR(UNIQUEMAGIC, 0x0d, DMA*)

Question 2:

Is there a limit to the size of the data that I can pass?

The symptom is that ALL ioctl calls fail if I add a new case to the 
ioctl handler switch statment.  At this time this call is not even 
happening, but calls that are initializing the device begin to fail once 
I have added the code for this call. The failure mode is that the 
copy_from_user statment fails to copy any data.

If I comment out the case statment reference to the struct in question, 
things begin to work again.


ANY insight to this would be greatly appreciated.



In previous episodes:

I am writing a driver that is causing me fits.  I can open the driver
without problem, but the first ioctl call causes an infinite number...or
until I hit reset,  number of "cannot handle kernel paging request"
errors printed out.  If I change the code slightly....like adding a
printk the error statment may change to invalid operand: 0000.  I have
several prink statements that don't get printed out within the ioctl
function in the driver prior to the switch statment that will handle the
given request...this acts like when I insmod my module, the function
address don't get resolved correctly and that my function call gets lost.

Any thoughts and/or debugging suggestions would be most welcome.




TIA
David

--
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