mirror of https://github.com/proski/madwifi
Eliminate ether_sprintf in favor of new MAC_FMT and MAC_ADDR macros (which are faster and thread safe).
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3254 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
parent
77d9f966c0
commit
e479155497
44
ath/if_ath.c
44
ath/if_ath.c
|
@ -1758,9 +1758,9 @@ ath_uapsd_processtriggers(struct ath_softc *sc)
|
|||
*/
|
||||
#if 0
|
||||
/* This print is very chatty, so removing for now. */
|
||||
DPRINTF(sc, ATH_DEBUG_UAPSD, "%s: U-APSD node (%s) "
|
||||
DPRINTF(sc, ATH_DEBUG_UAPSD, "%s: U-APSD node (" MAC_FMT ") "
|
||||
"has invalid keycache entry\n",
|
||||
__func__, ether_sprintf(qwh->i_addr2));
|
||||
__func__, MAC_ADDR(qwh->i_addr2));
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
@ -1796,20 +1796,20 @@ ath_uapsd_processtriggers(struct ath_softc *sc)
|
|||
ic->ic_uapsdmaxtriggers++;
|
||||
WME_UAPSD_NODE_TRIGSEQINIT(ni);
|
||||
DPRINTF(sc, ATH_DEBUG_UAPSD,
|
||||
"%s: Node (%s) became U-APSD "
|
||||
"%s: Node (" MAC_FMT ") became U-APSD "
|
||||
"triggerable (%d)\n",
|
||||
__func__,
|
||||
ether_sprintf(qwh->i_addr2),
|
||||
MAC_ADDR(qwh->i_addr2),
|
||||
ic->ic_uapsdmaxtriggers);
|
||||
} else {
|
||||
ni->ni_flags &=
|
||||
~IEEE80211_NODE_UAPSD_TRIG;
|
||||
ic->ic_uapsdmaxtriggers--;
|
||||
DPRINTF(sc, ATH_DEBUG_UAPSD,
|
||||
"%s: Node (%s) no longer U-APSD"
|
||||
"%s: Node (" MAC_FMT ") no longer U-APSD"
|
||||
" triggerable (%d)\n",
|
||||
__func__,
|
||||
ether_sprintf(qwh->i_addr2),
|
||||
MAC_ADDR(qwh->i_addr2),
|
||||
ic->ic_uapsdmaxtriggers);
|
||||
/*
|
||||
* XXX: Rapidly thrashing sta could get
|
||||
|
@ -1851,9 +1851,9 @@ ath_uapsd_processtriggers(struct ath_softc *sc)
|
|||
|
||||
DPRINTF(sc, ATH_DEBUG_UAPSD,
|
||||
"%s: U-APSD trigger detected for node "
|
||||
"(%s) on AC %d\n",
|
||||
"(" MAC_FMT ") on AC %d\n",
|
||||
__func__,
|
||||
ether_sprintf(ni->ni_macaddr), ac);
|
||||
MAC_ADDR(ni->ni_macaddr), ac);
|
||||
if (ni->ni_flags & IEEE80211_NODE_UAPSD_SP) {
|
||||
/* have trigger, but SP in progress,
|
||||
* so ignore */
|
||||
|
@ -3421,7 +3421,7 @@ ath_keyprint(struct ath_softc *sc, const char *tag, u_int ix,
|
|||
printk("%s: [%02u] %-7s ", tag, ix, ciphers[hk->kv_type]);
|
||||
for (i = 0, n = hk->kv_len; i < n; i++)
|
||||
printk("%02x", hk->kv_val[i]);
|
||||
printk(" mac %s", ether_sprintf(mac));
|
||||
printk(" mac " MAC_FMT, MAC_ADDR(mac));
|
||||
if (hk->kv_type == HAL_CIPHER_TKIP) {
|
||||
printk(" %s ", sc->sc_splitmic ? "mic" : "rxmic");
|
||||
for (i = 0; i < sizeof(hk->kv_mic); i++)
|
||||
|
@ -7843,8 +7843,8 @@ ath_tx_start(struct net_device *dev, struct ieee80211_node *ni,
|
|||
/* must lock against interrupt-time processing (i.e., not just tasklet) */
|
||||
ATH_NODE_UAPSD_LOCK_IRQ(an);
|
||||
DPRINTF(sc, ATH_DEBUG_UAPSD,
|
||||
"%s: Qing U-APSD data frame for node %s \n",
|
||||
__func__, ether_sprintf(an->an_node.ni_macaddr));
|
||||
"%s: Qing U-APSD data frame for node " MAC_FMT " \n",
|
||||
__func__, MAC_ADDR(an->an_node.ni_macaddr));
|
||||
ath_tx_uapsdqueue(sc, an, bf);
|
||||
if (IEEE80211_NODE_UAPSD_USETIM(ni) && (an->an_uapsd_qdepth == 1))
|
||||
vap->iv_set_tim(ni, 1);
|
||||
|
@ -7992,8 +7992,8 @@ ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
|
|||
"ath_buf with no node!\n"));
|
||||
if (qwh->i_qos[0] & IEEE80211_QOS_EOSP) {
|
||||
DPRINTF(sc, ATH_DEBUG_UAPSD,
|
||||
"%s: EOSP detected for node (%s) on desc %p\n",
|
||||
__func__, ether_sprintf(ni->ni_macaddr), ds);
|
||||
"%s: EOSP detected for node (" MAC_FMT ") on desc %p\n",
|
||||
__func__, MAC_ADDR(ni->ni_macaddr), ds);
|
||||
ATH_NODE_UAPSD_LOCK_IRQ(an);
|
||||
ni->ni_flags &= ~IEEE80211_NODE_UAPSD_SP;
|
||||
if ((an->an_uapsd_qdepth == 0) &&
|
||||
|
@ -8629,8 +8629,8 @@ ath_scan_start(struct ieee80211com *ic)
|
|||
ath_hal_setrxfilter(ah, rfilt);
|
||||
ath_hal_setassocid(ah, dev->broadcast, 0);
|
||||
|
||||
DPRINTF(sc, ATH_DEBUG_STATE, "%s: RX filter 0x%x bssid %s aid 0\n",
|
||||
__func__, rfilt, ether_sprintf(dev->broadcast));
|
||||
DPRINTF(sc, ATH_DEBUG_STATE, "%s: RX filter 0x%x bssid " MAC_FMT " aid 0\n",
|
||||
__func__, rfilt, MAC_ADDR(dev->broadcast));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -8646,8 +8646,8 @@ ath_scan_end(struct ieee80211com *ic)
|
|||
ath_hal_setrxfilter(ah, rfilt);
|
||||
ath_hal_setassocid(ah, sc->sc_curbssid, sc->sc_curaid);
|
||||
|
||||
DPRINTF(sc, ATH_DEBUG_STATE, "%s: RX filter 0x%x bssid %s aid 0x%x\n",
|
||||
__func__, rfilt, ether_sprintf(sc->sc_curbssid),
|
||||
DPRINTF(sc, ATH_DEBUG_STATE, "%s: RX filter 0x%x bssid " MAC_FMT " aid 0x%x\n",
|
||||
__func__, rfilt, MAC_ADDR(sc->sc_curbssid),
|
||||
sc->sc_curaid);
|
||||
}
|
||||
|
||||
|
@ -8765,8 +8765,8 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
|
|||
} else
|
||||
sc->sc_curaid = 0;
|
||||
|
||||
DPRINTF(sc, ATH_DEBUG_STATE, "%s: RX filter 0x%x bssid %s aid 0x%x\n",
|
||||
__func__, rfilt, ether_sprintf(sc->sc_curbssid),
|
||||
DPRINTF(sc, ATH_DEBUG_STATE, "%s: RX filter 0x%x bssid " MAC_FMT " aid 0x%x\n",
|
||||
__func__, rfilt, MAC_ADDR(sc->sc_curbssid),
|
||||
sc->sc_curaid);
|
||||
|
||||
ath_hal_setrxfilter(ah, rfilt);
|
||||
|
@ -8794,12 +8794,12 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
|
|||
/* nothing to do */;
|
||||
} else if (nstate == IEEE80211_S_RUN) {
|
||||
DPRINTF(sc, ATH_DEBUG_STATE,
|
||||
"%s(RUN): ic_flags=0x%08x iv=%d bssid=%s "
|
||||
"capinfo=0x%04x chan=%d\n",
|
||||
"%s(RUN): ic_flags=0x%08x iv=%d bssid=" MAC_FMT
|
||||
" capinfo=0x%04x chan=%d\n",
|
||||
__func__,
|
||||
vap->iv_flags,
|
||||
ni->ni_intval,
|
||||
ether_sprintf(ni->ni_bssid),
|
||||
MAC_ADDR(ni->ni_bssid),
|
||||
ni->ni_capinfo,
|
||||
ieee80211_chan2ieee(ic, ni->ni_chan));
|
||||
|
||||
|
|
|
@ -195,8 +195,8 @@ ath_rate_update(struct ath_softc *sc, struct ieee80211_node *ni, int rate)
|
|||
|
||||
KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode));
|
||||
|
||||
DPRINTF(sc, "%s: set xmit rate for %s to %dM\n",
|
||||
__func__, ether_sprintf(ni->ni_macaddr),
|
||||
DPRINTF(sc, "%s: set xmit rate for " MAC_FMT " to %dM\n",
|
||||
__func__, MAC_ADDR(ni->ni_macaddr),
|
||||
ni->ni_rates.rs_nrates > 0 ?
|
||||
(ni->ni_rates.rs_rates[rate] & IEEE80211_RATE_VAL) / 2 : 0);
|
||||
|
||||
|
|
|
@ -320,9 +320,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_node *an,
|
|||
int mrr;
|
||||
|
||||
if (sn->num_rates <= 0) {
|
||||
printk(KERN_WARNING "%s: no rates for %s?\n",
|
||||
printk(KERN_WARNING "%s: no rates for " MAC_FMT "?\n",
|
||||
dev_info,
|
||||
ether_sprintf(an->an_node.ni_macaddr));
|
||||
MAC_ADDR(an->an_node.ni_macaddr));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -374,9 +374,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_node *an,
|
|||
*try0 = sn->retry_adjusted_count[ndx];
|
||||
|
||||
KASSERT((ndx < sn->num_rates),
|
||||
("%s: bad ndx (%d/%d) for %s?\n",
|
||||
("%s: bad ndx (%d/%d) for " MAC_FMT "?\n",
|
||||
dev_info, ndx, sn->num_rates,
|
||||
ether_sprintf(an->an_node.ni_macaddr)));
|
||||
MAC_ADDR(an->an_node.ni_macaddr)));
|
||||
|
||||
*rix = sn->rates[ndx].rix;
|
||||
if (shortPreamble)
|
||||
|
@ -407,19 +407,19 @@ ath_rate_get_mrr(struct ath_softc *sc, struct ath_node *an, int shortPreamble,
|
|||
rc3 = 0;
|
||||
|
||||
KASSERT((rc1 >= 0) && (rc1 < sn->num_rates),
|
||||
("%s: bad rc1 (%d/%d) for %s?\n",
|
||||
("%s: bad rc1 (%d/%d) for " MAC_FMT "?\n",
|
||||
dev_info, rc1, sn->num_rates,
|
||||
ether_sprintf(an->an_node.ni_macaddr)));
|
||||
MAC_ADDR(an->an_node.ni_macaddr)));
|
||||
|
||||
KASSERT((rc2 >= 0) && (rc2 < sn->num_rates),
|
||||
("%s: bad rc2 (%d/%d) for %s?\n",
|
||||
("%s: bad rc2 (%d/%d) for " MAC_FMT "?\n",
|
||||
dev_info, rc2, sn->num_rates,
|
||||
ether_sprintf(an->an_node.ni_macaddr)));
|
||||
MAC_ADDR(an->an_node.ni_macaddr)));
|
||||
|
||||
KASSERT((rc3 >= 0) && (rc3 < sn->num_rates),
|
||||
("%s: bad rc3 (%d/%d) for %s?\n",
|
||||
("%s: bad rc3 (%d/%d) for " MAC_FMT "?\n",
|
||||
dev_info, rc3, sn->num_rates,
|
||||
ether_sprintf(an->an_node.ni_macaddr)));
|
||||
MAC_ADDR(an->an_node.ni_macaddr)));
|
||||
|
||||
if (shortPreamble) {
|
||||
mrr->rate1 = sn->rates[rc1].shortPreambleRateCode;
|
||||
|
@ -473,8 +473,8 @@ ath_rate_tx_complete(struct ath_softc *sc,
|
|||
tries = ts->ts_shortretry + ts->ts_longretry + 1;
|
||||
|
||||
if (sn->num_rates <= 0) {
|
||||
DPRINTF(sc, "%s: %s %s no rates yet\n", dev_info,
|
||||
ether_sprintf(an->an_node.ni_macaddr), __func__);
|
||||
DPRINTF(sc, "%s: " MAC_FMT " %s no rates yet\n", dev_info,
|
||||
MAC_ADDR(an->an_node.ni_macaddr), __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -536,8 +536,8 @@ ath_rate_tx_complete(struct ath_softc *sc,
|
|||
static void
|
||||
ath_rate_newassoc(struct ath_softc *sc, struct ath_node *an, int isnew)
|
||||
{
|
||||
DPRINTF(sc, "%s: %s %s\n", dev_info,
|
||||
ether_sprintf(an->an_node.ni_macaddr), __func__);
|
||||
DPRINTF(sc, "%s: " MAC_FMT " %s\n", dev_info,
|
||||
MAC_ADDR(an->an_node.ni_macaddr), __func__);
|
||||
if (isnew)
|
||||
ath_rate_ctl_reset(sc, &an->an_node);
|
||||
}
|
||||
|
@ -648,8 +648,8 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni)
|
|||
ni->ni_txrate = 0;
|
||||
|
||||
if (sn->num_rates <= 0) {
|
||||
DPRINTF(sc, "%s: %s %s no rates (fixed %d) \n",
|
||||
dev_info, __func__, ether_sprintf(ni->ni_macaddr),
|
||||
DPRINTF(sc, "%s: %s " MAC_FMT " no rates (fixed %d) \n",
|
||||
dev_info, __func__, MAC_ADDR(ni->ni_macaddr),
|
||||
vap->iv_fixed_rate);
|
||||
/* There are no rates yet; we're done */
|
||||
return;
|
||||
|
@ -671,8 +671,8 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni)
|
|||
|
||||
sn->static_rate_ndx = srate;
|
||||
ni->ni_txrate = srate;
|
||||
DPRINTF(sc, "%s: %s %s fixed rate %d%sMbps\n",
|
||||
dev_info, __func__, ether_sprintf(ni->ni_macaddr),
|
||||
DPRINTF(sc, "%s: %s " MAC_FMT " fixed rate %d%sMbps\n",
|
||||
dev_info, __func__, MAC_ADDR(ni->ni_macaddr),
|
||||
sn->rates[srate].rate / 2,
|
||||
(sn->rates[srate].rate % 2) ? ".5 " : " ");
|
||||
return;
|
||||
|
@ -933,7 +933,7 @@ ath_proc_read_nodes(struct ieee80211vap *vap, char *buf, int space)
|
|||
/* Assume each node needs 1500 bytes */
|
||||
if ((buf + space) < (p + 1500)) {
|
||||
if ((buf + space) > (p + 100)) {
|
||||
p += sprintf(p, "out of room for node %s\n\n", ether_sprintf(ni->ni_macaddr));
|
||||
p += sprintf(p, "out of room for node " MAC_FMT "\n\n", MAC_ADDR(ni->ni_macaddr));
|
||||
break;
|
||||
}
|
||||
DPRINTF(sc, "%s: out of memeory to write tall of the nodes\n", __func__);
|
||||
|
@ -945,7 +945,7 @@ ath_proc_read_nodes(struct ieee80211vap *vap, char *buf, int space)
|
|||
if (IEEE80211_ADDR_EQ(vap->iv_myaddr, ni->ni_macaddr))
|
||||
continue;
|
||||
|
||||
p += sprintf(p, "rate data for node:: %s\n", ether_sprintf(ni->ni_macaddr));
|
||||
p += sprintf(p, "rate data for node: " MAC_FMT "\n", MAC_ADDR(ni->ni_macaddr));
|
||||
p += sprintf(p, "rate throughput ewma prob this prob this succ/attempt success attempts\n");
|
||||
for (x = 0; x < odst->num_rates; x++) {
|
||||
p += sprintf(p, "%s",
|
||||
|
|
|
@ -184,8 +184,8 @@ ath_rate_update(struct ath_softc *sc, struct ieee80211_node *ni, int rate)
|
|||
|
||||
KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode));
|
||||
|
||||
DPRINTF(sc, "%s: set xmit rate for %s to %dM\n",
|
||||
__func__, ether_sprintf(ni->ni_macaddr),
|
||||
DPRINTF(sc, "%s: set xmit rate for " MAC_FMT " to %dM\n",
|
||||
__func__, MAC_ADDR(ni->ni_macaddr),
|
||||
ni->ni_rates.rs_nrates > 0 ?
|
||||
(ni->ni_rates.rs_rates[rate] & IEEE80211_RATE_VAL) / 2 : 0);
|
||||
|
||||
|
@ -362,8 +362,8 @@ ath_rate_ctl(void *arg, struct ieee80211_node *ni)
|
|||
on->on_tx_retr < (on->on_tx_ok * ath_rate_raise) / 100)
|
||||
dir = 1;
|
||||
|
||||
DPRINTF(sc, "%s: ok %d err %d retr %d upper %d dir %d\n",
|
||||
ether_sprintf(ni->ni_macaddr),
|
||||
DPRINTF(sc, MAC_FMT ": ok %d err %d retr %d upper %d dir %d\n",
|
||||
MAC_ADDR(ni->ni_macaddr),
|
||||
on->on_tx_ok, on->on_tx_err, on->on_tx_retr,
|
||||
on->on_tx_upper, dir);
|
||||
|
||||
|
|
|
@ -382,9 +382,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_node *an,
|
|||
unsigned average_tx_time;
|
||||
|
||||
if (sn->num_rates <= 0) {
|
||||
printk(KERN_WARNING "%s: no rates for %s?\n",
|
||||
printk(KERN_WARNING "%s: no rates for " MAC_FMT "?\n",
|
||||
dev_info,
|
||||
ether_sprintf(an->an_node.ni_macaddr));
|
||||
MAC_ADDR(an->an_node.ni_macaddr));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -459,9 +459,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_node *an,
|
|||
|
||||
if (change_rates) {
|
||||
if (best_ndx != sn->current_rate[size_bin]) {
|
||||
DPRINTF(sc, ATH_DEBUG_RATE, "%s: %s size %u switch rate %u (%u/%u) -> %u (%u/%u) after %u packets mrr %u\n",
|
||||
DPRINTF(sc, ATH_DEBUG_RATE, "%s: " MAC_FMT " size %u switch rate %u (%u/%u) -> %u (%u/%u) after %u packets mrr %u\n",
|
||||
dev_info,
|
||||
ether_sprintf(an->an_node.ni_macaddr),
|
||||
MAC_ADDR(an->an_node.ni_macaddr),
|
||||
packet_size_bins[size_bin],
|
||||
sn->rates[sn->current_rate[size_bin]].rate,
|
||||
sn->stats[size_bin][sn->current_rate[size_bin]].average_tx_time,
|
||||
|
@ -489,9 +489,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_node *an,
|
|||
}
|
||||
|
||||
KASSERT(ndx >= 0 && ndx < sn->num_rates,
|
||||
("%s: bad ndx (%u/%u) for %s?\n",
|
||||
("%s: bad ndx (%u/%u) for " MAC_FMT "?\n",
|
||||
dev_info, ndx, sn->num_rates,
|
||||
ether_sprintf(an->an_node.ni_macaddr)));
|
||||
MAC_ADDR(an->an_node.ni_macaddr)));
|
||||
|
||||
|
||||
*rix = sn->rates[ndx].rix;
|
||||
|
@ -638,8 +638,8 @@ update_stats(struct ath_softc *sc, struct ath_node *an,
|
|||
sn->stats[size_bin][ndx0].total_packets++;
|
||||
|
||||
if (ndx0 == sn->current_sample_ndx[size_bin]) {
|
||||
DPRINTF(sc, ATH_DEBUG_RATE, "%s: %s size %u sample rate %u tries (%u/%u) tt %u avg_tt (%u/%u) status %u\n",
|
||||
dev_info, ether_sprintf(an->an_node.ni_macaddr),
|
||||
DPRINTF(sc, ATH_DEBUG_RATE, "%s: " MAC_FMT " size %u sample rate %u tries (%u/%u) tt %u avg_tt (%u/%u) status %u\n",
|
||||
dev_info, MAC_ADDR(an->an_node.ni_macaddr),
|
||||
size, rate, short_tries, tries, tt,
|
||||
sn->stats[size_bin][ndx0].average_tx_time,
|
||||
sn->stats[size_bin][ndx0].perfect_tx_time,
|
||||
|
@ -672,8 +672,8 @@ ath_rate_tx_complete(struct ath_softc *sc,
|
|||
frame_size = 1500;
|
||||
|
||||
if (sn->num_rates <= 0) {
|
||||
DPRINTF(sc, ATH_DEBUG_RATE, "%s: %s %s no rates yet\n", dev_info,
|
||||
ether_sprintf(an->an_node.ni_macaddr), __func__);
|
||||
DPRINTF(sc, ATH_DEBUG_RATE, "%s: " MAC_FMT " %s no rates yet\n", dev_info,
|
||||
MAC_ADDR(an->an_node.ni_macaddr), __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -682,9 +682,9 @@ ath_rate_tx_complete(struct ath_softc *sc,
|
|||
|
||||
if (sc->sc_mrretry && ts->ts_status) {
|
||||
/* this packet failed */
|
||||
DPRINTF(sc, ATH_DEBUG_RATE, "%s: %s size %u rate/try %u/%u %u/%u %u/%u %u/%u status %s retries (%u/%u)\n",
|
||||
DPRINTF(sc, ATH_DEBUG_RATE, "%s: " MAC_FMT " size %u rate/try %u/%u %u/%u %u/%u %u/%u status %s retries (%u/%u)\n",
|
||||
dev_info,
|
||||
ether_sprintf(an->an_node.ni_macaddr),
|
||||
MAC_ADDR(an->an_node.ni_macaddr),
|
||||
bin_to_size(size_to_bin(frame_size)),
|
||||
sc->sc_hwmap[MS(ds->ds_ctl3, AR_XmitRate0)].ieeerate,
|
||||
MS(ds->ds_ctl2, AR_XmitDataTries0),
|
||||
|
@ -738,8 +738,8 @@ ath_rate_tx_complete(struct ath_softc *sc,
|
|||
ndx[3] = rate_to_ndx(sn, rate[3]);
|
||||
|
||||
#if 0
|
||||
DPRINTF(sc, "%s: %s size %u finaltsidx %u tries %u status %u rate/try %u/%u %u/%u %u/%u %u/%u\n",
|
||||
dev_info, ether_sprintf(an->an_node.ni_macaddr),
|
||||
DPRINTF(sc, "%s: " MAC_FMT " size %u finaltsidx %u tries %u status %u rate/try %u/%u %u/%u %u/%u %u/%u\n",
|
||||
dev_info, MAC_ADDR(an->an_node.ni_macaddr),
|
||||
bin_to_size(size_to_bin(frame_size)),
|
||||
finalTSIdx,
|
||||
long_tries,
|
||||
|
@ -806,8 +806,8 @@ ath_rate_tx_complete(struct ath_softc *sc,
|
|||
static void
|
||||
ath_rate_newassoc(struct ath_softc *sc, struct ath_node *an, int isnew)
|
||||
{
|
||||
DPRINTF(sc, ATH_DEBUG_RATE, "%s: %s %s isnew %d\n", dev_info,
|
||||
ether_sprintf(an->an_node.ni_macaddr), __func__, isnew);
|
||||
DPRINTF(sc, ATH_DEBUG_RATE, "%s: " MAC_FMT " %s isnew %d\n", dev_info,
|
||||
MAC_ADDR(an->an_node.ni_macaddr), __func__, isnew);
|
||||
if (isnew)
|
||||
ath_rate_ctl_reset(sc, &an->an_node);
|
||||
}
|
||||
|
@ -852,8 +852,8 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni)
|
|||
sn->num_rates = ni->ni_rates.rs_nrates;
|
||||
|
||||
if (sn->num_rates <= 0) {
|
||||
DPRINTF(sc, ATH_DEBUG_RATE,"%s: %s %s no rates (fixed %u) \n",
|
||||
dev_info, __func__, ether_sprintf(ni->ni_macaddr),
|
||||
DPRINTF(sc, ATH_DEBUG_RATE,"%s: %s " MAC_FMT " no rates (fixed %u) \n",
|
||||
dev_info, __func__, MAC_ADDR(ni->ni_macaddr),
|
||||
vap->iv_fixed_rate);
|
||||
/* there are no rates yet we're done */
|
||||
return;
|
||||
|
@ -877,8 +877,8 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni)
|
|||
|
||||
sn->static_rate_ndx = srate;
|
||||
ni->ni_txrate = srate;
|
||||
DPRINTF(sc, ATH_DEBUG_RATE, "%s: %s %s fixed rate %u%sMbps\n",
|
||||
dev_info, __func__, ether_sprintf(ni->ni_macaddr),
|
||||
DPRINTF(sc, ATH_DEBUG_RATE, "%s: %s " MAC_FMT " fixed rate %u%sMbps\n",
|
||||
dev_info, __func__, MAC_ADDR(ni->ni_macaddr),
|
||||
sn->rates[srate].rate / 2,
|
||||
(sn->rates[srate].rate % 0x1) ? ".5" : " ");
|
||||
return;
|
||||
|
@ -920,8 +920,9 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni)
|
|||
sn->current_rate[y] = ndx;
|
||||
}
|
||||
|
||||
DPRINTF(sc, ATH_DEBUG_RATE, "%s: %s %s %u rates %u%sMbps (%uus)- %u%sMbps (%uus)\n",
|
||||
dev_info, __func__, ether_sprintf(ni->ni_macaddr),
|
||||
DPRINTF(sc, ATH_DEBUG_RATE, "%s: %s " MAC_FMT
|
||||
" %u rates %u%sMbps (%uus)- %u%sMbps (%uus)\n",
|
||||
dev_info, __func__, MAC_ADDR(ni->ni_macaddr),
|
||||
sn->num_rates,
|
||||
sn->rates[0].rate / 2, sn->rates[0].rate % 0x1 ? ".5" : "",
|
||||
sn->stats[1][0].perfect_tx_time,
|
||||
|
@ -1012,7 +1013,7 @@ proc_read_nodes(struct ieee80211vap *vap, const int size, char *buf, int space)
|
|||
}
|
||||
|
||||
size_bin = size_to_bin(size);
|
||||
p += sprintf(p, "%s\n", ether_sprintf(ni->ni_macaddr));
|
||||
p += sprintf(p, MAC_FMT "\n", MAC_ADDR(ni->ni_macaddr));
|
||||
p += sprintf(p,
|
||||
"rate\ttt\tperfect\tfailed\tpkts\tavg_tries\tlast_tx\n");
|
||||
for (ndx = 0; ndx < sn->num_rates; ndx++) {
|
||||
|
|
|
@ -171,7 +171,7 @@ acl_add(struct ieee80211vap *vap, const u_int8_t mac[IEEE80211_ADDR_LEN])
|
|||
MALLOC(new, struct acl *, sizeof(struct acl), M_80211_ACL, M_NOWAIT | M_ZERO);
|
||||
if (new == NULL) {
|
||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_ACL,
|
||||
"ACL: add %s failed, no memory\n", ether_sprintf(mac));
|
||||
"ACL: add " MAC_FMT " failed, no memory\n", MAC_ADDR(mac));
|
||||
/* XXX statistic */
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
@ -183,8 +183,8 @@ acl_add(struct ieee80211vap *vap, const u_int8_t mac[IEEE80211_ADDR_LEN])
|
|||
ACL_UNLOCK_EARLY(as);
|
||||
FREE(new, M_80211_ACL);
|
||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_ACL,
|
||||
"ACL: add %s failed, already present\n",
|
||||
ether_sprintf(mac));
|
||||
"ACL: add " MAC_FMT " failed, already present\n",
|
||||
MAC_ADDR(mac));
|
||||
return -EEXIST;
|
||||
}
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ acl_add(struct ieee80211vap *vap, const u_int8_t mac[IEEE80211_ADDR_LEN])
|
|||
ACL_UNLOCK(as);
|
||||
|
||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_ACL,
|
||||
"ACL: add %s\n", ether_sprintf(mac));
|
||||
"ACL: add " MAC_FMT "\n", MAC_ADDR(mac));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ acl_remove(struct ieee80211vap *vap, const u_int8_t mac[IEEE80211_ADDR_LEN])
|
|||
ACL_UNLOCK(as);
|
||||
|
||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_ACL,
|
||||
"ACL: remove %s%s\n", ether_sprintf(mac),
|
||||
"ACL: remove " MAC_FMT "%s\n", MAC_ADDR(mac),
|
||||
acl == NULL ? ", not present" : "");
|
||||
|
||||
return (acl == NULL ? ENOENT : 0);
|
||||
|
|
|
@ -524,9 +524,9 @@ ieee80211_crypto_setkey(struct ieee80211vap *vap, struct ieee80211_key *key,
|
|||
KASSERT(cip != NULL, ("No cipher!"));
|
||||
|
||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO,
|
||||
"%s: %s keyix %u flags 0x%x mac %s tsc %llu len %u\n", __func__,
|
||||
"%s: %s keyix %u flags 0x%x mac " MAC_FMT " tsc %llu len %u\n", __func__,
|
||||
cip->ic_name, key->wk_keyix, key->wk_flags,
|
||||
ether_sprintf(macaddr), (unsigned long long)key->wk_keytsc,
|
||||
MAC_ADDR(macaddr), (unsigned long long)key->wk_keytsc,
|
||||
key->wk_keylen);
|
||||
|
||||
/*
|
||||
|
|
|
@ -1037,8 +1037,8 @@ tkip_decrypt(struct tkip_ctx *ctx, struct ieee80211_key *key,
|
|||
ctx->rx_phase1_done = 0;
|
||||
}
|
||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO,
|
||||
"[%s] TKIP ICV mismatch on decrypt (keyix %d, rsc %llu)\n",
|
||||
ether_sprintf(wh->i_addr2), key->wk_keyix,
|
||||
"[" MAC_FMT "] TKIP ICV mismatch on decrypt (keyix %d, rsc %llu)\n",
|
||||
MAC_ADDR(wh->i_addr2), key->wk_keyix,
|
||||
(unsigned long long)ctx->rx_rsc);
|
||||
vap->iv_stats.is_rx_tkipicv++;
|
||||
return 0;
|
||||
|
|
|
@ -156,10 +156,10 @@ iwspy_event(struct ieee80211vap *vap, struct ieee80211_node *ni, u_int rssi)
|
|||
union iwreq_data wrq;
|
||||
struct iw_thrspy thr;
|
||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG,
|
||||
"%s: we spy %s, threshold is active "
|
||||
"and rssi exceeds it -> raise an iwspy"
|
||||
" event\n", __func__, ether_sprintf(
|
||||
ni->ni_macaddr));
|
||||
"%s: we spy " MAC_FMT
|
||||
", threshold is active and rssi exceeds"
|
||||
" it -> raise an iwspy event\n",
|
||||
__func__, MAC_ADDR(ni->ni_macaddr));
|
||||
memset(&wrq, 0, sizeof(wrq));
|
||||
wrq.data.length = 1;
|
||||
memset(&thr, 0, sizeof(struct iw_thrspy));
|
||||
|
@ -794,10 +794,11 @@ ieee80211_input(struct ieee80211_node *ni,
|
|||
#ifdef IEEE80211_DEBUG
|
||||
if ((ieee80211_msg_debug(vap) && doprint(vap, subtype)) ||
|
||||
ieee80211_msg_dumppkts(vap)) {
|
||||
ieee80211_note(vap, "received %s from %s rssi %d\n",
|
||||
ieee80211_note(vap,
|
||||
"received %s from " MAC_FMT " rssi %d\n",
|
||||
ieee80211_mgt_subtype_name[subtype >>
|
||||
IEEE80211_FC0_SUBTYPE_SHIFT],
|
||||
ether_sprintf(wh->i_addr2), rssi);
|
||||
MAC_ADDR(wh->i_addr2), rssi);
|
||||
}
|
||||
#endif
|
||||
if (wh->i_fc[1] & IEEE80211_FC1_PROT) {
|
||||
|
@ -1705,8 +1706,8 @@ static void
|
|||
ieee80211_ssid_mismatch(struct ieee80211vap *vap, const char *tag,
|
||||
u_int8_t mac[IEEE80211_ADDR_LEN], u_int8_t *ssid)
|
||||
{
|
||||
printf("[%s] discard %s frame, ssid mismatch: ",
|
||||
ether_sprintf(mac), tag);
|
||||
printf("[" MAC_FMT "] discard %s frame, ssid mismatch: ",
|
||||
MAC_ADDR(mac), tag);
|
||||
ieee80211_print_essid(ssid + 2, ssid[1]);
|
||||
printf("\n");
|
||||
}
|
||||
|
@ -3322,8 +3323,8 @@ ieee80211_recv_mgmt(struct ieee80211_node *ni, struct sk_buff *skb,
|
|||
else
|
||||
IEEE80211_DPRINTF(vap,
|
||||
IEEE80211_MSG_ASSOC | IEEE80211_MSG_WPA,
|
||||
"[%s] ignoring RSN IE in association request\n",
|
||||
ether_sprintf(wh->i_addr2));
|
||||
"[" MAC_FMT "] ignoring RSN IE in association request\n",
|
||||
MAC_ADDR(wh->i_addr2));
|
||||
break;
|
||||
case IEEE80211_ELEMID_VENDOR:
|
||||
/* NB: Provide all IEs for wpa_supplicant, so
|
||||
|
@ -3334,8 +3335,8 @@ ieee80211_recv_mgmt(struct ieee80211_node *ni, struct sk_buff *skb,
|
|||
else
|
||||
IEEE80211_DPRINTF(vap,
|
||||
IEEE80211_MSG_ASSOC | IEEE80211_MSG_WPA,
|
||||
"[%s] ignoring WPA IE in association request\n",
|
||||
ether_sprintf(wh->i_addr2));
|
||||
"[" MAC_FMT "] ignoring WPA IE in association request\n",
|
||||
MAC_ADDR(wh->i_addr2));
|
||||
} else if (iswmeinfo(frm))
|
||||
wme = frm;
|
||||
else if (isatherosoui(frm))
|
||||
|
@ -3367,8 +3368,8 @@ ieee80211_recv_mgmt(struct ieee80211_node *ni, struct sk_buff *skb,
|
|||
if (wpa == NULL && (ic->ic_flags & IEEE80211_F_WPA)) {
|
||||
IEEE80211_DPRINTF(vap,
|
||||
IEEE80211_MSG_ASSOC | IEEE80211_MSG_WPA,
|
||||
"[%s] no WPA/RSN IE in association request\n",
|
||||
ether_sprintf(wh->i_addr2));
|
||||
"[" MAC_FMT "] no WPA/RSN IE in association request\n",
|
||||
MAC_ADDR(wh->i_addr2));
|
||||
IEEE80211_SEND_MGMT(ni,
|
||||
IEEE80211_FC0_SUBTYPE_DEAUTH,
|
||||
IEEE80211_REASON_RSN_REQUIRED);
|
||||
|
|
|
@ -291,9 +291,9 @@ ieee80211_notify_sta_stats(struct ieee80211_node *ni)
|
|||
union iwreq_data wreq;
|
||||
char buf[1024];
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s\nmac=%s\nrx_packets=%u\nrx_bytes=%llu\n"
|
||||
snprintf(buf, sizeof(buf), "%s\nmac=" MAC_FMT "\nrx_packets=%u\nrx_bytes=%llu\n"
|
||||
"tx_packets=%u\ntx_bytes=%llu\n", tag,
|
||||
ether_sprintf(ni->ni_macaddr), ni->ni_stats.ns_rx_data,
|
||||
MAC_ADDR(ni->ni_macaddr), ni->ni_stats.ns_rx_data,
|
||||
(unsigned long long)ni->ni_stats.ns_rx_bytes,
|
||||
ni->ni_stats.ns_tx_data,
|
||||
(unsigned long long)ni->ni_stats.ns_tx_bytes);
|
||||
|
@ -332,10 +332,10 @@ ieee80211_notify_replay_failure(struct ieee80211vap *vap,
|
|||
(unsigned long long)rsc);
|
||||
|
||||
/* TODO: needed parameters: count, keyid, key type, src address, TSC */
|
||||
snprintf(buf, sizeof(buf), "%s(keyid=%d %scast addr=%s)", tag,
|
||||
snprintf(buf, sizeof(buf), "%s(keyid=%d %scast addr=" MAC_FMT ")", tag,
|
||||
k->wk_keyix,
|
||||
IEEE80211_IS_MULTICAST(wh->i_addr1) ? "broad" : "uni",
|
||||
ether_sprintf(wh->i_addr1));
|
||||
MAC_ADDR(wh->i_addr1));
|
||||
memset(&wrqu, 0, sizeof(wrqu));
|
||||
wrqu.data.length = strlen(buf);
|
||||
wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf);
|
||||
|
@ -356,9 +356,9 @@ ieee80211_notify_michael_failure(struct ieee80211vap *vap,
|
|||
vap->iv_stats.is_rx_tkipmic++;
|
||||
|
||||
/* TODO: needed parameters: count, keyid, key type, src address, TSC */
|
||||
snprintf(buf, sizeof(buf), "%s(keyid=%d %scast addr=%s)", tag,
|
||||
snprintf(buf, sizeof(buf), "%s(keyid=%d %scast addr=" MAC_FMT ")", tag,
|
||||
keyix, IEEE80211_IS_MULTICAST(wh->i_addr2) ? "broad" : "uni",
|
||||
ether_sprintf(wh->i_addr2));
|
||||
MAC_ADDR(wh->i_addr2));
|
||||
memset(&wrqu, 0, sizeof(wrqu));
|
||||
wrqu.data.length = strlen(buf);
|
||||
wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf);
|
||||
|
@ -414,7 +414,7 @@ proc_read_nodes(struct ieee80211vap *vap, char *buf, int space)
|
|||
0 != memcmp(vap->iv_myaddr, ni->ni_macaddr, IEEE80211_ADDR_LEN)) {
|
||||
struct timespec t;
|
||||
jiffies_to_timespec(jiffies - ni->ni_last_rx, &t);
|
||||
p += sprintf(p, "macaddr: <%s>\n", ether_sprintf(ni->ni_macaddr));
|
||||
p += sprintf(p, "macaddr: <" MAC_FMT ">\n", MAC_ADDR(ni->ni_macaddr));
|
||||
p += sprintf(p, " rssi %d\n", ni->ni_rssi);
|
||||
|
||||
p += sprintf(p, " last_rx %ld.%06ld\n",
|
||||
|
@ -947,19 +947,6 @@ ieee80211_virtfs_vdetach(struct ieee80211vap *vap)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Format an Ethernet MAC for printing.
|
||||
*/
|
||||
const char*
|
||||
ether_sprintf(const u_int8_t *mac)
|
||||
{
|
||||
static char etherbuf[18]; /* XXX */
|
||||
snprintf(etherbuf, sizeof(etherbuf), "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
|
||||
return etherbuf;
|
||||
}
|
||||
EXPORT_SYMBOL(ether_sprintf); /* XXX */
|
||||
|
||||
/* Function to handle the device event notifications.
|
||||
* If the event is a NETDEV_CHANGENAME, and is for an interface
|
||||
* we are taking care of, then we want to remove its existing
|
||||
|
|
|
@ -472,7 +472,6 @@ ieee80211_malloc(size_t size, int flags)
|
|||
#define printf(...) printk(__VA_ARGS__)
|
||||
struct ieee80211com;
|
||||
extern void if_printf(struct net_device *, const char *, ...);
|
||||
extern const char *ether_sprintf(const u_int8_t *);
|
||||
|
||||
/*
|
||||
* Queue write-arounds and support routines.
|
||||
|
|
|
@ -518,8 +518,8 @@ check_bss_debug(struct ieee80211vap *vap, struct ieee80211_node *ni)
|
|||
!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(" %c " MAC_FMT, fail ? '-' : '+', MAC_ADDR(ni->ni_macaddr));
|
||||
printf(" " MAC_FMT "%c", MAC_ADDR(ni->ni_bssid), fail & 0x20 ? '!' : ' ');
|
||||
printf(" %3d%c",
|
||||
ieee80211_chan2ieee(ic, ni->ni_chan), fail & 0x01 ? '!' : ' ');
|
||||
printf(" %+4d", ni->ni_rssi);
|
||||
|
@ -580,8 +580,8 @@ ieee80211_ibss_merge(struct ieee80211_node *ni)
|
|||
return 0;
|
||||
}
|
||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC,
|
||||
"%s: new bssid %s: %s preamble, %s slot time%s\n", __func__,
|
||||
ether_sprintf(ni->ni_bssid),
|
||||
"%s: new bssid " MAC_FMT ": %s preamble, %s slot time%s\n", __func__,
|
||||
MAC_ADDR(ni->ni_bssid),
|
||||
ic->ic_flags & IEEE80211_F_SHPREAMBLE ? "short" : "long",
|
||||
ic->ic_flags & IEEE80211_F_SHSLOT ? "short" : "long",
|
||||
ic->ic_flags & IEEE80211_F_USEPROT ? ", protection" : "");
|
||||
|
@ -692,8 +692,8 @@ ieee80211_sta_join(struct ieee80211vap *vap,
|
|||
__func__, ni, MAC_ADDR(se->se_macaddr));
|
||||
if (ni == NULL) {
|
||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE,
|
||||
"%s: Unable to allocate node for BSS: %s\n", __func__,
|
||||
ether_sprintf(ni->ni_macaddr));
|
||||
"%s: Unable to allocate node for BSS: " MAC_FMT "\n", __func__,
|
||||
MAC_ADDR(ni->ni_macaddr));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -948,9 +948,9 @@ static void node_print_message(
|
|||
va_start(args, message);
|
||||
vsnprintf(expanded_message, sizeof(expanded_message), message, args);
|
||||
#ifdef IEEE80211_DEBUG_REFCNT
|
||||
printk("%s/%s: %s%s:%d -> %s:%d %s [node %p<%s>%s%s%s%s, refs=%02d]\n",
|
||||
printk("%s/%s: %s%s:%d -> %s:%d %s [node %p<" MAC_FMT ">%s%s%s%s, refs=%02d]\n",
|
||||
#else
|
||||
printk("%s/%s: %s%s:%d %s [node %p<%s>%s%s%s%s, refs=%02d]\n",
|
||||
printk("%s/%s: %s%s:%d %s [node %p<" MAC_FMT ">%s%s%s%s, refs=%02d]\n",
|
||||
#endif /* #ifdef IEEE80211_DEBUG_REFCNT */
|
||||
ni->ni_ic->ic_dev->name,
|
||||
ni->ni_vap->iv_dev->name,
|
||||
|
@ -960,7 +960,7 @@ static void node_print_message(
|
|||
#endif /* #ifdef IEEE80211_DEBUG_REFCNT */
|
||||
func2, line2,
|
||||
expanded_message,
|
||||
ni, ether_sprintf(ni->ni_macaddr),
|
||||
ni, MAC_ADDR(ni->ni_macaddr),
|
||||
ni->ni_table != NULL ? " in " : "",
|
||||
ni->ni_table != NULL ? ni->ni_table->nt_name : "",
|
||||
ni->ni_table != NULL ? " table" : "",
|
||||
|
@ -1051,7 +1051,7 @@ ieee80211_alloc_node_table(struct ieee80211vap *vap,
|
|||
IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt);
|
||||
}
|
||||
else {
|
||||
printk("Failed to allocate node for %s.\n", ether_sprintf(macaddr));
|
||||
printk("Failed to allocate node for " MAC_FMT ".\n", MAC_ADDR(macaddr));
|
||||
}
|
||||
|
||||
return ni;
|
||||
|
@ -1904,8 +1904,8 @@ ieee80211_dump_node(struct ieee80211_node_table *nt, struct ieee80211_node *ni)
|
|||
{
|
||||
int i;
|
||||
|
||||
printf("0x%p: mac %s (refcnt %d)\n", ni,
|
||||
ether_sprintf(ni->ni_macaddr), atomic_read(&ni->ni_refcnt));
|
||||
printf("0x%p: mac " MAC_FMT " (refcnt %d)\n", ni,
|
||||
MAC_ADDR(ni->ni_macaddr), atomic_read(&ni->ni_refcnt));
|
||||
printf("\tscangen %u authmode %u flags 0x%x\n",
|
||||
ni->ni_scangen, ni->ni_authmode, ni->ni_flags);
|
||||
printf("\tassocid 0x%x txpower %u vlan %u\n",
|
||||
|
@ -1919,8 +1919,8 @@ ieee80211_dump_node(struct ieee80211_node_table *nt, struct ieee80211_node *ni)
|
|||
}
|
||||
printf("\trtsf %10llu rssi %u intval %u capinfo 0x%x\n",
|
||||
ni->ni_rtsf, ni->ni_rssi, ni->ni_intval, ni->ni_capinfo);
|
||||
printf("\tbssid %s essid \"%.*s\" channel %u:0x%x\n",
|
||||
ether_sprintf(ni->ni_bssid),
|
||||
printf("\tbssid " MAC_FMT " essid \"%.*s\" channel %u:0x%x\n",
|
||||
MAC_ADDR(ni->ni_bssid),
|
||||
ni->ni_esslen, ni->ni_essid,
|
||||
ni->ni_chan != IEEE80211_CHAN_ANYC ?
|
||||
ni->ni_chan->ic_freq : IEEE80211_CHAN_ANY,
|
||||
|
|
|
@ -430,8 +430,8 @@ ieee80211_mgmt_output(struct ieee80211_node *ni, struct sk_buff *skb, int type)
|
|||
/* avoid printing too many frames */
|
||||
if ((ieee80211_msg_debug(vap) && doprint(vap, type)) ||
|
||||
ieee80211_msg_dumppkts(vap)) {
|
||||
printf("[%s] send %s on channel %u\n",
|
||||
ether_sprintf(wh->i_addr1),
|
||||
printf("[" MAC_FMT "] send %s on channel %u\n",
|
||||
MAC_ADDR(wh->i_addr1),
|
||||
ieee80211_mgt_subtype_name[
|
||||
(type & IEEE80211_FC0_SUBTYPE_MASK) >>
|
||||
IEEE80211_FC0_SUBTYPE_SHIFT],
|
||||
|
@ -479,8 +479,8 @@ ieee80211_send_nulldata(struct ieee80211_node *ni)
|
|||
IEEE80211_NODE_STAT(ni, tx_data);
|
||||
|
||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG | IEEE80211_MSG_DUMPPKTS,
|
||||
"[%s] send null data frame on channel %u, pwr mgt %s\n",
|
||||
ether_sprintf(ni->ni_macaddr),
|
||||
"[" MAC_FMT "] send null data frame on channel %u, pwr mgt %s\n",
|
||||
MAC_ADDR(ni->ni_macaddr),
|
||||
ieee80211_chan2ieee(ic, ic->ic_curchan),
|
||||
wh->i_fc[1] & IEEE80211_FC1_PWR_MGT ? "ena" : "dis");
|
||||
|
||||
|
@ -1740,8 +1740,8 @@ ieee80211_send_probereq(struct ieee80211_node *ni,
|
|||
IEEE80211_NODE_STAT(ni, tx_mgmt);
|
||||
|
||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG | IEEE80211_MSG_DUMPPKTS,
|
||||
"[%s] send probe req on channel %u\n",
|
||||
ether_sprintf(wh->i_addr1),
|
||||
"[" MAC_FMT "] send probe req on channel %u\n",
|
||||
MAC_ADDR(wh->i_addr1),
|
||||
ieee80211_chan2ieee(ic, ic->ic_curchan));
|
||||
|
||||
(void)ic->ic_mgtstart(ic, skb);
|
||||
|
|
|
@ -321,25 +321,25 @@ ieee80211_dump_pkt(struct ieee80211com *ic,
|
|||
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));
|
||||
printf("NODS " MAC_FMT, MAC_ADDR(wh->i_addr2));
|
||||
printf("->" MAC_FMT, MAC_ADDR(wh->i_addr1));
|
||||
printf("(" MAC_FMT ")", MAC_ADDR(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));
|
||||
printf("TODS " MAC_FMT, MAC_ADDR(wh->i_addr2));
|
||||
printf("->" MAC_FMT, MAC_ADDR(wh->i_addr3));
|
||||
printf("(" MAC_FMT ")", MAC_ADDR(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));
|
||||
printf("FRDS " MAC_FMT, MAC_ADDR(wh->i_addr3));
|
||||
printf("->" MAC_FMT, MAC_ADDR(wh->i_addr1));
|
||||
printf("(" MAC_FMT ")", MAC_ADDR(wh->i_addr2));
|
||||
break;
|
||||
case IEEE80211_FC1_DIR_DSTODS:
|
||||
printf("DSDS %s", ether_sprintf((u_int8_t *)&wh[1]));
|
||||
printf("->%s", ether_sprintf(wh->i_addr3));
|
||||
printf("(%s", ether_sprintf(wh->i_addr2));
|
||||
printf("->%s)", ether_sprintf(wh->i_addr1));
|
||||
printf("DSDS " MAC_FMT, MAC_ADDR((u_int8_t *)&wh[1]));
|
||||
printf("->" MAC_FMT, MAC_ADDR(wh->i_addr3));
|
||||
printf("(" MAC_FMT, MAC_ADDR(wh->i_addr2));
|
||||
printf("->" MAC_FMT ")", MAC_ADDR(wh->i_addr1));
|
||||
break;
|
||||
}
|
||||
switch (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) {
|
||||
|
@ -1537,9 +1537,9 @@ __ieee80211_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int
|
|||
IEEE80211_MSG_NODE,
|
||||
"%s: Unable to "
|
||||
"allocate node for "
|
||||
"WDS: %s\n",
|
||||
"WDS: " MAC_FMT "\n",
|
||||
__func__,
|
||||
ether_sprintf(
|
||||
MAC_ADDR(
|
||||
vap->wds_mac)
|
||||
);
|
||||
}
|
||||
|
@ -1572,10 +1572,10 @@ __ieee80211_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int
|
|||
ni->ni_txrate));
|
||||
#ifdef IEEE80211_DEBUG
|
||||
if (ieee80211_msg_debug(vap)) {
|
||||
ieee80211_note(vap, "%s with %s ssid ",
|
||||
ieee80211_note(vap, "%s with " MAC_FMT " ssid ",
|
||||
(vap->iv_opmode == IEEE80211_M_STA ?
|
||||
"associated" : "synchronized "),
|
||||
ether_sprintf(ni->ni_bssid));
|
||||
MAC_ADDR(ni->ni_bssid));
|
||||
ieee80211_print_essid(vap->iv_bss->ni_essid,
|
||||
ni->ni_esslen);
|
||||
printf(" channel %d start %uMb\n",
|
||||
|
|
|
@ -799,16 +799,16 @@ dump_probe_beacon(u_int8_t subtype, int isnew,
|
|||
const struct ieee80211_scanparams *sp)
|
||||
{
|
||||
|
||||
printf("[%s] %s%s on chan %u (bss chan %u) ",
|
||||
ether_sprintf(mac), isnew ? "new " : "",
|
||||
printf("[" MAC_FMT "] %s%s on chan %u (bss chan %u) ",
|
||||
MAC_ADDR(mac), isnew ? "new " : "",
|
||||
ieee80211_mgt_subtype_name[subtype >> IEEE80211_FC0_SUBTYPE_SHIFT],
|
||||
sp->chan, sp->bchan);
|
||||
ieee80211_print_essid(sp->ssid + 2, sp->ssid[1]);
|
||||
printf("\n");
|
||||
|
||||
if (isnew) {
|
||||
printf("[%s] caps 0x%x bintval %u erp 0x%x",
|
||||
ether_sprintf(mac), sp->capinfo, sp->bintval, sp->erp);
|
||||
printf("[" MAC_FMT "] caps 0x%x bintval %u erp 0x%x",
|
||||
MAC_ADDR(mac), sp->capinfo, sp->bintval, sp->erp);
|
||||
if (sp->country != NULL) {
|
||||
#ifdef __FreeBSD__
|
||||
printf(" country info %*D",
|
||||
|
|
|
@ -791,10 +791,10 @@ match_bss(struct ieee80211vap *vap,
|
|||
#ifdef IEEE80211_DEBUG
|
||||
if (ieee80211_msg_is_reported(vap, IEEE80211_MSG_SCAN | IEEE80211_MSG_ROAM)) {
|
||||
printf(" %03x", fail);
|
||||
printf(" %c %s",
|
||||
printf(" %c " MAC_FMT,
|
||||
fail & 0x40 ? '=' : fail & 0x80 ? '^' : fail ? '-' : '+',
|
||||
ether_sprintf(se->se_macaddr));
|
||||
printf(" %s%c", ether_sprintf(se->se_bssid),
|
||||
MAC_ADDR(se->se_macaddr));
|
||||
printf(" " MAC_FMT "%c", MAC_ADDR(se->se_bssid),
|
||||
fail & 0x20 ? '!' : ' ');
|
||||
printf(" %3d%c", ieee80211_chan2ieee(ic, se->se_chan),
|
||||
fail & 0x01 ? '!' : ' ');
|
||||
|
|
|
@ -200,10 +200,10 @@ static void skb_destructor(struct sk_buff* skb) {
|
|||
/* Report any node reference leaks - caused by kernel net device queue
|
||||
* dropping buffer, rather than passing it to the driver. */
|
||||
if (SKB_CB(skb)->ni != NULL) {
|
||||
printk(KERN_ERR "%s:%d - ERROR: non-NULL node pointer in %p, %p<%s>! "
|
||||
printk(KERN_ERR "%s:%d - ERROR: non-NULL node pointer in %p, %p<" MAC_FMT ">! "
|
||||
"Leak Detected!\n",
|
||||
__func__, __LINE__,
|
||||
skb, SKB_CB(skb)->ni, ether_sprintf(SKB_CB(skb)->ni->ni_macaddr));
|
||||
skb, SKB_CB(skb)->ni, MAC_ADDR(SKB_CB(skb)->ni->ni_macaddr));
|
||||
dump_stack();
|
||||
}
|
||||
if (SKB_CB(skb)->next_destructor != NULL) {
|
||||
|
@ -217,20 +217,31 @@ static void get_skb_description(char *dst, int dst_size, const char* label, cons
|
|||
dst[0] = '\0';
|
||||
if (NULL != skb) {
|
||||
int adj_users = atomic_read(&skb->users) + users_adjustment;
|
||||
snprintf(dst, dst_size,
|
||||
" [%s%s%p,users=%d,node=%p%s%s%s,aid=%d%s%s]",
|
||||
label,
|
||||
(label != NULL ? ": " : ""),
|
||||
skb,
|
||||
adj_users,
|
||||
(SKB_CB(skb)->ni ? SKB_CB(skb)->ni : NULL),
|
||||
(SKB_CB(skb)->ni ? "<" : ""),
|
||||
(SKB_CB(skb)->ni ? ether_sprintf(SKB_CB(skb)->ni->ni_macaddr) : ""),
|
||||
(SKB_CB(skb)->ni ? ">" : ""),
|
||||
(SKB_CB(skb)->ni ? SKB_CB(skb)->ni->ni_associd : -1),
|
||||
((adj_users < 0) ? " ** CORRUPTED **" : ""),
|
||||
((adj_users == 0) ? " ** RELEASED **" : "")
|
||||
);
|
||||
if (SKB_CB(skb)->ni != NULL) {
|
||||
snprintf(dst, dst_size,
|
||||
" [%s%s%p,users=%d,node=%p<" MAC_FMT ">,aid=%d%s%s]",
|
||||
label,
|
||||
(label != NULL ? ": " : ""),
|
||||
skb,
|
||||
adj_users,
|
||||
SKB_CB(skb)->ni,
|
||||
MAC_ADDR(SKB_CB(skb)->ni->ni_macaddr),
|
||||
SKB_CB(skb)->ni->ni_associd,
|
||||
((adj_users < 0) ? " ** CORRUPTED **" : ""),
|
||||
((adj_users == 0) ? " ** RELEASED **" : "")
|
||||
);
|
||||
}
|
||||
else {
|
||||
snprintf(dst, dst_size,
|
||||
" [%s%s%p,users=%d,node=NULL,aid=N/A%s%s]",
|
||||
label,
|
||||
(label != NULL ? ": " : ""),
|
||||
skb,
|
||||
adj_users,
|
||||
((adj_users < 0) ? " ** CORRUPTED **" : ""),
|
||||
((adj_users == 0) ? " ** RELEASED **" : "")
|
||||
);
|
||||
}
|
||||
dst[dst_size-1] = '\0';
|
||||
}
|
||||
}
|
||||
|
@ -395,10 +406,10 @@ unref_skb(struct sk_buff *skb, int type,
|
|||
}
|
||||
else {
|
||||
if (SKB_CB(skb)->ni != NULL) {
|
||||
printk(KERN_ERR "%s:%d - ERROR: non-NULL node pointer in %p, %p<%s>! "
|
||||
printk(KERN_ERR "%s:%d - ERROR: non-NULL node pointer in %p, %p<" MAC_FMT ">! "
|
||||
"Driver Leak Detected!\n",
|
||||
__func__, __LINE__,
|
||||
skb, SKB_CB(skb)->ni, ether_sprintf(SKB_CB(skb)->ni->ni_macaddr));
|
||||
skb, SKB_CB(skb)->ni, MAC_ADDR(SKB_CB(skb)->ni->ni_macaddr));
|
||||
dump_stack();
|
||||
/* Allow the leak and let programmer fix it, but do not
|
||||
* report it again in the destructor. */
|
||||
|
|
|
@ -3594,8 +3594,8 @@ ieee80211_ioctl_wdsmac(struct net_device *dev, struct iw_request_info *info,
|
|||
struct sockaddr *sa = (struct sockaddr *)extra;
|
||||
|
||||
if (!IEEE80211_ADDR_NULL(vap->wds_mac)) {
|
||||
printk("%s: Failed to add WDS MAC: %s\n", dev->name,
|
||||
ether_sprintf(sa->sa_data));
|
||||
printk("%s: Failed to add WDS MAC: " MAC_FMT "\n", dev->name,
|
||||
MAC_ADDR(sa->sa_data));
|
||||
printk("%s: Device already has WDS mac address attached,"
|
||||
" remove first\n", dev->name);
|
||||
return -1;
|
||||
|
@ -3603,8 +3603,8 @@ ieee80211_ioctl_wdsmac(struct net_device *dev, struct iw_request_info *info,
|
|||
|
||||
memcpy(vap->wds_mac, sa->sa_data, IEEE80211_ADDR_LEN);
|
||||
|
||||
printk("%s: Added WDS MAC: %s\n", dev->name,
|
||||
ether_sprintf(vap->wds_mac));
|
||||
printk("%s: Added WDS MAC: " MAC_FMT "\n", dev->name,
|
||||
MAC_ADDR(vap->wds_mac));
|
||||
|
||||
if (IS_UP(vap->iv_dev)) {
|
||||
/* Force us back to scan state to force us to go back through RUN
|
||||
|
@ -3650,8 +3650,8 @@ ieee80211_ioctl_wdsdelmac(struct net_device *dev, struct iw_request_info *info,
|
|||
return 0;
|
||||
}
|
||||
|
||||
printk("%s: WDS MAC address %s is not known by this interface\n",
|
||||
dev->name, ether_sprintf(sa->sa_data));
|
||||
printk("%s: WDS MAC address " MAC_FMT " is not known by this interface\n",
|
||||
dev->name, MAC_ADDR(sa->sa_data));
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue