[net80211] add STBC capability flags to iv_flags_ht.

This is in preparation for exposing configuring STBC flags up to ifconfig
so STBC TX/RX can be configured at runtime.

* Set the FHT_STBC flags for TX/RX if the HT capabilitiex exist
* Clear the RX STBC HT capability flag when creating a HTCAP IE, so
  we only announce it if it's configured in the FHT flags.

Tested:

* AR9331 (carambola2), AP/STA modes
This commit is contained in:
adrian 2016-04-26 01:29:03 +00:00
parent 7cf304dd3d
commit 16ee478f13

View File

@ -293,6 +293,11 @@ ieee80211_ht_vattach(struct ieee80211vap *vap)
vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_RX;
if (vap->iv_htcaps & IEEE80211_HTC_AMSDU)
vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_TX;
if (vap->iv_htcaps & IEEE80211_HTCAP_TXSTBC)
vap->iv_flags_ht |= IEEE80211_FHT_STBC_TX;
if (vap->iv_htcaps & IEEE80211_HTCAP_RXSTBC)
vap->iv_flags_ht |= IEEE80211_FHT_STBC_RX;
}
/* NB: disable default legacy WDS, too many issues right now */
if (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY)
@ -2778,6 +2783,13 @@ ieee80211_add_htcap_body(uint8_t *frm, struct ieee80211_node *ni)
if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40) == 0 ||
(caps & IEEE80211_HTCAP_CHWIDTH40) == 0)
caps &= ~IEEE80211_HTCAP_SHORTGI40;
/* adjust STBC based on receive capabilities */
if ((vap->iv_flags_ht & IEEE80211_FHT_STBC_RX) == 0)
caps &= ~IEEE80211_HTCAP_RXSTBC;
/* XXX TODO: adjust LDPC based on receive capabilities */
ADDSHORT(frm, caps);
/* HT parameters */