1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-30 00:47:38 +00:00

Added more 'iw' output

This commit is contained in:
kimocoder 2019-11-14 20:19:03 +01:00
parent 82b14e8092
commit 3116f1e01a
2 changed files with 74 additions and 10 deletions

View File

@ -42,7 +42,7 @@ const char *rtw_log_level_str[] = {
void dump_drv_version(void *sel) void dump_drv_version(void *sel)
{ {
RTW_PRINT_SEL(sel, "%s %s\n", DRV_NAME, DRIVERVERSION); RTW_PRINT_SEL(sel, "%s %s\n", DRV_NAME, DRIVERVERSION);
RTW_PRINT_SEL(sel, "build time: %s %s\n", __DATE__, __TIME__); //RTW_PRINT_SEL(sel, "build time: %s %s\n", __DATE__, __TIME__);
} }
void dump_drv_cfg(void *sel) void dump_drv_cfg(void *sel)

View File

@ -34,13 +34,29 @@
#define STATION_INFO_PLINK_STATE BIT(NL80211_STA_INFO_PLINK_STATE) #define STATION_INFO_PLINK_STATE BIT(NL80211_STA_INFO_PLINK_STATE)
#define STATION_INFO_SIGNAL BIT(NL80211_STA_INFO_SIGNAL) #define STATION_INFO_SIGNAL BIT(NL80211_STA_INFO_SIGNAL)
#define STATION_INFO_TX_BITRATE BIT(NL80211_STA_INFO_TX_BITRATE) #define STATION_INFO_TX_BITRATE BIT(NL80211_STA_INFO_TX_BITRATE)
#define STATION_INFO_TX_BITRATE_BW_5 BIT(RATE_INFO_BW_5)
#define STATION_INFO_TX_BITRATE_BW_10 BIT(RATE_INFO_BW_10)
#define STATION_INFO_TX_BITRATE_BW_20 BIT(RATE_INFO_BW_20)
#define STATION_INFO_TX_BITRATE_BW_40 BIT(RATE_INFO_BW_40)
#define STATION_INFO_TX_BITRATE_BW_80 BIT(RATE_INFO_BW_80)
#define STATION_INFO_TX_BITRATE_BW_160 BIT(RATE_INFO_BW_160)
#define STATION_INFO_RX_PACKETS BIT(NL80211_STA_INFO_RX_PACKETS) #define STATION_INFO_RX_PACKETS BIT(NL80211_STA_INFO_RX_PACKETS)
#define STATION_INFO_TX_PACKETS BIT(NL80211_STA_INFO_TX_PACKETS) #define STATION_INFO_TX_PACKETS BIT(NL80211_STA_INFO_TX_PACKETS)
#define STATION_INFO_TX_FAILED BIT(NL80211_STA_INFO_TX_FAILED) #define STATION_INFO_TX_FAILED BIT(NL80211_STA_INFO_TX_FAILED)
#define STATION_INFO_RX_BYTES BIT(NL80211_STA_INFO_RX_BYTES)
#define STATION_INFO_TX_BYTES BIT(NL80211_STA_INFO_TX_BYTES)
#define STATION_INFO_LOCAL_PM BIT(NL80211_STA_INFO_LOCAL_PM) #define STATION_INFO_LOCAL_PM BIT(NL80211_STA_INFO_LOCAL_PM)
#define STATION_INFO_PEER_PM BIT(NL80211_STA_INFO_PEER_PM) #define STATION_INFO_PEER_PM BIT(NL80211_STA_INFO_PEER_PM)
#define STATION_INFO_NONPEER_PM BIT(NL80211_STA_INFO_NONPEER_PM) #define STATION_INFO_NONPEER_PM BIT(NL80211_STA_INFO_NONPEER_PM)
#define STATION_INFO_RX_BYTES BIT(NL80211_STA_INFO_RX_BYTES)
#define STATION_INFO_TX_BYTES BIT(NL80211_STA_INFO_TX_BYTES)
#define STATION_INFO_ASSOC_REQ_IES 0 #define STATION_INFO_ASSOC_REQ_IES 0
#define STATION_INFO_BSS_PARAM BIT(NL80211_STA_INFO_BSS_PARAM)
#define STATION_INFO_BSS_PARAM_CTS_PROT BIT(NL80211_STA_BSS_PARAM_CTS_PROT)
#define STATION_INFO_BSS_PARAM_SHORT_PREAMBLE BIT(NL80211_STA_BSS_PARAM_SHORT_PREAMBLE)
#define STATION_INFO_BSS_PARAM_SHORT_SLOT_TIME BIT(NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME)
#define STATION_INFO_BSS_PARAM_DTIM_PERIOD BIT(NL80211_STA_BSS_PARAM_DTIM_PERIOD)
#define STATION_INFO_BSS_PARAM_BEACON_INTERVAL BIT(NL80211_STA_BSS_PARAM_BEACON_INTERVAL)
#endif /* Linux kernel >= 4.0.0 */ #endif /* Linux kernel >= 4.0.0 */
#include <rtw_wifi_regd.h> #include <rtw_wifi_regd.h>
@ -2264,6 +2280,7 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy,
&& check_fwstate(pmlmepriv, _FW_LINKED) && check_fwstate(pmlmepriv, _FW_LINKED)
) { ) {
struct wlan_network *cur_network = &(pmlmepriv->cur_network); struct wlan_network *cur_network = &(pmlmepriv->cur_network);
struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter);
if (_rtw_memcmp((u8 *)mac, cur_network->network.MacAddress, ETH_ALEN) == _FALSE) { if (_rtw_memcmp((u8 *)mac, cur_network->network.MacAddress, ETH_ALEN) == _FALSE) {
RTW_INFO("%s, mismatch bssid="MAC_FMT"\n", __func__, MAC_ARG(cur_network->network.MacAddress)); RTW_INFO("%s, mismatch bssid="MAC_FMT"\n", __func__, MAC_ARG(cur_network->network.MacAddress));
@ -2276,6 +2293,53 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy,
sinfo->filled |= STATION_INFO_TX_BITRATE; sinfo->filled |= STATION_INFO_TX_BITRATE;
sinfo->txrate.legacy = rtw_get_cur_max_rate(padapter); sinfo->txrate.legacy = rtw_get_cur_max_rate(padapter);
/* to-do set the txrate flags */
// for example something like:
//sinfo->txrate.flags |= NL80211_RATE_INFO_VHT_NSS;
//sinfo->txrate.nss = rtw_vht_mcsmap_to_nss(psta->vhtpriv.vht_mcs_map);
/* bw_mode is more delicate
sinfo->txrate.bw is flagged
psta->bw_mode */
/*
sinfo->txrate.bw = psta->bw_mode;
sinfo->txrate.flags |= psta->bw_mode;
printk("rtw_get_current_tx_sgi: %i", rtw_get_current_tx_sgi(padapter, mac));
printk("NSS: %i", rtw_vht_mcsmap_to_nss(psta->vhtpriv.vht_mcs_map));
printk("BW MODE: %i", psta->bw_mode);
printk("5 10 20 40 80 160: %i %i %i %i %i %i", STATION_INFO_TX_BITRATE_BW_5, STATION_INFO_TX_BITRATE_BW_10, STATION_INFO_TX_BITRATE_BW_20, STATION_INFO_TX_BITRATE_BW_40, STATION_INFO_TX_BITRATE_BW_80, STATION_INFO_TX_BITRATE_BW_160);
printk("5 10 20 40 80 160: %i %i %i %i %i %i", RATE_INFO_BW_5, RATE_INFO_BW_10, RATE_INFO_BW_20, RATE_INFO_BW_40, RATE_INFO_BW_80, RATE_INFO_BW_160);
*/
sinfo->filled |= STATION_INFO_RX_PACKETS;
sinfo->rx_packets = sta_rx_data_pkts(psta);
sinfo->filled |= STATION_INFO_TX_PACKETS;
sinfo->tx_packets = psta->sta_stats.tx_pkts;
sinfo->filled |= STATION_INFO_TX_FAILED;
sinfo->tx_failed = psta->sta_stats.tx_fail_cnt;
sinfo->filled |= STATION_INFO_BSS_PARAM;
if (!psta->no_short_preamble_set)
sinfo->bss_param.flags |= STATION_INFO_BSS_PARAM_SHORT_PREAMBLE;
if (!psta->no_short_slot_time_set)
sinfo->bss_param.flags |= STATION_INFO_BSS_PARAM_SHORT_SLOT_TIME;
/* no idea how to check this yet */
if (0)
sinfo->bss_param.flags |= STATION_INFO_BSS_PARAM_CTS_PROT;
/* is this actually the dtim_period? */
sinfo->bss_param.flags |= STATION_INFO_BSS_PARAM_DTIM_PERIOD;
sinfo->bss_param.dtim_period = pwrctl->dtim;
sinfo->bss_param.beacon_interval = get_beacon_interval(&cur_network->network);
} }
if (psta) { if (psta) {