Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137885166
D50644.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
32 KB
Referenced Files
None
Subscribers
None
D50644.diff
View Options
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -1204,7 +1204,7 @@
return (0);
if (IEEE80211_IS_CHAN_VHT80P80(c)) {
- printf("%s: TODO VHT80+80 channel (ieee=%d, flags=0x%08x)\n",
+ net80211_printf("%s: TODO VHT80+80 channel (ieee=%d, flags=0x%08x)\n",
__func__, c->ic_ieee, c->ic_flags);
}
@@ -1219,7 +1219,7 @@
ieee80211_mhz2ieee(midpoint, c->ic_flags);
c->ic_vht_ch_freq2 = 0;
#if 0
- printf("%s: %d, freq=%d, midpoint=%d, freq1=%d, freq2=%d\n",
+ net80211_printf("%s: %d, freq=%d, midpoint=%d, freq1=%d, freq2=%d\n",
__func__, c->ic_ieee, c->ic_freq, midpoint,
c->ic_vht_ch_freq1, c->ic_vht_ch_freq2);
#endif
@@ -1240,7 +1240,7 @@
ieee80211_mhz2ieee(midpoint, c->ic_flags);
c->ic_vht_ch_freq2 = 0;
#if 0
- printf("%s: %d, freq=%d, midpoint=%d, freq1=%d, freq2=%d\n",
+ net80211_printf("%s: %d, freq=%d, midpoint=%d, freq1=%d, freq2=%d\n",
__func__, c->ic_ieee, c->ic_freq, midpoint,
c->ic_vht_ch_freq1, c->ic_vht_ch_freq2);
#endif
@@ -1265,7 +1265,7 @@
return (1);
}
- printf("%s: unknown VHT channel type (ieee=%d, flags=0x%08x)\n",
+ net80211_printf("%s: unknown VHT channel type (ieee=%d, flags=0x%08x)\n",
__func__, c->ic_ieee, c->ic_flags);
return (0);
@@ -1313,7 +1313,7 @@
return (ENOBUFS);
#if 0
- printf("%s: %d of %d: ieee=%d, freq=%d, flags=0x%08x\n",
+ net80211_printf("%s: %d of %d: ieee=%d, freq=%d, flags=0x%08x\n",
__func__, *nchans, maxchans, ieee, freq, flags);
#endif
@@ -1343,7 +1343,7 @@
return (ENOBUFS);
#if 0
- printf("%s: %d of %d: flags=0x%08x\n",
+ net80211_printf("%s: %d of %d: flags=0x%08x\n",
__func__, *nchans, maxchans, flags);
#endif
@@ -2075,10 +2075,10 @@
if (mword == 0)
continue;
rate = ieee80211_media2rate(mword);
- printf("%s%d%sMbps", (i != 0 ? " " : ""),
+ net80211_printf("%s%d%sMbps", (i != 0 ? " " : ""),
rate / 2, ((rate & 0x1) != 0 ? ".5" : ""));
}
- printf("\n");
+ net80211_printf("\n");
}
ieee80211_ht_announce(ic);
ieee80211_vht_announce(ic);
@@ -2091,7 +2091,7 @@
char type;
int i, cw;
- printf("Chan Freq CW RegPwr MinPwr MaxPwr\n");
+ net80211_printf("Chan Freq CW RegPwr MinPwr MaxPwr\n");
for (i = 0; i < ic->ic_nchans; i++) {
c = &ic->ic_channels[i];
if (IEEE80211_IS_CHAN_ST(c))
@@ -2118,7 +2118,7 @@
cw = 5;
else
cw = 20;
- printf("%4d %4d%c %2d%c %6d %4d.%d %4d.%d\n"
+ net80211_printf("%4d %4d%c %2d%c %6d %4d.%d %4d.%d\n"
, c->ic_ieee, c->ic_freq, type
, cw
, IEEE80211_IS_CHAN_HT40U(c) ? '+' :
@@ -2366,7 +2366,7 @@
return IEEE80211_MODE_FH;
/* NB: should not get here */
- printf("%s: cannot map channel to mode; freq %u flags 0x%x\n",
+ net80211_printf("%s: cannot map channel to mode; freq %u flags 0x%x\n",
__func__, chan->ic_freq, chan->ic_flags);
return IEEE80211_MODE_11B;
}
diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c
--- a/sys/net80211/ieee80211_adhoc.c
+++ b/sys/net80211/ieee80211_adhoc.c
@@ -235,7 +235,7 @@
ether_sprintf(ni->ni_bssid));
ieee80211_print_essid(vap->iv_bss->ni_essid,
ni->ni_esslen);
- printf(" channel %d start %uMbit/s\n",
+ net80211_printf(" channel %d start %uMbit/s\n",
ieee80211_chan2ieee(ic, ic->ic_curchan),
ieee80211_node_get_txrate_kbit(ni) / 1000);
}
diff --git a/sys/net80211/ieee80211_alq.c b/sys/net80211/ieee80211_alq.c
--- a/sys/net80211/ieee80211_alq.c
+++ b/sys/net80211/ieee80211_alq.c
@@ -79,7 +79,7 @@
ieee80211_alq_qsize, 0);
ieee80211_alq_lost = 0;
ieee80211_alq_logged = 0;
- printf("net80211: logging to %s enabled; "
+ net80211_printf("net80211: logging to %s enabled; "
"struct size %d bytes\n",
ieee80211_alq_logfile,
(int) sizeof(struct ieee80211_alq_rec));
@@ -87,7 +87,7 @@
if (ieee80211_alq)
alq_close(ieee80211_alq);
ieee80211_alq = NULL;
- printf("net80211: logging disabled\n");
+ net80211_printf("net80211: logging disabled\n");
error = 0;
}
return (error);
diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c
--- a/sys/net80211/ieee80211_crypto.c
+++ b/sys/net80211/ieee80211_crypto.c
@@ -261,12 +261,12 @@
ieee80211_crypto_register(const struct ieee80211_cipher *cip)
{
if (cip->ic_cipher >= IEEE80211_CIPHER_MAX) {
- printf("%s: cipher %s has an invalid cipher index %u\n",
+ net80211_printf("%s: cipher %s has an invalid cipher index %u\n",
__func__, cip->ic_name, cip->ic_cipher);
return;
}
if (ciphers[cip->ic_cipher] != NULL && ciphers[cip->ic_cipher] != cip) {
- printf("%s: cipher %s registered with a different template\n",
+ net80211_printf("%s: cipher %s registered with a different template\n",
__func__, cip->ic_name);
return;
}
@@ -280,12 +280,12 @@
ieee80211_crypto_unregister(const struct ieee80211_cipher *cip)
{
if (cip->ic_cipher >= IEEE80211_CIPHER_MAX) {
- printf("%s: cipher %s has an invalid cipher index %u\n",
+ net80211_printf("%s: cipher %s has an invalid cipher index %u\n",
__func__, cip->ic_name, cip->ic_cipher);
return;
}
if (ciphers[cip->ic_cipher] != NULL && ciphers[cip->ic_cipher] != cip) {
- printf("%s: cipher %s registered with a different template\n",
+ net80211_printf("%s: cipher %s registered with a different template\n",
__func__, cip->ic_name);
return;
}
diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c
--- a/sys/net80211/ieee80211_hostap.c
+++ b/sys/net80211/ieee80211_hostap.c
@@ -309,7 +309,7 @@
ether_sprintf(ni->ni_bssid));
ieee80211_print_essid(ni->ni_essid,
ni->ni_esslen);
- printf(" channel %d start %uMbit/s\n",
+ net80211_printf(" channel %d start %uMbit/s\n",
ieee80211_chan2ieee(ic, ic->ic_curchan),
ieee80211_node_get_txrate_kbit(ni) / 1000);
}
@@ -2218,7 +2218,7 @@
vhtcap != NULL &&
vhtinfo != NULL) {
/* XXX TODO; see below */
- printf("%s: VHT TODO!\n", __func__);
+ net80211_vap_printf(vap, "%s: VHT TODO!\n", __func__);
ieee80211_vht_node_init(ni);
ieee80211_vht_update_cap(ni, vhtcap, vhtinfo);
} else if (ni->ni_flags & IEEE80211_NODE_VHT)
diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c
--- a/sys/net80211/ieee80211_hwmp.c
+++ b/sys/net80211/ieee80211_hwmp.c
@@ -261,7 +261,8 @@
hs = IEEE80211_MALLOC(sizeof(struct ieee80211_hwmp_state), M_80211_VAP,
IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (hs == NULL) {
- printf("%s: couldn't alloc HWMP state\n", __func__);
+ net80211_vap_printf(vap, "%s: couldn't alloc HWMP state\n",
+ __func__);
return;
}
hs->hs_maxhops = IEEE80211_HWMP_DEFAULT_MAXHOPS;
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -901,7 +901,7 @@
break;
#endif
case IEEE80211_ACTION_CAT_VHT:
- printf("%s: TODO: VHT handling!\n", __func__);
+ net80211_printf("%s: TODO: VHT handling!\n", __func__);
break;
}
return 0;
@@ -915,10 +915,10 @@
ieee80211_ssid_mismatch(struct ieee80211vap *vap, const char *tag,
uint8_t mac[IEEE80211_ADDR_LEN], uint8_t *ssid)
{
- printf("[%s] discard %s frame, ssid mismatch: ",
+ net80211_printf("[%s] discard %s frame, ssid mismatch: ",
ether_sprintf(mac), tag);
ieee80211_print_essid(ssid + 2, ssid[1]);
- printf("\n");
+ net80211_printf("\n");
}
/*
@@ -973,7 +973,8 @@
ether_sprintf(ieee80211_getbssid(vap, wh)), buf);
if (len >= sizeof(buf))
- printf("%s: XXX buffer too small: len = %d\n", __func__, len);
+ net80211_printf("%s: XXX buffer too small: len = %d\n",
+ __func__, len);
}
void
@@ -991,7 +992,8 @@
net80211_vap_printf(vap, "[%s] %s\n", ether_sprintf(mac), buf);
if (len >= sizeof(buf))
- printf("%s: XXX buffer too small: len = %d\n", __func__, len);
+ net80211_printf("%s: XXX buffer too small: len = %d\n",
+ __func__, len);
}
void
@@ -1013,7 +1015,8 @@
buf);
if (len >= sizeof(buf))
- printf("%s: XXX buffer too small: len = %d\n", __func__, len);
+ net80211_printf("%s: XXX buffer too small: len = %d\n",
+ __func__, len);
}
void
@@ -1034,7 +1037,8 @@
type != NULL ? " " : "", type != NULL ? type : "", buf);
if (len >= sizeof(buf))
- printf("%s: XXX buffer too small: len = %d\n", __func__, len);
+ net80211_printf("%s: XXX buffer too small: len = %d\n",
+ __func__, len);
}
void
@@ -1055,6 +1059,7 @@
type != NULL ? " " : "", type != NULL ? type : "", buf);
if (len >= sizeof(buf))
- printf("%s: XXX buffer too small: len = %d\n", __func__, len);
+ net80211_printf("%s: XXX buffer too small: len = %d\n",
+ __func__, len);
}
#endif /* IEEE80211_DEBUG */
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c
--- a/sys/net80211/ieee80211_ioctl.c
+++ b/sys/net80211/ieee80211_ioctl.c
@@ -2131,7 +2131,7 @@
}
break;
case IEEE80211_MODE_VHT_2GHZ:
- printf("%s: TBD\n", __func__);
+ net80211_printf("%s: TBD\n", __func__);
break;
case IEEE80211_MODE_VHT_5GHZ:
if (IEEE80211_IS_CHAN_A(c)) {
diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c
--- a/sys/net80211/ieee80211_mesh.c
+++ b/sys/net80211/ieee80211_mesh.c
@@ -664,7 +664,8 @@
ms = IEEE80211_MALLOC(sizeof(struct ieee80211_mesh_state), M_80211_VAP,
IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (ms == NULL) {
- printf("%s: couldn't alloc MBSS state\n", __func__);
+ net80211_vap_printf(vap, "%s: couldn't alloc MBSS state\n",
+ __func__);
return;
}
vap->iv_mesh = ms;
@@ -821,7 +822,7 @@
ieee80211_print_essid(ni->ni_meshid,
ni->ni_meshidlen);
/* XXX MCS/HT */
- printf(" channel %d\n",
+ net80211_printf(" channel %d\n",
ieee80211_chan2ieee(ic, ic->ic_curchan));
}
#endif
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -189,7 +189,8 @@
IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (vap->iv_aid_bitmap == NULL) {
/* XXX no way to recover */
- printf("%s: no memory for AID bitmap, max aid %d!\n",
+ net80211_vap_printf(vap,
+ "%s: no memory for AID bitmap, max aid %d!\n",
__func__, vap->iv_max_aid);
vap->iv_max_aid = 0;
}
@@ -577,22 +578,22 @@
!IEEE80211_ADDR_EQ(vap->iv_des_bssid, ni->ni_bssid))
fail |= 0x20;
- printf(" %c %s", fail ? '-' : '+', ether_sprintf(ni->ni_macaddr));
- printf(" %s%c", ether_sprintf(ni->ni_bssid), fail & 0x20 ? '!' : ' ');
- printf(" %3d%c",
+ net80211_printf(" %c %s", fail ? '-' : '+', ether_sprintf(ni->ni_macaddr));
+ net80211_printf(" %s%c", ether_sprintf(ni->ni_bssid), fail & 0x20 ? '!' : ' ');
+ net80211_printf(" %3d%c",
ieee80211_chan2ieee(ic, ni->ni_chan), fail & 0x01 ? '!' : ' ');
- printf(" %2dM%c", (rate & IEEE80211_RATE_VAL) / 2,
+ net80211_printf(" %2dM%c", (rate & IEEE80211_RATE_VAL) / 2,
fail & 0x08 ? '!' : ' ');
- printf(" %4s%c",
+ net80211_printf(" %4s%c",
(ni->ni_capinfo & IEEE80211_CAPINFO_ESS) ? "ess" :
(ni->ni_capinfo & IEEE80211_CAPINFO_IBSS) ? "ibss" :
"????",
fail & 0x02 ? '!' : ' ');
- printf(" %3s%c ",
+ net80211_printf(" %3s%c ",
(ni->ni_capinfo & IEEE80211_CAPINFO_PRIVACY) ? "wep" : "no",
fail & 0x04 ? '!' : ' ');
ieee80211_print_essid(ni->ni_essid, ni->ni_esslen);
- printf("%s\n", fail & 0x10 ? "!" : "");
+ net80211_printf("%s\n", fail & 0x10 ? "!" : "");
}
#endif /* IEEE80211_DEBUG */
@@ -1035,10 +1036,9 @@
ni->ni_ies.vhtcap_ie != NULL &&
vap->iv_vht_flags & IEEE80211_FVHT_VHT) {
if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) {
- printf("%s: BSS %6D: 2GHz channel, VHT info; ignoring\n",
- __func__,
- ni->ni_macaddr,
- ":");
+ net80211_vap_printf(ni->ni_vap,
+ "%s: BSS %6D: 2GHz channel, VHT info; ignoring\n",
+ __func__, ni->ni_macaddr, ":");
} else {
ieee80211_vht_node_init(ni);
ieee80211_vht_updateparams(ni,
@@ -1166,7 +1166,7 @@
while (ielen > 1) {
/* Make sure the given IE length fits into the total length. */
if ((2 + ie[1]) > ielen) {
- printf("%s: malformed IEs! ies %p { data %p len %d }: "
+ net80211_printf("%s: malformed IEs! ies %p { data %p len %d }: "
"ie %u len 2+%u > total len left %d\n",
__func__, ies, ies->data, ies->len,
ie[0], ie[1], ielen);
@@ -1607,7 +1607,8 @@
*/
ieee80211_ht_wds_init(ni);
if (vap->iv_vht_flags & IEEE80211_FVHT_VHT) {
- printf("%s: TODO: vht_wds_init\n", __func__);
+ net80211_vap_printf(vap,
+ "%s: TODO: vht_wds_init\n", __func__);
}
} else {
struct ieee80211_channel *c = ni->ni_chan;
@@ -1864,10 +1865,9 @@
if (do_vht_setup) {
if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) {
- printf("%s: BSS %6D: 2GHz channel, VHT info; ignoring\n",
- __func__,
- ni->ni_macaddr,
- ":");
+ net80211_vap_printf(ni->ni_vap,
+ "%s: BSS %6D: 2GHz channel, VHT info; ignoring\n",
+ __func__, ni->ni_macaddr, ":");
} else {
ieee80211_vht_node_init(ni);
ieee80211_vht_updateparams(ni,
@@ -2341,7 +2341,7 @@
int i;
for (i = 0; i < nt->nt_keyixmax; i++)
if (nt->nt_keyixmap[i] != NULL)
- printf("%s: %s[%u] still active\n", __func__,
+ net80211_printf("%s: %s[%u] still active\n", __func__,
nt->nt_name, i);
#endif
IEEE80211_FREE(nt->nt_keyixmap, M_80211_NODE);
@@ -2645,36 +2645,36 @@
ieee80211_dump_node(struct ieee80211_node_table *nt __unused,
struct ieee80211_node *ni)
{
- printf("%p: mac %s refcnt %d\n", ni,
+ net80211_printf("%p: mac %s refcnt %d\n", ni,
ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni));
- printf("\tauthmode %u flags 0x%x\n",
+ net80211_printf("\tauthmode %u flags 0x%x\n",
ni->ni_authmode, ni->ni_flags);
- printf("\tassocid 0x%x txpower %u vlan %u\n",
+ net80211_printf("\tassocid 0x%x txpower %u vlan %u\n",
ni->ni_associd, ni->ni_txpower, ni->ni_vlan);
- printf("\ttxseq %u rxseq %u fragno %u rxfragstamp %u\n",
+ net80211_printf("\ttxseq %u rxseq %u fragno %u rxfragstamp %u\n",
ni->ni_txseqs[IEEE80211_NONQOS_TID],
ni->ni_rxseqs[IEEE80211_NONQOS_TID] >> IEEE80211_SEQ_SEQ_SHIFT,
ni->ni_rxseqs[IEEE80211_NONQOS_TID] & IEEE80211_SEQ_FRAG_MASK,
ni->ni_rxfragstamp);
- printf("\trssi %d noise %d intval %u capinfo 0x%x\n",
+ net80211_printf("\trssi %d noise %d intval %u capinfo 0x%x\n",
node_getrssi(ni), ni->ni_noise,
ni->ni_intval, ni->ni_capinfo);
- printf("\tbssid %s essid \"%.*s\" channel %u:0x%x\n",
+ net80211_printf("\tbssid %s essid \"%.*s\" channel %u:0x%x\n",
ether_sprintf(ni->ni_bssid),
ni->ni_esslen, ni->ni_essid,
(ni->ni_chan != IEEE80211_CHAN_ANYC) ? ni->ni_chan->ic_freq : 0,
(ni->ni_chan != IEEE80211_CHAN_ANYC) ? ni->ni_chan->ic_flags : 0);
- printf("\tinact %u inact_reload %u txrate type %d dot11rate %u\n",
+ net80211_printf("\tinact %u inact_reload %u txrate type %d dot11rate %u\n",
ni->ni_inact, ni->ni_inact_reload,
ni->ni_txrate.type,
ni->ni_txrate.dot11rate);
- printf("\thtcap %x htparam %x htctlchan %u ht2ndchan %u\n",
+ net80211_printf("\thtcap %x htparam %x htctlchan %u ht2ndchan %u\n",
ni->ni_htcap, ni->ni_htparam,
ni->ni_htctlchan, ni->ni_ht2ndchan);
- printf("\thtopmode %x htstbc %x htchw %d (%s)\n",
+ net80211_printf("\thtopmode %x htstbc %x htchw %d (%s)\n",
ni->ni_htopmode, ni->ni_htstbc,
ni->ni_chw, ieee80211_ni_chw_to_str(ni->ni_chw));
- printf("\tvhtcap %x freq1 %d freq2 %d vhtbasicmcs %x\n",
+ net80211_printf("\tvhtcap %x freq1 %d freq2 %d vhtbasicmcs %x\n",
ni->ni_vhtcap, (int) ni->ni_vht_chan1, (int) ni->ni_vht_chan2,
(int) ni->ni_vht_basicmcs);
/* XXX VHT state */
@@ -3162,7 +3162,8 @@
break;
case IEEE80211_NODE_TXRATE_VHT:
default:
- printf("%s: called for VHT / unknown rate (type %d)!\n",
+ net80211_vap_printf(ni->ni_vap,
+ "%s: called for VHT / unknown rate (type %d)!\n",
__func__, ni->ni_txrate.type);
return (12); /* OFDM6 for now */
}
@@ -3324,8 +3325,9 @@
ni->ni_txrate.nss, ni->ni_txrate.mcs, false);
break;
default:
- printf("%s: called for unknown rate (type %d)!\n",
- __func__, ni->ni_txrate.type);
+ net80211_vap_printf(ni->ni_vap,
+ "%s: called for unknown rate (type %d)!\n", __func__,
+ ni->ni_txrate.type);
return (0);
}
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -1834,7 +1834,8 @@
* be forced to be non-QoS traffic to be A-MSDU encapsulated.
*/
if (is_amsdu)
- printf("%s: XXX ERROR: is_amsdu set; not QoS!\n",
+ net80211_vap_printf(vap,
+ "%s: XXX ERROR: is_amsdu set; not QoS!\n",
__func__);
}
diff --git a/sys/net80211/ieee80211_power.c b/sys/net80211/ieee80211_power.c
--- a/sys/net80211/ieee80211_power.c
+++ b/sys/net80211/ieee80211_power.c
@@ -88,7 +88,8 @@
M_80211_POWER,
IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (vap->iv_tim_bitmap == NULL) {
- printf("%s: no memory for TIM bitmap!\n", __func__);
+ net80211_vap_printf(vap,
+ "%s: no memory for TIM bitmap!\n", __func__);
/* XXX good enough to keep from crashing? */
vap->iv_tim_len = 0;
}
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -504,7 +504,7 @@
void
ieee80211_aclator_register(const struct ieee80211_aclator *iac)
{
- printf("wlan: %s acl policy registered\n", iac->iac_name);
+ net80211_printf("wlan: %s acl policy registered\n", iac->iac_name);
acl = iac;
}
@@ -513,7 +513,7 @@
{
if (acl == iac)
acl = NULL;
- printf("wlan: %s acl policy unregistered\n", iac->iac_name);
+ net80211_printf("wlan: %s acl policy unregistered\n", iac->iac_name);
}
const struct ieee80211_aclator *
@@ -538,14 +538,14 @@
break;
}
if (i == len) {
- printf("\"");
+ net80211_printf("\"");
for (i = 0, p = essid; i < len; i++, p++)
- printf("%c", *p);
- printf("\"");
+ net80211_printf("%c", *p);
+ net80211_printf("\"");
} else {
- printf("0x");
+ net80211_printf("0x");
for (i = 0, p = essid; i < len; i++, p++)
- printf("%02x", *p);
+ net80211_printf("%02x", *p);
}
}
@@ -559,67 +559,67 @@
wh = (const struct ieee80211_frame *)buf;
switch (wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) {
case IEEE80211_FC1_DIR_NODS:
- printf("NODS %s", ether_sprintf(wh->i_addr2));
- printf("->%s", ether_sprintf(wh->i_addr1));
- printf("(%s)", ether_sprintf(wh->i_addr3));
+ net80211_printf("NODS %s", ether_sprintf(wh->i_addr2));
+ net80211_printf("->%s", ether_sprintf(wh->i_addr1));
+ net80211_printf("(%s)", ether_sprintf(wh->i_addr3));
break;
case IEEE80211_FC1_DIR_TODS:
- printf("TODS %s", ether_sprintf(wh->i_addr2));
- printf("->%s", ether_sprintf(wh->i_addr3));
- printf("(%s)", ether_sprintf(wh->i_addr1));
+ net80211_printf("TODS %s", ether_sprintf(wh->i_addr2));
+ net80211_printf("->%s", ether_sprintf(wh->i_addr3));
+ net80211_printf("(%s)", ether_sprintf(wh->i_addr1));
break;
case IEEE80211_FC1_DIR_FROMDS:
- printf("FRDS %s", ether_sprintf(wh->i_addr3));
- printf("->%s", ether_sprintf(wh->i_addr1));
- printf("(%s)", ether_sprintf(wh->i_addr2));
+ net80211_printf("FRDS %s", ether_sprintf(wh->i_addr3));
+ net80211_printf("->%s", ether_sprintf(wh->i_addr1));
+ net80211_printf("(%s)", ether_sprintf(wh->i_addr2));
break;
case IEEE80211_FC1_DIR_DSTODS:
- printf("DSDS %s", ether_sprintf((const uint8_t *)&wh[1]));
- printf("->%s", ether_sprintf(wh->i_addr3));
- printf("(%s", ether_sprintf(wh->i_addr2));
- printf("->%s)", ether_sprintf(wh->i_addr1));
+ net80211_printf("DSDS %s", ether_sprintf((const uint8_t *)&wh[1]));
+ net80211_printf("->%s", ether_sprintf(wh->i_addr3));
+ net80211_printf("(%s", ether_sprintf(wh->i_addr2));
+ net80211_printf("->%s)", ether_sprintf(wh->i_addr1));
break;
}
switch (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) {
case IEEE80211_FC0_TYPE_DATA:
- printf(" data");
+ net80211_printf(" data");
break;
case IEEE80211_FC0_TYPE_MGT:
- printf(" %s", ieee80211_mgt_subtype_name(wh->i_fc[0]));
+ net80211_printf(" %s", ieee80211_mgt_subtype_name(wh->i_fc[0]));
break;
default:
- printf(" type#%d", wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK);
+ net80211_printf(" type#%d", wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK);
break;
}
if (IEEE80211_QOS_HAS_SEQ(wh)) {
const struct ieee80211_qosframe *qwh =
(const struct ieee80211_qosframe *)buf;
- printf(" QoS [TID %u%s]", qwh->i_qos[0] & IEEE80211_QOS_TID,
+ net80211_printf(" QoS [TID %u%s]", qwh->i_qos[0] & IEEE80211_QOS_TID,
qwh->i_qos[0] & IEEE80211_QOS_ACKPOLICY ? " ACM" : "");
}
if (IEEE80211_IS_PROTECTED(wh)) {
int off;
off = ieee80211_anyhdrspace(ic, wh);
- printf(" WEP [IV %.02x %.02x %.02x",
+ net80211_printf(" WEP [IV %.02x %.02x %.02x",
buf[off+0], buf[off+1], buf[off+2]);
if (buf[off+IEEE80211_WEP_IVLEN] & IEEE80211_WEP_EXTIV)
- printf(" %.02x %.02x %.02x",
+ net80211_printf(" %.02x %.02x %.02x",
buf[off+4], buf[off+5], buf[off+6]);
- printf(" KID %u]", buf[off+IEEE80211_WEP_IVLEN] >> 6);
+ net80211_printf(" KID %u]", buf[off+IEEE80211_WEP_IVLEN] >> 6);
}
if (rate >= 0)
- printf(" %dM", rate / 2);
+ net80211_printf(" %dM", rate / 2);
if (rssi >= 0)
- printf(" +%d", rssi);
- printf("\n");
+ net80211_printf(" +%d", rssi);
+ net80211_printf("\n");
if (len > 0) {
for (i = 0; i < len; i++) {
if ((i & 1) == 0)
- printf(" ");
- printf("%02x", buf[i]);
+ net80211_printf(" ");
+ net80211_printf("%02x", buf[i]);
}
- printf("\n");
+ net80211_printf("\n");
}
}
diff --git a/sys/net80211/ieee80211_radiotap.c b/sys/net80211/ieee80211_radiotap.c
--- a/sys/net80211/ieee80211_radiotap.c
+++ b/sys/net80211/ieee80211_radiotap.c
@@ -354,14 +354,14 @@
continue;
if (items[i].align == 0) {
/* NB: unidentified element, don't guess */
- printf("%s: unknown item %d\n", __func__, i);
+ net80211_printf("%s: unknown item %d\n", __func__, i);
return -1;
}
off = roundup2(off, items[i].align);
if (i == item) {
if (off + items[i].width > le16toh(rh->it_len)) {
/* NB: item does not fit in header data */
- printf("%s: item %d not in header data, "
+ net80211_printf("%s: item %d not in header data, "
"off %d width %zu len %d\n", __func__, i,
off, items[i].width, le16toh(rh->it_len));
return -1;
diff --git a/sys/net80211/ieee80211_scan.c b/sys/net80211/ieee80211_scan.c
--- a/sys/net80211/ieee80211_scan.c
+++ b/sys/net80211/ieee80211_scan.c
@@ -288,7 +288,7 @@
for (i = ss->ss_next; i < ss->ss_last; i++) {
const struct ieee80211_channel *c = ss->ss_chans[i];
- printf("%s%u%c", sep, ieee80211_chan2ieee(ic, c),
+ net80211_printf("%s%u%c", sep, ieee80211_chan2ieee(ic, c),
ieee80211_channel_type_char(c));
sep = ", ";
}
@@ -547,21 +547,21 @@
int i, nbands, schan, nchan;
if (cie->len < 3) {
- printf(" <bogus country ie, len %d>", cie->len);
+ net80211_printf(" <bogus country ie, len %d>", cie->len);
return;
}
- printf(" country [%c%c%c", cie->cc[0], cie->cc[1], cie->cc[2]);
+ net80211_printf(" country [%c%c%c", cie->cc[0], cie->cc[1], cie->cc[2]);
nbands = (cie->len - 3) / sizeof(cie->band[0]);
for (i = 0; i < nbands; i++) {
schan = cie->band[i].schan;
nchan = cie->band[i].nchan;
if (nchan != 1)
- printf(" %u-%u,%u", schan, schan + nchan-1,
+ net80211_printf(" %u-%u,%u", schan, schan + nchan-1,
cie->band[i].maxtxpwr);
else
- printf(" %u,%u", schan, cie->band[i].maxtxpwr);
+ net80211_printf(" %u,%u", schan, cie->band[i].maxtxpwr);
}
- printf("]");
+ net80211_printf("]");
}
void
@@ -570,18 +570,18 @@
const struct ieee80211_scanparams *sp, int rssi)
{
- printf("[%s] %s%s on chan %u (bss chan %u) ",
+ net80211_printf("[%s] %s%s on chan %u (bss chan %u) ",
ether_sprintf(mac), isnew ? "new " : "",
ieee80211_mgt_subtype_name(subtype), sp->chan, sp->bchan);
ieee80211_print_essid(sp->ssid + 2, sp->ssid[1]);
- printf(" rssi %d\n", rssi);
+ net80211_printf(" rssi %d\n", rssi);
if (isnew) {
- printf("[%s] caps 0x%x bintval %u erp 0x%x",
+ net80211_printf("[%s] caps 0x%x bintval %u erp 0x%x",
ether_sprintf(mac), sp->capinfo, sp->bintval, sp->erp);
if (sp->country != NULL)
dump_country(sp->country);
- printf("\n");
+ net80211_printf("\n");
}
}
#endif /* IEEE80211_DEBUG */
diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c
--- a/sys/net80211/ieee80211_scan_sta.c
+++ b/sys/net80211/ieee80211_scan_sta.c
@@ -1157,7 +1157,7 @@
fail |= MATCH_RSSI;
#ifdef IEEE80211_DEBUG
if (ieee80211_msg(vap, debug)) {
- printf(" %c %s",
+ net80211_printf(" %c %s",
fail & MATCH_FAILS ? '=' :
fail & MATCH_NOTSEEN ? '^' :
fail & MATCH_CC ? '$' :
@@ -1170,23 +1170,23 @@
#endif
fail & MATCH_MESH_NOID ? 'm' :
fail ? '-' : '+', ether_sprintf(se->se_macaddr));
- printf(" %s%c", ether_sprintf(se->se_bssid),
+ net80211_printf(" %s%c", ether_sprintf(se->se_bssid),
fail & MATCH_BSSID ? '!' : ' ');
- printf(" %3d%c", ieee80211_chan2ieee(ic, se->se_chan),
+ net80211_printf(" %3d%c", ieee80211_chan2ieee(ic, se->se_chan),
fail & MATCH_CHANNEL ? '!' : ' ');
- printf(" %+4d%c", se->se_rssi, fail & MATCH_RSSI ? '!' : ' ');
- printf(" %2dM%c", (rate & IEEE80211_RATE_VAL) / 2,
+ net80211_printf(" %+4d%c", se->se_rssi, fail & MATCH_RSSI ? '!' : ' ');
+ net80211_printf(" %2dM%c", (rate & IEEE80211_RATE_VAL) / 2,
fail & MATCH_RATE ? '!' : ' ');
- printf(" %4s%c",
+ net80211_printf(" %4s%c",
(se->se_capinfo & IEEE80211_CAPINFO_ESS) ? "ess" :
(se->se_capinfo & IEEE80211_CAPINFO_IBSS) ? "ibss" : "",
fail & MATCH_CAPINFO ? '!' : ' ');
- printf(" %3s%c ",
+ net80211_printf(" %3s%c ",
(se->se_capinfo & IEEE80211_CAPINFO_PRIVACY) ?
"wep" : "no",
fail & MATCH_PRIVACY ? '!' : ' ');
ieee80211_print_essid(se->se_ssid+2, se->se_ssid[1]);
- printf("%s\n", fail & (MATCH_SSID | MATCH_MESHID) ? "!" : "");
+ net80211_printf("%s\n", fail & (MATCH_SSID | MATCH_MESHID) ? "!" : "");
}
#endif
return fail;
diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c
--- a/sys/net80211/ieee80211_sta.c
+++ b/sys/net80211/ieee80211_sta.c
@@ -415,7 +415,7 @@
ether_sprintf(ni->ni_bssid));
ieee80211_print_essid(vap->iv_bss->ni_essid,
ni->ni_esslen);
- printf(" channel %d start %uMbit/s\n",
+ net80211_printf(" channel %d start %uMbit/s\n",
ieee80211_chan2ieee(ic, ic->ic_curchan),
ieee80211_node_get_txrate_kbit(ni) / 1000);
}
@@ -1870,10 +1870,9 @@
* We aren't ready for 2GHz VHT support.
*/
if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) {
- printf("%s: peer %6D: VHT on 2GHz, ignoring\n",
- __func__,
- ni->ni_macaddr,
- ":");
+ net80211_vap_printf(vap,
+ "%s: peer %6D: VHT on 2GHz, ignoring\n",
+ __func__, ni->ni_macaddr, ":");
} else {
ieee80211_vht_node_init(ni);
ieee80211_vht_updateparams(ni, vhtcap, vhtopmode);
diff --git a/sys/net80211/ieee80211_superg.c b/sys/net80211/ieee80211_superg.c
--- a/sys/net80211/ieee80211_superg.c
+++ b/sys/net80211/ieee80211_superg.c
@@ -115,8 +115,8 @@
sizeof(struct ieee80211_superg), M_80211_VAP,
IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (sg == NULL) {
- printf("%s: cannot allocate SuperG state block\n",
- __func__);
+ net80211_ic_printf(ic,
+ "%s: cannot allocate SuperG state block\n", __func__);
return;
}
TIMEOUT_TASK_INIT(ic->ic_tq, &sg->ff_qtimer, 0, ff_age_all, ic);
@@ -382,7 +382,8 @@
ETHER_HEADER_COPY(&eh1, mtod(m1, caddr_t));
m1 = ieee80211_mbuf_adjust(vap, hdrspace, key, m1);
if (m1 == NULL) {
- printf("%s: failed initial mbuf_adjust\n", __func__);
+ net80211_vap_printf(vap, "%s: failed initial mbuf_adjust\n",
+ __func__);
/* NB: ieee80211_mbuf_adjust handles msgs+statistics */
m_freem(m2);
goto bad;
@@ -398,7 +399,7 @@
m2 = ieee80211_mbuf_adjust(vap, 4, NULL, m2);
if (m2 == NULL) {
/* NB: ieee80211_mbuf_adjust handles msgs+statistics */
- printf("%s: failed second \n", __func__);
+ net80211_vap_printf(vap, "%s: failed second \n", __func__);
goto bad;
}
@@ -714,7 +715,7 @@
}
mprev = m;
}
- printf("%s: packet not found\n", __func__);
+ net80211_ic_printf(ic, "%s: packet not found\n", __func__);
}
static uint32_t
diff --git a/sys/net80211/ieee80211_tdma.c b/sys/net80211/ieee80211_tdma.c
--- a/sys/net80211/ieee80211_tdma.c
+++ b/sys/net80211/ieee80211_tdma.c
@@ -153,7 +153,8 @@
sizeof(struct ieee80211_tdma_state), M_80211_VAP,
IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
if (ts == NULL) {
- printf("%s: cannot allocate TDMA state block\n", __func__);
+ net80211_vap_printf(vap,
+ "%s: cannot allocate TDMA state block\n", __func__);
/* NB: fall back to adhdemo mode */
vap->iv_caps &= ~IEEE80211_C_TDMA;
return;
@@ -419,8 +420,9 @@
if (tdma->tdma_slotcnt != ts->tdma_slotcnt) {
if (!TDMA_SLOTCNT_VALID(tdma->tdma_slotcnt)) {
if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1))
- printf("%s: bad slot cnt %u\n",
- __func__, tdma->tdma_slotcnt);
+ net80211_vap_printf(vap,
+ "%s: bad slot cnt %u\n", __func__,
+ tdma->tdma_slotcnt);
return 0;
}
update |= TDMA_UPDATE_SLOTCNT;
@@ -429,8 +431,8 @@
if (slotlen != ts->tdma_slotlen) {
if (!TDMA_SLOTLEN_VALID(slotlen)) {
if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1))
- printf("%s: bad slot len %u\n",
- __func__, slotlen);
+ net80211_vap_printf(vap,
+ "%s: bad slot len %u\n", __func__, slotlen);
return 0;
}
update |= TDMA_UPDATE_SLOTLEN;
@@ -438,8 +440,9 @@
if (tdma->tdma_bintval != ts->tdma_bintval) {
if (!TDMA_BINTVAL_VALID(tdma->tdma_bintval)) {
if (ppsratecheck(&ts->tdma_lastprint, &ts->tdma_fails, 1))
- printf("%s: bad beacon interval %u\n",
- __func__, tdma->tdma_bintval);
+ net80211_vap_printf(vap,
+ "%s: bad beacon interval %u\n", __func__,
+ tdma->tdma_bintval);
return 0;
}
update |= TDMA_UPDATE_BINTVAL;
@@ -453,9 +456,10 @@
if (isclr(tdma->tdma_inuse, slot))
break;
if (slot <= 0) {
- printf("%s: no free slot, slotcnt %u inuse: 0x%x\n",
- __func__, tdma->tdma_slotcnt,
- tdma->tdma_inuse[0]);
+ net80211_vap_printf(vap,
+ "%s: no free slot, slotcnt %u inuse: 0x%x\n",
+ __func__, tdma->tdma_slotcnt,
+ tdma->tdma_inuse[0]);
/* XXX need to do something better */
return 0;
}
diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c
--- a/sys/net80211/ieee80211_vht.c
+++ b/sys/net80211/ieee80211_vht.c
@@ -250,7 +250,8 @@
ni->ni_vht_basicmcs = le16dec(ie + 5);
#if 0
- printf("%s: chan1=%d, chan2=%d, chanwidth=%d, basicmcs=0x%04x\n",
+ net80211_vap_printf(ni->ni_vap,
+ "%s: chan1=%d, chan2=%d, chanwidth=%d, basicmcs=0x%04x\n",
__func__, ni->ni_vht_chan1, ni->ni_vht_chan2, ni->ni_vht_chanwidth,
ni->ni_vht_basicmcs);
#endif
@@ -774,7 +775,8 @@
}
static uint8_t
-ieee80211_vht_get_chwidth_ie(struct ieee80211_channel *c)
+ieee80211_vht_get_chwidth_ie(const struct ieee80211vap *vap,
+ const struct ieee80211_channel *c)
{
/*
@@ -794,7 +796,8 @@
return IEEE80211_VHT_CHANWIDTH_USE_HT;
/* We shouldn't get here */
- printf("%s: called on a non-VHT channel (freq=%d, flags=0x%08x\n",
+ net80211_vap_printf(vap,
+ "%s: called on a non-VHT channel (freq=%d, flags=0x%08x\n",
__func__, (int) c->ic_freq, c->ic_flags);
return IEEE80211_VHT_CHANWIDTH_USE_HT;
}
@@ -820,7 +823,7 @@
frm += 2;
/* 8-bit chanwidth */
- *frm++ = ieee80211_vht_get_chwidth_ie(ni->ni_chan);
+ *frm++ = ieee80211_vht_get_chwidth_ie(ni->ni_vap, ni->ni_chan);
/* 8-bit freq1 */
*frm++ = ni->ni_chan->ic_vht_ch_freq1;
@@ -863,7 +866,8 @@
/* First case - handle channel demotion - if VHT isn't set */
if ((flags & IEEE80211_FVHT_MASK) == 0) {
#if 0
- printf("%s: demoting channel %d/0x%08x\n", __func__,
+ net80211_ic_printf(ic,
+ "%s: demoting channel %d/0x%08x\n", __func__,
chan->ic_ieee, chan->ic_flags);
#endif
c = ieee80211_find_channel(ic, chan->ic_freq,
@@ -871,7 +875,7 @@
if (c == NULL)
c = chan;
#if 0
- printf("%s: .. to %d/0x%08x\n", __func__,
+ net80211_ic_printf(ic, "%s: .. to %d/0x%08x\n", __func__,
c->ic_ieee, c->ic_flags);
#endif
return (c);
@@ -908,7 +912,8 @@
chan = c;
#if 0
- printf("%s: selected %d/0x%08x\n", __func__, c->ic_ieee, c->ic_flags);
+ net80211_ic_printf(ic, "%s: selected %d/0x%08x\n", __func__,
+ c->ic_ieee, c->ic_flags);
#endif
return (chan);
}
@@ -926,7 +931,7 @@
ieee80211_vht_get_vhtinfo_ie(struct ieee80211_node *ni,
struct ieee80211_vht_operation *vhtop, int opmode)
{
- printf("%s: called; TODO!\n", __func__);
+ net80211_vap_printf(ni->ni_vap, "%s: called; TODO!\n", __func__);
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 27, 9:10 PM (4 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26262882
Default Alt Text
D50644.diff (32 KB)
Attached To
Mode
D50644: net80211: migrate direct printf() to ieee80211_printf()
Attached
Detach File
Event Timeline
Log In to Comment