Re: ioctl call fails with unknown command



On Feb 20, 1:18 pm, mcha...@xxxxxxxxx wrote:
hi, when trying to do ioctl call to my driver, i keep getting an error
message: unknown command fd(3). it seems that the ioctl

call is not invoking my driver ioctal method because the debug message
inside my ioctl method never get printed out.
although this may seems like i am using incorrect file descriptor,
since my ioctl method is not even being called, i know i am

using the correct file descriptor because my 'read' method gets
invoked fine.
And using the same code and driver, i was able to get it to work on a
486 target machine but it doesn't seem to work with this

particular linux version.

how can i debug this code? where in the kernel code can i begin to
trace to see what is happening? which file/function gets

called when ioctl function is fisrt called?
(i don't have a debugger and i am not able to gdb the code so i need
to resort to printing out debug messages in the source

code.)

thank you in advance.
ioctl call fails with unknown comma

I am assuming that you are using 2.6.x kernel. If so use one of the
macros provided by the kernel to specify IOCTLs such as:
_IO( 'k', 0)
_IOR( 'k', 2)
_IOW( 'k', 4)
_IOWR( 'k', 5)

etc.

Make sure the file open succeeds before attempting to call its IOCTLs.
Eg:
myfile = open("/dev/mydevice0", O_RDWR | O_SYNC);

ioctl( myfile, 4, 1234);

.



Relevant Pages

  • Re: TFAT issue
    ... be TFAT, look for the TFAT debug messages. ... 0x8f7ce800: Enter ioctl 00000002 ... 0x8ef7eb2c: Exit ioctl 00000002 ...
    (microsoft.public.windowsce.platbuilder)
  • Re: TFAT issue
    ... there is a separate TFAT debug zone. ... 0x8f7ce800: Enter ioctl 00000002 ... 0x8ef7eb2c: Exit ioctl 00000002 ...
    (microsoft.public.windowsce.platbuilder)
  • Re: TFAT issue
    ... be TFAT, look for the TFAT debug messages. ... 0x8f7ce800: Enter ioctl 00000002 ... 0x8ef7eb2c: Exit ioctl 00000002 ...
    (microsoft.public.windowsce.platbuilder)
  • ioctl call fails with unknown command
    ... hi, when trying to do ioctl call to my driver, i keep getting an error ... message: unknown command fd. ... inside my ioctl method never get printed out. ...
    (comp.os.linux.development.system)