summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2005-09-08 12:44:55 +0000
committerjsg <jsg@openbsd.org>2005-09-08 12:44:55 +0000
commitfe6a7506e13cb7c3b49b4bea6e5af59f79818eb3 (patch)
tree8d163af940d9808fc56b316d680009d577bb4bbc
parentfix reloads where capbilities change (diff)
downloadwireguard-openbsd-fe6a7506e13cb7c3b49b4bea6e5af59f79818eb3.tar.xz
wireguard-openbsd-fe6a7506e13cb7c3b49b4bea6e5af59f79818eb3.zip
Remove the last of the FreeBSD compatiblity goop.
ok reyk@
-rw-r--r--sys/dev/cardbus/if_ath_cardbus.c3
-rw-r--r--sys/dev/cardbus/if_atw_cardbus.c3
-rw-r--r--sys/dev/cardbus/if_rtw_cardbus.c3
-rw-r--r--sys/dev/ic/ar5xxx.h3
-rw-r--r--sys/dev/ic/ath.c3
-rw-r--r--sys/dev/ic/atw.c6
-rw-r--r--sys/dev/ic/rtw.c3
-rw-r--r--sys/dev/pci/if_ath_pci.c3
-rw-r--r--sys/dev/pci/if_atw_pci.c3
-rw-r--r--sys/dev/pci/if_rtw_pci.c3
-rw-r--r--sys/net80211/ieee80211.c22
-rw-r--r--sys/net80211/ieee80211_compat.h44
-rw-r--r--sys/net80211/ieee80211_crypto.c3
-rw-r--r--sys/net80211/ieee80211_input.c14
-rw-r--r--sys/net80211/ieee80211_node.c14
-rw-r--r--sys/net80211/ieee80211_output.c18
-rw-r--r--sys/net80211/ieee80211_proto.c19
-rw-r--r--sys/net80211/ieee80211_rssadapt.c3
18 files changed, 58 insertions, 112 deletions
diff --git a/sys/dev/cardbus/if_ath_cardbus.c b/sys/dev/cardbus/if_ath_cardbus.c
index e1dd0712567..e7713e38956 100644
--- a/sys/dev/cardbus/if_ath_cardbus.c
+++ b/sys/dev/cardbus/if_ath_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ath_cardbus.c,v 1.5 2005/06/08 05:36:33 henning Exp $ */
+/* $OpenBSD: if_ath_cardbus.c,v 1.6 2005/09/08 12:44:56 jsg Exp $ */
/* $NetBSD: if_ath_cardbus.c,v 1.4 2004/08/02 19:14:28 mycroft Exp $ */
/*
@@ -62,7 +62,6 @@
#include <netinet/if_ether.h>
#endif
-#include <net80211/ieee80211_compat.h>
#include <net80211/ieee80211_var.h>
#if NBPFILTER > 0
diff --git a/sys/dev/cardbus/if_atw_cardbus.c b/sys/dev/cardbus/if_atw_cardbus.c
index b664fa454ec..666afba4a5b 100644
--- a/sys/dev/cardbus/if_atw_cardbus.c
+++ b/sys/dev/cardbus/if_atw_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atw_cardbus.c,v 1.10 2005/06/08 05:36:33 henning Exp $ */
+/* $OpenBSD: if_atw_cardbus.c,v 1.11 2005/09/08 12:44:56 jsg Exp $ */
/* $NetBSD: if_atw_cardbus.c,v 1.9 2004/07/23 07:07:55 dyoung Exp $ */
/*-
@@ -66,7 +66,6 @@
#include <netinet/if_ether.h>
#endif
-#include <net80211/ieee80211_compat.h>
#include <net80211/ieee80211_radiotap.h>
#include <net80211/ieee80211_var.h>
diff --git a/sys/dev/cardbus/if_rtw_cardbus.c b/sys/dev/cardbus/if_rtw_cardbus.c
index c633165643a..b6487b630d4 100644
--- a/sys/dev/cardbus/if_rtw_cardbus.c
+++ b/sys/dev/cardbus/if_rtw_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rtw_cardbus.c,v 1.8 2005/06/08 05:36:33 henning Exp $ */
+/* $OpenBSD: if_rtw_cardbus.c,v 1.9 2005/09/08 12:44:56 jsg Exp $ */
/* $NetBSD: if_rtw_cardbus.c,v 1.4 2004/12/20 21:05:34 dyoung Exp $ */
/*-
@@ -98,7 +98,6 @@
#include <netinet/if_ether.h>
#endif
-#include <net80211/ieee80211_compat.h>
#include <net80211/ieee80211_radiotap.h>
#include <net80211/ieee80211_var.h>
diff --git a/sys/dev/ic/ar5xxx.h b/sys/dev/ic/ar5xxx.h
index 2f86057c041..dbe4928c1f6 100644
--- a/sys/dev/ic/ar5xxx.h
+++ b/sys/dev/ic/ar5xxx.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5xxx.h,v 1.25 2005/08/17 13:14:17 reyk Exp $ */
+/* $OpenBSD: ar5xxx.h,v 1.26 2005/09/08 12:44:55 jsg Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -57,7 +57,6 @@
#endif
#include <net80211/ieee80211_var.h>
-#include <net80211/ieee80211_compat.h>
#include <net80211/ieee80211_radiotap.h>
#include <net80211/ieee80211_regdomain.h>
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c
index 7b5a964f7a1..a7c4ecd524e 100644
--- a/sys/dev/ic/ath.c
+++ b/sys/dev/ic/ath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ath.c,v 1.36 2005/09/08 09:11:07 jsg Exp $ */
+/* $OpenBSD: ath.c,v 1.37 2005/09/08 12:44:55 jsg Exp $ */
/* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */
/*-
@@ -78,7 +78,6 @@
#endif
#include <net80211/ieee80211_var.h>
-#include <net80211/ieee80211_compat.h>
#include <dev/pci/pcidevs.h>
#include <dev/gpio/gpiovar.h>
diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c
index 0f8e245648a..a3ee829d921 100644
--- a/sys/dev/ic/atw.c
+++ b/sys/dev/ic/atw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atw.c,v 1.35 2005/08/27 09:13:50 avsm Exp $ */
+/* $OpenBSD: atw.c,v 1.36 2005/09/08 12:44:55 jsg Exp $ */
/* $NetBSD: atw.c,v 1.69 2004/07/23 07:07:55 dyoung Exp $ */
/*-
@@ -77,7 +77,6 @@ __KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.69 2004/07/23 07:07:55 dyoung Exp $");
#endif
#include <net80211/ieee80211_var.h>
-#include <net80211/ieee80211_compat.h>
#include <net80211/ieee80211_radiotap.h>
#include <machine/bus.h>
@@ -3814,7 +3813,8 @@ atw_start(struct ifnet *ifp)
lasttx = nexttx;
}
- IASSERT(lasttx != -1, ("bad lastx"));
+ if (lasttx == -1)
+ panic("%s: bad lastx", ifp->if_xname);
/* Set `first segment' and `last segment' appropriately. */
sc->sc_txdescs[sc->sc_txnext].at_flags |=
htole32(ATW_TXFLAG_FS);
diff --git a/sys/dev/ic/rtw.c b/sys/dev/ic/rtw.c
index 2bd416e20dd..5dabd999df7 100644
--- a/sys/dev/ic/rtw.c
+++ b/sys/dev/ic/rtw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtw.c,v 1.35 2005/07/18 02:43:27 fgsch Exp $ */
+/* $OpenBSD: rtw.c,v 1.36 2005/09/08 12:44:55 jsg Exp $ */
/* $NetBSD: rtw.c,v 1.29 2004/12/27 19:49:16 dyoung Exp $ */
/*-
@@ -67,7 +67,6 @@
#endif
#include <net80211/ieee80211_var.h>
-#include <net80211/ieee80211_compat.h>
#include <net80211/ieee80211_radiotap.h>
#include <dev/ic/rtwreg.h>
diff --git a/sys/dev/pci/if_ath_pci.c b/sys/dev/pci/if_ath_pci.c
index 11f43bde688..cb14fb81f43 100644
--- a/sys/dev/pci/if_ath_pci.c
+++ b/sys/dev/pci/if_ath_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ath_pci.c,v 1.6 2005/08/17 12:58:39 reyk Exp $ */
+/* $OpenBSD: if_ath_pci.c,v 1.7 2005/09/08 12:44:55 jsg Exp $ */
/* $NetBSD: if_ath_pci.c,v 1.7 2004/06/30 05:58:17 mycroft Exp $ */
/*-
@@ -65,7 +65,6 @@
#include <netinet/if_ether.h>
#endif
-#include <net80211/ieee80211_compat.h>
#include <net80211/ieee80211_var.h>
#include <dev/gpio/gpiovar.h>
diff --git a/sys/dev/pci/if_atw_pci.c b/sys/dev/pci/if_atw_pci.c
index 758f480418c..621c9aa35b8 100644
--- a/sys/dev/pci/if_atw_pci.c
+++ b/sys/dev/pci/if_atw_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atw_pci.c,v 1.6 2005/08/09 04:10:11 mickey Exp $ */
+/* $OpenBSD: if_atw_pci.c,v 1.7 2005/09/08 12:44:55 jsg Exp $ */
/* $NetBSD: if_atw_pci.c,v 1.7 2004/07/23 07:07:55 dyoung Exp $ */
/*-
@@ -64,7 +64,6 @@
#include <netinet/if_ether.h>
#endif
-#include <net80211/ieee80211_compat.h>
#include <net80211/ieee80211_radiotap.h>
#include <net80211/ieee80211_var.h>
diff --git a/sys/dev/pci/if_rtw_pci.c b/sys/dev/pci/if_rtw_pci.c
index 1ae12472679..87e5e7ee638 100644
--- a/sys/dev/pci/if_rtw_pci.c
+++ b/sys/dev/pci/if_rtw_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rtw_pci.c,v 1.6 2005/08/09 04:10:12 mickey Exp $ */
+/* $OpenBSD: if_rtw_pci.c,v 1.7 2005/09/08 12:44:55 jsg Exp $ */
/* $NetBSD: if_rtw_pci.c,v 1.1 2004/09/26 02:33:36 dyoung Exp $ */
/*-
@@ -67,7 +67,6 @@
#include <netinet/if_ether.h>
#endif
-#include <net80211/ieee80211_compat.h>
#include <net80211/ieee80211_radiotap.h>
#include <net80211/ieee80211_var.h>
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
index 8889d9180c1..c20e8a6c507 100644
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211.c,v 1.11 2005/09/08 09:11:08 jsg Exp $ */
+/* $OpenBSD: ieee80211.c,v 1.12 2005/09/08 12:44:55 jsg Exp $ */
/* $NetBSD: ieee80211.c,v 1.19 2004/06/06 05:45:29 dyoung Exp $ */
/*-
@@ -68,7 +68,6 @@
#endif
#include <net80211/ieee80211_var.h>
-#include <net80211/ieee80211_compat.h>
#ifdef IEEE80211_DEBUG
int ieee80211_debug = 0;
@@ -108,8 +107,8 @@ ieee80211_ifattach(struct ifnet *ifp)
ifp->if_output = ieee80211_output;
#if NBPFILTER > 0
- BPF_ATTACH(ifp, DLT_IEEE802_11,
- sizeof(struct ieee80211_frame_addr4), &ic->ic_rawbpf);
+ bpfattach(&ic->ic_rawbpf, ifp, DLT_IEEE802_11,
+ sizeof(struct ieee80211_frame_addr4));
#endif
ieee80211_crypto_attach(ifp);
@@ -182,7 +181,7 @@ ieee80211_ifdetach(struct ifnet *ifp)
LIST_REMOVE(ic, ic_list);
ifmedia_delete_instance(&ic->ic_media, IFM_INST_ANY);
#if NBPFILTER > 0
- BPF_DETACH(ifp);
+ bpfdetach(ifp);
#endif
ether_ifdetach(ifp);
}
@@ -674,7 +673,8 @@ ieee80211_setmode(struct ieee80211com *ic, enum ieee80211_phymode mode)
* Verify at least one channel is present in the available
* channel list before committing to the new mode.
*/
- IASSERT(mode < N(chanflags), ("Unexpected mode %u", mode));
+ if (mode >= N(chanflags))
+ panic("Unexpected mode %u", mode);
modeflags = chanflags[mode];
for (i = 0; i <= IEEE80211_CHAN_MAX; i++) {
c = &ic->ic_channels[i];
@@ -721,11 +721,11 @@ ieee80211_setmode(struct ieee80211com *ic, enum ieee80211_phymode mode)
ic->ic_ibss_chan = &ic->ic_channels[i];
break;
}
- IASSERT(ic->ic_ibss_chan != NULL &&
- isset(ic->ic_chan_active,
- ieee80211_chan2ieee(ic, ic->ic_ibss_chan)),
- ("Bad IBSS channel %u\n",
- ieee80211_chan2ieee(ic, ic->ic_ibss_chan)));
+ if ((ic->ic_ibss_chan == NULL) ||
+ isclr(ic->ic_chan_active,
+ ieee80211_chan2ieee(ic, ic->ic_ibss_chan)))
+ panic("Bad IBSS channel %u\n",
+ ieee80211_chan2ieee(ic, ic->ic_ibss_chan));
}
/*
diff --git a/sys/net80211/ieee80211_compat.h b/sys/net80211/ieee80211_compat.h
deleted file mode 100644
index 45714d611ed..00000000000
--- a/sys/net80211/ieee80211_compat.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $OpenBSD: ieee80211_compat.h,v 1.3 2005/09/08 09:11:08 jsg Exp $ */
-/* $NetBSD: ieee80211_compat.h,v 1.5 2004/01/13 23:37:30 dyoung Exp $ */
-
-/*-
- * Copyright (c) 2003, 2004 David Young
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef _NET80211_IEEE80211_COMPAT_H_
-#define _NET80211_IEEE80211_COMPAT_H_
-
-#define IASSERT(cond, complaint) if (!(cond)) panic complaint
-
-#define ieee80211_node_critsec_decl(v) int v
-#define ieee80211_node_critsec_begin(ic, v) do { v = splnet(); } while (0)
-#define ieee80211_node_critsec_end(ic, v) splx(v)
-
-#define BPF_ATTACH(ifp_x,dlt_x,dlf_x,bpf_x) \
- bpfattach(bpf_x,ifp_x,dlt_x,dlf_x)
-#define BPF_DETACH(ifp_x) bpfdetach(ifp_x)
-#define BPF_MTAP(bpf_x,mbf_x) bpf_mtap(bpf_x,mbf_x)
-
-#endif /* _NET80211_IEEE80211_COMPAT_H_ */
diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c
index 1d51df1ce9a..c5cb257c7cc 100644
--- a/sys/net80211/ieee80211_crypto.c
+++ b/sys/net80211/ieee80211_crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_crypto.c,v 1.5 2005/09/08 09:11:08 jsg Exp $ */
+/* $OpenBSD: ieee80211_crypto.c,v 1.6 2005/09/08 12:44:55 jsg Exp $ */
/* $NetBSD: ieee80211_crypto.c,v 1.5 2003/12/14 09:56:53 dyoung Exp $ */
/*-
@@ -65,7 +65,6 @@
#endif
#include <net80211/ieee80211_var.h>
-#include <net80211/ieee80211_compat.h>
#include <dev/rndvar.h>
#include <crypto/arc4.h>
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index d88cf5e6d11..7cff8b38eca 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -1,5 +1,5 @@
/* $NetBSD: ieee80211_input.c,v 1.24 2004/05/31 11:12:24 dyoung Exp $ */
-/* $OpenBSD: ieee80211_input.c,v 1.8 2005/09/08 09:11:08 jsg Exp $ */
+/* $OpenBSD: ieee80211_input.c,v 1.9 2005/09/08 12:44:55 jsg Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -66,7 +66,6 @@
#endif
#include <net80211/ieee80211_var.h>
-#include <net80211/ieee80211_compat.h>
#include <dev/rndvar.h>
@@ -101,7 +100,8 @@ ieee80211_input(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni,
u_int8_t dir, type, subtype;
u_int16_t rxseq;
- IASSERT(ni != NULL, ("null node"));
+ if (ni == NULL)
+ panic("null mode");
/* trim CRC here so WEP can find its own CRC at the end of packet. */
if (m->m_flags & M_HASFCS) {
@@ -302,7 +302,7 @@ ieee80211_input(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni,
#if NBPFILTER > 0
/* copy to listener after decrypt */
if (ic->ic_rawbpf)
- BPF_MTAP(ic->ic_rawbpf, m);
+ bpf_mtap(ic->ic_rawbpf, m);
#endif
m = ieee80211_decap(ifp, m);
if (m == NULL) {
@@ -352,7 +352,7 @@ ieee80211_input(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni,
* we don't need to duplicate for DLT_EN10MB.
*/
if (ifp->if_bpf && m1 == NULL)
- BPF_MTAP(ifp->if_bpf, m);
+ bpf_mtap(ifp->if_bpf, m);
#endif
ether_input_mbuf(ifp, m);
}
@@ -407,7 +407,7 @@ ieee80211_input(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni,
}
#if NBPFILTER > 0
if (ic->ic_rawbpf)
- BPF_MTAP(ic->ic_rawbpf, m);
+ bpf_mtap(ic->ic_rawbpf, m);
#endif
(*ic->ic_recv_mgmt)(ic, m, ni, subtype, rssi, rstamp);
m_freem(m);
@@ -440,7 +440,7 @@ ieee80211_input(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni,
if (m != NULL) {
#if NBPFILTER > 0
if (ic->ic_rawbpf)
- BPF_MTAP(ic->ic_rawbpf, m);
+ bpf_mtap(ic->ic_rawbpf, m);
#endif
m_freem(m);
}
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 029e7538da6..7d4d41f45e3 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_node.c,v 1.8 2005/09/08 09:11:08 jsg Exp $ */
+/* $OpenBSD: ieee80211_node.c,v 1.9 2005/09/08 12:44:55 jsg Exp $ */
/* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */
/*-
@@ -65,7 +65,6 @@
#endif
#include <net80211/ieee80211_var.h>
-#include <net80211/ieee80211_compat.h>
#include <dev/rndvar.h>
@@ -136,7 +135,8 @@ ieee80211_node_lateattach(struct ifnet *ifp)
struct ieee80211_node *ni;
ni = ieee80211_alloc_node_helper(ic);
- IASSERT(ni != NULL, ("unable to setup inital BSS node"));
+ if (ni == NULL)
+ panic("unable to setup inital BSS node");
ni->ni_chan = IEEE80211_CHAN_ANYC;
ic->ic_bss = ieee80211_ref_node(ni);
ic->ic_txpower = IEEE80211_TXPOWER_MAX;
@@ -851,7 +851,8 @@ ieee80211_lookup_node(struct ieee80211com *ic,
static void
ieee80211_free_node(struct ieee80211com *ic, struct ieee80211_node *ni)
{
- IASSERT(ni != ic->ic_bss, ("freeing bss node"));
+ if (ni == ic->ic_bss)
+ panic("freeing bss node");
IEEE80211_DPRINTF(("%s %s\n", __func__, ether_sprintf(ni->ni_macaddr)));
IEEE80211_AID_CLR(ni->ni_associd, ic->ic_aid_bitmap);
@@ -1003,9 +1004,8 @@ ieee80211_node_join(struct ieee80211com *ic, struct ieee80211_node *ni,
void
ieee80211_node_leave(struct ieee80211com *ic, struct ieee80211_node *ni)
{
-
- IASSERT(ic->ic_opmode == IEEE80211_M_HOSTAP,
- ("not in ap mode, mode %u", ic->ic_opmode));
+ if (ic->ic_opmode != IEEE80211_M_HOSTAP)
+ panic("not in ap mode, mode %u", ic->ic_opmode);
/*
* If node wasn't previously associated all
* we need to do is reclaim the reference.
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index 137166b0564..ca7f2433d5e 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_output.c,v 1.11 2005/09/08 09:11:08 jsg Exp $ */
+/* $OpenBSD: ieee80211_output.c,v 1.12 2005/09/08 12:44:55 jsg Exp $ */
/* $NetBSD: ieee80211_output.c,v 1.13 2004/05/31 11:02:55 dyoung Exp $ */
/*-
@@ -64,7 +64,6 @@
#endif
#include <net80211/ieee80211_var.h>
-#include <net80211/ieee80211_compat.h>
/*
* IEEE 802.11 output routine. Normally this will directly call the
@@ -142,7 +141,8 @@ ieee80211_mgmt_output(struct ifnet *ifp, struct ieee80211_node *ni,
struct ieee80211com *ic = (void *)ifp;
struct ieee80211_frame *wh;
- IASSERT(ni != NULL, ("null node"));
+ if (ni == NULL)
+ panic("null node");
ni->ni_inact = 0;
/*
@@ -561,7 +561,8 @@ ieee80211_getmbuf(int flags, int type, u_int pktlen)
{
struct mbuf *m;
- IASSERT(pktlen <= MCLBYTES, ("802.11 packet too large: %u", pktlen));
+ if (pktlen > MCLBYTES)
+ panic("802.11 packet too large: %u", pktlen);
MGETHDR(m, flags, type);
if (m != NULL && pktlen > MHLEN)
MCLGET(m, flags);
@@ -585,7 +586,8 @@ ieee80211_send_mgmt(struct ieee80211com *ic, struct ieee80211_node *ni,
u_int16_t capinfo;
int has_challenge, is_shared_key, ret, timer;
- IASSERT(ni != NULL, ("null node"));
+ if (ni == NULL)
+ panic("null node");
/*
* Hold a reference on the node so it doesn't go away until after
@@ -967,9 +969,9 @@ ieee80211_beacon_alloc(struct ieee80211com *ic, struct ieee80211_node *ni)
frm = ieee80211_add_xrates(frm, rs);
m->m_pkthdr.len = m->m_len = frm - mtod(m, u_int8_t *);
m->m_pkthdr.rcvif = (void *)ni;
- IASSERT(m->m_pkthdr.len <= pktlen,
- ("beacon bigger than expected, len %u calculated %u",
- m->m_pkthdr.len, pktlen));
+ if (m->m_pkthdr.len > pktlen)
+ panic("beacon bigger than expected, len %u calculated %u",
+ m->m_pkthdr.len, pktlen);
return m;
}
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
index 56cd0800fb6..1cb566f8eda 100644
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_proto.c,v 1.6 2005/09/08 09:11:08 jsg Exp $ */
+/* $OpenBSD: ieee80211_proto.c,v 1.7 2005/09/08 12:44:55 jsg Exp $ */
/* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */
/*-
@@ -68,7 +68,6 @@
#endif
#include <net80211/ieee80211_var.h>
-#include <net80211/ieee80211_compat.h>
#define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2)
@@ -310,7 +309,7 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int mgt
struct ifnet *ifp = &ic->ic_if;
struct ieee80211_node *ni;
enum ieee80211_state ostate;
- ieee80211_node_critsec_decl(s);
+ int s;
ostate = ic->ic_state;
IEEE80211_DPRINTF(("%s: %s -> %s\n", __func__,
@@ -330,7 +329,7 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int mgt
IEEE80211_REASON_ASSOC_LEAVE);
break;
case IEEE80211_M_HOSTAP:
- ieee80211_node_critsec_begin(ic, s);
+ s = splnet();
TAILQ_FOREACH(ni, &ic->ic_node, ni_list) {
if (ni->ni_associd == 0)
continue;
@@ -338,7 +337,7 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int mgt
IEEE80211_FC0_SUBTYPE_DISASSOC,
IEEE80211_REASON_ASSOC_LEAVE);
}
- ieee80211_node_critsec_end(ic, s);
+ splx(s);
break;
default:
break;
@@ -352,13 +351,13 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int mgt
IEEE80211_REASON_AUTH_LEAVE);
break;
case IEEE80211_M_HOSTAP:
- ieee80211_node_critsec_begin(ic, s);
+ s = splnet();
TAILQ_FOREACH(ni, &ic->ic_node, ni_list) {
IEEE80211_SEND_MGMT(ic, ni,
IEEE80211_FC0_SUBTYPE_DEAUTH,
IEEE80211_REASON_AUTH_LEAVE);
}
- ieee80211_node_critsec_end(ic, s);
+ splx(s);
break;
default:
break;
@@ -493,9 +492,9 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int mgt
break;
case IEEE80211_S_SCAN: /* adhoc/hostap mode */
case IEEE80211_S_ASSOC: /* infra mode */
- IASSERT(ni->ni_txrate < ni->ni_rates.rs_nrates,
- ("%s: bogus xmit rate %u setup\n", __func__,
- ni->ni_txrate));
+ if (ni->ni_txrate >= ni->ni_rates.rs_nrates)
+ panic("%s: bogus xmit rate %u setup\n",
+ __func__, ni->ni_txrate);
if (ifp->if_flags & IFF_DEBUG) {
printf("%s: %s with %s ssid ",
ifp->if_xname,
diff --git a/sys/net80211/ieee80211_rssadapt.c b/sys/net80211/ieee80211_rssadapt.c
index 70d10b8440b..e264e62d137 100644
--- a/sys/net80211/ieee80211_rssadapt.c
+++ b/sys/net80211/ieee80211_rssadapt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_rssadapt.c,v 1.2 2005/09/07 05:40:11 jsg Exp $ */
+/* $OpenBSD: ieee80211_rssadapt.c,v 1.3 2005/09/08 12:44:55 jsg Exp $ */
/* $NetBSD: ieee80211_rssadapt.c,v 1.7 2004/05/25 04:33:59 dyoung Exp $ */
/*-
@@ -46,7 +46,6 @@
#include <net80211/ieee80211_var.h>
#include <net80211/ieee80211.h>
-#include <net80211/ieee80211_compat.h>
#include <net80211/ieee80211_rssadapt.h>
#ifdef interpolate