Sharing ioctls between char and net device

Jan Kasprzak (Jan.Kasprzak@eunet.cz)
Wed, 14 Oct 1998 21:50:11 +0200


Hi all,

I am developing a driver for a synchronous serial board
(http://www.fi.muni.cz/~kas/cosa/). The driver can work as the character
device or as the network interface. I have written an user-space utility
for downloading firmware, resetting the card, querying the hardware
type etc. I would like to allow this user-space utility work both
via the ioctl on the character device and via the ioctl on the
network socket.

Now the problem is whether this can be done with the
same ioctl command numbering for both ways. The dev->do_ioctl accepts only
the SIOCDEVPRIVATE .. SIOCDEVPRIVATE+15 ioctls according to
linux/net/core/dev.c (and the first two numbers are already used
by the syncppp/hdlc layer -- see the linux/drivers/net/syncppp.h).
But using these ioctls for the character
device seems a bit ugly to me (the clean way is to use the _IOW/_IOR
macros for generating the ioctl command numbers).

What would you suggest to use?

-Yenya

--
\   Jan "Yenya" Kasprzak <kas@eunet.cz>    http://www.fi.muni.cz/~kas/   /
\\  PGP: finger kas@brn.traveller.cz A49AB5ECECDBD3DA 83980A92BD19994B  //
\\\            Czech Linux Homepage at http://www.linux.cz             ///
/// Yow! 11.26 MB/s remote host TCP bandwidth  &  199 usec remote TCP  \\\
//  latency over 100Mb/s ethernet.  Beat that!                [Linux]   \\

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/