summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/files3
-rw-r--r--sys/dev/ic/ath.c72
-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
10 files changed, 93 insertions, 133 deletions
diff --git a/sys/conf/files b/sys/conf/files
index a5faaa69d05..d61d48c77f7 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1,4 +1,4 @@
-# $OpenBSD: files,v 1.348 2005/07/17 12:21:28 miod Exp $
+# $OpenBSD: files,v 1.349 2005/09/08 09:11:07 jsg Exp $
# $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@@ -718,7 +718,6 @@ file net/if_enc.c enc needs-count
file net/if_gre.c gre needs-count
file net/if_trunk.c trunk needs-count
file net80211/ieee80211.c wlan
-file net80211/ieee80211_compat.c wlan
file net80211/ieee80211_crypto.c wlan
file net80211/ieee80211_input.c wlan
file net80211/ieee80211_ioctl.c wlan
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c
index 073a9a4d1e5..7b5a964f7a1 100644
--- a/sys/dev/ic/ath.c
+++ b/sys/dev/ic/ath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ath.c,v 1.35 2005/08/21 18:40:17 reyk Exp $ */
+/* $OpenBSD: ath.c,v 1.36 2005/09/08 09:11:07 jsg Exp $ */
/* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */
/*-
@@ -225,19 +225,19 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
ah = ath_hal_attach(devid, sc, sc->sc_st, sc->sc_sh, &status);
if (ah == NULL) {
- if_printf(ifp, "unable to attach hardware; HAL status %d\n",
- status);
+ printf("%s: unable to attach hardware; HAL status %d\n",
+ ifp->if_xname, status);
error = ENXIO;
goto bad;
}
if (ah->ah_abi != HAL_ABI_VERSION) {
- if_printf(ifp, "HAL ABI mismatch detected (0x%x != 0x%x)\n",
- ah->ah_abi, HAL_ABI_VERSION);
+ printf("%s: HAL ABI mismatch detected (0x%x != 0x%x)\n",
+ ifp->if_xname, ah->ah_abi, HAL_ABI_VERSION);
error = ENXIO;
goto bad;
}
- if_printf(ifp, "AR%s %u.%u phy %u.%u",
+ printf("%s: AR%s %u.%u phy %u.%u", ifp->if_xname,
ar5k_printver(AR5K_VERSION_VER, ah->ah_macVersion),
ah->ah_macVersion, ah->ah_macRev,
ah->ah_phyRev >> 4, ah->ah_phyRev & 0xf);
@@ -282,7 +282,8 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
error = ath_desc_alloc(sc);
if (error != 0) {
- if_printf(ifp, "failed to allocate descriptors: %d\n", error);
+ printf("%s: failed to allocate descriptors: %d\n",
+ ifp->if_xname, error);
goto bad;
}
timeout_set(&sc->sc_scan_to, ath_next_scan, sc);
@@ -309,7 +310,8 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
*/
sc->sc_bhalq = ath_hal_setup_tx_queue(ah,HAL_TX_QUEUE_BEACON,NULL);
if (sc->sc_bhalq == (u_int) -1) {
- if_printf(ifp, "unable to setup a beacon xmit queue!\n");
+ printf("%s: unable to setup a beacon xmit queue!\n",
+ ifp->if_xname);
goto bad2;
}
@@ -319,8 +321,8 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
sc->sc_txhalq[i] = ath_hal_setup_tx_queue(ah,
HAL_TX_QUEUE_DATA, &qinfo);
if (sc->sc_txhalq[i] == (u_int) -1) {
- if_printf(ifp,
- "unable to setup a data xmit queue %u!\n", i);
+ printf("%s: unable to setup a data xmit queue %u!\n",
+ ifp->if_xname, i);
goto bad2;
}
}
@@ -611,7 +613,7 @@ ath_fatal_proc(void *arg, int pending)
struct ifnet *ifp = &ic->ic_if;
if (ifp->if_flags & IFF_DEBUG)
- if_printf(ifp, "hardware error; resetting\n");
+ printf("%s: hardware error; resetting\n", ifp->if_xname);
ath_reset(sc, 1);
}
@@ -623,7 +625,7 @@ ath_rxorn_proc(void *arg, int pending)
struct ifnet *ifp = &ic->ic_if;
if (ifp->if_flags & IFF_DEBUG)
- if_printf(ifp, "rx FIFO overrun; resetting\n");
+ printf("%s: rx FIFO overrun; resetting\n", ifp->if_xname);
ath_reset(sc, 1);
}
@@ -716,8 +718,8 @@ ath_init1(struct ath_softc *sc)
hchan.channel = ic->ic_ibss_chan->ic_freq;
hchan.channelFlags = ath_chan2flags(ic, ic->ic_ibss_chan);
if (!ath_hal_reset(ah, ic->ic_opmode, &hchan, AH_FALSE, &status)) {
- if_printf(ifp, "unable to reset hardware; hal status %u\n",
- status);
+ printf("%s: unable to reset hardware; hal status %u\n",
+ ifp->if_xname, status);
error = EIO;
goto done;
}
@@ -731,12 +733,13 @@ ath_init1(struct ath_softc *sc)
*/
if (ic->ic_flags & IEEE80211_F_WEPON) {
if ((error = ath_initkeytable(sc)) != 0) {
- if_printf(ifp, "unable to initialize the key cache\n");
+ printf("%s: unable to initialize the key cache\n",
+ ifp->if_xname);
goto done;
}
}
if ((error = ath_startrecv(sc)) != 0) {
- if_printf(ifp, "unable to start recv logic\n");
+ printf("%s: unable to start recv logic\n", ifp->if_xname);
goto done;
}
@@ -852,15 +855,16 @@ ath_reset(struct ath_softc *sc, int full)
/* NB: indicate channel change so we do a full reset */
if (!ath_hal_reset(ah, ic->ic_opmode, &hchan,
full ? AH_TRUE : AH_FALSE, &status)) {
- if_printf(ifp, "%s: unable to reset hardware; hal status %u\n",
- __func__, status);
+ printf("%s: %s: unable to reset hardware; hal status %u\n",
+ ifp->if_xname, __func__, status);
}
ath_set_slot_time(sc);
/* In case channel changed, save as a node channel */
ic->ic_bss->ni_chan = ic->ic_ibss_chan;
ath_hal_set_intr(ah, sc->sc_imask);
if (ath_startrecv(sc) != 0) /* restart recv */
- if_printf(ifp, "%s: unable to start recv logic\n", __func__);
+ printf("%s: %s: unable to start recv logic\n", ifp->if_xname,
+ __func__);
ath_start(ifp); /* restart xmit */
if (ic->ic_state == IEEE80211_S_RUN)
ath_beacon_config(sc); /* restart beacons */
@@ -1014,7 +1018,7 @@ ath_watchdog(struct ifnet *ifp)
return;
if (sc->sc_tx_timer) {
if (--sc->sc_tx_timer == 0) {
- if_printf(ifp, "device timeout\n");
+ printf("%s: device timeout\n", ifp->if_xname);
ath_reset(sc, 1);
ifp->if_oerrors++;
sc->sc_stats.ast_watchdog++;
@@ -1893,7 +1897,7 @@ ath_rx_proc(void *arg, int npending)
do {
bf = TAILQ_FIRST(&sc->sc_rxbuf);
if (bf == NULL) { /* NB: shouldn't happen */
- if_printf(ifp, "ath_rx_proc: no buffer!\n");
+ printf("%s: ath_rx_proc: no buffer!\n", ifp->if_xname);
break;
}
ds = bf->bf_desc;
@@ -1903,7 +1907,7 @@ ath_rx_proc(void *arg, int npending)
}
m = bf->bf_m;
if (m == NULL) { /* NB: shouldn't happen */
- if_printf(ifp, "ath_rx_proc: no mbuf!\n");
+ printf("%s: ath_rx_proc: no mbuf!\n", ifp->if_xname);
continue;
}
/* XXX sync descriptor memory */
@@ -2264,7 +2268,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni,
rix = sc->sc_rixmap[ni->ni_rates.rs_rates[ni->ni_txrate] &
IEEE80211_RATE_VAL];
if (rix == 0xff) {
- if_printf(ifp, "bogus xmit rate 0x%x\n",
+ printf("%s: bogus xmit rate 0x%x\n", ifp->if_xname,
ni->ni_rates.rs_rates[ni->ni_txrate]);
sc->sc_stats.ast_tx_badrate++;
m_freem(m0);
@@ -2674,6 +2678,7 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan)
{
struct ath_hal *ah = sc->sc_ah;
struct ieee80211com *ic = &sc->sc_ic;
+ struct ifnet *ifp = &ic->ic_if;
DPRINTF(ATH_DEBUG_ANY, ("%s: %u (%u MHz) -> %u (%u MHz)\n", __func__,
ieee80211_chan2ieee(ic, ic->ic_ibss_chan),
@@ -2702,8 +2707,8 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan)
hchan.channelFlags = ath_chan2flags(ic, chan);
if (!ath_hal_reset(ah, ic->ic_opmode, &hchan, AH_TRUE,
&status)) {
- if_printf(&ic->ic_if, "ath_chan_set: unable to reset "
- "channel %u (%u Mhz)\n",
+ printf("%s: ath_chan_set: unable to reset "
+ "channel %u (%u Mhz)\n", ifp->if_xname,
ieee80211_chan2ieee(ic, chan), chan->ic_freq);
return EIO;
}
@@ -2712,8 +2717,8 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan)
* Re-enable rx framework.
*/
if (ath_startrecv(sc) != 0) {
- if_printf(&ic->ic_if,
- "ath_chan_set: unable to restart recv logic\n");
+ printf("%s: ath_chan_set: unable to restart recv ",
+ "logic\n", ifp->if_xname);
return EIO;
}
@@ -3018,12 +3023,13 @@ ath_getchannels(struct ath_softc *sc, u_int cc, HAL_BOOL outdoor,
chans = malloc(IEEE80211_CHAN_MAX * sizeof(HAL_CHANNEL),
M_TEMP, M_NOWAIT);
if (chans == NULL) {
- if_printf(ifp, "unable to allocate channel table\n");
+ printf("%s: unable to allocate channel table\n", ifp->if_xname);
return ENOMEM;
}
if (!ath_hal_init_channels(ah, chans, IEEE80211_CHAN_MAX, &nchan,
cc, HAL_MODE_ALL, outdoor, xchanmode)) {
- if_printf(ifp, "unable to collect channel list from hal\n");
+ printf("%s: unable to collect channel list from hal\n",
+ ifp->if_xname);
free(chans, M_TEMP);
return EINVAL;
}
@@ -3036,8 +3042,8 @@ ath_getchannels(struct ath_softc *sc, u_int cc, HAL_BOOL outdoor,
HAL_CHANNEL *c = &chans[i];
ix = ath_hal_mhz2ieee(c->channel, c->channelFlags);
if (ix > IEEE80211_CHAN_MAX) {
- if_printf(ifp, "bad hal channel %u (%u/%x) ignored\n",
- ix, c->channel, c->channelFlags);
+ printf("%s: bad hal channel %u (%u/%x) ignored\n",
+ ifp->if_xname, ix, c->channel, c->channelFlags);
continue;
}
DPRINTF(ATH_DEBUG_ANY,
@@ -3058,8 +3064,8 @@ ath_getchannels(struct ath_softc *sc, u_int cc, HAL_BOOL outdoor,
free(chans, M_TEMP);
if (sc->sc_nchan < 1) {
- if_printf(ifp, "no valid channels for regdomain %s(%u)\n",
- ieee80211_regdomain2name(ath_regdomain),
+ printf("%s: no valid channels for regdomain %s(%u)\n",
+ ifp->if_xname, ieee80211_regdomain2name(ath_regdomain),
sc->sc_ah->ah_capabilities.cap_eeprom.ee_regdomain);
return ENOENT;
}
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));