Change the MIMO userland export ABI to include flags, number of radio chains,

extended EVM statistics and EXT channel data.

ifconfig still displays 3 chains worth of ctl noise/rssi.
This commit is contained in:
Adrian Chadd 2011-04-21 03:47:40 +00:00
parent 69bcf84509
commit bc4e0fe6d0
3 changed files with 31 additions and 12 deletions

View File

@ -3139,11 +3139,13 @@ static void
printmimo(const struct ieee80211_mimo_info *mi)
{
/* NB: don't muddy display unless there's something to show */
if (mi->rssi[0] != 0 || mi->rssi[1] != 0 || mi->rssi[2] != 0) {
/* XXX should check flags and n_rx_chains */
if (mi->rssi_ctl[0] != 0 || mi->rssi_ctl[1] != 0 || mi->rssi_ctl[2] != 0) {
/* XXX ignore EVM for now */
/* XXX ignore EXT for now */
printf(" (rssi %d:%d:%d nf %d:%d:%d)",
mi->rssi[0], mi->rssi[1], mi->rssi[2],
mi->noise[0], mi->noise[1], mi->noise[2]);
mi->rssi_ctl[0], mi->rssi_ctl[1], mi->rssi_ctl[2],
mi->noise_ctl[0], mi->noise_ctl[1], mi->noise_ctl[2]);
}
}

View File

@ -395,9 +395,14 @@ struct ieee80211_regdomain {
* XXX This doesn't yet export both ctl/ext chain details
*/
struct ieee80211_mimo_info {
int8_t rssi[IEEE80211_MAX_CHAINS]; /* per-antenna rssi */
int8_t noise[IEEE80211_MAX_CHAINS]; /* per-antenna noise floor */
uint8_t pad[2];
uint32_t evm[3]; /* EVM data */
uint16_t flags; /* IEEE80211_R_* flags */
uint8_t n_rx_chains; /* number of RX chains involved */
uint8_t pad[1];
int8_t rssi_ctl[IEEE80211_MAX_CHAINS]; /* per-antenna rssi */
int8_t noise_ctl[IEEE80211_MAX_CHAINS]; /* per-antenna noise floor */
int8_t rssi_ext[IEEE80211_MAX_CHAINS]; /* per-antenna ext rssi */
int8_t noise_ext[IEEE80211_MAX_CHAINS]; /* per-antenna ext noise floor */
uint32_t evm[IEEE80211_MAX_CHAINS][IEEE80211_MAX_EVM_PILOTS];
/* EVM data */
};
#endif /* _NET80211__IEEE80211_H_ */

View File

@ -1091,18 +1091,30 @@ node_getmimoinfo(const struct ieee80211_node *ni,
bzero(info, sizeof(*info));
/* XXX set flags - evm, ctl/ext data, etc. */
info->n_rx_chains = ni->ni_mimo_chains;
for (i = 0; i < ni->ni_mimo_chains; i++) {
/* Ctl channel */
avgrssi = ni->ni_mimo_rssi_ctl[i];
if (avgrssi == IEEE80211_RSSI_DUMMY_MARKER) {
info->rssi[i] = 0;
info->rssi_ctl[i] = 0;
} else {
rssi = IEEE80211_RSSI_GET(avgrssi);
info->rssi[i] = rssi < 0 ? 0 : rssi > 127 ? 127 : rssi;
}
info->noise[i] = ni->ni_mimo_noise_ctl[i];
info->rssi_ctl[i] = rssi < 0 ? 0 : rssi > 127 ? 127 : rssi;
}
info->noise_ctl[i] = ni->ni_mimo_noise_ctl[i];
/* XXX ext radios? */
/* Ext channel */
avgrssi = ni->ni_mimo_rssi_ext[i];
if (avgrssi == IEEE80211_RSSI_DUMMY_MARKER) {
info->rssi_ext[i] = 0;
} else {
rssi = IEEE80211_RSSI_GET(avgrssi);
info->rssi_ext[i] = rssi < 0 ? 0 : rssi > 127 ? 127 : rssi;
}
info->noise_ext[i] = ni->ni_mimo_noise_ext[i];
}
/* XXX EVM? */
}