Changeset View
Changeset View
Standalone View
Standalone View
sys/net80211/ieee80211_ht.c
Show First 20 Lines • Show All 292 Lines • ▼ Show 20 Lines | if (vap->iv_htcaps & IEEE80211_HTC_HT) { | ||||
vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_RX; | vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_RX; | ||||
if (vap->iv_htcaps & IEEE80211_HTC_AMSDU) | if (vap->iv_htcaps & IEEE80211_HTC_AMSDU) | ||||
vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_TX; | vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_TX; | ||||
if (vap->iv_htcaps & IEEE80211_HTCAP_TXSTBC) | if (vap->iv_htcaps & IEEE80211_HTCAP_TXSTBC) | ||||
vap->iv_flags_ht |= IEEE80211_FHT_STBC_TX; | vap->iv_flags_ht |= IEEE80211_FHT_STBC_TX; | ||||
if (vap->iv_htcaps & IEEE80211_HTCAP_RXSTBC) | if (vap->iv_htcaps & IEEE80211_HTCAP_RXSTBC) | ||||
vap->iv_flags_ht |= IEEE80211_FHT_STBC_RX; | vap->iv_flags_ht |= IEEE80211_FHT_STBC_RX; | ||||
if (vap->iv_htcaps & IEEE80211_HTCAP_LDPC) | |||||
vap->iv_flags_ht |= IEEE80211_FHT_LDPC_RX; | |||||
if (vap->iv_htcaps & IEEE80211_HTC_TXLDPC) | |||||
vap->iv_flags_ht |= IEEE80211_FHT_LDPC_TX; | |||||
} | } | ||||
/* NB: disable default legacy WDS, too many issues right now */ | /* NB: disable default legacy WDS, too many issues right now */ | ||||
if (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) | if (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) | ||||
vap->iv_flags_ht &= ~IEEE80211_FHT_HT; | vap->iv_flags_ht &= ~IEEE80211_FHT_HT; | ||||
} | } | ||||
void | void | ||||
ieee80211_ht_vdetach(struct ieee80211vap *vap) | ieee80211_ht_vdetach(struct ieee80211vap *vap) | ||||
▲ Show 20 Lines • Show All 1,336 Lines • ▼ Show 20 Lines | if ((ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) && | ||||
(vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20)) | (vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20)) | ||||
ni->ni_flags |= IEEE80211_NODE_SGI20; | ni->ni_flags |= IEEE80211_NODE_SGI20; | ||||
if ((ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) && | if ((ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) && | ||||
(vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40)) | (vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40)) | ||||
ni->ni_flags |= IEEE80211_NODE_SGI40; | ni->ni_flags |= IEEE80211_NODE_SGI40; | ||||
} | } | ||||
/* | /* | ||||
* Update LDPC state according to received htcap | |||||
* and local settings. | |||||
*/ | |||||
static __inline void | |||||
htcap_update_ldpc(struct ieee80211_node *ni) | |||||
{ | |||||
struct ieee80211vap *vap = ni->ni_vap; | |||||
if ((ni->ni_htcap & IEEE80211_HTCAP_LDPC) && | |||||
(vap->iv_flags_ht & IEEE80211_FHT_LDPC_TX)) | |||||
ni->ni_flags |= IEEE80211_NODE_LDPC; | |||||
} | |||||
/* | |||||
* Parse and update HT-related state extracted from | * Parse and update HT-related state extracted from | ||||
* the HT cap and info ie's. | * the HT cap and info ie's. | ||||
* | * | ||||
* This is called from the STA management path and | * This is called from the STA management path and | ||||
* the ieee80211_node_join() path. It will take into | * the ieee80211_node_join() path. It will take into | ||||
* account the IEs discovered during scanning and | * account the IEs discovered during scanning and | ||||
* adjust things accordingly. | * adjust things accordingly. | ||||
*/ | */ | ||||
void | void | ||||
ieee80211_ht_updateparams(struct ieee80211_node *ni, | ieee80211_ht_updateparams(struct ieee80211_node *ni, | ||||
const uint8_t *htcapie, const uint8_t *htinfoie) | const uint8_t *htcapie, const uint8_t *htinfoie) | ||||
{ | { | ||||
struct ieee80211vap *vap = ni->ni_vap; | struct ieee80211vap *vap = ni->ni_vap; | ||||
const struct ieee80211_ie_htinfo *htinfo; | const struct ieee80211_ie_htinfo *htinfo; | ||||
ieee80211_parse_htcap(ni, htcapie); | ieee80211_parse_htcap(ni, htcapie); | ||||
if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS) | if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS) | ||||
htcap_update_mimo_ps(ni); | htcap_update_mimo_ps(ni); | ||||
htcap_update_shortgi(ni); | htcap_update_shortgi(ni); | ||||
htcap_update_ldpc(ni); | |||||
if (htinfoie[0] == IEEE80211_ELEMID_VENDOR) | if (htinfoie[0] == IEEE80211_ELEMID_VENDOR) | ||||
htinfoie += 4; | htinfoie += 4; | ||||
htinfo = (const struct ieee80211_ie_htinfo *) htinfoie; | htinfo = (const struct ieee80211_ie_htinfo *) htinfoie; | ||||
htinfo_parse(ni, htinfo); | htinfo_parse(ni, htinfo); | ||||
/* | /* | ||||
* Defer the node channel change; we need to now | * Defer the node channel change; we need to now | ||||
▲ Show 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | |||||
ieee80211_ht_updatehtcap(struct ieee80211_node *ni, const uint8_t *htcapie) | ieee80211_ht_updatehtcap(struct ieee80211_node *ni, const uint8_t *htcapie) | ||||
{ | { | ||||
struct ieee80211vap *vap = ni->ni_vap; | struct ieee80211vap *vap = ni->ni_vap; | ||||
ieee80211_parse_htcap(ni, htcapie); | ieee80211_parse_htcap(ni, htcapie); | ||||
if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS) | if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS) | ||||
htcap_update_mimo_ps(ni); | htcap_update_mimo_ps(ni); | ||||
htcap_update_shortgi(ni); | htcap_update_shortgi(ni); | ||||
htcap_update_ldpc(ni); | |||||
} | } | ||||
/* | /* | ||||
* Called once HT and VHT capabilities are parsed in hostap mode - | * Called once HT and VHT capabilities are parsed in hostap mode - | ||||
* this will adjust the channel configuration of the given node | * this will adjust the channel configuration of the given node | ||||
* based on the configuration and capabilities. | * based on the configuration and capabilities. | ||||
*/ | */ | ||||
void | void | ||||
▲ Show 20 Lines • Show All 1,190 Lines • ▼ Show 20 Lines | #define ADDSHORT(frm, v) do { \ | ||||
if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40) == 0 || | if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40) == 0 || | ||||
(caps & IEEE80211_HTCAP_CHWIDTH40) == 0) | (caps & IEEE80211_HTCAP_CHWIDTH40) == 0) | ||||
caps &= ~IEEE80211_HTCAP_SHORTGI40; | caps &= ~IEEE80211_HTCAP_SHORTGI40; | ||||
/* adjust STBC based on receive capabilities */ | /* adjust STBC based on receive capabilities */ | ||||
if ((vap->iv_flags_ht & IEEE80211_FHT_STBC_RX) == 0) | if ((vap->iv_flags_ht & IEEE80211_FHT_STBC_RX) == 0) | ||||
caps &= ~IEEE80211_HTCAP_RXSTBC; | caps &= ~IEEE80211_HTCAP_RXSTBC; | ||||
/* XXX TODO: adjust LDPC based on receive capabilities */ | /* adjust LDPC based on receive capabilites */ | ||||
if ((vap->iv_flags_ht & IEEE80211_FHT_LDPC_RX) == 0) | |||||
caps &= ~IEEE80211_HTCAP_LDPC; | |||||
ADDSHORT(frm, caps); | ADDSHORT(frm, caps); | ||||
/* HT parameters */ | /* HT parameters */ | ||||
*frm = SM(rxmax, IEEE80211_HTCAP_MAXRXAMPDU) | *frm = SM(rxmax, IEEE80211_HTCAP_MAXRXAMPDU) | ||||
| SM(density, IEEE80211_HTCAP_MPDUDENSITY) | | SM(density, IEEE80211_HTCAP_MPDUDENSITY) | ||||
; | ; | ||||
frm++; | frm++; | ||||
▲ Show 20 Lines • Show All 275 Lines • Show Last 20 Lines |