]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/net/net_osdep.h
unfinished sblive driver, playback/mixer only for now - not enabled in
[FreeBSD/FreeBSD.git] / sys / net / net_osdep.h
1 /*
2  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
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
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the project nor the names of its contributors
14  *    may be used to endorse or promote products derived from this software
15  *    without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * $FreeBSD$
30  */
31 /*
32  * glue for kernel code programming differences.
33  */
34
35 /*
36  * OS dependencies:
37  *
38  * - privileged process
39  *      NetBSD, FreeBSD 3
40  *              struct proc *p;
41  *              if (p && !suser(p->p_ucred, &p->p_acflag))
42  *                      privileged;
43  *      OpenBSD, BSDI [34], FreeBSD 2
44  *              struct socket *so;
45  *              if (so->so_state & SS_PRIV)
46  *                      privileged;
47  * - foo_control
48  *      NetBSD, FreeBSD 3
49  *              needs to give struct proc * as argument
50  *      OpenBSD, BSDI [34], FreeBSD 2
51  *              do not need struct proc *
52  * - bpf:
53  *      OpenBSD, NetBSD, BSDI [34]
54  *              need caddr_t * (= if_bpf **) and struct ifnet *
55  *      FreeBSD 2, FreeBSD 3
56  *              need only struct ifnet * as argument
57  * - struct ifnet
58  *                      use queue.h?    member names    if name
59  *                      ---             ---             ---
60  *      FreeBSD 2       no              old standard    if_name+unit
61  *      FreeBSD 3       yes             strange         if_name+unit
62  *      OpenBSD         yes             standard        if_xname
63  *      NetBSD          yes             standard        if_xname
64  *      BSDI [34]       no              old standard    if_name+unit
65  * - usrreq
66  *      NetBSD, OpenBSD, BSDI [34], FreeBSD 2
67  *              single function with PRU_xx, arguments are mbuf
68  *      FreeBSD 3
69  *              separates functions, non-mbuf arguments
70  * - {set,get}sockopt
71  *      NetBSD, OpenBSD, BSDI [34], FreeBSD 2
72  *              manipulation based on mbuf
73  *      FreeBSD 3
74  *              non-mbuf manipulation using sooptcopy{in,out}()
75  * - timeout() and untimeout()
76  *      NetBSD, OpenBSD, BSDI [34], FreeBSD 2
77  *              timeout() is a void function
78  *      FreeBSD 3
79  *              timeout() is non-void, must keep returned value for untimeuot()
80  * - sysctl
81  *      NetBSD, OpenBSD
82  *              foo_sysctl()
83  *      BSDI [34]
84  *              foo_sysctl() but with different style
85  *      FreeBSD 2, FreeBSD 3
86  *              linker hack
87  *
88  * - if_ioctl
89  *      NetBSD, FreeBSD 3, BSDI [34]
90  *              2nd argument is u_long cmd
91  *      FreeBSD 2
92  *              2nd argument is int cmd
93  * - if attach routines
94  *      NetBSD
95  *              void xxattach(int);
96  *      FreeBSD 2, FreeBSD 3
97  *              void xxattach(void *);
98  *              PSEUDO_SET(xxattach, if_xx);
99  *
100  * - ovbcopy()
101  *      in NetBSD 1.4 or later, ovbcopy() is not supplied in the kernel.
102  *      bcopy() is safe against overwrites.
103  * - splnet()
104  *      NetBSD 1.4 or later requires splsoftnet().
105  *      other operating systems use splnet().
106  *
107  * - dtom()
108  *      NEVER USE IT!
109  */
110
111 #ifndef __NET_NET_OSDEP_H_DEFINED_
112 #define __NET_NET_OSDEP_H_DEFINED_
113 #ifdef _KERNEL
114
115 struct ifnet;
116 extern const    char *if_name __P((struct ifnet *));
117
118 #define HAVE_OLD_BPF
119
120 #endif /*_KERNEL*/
121 #endif /*__NET_NET_OSDEP_H_DEFINED_ */