ia64/linux-2.6.18-xen.hg

annotate Documentation/ioctl-number.txt @ 854:950b9eb27661

usbback: fix urb interval value for interrupt urbs.

Signed-off-by: Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Apr 06 13:51:20 2009 +0100 (2009-04-06)
parents 831230e53067
children
rev   line source
ian@0 1 Ioctl Numbers
ian@0 2 19 October 1999
ian@0 3 Michael Elizabeth Chastain
ian@0 4 <mec@shout.net>
ian@0 5
ian@0 6 If you are adding new ioctl's to the kernel, you should use the _IO
ian@0 7 macros defined in <linux/ioctl.h>:
ian@0 8
ian@0 9 _IO an ioctl with no parameters
ian@0 10 _IOW an ioctl with write parameters (copy_from_user)
ian@0 11 _IOR an ioctl with read parameters (copy_to_user)
ian@0 12 _IOWR an ioctl with both write and read parameters.
ian@0 13
ian@0 14 'Write' and 'read' are from the user's point of view, just like the
ian@0 15 system calls 'write' and 'read'. For example, a SET_FOO ioctl would
ian@0 16 be _IOW, although the kernel would actually read data from user space;
ian@0 17 a GET_FOO ioctl would be _IOR, although the kernel would actually write
ian@0 18 data to user space.
ian@0 19
ian@0 20 The first argument to _IO, _IOW, _IOR, or _IOWR is an identifying letter
ian@0 21 or number from the table below. Because of the large number of drivers,
ian@0 22 many drivers share a partial letter with other drivers.
ian@0 23
ian@0 24 If you are writing a driver for a new device and need a letter, pick an
ian@0 25 unused block with enough room for expansion: 32 to 256 ioctl commands.
ian@0 26 You can register the block by patching this file and submitting the
ian@0 27 patch to Linus Torvalds. Or you can e-mail me at <mec@shout.net> and
ian@0 28 I'll register one for you.
ian@0 29
ian@0 30 The second argument to _IO, _IOW, _IOR, or _IOWR is a sequence number
ian@0 31 to distinguish ioctls from each other. The third argument to _IOW,
ian@0 32 _IOR, or _IOWR is the type of the data going into the kernel or coming
ian@0 33 out of the kernel (e.g. 'int' or 'struct foo'). NOTE! Do NOT use
ian@0 34 sizeof(arg) as the third argument as this results in your ioctl thinking
ian@0 35 it passes an argument of type size_t.
ian@0 36
ian@0 37 Some devices use their major number as the identifier; this is OK, as
ian@0 38 long as it is unique. Some devices are irregular and don't follow any
ian@0 39 convention at all.
ian@0 40
ian@0 41 Following this convention is good because:
ian@0 42
ian@0 43 (1) Keeping the ioctl's globally unique helps error checking:
ian@0 44 if a program calls an ioctl on the wrong device, it will get an
ian@0 45 error rather than some unexpected behaviour.
ian@0 46
ian@0 47 (2) The 'strace' build procedure automatically finds ioctl numbers
ian@0 48 defined with _IO, _IOW, _IOR, or _IOWR.
ian@0 49
ian@0 50 (3) 'strace' can decode numbers back into useful names when the
ian@0 51 numbers are unique.
ian@0 52
ian@0 53 (4) People looking for ioctls can grep for them more easily when
ian@0 54 this convention is used to define the ioctl numbers.
ian@0 55
ian@0 56 (5) When following the convention, the driver code can use generic
ian@0 57 code to copy the parameters between user and kernel space.
ian@0 58
ian@0 59 This table lists ioctls visible from user land for Linux/i386. It contains
ian@0 60 most drivers up to 2.3.14, but I know I am missing some.
ian@0 61
ian@0 62 Code Seq# Include File Comments
ian@0 63 ========================================================
ian@0 64 0x00 00-1F linux/fs.h conflict!
ian@0 65 0x00 00-1F scsi/scsi_ioctl.h conflict!
ian@0 66 0x00 00-1F linux/fb.h conflict!
ian@0 67 0x00 00-1F linux/wavefront.h conflict!
ian@0 68 0x02 all linux/fd.h
ian@0 69 0x03 all linux/hdreg.h
ian@0 70 0x04 all linux/umsdos_fs.h
ian@0 71 0x06 all linux/lp.h
ian@0 72 0x09 all linux/md.h
ian@0 73 0x12 all linux/fs.h
ian@0 74 linux/blkpg.h
ian@0 75 0x1b all InfiniBand Subsystem <http://www.openib.org/>
ian@0 76 0x20 all drivers/cdrom/cm206.h
ian@0 77 0x22 all scsi/sg.h
ian@0 78 '#' 00-3F IEEE 1394 Subsystem Block for the entire subsystem
ian@0 79 '1' 00-1F <linux/timepps.h> PPS kit from Ulrich Windl
ian@0 80 <ftp://ftp.de.kernel.org/pub/linux/daemons/ntp/PPS/>
ian@0 81 '8' all SNP8023 advanced NIC card
ian@0 82 <mailto:mcr@solidum.com>
ian@0 83 'A' 00-1F linux/apm_bios.h
ian@0 84 'B' C0-FF advanced bbus
ian@0 85 <mailto:maassen@uni-freiburg.de>
ian@0 86 'C' all linux/soundcard.h
ian@0 87 'D' all asm-s390/dasd.h
ian@0 88 'E' all linux/input.h
ian@0 89 'F' all linux/fb.h
ian@0 90 'H' all linux/hiddev.h
ian@0 91 'I' all linux/isdn.h
ian@0 92 'J' 00-1F drivers/scsi/gdth_ioctl.h
ian@0 93 'K' all linux/kd.h
ian@0 94 'L' 00-1F linux/loop.h
ian@0 95 'L' E0-FF linux/ppdd.h encrypted disk device driver
ian@0 96 <http://linux01.gwdg.de/~alatham/ppdd.html>
ian@0 97 'M' all linux/soundcard.h conflict!
ian@0 98 'M' 00-1F linux/isicom.h conflict!
ian@0 99 'N' 00-1F drivers/usb/scanner.h
ian@0 100 'P' all linux/soundcard.h
ian@0 101 'Q' all linux/soundcard.h
ian@0 102 'R' 00-1F linux/random.h
ian@0 103 'S' all linux/cdrom.h conflict!
ian@0 104 'S' 80-81 scsi/scsi_ioctl.h conflict!
ian@0 105 'S' 82-FF scsi/scsi.h conflict!
ian@0 106 'T' all linux/soundcard.h conflict!
ian@0 107 'T' all asm-i386/ioctls.h conflict!
ian@0 108 'U' 00-EF linux/drivers/usb/usb.h
ian@0 109 'U' F0-FF drivers/usb/auerswald.c
ian@0 110 'V' all linux/vt.h
ian@0 111 'W' 00-1F linux/watchdog.h conflict!
ian@0 112 'W' 00-1F linux/wanrouter.h conflict!
ian@0 113 'X' all linux/xfs_fs.h
ian@0 114 'Y' all linux/cyclades.h
ian@0 115 'a' all ATM on linux
ian@0 116 <http://lrcwww.epfl.ch/linux-atm/magic.html>
ian@0 117 'b' 00-FF bit3 vme host bridge
ian@0 118 <mailto:natalia@nikhefk.nikhef.nl>
ian@0 119 'c' 00-7F linux/comstats.h conflict!
ian@0 120 'c' 00-7F linux/coda.h conflict!
ian@0 121 'd' 00-FF linux/char/drm/drm/h conflict!
ian@0 122 'd' 00-DF linux/video_decoder.h conflict!
ian@0 123 'd' F0-FF linux/digi1.h
ian@0 124 'e' all linux/digi1.h conflict!
ian@0 125 'e' 00-1F linux/video_encoder.h conflict!
ian@0 126 'e' 00-1F net/irda/irtty.h conflict!
ian@0 127 'f' 00-1F linux/ext2_fs.h
ian@0 128 'h' 00-7F Charon filesystem
ian@0 129 <mailto:zapman@interlan.net>
ian@0 130 'i' 00-3F linux/i2o.h
ian@0 131 'j' 00-3F linux/joystick.h
ian@0 132 'l' 00-3F linux/tcfs_fs.h transparent cryptographic file system
ian@0 133 <http://mikonos.dia.unisa.it/tcfs>
ian@0 134 'l' 40-7F linux/udf_fs_i.h in development:
ian@0 135 <http://sourceforge.net/projects/linux-udf/>
ian@0 136 'm' all linux/mtio.h conflict!
ian@0 137 'm' all linux/soundcard.h conflict!
ian@0 138 'm' all linux/synclink.h conflict!
ian@0 139 'm' 00-1F net/irda/irmod.h conflict!
ian@0 140 'n' 00-7F linux/ncp_fs.h
ian@0 141 'n' E0-FF video/matrox.h matroxfb
ian@0 142 'p' 00-3F linux/mc146818rtc.h
ian@0 143 'p' 40-7F linux/nvram.h
ian@0 144 'p' 80-9F user-space parport
ian@0 145 <mailto:tim@cyberelk.net>
ian@0 146 'q' 00-1F linux/serio.h
ian@0 147 'q' 80-FF Internet PhoneJACK, Internet LineJACK
ian@0 148 <http://www.quicknet.net>
ian@0 149 'r' 00-1F linux/msdos_fs.h
ian@0 150 's' all linux/cdk.h
ian@0 151 't' 00-7F linux/if_ppp.h
ian@0 152 't' 80-8F linux/isdn_ppp.h
ian@0 153 'u' 00-1F linux/smb_fs.h
ian@0 154 'v' 00-1F linux/ext2_fs.h conflict!
ian@0 155 'v' all linux/videodev.h conflict!
ian@0 156 'w' all CERN SCI driver
ian@0 157 'y' 00-1F packet based user level communications
ian@0 158 <mailto:zapman@interlan.net>
ian@0 159 'z' 00-3F CAN bus card
ian@0 160 <mailto:hdstich@connectu.ulm.circular.de>
ian@0 161 'z' 40-7F CAN bus card
ian@0 162 <mailto:oe@port.de>
ian@0 163 0x80 00-1F linux/fb.h
ian@0 164 0x81 00-1F linux/videotext.h
ian@0 165 0x89 00-06 asm-i386/sockios.h
ian@0 166 0x89 0B-DF linux/sockios.h
ian@0 167 0x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range
ian@0 168 0x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range
ian@0 169 0x8B all linux/wireless.h
ian@0 170 0x8C 00-3F WiNRADiO driver
ian@0 171 <http://www.proximity.com.au/~brian/winradio/>
ian@0 172 0x90 00 drivers/cdrom/sbpcd.h
ian@0 173 0x93 60-7F linux/auto_fs.h
ian@0 174 0x99 00-0F 537-Addinboard driver
ian@0 175 <mailto:buk@buks.ipn.de>
ian@0 176 0xA0 all linux/sdp/sdp.h Industrial Device Project
ian@0 177 <mailto:kenji@bitgate.com>
ian@0 178 0xA3 80-8F Port ACL in development:
ian@0 179 <mailto:tlewis@mindspring.com>
ian@0 180 0xA3 90-9F linux/dtlk.h
ian@0 181 0xAB 00-1F linux/nbd.h
ian@0 182 0xAC 00-1F linux/raw.h
ian@0 183 0xAD 00 Netfilter device in development:
ian@0 184 <mailto:rusty@rustcorp.com.au>
ian@0 185 0xB0 all RATIO devices in development:
ian@0 186 <mailto:vgo@ratio.de>
ian@0 187 0xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca>
ian@0 188 0xCB 00-1F CBM serial IEC bus in development:
ian@0 189 <mailto:michael.klein@puffin.lb.shuttle.de>
ian@0 190 0xDD 00-3F ZFCP device driver see drivers/s390/scsi/
ian@0 191 <mailto:aherrman@de.ibm.com>
ian@0 192 0xF3 00-3F video/sisfb.h sisfb (in development)
ian@0 193 <mailto:thomas@winischhofer.net>