Deleted Added
sdiff udiff text old ( 197176 ) new ( 200110 )
full compact
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include "opt_compat.h"
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/compat/linux/linux_ioctl.c 197176 2009-09-13 21:30:18Z zec $");
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/sysproto.h>
37#include <sys/cdio.h>
38#include <sys/dvdio.h>
39#include <sys/conf.h>
40#include <sys/disk.h>

--- 32 unchanged lines hidden (view full) ---

73#include <machine/../linux/linux_proto.h>
74#endif
75
76#include <compat/linux/linux_ioctl.h>
77#include <compat/linux/linux_mib.h>
78#include <compat/linux/linux_socket.h>
79#include <compat/linux/linux_util.h>
80
81CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ);
82
83static linux_ioctl_function_t linux_ioctl_cdrom;
84static linux_ioctl_function_t linux_ioctl_vfat;
85static linux_ioctl_function_t linux_ioctl_console;
86static linux_ioctl_function_t linux_ioctl_hdio;
87static linux_ioctl_function_t linux_ioctl_disk;
88static linux_ioctl_function_t linux_ioctl_socket;
89static linux_ioctl_function_t linux_ioctl_sound;
90static linux_ioctl_function_t linux_ioctl_termio;
91static linux_ioctl_function_t linux_ioctl_private;
92static linux_ioctl_function_t linux_ioctl_drm;
93static linux_ioctl_function_t linux_ioctl_sg;
94static linux_ioctl_function_t linux_ioctl_special;
95
96static struct linux_ioctl_handler cdrom_handler =
97{ linux_ioctl_cdrom, LINUX_IOCTL_CDROM_MIN, LINUX_IOCTL_CDROM_MAX };
98static struct linux_ioctl_handler vfat_handler =
99{ linux_ioctl_vfat, LINUX_IOCTL_VFAT_MIN, LINUX_IOCTL_VFAT_MAX };
100static struct linux_ioctl_handler console_handler =
101{ linux_ioctl_console, LINUX_IOCTL_CONSOLE_MIN, LINUX_IOCTL_CONSOLE_MAX };

--- 8 unchanged lines hidden (view full) ---

110static struct linux_ioctl_handler termio_handler =
111{ linux_ioctl_termio, LINUX_IOCTL_TERMIO_MIN, LINUX_IOCTL_TERMIO_MAX };
112static struct linux_ioctl_handler private_handler =
113{ linux_ioctl_private, LINUX_IOCTL_PRIVATE_MIN, LINUX_IOCTL_PRIVATE_MAX };
114static struct linux_ioctl_handler drm_handler =
115{ linux_ioctl_drm, LINUX_IOCTL_DRM_MIN, LINUX_IOCTL_DRM_MAX };
116static struct linux_ioctl_handler sg_handler =
117{ linux_ioctl_sg, LINUX_IOCTL_SG_MIN, LINUX_IOCTL_SG_MAX };
118
119DATA_SET(linux_ioctl_handler_set, cdrom_handler);
120DATA_SET(linux_ioctl_handler_set, vfat_handler);
121DATA_SET(linux_ioctl_handler_set, console_handler);
122DATA_SET(linux_ioctl_handler_set, hdio_handler);
123DATA_SET(linux_ioctl_handler_set, disk_handler);
124DATA_SET(linux_ioctl_handler_set, socket_handler);
125DATA_SET(linux_ioctl_handler_set, sound_handler);
126DATA_SET(linux_ioctl_handler_set, termio_handler);
127DATA_SET(linux_ioctl_handler_set, private_handler);
128DATA_SET(linux_ioctl_handler_set, drm_handler);
129DATA_SET(linux_ioctl_handler_set, sg_handler);
130
131struct handler_element
132{
133 TAILQ_ENTRY(handler_element) list;
134 int (*func)(struct thread *, struct linux_ioctl_args *);
135 int low, high, span;
136};
137

--- 2446 unchanged lines hidden (view full) ---

2584 cmd = args->cmd;
2585
2586 error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td));
2587 fdrop(fp, td);
2588 return (error);
2589}
2590
2591/*
2592 * Special ioctl handler
2593 */
2594static int
2595linux_ioctl_special(struct thread *td, struct linux_ioctl_args *args)
2596{
2597 int error;
2598
2599 switch (args->cmd) {

--- 133 unchanged lines hidden ---