net80211(4): do not setup Tx parameters for unsupported modes.

That should shorten 'ifconfig <wlan> list txparam' output since
unsupported modes will not be shown.

Checked with RTL8188EE, STA mode.

MFC after:	2 weeks
This commit is contained in:
Andriy Voskoboinyk 2019-02-03 04:31:50 +00:00
parent 35a5128d50
commit 1c4cb65153
2 changed files with 6 additions and 0 deletions

View File

@ -347,6 +347,9 @@ ieee80211_proto_vattach(struct ieee80211vap *vap)
* driver and/or user applications.
*/
for (i = IEEE80211_MODE_11A; i < IEEE80211_MODE_MAX; i++) {
if (isclr(ic->ic_modecaps, i))
continue;
const struct ieee80211_rateset *rs = &ic->ic_sup_rates[i];
vap->iv_txparms[i].ucastrate = IEEE80211_FIXED_RATE_NONE;

View File

@ -127,6 +127,9 @@ static int tdma_process_params(struct ieee80211_node *ni,
static void
settxparms(struct ieee80211vap *vap, enum ieee80211_phymode mode, int rate)
{
if (isclr(vap->iv_ic->ic_modecaps, mode))
return;
vap->iv_txparms[mode].ucastrate = rate;
vap->iv_txparms[mode].mcastrate = rate;
}