net80211: migrate if_printf() -> net80211_vap_printf()
Migrate the if_printf() calls to net80211_vap_printf(), which hides the underlying ifp and the network stack. Note: there are still a LOT of direct printf() calls in the codebase. This is just a mostly mechanical conversion of if_printf() calls. Differential Revision: https://reviews.freebsd.org/D50643 Reviewed by: bz
This commit is contained in:
@@ -2748,7 +2748,7 @@ ieee80211_is_ctl_frame_for_vap(struct ieee80211_node *ni, const struct mbuf *m0)
|
||||
KASSERT(IEEE80211_IS_CTL(wh), ("%s: not a CTL frame (fc[0]=0x%04x)",
|
||||
__func__, wh->i_fc[0]));
|
||||
if (!IEEE80211_IS_CTL(wh)) {
|
||||
if_printf(vap->iv_ifp,
|
||||
net80211_vap_printf(vap,
|
||||
"%s: not a control frame (fc[0]=0x%04x)\n",
|
||||
__func__, wh->i_fc[0]);
|
||||
return (false);
|
||||
|
||||
@@ -645,7 +645,8 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m,
|
||||
#ifdef IEEE80211_DEBUG
|
||||
if ((ieee80211_msg_debug(vap) && doprint(vap, subtype)) ||
|
||||
ieee80211_msg_dumppkts(vap)) {
|
||||
if_printf(ifp, "received %s from %s rssi %d\n",
|
||||
net80211_vap_printf(vap,
|
||||
"received %s from %s rssi %d\n",
|
||||
ieee80211_mgt_subtype_name(subtype),
|
||||
ether_sprintf(wh->i_addr2), rssi);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ amrr_init(struct ieee80211vap *vap)
|
||||
amrr = vap->iv_rs = IEEE80211_MALLOC(sizeof(struct ieee80211_amrr),
|
||||
M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
|
||||
if (amrr == NULL) {
|
||||
if_printf(vap->iv_ifp, "couldn't alloc ratectl structure\n");
|
||||
net80211_vap_printf(vap, "couldn't alloc ratectl structure\n");
|
||||
return;
|
||||
}
|
||||
amrr->amrr_min_success_threshold = IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD;
|
||||
@@ -231,7 +231,8 @@ amrr_node_init(struct ieee80211_node *ni)
|
||||
struct ieee80211_amrr_node *amn;
|
||||
|
||||
if (!amrr) {
|
||||
if_printf(vap->iv_ifp, "ratectl structure was not allocated, "
|
||||
net80211_vap_printf(vap,
|
||||
"ratectl structure was not allocated, "
|
||||
"per-node structure allocation skipped\n");
|
||||
return;
|
||||
}
|
||||
@@ -240,8 +241,8 @@ amrr_node_init(struct ieee80211_node *ni)
|
||||
ni->ni_rctls = amn = IEEE80211_MALLOC(sizeof(struct ieee80211_amrr_node),
|
||||
M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
|
||||
if (amn == NULL) {
|
||||
if_printf(vap->iv_ifp, "couldn't alloc per-node ratectl "
|
||||
"structure\n");
|
||||
net80211_vap_printf(vap,
|
||||
"couldn't alloc per-node ratectl structure\n");
|
||||
return;
|
||||
}
|
||||
} else
|
||||
|
||||
@@ -144,7 +144,7 @@ cac_timeout(void *arg)
|
||||
ieee80211_notify_cac(ic, ic->ic_curchan,
|
||||
IEEE80211_NOTIFY_CAC_RADAR);
|
||||
|
||||
if_printf(vap->iv_ifp,
|
||||
net80211_vap_printf(vap,
|
||||
"CAC timer on channel %u (%u MHz) stopped due to radar\n",
|
||||
ic->ic_curchan->ic_ieee, ic->ic_curchan->ic_freq);
|
||||
|
||||
@@ -153,7 +153,7 @@ cac_timeout(void *arg)
|
||||
vap->iv_des_chan = dfs->newchan;
|
||||
ieee80211_new_state_locked(vap, IEEE80211_S_SCAN, 0);
|
||||
} else {
|
||||
if_printf(vap->iv_ifp,
|
||||
net80211_vap_printf(vap,
|
||||
"CAC timer on channel %u (%u MHz) expired; "
|
||||
"no radar detected\n",
|
||||
ic->ic_curchan->ic_ieee, ic->ic_curchan->ic_freq);
|
||||
@@ -187,7 +187,8 @@ ieee80211_dfs_cac_start(struct ieee80211vap *vap)
|
||||
IEEE80211_LOCK_ASSERT(ic);
|
||||
|
||||
callout_reset(&dfs->cac_timer, CAC_TIMEOUT, cac_timeout, vap);
|
||||
if_printf(vap->iv_ifp, "start %d second CAC timer on channel %u (%u MHz)\n",
|
||||
net80211_vap_printf(vap,
|
||||
"start %d second CAC timer on channel %u (%u MHz)\n",
|
||||
ticks_to_secs(CAC_TIMEOUT),
|
||||
ic->ic_curchan->ic_ieee, ic->ic_curchan->ic_freq);
|
||||
ieee80211_notify_cac(ic, ic->ic_curchan, IEEE80211_NOTIFY_CAC_START);
|
||||
@@ -206,7 +207,8 @@ ieee80211_dfs_cac_stop(struct ieee80211vap *vap)
|
||||
|
||||
/* NB: racey but not important */
|
||||
if (callout_pending(&dfs->cac_timer)) {
|
||||
if_printf(vap->iv_ifp, "stop CAC timer on channel %u (%u MHz)\n",
|
||||
net80211_vap_printf(vap,
|
||||
"stop CAC timer on channel %u (%u MHz)\n",
|
||||
ic->ic_curchan->ic_ieee, ic->ic_curchan->ic_freq);
|
||||
ieee80211_notify_cac(ic, ic->ic_curchan,
|
||||
IEEE80211_NOTIFY_CAC_STOP);
|
||||
|
||||
@@ -838,7 +838,8 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m,
|
||||
#ifdef IEEE80211_DEBUG
|
||||
if ((ieee80211_msg_debug(vap) && doprint(vap, subtype)) ||
|
||||
ieee80211_msg_dumppkts(vap)) {
|
||||
if_printf(ifp, "received %s from %s rssi %d\n",
|
||||
net80211_vap_printf(vap,
|
||||
"received %s from %s rssi %d\n",
|
||||
ieee80211_mgt_subtype_name(subtype),
|
||||
ether_sprintf(wh->i_addr2), rssi);
|
||||
}
|
||||
|
||||
@@ -950,10 +950,11 @@ ieee80211_note(const struct ieee80211vap *vap, const char *fmt, ...)
|
||||
len = vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if_printf(vap->iv_ifp, "%s", buf); /* NB: no \n */
|
||||
net80211_vap_printf(vap, "%s", buf); /* NB: no \n */
|
||||
|
||||
if (len >= sizeof(buf))
|
||||
printf("%s: XXX buffer too small: len = %d\n", __func__, len);
|
||||
net80211_vap_printf(vap,
|
||||
"%s: XXX buffer too small: len = %d\n", __func__, len);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -968,7 +969,7 @@ ieee80211_note_frame(const struct ieee80211vap *vap,
|
||||
va_start(ap, fmt);
|
||||
len = vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||
va_end(ap);
|
||||
if_printf(vap->iv_ifp, "[%s] %s\n",
|
||||
net80211_vap_printf(vap, "[%s] %s\n",
|
||||
ether_sprintf(ieee80211_getbssid(vap, wh)), buf);
|
||||
|
||||
if (len >= sizeof(buf))
|
||||
@@ -987,7 +988,7 @@ ieee80211_note_mac(const struct ieee80211vap *vap,
|
||||
va_start(ap, fmt);
|
||||
len = vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||
va_end(ap);
|
||||
if_printf(vap->iv_ifp, "[%s] %s\n", ether_sprintf(mac), buf);
|
||||
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);
|
||||
@@ -1006,7 +1007,7 @@ ieee80211_discard_frame(const struct ieee80211vap *vap,
|
||||
len = vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if_printf(vap->iv_ifp, "[%s] discard %s frame, %s\n",
|
||||
net80211_vap_printf(vap, "[%s] discard %s frame, %s\n",
|
||||
ether_sprintf(ieee80211_getbssid(vap, wh)),
|
||||
type != NULL ? type : ieee80211_mgt_subtype_name(wh->i_fc[0]),
|
||||
buf);
|
||||
@@ -1028,7 +1029,7 @@ ieee80211_discard_ie(const struct ieee80211vap *vap,
|
||||
len = vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if_printf(vap->iv_ifp, "[%s] discard%s%s information element, %s\n",
|
||||
net80211_vap_printf(vap, "[%s] discard%s%s information element, %s\n",
|
||||
ether_sprintf(ieee80211_getbssid(vap, wh)),
|
||||
type != NULL ? " " : "", type != NULL ? type : "", buf);
|
||||
|
||||
@@ -1049,7 +1050,7 @@ ieee80211_discard_mac(const struct ieee80211vap *vap,
|
||||
len = vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if_printf(vap->iv_ifp, "[%s] discard%s%s frame, %s\n",
|
||||
net80211_vap_printf(vap, "[%s] discard%s%s frame, %s\n",
|
||||
ether_sprintf(mac),
|
||||
type != NULL ? " " : "", type != NULL ? type : "", buf);
|
||||
|
||||
|
||||
@@ -1788,7 +1788,8 @@ mesh_input(struct ieee80211_node *ni, struct mbuf *m,
|
||||
if ((ieee80211_msg_debug(vap) &&
|
||||
(vap->iv_ic->ic_flags & IEEE80211_F_SCAN)) ||
|
||||
ieee80211_msg_dumppkts(vap)) {
|
||||
if_printf(ifp, "received %s from %s rssi %d\n",
|
||||
net80211_vap_printf(vap,
|
||||
"received %s from %s rssi %d\n",
|
||||
ieee80211_mgt_subtype_name(subtype),
|
||||
ether_sprintf(wh->i_addr2), rssi);
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ ieee80211_node_latevattach(struct ieee80211vap *vap)
|
||||
/* XXX should we allow max aid to be zero? */
|
||||
if (vap->iv_max_aid < IEEE80211_AID_MIN) {
|
||||
vap->iv_max_aid = IEEE80211_AID_MIN;
|
||||
if_printf(vap->iv_ifp,
|
||||
net80211_vap_printf(vap,
|
||||
"WARNING: max aid too small, changed to %d\n",
|
||||
vap->iv_max_aid);
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ rssadapt_init(struct ieee80211vap *vap)
|
||||
vap->iv_rs = rs = IEEE80211_MALLOC(sizeof(struct ieee80211_rssadapt),
|
||||
M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
|
||||
if (rs == NULL) {
|
||||
if_printf(vap->iv_ifp, "couldn't alloc ratectl structure\n");
|
||||
net80211_vap_printf(vap, "couldn't alloc ratectl structure\n");
|
||||
return;
|
||||
}
|
||||
rs->vap = vap;
|
||||
@@ -178,7 +178,8 @@ rssadapt_node_init(struct ieee80211_node *ni)
|
||||
const struct ieee80211_rateset *rs = &ni->ni_rates;
|
||||
|
||||
if (!rsa) {
|
||||
if_printf(vap->iv_ifp, "ratectl structure was not allocated, "
|
||||
net80211_vap_printf(vap,
|
||||
"ratectl structure was not allocated, "
|
||||
"per-node structure allocation skipped\n");
|
||||
return;
|
||||
}
|
||||
@@ -188,8 +189,8 @@ rssadapt_node_init(struct ieee80211_node *ni)
|
||||
IEEE80211_MALLOC(sizeof(struct ieee80211_rssadapt_node),
|
||||
M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
|
||||
if (ra == NULL) {
|
||||
if_printf(vap->iv_ifp, "couldn't alloc per-node ratectl "
|
||||
"structure\n");
|
||||
net80211_vap_printf(vap,
|
||||
"couldn't alloc per-node ratectl structure\n");
|
||||
return;
|
||||
}
|
||||
} else
|
||||
|
||||
@@ -299,9 +299,9 @@ ieee80211_scan_dump(struct ieee80211_scan_state *ss)
|
||||
{
|
||||
struct ieee80211vap *vap = ss->ss_vap;
|
||||
|
||||
if_printf(vap->iv_ifp, "scan set ");
|
||||
net80211_vap_printf(vap, "scan set ");
|
||||
ieee80211_scan_dump_channels(ss);
|
||||
printf(" dwell min %ums max %ums\n",
|
||||
net80211_vap_printf(vap, " dwell min %ums max %ums\n",
|
||||
ticks_to_msecs(ss->ss_mindwell), ticks_to_msecs(ss->ss_maxdwell));
|
||||
}
|
||||
#endif /* IEEE80211_DEBUG */
|
||||
|
||||
@@ -815,11 +815,9 @@ scan_end(struct ieee80211_scan_state *ss, int scandone)
|
||||
* driver calls (whilst unlocked), update scandone.
|
||||
*/
|
||||
if ((scandone == 0) && ((ss_priv->ss_iflags & ISCAN_PAUSE) == ISCAN_CANCEL)) {
|
||||
/* XXX printf? */
|
||||
if_printf(vap->iv_ifp,
|
||||
net80211_vap_printf(vap,
|
||||
"%s: OOPS! scan cancelled during driver call (1) (ss_iflags=0x%x)!\n",
|
||||
__func__,
|
||||
ss_priv->ss_iflags);
|
||||
__func__, ss_priv->ss_iflags);
|
||||
scandone = 1;
|
||||
}
|
||||
|
||||
@@ -886,11 +884,9 @@ scan_end(struct ieee80211_scan_state *ss, int scandone)
|
||||
* driver calls (whilst unlocked), update scandone.
|
||||
*/
|
||||
if (scandone == 0 && (ss_priv->ss_iflags & ISCAN_PAUSE) == ISCAN_CANCEL) {
|
||||
/* XXX printf? */
|
||||
if_printf(vap->iv_ifp,
|
||||
net80211_vap_printf(vap,
|
||||
"%s: OOPS! scan cancelled during driver call (2) (ss_iflags=0x%x)!\n",
|
||||
__func__,
|
||||
ss_priv->ss_iflags);
|
||||
__func__, ss_priv->ss_iflags);
|
||||
scandone = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -916,7 +916,8 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m,
|
||||
#ifdef IEEE80211_DEBUG
|
||||
if ((ieee80211_msg_debug(vap) && doprint(vap, subtype)) ||
|
||||
ieee80211_msg_dumppkts(vap)) {
|
||||
if_printf(ifp, "received %s from %s rssi %d\n",
|
||||
net80211_vap_printf(vap,
|
||||
"received %s from %s rssi %d\n",
|
||||
ieee80211_mgt_subtype_name(subtype),
|
||||
ether_sprintf(wh->i_addr2), rssi);
|
||||
}
|
||||
|
||||
@@ -703,7 +703,8 @@ wds_input(struct ieee80211_node *ni, struct mbuf *m,
|
||||
}
|
||||
#ifdef IEEE80211_DEBUG
|
||||
if (ieee80211_msg_debug(vap) || ieee80211_msg_dumppkts(vap)) {
|
||||
if_printf(ifp, "received %s from %s rssi %d\n",
|
||||
net80211_vap_printf(vap,
|
||||
"received %s from %s rssi %d\n",
|
||||
ieee80211_mgt_subtype_name(subtype),
|
||||
ether_sprintf(wh->i_addr2), rssi);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user