Global-ify channel_type() - this fixes non-debug net80211 builds.

This commit is contained in:
Adrian Chadd 2015-01-06 18:25:10 +00:00
parent 8d665c6ba8
commit a1cbd04334
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=276757
4 changed files with 26 additions and 48 deletions

View File

@ -1747,3 +1747,23 @@ ieee80211_mac_hash(const struct ieee80211com *ic,
return c;
}
#undef mix
char
ieee80211_channel_type_char(const struct ieee80211_channel *c)
{
if (IEEE80211_IS_CHAN_ST(c))
return 'S';
if (IEEE80211_IS_CHAN_108A(c))
return 'T';
if (IEEE80211_IS_CHAN_108G(c))
return 'G';
if (IEEE80211_IS_CHAN_HT(c))
return 'n';
if (IEEE80211_IS_CHAN_A(c))
return 'a';
if (IEEE80211_IS_CHAN_ANYG(c))
return 'g';
if (IEEE80211_IS_CHAN_B(c))
return 'b';
return 'f';
}

View File

@ -260,29 +260,6 @@ ieee80211_scan_update_locked(struct ieee80211vap *vap,
}
}
/*
* XXX TODO: should be a global method!
*/
static char
channel_type(const struct ieee80211_channel *c)
{
if (IEEE80211_IS_CHAN_ST(c))
return 'S';
if (IEEE80211_IS_CHAN_108A(c))
return 'T';
if (IEEE80211_IS_CHAN_108G(c))
return 'G';
if (IEEE80211_IS_CHAN_HT(c))
return 'n';
if (IEEE80211_IS_CHAN_A(c))
return 'a';
if (IEEE80211_IS_CHAN_ANYG(c))
return 'g';
if (IEEE80211_IS_CHAN_B(c))
return 'b';
return 'f';
}
void
ieee80211_scan_dump_channels(const struct ieee80211_scan_state *ss)
{
@ -295,7 +272,7 @@ ieee80211_scan_dump_channels(const struct ieee80211_scan_state *ss)
const struct ieee80211_channel *c = ss->ss_chans[i];
printf("%s%u%c", sep, ieee80211_chan2ieee(ic, c),
channel_type(c));
ieee80211_channel_type_char(c));
sep = ", ";
}
}

View File

@ -185,27 +185,6 @@ ieee80211_swscan_vdetach(struct ieee80211vap *vap)
}
}
/* XXX should be a global net80211 function */
static char
channel_type(const struct ieee80211_channel *c)
{
if (IEEE80211_IS_CHAN_ST(c))
return 'S';
if (IEEE80211_IS_CHAN_108A(c))
return 'T';
if (IEEE80211_IS_CHAN_108G(c))
return 'G';
if (IEEE80211_IS_CHAN_HT(c))
return 'n';
if (IEEE80211_IS_CHAN_A(c))
return 'a';
if (IEEE80211_IS_CHAN_ANYG(c))
return 'g';
if (IEEE80211_IS_CHAN_B(c))
return 'b';
return 'f';
}
void
ieee80211_swscan_set_scan_duration(struct ieee80211vap *vap, u_int duration)
{
@ -667,8 +646,9 @@ scan_task(void *arg, int pending)
"%s: chan %3d%c -> %3d%c [%s, dwell min %lums max %lums]\n",
__func__,
ieee80211_chan2ieee(ic, ic->ic_curchan),
channel_type(ic->ic_curchan),
ieee80211_chan2ieee(ic, chan), channel_type(chan),
ieee80211_channel_type_char(ic->ic_curchan),
ieee80211_chan2ieee(ic, chan),
ieee80211_channel_type_char(chan),
(ss->ss_flags & IEEE80211_SCAN_ACTIVE) &&
(chan->ic_flags & IEEE80211_CHAN_PASSIVE) == 0 ?
"active" : "passive",
@ -878,7 +858,7 @@ ieee80211_swscan_add_scan(struct ieee80211vap *vap,
"%s: chan %3d%c min dwell met (%u > %lu)\n",
__func__,
ieee80211_chan2ieee(ic, ic->ic_curchan),
channel_type(ic->ic_curchan),
ieee80211_channel_type_char(ic->ic_curchan),
ticks, SCAN_PRIVATE(ss)->ss_chanmindwell);
SCAN_PRIVATE(ss)->ss_iflags |= ISCAN_MINDWELL;
/*

View File

@ -711,6 +711,7 @@ int ieee80211_setmode(struct ieee80211com *, enum ieee80211_phymode);
enum ieee80211_phymode ieee80211_chan2mode(const struct ieee80211_channel *);
uint32_t ieee80211_mac_hash(const struct ieee80211com *,
const uint8_t addr[IEEE80211_ADDR_LEN]);
char ieee80211_channel_type_char(const struct ieee80211_channel *c);
void ieee80211_radiotap_attach(struct ieee80211com *,
struct ieee80211_radiotap_header *th, int tlen,