Rich Felker | 6315004 | 2012-07-11 04:22:13 -0400 | [diff] [blame] | 1 | #define _IOC(a,b,c,d) ( ((a)<<29) | ((b)<<8) | (c) | ((d)<<16) ) |
| 2 | #define _IOC_NONE 1U |
Rich Felker | ff02f94 | 2012-08-07 19:19:21 -0400 | [diff] [blame^] | 3 | #define _IOC_READ 2U |
| 4 | #define _IOC_WRITE 4U |
Rich Felker | 6315004 | 2012-07-11 04:22:13 -0400 | [diff] [blame] | 5 | |
| 6 | #define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0) |
| 7 | #define _IOW(a,b,c) _IOC(1,(a),(b),sizeof(c)) |
| 8 | #define _IOR(a,b,c) _IOC(2,(a),(b),sizeof(c)) |
| 9 | #define _IOWR(a,b,c) _IOC(4,(a),(b),sizeof(c)) |
| 10 | |
| 11 | #define TCGETA 0x5401 |
| 12 | #define TCSETA 0x5402 |
| 13 | #define TCSETAW 0x5403 |
| 14 | #define TCSETAF 0x5404 |
| 15 | #define TCSBRK 0x5405 |
| 16 | #define TCXONC 0x5406 |
| 17 | #define TCFLSH 0x5407 |
| 18 | #define TCGETS 0x540D |
| 19 | #define TCSETS 0x540E |
| 20 | #define TCSETSW 0x540F |
| 21 | #define TCSETSF 0x5410 |
| 22 | |
| 23 | #define TIOCEXCL 0x740D |
| 24 | #define TIOCNXCL 0x740E |
| 25 | #define TIOCOUTQ 0x7472 |
| 26 | #define TIOCSTI 0x5472 |
| 27 | #define TIOCMGET 0x741D |
| 28 | #define TIOCMBIS 0x741B |
| 29 | #define TIOCMBIC 0x741C |
| 30 | #define TIOCMSET 0x741D |
| 31 | |
| 32 | #define TIOCPKT 0x5470 |
| 33 | #define TIOCSWINSZ _IOW('t', 103, struct winsize) |
| 34 | #define TIOCGWINSZ _IOR('t', 104, struct winsize) |
| 35 | #define TIOCNOTTY 0x5471 |
| 36 | #define TIOCSETD 0x7401 |
| 37 | #define TIOCGETD 0x7400 |
| 38 | |
| 39 | #define FIOCLEX 0x6601 |
| 40 | #define FIONCLEX 0x6602 |
| 41 | #define FIOASYNC 0x667D |
| 42 | #define FIONBIO 0x667E |
| 43 | #define FIOQSIZE 0x667F |
| 44 | |
| 45 | #define TIOCGLTC 0x7474 |
| 46 | #define TIOCSLTC 0x7475 |
| 47 | #define TIOCSPGRP _IOW('t', 118, int) |
| 48 | #define TIOCGPGRP _IOR('t', 119, int) |
| 49 | #define TIOCCONS _IOW('t', 120, int) |
| 50 | |
| 51 | #define FIONREAD 0x467F |
| 52 | #define TIOCINQ FIONREAD |
| 53 | |
| 54 | #define TIOCGETP 0x7408 |
| 55 | #define TIOCSETP 0x7409 |
| 56 | #define TIOCSETN 0x740A |
| 57 | |
| 58 | #define TIOCSBRK 0x5427 |
| 59 | #define TIOCCBRK 0x5428 |
| 60 | #define TIOCGSID 0x7416 |
| 61 | #define TIOCGPTN _IOR('T', 0x30, unsigned int) |
| 62 | #define TIOCSPTLCK _IOW('T', 0x31, int) |
| 63 | |
| 64 | #define TIOCSCTTY 0x5480 |
| 65 | #define TIOCGSOFTCAR 0x5481 |
| 66 | #define TIOCSSOFTCAR 0x5482 |
| 67 | #define TIOCLINUX 0x5483 |
| 68 | #define TIOCGSERIAL 0x5484 |
| 69 | #define TIOCSSERIAL 0x5485 |
| 70 | #define TCSBRKP 0x5486 |
| 71 | |
| 72 | #define TIOCSERCONFIG 0x5488 |
| 73 | #define TIOCSERGWILD 0x5489 |
| 74 | #define TIOCSERSWILD 0x548A |
| 75 | #define TIOCGLCKTRMIOS 0x548B |
| 76 | #define TIOCSLCKTRMIOS 0x548C |
| 77 | #define TIOCSERGSTRUCT 0x548D |
| 78 | #define TIOCSERGETLSR 0x548E |
| 79 | #define TIOCSERGETMULTI 0x548F |
| 80 | #define TIOCSERSETMULTI 0x5490 |
| 81 | #define TIOCMIWAIT 0x5491 |
| 82 | #define TIOCGICOUNT 0x5492 |
| 83 | #define TIOCGHAYESESP 0x5493 |
| 84 | #define TIOCSHAYESESP 0x5494 |
| 85 | |
| 86 | #define TIOCTTYGSTRUCT 0x5426 // RICH: Not sure about these. |
| 87 | #define TCGETX 0x5432 // RICH: Not sure about these. |
| 88 | #define TCSETX 0x5433 // RICH: Not sure about these. |
| 89 | #define TCSETXF 0x5434 // RICH: Not sure about these. |
| 90 | #define TCSETXW 0x5435 // RICH: Not sure about these. |
| 91 | |
| 92 | #define TIOCPKT_DATA 0 |
| 93 | #define TIOCPKT_FLUSHREAD 1 |
| 94 | #define TIOCPKT_FLUSHWRITE 2 |
| 95 | #define TIOCPKT_STOP 4 |
| 96 | #define TIOCPKT_START 8 |
| 97 | #define TIOCPKT_NOSTOP 16 |
| 98 | #define TIOCPKT_DOSTOP 32 |
| 99 | #define TIOCPKT_IOCTL 64 |
| 100 | |
| 101 | #define TIOCSER_TEMT 0x01 |
| 102 | |
| 103 | struct winsize { |
| 104 | unsigned short ws_row; |
| 105 | unsigned short ws_col; |
| 106 | unsigned short ws_xpixel; |
| 107 | unsigned short ws_ypixel; |
| 108 | }; |
| 109 | |
| 110 | #define TIOCM_LE 0x001 |
| 111 | #define TIOCM_DTR 0x002 |
| 112 | #define TIOCM_RTS 0x004 |
| 113 | #define TIOCM_ST 0x008 |
| 114 | #define TIOCM_SR 0x010 |
| 115 | #define TIOCM_CTS 0x020 |
| 116 | #define TIOCM_CAR 0x040 |
| 117 | #define TIOCM_RNG 0x080 |
| 118 | #define TIOCM_DSR 0x100 |
| 119 | #define TIOCM_CD TIOCM_CAR |
| 120 | #define TIOCM_RI TIOCM_RNG |
| 121 | #define TIOCM_OUT1 0x2000 |
| 122 | #define TIOCM_OUT2 0x4000 |
| 123 | #define TIOCM_LOOP 0x8000 |
| 124 | #define TIOCM_MODEM_BITS TIOCM_OUT2 |
| 125 | |
| 126 | #define N_TTY 0 |
| 127 | #define N_SLIP 1 |
| 128 | #define N_MOUSE 2 |
| 129 | #define N_PPP 3 |
| 130 | #define N_STRIP 4 |
| 131 | #define N_AX25 5 |
| 132 | #define N_X25 6 |
| 133 | #define N_6PACK 7 |
| 134 | #define N_MASC 8 |
| 135 | #define N_R3964 9 |
| 136 | #define N_PROFIBUS_FDL 10 |
| 137 | #define N_IRDA 11 |
| 138 | #define N_SMSBLOCK 12 |
| 139 | #define N_HDLC 13 |
| 140 | #define N_SYNC_PPP 14 |
| 141 | #define N_HCI 15 |
| 142 | |
| 143 | #define FIOSETOWN 0x8901 |
| 144 | #define SIOCSPGRP 0x8902 |
| 145 | #define FIOGETOWN 0x8903 |
| 146 | #define SIOCGPGRP 0x8904 |
| 147 | #define SIOCATMARK 0x8905 |
| 148 | #define SIOCGSTAMP 0x8906 |
| 149 | |
| 150 | #define SIOCADDRT 0x890B |
| 151 | #define SIOCDELRT 0x890C |
| 152 | #define SIOCRTMSG 0x890D |
| 153 | |
| 154 | #define SIOCGIFNAME 0x8910 |
| 155 | #define SIOCSIFLINK 0x8911 |
| 156 | #define SIOCGIFCONF 0x8912 |
| 157 | #define SIOCGIFFLAGS 0x8913 |
| 158 | #define SIOCSIFFLAGS 0x8914 |
| 159 | #define SIOCGIFADDR 0x8915 |
| 160 | #define SIOCSIFADDR 0x8916 |
| 161 | #define SIOCGIFDSTADDR 0x8917 |
| 162 | #define SIOCSIFDSTADDR 0x8918 |
| 163 | #define SIOCGIFBRDADDR 0x8919 |
| 164 | #define SIOCSIFBRDADDR 0x891a |
| 165 | #define SIOCGIFNETMASK 0x891b |
| 166 | #define SIOCSIFNETMASK 0x891c |
| 167 | #define SIOCGIFMETRIC 0x891d |
| 168 | #define SIOCSIFMETRIC 0x891e |
| 169 | #define SIOCGIFMEM 0x891f |
| 170 | #define SIOCSIFMEM 0x8920 |
| 171 | #define SIOCGIFMTU 0x8921 |
| 172 | #define SIOCSIFMTU 0x8922 |
| 173 | #define SIOCSIFHWADDR 0x8924 |
| 174 | #define SIOCGIFENCAP 0x8925 |
| 175 | #define SIOCSIFENCAP 0x8926 |
| 176 | #define SIOCGIFHWADDR 0x8927 |
| 177 | #define SIOCGIFSLAVE 0x8929 |
| 178 | #define SIOCSIFSLAVE 0x8930 |
| 179 | #define SIOCADDMULTI 0x8931 |
| 180 | #define SIOCDELMULTI 0x8932 |
| 181 | #define SIOCGIFINDEX 0x8933 |
| 182 | #define SIOGIFINDEX SIOCGIFINDEX |
| 183 | #define SIOCSIFPFLAGS 0x8934 |
| 184 | #define SIOCGIFPFLAGS 0x8935 |
| 185 | #define SIOCDIFADDR 0x8936 |
| 186 | #define SIOCSIFHWBROADCAST 0x8937 |
| 187 | #define SIOCGIFCOUNT 0x8938 |
| 188 | |
| 189 | #define SIOCGIFBR 0x8940 |
| 190 | #define SIOCSIFBR 0x8941 |
| 191 | |
| 192 | #define SIOCGIFTXQLEN 0x8942 |
| 193 | #define SIOCSIFTXQLEN 0x8943 |
| 194 | |
| 195 | #define SIOCDARP 0x8953 |
| 196 | #define SIOCGARP 0x8954 |
| 197 | #define SIOCSARP 0x8955 |
| 198 | |
| 199 | #define SIOCDRARP 0x8960 |
| 200 | #define SIOCGRARP 0x8961 |
| 201 | #define SIOCSRARP 0x8962 |
| 202 | |
| 203 | #define SIOCGIFMAP 0x8970 |
| 204 | #define SIOCSIFMAP 0x8971 |
| 205 | |
| 206 | #define SIOCADDDLCI 0x8980 |
| 207 | #define SIOCDELDLCI 0x8981 |
| 208 | |
| 209 | #define SIOCDEVPRIVATE 0x89F0 |
| 210 | #define SIOCPROTOPRIVATE 0x89E0 |