Wed May 20 09:17:18 2015 UTC ()
Remove leftover use of AF_NS and NS option

Unnecessary NETISR_NS is also removed.


(ozaki-r)
diff -r1.34 -r1.35 src/sys/arch/acorn32/podulebus/if_ie.c
diff -r1.52 -r1.53 src/sys/arch/amiga/dev/if_es.c
diff -r1.39 -r1.40 src/sys/arch/amiga/dev/if_qn.c
diff -r1.13 -r1.14 src/sys/arch/arm/at91/at91emac.c
diff -r1.31 -r1.32 src/sys/arch/arm/ep93xx/epe.c
diff -r1.22 -r1.23 src/sys/arch/sun2/dev/if_ec.c
diff -r1.55 -r1.56 src/sys/arch/sun3/dev/if_ie.c
diff -r1.17 -r1.18 src/sys/arch/x68k/dev/if_ne_intio.c
diff -r1.20 -r1.21 src/sys/arch/x68k/dev/if_ne_neptune.c
diff -r1.1 -r1.2 src/sys/dev/cadence/if_cemac.c
diff -r1.41 -r1.42 src/sys/net/if_ecosubr.c
diff -r1.41 -r1.42 src/sys/net/if_hippisubr.c
diff -r1.207 -r1.208 src/sys/net/if_ethersubr.c
diff -r1.88 -r1.89 src/sys/net/if_fddisubr.c
diff -r1.66 -r1.67 src/sys/net/if_tokensubr.c
diff -r1.42 -r1.43 src/sys/net/netisr.h

cvs diff -r1.34 -r1.35 src/sys/arch/acorn32/podulebus/if_ie.c (expand / switch to unified diff)

--- src/sys/arch/acorn32/podulebus/if_ie.c 2014/10/25 10:58:12 1.34
+++ src/sys/arch/acorn32/podulebus/if_ie.c 2015/05/20 09:17:17 1.35
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_ie.c,v 1.34 2014/10/25 10:58:12 skrll Exp $ */ 1/* $NetBSD: if_ie.c,v 1.35 2015/05/20 09:17:17 ozaki-r Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1995 Melvin Tang-Richardson. 4 * Copyright (c) 1995 Melvin Tang-Richardson.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This driver is a major hash up of src/sys/dev/isa/if_ie.c and 7 * This driver is a major hash up of src/sys/dev/isa/if_ie.c and
8 * src/sys/arch/acorn32/podulebus/kgdb_ie.c Please refer to copyright 8 * src/sys/arch/acorn32/podulebus/kgdb_ie.c Please refer to copyright
9 * notices from them too. 9 * notices from them too.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -43,27 +43,27 @@ @@ -43,27 +43,27 @@
43 * 43 *
44 * Created : 26/06/95 44 * Created : 26/06/95
45 */ 45 */
46 46
47/* 47/*
48 * This driver is at its last beta release. It should not cause 48 * This driver is at its last beta release. It should not cause
49 * any problems (Touch wood) 49 * any problems (Touch wood)
50 * 50 *
51 * If it passes field tests again. This will constitute the realse 51 * If it passes field tests again. This will constitute the realse
52 * version. 52 * version.
53 */ 53 */
54 54
55#include <sys/cdefs.h> 55#include <sys/cdefs.h>
56__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.34 2014/10/25 10:58:12 skrll Exp $"); 56__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.35 2015/05/20 09:17:17 ozaki-r Exp $");
57 57
58#define IGNORE_ETHER1_IDROM_CHECKSUM 58#define IGNORE_ETHER1_IDROM_CHECKSUM
59 59
60/* Standard podule includes */ 60/* Standard podule includes */
61 61
62#include "opt_inet.h" 62#include "opt_inet.h"
63#include "opt_ns.h" 63#include "opt_ns.h"
64 64
65#include <sys/param.h> 65#include <sys/param.h>
66 66
67#include <sys/systm.h> 67#include <sys/systm.h>
68#include <sys/kernel.h> 68#include <sys/kernel.h>
69#include <sys/conf.h> 69#include <sys/conf.h>
@@ -84,31 +84,26 @@ __KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1. @@ -84,31 +84,26 @@ __KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.
84#include <net/if.h> 84#include <net/if.h>
85#include <net/if_types.h> 85#include <net/if_types.h>
86#include <net/if_dl.h> 86#include <net/if_dl.h>
87#include <net/if_ether.h> 87#include <net/if_ether.h>
88 88
89#ifdef INET 89#ifdef INET
90#include <netinet/in.h> 90#include <netinet/in.h>
91#include <netinet/in_systm.h> 91#include <netinet/in_systm.h>
92#include <netinet/in_var.h> 92#include <netinet/in_var.h>
93#include <netinet/ip.h> 93#include <netinet/ip.h>
94#include <netinet/if_inarp.h> 94#include <netinet/if_inarp.h>
95#endif 95#endif
96 96
97#ifdef NS 
98#include <netns/ns.h> 
99#include <netns/ns_if.h> 
100#endif 
101 
102/* Import our data structres */ 97/* Import our data structres */
103 98
104#include "if_iereg.h" 99#include "if_iereg.h"
105 100
106/* BPF support */ 101/* BPF support */
107 102
108#include <net/bpf.h> 103#include <net/bpf.h>
109#include <net/bpfdesc.h> 104#include <net/bpfdesc.h>
110 105
111/* Some useful defines and macros */ 106/* Some useful defines and macros */
112 107
113#define PODULE_IRQ_PENDING (1) 108#define PODULE_IRQ_PENDING (1)
114#define NFRAMES (16) /* number of frame to allow for receive */ 109#define NFRAMES (16) /* number of frame to allow for receive */

cvs diff -r1.52 -r1.53 src/sys/arch/amiga/dev/if_es.c (expand / switch to unified diff)

--- src/sys/arch/amiga/dev/if_es.c 2014/01/22 00:25:16 1.52
+++ src/sys/arch/amiga/dev/if_es.c 2015/05/20 09:17:17 1.53
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_es.c,v 1.52 2014/01/22 00:25:16 christos Exp $ */ 1/* $NetBSD: if_es.c,v 1.53 2015/05/20 09:17:17 ozaki-r Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1995 Michael L. Hitch 4 * Copyright (c) 1995 Michael L. Hitch
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -23,58 +23,53 @@ @@ -23,58 +23,53 @@
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28/* 28/*
29 * SMC 91C90 Single-Chip Ethernet Controller 29 * SMC 91C90 Single-Chip Ethernet Controller
30 */ 30 */
31#include "opt_ddb.h" 31#include "opt_ddb.h"
32#include "opt_inet.h" 32#include "opt_inet.h"
33#include "opt_ns.h" 33#include "opt_ns.h"
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: if_es.c,v 1.52 2014/01/22 00:25:16 christos Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: if_es.c,v 1.53 2015/05/20 09:17:17 ozaki-r Exp $");
37 37
38 38
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/systm.h> 40#include <sys/systm.h>
41#include <sys/mbuf.h> 41#include <sys/mbuf.h>
42#include <sys/buf.h> 42#include <sys/buf.h>
43#include <sys/protosw.h> 43#include <sys/protosw.h>
44#include <sys/socket.h> 44#include <sys/socket.h>
45#include <sys/syslog.h> 45#include <sys/syslog.h>
46#include <sys/ioctl.h> 46#include <sys/ioctl.h>
47#include <sys/errno.h> 47#include <sys/errno.h>
48#include <sys/device.h> 48#include <sys/device.h>
49 49
50#include <net/if.h> 50#include <net/if.h>
51#include <net/if_dl.h> 51#include <net/if_dl.h>
52#include <net/if_ether.h> 52#include <net/if_ether.h>
53#include <net/if_media.h> 53#include <net/if_media.h>
54 54
55#ifdef INET 55#ifdef INET
56#include <netinet/in.h> 56#include <netinet/in.h>
57#include <netinet/in_systm.h> 57#include <netinet/in_systm.h>
58#include <netinet/in_var.h> 58#include <netinet/in_var.h>
59#include <netinet/ip.h> 59#include <netinet/ip.h>
60#include <netinet/if_inarp.h> 60#include <netinet/if_inarp.h>
61#endif 61#endif
62 62
63#ifdef NS 
64#include <netns/ns.h> 
65#include <netns/ns_if.h> 
66#endif 
67 
68#include <machine/cpu.h> 63#include <machine/cpu.h>
69#include <amiga/amiga/device.h> 64#include <amiga/amiga/device.h>
70#include <amiga/amiga/isr.h> 65#include <amiga/amiga/isr.h>
71#include <amiga/dev/zbusvar.h> 66#include <amiga/dev/zbusvar.h>
72#include <amiga/dev/if_esreg.h> 67#include <amiga/dev/if_esreg.h>
73 68
74#define SWAP(x) (((x & 0xff) << 8) | ((x >> 8) & 0xff)) 69#define SWAP(x) (((x & 0xff) << 8) | ((x >> 8) & 0xff))
75 70
76#define USEPKTBUF 71#define USEPKTBUF
77 72
78/* 73/*
79 * Ethernet software status per interface. 74 * Ethernet software status per interface.
80 * 75 *
@@ -959,42 +954,26 @@ esioctl(struct ifnet *ifp, u_long cmd, v @@ -959,42 +954,26 @@ esioctl(struct ifnet *ifp, u_long cmd, v
959 954
960 switch (cmd) { 955 switch (cmd) {
961 956
962 case SIOCINITIFADDR: 957 case SIOCINITIFADDR:
963 ifp->if_flags |= IFF_UP; 958 ifp->if_flags |= IFF_UP;
964 959
965 switch (ifa->ifa_addr->sa_family) { 960 switch (ifa->ifa_addr->sa_family) {
966#ifdef INET 961#ifdef INET
967 case AF_INET: 962 case AF_INET:
968 esinit(sc); 963 esinit(sc);
969 arp_ifinit(ifp, ifa); 964 arp_ifinit(ifp, ifa);
970 break; 965 break;
971#endif 966#endif
972#ifdef NS 
973 case AF_NS: 
974 { 
975 register struct ns_addr *ina = &IA_SNS(ifa)->sns_addr; 
976 
977 if (ns_nullhost(*ina)) 
978 ina->x_host = 
979 *(union ns_host *)LLADDR(ifp->if_sadl); 
980 else 
981 bcopy(ina->x_host.c_host, 
982 LLADDR(ifp->if_sadl), ETHER_ADDR_LEN); 
983 /* Set new address. */ 
984 esinit(sc); 
985 break; 
986 } 
987#endif 
988 default: 967 default:
989 esinit(sc); 968 esinit(sc);
990 break; 969 break;
991 } 970 }
992 break; 971 break;
993 972
994 case SIOCSIFFLAGS: 973 case SIOCSIFFLAGS:
995 if ((error = ifioctl_common(ifp, cmd, data)) != 0) 974 if ((error = ifioctl_common(ifp, cmd, data)) != 0)
996 break; 975 break;
997 /* XXX see the comment in ed_ioctl() about code re-use */ 976 /* XXX see the comment in ed_ioctl() about code re-use */
998 /* 977 /*
999 * If interface is marked down and it is running, then stop it 978 * If interface is marked down and it is running, then stop it
1000 */ 979 */

cvs diff -r1.39 -r1.40 src/sys/arch/amiga/dev/if_qn.c (expand / switch to unified diff)

--- src/sys/arch/amiga/dev/if_qn.c 2012/10/27 17:17:29 1.39
+++ src/sys/arch/amiga/dev/if_qn.c 2015/05/20 09:17:17 1.40
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_qn.c,v 1.39 2012/10/27 17:17:29 chs Exp $ */ 1/* $NetBSD: if_qn.c,v 1.40 2015/05/20 09:17:17 ozaki-r Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1995 Mika Kortelainen 4 * Copyright (c) 1995 Mika Kortelainen
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -56,27 +56,27 @@ @@ -56,27 +56,27 @@
56 * All rights reserved. 56 * All rights reserved.
57 * 57 *
58 * - if_fe.c: some ideas for error handling for qn_rint() which might 58 * - if_fe.c: some ideas for error handling for qn_rint() which might
59 * have fixed those random lock ups, too. 59 * have fixed those random lock ups, too.
60 * 60 *
61 * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 61 * All Rights Reserved, Copyright (C) Fujitsu Limited 1995
62 * 62 *
63 * 63 *
64 * TODO: 64 * TODO:
65 * - add multicast support 65 * - add multicast support
66 */ 66 */
67 67
68#include <sys/cdefs.h> 68#include <sys/cdefs.h>
69__KERNEL_RCSID(0, "$NetBSD: if_qn.c,v 1.39 2012/10/27 17:17:29 chs Exp $"); 69__KERNEL_RCSID(0, "$NetBSD: if_qn.c,v 1.40 2015/05/20 09:17:17 ozaki-r Exp $");
70 70
71#include "qn.h" 71#include "qn.h"
72#if NQN > 0 72#if NQN > 0
73 73
74#define QN_DEBUG 74#define QN_DEBUG
75#define QN_DEBUG1_no /* hides some old tests */ 75#define QN_DEBUG1_no /* hides some old tests */
76#define QN_CHECKS_no /* adds some checks (not needed in normal situations) */ 76#define QN_CHECKS_no /* adds some checks (not needed in normal situations) */
77 77
78 78
79/* 79/*
80 * Fujitsu MB86950 Ethernet Controller (as used in the QuickNet QN2000 80 * Fujitsu MB86950 Ethernet Controller (as used in the QuickNet QN2000
81 * Ethernet card) 81 * Ethernet card)
82 */ 82 */
@@ -97,31 +97,26 @@ __KERNEL_RCSID(0, "$NetBSD: if_qn.c,v 1. @@ -97,31 +97,26 @@ __KERNEL_RCSID(0, "$NetBSD: if_qn.c,v 1.
97 97
98#include <net/if.h> 98#include <net/if.h>
99#include <net/if_dl.h> 99#include <net/if_dl.h>
100#include <net/if_ether.h> 100#include <net/if_ether.h>
101 101
102#ifdef INET 102#ifdef INET
103#include <netinet/in.h> 103#include <netinet/in.h>
104#include <netinet/in_systm.h> 104#include <netinet/in_systm.h>
105#include <netinet/in_var.h> 105#include <netinet/in_var.h>
106#include <netinet/ip.h> 106#include <netinet/ip.h>
107#include <netinet/if_inarp.h> 107#include <netinet/if_inarp.h>
108#endif 108#endif
109 109
110#ifdef NS 
111#include <netns/ns.h> 
112#include <netns/ns_if.h> 
113#endif 
114 
115#include <machine/cpu.h> 110#include <machine/cpu.h>
116#include <amiga/amiga/device.h> 111#include <amiga/amiga/device.h>
117#include <amiga/amiga/isr.h> 112#include <amiga/amiga/isr.h>
118#include <amiga/dev/zbusvar.h> 113#include <amiga/dev/zbusvar.h>
119#include <amiga/dev/if_qnreg.h> 114#include <amiga/dev/if_qnreg.h>
120 115
121 116
122#define NIC_R_MASK (R_INT_PKT_RDY | R_INT_ALG_ERR |\ 117#define NIC_R_MASK (R_INT_PKT_RDY | R_INT_ALG_ERR |\
123 R_INT_CRC_ERR | R_INT_OVR_FLO) 118 R_INT_CRC_ERR | R_INT_OVR_FLO)
124#define MAX_PACKETS 30 /* max number of packets read per interrupt */ 119#define MAX_PACKETS 30 /* max number of packets read per interrupt */
125 120
126/* 121/*
127 * Ethernet software status per interface 122 * Ethernet software status per interface
@@ -818,42 +813,26 @@ qnioctl(register struct ifnet *ifp, u_lo @@ -818,42 +813,26 @@ qnioctl(register struct ifnet *ifp, u_lo
818 switch (cmd) { 813 switch (cmd) {
819 814
820 case SIOCINITIFADDR: 815 case SIOCINITIFADDR:
821 ifp->if_flags |= IFF_UP; 816 ifp->if_flags |= IFF_UP;
822 817
823 switch (ifa->ifa_addr->sa_family) { 818 switch (ifa->ifa_addr->sa_family) {
824#ifdef INET 819#ifdef INET
825 case AF_INET: 820 case AF_INET:
826 qnstop(sc); 821 qnstop(sc);
827 qninit(sc); 822 qninit(sc);
828 arp_ifinit(ifp, ifa); 823 arp_ifinit(ifp, ifa);
829 break; 824 break;
830#endif 825#endif
831#ifdef NS 
832 case AF_NS: 
833 { 
834 register struct ns_addr *ina = &(IA_SNS(ifa)->sns_addr); 
835 
836 if (ns_nullhost(*ina)) 
837 ina->x_host = 
838 *(union ns_host *)LLADDR(ifp->if_sadl); 
839 else 
840 bcopy(ina->x_host.c_host, 
841 LLADDR(ifp->if_sadl), ETHER_ADDR_LEN); 
842 qnstop(sc); 
843 qninit(sc); 
844 break; 
845 } 
846#endif 
847 default: 826 default:
848 log(LOG_INFO, "qn:sa_family:default (not tested)\n"); 827 log(LOG_INFO, "qn:sa_family:default (not tested)\n");
849 qnstop(sc); 828 qnstop(sc);
850 qninit(sc); 829 qninit(sc);
851 break; 830 break;
852 } 831 }
853 break; 832 break;
854 833
855 case SIOCSIFFLAGS: 834 case SIOCSIFFLAGS:
856 if ((error = ifioctl_common(ifp, cmd, data)) != 0) 835 if ((error = ifioctl_common(ifp, cmd, data)) != 0)
857 break; 836 break;
858 /* XXX see the comment in ed_ioctl() about code re-use */ 837 /* XXX see the comment in ed_ioctl() about code re-use */
859 if ((ifp->if_flags & IFF_UP) == 0 && 838 if ((ifp->if_flags & IFF_UP) == 0 &&

cvs diff -r1.13 -r1.14 src/sys/arch/arm/at91/at91emac.c (expand / switch to unified diff)

--- src/sys/arch/arm/at91/at91emac.c 2012/11/12 18:00:36 1.13
+++ src/sys/arch/arm/at91/at91emac.c 2015/05/20 09:17:17 1.14
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1/* $Id: at91emac.c,v 1.13 2012/11/12 18:00:36 skrll Exp $ */ 1/* $Id: at91emac.c,v 1.14 2015/05/20 09:17:17 ozaki-r Exp $ */
2/* $NetBSD: at91emac.c,v 1.13 2012/11/12 18:00:36 skrll Exp $ */ 2/* $NetBSD: at91emac.c,v 1.14 2015/05/20 09:17:17 ozaki-r Exp $ */
3 3
4/* 4/*
5 * Copyright (c) 2007 Embedtronics Oy 5 * Copyright (c) 2007 Embedtronics Oy
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Based on arch/arm/ep93xx/epe.c 8 * Based on arch/arm/ep93xx/epe.c
9 * 9 *
10 * Copyright (c) 2004 Jesse Off 10 * Copyright (c) 2004 Jesse Off
11 * All rights reserved. 11 * All rights reserved.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions 14 * modification, are permitted provided that the following conditions
15 * are met: 15 * are met:
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 23 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 24 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 25 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
26 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE. 32 * POSSIBILITY OF SUCH DAMAGE.
33 */ 33 */
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.13 2012/11/12 18:00:36 skrll Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.14 2015/05/20 09:17:17 ozaki-r Exp $");
37 37
38#include <sys/types.h> 38#include <sys/types.h>
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/systm.h> 40#include <sys/systm.h>
41#include <sys/ioctl.h> 41#include <sys/ioctl.h>
42#include <sys/kernel.h> 42#include <sys/kernel.h>
43#include <sys/proc.h> 43#include <sys/proc.h>
44#include <sys/malloc.h> 44#include <sys/malloc.h>
45#include <sys/time.h> 45#include <sys/time.h>
46#include <sys/device.h> 46#include <sys/device.h>
47#include <uvm/uvm_extern.h> 47#include <uvm/uvm_extern.h>
48 48
49#include <sys/bus.h> 49#include <sys/bus.h>
@@ -58,31 +58,26 @@ __KERNEL_RCSID(0, "$NetBSD: at91emac.c,v @@ -58,31 +58,26 @@ __KERNEL_RCSID(0, "$NetBSD: at91emac.c,v
58#include <net/if_ether.h> 58#include <net/if_ether.h>
59 59
60#include <dev/mii/mii.h> 60#include <dev/mii/mii.h>
61#include <dev/mii/miivar.h> 61#include <dev/mii/miivar.h>
62 62
63#ifdef INET 63#ifdef INET
64#include <netinet/in.h> 64#include <netinet/in.h>
65#include <netinet/in_systm.h> 65#include <netinet/in_systm.h>
66#include <netinet/in_var.h> 66#include <netinet/in_var.h>
67#include <netinet/ip.h> 67#include <netinet/ip.h>
68#include <netinet/if_inarp.h> 68#include <netinet/if_inarp.h>
69#endif 69#endif
70 70
71#ifdef NS 
72#include <netns/ns.h> 
73#include <netns/ns_if.h> 
74#endif 
75 
76#include <net/bpf.h> 71#include <net/bpf.h>
77#include <net/bpfdesc.h> 72#include <net/bpfdesc.h>
78 73
79#ifdef IPKDB_AT91 // @@@ 74#ifdef IPKDB_AT91 // @@@
80#include <ipkdb/ipkdb.h> 75#include <ipkdb/ipkdb.h>
81#endif 76#endif
82 77
83#include <arm/at91/at91var.h> 78#include <arm/at91/at91var.h>
84#include <arm/at91/at91emacreg.h> 79#include <arm/at91/at91emacreg.h>
85#include <arm/at91/at91emacvar.h> 80#include <arm/at91/at91emacvar.h>
86 81
87#define DEFAULT_MDCDIV 32 82#define DEFAULT_MDCDIV 32
88 83

cvs diff -r1.31 -r1.32 src/sys/arch/arm/ep93xx/epe.c (expand / switch to unified diff)

--- src/sys/arch/arm/ep93xx/epe.c 2014/03/08 18:08:48 1.31
+++ src/sys/arch/arm/ep93xx/epe.c 2015/05/20 09:17:17 1.32
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: epe.c,v 1.31 2014/03/08 18:08:48 skrll Exp $ */ 1/* $NetBSD: epe.c,v 1.32 2015/05/20 09:17:17 ozaki-r Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2004 Jesse Off 4 * Copyright (c) 2004 Jesse Off
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.31 2014/03/08 18:08:48 skrll Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.32 2015/05/20 09:17:17 ozaki-r Exp $");
31 31
32#include <sys/types.h> 32#include <sys/types.h>
33#include <sys/param.h> 33#include <sys/param.h>
34#include <sys/systm.h> 34#include <sys/systm.h>
35#include <sys/ioctl.h> 35#include <sys/ioctl.h>
36#include <sys/kernel.h> 36#include <sys/kernel.h>
37#include <sys/proc.h> 37#include <sys/proc.h>
38#include <sys/malloc.h> 38#include <sys/malloc.h>
39#include <sys/time.h> 39#include <sys/time.h>
40#include <sys/device.h> 40#include <sys/device.h>
41#include <uvm/uvm_extern.h> 41#include <uvm/uvm_extern.h>
42 42
43#include <sys/bus.h> 43#include <sys/bus.h>
@@ -55,31 +55,26 @@ __KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.31 @@ -55,31 +55,26 @@ __KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.31
55#include <net/if_ether.h> 55#include <net/if_ether.h>
56 56
57#include <dev/mii/mii.h> 57#include <dev/mii/mii.h>
58#include <dev/mii/miivar.h> 58#include <dev/mii/miivar.h>
59 59
60#ifdef INET 60#ifdef INET
61#include <netinet/in.h> 61#include <netinet/in.h>
62#include <netinet/in_systm.h> 62#include <netinet/in_systm.h>
63#include <netinet/in_var.h> 63#include <netinet/in_var.h>
64#include <netinet/ip.h> 64#include <netinet/ip.h>
65#include <netinet/if_inarp.h> 65#include <netinet/if_inarp.h>
66#endif 66#endif
67 67
68#ifdef NS 
69#include <netns/ns.h> 
70#include <netns/ns_if.h> 
71#endif 
72 
73#include <net/bpf.h> 68#include <net/bpf.h>
74#include <net/bpfdesc.h> 69#include <net/bpfdesc.h>
75 70
76#include <arm/ep93xx/ep93xxreg.h> 71#include <arm/ep93xx/ep93xxreg.h>
77#include <arm/ep93xx/epereg.h>  72#include <arm/ep93xx/epereg.h>
78#include <arm/ep93xx/epevar.h>  73#include <arm/ep93xx/epevar.h>
79 74
80#define DEFAULT_MDCDIV 32 75#define DEFAULT_MDCDIV 32
81 76
82#ifndef EPE_FAST 77#ifndef EPE_FAST
83#define EPE_FAST 78#define EPE_FAST
84#endif 79#endif
85 80

cvs diff -r1.22 -r1.23 src/sys/arch/sun2/dev/if_ec.c (expand / switch to unified diff)

--- src/sys/arch/sun2/dev/if_ec.c 2015/04/13 21:18:42 1.22
+++ src/sys/arch/sun2/dev/if_ec.c 2015/05/20 09:17:17 1.23
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_ec.c,v 1.22 2015/04/13 21:18:42 riastradh Exp $ */ 1/* $NetBSD: if_ec.c,v 1.23 2015/05/20 09:17:17 ozaki-r Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Matthew Fredette. 8 * by Matthew Fredette.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 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 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * 3Com 3C400 device driver 33 * 3Com 3C400 device driver
34 */ 34 */
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.22 2015/04/13 21:18:42 riastradh Exp $"); 37__KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.23 2015/05/20 09:17:17 ozaki-r Exp $");
38 38
39#include "opt_inet.h" 39#include "opt_inet.h"
40#include "opt_ns.h" 40#include "opt_ns.h"
41 41
42#include <sys/param.h> 42#include <sys/param.h>
43#include <sys/systm.h> 43#include <sys/systm.h>
44#include <sys/errno.h> 44#include <sys/errno.h>
45#include <sys/ioctl.h> 45#include <sys/ioctl.h>
46#include <sys/mbuf.h> 46#include <sys/mbuf.h>
47#include <sys/socket.h> 47#include <sys/socket.h>
48#include <sys/syslog.h> 48#include <sys/syslog.h>
49#include <sys/device.h> 49#include <sys/device.h>
50#include <sys/endian.h> 50#include <sys/endian.h>
@@ -55,31 +55,26 @@ __KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1. @@ -55,31 +55,26 @@ __KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.
55#include <net/if_types.h> 55#include <net/if_types.h>
56 56
57#include <net/if_ether.h> 57#include <net/if_ether.h>
58#include <net/if_media.h> 58#include <net/if_media.h>
59 59
60#ifdef INET 60#ifdef INET
61#include <netinet/in.h> 61#include <netinet/in.h>
62#include <netinet/in_systm.h> 62#include <netinet/in_systm.h>
63#include <netinet/in_var.h> 63#include <netinet/in_var.h>
64#include <netinet/ip.h> 64#include <netinet/ip.h>
65#include <netinet/if_inarp.h> 65#include <netinet/if_inarp.h>
66#endif 66#endif
67 67
68#ifdef NS 
69#include <netns/ns.h> 
70#include <netns/ns_if.h> 
71#endif 
72 
73#include <net/bpf.h> 68#include <net/bpf.h>
74#include <net/bpfdesc.h> 69#include <net/bpfdesc.h>
75 70
76#include <machine/cpu.h> 71#include <machine/cpu.h>
77#include <machine/autoconf.h> 72#include <machine/autoconf.h>
78#include <machine/idprom.h> 73#include <machine/idprom.h>
79#include <machine/bus.h> 74#include <machine/bus.h>
80#include <machine/intr.h> 75#include <machine/intr.h>
81 76
82#include <sun2/dev/if_ecreg.h> 77#include <sun2/dev/if_ecreg.h>
83 78
84/* 79/*
85 * Interface softc. 80 * Interface softc.

cvs diff -r1.55 -r1.56 src/sys/arch/sun3/dev/if_ie.c (expand / switch to unified diff)

--- src/sys/arch/sun3/dev/if_ie.c 2010/04/05 07:19:32 1.55
+++ src/sys/arch/sun3/dev/if_ie.c 2015/05/20 09:17:17 1.56
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_ie.c,v 1.55 2010/04/05 07:19:32 joerg Exp $ */ 1/* $NetBSD: if_ie.c,v 1.56 2015/05/20 09:17:17 ozaki-r Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. 4 * Copyright (c) 1993, 1994, 1995 Charles M. Hannum.
5 * Copyright (c) 1992, 1993, University of Vermont and State 5 * Copyright (c) 1992, 1993, University of Vermont and State
6 * Agricultural College. 6 * Agricultural College.
7 * Copyright (c) 1992, 1993, Garrett A. Wollman. 7 * Copyright (c) 1992, 1993, Garrett A. Wollman.
8 * 8 *
9 * Portions: 9 * Portions:
10 * Copyright (c) 1994, 1995, Rafal K. Boni 10 * Copyright (c) 1994, 1995, Rafal K. Boni
11 * Copyright (c) 1990, 1991, William F. Jolitz 11 * Copyright (c) 1990, 1991, William F. Jolitz
12 * Copyright (c) 1990, The Regents of the University of California 12 * Copyright (c) 1990, The Regents of the University of California
13 * 13 *
14 * All rights reserved. 14 * All rights reserved.
@@ -88,27 +88,27 @@ @@ -88,27 +88,27 @@
88 buffer rather than being split off into various fields in the RFD. 88 buffer rather than being split off into various fields in the RFD.
89 This also means that we must include this header in the transmit 89 This also means that we must include this header in the transmit
90 buffer as well. 90 buffer as well.
91 91
92 By convention, all transmit commands, and only transmit commands, 92 By convention, all transmit commands, and only transmit commands,
93 shall have the I (IE_CMD_INTR) bit set in the command. This way, 93 shall have the I (IE_CMD_INTR) bit set in the command. This way,
94 when an interrupt arrives at ieintr(), it is immediately possible 94 when an interrupt arrives at ieintr(), it is immediately possible
95 to tell what precisely caused it. ANY OTHER command-sending 95 to tell what precisely caused it. ANY OTHER command-sending
96 routines should run at splnet(), and should post an acknowledgement 96 routines should run at splnet(), and should post an acknowledgement
97 to every interrupt they generate. 97 to every interrupt they generate.
98*/ 98*/
99 99
100#include <sys/cdefs.h> 100#include <sys/cdefs.h>
101__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.55 2010/04/05 07:19:32 joerg Exp $"); 101__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.56 2015/05/20 09:17:17 ozaki-r Exp $");
102 102
103#include "opt_inet.h" 103#include "opt_inet.h"
104#include "opt_ns.h" 104#include "opt_ns.h"
105 105
106#include <sys/param.h> 106#include <sys/param.h>
107#include <sys/systm.h> 107#include <sys/systm.h>
108#include <sys/mbuf.h> 108#include <sys/mbuf.h>
109#include <sys/buf.h> 109#include <sys/buf.h>
110#include <sys/protosw.h> 110#include <sys/protosw.h>
111#include <sys/socket.h> 111#include <sys/socket.h>
112#include <sys/ioctl.h> 112#include <sys/ioctl.h>
113#include <sys/errno.h> 113#include <sys/errno.h>
114#include <sys/syslog.h> 114#include <sys/syslog.h>
@@ -120,31 +120,26 @@ __KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1. @@ -120,31 +120,26 @@ __KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.
120#include <net/if_ether.h> 120#include <net/if_ether.h>
121 121
122#include <net/bpf.h> 122#include <net/bpf.h>
123#include <net/bpfdesc.h> 123#include <net/bpfdesc.h>
124 124
125#ifdef INET 125#ifdef INET
126#include <netinet/in.h> 126#include <netinet/in.h>
127#include <netinet/in_systm.h> 127#include <netinet/in_systm.h>
128#include <netinet/in_var.h> 128#include <netinet/in_var.h>
129#include <netinet/ip.h> 129#include <netinet/ip.h>
130#include <netinet/if_inarp.h> 130#include <netinet/if_inarp.h>
131#endif 131#endif
132 132
133#ifdef NS 
134#include <netns/ns.h> 
135#include <netns/ns_if.h> 
136#endif 
137 
138#include <uvm/uvm_extern.h> 133#include <uvm/uvm_extern.h>
139 134
140#include <machine/autoconf.h> 135#include <machine/autoconf.h>
141#include <machine/cpu.h> 136#include <machine/cpu.h>
142#include <machine/pmap.h> 137#include <machine/pmap.h>
143 138
144/* 139/*
145 * ugly byte-order hack for SUNs 140 * ugly byte-order hack for SUNs
146 */ 141 */
147 142
148#define XSWAP(y) ( (((y) & 0xff00) >> 8) | (((y) & 0xff) << 8) ) 143#define XSWAP(y) ( (((y) & 0xff00) >> 8) | (((y) & 0xff) << 8) )
149#define SWAP(x) ((u_short)(XSWAP((u_short)(x)))) 144#define SWAP(x) ((u_short)(XSWAP((u_short)(x))))
150 145
@@ -1510,43 +1505,26 @@ ieioctl(struct ifnet *ifp, u_long cmd, v @@ -1510,43 +1505,26 @@ ieioctl(struct ifnet *ifp, u_long cmd, v
1510 1505
1511 switch (cmd) { 1506 switch (cmd) {
1512 1507
1513 case SIOCINITIFADDR: 1508 case SIOCINITIFADDR:
1514 ifp->if_flags |= IFF_UP; 1509 ifp->if_flags |= IFF_UP;
1515 1510
1516 switch (ifa->ifa_addr->sa_family) { 1511 switch (ifa->ifa_addr->sa_family) {
1517#ifdef INET 1512#ifdef INET
1518 case AF_INET: 1513 case AF_INET:
1519 ieinit(sc); 1514 ieinit(sc);
1520 arp_ifinit(ifp, ifa); 1515 arp_ifinit(ifp, ifa);
1521 break; 1516 break;
1522#endif 1517#endif
1523#ifdef NS 
1524 /* XXX - This code is probably wrong. */ 
1525 case AF_NS: 
1526 { 
1527 struct ns_addr *ina = &IA_SNS(ifa)->sns_addr; 
1528 
1529 if (ns_nullhost(*ina)) 
1530 ina->x_host = 
1531 *(union ns_host *)LLADDR(ifp->if_sadl); 
1532 else 
1533 memcpy(LLADDR(ifp->if_sadl), 
1534 ina->x_host.c_host, ETHER_ADDR_LEN); 
1535 /* Set new address. */ 
1536 ieinit(sc); 
1537 break; 
1538 } 
1539#endif /* NS */ 
1540 default: 1518 default:
1541 ieinit(sc); 1519 ieinit(sc);
1542 break; 1520 break;
1543 } 1521 }
1544 break; 1522 break;
1545 1523
1546 case SIOCSIFFLAGS: 1524 case SIOCSIFFLAGS:
1547 if ((error = ifioctl_common(ifp, cmd, data)) != 0) 1525 if ((error = ifioctl_common(ifp, cmd, data)) != 0)
1548 break; 1526 break;
1549 sc->promisc = ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI); 1527 sc->promisc = ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI);
1550 1528
1551 switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) { 1529 switch (ifp->if_flags & (IFF_UP|IFF_RUNNING)) {
1552 case IFF_RUNNING: 1530 case IFF_RUNNING:

cvs diff -r1.17 -r1.18 src/sys/arch/x68k/dev/if_ne_intio.c (expand / switch to unified diff)

--- src/sys/arch/x68k/dev/if_ne_intio.c 2011/10/16 03:10:18 1.17
+++ src/sys/arch/x68k/dev/if_ne_intio.c 2015/05/20 09:17:18 1.18
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_ne_intio.c,v 1.17 2011/10/16 03:10:18 isaki Exp $ */ 1/* $NetBSD: if_ne_intio.c,v 1.18 2015/05/20 09:17:18 ozaki-r Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Tetsuya Isaki. All rights reserved. 4 * Copyright (c) 2001 Tetsuya Isaki. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -20,56 +20,51 @@ @@ -20,56 +20,51 @@
20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE. 25 * SUCH DAMAGE.
26 */ 26 */
27 27
28/* 28/*
29 * Ethernet part of Nereid Ethernet/USB/Memory board 29 * Ethernet part of Nereid Ethernet/USB/Memory board
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: if_ne_intio.c,v 1.17 2011/10/16 03:10:18 isaki Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: if_ne_intio.c,v 1.18 2015/05/20 09:17:18 ozaki-r Exp $");
34 34
35#include "opt_inet.h" 35#include "opt_inet.h"
36#include "opt_ns.h" 36#include "opt_ns.h"
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/mbuf.h> 40#include <sys/mbuf.h>
41#include <sys/socket.h> 41#include <sys/socket.h>
42#include <sys/select.h> 42#include <sys/select.h>
43#include <sys/device.h> 43#include <sys/device.h>
44 44
45#include <net/if.h> 45#include <net/if.h>
46#include <net/if_dl.h> 46#include <net/if_dl.h>
47#include <net/if_ether.h> 47#include <net/if_ether.h>
48#include <net/if_media.h> 48#include <net/if_media.h>
49 49
50#ifdef INET 50#ifdef INET
51#include <netinet/in.h> 51#include <netinet/in.h>
52#include <netinet/in_systm.h> 52#include <netinet/in_systm.h>
53#include <netinet/in_var.h> 53#include <netinet/in_var.h>
54#include <netinet/ip.h> 54#include <netinet/ip.h>
55#include <netinet/if_inarp.h> 55#include <netinet/if_inarp.h>
56#endif 56#endif
57 57
58#ifdef NS 
59#include <netns/ns.h> 
60#include <netns/ns_if.h> 
61#endif 
62 
63#if BPFILTER > 0 58#if BPFILTER > 0
64#include <net/bpf.h> 59#include <net/bpf.h>
65#include <net/bpfdesc.h> 60#include <net/bpfdesc.h>
66#endif 61#endif
67 62
68#include <machine/bus.h> 63#include <machine/bus.h>
69#include <machine/cpu.h> 64#include <machine/cpu.h>
70 65
71#include <dev/ic/dp8390reg.h> 66#include <dev/ic/dp8390reg.h>
72#include <dev/ic/dp8390var.h> 67#include <dev/ic/dp8390var.h>
73#include <dev/ic/ne2000reg.h> 68#include <dev/ic/ne2000reg.h>
74#include <dev/ic/ne2000var.h> 69#include <dev/ic/ne2000var.h>
75 70

cvs diff -r1.20 -r1.21 src/sys/arch/x68k/dev/if_ne_neptune.c (expand / switch to unified diff)

--- src/sys/arch/x68k/dev/if_ne_neptune.c 2010/03/03 13:39:57 1.20
+++ src/sys/arch/x68k/dev/if_ne_neptune.c 2015/05/20 09:17:18 1.21
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_ne_neptune.c,v 1.20 2010/03/03 13:39:57 tsutsui Exp $ */ 1/* $NetBSD: if_ne_neptune.c,v 1.21 2015/05/20 09:17:18 ozaki-r Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: if_ne_neptune.c,v 1.20 2010/03/03 13:39:57 tsutsui Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: if_ne_neptune.c,v 1.21 2015/05/20 09:17:18 ozaki-r Exp $");
35 35
36#include "opt_inet.h" 36#include "opt_inet.h"
37#include "opt_ns.h" 37#include "opt_ns.h"
38 38
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/systm.h> 40#include <sys/systm.h>
41#include <sys/mbuf.h> 41#include <sys/mbuf.h>
42#include <sys/socket.h> 42#include <sys/socket.h>
43#include <sys/ioctl.h> 43#include <sys/ioctl.h>
44#include <sys/errno.h> 44#include <sys/errno.h>
45#include <sys/syslog.h> 45#include <sys/syslog.h>
46#include <sys/select.h> 46#include <sys/select.h>
47#include <sys/device.h> 47#include <sys/device.h>
@@ -49,31 +49,26 @@ __KERNEL_RCSID(0, "$NetBSD: if_ne_neptun @@ -49,31 +49,26 @@ __KERNEL_RCSID(0, "$NetBSD: if_ne_neptun
49#include <net/if.h> 49#include <net/if.h>
50#include <net/if_dl.h> 50#include <net/if_dl.h>
51#include <net/if_ether.h> 51#include <net/if_ether.h>
52#include <net/if_media.h> 52#include <net/if_media.h>
53 53
54#ifdef INET 54#ifdef INET
55#include <netinet/in.h> 55#include <netinet/in.h>
56#include <netinet/in_systm.h> 56#include <netinet/in_systm.h>
57#include <netinet/in_var.h> 57#include <netinet/in_var.h>
58#include <netinet/ip.h> 58#include <netinet/ip.h>
59#include <netinet/if_inarp.h> 59#include <netinet/if_inarp.h>
60#endif 60#endif
61 61
62#ifdef NS 
63#include <netns/ns.h> 
64#include <netns/ns_if.h> 
65#endif 
66 
67#include <machine/bus.h> 62#include <machine/bus.h>
68 63
69#include <dev/ic/dp8390reg.h> 64#include <dev/ic/dp8390reg.h>
70#include <dev/ic/dp8390var.h> 65#include <dev/ic/dp8390var.h>
71 66
72#include <dev/ic/ne2000reg.h> 67#include <dev/ic/ne2000reg.h>
73#include <dev/ic/ne2000var.h> 68#include <dev/ic/ne2000var.h>
74 69
75#include <arch/x68k/dev/neptunevar.h> 70#include <arch/x68k/dev/neptunevar.h>
76 71
77static int ne_neptune_match(device_t, cfdata_t, void *); 72static int ne_neptune_match(device_t, cfdata_t, void *);
78static void ne_neptune_attach(device_t, device_t, void *); 73static void ne_neptune_attach(device_t, device_t, void *);
79 74

cvs diff -r1.1 -r1.2 src/sys/dev/cadence/if_cemac.c (expand / switch to unified diff)

--- src/sys/dev/cadence/if_cemac.c 2015/01/23 12:34:09 1.1
+++ src/sys/dev/cadence/if_cemac.c 2015/05/20 09:17:18 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_cemac.c,v 1.1 2015/01/23 12:34:09 hkenken Exp $ */ 1/* $NetBSD: if_cemac.c,v 1.2 2015/05/20 09:17:18 ozaki-r Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2015 Genetec Corporation. All rights reserved. 4 * Copyright (c) 2015 Genetec Corporation. All rights reserved.
5 * Written by Hashimoto Kenichi for Genetec Corporation. 5 * Written by Hashimoto Kenichi for Genetec Corporation.
6 * 6 *
7 * Based on arch/arm/at91/at91emac.c 7 * Based on arch/arm/at91/at91emac.c
8 * 8 *
9 * Copyright (c) 2007 Embedtronics Oy 9 * Copyright (c) 2007 Embedtronics Oy
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Copyright (c) 2004 Jesse Off 12 * Copyright (c) 2004 Jesse Off
13 * All rights reserved. 13 * All rights reserved.
14 * 14 *
@@ -30,27 +30,27 @@ @@ -30,27 +30,27 @@
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE. 34 * POSSIBILITY OF SUCH DAMAGE.
35 */ 35 */
36 36
37/* 37/*
38 * Cadence EMAC/GEM ethernet controller IP driver 38 * Cadence EMAC/GEM ethernet controller IP driver
39 * used by arm/at91, arm/zynq SoC 39 * used by arm/at91, arm/zynq SoC
40 */ 40 */
41 41
42#include <sys/cdefs.h> 42#include <sys/cdefs.h>
43__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.1 2015/01/23 12:34:09 hkenken Exp $"); 43__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.2 2015/05/20 09:17:18 ozaki-r Exp $");
44 44
45#include <sys/types.h> 45#include <sys/types.h>
46#include <sys/param.h> 46#include <sys/param.h>
47#include <sys/systm.h> 47#include <sys/systm.h>
48#include <sys/ioctl.h> 48#include <sys/ioctl.h>
49#include <sys/kernel.h> 49#include <sys/kernel.h>
50#include <sys/proc.h> 50#include <sys/proc.h>
51#include <sys/malloc.h> 51#include <sys/malloc.h>
52#include <sys/time.h> 52#include <sys/time.h>
53#include <sys/device.h> 53#include <sys/device.h>
54#include <uvm/uvm_extern.h> 54#include <uvm/uvm_extern.h>
55 55
56#include <sys/bus.h> 56#include <sys/bus.h>
@@ -65,31 +65,26 @@ __KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v @@ -65,31 +65,26 @@ __KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v
65#include <net/if_ether.h> 65#include <net/if_ether.h>
66 66
67#include <dev/mii/mii.h> 67#include <dev/mii/mii.h>
68#include <dev/mii/miivar.h> 68#include <dev/mii/miivar.h>
69 69
70#ifdef INET 70#ifdef INET
71#include <netinet/in.h> 71#include <netinet/in.h>
72#include <netinet/in_systm.h> 72#include <netinet/in_systm.h>
73#include <netinet/in_var.h> 73#include <netinet/in_var.h>
74#include <netinet/ip.h> 74#include <netinet/ip.h>
75#include <netinet/if_inarp.h> 75#include <netinet/if_inarp.h>
76#endif 76#endif
77 77
78#ifdef NS 
79#include <netns/ns.h> 
80#include <netns/ns_if.h> 
81#endif 
82 
83#include <net/bpf.h> 78#include <net/bpf.h>
84#include <net/bpfdesc.h> 79#include <net/bpfdesc.h>
85 80
86#ifdef IPKDB_AT91 // @@@ 81#ifdef IPKDB_AT91 // @@@
87#include <ipkdb/ipkdb.h> 82#include <ipkdb/ipkdb.h>
88#endif 83#endif
89 84
90#include <dev/cadence/cemacreg.h> 85#include <dev/cadence/cemacreg.h>
91#include <dev/cadence/if_cemacvar.h> 86#include <dev/cadence/if_cemacvar.h>
92 87
93#define DEFAULT_MDCDIV 32 88#define DEFAULT_MDCDIV 32
94 89
95#define CEMAC_READ(x) \ 90#define CEMAC_READ(x) \

cvs diff -r1.41 -r1.42 src/sys/net/Attic/if_ecosubr.c (expand / switch to unified diff)

--- src/sys/net/Attic/if_ecosubr.c 2014/11/16 16:20:01 1.41
+++ src/sys/net/Attic/if_ecosubr.c 2015/05/20 09:17:18 1.42
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_ecosubr.c,v 1.41 2014/11/16 16:20:01 ozaki-r Exp $ */ 1/* $NetBSD: if_ecosubr.c,v 1.42 2015/05/20 09:17:18 ozaki-r Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001 Ben Harris 4 * Copyright (c) 2001 Ben Harris
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -48,27 +48,27 @@ @@ -48,27 +48,27 @@
48 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 48 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
49 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 49 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 50 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
51 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 51 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 52 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
53 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 53 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
54 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 54 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
55 * SUCH DAMAGE. 55 * SUCH DAMAGE.
56 * 56 *
57 * @(#)if_ethersubr.c 8.2 (Berkeley) 4/4/96 57 * @(#)if_ethersubr.c 8.2 (Berkeley) 4/4/96
58 */ 58 */
59 59
60#include <sys/cdefs.h> 60#include <sys/cdefs.h>
61__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.41 2014/11/16 16:20:01 ozaki-r Exp $"); 61__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.42 2015/05/20 09:17:18 ozaki-r Exp $");
62 62
63#include "opt_inet.h" 63#include "opt_inet.h"
64 64
65#include <sys/param.h> 65#include <sys/param.h>
66#include <sys/errno.h> 66#include <sys/errno.h>
67#include <sys/kernel.h> 67#include <sys/kernel.h>
68#include <sys/socket.h> 68#include <sys/socket.h>
69#include <sys/sockio.h> 69#include <sys/sockio.h>
70#include <sys/syslog.h> 70#include <sys/syslog.h>
71#include <sys/systm.h> 71#include <sys/systm.h>
72 72
73#include <net/if.h> 73#include <net/if.h>
74#include <net/if_dl.h> 74#include <net/if_dl.h>
@@ -181,27 +181,27 @@ eco_output(struct ifnet *ifp, struct mbu @@ -181,27 +181,27 @@ eco_output(struct ifnet *ifp, struct mbu
181 181
182 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) 182 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
183 senderr(ENETDOWN); 183 senderr(ENETDOWN);
184 if ((rt = rt0) != NULL) { 184 if ((rt = rt0) != NULL) {
185 if ((rt->rt_flags & RTF_UP) == 0) { 185 if ((rt->rt_flags & RTF_UP) == 0) {
186 if ((rt0 = rt = rtalloc1(dst, 1)) != NULL) { 186 if ((rt0 = rt = rtalloc1(dst, 1)) != NULL) {
187 rt->rt_refcnt--; 187 rt->rt_refcnt--;
188 if (rt->rt_ifp != ifp) 188 if (rt->rt_ifp != ifp)
189 return (*rt->rt_ifp->if_output) 189 return (*rt->rt_ifp->if_output)
190 (ifp, m0, dst, rt); 190 (ifp, m0, dst, rt);
191 } else 191 } else
192 senderr(EHOSTUNREACH); 192 senderr(EHOSTUNREACH);
193 } 193 }
194 if ((rt->rt_flags & RTF_GATEWAY) && dst->sa_family != AF_NS) { 194 if ((rt->rt_flags & RTF_GATEWAY)) {
195 if (rt->rt_gwroute == 0) 195 if (rt->rt_gwroute == 0)
196 goto lookup; 196 goto lookup;
197 if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) { 197 if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) {
198 rtfree(rt); rt = rt0; 198 rtfree(rt); rt = rt0;
199 lookup: rt->rt_gwroute = rtalloc1(rt->rt_gateway, 1); 199 lookup: rt->rt_gwroute = rtalloc1(rt->rt_gateway, 1);
200 if ((rt = rt->rt_gwroute) == 0) 200 if ((rt = rt->rt_gwroute) == 0)
201 senderr(EHOSTUNREACH); 201 senderr(EHOSTUNREACH);
202 /* the "G" test below also prevents rt == rt0 */ 202 /* the "G" test below also prevents rt == rt0 */
203 if ((rt->rt_flags & RTF_GATEWAY) || 203 if ((rt->rt_flags & RTF_GATEWAY) ||
204 (rt->rt_ifp != ifp)) { 204 (rt->rt_ifp != ifp)) {
205 rt->rt_refcnt--; 205 rt->rt_refcnt--;
206 rt0->rt_gwroute = 0; 206 rt0->rt_gwroute = 0;
207 senderr(EHOSTUNREACH); 207 senderr(EHOSTUNREACH);

cvs diff -r1.41 -r1.42 src/sys/net/Attic/if_hippisubr.c (expand / switch to unified diff)

--- src/sys/net/Attic/if_hippisubr.c 2014/06/05 23:48:16 1.41
+++ src/sys/net/Attic/if_hippisubr.c 2015/05/20 09:17:18 1.42
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_hippisubr.c,v 1.41 2014/06/05 23:48:16 rmind Exp $ */ 1/* $NetBSD: if_hippisubr.c,v 1.42 2015/05/20 09:17:18 ozaki-r Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1982, 1989, 1993 4 * Copyright (c) 1982, 1989, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: if_hippisubr.c,v 1.41 2014/06/05 23:48:16 rmind Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: if_hippisubr.c,v 1.42 2015/05/20 09:17:18 ozaki-r Exp $");
34 34
35#include "opt_inet.h" 35#include "opt_inet.h"
36 36
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/kernel.h> 40#include <sys/kernel.h>
41#include <sys/malloc.h> 41#include <sys/malloc.h>
42#include <sys/mbuf.h> 42#include <sys/mbuf.h>
43#include <sys/protosw.h> 43#include <sys/protosw.h>
44#include <sys/socket.h> 44#include <sys/socket.h>
45#include <sys/ioctl.h> 45#include <sys/ioctl.h>
46#include <sys/errno.h> 46#include <sys/errno.h>
@@ -102,27 +102,27 @@ hippi_output(struct ifnet *ifp, struct m @@ -102,27 +102,27 @@ hippi_output(struct ifnet *ifp, struct m
102 if (m->m_flags & (M_BCAST | M_MCAST)) 102 if (m->m_flags & (M_BCAST | M_MCAST))
103 senderr(EOPNOTSUPP); /* XXX: some other error? */ 103 senderr(EOPNOTSUPP); /* XXX: some other error? */
104 104
105 if ((rt = rt0) != NULL) { 105 if ((rt = rt0) != NULL) {
106 if ((rt->rt_flags & RTF_UP) == 0) { 106 if ((rt->rt_flags & RTF_UP) == 0) {
107 if ((rt0 = rt = rtalloc1(dst, 1)) != NULL) { 107 if ((rt0 = rt = rtalloc1(dst, 1)) != NULL) {
108 rt->rt_refcnt--; 108 rt->rt_refcnt--;
109 if (rt->rt_ifp != ifp) 109 if (rt->rt_ifp != ifp)
110 return (*rt->rt_ifp->if_output) 110 return (*rt->rt_ifp->if_output)
111 (ifp, m0, dst, rt); 111 (ifp, m0, dst, rt);
112 } else 112 } else
113 senderr(EHOSTUNREACH); 113 senderr(EHOSTUNREACH);
114 } 114 }
115 if ((rt->rt_flags & RTF_GATEWAY) && dst->sa_family != AF_NS) { 115 if ((rt->rt_flags & RTF_GATEWAY)) {
116 if (rt->rt_gwroute == 0) 116 if (rt->rt_gwroute == 0)
117 goto lookup; 117 goto lookup;
118 if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) { 118 if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) {
119 rtfree(rt); rt = rt0; 119 rtfree(rt); rt = rt0;
120 lookup: rt->rt_gwroute = rtalloc1(rt->rt_gateway, 1); 120 lookup: rt->rt_gwroute = rtalloc1(rt->rt_gateway, 1);
121 if ((rt = rt->rt_gwroute) == 0) 121 if ((rt = rt->rt_gwroute) == 0)
122 senderr(EHOSTUNREACH); 122 senderr(EHOSTUNREACH);
123 /* the "G" test below also prevents rt == rt0 */ 123 /* the "G" test below also prevents rt == rt0 */
124 if ((rt->rt_flags & RTF_GATEWAY) || 124 if ((rt->rt_flags & RTF_GATEWAY) ||
125 (rt->rt_ifp != ifp)) { 125 (rt->rt_ifp != ifp)) {
126 rt->rt_refcnt--; 126 rt->rt_refcnt--;
127 rt0->rt_gwroute = 0; 127 rt0->rt_gwroute = 0;
128 senderr(EHOSTUNREACH); 128 senderr(EHOSTUNREACH);

cvs diff -r1.207 -r1.208 src/sys/net/if_ethersubr.c (expand / switch to unified diff)

--- src/sys/net/if_ethersubr.c 2015/04/13 22:46:57 1.207
+++ src/sys/net/if_ethersubr.c 2015/05/20 09:17:18 1.208
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_ethersubr.c,v 1.207 2015/04/13 22:46:57 riastradh Exp $ */ 1/* $NetBSD: if_ethersubr.c,v 1.208 2015/05/20 09:17:18 ozaki-r Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -51,27 +51,27 @@ @@ -51,27 +51,27 @@
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE. 58 * SUCH DAMAGE.
59 * 59 *
60 * @(#)if_ethersubr.c 8.2 (Berkeley) 4/4/96 60 * @(#)if_ethersubr.c 8.2 (Berkeley) 4/4/96
61 */ 61 */
62 62
63#include <sys/cdefs.h> 63#include <sys/cdefs.h>
64__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.207 2015/04/13 22:46:57 riastradh Exp $"); 64__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.208 2015/05/20 09:17:18 ozaki-r Exp $");
65 65
66#include "opt_inet.h" 66#include "opt_inet.h"
67#include "opt_atalk.h" 67#include "opt_atalk.h"
68#include "opt_ipx.h" 68#include "opt_ipx.h"
69#include "opt_mbuftrace.h" 69#include "opt_mbuftrace.h"
70#include "opt_mpls.h" 70#include "opt_mpls.h"
71#include "opt_gateway.h" 71#include "opt_gateway.h"
72#include "opt_pppoe.h" 72#include "opt_pppoe.h"
73#include "opt_net_mpsafe.h" 73#include "opt_net_mpsafe.h"
74#include "vlan.h" 74#include "vlan.h"
75#include "pppoe.h" 75#include "pppoe.h"
76#include "bridge.h" 76#include "bridge.h"
77#include "arp.h" 77#include "arp.h"
@@ -245,27 +245,27 @@ ether_output(struct ifnet * const ifp0,  @@ -245,27 +245,27 @@ ether_output(struct ifnet * const ifp0,
245 245
246 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) 246 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
247 senderr(ENETDOWN); 247 senderr(ENETDOWN);
248 if ((rt = rt0) != NULL) { 248 if ((rt = rt0) != NULL) {
249 if ((rt->rt_flags & RTF_UP) == 0) { 249 if ((rt->rt_flags & RTF_UP) == 0) {
250 if ((rt0 = rt = rtalloc1(dst, 1)) != NULL) { 250 if ((rt0 = rt = rtalloc1(dst, 1)) != NULL) {
251 rt->rt_refcnt--; 251 rt->rt_refcnt--;
252 if (rt->rt_ifp != ifp) 252 if (rt->rt_ifp != ifp)
253 return (*rt->rt_ifp->if_output) 253 return (*rt->rt_ifp->if_output)
254 (ifp, m0, dst, rt); 254 (ifp, m0, dst, rt);
255 } else 255 } else
256 senderr(EHOSTUNREACH); 256 senderr(EHOSTUNREACH);
257 } 257 }
258 if ((rt->rt_flags & RTF_GATEWAY) && dst->sa_family != AF_NS) { 258 if ((rt->rt_flags & RTF_GATEWAY)) {
259 if (rt->rt_gwroute == NULL) 259 if (rt->rt_gwroute == NULL)
260 goto lookup; 260 goto lookup;
261 if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) { 261 if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) {
262 rtfree(rt); rt = rt0; 262 rtfree(rt); rt = rt0;
263 lookup: rt->rt_gwroute = rtalloc1(rt->rt_gateway, 1); 263 lookup: rt->rt_gwroute = rtalloc1(rt->rt_gateway, 1);
264 if ((rt = rt->rt_gwroute) == NULL) 264 if ((rt = rt->rt_gwroute) == NULL)
265 senderr(EHOSTUNREACH); 265 senderr(EHOSTUNREACH);
266 /* the "G" test below also prevents rt == rt0 */ 266 /* the "G" test below also prevents rt == rt0 */
267 if ((rt->rt_flags & RTF_GATEWAY) || 267 if ((rt->rt_flags & RTF_GATEWAY) ||
268 (rt->rt_ifp != ifp)) { 268 (rt->rt_ifp != ifp)) {
269 rt->rt_refcnt--; 269 rt->rt_refcnt--;
270 rt0->rt_gwroute = NULL; 270 rt0->rt_gwroute = NULL;
271 senderr(EHOSTUNREACH); 271 senderr(EHOSTUNREACH);

cvs diff -r1.88 -r1.89 src/sys/net/Attic/if_fddisubr.c (expand / switch to unified diff)

--- src/sys/net/Attic/if_fddisubr.c 2014/06/07 09:34:02 1.88
+++ src/sys/net/Attic/if_fddisubr.c 2015/05/20 09:17:18 1.89
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_fddisubr.c,v 1.88 2014/06/07 09:34:02 martin Exp $ */ 1/* $NetBSD: if_fddisubr.c,v 1.89 2015/05/20 09:17:18 ozaki-r Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -86,27 +86,27 @@ @@ -86,27 +86,27 @@
86 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 86 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
87 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 87 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
88 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 88 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
89 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 89 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
90 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 90 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
91 * SUCH DAMAGE. 91 * SUCH DAMAGE.
92 * 92 *
93 * @(#)if_fddisubr.c 8.1 (Berkeley) 6/10/93 93 * @(#)if_fddisubr.c 8.1 (Berkeley) 6/10/93
94 * 94 *
95 * Id: if_fddisubr.c,v 1.15 1997/03/21 22:35:50 thomas Exp 95 * Id: if_fddisubr.c,v 1.15 1997/03/21 22:35:50 thomas Exp
96 */ 96 */
97 97
98#include <sys/cdefs.h> 98#include <sys/cdefs.h>
99__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.88 2014/06/07 09:34:02 martin Exp $"); 99__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.89 2015/05/20 09:17:18 ozaki-r Exp $");
100 100
101#include "opt_gateway.h" 101#include "opt_gateway.h"
102#include "opt_inet.h" 102#include "opt_inet.h"
103#include "opt_atalk.h" 103#include "opt_atalk.h"
104#include "opt_ipx.h" 104#include "opt_ipx.h"
105#include "opt_mbuftrace.h" 105#include "opt_mbuftrace.h"
106 106
107 107
108#include <sys/param.h> 108#include <sys/param.h>
109#include <sys/systm.h> 109#include <sys/systm.h>
110#include <sys/kernel.h> 110#include <sys/kernel.h>
111#include <sys/malloc.h> 111#include <sys/malloc.h>
112#include <sys/mbuf.h> 112#include <sys/mbuf.h>
@@ -452,30 +452,28 @@ bad: @@ -452,30 +452,28 @@ bad:
452} 452}
453 453
454/* 454/*
455 * Process a received FDDI packet; 455 * Process a received FDDI packet;
456 * the packet is in the mbuf chain m with 456 * the packet is in the mbuf chain m with
457 * the fddi header. 457 * the fddi header.
458 */ 458 */
459static void 459static void
460fddi_input(struct ifnet *ifp, struct mbuf *m) 460fddi_input(struct ifnet *ifp, struct mbuf *m)
461{ 461{
462#if defined(INET) || defined(INET6) 462#if defined(INET) || defined(INET6)
463 pktqueue_t *pktq = NULL; 463 pktqueue_t *pktq = NULL;
464#endif 464#endif
465#if defined(NS) || defined(DECNET) || defined(IPX) || defined(NETATALK) 465#if defined(DECNET) || defined(IPX) || defined(NETATALK)
466 struct ifqueue *inq = NULL; 466 struct ifqueue *inq = NULL;
467#endif 
468#if defined(NS) || defined(DECNET) || defined(IPX) || defined(NETATALK) 
469 int isr = 0; 467 int isr = 0;
470 int s; 468 int s;
471#endif 469#endif
472 470
473 struct llc *l; 471 struct llc *l;
474 struct fddi_header *fh; 472 struct fddi_header *fh;
475 473
476 MCLAIM(m, &((struct ethercom *)ifp)->ec_rx_mowner); 474 MCLAIM(m, &((struct ethercom *)ifp)->ec_rx_mowner);
477 if ((ifp->if_flags & IFF_UP) == 0) { 475 if ((ifp->if_flags & IFF_UP) == 0) {
478 m_freem(m); 476 m_freem(m);
479 return; 477 return;
480 } 478 }
481 479
@@ -498,27 +496,27 @@ fddi_input(struct ifnet *ifp, struct mbu @@ -498,27 +496,27 @@ fddi_input(struct ifnet *ifp, struct mbu
498 496
499#ifdef M_LINK0 497#ifdef M_LINK0
500 /* 498 /*
501 * If this has a LLC priority of 0, then mark it so upper 499 * If this has a LLC priority of 0, then mark it so upper
502 * layers have a hint that it really came via a FDDI/Ethernet 500 * layers have a hint that it really came via a FDDI/Ethernet
503 * bridge. 501 * bridge.
504 */ 502 */
505 if ((fh->fddi_fc & FDDIFC_LLC_PRIO7) == FDDIFC_LLC_PRIO0) 503 if ((fh->fddi_fc & FDDIFC_LLC_PRIO7) == FDDIFC_LLC_PRIO0)
506 m->m_flags |= M_LINK0; 504 m->m_flags |= M_LINK0;
507#endif 505#endif
508 506
509 l = (struct llc *)(fh+1); 507 l = (struct llc *)(fh+1);
510 switch (l->llc_dsap) { 508 switch (l->llc_dsap) {
511#if defined(INET) || defined(INET6) || defined(NS) || defined(DECNET) || defined(IPX) || defined(NETATALK) 509#if defined(INET) || defined(INET6) || defined(DECNET) || defined(IPX) || defined(NETATALK)
512 case LLC_SNAP_LSAP: 510 case LLC_SNAP_LSAP:
513 { 511 {
514 uint16_t etype; 512 uint16_t etype;
515 if (l->llc_control != LLC_UI || l->llc_ssap != LLC_SNAP_LSAP) 513 if (l->llc_control != LLC_UI || l->llc_ssap != LLC_SNAP_LSAP)
516 goto dropanyway; 514 goto dropanyway;
517 515
518 /* Strip off the FDDI header. */ 516 /* Strip off the FDDI header. */
519 m_adj(m, sizeof(struct fddi_header)); 517 m_adj(m, sizeof(struct fddi_header));
520 518
521#ifdef NETATALK 519#ifdef NETATALK
522 if (memcmp(&(l->llc_snap_org_code)[0], at_org_code, 520 if (memcmp(&(l->llc_snap_org_code)[0], at_org_code,
523 sizeof(at_org_code)) == 0 && 521 sizeof(at_org_code)) == 0 &&
524 ntohs(l->llc_snap_ether_type) == ETHERTYPE_ATALK) { 522 ntohs(l->llc_snap_ether_type) == ETHERTYPE_ATALK) {
@@ -549,27 +547,27 @@ fddi_input(struct ifnet *ifp, struct mbu @@ -549,27 +547,27 @@ fddi_input(struct ifnet *ifp, struct mbu
549 547
550 switch (etype) { 548 switch (etype) {
551#ifdef INET 549#ifdef INET
552 case ETHERTYPE_IP: 550 case ETHERTYPE_IP:
553#ifdef GATEWAY 551#ifdef GATEWAY
554 if (ipflow_fastforward(m)) 552 if (ipflow_fastforward(m))
555 return; 553 return;
556#endif 554#endif
557 pktq = ip_pktq; 555 pktq = ip_pktq;
558 break; 556 break;
559 557
560 case ETHERTYPE_ARP: 558 case ETHERTYPE_ARP:
561#if !defined(__bsdi__) || _BSDI_VERSION >= 199401 559#if !defined(__bsdi__) || _BSDI_VERSION >= 199401
562#if defined(NS) || defined(DECNET) || defined(IPX) || defined(NETATALK) 560#if defined(DECNET) || defined(IPX) || defined(NETATALK)
563 isr = NETISR_ARP; 561 isr = NETISR_ARP;
564 inq = &arpintrq; 562 inq = &arpintrq;
565#endif 563#endif
566 break; 564 break;
567#else 565#else
568 arpinput(ifp, m); 566 arpinput(ifp, m);
569 return; 567 return;
570#endif 568#endif
571#endif 569#endif
572#ifdef IPX 570#ifdef IPX
573 case ETHERTYPE_IPX: 571 case ETHERTYPE_IPX:
574 isr = NETISR_IPX; 572 isr = NETISR_IPX;
575 inq = &ipxintrq; 573 inq = &ipxintrq;
@@ -601,42 +599,42 @@ fddi_input(struct ifnet *ifp, struct mbu @@ -601,42 +599,42 @@ fddi_input(struct ifnet *ifp, struct mbu
601 aarpinput(ifp, m); /* XXX */ 599 aarpinput(ifp, m); /* XXX */
602 return; 600 return;
603#endif /* NETATALK */ 601#endif /* NETATALK */
604 default: 602 default:
605 ifp->if_noproto++; 603 ifp->if_noproto++;
606 goto dropanyway; 604 goto dropanyway;
607 } 605 }
608 break; 606 break;
609 } 607 }
610#endif /* INET || NS */ 608#endif /* INET || NS */
611 609
612 default: 610 default:
613 ifp->if_noproto++; 611 ifp->if_noproto++;
614#if defined(INET) || defined(INET6) || defined(NS) || defined(DECNET) || defined(IPX) || defined(NETATALK) 612#if defined(INET) || defined(INET6) || defined(DECNET) || defined(IPX) || defined(NETATALK)
615 dropanyway: 613 dropanyway:
616#endif 614#endif
617 m_freem(m); 615 m_freem(m);
618 return; 616 return;
619 } 617 }
620 618
621#if defined(INET) || defined(INET6) 619#if defined(INET) || defined(INET6)
622 if (__predict_true(pktq)) { 620 if (__predict_true(pktq)) {
623 if (__predict_false(!pktq_enqueue(pktq, m, 0))) { 621 if (__predict_false(!pktq_enqueue(pktq, m, 0))) {
624 m_freem(m); 622 m_freem(m);
625 } 623 }
626 return; 624 return;
627 } 625 }
628#endif 626#endif
629#if defined(NS) || defined(DECNET) || defined(IPX) || defined(NETATALK) 627#if defined(DECNET) || defined(IPX) || defined(NETATALK)
630 if (!inq) { 628 if (!inq) {
631 m_freem(m); 629 m_freem(m);
632 } 630 }
633 s = splnet(); 631 s = splnet();
634 if (IF_QFULL(inq)) { 632 if (IF_QFULL(inq)) {
635 IF_DROP(inq); 633 IF_DROP(inq);
636 m_freem(m); 634 m_freem(m);
637 } else { 635 } else {
638 IF_ENQUEUE(inq, m); 636 IF_ENQUEUE(inq, m);
639 schednetisr(isr); 637 schednetisr(isr);
640 } 638 }
641 splx(s); 639 splx(s);
642#endif 640#endif

cvs diff -r1.66 -r1.67 src/sys/net/Attic/if_tokensubr.c (expand / switch to unified diff)

--- src/sys/net/Attic/if_tokensubr.c 2014/11/28 08:29:00 1.66
+++ src/sys/net/Attic/if_tokensubr.c 2015/05/20 09:17:18 1.67
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_tokensubr.c,v 1.66 2014/11/28 08:29:00 ozaki-r Exp $ */ 1/* $NetBSD: if_tokensubr.c,v 1.67 2015/05/20 09:17:18 ozaki-r Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1982, 1989, 1993 4 * Copyright (c) 1982, 1989, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -82,27 +82,27 @@ @@ -82,27 +82,27 @@
82 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 82 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
83 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 83 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
84 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 84 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
85 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 85 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
86 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 86 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
87 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 87 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
88 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 88 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
89 * SUCH DAMAGE. 89 * SUCH DAMAGE.
90 * 90 *
91 * from: NetBSD: if_fddisubr.c,v 1.2 1995/08/19 04:35:29 cgd Exp 91 * from: NetBSD: if_fddisubr.c,v 1.2 1995/08/19 04:35:29 cgd Exp
92 */ 92 */
93 93
94#include <sys/cdefs.h> 94#include <sys/cdefs.h>
95__KERNEL_RCSID(0, "$NetBSD: if_tokensubr.c,v 1.66 2014/11/28 08:29:00 ozaki-r Exp $"); 95__KERNEL_RCSID(0, "$NetBSD: if_tokensubr.c,v 1.67 2015/05/20 09:17:18 ozaki-r Exp $");
96 96
97#include "opt_inet.h" 97#include "opt_inet.h"
98#include "opt_atalk.h" 98#include "opt_atalk.h"
99#include "opt_gateway.h" 99#include "opt_gateway.h"
100 100
101 101
102#include <sys/param.h> 102#include <sys/param.h>
103#include <sys/systm.h> 103#include <sys/systm.h>
104#include <sys/kernel.h> 104#include <sys/kernel.h>
105#include <sys/malloc.h> 105#include <sys/malloc.h>
106#include <sys/mbuf.h> 106#include <sys/mbuf.h>
107#include <sys/protosw.h> 107#include <sys/protosw.h>
108#include <sys/socket.h> 108#include <sys/socket.h>
@@ -441,27 +441,27 @@ token_input(struct ifnet *ifp, struct mb @@ -441,27 +441,27 @@ token_input(struct ifnet *ifp, struct mb
441 441
442 /* Skip past the Token Ring header and RIF. */ 442 /* Skip past the Token Ring header and RIF. */
443 lan_hdr_len = sizeof(struct token_header); 443 lan_hdr_len = sizeof(struct token_header);
444 if (trh->token_shost[0] & TOKEN_RI_PRESENT) { 444 if (trh->token_shost[0] & TOKEN_RI_PRESENT) {
445 struct token_rif *trrif; 445 struct token_rif *trrif;
446 446
447 trrif = TOKEN_RIF(trh); 447 trrif = TOKEN_RIF(trh);
448 lan_hdr_len += (ntohs(trrif->tr_rcf) & TOKEN_RCF_LEN_MASK) >> 8; 448 lan_hdr_len += (ntohs(trrif->tr_rcf) & TOKEN_RCF_LEN_MASK) >> 8;
449 } 449 }
450 450
451 l = (struct llc *)(mtod(m, uint8_t *) + lan_hdr_len); 451 l = (struct llc *)(mtod(m, uint8_t *) + lan_hdr_len);
452 452
453 switch (l->llc_dsap) { 453 switch (l->llc_dsap) {
454#if defined(INET) || defined(NS) || defined(DECNET) 454#if defined(INET) || defined(DECNET)
455 case LLC_SNAP_LSAP: 455 case LLC_SNAP_LSAP:
456 { 456 {
457 uint16_t etype; 457 uint16_t etype;
458 if (l->llc_control != LLC_UI || l->llc_ssap != LLC_SNAP_LSAP) 458 if (l->llc_control != LLC_UI || l->llc_ssap != LLC_SNAP_LSAP)
459 goto dropanyway; 459 goto dropanyway;
460 if (l->llc_snap.org_code[0] != 0 || 460 if (l->llc_snap.org_code[0] != 0 ||
461 l->llc_snap.org_code[1] != 0 || 461 l->llc_snap.org_code[1] != 0 ||
462 l->llc_snap.org_code[2] != 0) 462 l->llc_snap.org_code[2] != 0)
463 goto dropanyway; 463 goto dropanyway;
464 etype = ntohs(l->llc_snap.ether_type); 464 etype = ntohs(l->llc_snap.ether_type);
465 m_adj(m, lan_hdr_len + LLC_SNAPFRAMELEN); 465 m_adj(m, lan_hdr_len + LLC_SNAPFRAMELEN);
466#if NCARP > 0 466#if NCARP > 0
467 if (ifp->if_carp && ifp->if_type != IFT_CARP && 467 if (ifp->if_carp && ifp->if_type != IFT_CARP &&
@@ -491,27 +491,27 @@ token_input(struct ifnet *ifp, struct mb @@ -491,27 +491,27 @@ token_input(struct ifnet *ifp, struct mb
491 /* 491 /*
492 printf("token_input: unknown protocol 0x%x\n", etype); 492 printf("token_input: unknown protocol 0x%x\n", etype);
493 */ 493 */
494 ifp->if_noproto++; 494 ifp->if_noproto++;
495 goto dropanyway; 495 goto dropanyway;
496 } 496 }
497 break; 497 break;
498 } 498 }
499#endif /* INET || NS || DECNET */ 499#endif /* INET || NS || DECNET */
500 500
501 default: 501 default:
502 /* printf("token_input: unknown dsap 0x%x\n", l->llc_dsap); */ 502 /* printf("token_input: unknown dsap 0x%x\n", l->llc_dsap); */
503 ifp->if_noproto++; 503 ifp->if_noproto++;
504#if defined(INET) || defined(NS) || defined(DECNET) 504#if defined(INET) || defined(DECNET)
505 dropanyway: 505 dropanyway:
506#endif 506#endif
507 m_freem(m); 507 m_freem(m);
508 return; 508 return;
509 } 509 }
510 510
511 if (__predict_true(pktq)) { 511 if (__predict_true(pktq)) {
512 if (__predict_false(!pktq_enqueue(pktq, m, 0))) { 512 if (__predict_false(!pktq_enqueue(pktq, m, 0))) {
513 m_freem(m); 513 m_freem(m);
514 } 514 }
515 return; 515 return;
516 } 516 }
517 517

cvs diff -r1.42 -r1.43 src/sys/net/Attic/netisr.h (expand / switch to unified diff)

--- src/sys/net/Attic/netisr.h 2013/03/01 18:25:57 1.42
+++ src/sys/net/Attic/netisr.h 2015/05/20 09:17:18 1.43
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: netisr.h,v 1.42 2013/03/01 18:25:57 joerg Exp $ */ 1/* $NetBSD: netisr.h,v 1.43 2015/05/20 09:17:18 ozaki-r Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1980, 1986, 1989, 1993 4 * Copyright (c) 1980, 1986, 1989, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -92,27 +92,26 @@ @@ -92,27 +92,26 @@
92#endif 92#endif
93 93
94#endif /* !defined(_LOCORE) */ 94#endif /* !defined(_LOCORE) */
95#endif /* defined(_KERNEL) */ 95#endif /* defined(_KERNEL) */
96 96
97 97
98/* 98/*
99 * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status 99 * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status
100 * word which is used to de-multiplex a single software 100 * word which is used to de-multiplex a single software
101 * interrupt used for scheduling the network code to calls 101 * interrupt used for scheduling the network code to calls
102 * on the lowest level routine of each protocol. 102 * on the lowest level routine of each protocol.
103 */ 103 */
104#define NETISR_IP 2 /* same as AF_INET */ 104#define NETISR_IP 2 /* same as AF_INET */
105#define NETISR_NS 6 /* same as AF_NS */ 
106#define NETISR_CCITT 10 /* same as AF_CCITT */ 105#define NETISR_CCITT 10 /* same as AF_CCITT */
107#define NETISR_ATALK 16 /* same as AF_APPLETALK */ 106#define NETISR_ATALK 16 /* same as AF_APPLETALK */
108#define NETISR_IPX 23 /* same as AF_IPX */ 107#define NETISR_IPX 23 /* same as AF_IPX */
109#define NETISR_IPV6 24 /* same as AF_INET6 */ 108#define NETISR_IPV6 24 /* same as AF_INET6 */
110#define NETISR_ISDN 26 /* same as AF_E164 */ 109#define NETISR_ISDN 26 /* same as AF_E164 */
111#define NETISR_NATM 27 /* same as AF_NATM */ 110#define NETISR_NATM 27 /* same as AF_NATM */
112#define NETISR_ARP 28 /* same as AF_ARP */ 111#define NETISR_ARP 28 /* same as AF_ARP */
113#define NETISR_MPLS 33 /* same as AF_MPLS */ 112#define NETISR_MPLS 33 /* same as AF_MPLS */
114#define NETISR_MAX AF_MAX 113#define NETISR_MAX AF_MAX
115 114
116#if !defined(_LOCORE) && defined(_KERNEL) 115#if !defined(_LOCORE) && defined(_KERNEL)
117/* XXX Legacy netisr support. */ 116/* XXX Legacy netisr support. */
118void schednetisr(int); 117void schednetisr(int);