Skip to contentSkip to conversation

Ioctl

DISCUSSION Brian D. McGrew 3 participants 3 messages Jan 31, 2011

lore
Share & tools
lore
#0 lore raw

Hello,

I'm very new at working with the kernel and device drivers and I'm trying to bring ours drivers up from a 2.6.16 kernel to 2.6.37. I'm noticing that ioctl() doesn't seem to be raound anymore, or at least I can't find it.

There is tons of stuff in my code that I don't yet understand which requires the ioctl function. What is the best way for me to either get the ioctl working in 2.6.37, or the quickest way to work around it???

Thanks,

-b

#1 lore raw
Quoted 9 lines · On Mon, 31 Jan 2011 11:39:13 -0800 Brian D. McGrew wrote:

Hello,

I'm very new at working with the kernel and device drivers and I'm trying to bring ours drivers up from a 2.6.16 kernel to 2.6.37. I'm noticing that ioctl() doesn't seem to be raound anymore, or at least I can't find it.

There is tons of stuff in my code that I don't yet understand which requires the ioctl function. What is the best way for me to either get the ioctl working in 2.6.37, or the quickest way to work around it???

ioctl() is still around.

fs/ioctl.c:
SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) {

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#2 lore raw
In reply to Brian D. McGrew
Quoted 3 lines · On Mon, 31 Jan 2011 11:39:13 -0800 "Brian D. McGrew" <[email protected]>…

I'm very new at working with the kernel and device drivers and I'm trying to bring ours drivers up from a 2.6.16 kernel to 2.6.37. I'm noticing that ioctl() doesn't seem to be raound anymore, or at least I can't find it.

What you almost certainly want is unlocked_ioctl(), which handles ioctl() calls but lacks the protection of the (soon to be removed) big kernel lock. If your driver is properly written, you should have no problem using unlocked_ioctl(), but do note that the function prototype is a little different.

jon