ioctl32.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. /* $Id: ioctl32.c,v 1.136 2002/01/14 09:49:52 davem Exp $
  2. * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  3. *
  4. * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
  5. * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
  6. * Copyright (C) 2003 Pavel Machek (pavel@suse.cz)
  7. *
  8. * These routines maintain argument size conversion between 32bit and 64bit
  9. * ioctls.
  10. */
  11. #define INCLUDES
  12. #include "compat_ioctl.c"
  13. #include <linux/ncp_fs.h>
  14. #include <linux/syscalls.h>
  15. #include <asm/fbio.h>
  16. #include <asm/kbio.h>
  17. #include <asm/vuid_event.h>
  18. #include <asm/envctrl.h>
  19. #include <asm/display7seg.h>
  20. #include <asm/openpromio.h>
  21. #include <asm/audioio.h>
  22. #include <asm/watchdog.h>
  23. /* Use this to get at 32-bit user passed pointers.
  24. * See sys_sparc32.c for description about it.
  25. */
  26. #define A(__x) compat_ptr(__x)
  27. static __inline__ void *alloc_user_space(long len)
  28. {
  29. struct pt_regs *regs = current_thread_info()->kregs;
  30. unsigned long usp = regs->u_regs[UREG_I6];
  31. if (!(test_thread_flag(TIF_32BIT)))
  32. usp += STACK_BIAS;
  33. return (void *) (usp - len);
  34. }
  35. #define CODE
  36. #include "compat_ioctl.c"
  37. struct fbcmap32 {
  38. int index; /* first element (0 origin) */
  39. int count;
  40. u32 red;
  41. u32 green;
  42. u32 blue;
  43. };
  44. #define FBIOPUTCMAP32 _IOW('F', 3, struct fbcmap32)
  45. #define FBIOGETCMAP32 _IOW('F', 4, struct fbcmap32)
  46. static int fbiogetputcmap(unsigned int fd, unsigned int cmd, unsigned long arg)
  47. {
  48. struct fbcmap32 __user *argp = (void __user *)arg;
  49. struct fbcmap __user *p = compat_alloc_user_space(sizeof(*p));
  50. u32 addr;
  51. int ret;
  52. ret = copy_in_user(p, argp, 2 * sizeof(int));
  53. ret |= get_user(addr, &argp->red);
  54. ret |= put_user(compat_ptr(addr), &p->red);
  55. ret |= get_user(addr, &argp->green);
  56. ret |= put_user(compat_ptr(addr), &p->green);
  57. ret |= get_user(addr, &argp->blue);
  58. ret |= put_user(compat_ptr(addr), &p->blue);
  59. if (ret)
  60. return -EFAULT;
  61. return sys_ioctl(fd, (cmd == FBIOPUTCMAP32) ? FBIOPUTCMAP_SPARC : FBIOGETCMAP_SPARC, (unsigned long)p);
  62. }
  63. struct fbcursor32 {
  64. short set; /* what to set, choose from the list above */
  65. short enable; /* cursor on/off */
  66. struct fbcurpos pos; /* cursor position */
  67. struct fbcurpos hot; /* cursor hot spot */
  68. struct fbcmap32 cmap; /* color map info */
  69. struct fbcurpos size; /* cursor bit map size */
  70. u32 image; /* cursor image bits */
  71. u32 mask; /* cursor mask bits */
  72. };
  73. #define FBIOSCURSOR32 _IOW('F', 24, struct fbcursor32)
  74. #define FBIOGCURSOR32 _IOW('F', 25, struct fbcursor32)
  75. static int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg)
  76. {
  77. struct fbcursor __user *p = compat_alloc_user_space(sizeof(*p));
  78. struct fbcursor32 __user *argp = (void __user *)arg;
  79. compat_uptr_t addr;
  80. int ret;
  81. ret = copy_in_user(p, argp,
  82. 2 * sizeof (short) + 2 * sizeof(struct fbcurpos));
  83. ret |= copy_in_user(&p->size, &argp->size, sizeof(struct fbcurpos));
  84. ret |= copy_in_user(&p->cmap, &argp->cmap, 2 * sizeof(int));
  85. ret |= get_user(addr, &argp->cmap.red);
  86. ret |= put_user(compat_ptr(addr), &p->cmap.red);
  87. ret |= get_user(addr, &argp->cmap.green);
  88. ret |= put_user(compat_ptr(addr), &p->cmap.green);
  89. ret |= get_user(addr, &argp->cmap.blue);
  90. ret |= put_user(compat_ptr(addr), &p->cmap.blue);
  91. ret |= get_user(addr, &argp->mask);
  92. ret |= put_user(compat_ptr(addr), &p->mask);
  93. ret |= get_user(addr, &argp->image);
  94. ret |= put_user(compat_ptr(addr), &p->image);
  95. if (ret)
  96. return -EFAULT;
  97. return sys_ioctl (fd, FBIOSCURSOR, (unsigned long)p);
  98. }
  99. #if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
  100. /* This really belongs in include/linux/drm.h -DaveM */
  101. #include "../../../drivers/char/drm/drm.h"
  102. typedef struct drm32_version {
  103. int version_major; /* Major version */
  104. int version_minor; /* Minor version */
  105. int version_patchlevel;/* Patch level */
  106. int name_len; /* Length of name buffer */
  107. u32 name; /* Name of driver */
  108. int date_len; /* Length of date buffer */
  109. u32 date; /* User-space buffer to hold date */
  110. int desc_len; /* Length of desc buffer */
  111. u32 desc; /* User-space buffer to hold desc */
  112. } drm32_version_t;
  113. #define DRM32_IOCTL_VERSION DRM_IOWR(0x00, drm32_version_t)
  114. static int drm32_version(unsigned int fd, unsigned int cmd, unsigned long arg)
  115. {
  116. drm32_version_t __user *uversion = (drm32_version_t __user *)arg;
  117. drm_version_t __user *p = compat_alloc_user_space(sizeof(*p));
  118. compat_uptr_t addr;
  119. int n;
  120. int ret;
  121. if (clear_user(p, 3 * sizeof(int)) ||
  122. get_user(n, &uversion->name_len) ||
  123. put_user(n, &p->name_len) ||
  124. get_user(addr, &uversion->name) ||
  125. put_user(compat_ptr(addr), &p->name) ||
  126. get_user(n, &uversion->date_len) ||
  127. put_user(n, &p->date_len) ||
  128. get_user(addr, &uversion->date) ||
  129. put_user(compat_ptr(addr), &p->date) ||
  130. get_user(n, &uversion->desc_len) ||
  131. put_user(n, &p->desc_len) ||
  132. get_user(addr, &uversion->desc) ||
  133. put_user(compat_ptr(addr), &p->desc))
  134. return -EFAULT;
  135. ret = sys_ioctl(fd, DRM_IOCTL_VERSION, (unsigned long)p);
  136. if (ret)
  137. return ret;
  138. if (copy_in_user(uversion, p, 3 * sizeof(int)) ||
  139. get_user(n, &p->name_len) ||
  140. put_user(n, &uversion->name_len) ||
  141. get_user(n, &p->date_len) ||
  142. put_user(n, &uversion->date_len) ||
  143. get_user(n, &p->desc_len) ||
  144. put_user(n, &uversion->desc_len))
  145. return -EFAULT;
  146. return 0;
  147. }
  148. typedef struct drm32_unique {
  149. int unique_len; /* Length of unique */
  150. u32 unique; /* Unique name for driver instantiation */
  151. } drm32_unique_t;
  152. #define DRM32_IOCTL_GET_UNIQUE DRM_IOWR(0x01, drm32_unique_t)
  153. #define DRM32_IOCTL_SET_UNIQUE DRM_IOW( 0x10, drm32_unique_t)
  154. static int drm32_getsetunique(unsigned int fd, unsigned int cmd, unsigned long arg)
  155. {
  156. drm32_unique_t __user *uarg = (drm32_unique_t __user *)arg;
  157. drm_unique_t __user *p = compat_alloc_user_space(sizeof(*p));
  158. compat_uptr_t addr;
  159. int n;
  160. int ret;
  161. if (get_user(n, &uarg->unique_len) ||
  162. put_user(n, &p->unique_len) ||
  163. get_user(addr, &uarg->unique) ||
  164. put_user(compat_ptr(addr), &p->unique))
  165. return -EFAULT;
  166. if (cmd == DRM32_IOCTL_GET_UNIQUE)
  167. ret = sys_ioctl (fd, DRM_IOCTL_GET_UNIQUE, (unsigned long)p);
  168. else
  169. ret = sys_ioctl (fd, DRM_IOCTL_SET_UNIQUE, (unsigned long)p);
  170. if (ret)
  171. return ret;
  172. if (get_user(n, &p->unique_len) || put_user(n, &uarg->unique_len))
  173. return -EFAULT;
  174. return 0;
  175. }
  176. typedef struct drm32_map {
  177. u32 offset; /* Requested physical address (0 for SAREA)*/
  178. u32 size; /* Requested physical size (bytes) */
  179. drm_map_type_t type; /* Type of memory to map */
  180. drm_map_flags_t flags; /* Flags */
  181. u32 handle; /* User-space: "Handle" to pass to mmap */
  182. /* Kernel-space: kernel-virtual address */
  183. int mtrr; /* MTRR slot used */
  184. /* Private data */
  185. } drm32_map_t;
  186. #define DRM32_IOCTL_ADD_MAP DRM_IOWR(0x15, drm32_map_t)
  187. static int drm32_addmap(unsigned int fd, unsigned int cmd, unsigned long arg)
  188. {
  189. drm32_map_t __user *uarg = (drm32_map_t __user *) arg;
  190. drm_map_t karg;
  191. mm_segment_t old_fs;
  192. u32 tmp;
  193. int ret;
  194. ret = get_user(karg.offset, &uarg->offset);
  195. ret |= get_user(karg.size, &uarg->size);
  196. ret |= get_user(karg.type, &uarg->type);
  197. ret |= get_user(karg.flags, &uarg->flags);
  198. ret |= get_user(tmp, &uarg->handle);
  199. ret |= get_user(karg.mtrr, &uarg->mtrr);
  200. if (ret)
  201. return -EFAULT;
  202. karg.handle = (void *) (unsigned long) tmp;
  203. old_fs = get_fs();
  204. set_fs(KERNEL_DS);
  205. ret = sys_ioctl(fd, DRM_IOCTL_ADD_MAP, (unsigned long) &karg);
  206. set_fs(old_fs);
  207. if (!ret) {
  208. ret = put_user(karg.offset, &uarg->offset);
  209. ret |= put_user(karg.size, &uarg->size);
  210. ret |= put_user(karg.type, &uarg->type);
  211. ret |= put_user(karg.flags, &uarg->flags);
  212. tmp = (u32) (long)karg.handle;
  213. ret |= put_user(tmp, &uarg->handle);
  214. ret |= put_user(karg.mtrr, &uarg->mtrr);
  215. if (ret)
  216. ret = -EFAULT;
  217. }
  218. return ret;
  219. }
  220. typedef struct drm32_buf_info {
  221. int count; /* Entries in list */
  222. u32 list; /* (drm_buf_desc_t *) */
  223. } drm32_buf_info_t;
  224. #define DRM32_IOCTL_INFO_BUFS DRM_IOWR(0x18, drm32_buf_info_t)
  225. static int drm32_info_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
  226. {
  227. drm32_buf_info_t __user *uarg = (drm32_buf_info_t __user *)arg;
  228. drm_buf_info_t __user *p = compat_alloc_user_space(sizeof(*p));
  229. compat_uptr_t addr;
  230. int n;
  231. int ret;
  232. if (get_user(n, &uarg->count) || put_user(n, &p->count) ||
  233. get_user(addr, &uarg->list) || put_user(compat_ptr(addr), &p->list))
  234. return -EFAULT;
  235. ret = sys_ioctl(fd, DRM_IOCTL_INFO_BUFS, (unsigned long)p);
  236. if (ret)
  237. return ret;
  238. if (get_user(n, &p->count) || put_user(n, &uarg->count))
  239. return -EFAULT;
  240. return 0;
  241. }
  242. typedef struct drm32_buf_free {
  243. int count;
  244. u32 list; /* (int *) */
  245. } drm32_buf_free_t;
  246. #define DRM32_IOCTL_FREE_BUFS DRM_IOW( 0x1a, drm32_buf_free_t)
  247. static int drm32_free_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
  248. {
  249. drm32_buf_free_t __user *uarg = (drm32_buf_free_t __user *)arg;
  250. drm_buf_free_t __user *p = compat_alloc_user_space(sizeof(*p));
  251. compat_uptr_t addr;
  252. int n;
  253. if (get_user(n, &uarg->count) || put_user(n, &p->count) ||
  254. get_user(addr, &uarg->list) || put_user(compat_ptr(addr), &p->list))
  255. return -EFAULT;
  256. return sys_ioctl(fd, DRM_IOCTL_FREE_BUFS, (unsigned long)p);
  257. }
  258. typedef struct drm32_buf_pub {
  259. int idx; /* Index into master buflist */
  260. int total; /* Buffer size */
  261. int used; /* Amount of buffer in use (for DMA) */
  262. u32 address; /* Address of buffer (void *) */
  263. } drm32_buf_pub_t;
  264. typedef struct drm32_buf_map {
  265. int count; /* Length of buflist */
  266. u32 virtual; /* Mmaped area in user-virtual (void *) */
  267. u32 list; /* Buffer information (drm_buf_pub_t *) */
  268. } drm32_buf_map_t;
  269. #define DRM32_IOCTL_MAP_BUFS DRM_IOWR(0x19, drm32_buf_map_t)
  270. static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
  271. {
  272. drm32_buf_map_t __user *uarg = (drm32_buf_map_t __user *)arg;
  273. drm32_buf_pub_t __user *ulist;
  274. drm_buf_map_t __user *arg64;
  275. drm_buf_pub_t __user *list;
  276. int orig_count, ret, i;
  277. int n;
  278. compat_uptr_t addr;
  279. if (get_user(orig_count, &uarg->count))
  280. return -EFAULT;
  281. arg64 = compat_alloc_user_space(sizeof(drm_buf_map_t) +
  282. (size_t)orig_count * sizeof(drm_buf_pub_t));
  283. list = (void __user *)(arg64 + 1);
  284. if (put_user(orig_count, &arg64->count) ||
  285. put_user(list, &arg64->list) ||
  286. get_user(addr, &uarg->virtual) ||
  287. put_user(compat_ptr(addr), &arg64->virtual) ||
  288. get_user(addr, &uarg->list))
  289. return -EFAULT;
  290. ulist = compat_ptr(addr);
  291. for (i = 0; i < orig_count; i++) {
  292. if (get_user(n, &ulist[i].idx) ||
  293. put_user(n, &list[i].idx) ||
  294. get_user(n, &ulist[i].total) ||
  295. put_user(n, &list[i].total) ||
  296. get_user(n, &ulist[i].used) ||
  297. put_user(n, &list[i].used) ||
  298. get_user(addr, &ulist[i].address) ||
  299. put_user(compat_ptr(addr), &list[i].address))
  300. return -EFAULT;
  301. }
  302. ret = sys_ioctl(fd, DRM_IOCTL_MAP_BUFS, (unsigned long) arg64);
  303. if (ret)
  304. return ret;
  305. for (i = 0; i < orig_count; i++) {
  306. void __user *p;
  307. if (get_user(n, &list[i].idx) ||
  308. put_user(n, &ulist[i].idx) ||
  309. get_user(n, &list[i].total) ||
  310. put_user(n, &ulist[i].total) ||
  311. get_user(n, &list[i].used) ||
  312. put_user(n, &ulist[i].used) ||
  313. get_user(p, &list[i].address) ||
  314. put_user((unsigned long)p, &ulist[i].address))
  315. return -EFAULT;
  316. }
  317. if (get_user(n, &arg64->count) || put_user(n, &uarg->count))
  318. return -EFAULT;
  319. return 0;
  320. }
  321. typedef struct drm32_dma {
  322. /* Indices here refer to the offset into
  323. buflist in drm_buf_get_t. */
  324. int context; /* Context handle */
  325. int send_count; /* Number of buffers to send */
  326. u32 send_indices; /* List of handles to buffers (int *) */
  327. u32 send_sizes; /* Lengths of data to send (int *) */
  328. drm_dma_flags_t flags; /* Flags */
  329. int request_count; /* Number of buffers requested */
  330. int request_size; /* Desired size for buffers */
  331. u32 request_indices; /* Buffer information (int *) */
  332. u32 request_sizes; /* (int *) */
  333. int granted_count; /* Number of buffers granted */
  334. } drm32_dma_t;
  335. #define DRM32_IOCTL_DMA DRM_IOWR(0x29, drm32_dma_t)
  336. /* RED PEN The DRM layer blindly dereferences the send/request
  337. * index/size arrays even though they are userland
  338. * pointers. -DaveM
  339. */
  340. static int drm32_dma(unsigned int fd, unsigned int cmd, unsigned long arg)
  341. {
  342. drm32_dma_t __user *uarg = (drm32_dma_t __user *) arg;
  343. drm_dma_t __user *p = compat_alloc_user_space(sizeof(*p));
  344. compat_uptr_t addr;
  345. int ret;
  346. if (copy_in_user(p, uarg, 2 * sizeof(int)) ||
  347. get_user(addr, &uarg->send_indices) ||
  348. put_user(compat_ptr(addr), &p->send_indices) ||
  349. get_user(addr, &uarg->send_sizes) ||
  350. put_user(compat_ptr(addr), &p->send_sizes) ||
  351. copy_in_user(&p->flags, &uarg->flags, sizeof(drm_dma_flags_t)) ||
  352. copy_in_user(&p->request_count, &uarg->request_count, sizeof(int))||
  353. copy_in_user(&p->request_size, &uarg->request_size, sizeof(int)) ||
  354. get_user(addr, &uarg->request_indices) ||
  355. put_user(compat_ptr(addr), &p->request_indices) ||
  356. get_user(addr, &uarg->request_sizes) ||
  357. put_user(compat_ptr(addr), &p->request_sizes) ||
  358. copy_in_user(&p->granted_count, &uarg->granted_count, sizeof(int)))
  359. return -EFAULT;
  360. ret = sys_ioctl(fd, DRM_IOCTL_DMA, (unsigned long)p);
  361. if (ret)
  362. return ret;
  363. if (copy_in_user(uarg, p, 2 * sizeof(int)) ||
  364. copy_in_user(&uarg->flags, &p->flags, sizeof(drm_dma_flags_t)) ||
  365. copy_in_user(&uarg->request_count, &p->request_count, sizeof(int))||
  366. copy_in_user(&uarg->request_size, &p->request_size, sizeof(int)) ||
  367. copy_in_user(&uarg->granted_count, &p->granted_count, sizeof(int)))
  368. return -EFAULT;
  369. return 0;
  370. }
  371. typedef struct drm32_ctx_res {
  372. int count;
  373. u32 contexts; /* (drm_ctx_t *) */
  374. } drm32_ctx_res_t;
  375. #define DRM32_IOCTL_RES_CTX DRM_IOWR(0x26, drm32_ctx_res_t)
  376. static int drm32_res_ctx(unsigned int fd, unsigned int cmd, unsigned long arg)
  377. {
  378. drm32_ctx_res_t __user *uarg = (drm32_ctx_res_t __user *) arg;
  379. drm_ctx_res_t __user *p = compat_alloc_user_space(sizeof(*p));
  380. compat_uptr_t addr;
  381. int ret;
  382. if (copy_in_user(p, uarg, sizeof(int)) ||
  383. get_user(addr, &uarg->contexts) ||
  384. put_user(compat_ptr(addr), &p->contexts))
  385. return -EFAULT;
  386. ret = sys_ioctl(fd, DRM_IOCTL_RES_CTX, (unsigned long)p);
  387. if (ret)
  388. return ret;
  389. if (copy_in_user(uarg, p, sizeof(int)))
  390. return -EFAULT;
  391. return 0;
  392. }
  393. #endif
  394. typedef int (* ioctl32_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
  395. #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
  396. #define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL },
  397. #define IOCTL_TABLE_START \
  398. struct ioctl_trans ioctl_start[] = {
  399. #define IOCTL_TABLE_END \
  400. };
  401. IOCTL_TABLE_START
  402. #include <linux/compat_ioctl.h>
  403. #define DECLARES
  404. #include "compat_ioctl.c"
  405. COMPATIBLE_IOCTL(TIOCSTART)
  406. COMPATIBLE_IOCTL(TIOCSTOP)
  407. COMPATIBLE_IOCTL(TIOCSLTC)
  408. COMPATIBLE_IOCTL(FBIOGTYPE)
  409. COMPATIBLE_IOCTL(FBIOSATTR)
  410. COMPATIBLE_IOCTL(FBIOGATTR)
  411. COMPATIBLE_IOCTL(FBIOSVIDEO)
  412. COMPATIBLE_IOCTL(FBIOGVIDEO)
  413. COMPATIBLE_IOCTL(FBIOGCURSOR32) /* This is not implemented yet. Later it should be converted... */
  414. COMPATIBLE_IOCTL(FBIOSCURPOS)
  415. COMPATIBLE_IOCTL(FBIOGCURPOS)
  416. COMPATIBLE_IOCTL(FBIOGCURMAX)
  417. /* Little k */
  418. COMPATIBLE_IOCTL(KIOCTYPE)
  419. COMPATIBLE_IOCTL(KIOCLAYOUT)
  420. COMPATIBLE_IOCTL(KIOCGTRANS)
  421. COMPATIBLE_IOCTL(KIOCTRANS)
  422. COMPATIBLE_IOCTL(KIOCCMD)
  423. COMPATIBLE_IOCTL(KIOCSDIRECT)
  424. COMPATIBLE_IOCTL(KIOCSLED)
  425. COMPATIBLE_IOCTL(KIOCGLED)
  426. COMPATIBLE_IOCTL(KIOCSRATE)
  427. COMPATIBLE_IOCTL(KIOCGRATE)
  428. COMPATIBLE_IOCTL(VUIDSFORMAT)
  429. COMPATIBLE_IOCTL(VUIDGFORMAT)
  430. /* Little v, the video4linux ioctls */
  431. COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
  432. COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
  433. COMPATIBLE_IOCTL(ENVCTRL_RD_WARNING_TEMPERATURE)
  434. COMPATIBLE_IOCTL(ENVCTRL_RD_SHUTDOWN_TEMPERATURE)
  435. COMPATIBLE_IOCTL(ENVCTRL_RD_CPU_TEMPERATURE)
  436. COMPATIBLE_IOCTL(ENVCTRL_RD_FAN_STATUS)
  437. COMPATIBLE_IOCTL(ENVCTRL_RD_VOLTAGE_STATUS)
  438. COMPATIBLE_IOCTL(ENVCTRL_RD_SCSI_TEMPERATURE)
  439. COMPATIBLE_IOCTL(ENVCTRL_RD_ETHERNET_TEMPERATURE)
  440. COMPATIBLE_IOCTL(ENVCTRL_RD_MTHRBD_TEMPERATURE)
  441. COMPATIBLE_IOCTL(ENVCTRL_RD_CPU_VOLTAGE)
  442. COMPATIBLE_IOCTL(ENVCTRL_RD_GLOBALADDRESS)
  443. /* COMPATIBLE_IOCTL(D7SIOCRD) same value as ENVCTRL_RD_VOLTAGE_STATUS */
  444. COMPATIBLE_IOCTL(D7SIOCWR)
  445. COMPATIBLE_IOCTL(D7SIOCTM)
  446. /* OPENPROMIO, SunOS/Solaris only, the NetBSD one's have
  447. * embedded pointers in the arg which we'd need to clean up...
  448. */
  449. COMPATIBLE_IOCTL(OPROMGETOPT)
  450. COMPATIBLE_IOCTL(OPROMSETOPT)
  451. COMPATIBLE_IOCTL(OPROMNXTOPT)
  452. COMPATIBLE_IOCTL(OPROMSETOPT2)
  453. COMPATIBLE_IOCTL(OPROMNEXT)
  454. COMPATIBLE_IOCTL(OPROMCHILD)
  455. COMPATIBLE_IOCTL(OPROMGETPROP)
  456. COMPATIBLE_IOCTL(OPROMNXTPROP)
  457. COMPATIBLE_IOCTL(OPROMU2P)
  458. COMPATIBLE_IOCTL(OPROMGETCONS)
  459. COMPATIBLE_IOCTL(OPROMGETFBNAME)
  460. COMPATIBLE_IOCTL(OPROMGETBOOTARGS)
  461. COMPATIBLE_IOCTL(OPROMSETCUR)
  462. COMPATIBLE_IOCTL(OPROMPCI2NODE)
  463. COMPATIBLE_IOCTL(OPROMPATH2NODE)
  464. /* Big L */
  465. COMPATIBLE_IOCTL(LOOP_SET_STATUS64)
  466. COMPATIBLE_IOCTL(LOOP_GET_STATUS64)
  467. /* Big A */
  468. COMPATIBLE_IOCTL(AUDIO_GETINFO)
  469. COMPATIBLE_IOCTL(AUDIO_SETINFO)
  470. COMPATIBLE_IOCTL(AUDIO_DRAIN)
  471. COMPATIBLE_IOCTL(AUDIO_GETDEV)
  472. COMPATIBLE_IOCTL(AUDIO_GETDEV_SUNOS)
  473. COMPATIBLE_IOCTL(AUDIO_FLUSH)
  474. COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI)
  475. #if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
  476. COMPATIBLE_IOCTL(DRM_IOCTL_GET_MAGIC)
  477. COMPATIBLE_IOCTL(DRM_IOCTL_IRQ_BUSID)
  478. COMPATIBLE_IOCTL(DRM_IOCTL_AUTH_MAGIC)
  479. COMPATIBLE_IOCTL(DRM_IOCTL_BLOCK)
  480. COMPATIBLE_IOCTL(DRM_IOCTL_UNBLOCK)
  481. COMPATIBLE_IOCTL(DRM_IOCTL_CONTROL)
  482. COMPATIBLE_IOCTL(DRM_IOCTL_ADD_BUFS)
  483. COMPATIBLE_IOCTL(DRM_IOCTL_MARK_BUFS)
  484. COMPATIBLE_IOCTL(DRM_IOCTL_ADD_CTX)
  485. COMPATIBLE_IOCTL(DRM_IOCTL_RM_CTX)
  486. COMPATIBLE_IOCTL(DRM_IOCTL_MOD_CTX)
  487. COMPATIBLE_IOCTL(DRM_IOCTL_GET_CTX)
  488. COMPATIBLE_IOCTL(DRM_IOCTL_SWITCH_CTX)
  489. COMPATIBLE_IOCTL(DRM_IOCTL_NEW_CTX)
  490. COMPATIBLE_IOCTL(DRM_IOCTL_ADD_DRAW)
  491. COMPATIBLE_IOCTL(DRM_IOCTL_RM_DRAW)
  492. COMPATIBLE_IOCTL(DRM_IOCTL_LOCK)
  493. COMPATIBLE_IOCTL(DRM_IOCTL_UNLOCK)
  494. COMPATIBLE_IOCTL(DRM_IOCTL_FINISH)
  495. #endif /* DRM */
  496. COMPATIBLE_IOCTL(WIOCSTART)
  497. COMPATIBLE_IOCTL(WIOCSTOP)
  498. COMPATIBLE_IOCTL(WIOCGSTAT)
  499. /* And these ioctls need translation */
  500. /* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */
  501. HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap)
  502. HANDLE_IOCTL(FBIOGETCMAP32, fbiogetputcmap)
  503. HANDLE_IOCTL(FBIOSCURSOR32, fbiogscursor)
  504. #if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
  505. HANDLE_IOCTL(DRM32_IOCTL_VERSION, drm32_version)
  506. HANDLE_IOCTL(DRM32_IOCTL_GET_UNIQUE, drm32_getsetunique)
  507. HANDLE_IOCTL(DRM32_IOCTL_SET_UNIQUE, drm32_getsetunique)
  508. HANDLE_IOCTL(DRM32_IOCTL_ADD_MAP, drm32_addmap)
  509. HANDLE_IOCTL(DRM32_IOCTL_INFO_BUFS, drm32_info_bufs)
  510. HANDLE_IOCTL(DRM32_IOCTL_FREE_BUFS, drm32_free_bufs)
  511. HANDLE_IOCTL(DRM32_IOCTL_MAP_BUFS, drm32_map_bufs)
  512. HANDLE_IOCTL(DRM32_IOCTL_DMA, drm32_dma)
  513. HANDLE_IOCTL(DRM32_IOCTL_RES_CTX, drm32_res_ctx)
  514. #endif /* DRM */
  515. #if 0
  516. HANDLE_IOCTL(RTC32_IRQP_READ, do_rtc_ioctl)
  517. HANDLE_IOCTL(RTC32_IRQP_SET, do_rtc_ioctl)
  518. HANDLE_IOCTL(RTC32_EPOCH_READ, do_rtc_ioctl)
  519. HANDLE_IOCTL(RTC32_EPOCH_SET, do_rtc_ioctl)
  520. #endif
  521. /* take care of sizeof(sizeof()) breakage */
  522. IOCTL_TABLE_END
  523. int ioctl_table_size = ARRAY_SIZE(ioctl_start);