ioctl32.c 19 KB

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