Hi, Actually IOCTL provides a entrypoint for your driver. read, write are other entry points. these entry points can be used for any purposes. but as a convention, IOCTL is used for configuring the device. --- Dan Erickson <coldoneknight@rogers.com> wrote: > > Recently I had some help from somebody on the > openprojects irc > server in channel #kernelnewbies. > I was asking how ioctl works and what not, and was > extremely > confussed. My purpose of this letter is to ask some > questions, but to also > make sure my understanding of it is correct and not > false. > So... I will start off my showing an example which I > grabbed from the > kernel source for the pci watchdog (wdt_pci.c). This > is just one of the > options the card supports. > > case WDIOC_KEEPALIVE: > wdtpci_ping(); > return 0; > > So basicly wdtpci_ping() is the code for > WDIOC_KEEPALIVE. > (What to do when WDIOC_KEEPALIVE is called). > (is my thinking on this correct?) > > I asked the person I was talking to on > #kernelnewbies what sends the > command? ie) the unsigned int cmd in ioctl. > And he said a userspace program sends the command. > Is this true? > What I mean, is that something needs to say "I want > to keep the computer > alive". So I will call WDIOC_KEEPALIVE to do this > for me. And it was > highly confussing me as to what actualy sends the > WDIOC_KEEPALIVE to the > driver. > > Could somebody please clear this up for me? > > > Thanks alot > > -Dan Erickson- > -ColdOneKnight@rogers.com- > > > > -- > Kernelnewbies: Help each other learn about the Linux > kernel. > Archive: > http://mail.nl.linux.org/kernelnewbies/ > FAQ: http://kernelnewbies.org/faq/ > -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/