compat_stub.c revision 1.1.2.15 1 /* $NetBSD: compat_stub.c,v 1.1.2.15 2018/04/17 07:24:55 pgoyette Exp $ */
2
3 /*-
4 * Copyright (c) 2018 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Paul Goyette
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 #include <sys/cdefs.h>
33
34 #ifdef _KERNEL_OPT
35 #include "opt_ntp.h"
36 #include "usb.h"
37 #endif
38
39 #include <sys/systm.h>
40 #include <sys/compat_stub.h>
41
42 /*
43 * Routine vectors for compat_50___sys_ntp_gettime
44 */
45
46 #ifdef NTP
47 void (*vec_ntp_gettime)(struct ntptimeval *) = ntp_gettime;
48 int (*vec_ntp_timestatus)(void) = ntp_timestatus;
49 #else
50 void (*vec_ntp_gettime)(struct ntptimeval *) = NULL;
51 int (*vec_ntp_timestatus)(void) = NULL;
52 #endif
53
54 /*
55 * ccd device compatability ioctl
56 */
57 int (*compat_ccd_ioctl_60)(dev_t, u_long, void *, int, struct lwp *,
58 int (*f)(dev_t, u_long, void *, int, struct lwp *)) = (void *)enosys;
59
60 /*
61 * clockctl device compatability ioctl
62 */
63 int (*compat_clockctl_ioctl_50)(dev_t, u_long, void *, int, struct lwp *) =
64 (void *)enosys;
65
66 /*
67 * if_sppp device compatability ioctl subroutine
68 */
69 int (*sppp_params50)(struct sppp *, u_long, void *) = (void *)enosys;
70
71 /*
72 * cryptodev compatability ioctl
73 */
74 int (*ocryptof50_ioctl)(struct file *, u_long, void *) = (void *)enosys;
75
76 /*
77 * raidframe compatability
78 */
79 int (*raidframe50_ioctl)(int, int, struct RF_Raid_s *, int, void *,
80 struct RF_Config_s **) = (void *)enosys;
81 int (*raidframe80_ioctl)(int, int, struct RF_Raid_s *, int, void *,
82 struct RF_Config_s **) = (void *)enosys;
83
84 /*
85 * puffs compatability
86 */
87 int (*puffs50_compat_outgoing)(struct puffs_req *, struct puffs_req **,
88 ssize_t *) = (void *)enosys;
89 void (*puffs50_compat_incoming)(struct puffs_req *, struct puffs_req *) =
90 (void *)voidop;
91
92 /*
93 * wsevents compatability
94 */
95 int (*wsevent_50_copyout_events)(const struct wscons_event *, int,
96 struct uio *) = (void *)enosys;
97
98 /*
99 * sysmon_power compatability
100 */
101 void (*compat_sysmon_power_40)(struct power_event *, struct sysmon_pswitch *,
102 int) = (void *)voidop;
103
104 /*
105 * bio compatability
106 */
107
108 int (*compat_bio_30)(void *, u_long, void *, int(*)(void *, u_long, void *)) =
109 (void *)enosys;
110
111 /*
112 * vnd ioctl compatability
113 */
114 int (*compat_vndioctl_30)(u_long, struct lwp *, void *, int, struct vattr *,
115 int (*get)(struct lwp *, void *, int, struct vattr *)) = (void *)enosys;
116
117 /*
118 * usb device_info compatability
119 */
120 int (*usbd30_fill_deviceinfo_old)(struct usbd_device *,
121 struct usb_device_info_old *, int) = (void *)enosys;
122
123 int (*usb30_copy_to_old)(struct usb_event *, struct usb_event_old *,
124 struct uio *) = (void *)enosys;
125
126 #if NUSB > 0
127 void (*vec_usbd_devinfo_vp)(struct usbd_device *, char *, size_t, char *,
128 size_t, int, int) = usbd_devinfo_vp;
129 int (*vec_usbd_printBCD)(char *cp, size_t l, int bcd) = usbd_printBCD;
130
131 #else
132 void (*vec_usbd_devinfo_vp)(struct usbd_device *, char *, size_t, char *,
133 size_t, int, int) = NULL;
134 int (*vec_usbd_printBCD)(char *cp, size_t l, int bcd) = NULL;
135 #endif
136
137 /*
138 * ieee80211 ioctl compatability
139 */
140 int (*ieee80211_get_ostats_20)(struct ieee80211_ostats *,
141 struct ieee80211_stats *) = (void *)enosys;
142
143 int (*if43_20_cvtcmd)(int) = (void *)enosys;
144
145 /*
146 * rtsock 14 compatability
147 */
148 void (*rtsock14_oifmsg)(struct ifnet *) = (void *)voidop;
149 int (*rtsock14_iflist)(struct ifnet *, struct rt_walkarg *,
150 struct rt_addrinfo *, size_t) = (void *)enosys;
151
152 /*
153 * modctl handler for old style OSTAT
154 */
155 int (*compat_modstat_80)(int, struct iovec *, void *) = (void *)enosys;
156
157 /*
158 * mask for kern_sig_43's killpg (updated by compat_09)
159 */
160 int kern_sig_43_pgid_mask = ~0;
161