summaryrefslogtreecommitdiff
path: root/sys/net80211
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2005-09-08 09:11:09 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2005-09-08 09:11:09 +0000
commit79452849f82a8546be085ead11cf29040d5f8bf5 (patch)
tree376d77bf3a94b5263f7d6d8e54e31d4979bae981 /sys/net80211
parente0760aa1f2f31cd631558ffc103464a909c4db94 (diff)
Remove FreeBSD if_printf compat function from net80211.
ok reyk@
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211.c14
-rw-r--r--sys/net80211/ieee80211_compat.c48
-rw-r--r--sys/net80211/ieee80211_compat.h5
-rw-r--r--sys/net80211/ieee80211_crypto.c5
-rw-r--r--sys/net80211/ieee80211_input.c41
-rw-r--r--sys/net80211/ieee80211_node.c8
-rw-r--r--sys/net80211/ieee80211_output.c21
-rw-r--r--sys/net80211/ieee80211_proto.c9
8 files changed, 53 insertions, 98 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
index 28eaabe9b43..8889d9180c1 100644
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211.c,v 1.10 2005/09/08 08:36:12 reyk Exp $ */
+/* $OpenBSD: ieee80211.c,v 1.11 2005/09/08 09:11:08 jsg Exp $ */
/* $NetBSD: ieee80211.c,v 1.19 2004/06/06 05:45:29 dyoung Exp $ */
/*-
@@ -127,9 +127,10 @@ ieee80211_ifattach(struct ifnet *ifp)
* Verify driver passed us valid data.
*/
if (i != ieee80211_chan2ieee(ic, c)) {
- if_printf(ifp, "bad channel ignored; "
+ printf("%s: bad channel ignored; "
"freq %u flags %x number %u\n",
- c->ic_freq, c->ic_flags, i);
+ ifp->if_xname, c->ic_freq, c->ic_flags,
+ i);
c->ic_flags = 0; /* NB: remove */
continue;
}
@@ -218,16 +219,17 @@ ieee80211_mhz2ieee(u_int freq, u_int flags)
u_int
ieee80211_chan2ieee(struct ieee80211com *ic, struct ieee80211_channel *c)
{
+ struct ifnet *ifp = &ic->ic_if;
if (ic->ic_channels <= c && c <= &ic->ic_channels[IEEE80211_CHAN_MAX])
return c - ic->ic_channels;
else if (c == IEEE80211_CHAN_ANYC)
return IEEE80211_CHAN_ANY;
else if (c != NULL) {
- if_printf(&ic->ic_if, "invalid channel freq %u flags %x\n",
- c->ic_freq, c->ic_flags);
+ printf("%s: invalid channel freq %u flags %x\n",
+ ifp->if_xname, c->ic_freq, c->ic_flags);
return 0; /* XXX */
} else {
- if_printf(&ic->ic_if, "invalid channel (NULL)\n");
+ printf("%s: invalid channel (NULL)\n", ifp->if_xname);
return 0; /* XXX */
}
}
diff --git a/sys/net80211/ieee80211_compat.c b/sys/net80211/ieee80211_compat.c
deleted file mode 100644
index 3a790e1776b..00000000000
--- a/sys/net80211/ieee80211_compat.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $OpenBSD: ieee80211_compat.c,v 1.4 2005/09/07 05:40:11 jsg Exp $ */
-/* $NetBSD: ieee80211_compat.c,v 1.3 2003/09/23 15:57:25 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.
- */
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/systm.h>
-#include <net/if.h>
-#include <net80211/ieee80211_compat.h>
-
-void
-if_printf(struct ifnet *ifp, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
-
- printf("%s: ", ifp->if_xname);
- vprintf(fmt, ap);
-
- va_end(ap);
- return;
-}
diff --git a/sys/net80211/ieee80211_compat.h b/sys/net80211/ieee80211_compat.h
index 862b3e18b2a..45714d611ed 100644
--- a/sys/net80211/ieee80211_compat.h
+++ b/sys/net80211/ieee80211_compat.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_compat.h,v 1.2 2005/09/07 05:40:11 jsg Exp $ */
+/* $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 $ */
/*-
@@ -32,9 +32,6 @@
#define IASSERT(cond, complaint) if (!(cond)) panic complaint
-void if_printf(struct ifnet *, const char *, ...)
- __attribute__((__format__(__printf__,2,3)));
-
#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)
diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c
index 70a42d5d2ee..1d51df1ce9a 100644
--- a/sys/net80211/ieee80211_crypto.c
+++ b/sys/net80211/ieee80211_crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_crypto.c,v 1.4 2005/09/07 05:40:11 jsg Exp $ */
+/* $OpenBSD: ieee80211_crypto.c,v 1.5 2005/09/08 09:11:08 jsg Exp $ */
/* $NetBSD: ieee80211_crypto.c,v 1.5 2003/12/14 09:56:53 dyoung Exp $ */
/*-
@@ -261,7 +261,8 @@ ieee80211_wep_crypt(struct ifnet *ifp, struct mbuf *m0, int txflag)
if (crc != letoh32(*(u_int32_t *)crcbuf)) {
#ifdef IEEE80211_DEBUG
if (ieee80211_debug) {
- if_printf(ifp, "decrypt CRC error\n");
+ printf("%s: decrypt CRC error\n",
+ ifp->if_xname);
if (ieee80211_debug > 1)
ieee80211_dump_pkt(n0->m_data,
n0->m_len, -1, -1);
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index 2bf748f2958..d88cf5e6d11 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.7 2005/09/07 05:40:11 jsg Exp $ */
+/* $OpenBSD: ieee80211_input.c,v 1.8 2005/09/08 09:11:08 jsg Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -399,7 +399,8 @@ ieee80211_input(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni,
doprint += ieee80211_debug;
#endif
if (doprint)
- if_printf(ifp, "received %s from %s rssi %d\n",
+ printf("%s: received %s from %s rssi %d\n",
+ ifp->if_xname,
ieee80211_mgt_subtype_name[subtype
>> IEEE80211_FC0_SUBTYPE_SHIFT],
ether_sprintf(wh->i_addr2), rssi);
@@ -689,8 +690,8 @@ ieee80211_auth_open(struct ieee80211com *ic, struct ieee80211_frame *wh,
IEEE80211_SEND_MGMT(ic, ni,
IEEE80211_FC0_SUBTYPE_AUTH, seq + 1);
if (ifp->if_flags & IFF_DEBUG)
- if_printf(ifp, "station %s %s authenticated (open)\n",
- ether_sprintf(ni->ni_macaddr),
+ printf("%s: station %s %s authenticated (open)\n",
+ ifp->if_xname, ether_sprintf(ni->ni_macaddr),
ni->ni_state != IEEE80211_STA_CACHE ?
"newly" : "already");
ieee80211_node_newstate(ni, IEEE80211_STA_AUTH);
@@ -708,10 +709,9 @@ ieee80211_auth_open(struct ieee80211com *ic, struct ieee80211_frame *wh,
}
if (status != 0) {
if (ifp->if_flags & IFF_DEBUG)
- if_printf(&ic->ic_if,
- "open authentication failed (reason %d) "
- "for %s\n", status,
- ether_sprintf(wh->i_addr3));
+ printf("%s: open authentication failed "
+ "(reason %d) for %s\n", ifp->if_xname,
+ status, ether_sprintf(wh->i_addr3));
if (ni != ic->ic_bss)
ni->ni_fails++;
ic->ic_stats.is_rx_auth_fail++;
@@ -809,8 +809,8 @@ ieee80211_auth_shared(struct ieee80211com *ic, struct ieee80211_frame *wh,
--i >= 0; )
ni->ni_challenge[i] = arc4random();
if (ifp->if_flags & IFF_DEBUG)
- if_printf(ifp, "station %s shared key "
- "%sauthentication\n",
+ printf("%s: station %s shared key "
+ "%sauthentication\n", ifp->if_xname,
ether_sprintf(ni->ni_macaddr),
ni->ni_state != IEEE80211_STA_CACHE ?
"" : "re");
@@ -835,8 +835,8 @@ ieee80211_auth_shared(struct ieee80211com *ic, struct ieee80211_frame *wh,
return;
}
if (ifp->if_flags & IFF_DEBUG)
- if_printf(ifp, "station %s authenticated "
- "(shared key)\n",
+ printf("%s: station %s authenticated "
+ "(shared key)\n", ifp->if_xname,
ether_sprintf(ni->ni_macaddr));
ieee80211_node_newstate(ni, IEEE80211_STA_AUTH);
break;
@@ -860,9 +860,8 @@ ieee80211_auth_shared(struct ieee80211com *ic, struct ieee80211_frame *wh,
ni->ni_challenge = NULL;
}
if (status != 0) {
- if_printf(&ic->ic_if,
- "%s: shared authentication failed "
- "(reason %d) for %s\n",
+ printf("%s: %s: shared authentication failed "
+ "(reason %d) for %s\n", ifp->if_xname,
__func__, status,
ether_sprintf(wh->i_addr3));
if (ni != ic->ic_bss)
@@ -1359,8 +1358,8 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
frm += 2;
if (status != 0) {
if (ifp->if_flags & IFF_DEBUG)
- if_printf(ifp,
- "%sassociation failed (reason %d) for %s\n",
+ printf("%s: %sassociation failed (reason %d)"
+ " for %s\n", ifp->if_xname,
ISREASSOC(subtype) ? "re" : "",
status, ether_sprintf(wh->i_addr3));
if (ni != ic->ic_bss)
@@ -1411,9 +1410,9 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
case IEEE80211_M_HOSTAP:
if (ni != ic->ic_bss) {
if (ifp->if_flags & IFF_DEBUG)
- if_printf(ifp,
- "station %s deauthenticated "
+ printf("%s: station %s deauthenticated "
"by peer (reason %d)\n",
+ ifp->if_xname,
ether_sprintf(ni->ni_macaddr),
reason);
ieee80211_node_leave(ic, ni);
@@ -1442,9 +1441,9 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
case IEEE80211_M_HOSTAP:
if (ni != ic->ic_bss) {
if (ifp->if_flags & IFF_DEBUG)
- if_printf(ifp,
- "station %s disassociated "
+ printf("%s: station %s disassociated "
"by peer (reason %d)\n",
+ ifp->if_xname,
ether_sprintf(ni->ni_macaddr),
reason);
ieee80211_node_leave(ic, ni);
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 61be2b07f00..029e7538da6 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_node.c,v 1.7 2005/09/08 08:36:12 reyk Exp $ */
+/* $OpenBSD: ieee80211_node.c,v 1.8 2005/09/08 09:11:08 jsg Exp $ */
/* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */
/*-
@@ -199,7 +199,7 @@ ieee80211_begin_scan(struct ifnet *ifp)
} else
ic->ic_stats.is_scan_passive++;
if (ifp->if_flags & IFF_DEBUG)
- if_printf(ifp, "begin %s scan\n",
+ printf("%s: begin %s scan\n", ifp->if_xname,
(ic->ic_flags & IEEE80211_F_ASCAN) ?
"active" : "passive");
@@ -268,7 +268,7 @@ ieee80211_create_ibss(struct ieee80211com* ic, struct ieee80211_channel *chan)
ni = ic->ic_bss;
if (ifp->if_flags & IFF_DEBUG)
- if_printf(ifp, "creating ibss\n");
+ printf("%s: creating ibss\n", ifp->if_xname);
ic->ic_flags |= IEEE80211_F_SIBSS;
ni->ni_chan = chan;
ni->ni_rates = ic->ic_sup_rates[ieee80211_chan2mode(ic, ni->ni_chan)];
@@ -371,7 +371,7 @@ ieee80211_end_scan(struct ifnet *ifp)
int i, fail;
if (ifp->if_flags & IFF_DEBUG)
- if_printf(ifp, "end %s scan\n",
+ printf("%s: end %s scan\n", ifp->if_xname,
(ic->ic_flags & IEEE80211_F_ASCAN) ?
"active" : "passive");
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index 400cdc4472a..137166b0564 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_output.c,v 1.10 2005/09/07 05:40:11 jsg Exp $ */
+/* $OpenBSD: ieee80211_output.c,v 1.11 2005/09/08 09:11:08 jsg Exp $ */
/* $NetBSD: ieee80211_output.c,v 1.13 2004/05/31 11:02:55 dyoung Exp $ */
/*-
@@ -105,7 +105,8 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
if (error) {
/* mbuf is already freed */
splx(s);
- if_printf(ifp, "failed to queue raw tx frame\n");
+ printf("%s: failed to queue raw tx frame\n",
+ ifp->if_xname);
return (error);
}
ifp->if_obytes += m->m_pkthdr.len;
@@ -187,7 +188,8 @@ ieee80211_mgmt_output(struct ifnet *ifp, struct ieee80211_node *ni,
#endif
(type & IEEE80211_FC0_SUBTYPE_MASK) !=
IEEE80211_FC0_SUBTYPE_PROBE_RESP)
- if_printf(ifp, "sending %s to %s on channel %u\n",
+ printf("%s: sending %s to %s on channel %u\n",
+ ifp->if_xname,
ieee80211_mgt_subtype_name[
(type & IEEE80211_FC0_SUBTYPE_MASK)
>> IEEE80211_FC0_SUBTYPE_SHIFT],
@@ -255,8 +257,9 @@ ieee80211_encap(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node **pni)
if (ni == NULL)
ni = ieee80211_ref_node(ic->ic_bss);
if (ni == NULL) {
- if_printf(ifp, "no node for dst %s, "
- "discard raw tx frame\n", ether_sprintf(addr));
+ printf("%s: no node for dst %s, "
+ "discard raw tx frame\n", ifp->if_xname,
+ ether_sprintf(addr));
ic->ic_stats.is_tx_nonode++;
goto bad;
}
@@ -738,8 +741,8 @@ ieee80211_send_mgmt(struct ieee80211com *ic, struct ieee80211_node *ni,
case IEEE80211_FC0_SUBTYPE_DEAUTH:
if (ifp->if_flags & IFF_DEBUG)
- if_printf(ifp, "station %s deauthenticate (reason %d)\n",
- ether_sprintf(ni->ni_macaddr), arg);
+ printf("%s: station %s deauthenticate (reason %d)\n",
+ ifp->if_xname, ether_sprintf(ni->ni_macaddr), arg);
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL)
senderr(ENOMEM, is_tx_nombuf);
@@ -850,8 +853,8 @@ ieee80211_send_mgmt(struct ieee80211com *ic, struct ieee80211_node *ni,
case IEEE80211_FC0_SUBTYPE_DISASSOC:
if (ifp->if_flags & IFF_DEBUG)
- if_printf(ifp, "station %s disassociate (reason %d)\n",
- ether_sprintf(ni->ni_macaddr), arg);
+ printf("%s: station %s disassociate (reason %d)\n",
+ ifp->if_xname, ether_sprintf(ni->ni_macaddr), arg);
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL)
senderr(ENOMEM, is_tx_nombuf);
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
index f32a054f1bc..56cd0800fb6 100644
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_proto.c,v 1.5 2005/09/07 05:40:11 jsg Exp $ */
+/* $OpenBSD: ieee80211_proto.c,v 1.6 2005/09/08 09:11:08 jsg Exp $ */
/* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */
/*-
@@ -410,8 +410,8 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int mgt
/* beacon miss */
if (ifp->if_flags & IFF_DEBUG) {
/* XXX bssid clobbered above */
- if_printf(ifp, "no recent beacons from %s;"
- " rescanning\n",
+ printf("%s: no recent beacons from %s;"
+ " rescanning\n", ifp->if_xname,
ether_sprintf(ic->ic_bss->ni_bssid));
}
ieee80211_free_allnodes(ic);
@@ -497,7 +497,8 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int mgt
("%s: bogus xmit rate %u setup\n", __func__,
ni->ni_txrate));
if (ifp->if_flags & IFF_DEBUG) {
- if_printf(ifp, "%s with %s ssid ",
+ printf("%s: %s with %s ssid ",
+ ifp->if_xname,
ic->ic_opmode == IEEE80211_M_STA ?
"associated" : "synchronized",
ether_sprintf(ni->ni_bssid));