mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-29 15:14:18 +08:00
cfg80211: remove enum station_info_flags
This is really just duplicating the list of information that's already available in the nl80211 attribute, so remove the list. Two small changes are needed: * remove STATION_INFO_ASSOC_REQ_IES complete, but the length (assoc_req_ies_len) can be used instead * add NL80211_STA_INFO_RX_DROP_MISC which exists internally but not in nl80211 yet This gets rid of the duplicate maintenance of the two lists. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
2b9a7e1bac
commit
319090bf6c
@ -1799,20 +1799,20 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev,
|
|||||||
|
|
||||||
if (vif->target_stats.rx_byte) {
|
if (vif->target_stats.rx_byte) {
|
||||||
sinfo->rx_bytes = vif->target_stats.rx_byte;
|
sinfo->rx_bytes = vif->target_stats.rx_byte;
|
||||||
sinfo->filled |= STATION_INFO_RX_BYTES64;
|
sinfo->filled |= BIT(NL80211_STA_INFO_RX_BYTES64);
|
||||||
sinfo->rx_packets = vif->target_stats.rx_pkt;
|
sinfo->rx_packets = vif->target_stats.rx_pkt;
|
||||||
sinfo->filled |= STATION_INFO_RX_PACKETS;
|
sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vif->target_stats.tx_byte) {
|
if (vif->target_stats.tx_byte) {
|
||||||
sinfo->tx_bytes = vif->target_stats.tx_byte;
|
sinfo->tx_bytes = vif->target_stats.tx_byte;
|
||||||
sinfo->filled |= STATION_INFO_TX_BYTES64;
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_BYTES64);
|
||||||
sinfo->tx_packets = vif->target_stats.tx_pkt;
|
sinfo->tx_packets = vif->target_stats.tx_pkt;
|
||||||
sinfo->filled |= STATION_INFO_TX_PACKETS;
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS);
|
||||||
}
|
}
|
||||||
|
|
||||||
sinfo->signal = vif->target_stats.cs_rssi;
|
sinfo->signal = vif->target_stats.cs_rssi;
|
||||||
sinfo->filled |= STATION_INFO_SIGNAL;
|
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
|
||||||
|
|
||||||
rate = vif->target_stats.tx_ucast_rate;
|
rate = vif->target_stats.tx_ucast_rate;
|
||||||
|
|
||||||
@ -1844,12 +1844,12 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sinfo->filled |= STATION_INFO_TX_BITRATE;
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
|
||||||
|
|
||||||
if (test_bit(CONNECTED, &vif->flags) &&
|
if (test_bit(CONNECTED, &vif->flags) &&
|
||||||
test_bit(DTIM_PERIOD_AVAIL, &vif->flags) &&
|
test_bit(DTIM_PERIOD_AVAIL, &vif->flags) &&
|
||||||
vif->nw_type == INFRA_NETWORK) {
|
vif->nw_type == INFRA_NETWORK) {
|
||||||
sinfo->filled |= STATION_INFO_BSS_PARAM;
|
sinfo->filled |= BIT(NL80211_STA_INFO_BSS_PARAM);
|
||||||
sinfo->bss_param.flags = 0;
|
sinfo->bss_param.flags = 0;
|
||||||
sinfo->bss_param.dtim_period = vif->assoc_bss_dtim_period;
|
sinfo->bss_param.dtim_period = vif->assoc_bss_dtim_period;
|
||||||
sinfo->bss_param.beacon_interval = vif->assoc_bss_beacon_int;
|
sinfo->bss_param.beacon_interval = vif->assoc_bss_beacon_int;
|
||||||
|
@ -488,7 +488,6 @@ void ath6kl_connect_ap_mode_sta(struct ath6kl_vif *vif, u16 aid, u8 *mac_addr,
|
|||||||
|
|
||||||
sinfo.assoc_req_ies = ies;
|
sinfo.assoc_req_ies = ies;
|
||||||
sinfo.assoc_req_ies_len = ies_len;
|
sinfo.assoc_req_ies_len = ies_len;
|
||||||
sinfo.filled |= STATION_INFO_ASSOC_REQ_IES;
|
|
||||||
|
|
||||||
cfg80211_new_sta(vif->ndev, mac_addr, &sinfo, GFP_KERNEL);
|
cfg80211_new_sta(vif->ndev, mac_addr, &sinfo, GFP_KERNEL);
|
||||||
|
|
||||||
|
@ -142,14 +142,14 @@ int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid,
|
|||||||
|
|
||||||
sinfo->generation = wil->sinfo_gen;
|
sinfo->generation = wil->sinfo_gen;
|
||||||
|
|
||||||
sinfo->filled = STATION_INFO_RX_BYTES |
|
sinfo->filled = BIT(NL80211_STA_INFO_RX_BYTES) |
|
||||||
STATION_INFO_TX_BYTES |
|
BIT(NL80211_STA_INFO_TX_BYTES) |
|
||||||
STATION_INFO_RX_PACKETS |
|
BIT(NL80211_STA_INFO_RX_PACKETS) |
|
||||||
STATION_INFO_TX_PACKETS |
|
BIT(NL80211_STA_INFO_TX_PACKETS) |
|
||||||
STATION_INFO_RX_BITRATE |
|
BIT(NL80211_STA_INFO_RX_BITRATE) |
|
||||||
STATION_INFO_TX_BITRATE |
|
BIT(NL80211_STA_INFO_TX_BITRATE) |
|
||||||
STATION_INFO_RX_DROP_MISC |
|
BIT(NL80211_STA_INFO_RX_DROP_MISC) |
|
||||||
STATION_INFO_TX_FAILED;
|
BIT(NL80211_STA_INFO_TX_FAILED);
|
||||||
|
|
||||||
sinfo->txrate.flags = RATE_INFO_FLAGS_MCS | RATE_INFO_FLAGS_60G;
|
sinfo->txrate.flags = RATE_INFO_FLAGS_MCS | RATE_INFO_FLAGS_60G;
|
||||||
sinfo->txrate.mcs = le16_to_cpu(reply.evt.bf_mcs);
|
sinfo->txrate.mcs = le16_to_cpu(reply.evt.bf_mcs);
|
||||||
@ -163,7 +163,7 @@ int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid,
|
|||||||
sinfo->tx_failed = stats->tx_errors;
|
sinfo->tx_failed = stats->tx_errors;
|
||||||
|
|
||||||
if (test_bit(wil_status_fwconnected, &wil->status)) {
|
if (test_bit(wil_status_fwconnected, &wil->status)) {
|
||||||
sinfo->filled |= STATION_INFO_SIGNAL;
|
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
|
||||||
sinfo->signal = reply.evt.sqi;
|
sinfo->signal = reply.evt.sqi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,7 +457,6 @@ static void wmi_evt_connect(struct wil6210_priv *wil, int id, void *d, int len)
|
|||||||
if (assoc_req_ie) {
|
if (assoc_req_ie) {
|
||||||
sinfo.assoc_req_ies = assoc_req_ie;
|
sinfo.assoc_req_ies = assoc_req_ie;
|
||||||
sinfo.assoc_req_ies_len = assoc_req_ielen;
|
sinfo.assoc_req_ies_len = assoc_req_ielen;
|
||||||
sinfo.filled |= STATION_INFO_ASSOC_REQ_IES;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg80211_new_sta(ndev, evt->bssid, &sinfo, GFP_KERNEL);
|
cfg80211_new_sta(ndev, evt->bssid, &sinfo, GFP_KERNEL);
|
||||||
|
@ -2333,10 +2333,10 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
|
|||||||
brcmf_err("GET STA INFO failed, %d\n", err);
|
brcmf_err("GET STA INFO failed, %d\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
sinfo->filled = STATION_INFO_INACTIVE_TIME;
|
sinfo->filled = BIT(NL80211_STA_INFO_INACTIVE_TIME);
|
||||||
sinfo->inactive_time = le32_to_cpu(sta_info_le.idle) * 1000;
|
sinfo->inactive_time = le32_to_cpu(sta_info_le.idle) * 1000;
|
||||||
if (le32_to_cpu(sta_info_le.flags) & BRCMF_STA_ASSOC) {
|
if (le32_to_cpu(sta_info_le.flags) & BRCMF_STA_ASSOC) {
|
||||||
sinfo->filled |= STATION_INFO_CONNECTED_TIME;
|
sinfo->filled |= BIT(NL80211_STA_INFO_CONNECTED_TIME);
|
||||||
sinfo->connected_time = le32_to_cpu(sta_info_le.in);
|
sinfo->connected_time = le32_to_cpu(sta_info_le.in);
|
||||||
}
|
}
|
||||||
brcmf_dbg(TRACE, "STA idle time : %d ms, connected time :%d sec\n",
|
brcmf_dbg(TRACE, "STA idle time : %d ms, connected time :%d sec\n",
|
||||||
@ -2354,7 +2354,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
|
|||||||
brcmf_err("Could not get rate (%d)\n", err);
|
brcmf_err("Could not get rate (%d)\n", err);
|
||||||
goto done;
|
goto done;
|
||||||
} else {
|
} else {
|
||||||
sinfo->filled |= STATION_INFO_TX_BITRATE;
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
|
||||||
sinfo->txrate.legacy = rate * 5;
|
sinfo->txrate.legacy = rate * 5;
|
||||||
brcmf_dbg(CONN, "Rate %d Mbps\n", rate / 2);
|
brcmf_dbg(CONN, "Rate %d Mbps\n", rate / 2);
|
||||||
}
|
}
|
||||||
@ -2369,7 +2369,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
|
|||||||
goto done;
|
goto done;
|
||||||
} else {
|
} else {
|
||||||
rssi = le32_to_cpu(scb_val.val);
|
rssi = le32_to_cpu(scb_val.val);
|
||||||
sinfo->filled |= STATION_INFO_SIGNAL;
|
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
|
||||||
sinfo->signal = rssi;
|
sinfo->signal = rssi;
|
||||||
brcmf_dbg(CONN, "RSSI %d dBm\n", rssi);
|
brcmf_dbg(CONN, "RSSI %d dBm\n", rssi);
|
||||||
}
|
}
|
||||||
@ -2396,7 +2396,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
|
|||||||
brcmf_dbg(CONN, "DTIM peroid %d\n",
|
brcmf_dbg(CONN, "DTIM peroid %d\n",
|
||||||
dtim_period);
|
dtim_period);
|
||||||
}
|
}
|
||||||
sinfo->filled |= STATION_INFO_BSS_PARAM;
|
sinfo->filled |= BIT(NL80211_STA_INFO_BSS_PARAM);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
err = -EPERM;
|
err = -EPERM;
|
||||||
@ -4778,7 +4778,6 @@ brcmf_notify_connect_status_ap(struct brcmf_cfg80211_info *cfg,
|
|||||||
if (((event == BRCMF_E_ASSOC_IND) || (event == BRCMF_E_REASSOC_IND)) &&
|
if (((event == BRCMF_E_ASSOC_IND) || (event == BRCMF_E_REASSOC_IND)) &&
|
||||||
(reason == BRCMF_E_STATUS_SUCCESS)) {
|
(reason == BRCMF_E_STATUS_SUCCESS)) {
|
||||||
memset(&sinfo, 0, sizeof(sinfo));
|
memset(&sinfo, 0, sizeof(sinfo));
|
||||||
sinfo.filled = STATION_INFO_ASSOC_REQ_IES;
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
brcmf_err("No IEs present in ASSOC/REASSOC_IND");
|
brcmf_err("No IEs present in ASSOC/REASSOC_IND");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -1616,10 +1616,10 @@ static int lbs_cfg_get_station(struct wiphy *wiphy, struct net_device *dev,
|
|||||||
|
|
||||||
lbs_deb_enter(LBS_DEB_CFG80211);
|
lbs_deb_enter(LBS_DEB_CFG80211);
|
||||||
|
|
||||||
sinfo->filled |= STATION_INFO_TX_BYTES |
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_BYTES) |
|
||||||
STATION_INFO_TX_PACKETS |
|
BIT(NL80211_STA_INFO_TX_PACKETS) |
|
||||||
STATION_INFO_RX_BYTES |
|
BIT(NL80211_STA_INFO_RX_BYTES) |
|
||||||
STATION_INFO_RX_PACKETS;
|
BIT(NL80211_STA_INFO_RX_PACKETS);
|
||||||
sinfo->tx_bytes = priv->dev->stats.tx_bytes;
|
sinfo->tx_bytes = priv->dev->stats.tx_bytes;
|
||||||
sinfo->tx_packets = priv->dev->stats.tx_packets;
|
sinfo->tx_packets = priv->dev->stats.tx_packets;
|
||||||
sinfo->rx_bytes = priv->dev->stats.rx_bytes;
|
sinfo->rx_bytes = priv->dev->stats.rx_bytes;
|
||||||
@ -1629,14 +1629,14 @@ static int lbs_cfg_get_station(struct wiphy *wiphy, struct net_device *dev,
|
|||||||
ret = lbs_get_rssi(priv, &signal, &noise);
|
ret = lbs_get_rssi(priv, &signal, &noise);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
sinfo->signal = signal;
|
sinfo->signal = signal;
|
||||||
sinfo->filled |= STATION_INFO_SIGNAL;
|
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert priv->cur_rate from hw_value to NL80211 value */
|
/* Convert priv->cur_rate from hw_value to NL80211 value */
|
||||||
for (i = 0; i < ARRAY_SIZE(lbs_rates); i++) {
|
for (i = 0; i < ARRAY_SIZE(lbs_rates); i++) {
|
||||||
if (priv->cur_rate == lbs_rates[i].hw_value) {
|
if (priv->cur_rate == lbs_rates[i].hw_value) {
|
||||||
sinfo->txrate.legacy = lbs_rates[i].bitrate;
|
sinfo->txrate.legacy = lbs_rates[i].bitrate;
|
||||||
sinfo->filled |= STATION_INFO_TX_BITRATE;
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -910,10 +910,10 @@ mwifiex_dump_station_info(struct mwifiex_private *priv,
|
|||||||
{
|
{
|
||||||
u32 rate;
|
u32 rate;
|
||||||
|
|
||||||
sinfo->filled = STATION_INFO_RX_BYTES | STATION_INFO_TX_BYTES |
|
sinfo->filled = BIT(NL80211_STA_INFO_RX_BYTES) | BIT(NL80211_STA_INFO_TX_BYTES) |
|
||||||
STATION_INFO_RX_PACKETS | STATION_INFO_TX_PACKETS |
|
BIT(NL80211_STA_INFO_RX_PACKETS) | BIT(NL80211_STA_INFO_TX_PACKETS) |
|
||||||
STATION_INFO_TX_BITRATE |
|
BIT(NL80211_STA_INFO_TX_BITRATE) |
|
||||||
STATION_INFO_SIGNAL | STATION_INFO_SIGNAL_AVG;
|
BIT(NL80211_STA_INFO_SIGNAL) | BIT(NL80211_STA_INFO_SIGNAL_AVG);
|
||||||
|
|
||||||
/* Get signal information from the firmware */
|
/* Get signal information from the firmware */
|
||||||
if (mwifiex_send_cmd(priv, HostCmd_CMD_RSSI_INFO,
|
if (mwifiex_send_cmd(priv, HostCmd_CMD_RSSI_INFO,
|
||||||
@ -944,7 +944,7 @@ mwifiex_dump_station_info(struct mwifiex_private *priv,
|
|||||||
sinfo->txrate.legacy = rate * 5;
|
sinfo->txrate.legacy = rate * 5;
|
||||||
|
|
||||||
if (priv->bss_mode == NL80211_IFTYPE_STATION) {
|
if (priv->bss_mode == NL80211_IFTYPE_STATION) {
|
||||||
sinfo->filled |= STATION_INFO_BSS_PARAM;
|
sinfo->filled |= BIT(NL80211_STA_INFO_BSS_PARAM);
|
||||||
sinfo->bss_param.flags = 0;
|
sinfo->bss_param.flags = 0;
|
||||||
if (priv->curr_bss_params.bss_descriptor.cap_info_bitmap &
|
if (priv->curr_bss_params.bss_descriptor.cap_info_bitmap &
|
||||||
WLAN_CAPABILITY_SHORT_PREAMBLE)
|
WLAN_CAPABILITY_SHORT_PREAMBLE)
|
||||||
|
@ -68,7 +68,6 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv)
|
|||||||
len = ETH_ALEN;
|
len = ETH_ALEN;
|
||||||
|
|
||||||
if (len != -1) {
|
if (len != -1) {
|
||||||
sinfo.filled = STATION_INFO_ASSOC_REQ_IES;
|
|
||||||
sinfo.assoc_req_ies = &event->data[len];
|
sinfo.assoc_req_ies = &event->data[len];
|
||||||
len = (u8 *)sinfo.assoc_req_ies -
|
len = (u8 *)sinfo.assoc_req_ies -
|
||||||
(u8 *)&event->frame_control;
|
(u8 *)&event->frame_control;
|
||||||
|
@ -2478,7 +2478,7 @@ static void rndis_fill_station_info(struct usbnet *usbdev,
|
|||||||
ret = rndis_query_oid(usbdev, RNDIS_OID_GEN_LINK_SPEED, &linkspeed, &len);
|
ret = rndis_query_oid(usbdev, RNDIS_OID_GEN_LINK_SPEED, &linkspeed, &len);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
sinfo->txrate.legacy = le32_to_cpu(linkspeed) / 1000;
|
sinfo->txrate.legacy = le32_to_cpu(linkspeed) / 1000;
|
||||||
sinfo->filled |= STATION_INFO_TX_BITRATE;
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
len = sizeof(rssi);
|
len = sizeof(rssi);
|
||||||
@ -2486,7 +2486,7 @@ static void rndis_fill_station_info(struct usbnet *usbdev,
|
|||||||
&rssi, &len);
|
&rssi, &len);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
sinfo->signal = level_to_qual(le32_to_cpu(rssi));
|
sinfo->signal = level_to_qual(le32_to_cpu(rssi));
|
||||||
sinfo->filled |= STATION_INFO_SIGNAL;
|
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5401,7 +5401,7 @@ static void wlcore_op_sta_statistics(struct ieee80211_hw *hw,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out_sleep;
|
goto out_sleep;
|
||||||
|
|
||||||
sinfo->filled |= STATION_INFO_SIGNAL;
|
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
|
||||||
sinfo->signal = rssi_dbm;
|
sinfo->signal = rssi_dbm;
|
||||||
|
|
||||||
out_sleep:
|
out_sleep:
|
||||||
|
@ -1092,17 +1092,17 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy,
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
sinfo->filled |= STATION_INFO_SIGNAL;
|
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
|
||||||
sinfo->signal = translate_percentage_to_dbm(padapter->recvpriv.
|
sinfo->signal = translate_percentage_to_dbm(padapter->recvpriv.
|
||||||
signal_strength);
|
signal_strength);
|
||||||
|
|
||||||
sinfo->filled |= STATION_INFO_TX_BITRATE;
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
|
||||||
sinfo->txrate.legacy = rtw_get_cur_max_rate(padapter);
|
sinfo->txrate.legacy = rtw_get_cur_max_rate(padapter);
|
||||||
|
|
||||||
sinfo->filled |= STATION_INFO_RX_PACKETS;
|
sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS);
|
||||||
sinfo->rx_packets = sta_rx_data_pkts(psta);
|
sinfo->rx_packets = sta_rx_data_pkts(psta);
|
||||||
|
|
||||||
sinfo->filled |= STATION_INFO_TX_PACKETS;
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS);
|
||||||
sinfo->tx_packets = psta->sta_stats.tx_pkts;
|
sinfo->tx_packets = psta->sta_stats.tx_pkts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2365,7 +2365,6 @@ void rtw_cfg80211_indicate_sta_assoc(struct rtw_adapter *padapter,
|
|||||||
u.reassoc_req.variable);
|
u.reassoc_req.variable);
|
||||||
|
|
||||||
sinfo.filled = 0;
|
sinfo.filled = 0;
|
||||||
sinfo.filled = STATION_INFO_ASSOC_REQ_IES;
|
|
||||||
sinfo.assoc_req_ies = pmgmt_frame + ie_offset;
|
sinfo.assoc_req_ies = pmgmt_frame + ie_offset;
|
||||||
sinfo.assoc_req_ies_len = frame_len - ie_offset;
|
sinfo.assoc_req_ies_len = frame_len - ie_offset;
|
||||||
cfg80211_new_sta(ndev, hdr->addr2, &sinfo, GFP_ATOMIC);
|
cfg80211_new_sta(ndev, hdr->addr2, &sinfo, GFP_ATOMIC);
|
||||||
|
@ -325,9 +325,9 @@ static int prism2_get_station(struct wiphy *wiphy, struct net_device *dev,
|
|||||||
|
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
sinfo->txrate.legacy = quality.txrate.data;
|
sinfo->txrate.legacy = quality.txrate.data;
|
||||||
sinfo->filled |= STATION_INFO_TX_BITRATE;
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
|
||||||
sinfo->signal = quality.level.data;
|
sinfo->signal = quality.level.data;
|
||||||
sinfo->filled |= STATION_INFO_SIGNAL;
|
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -865,75 +865,6 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
|
|||||||
struct station_parameters *params,
|
struct station_parameters *params,
|
||||||
enum cfg80211_station_type statype);
|
enum cfg80211_station_type statype);
|
||||||
|
|
||||||
/**
|
|
||||||
* enum station_info_flags - station information flags
|
|
||||||
*
|
|
||||||
* Used by the driver to indicate which info in &struct station_info
|
|
||||||
* it has filled in during get_station() or dump_station().
|
|
||||||
*
|
|
||||||
* @STATION_INFO_INACTIVE_TIME: @inactive_time filled
|
|
||||||
* @STATION_INFO_RX_BYTES: @rx_bytes filled
|
|
||||||
* @STATION_INFO_TX_BYTES: @tx_bytes filled
|
|
||||||
* @STATION_INFO_RX_BYTES64: @rx_bytes filled with 64-bit value
|
|
||||||
* @STATION_INFO_TX_BYTES64: @tx_bytes filled with 64-bit value
|
|
||||||
* @STATION_INFO_LLID: @llid filled
|
|
||||||
* @STATION_INFO_PLID: @plid filled
|
|
||||||
* @STATION_INFO_PLINK_STATE: @plink_state filled
|
|
||||||
* @STATION_INFO_SIGNAL: @signal filled
|
|
||||||
* @STATION_INFO_TX_BITRATE: @txrate fields are filled
|
|
||||||
* (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs)
|
|
||||||
* @STATION_INFO_RX_PACKETS: @rx_packets filled with 32-bit value
|
|
||||||
* @STATION_INFO_TX_PACKETS: @tx_packets filled with 32-bit value
|
|
||||||
* @STATION_INFO_TX_RETRIES: @tx_retries filled
|
|
||||||
* @STATION_INFO_TX_FAILED: @tx_failed filled
|
|
||||||
* @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled
|
|
||||||
* @STATION_INFO_SIGNAL_AVG: @signal_avg filled
|
|
||||||
* @STATION_INFO_RX_BITRATE: @rxrate fields are filled
|
|
||||||
* @STATION_INFO_BSS_PARAM: @bss_param filled
|
|
||||||
* @STATION_INFO_CONNECTED_TIME: @connected_time filled
|
|
||||||
* @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled
|
|
||||||
* @STATION_INFO_STA_FLAGS: @sta_flags filled
|
|
||||||
* @STATION_INFO_BEACON_LOSS_COUNT: @beacon_loss_count filled
|
|
||||||
* @STATION_INFO_T_OFFSET: @t_offset filled
|
|
||||||
* @STATION_INFO_LOCAL_PM: @local_pm filled
|
|
||||||
* @STATION_INFO_PEER_PM: @peer_pm filled
|
|
||||||
* @STATION_INFO_NONPEER_PM: @nonpeer_pm filled
|
|
||||||
* @STATION_INFO_CHAIN_SIGNAL: @chain_signal filled
|
|
||||||
* @STATION_INFO_CHAIN_SIGNAL_AVG: @chain_signal_avg filled
|
|
||||||
* @STATION_INFO_EXPECTED_THROUGHPUT: @expected_throughput filled
|
|
||||||
*/
|
|
||||||
enum station_info_flags {
|
|
||||||
STATION_INFO_INACTIVE_TIME = BIT(0),
|
|
||||||
STATION_INFO_RX_BYTES = BIT(1),
|
|
||||||
STATION_INFO_TX_BYTES = BIT(2),
|
|
||||||
STATION_INFO_LLID = BIT(3),
|
|
||||||
STATION_INFO_PLID = BIT(4),
|
|
||||||
STATION_INFO_PLINK_STATE = BIT(5),
|
|
||||||
STATION_INFO_SIGNAL = BIT(6),
|
|
||||||
STATION_INFO_TX_BITRATE = BIT(7),
|
|
||||||
STATION_INFO_RX_PACKETS = BIT(8),
|
|
||||||
STATION_INFO_TX_PACKETS = BIT(9),
|
|
||||||
STATION_INFO_TX_RETRIES = BIT(10),
|
|
||||||
STATION_INFO_TX_FAILED = BIT(11),
|
|
||||||
STATION_INFO_RX_DROP_MISC = BIT(12),
|
|
||||||
STATION_INFO_SIGNAL_AVG = BIT(13),
|
|
||||||
STATION_INFO_RX_BITRATE = BIT(14),
|
|
||||||
STATION_INFO_BSS_PARAM = BIT(15),
|
|
||||||
STATION_INFO_CONNECTED_TIME = BIT(16),
|
|
||||||
STATION_INFO_ASSOC_REQ_IES = BIT(17),
|
|
||||||
STATION_INFO_STA_FLAGS = BIT(18),
|
|
||||||
STATION_INFO_BEACON_LOSS_COUNT = BIT(19),
|
|
||||||
STATION_INFO_T_OFFSET = BIT(20),
|
|
||||||
STATION_INFO_LOCAL_PM = BIT(21),
|
|
||||||
STATION_INFO_PEER_PM = BIT(22),
|
|
||||||
STATION_INFO_NONPEER_PM = BIT(23),
|
|
||||||
STATION_INFO_RX_BYTES64 = BIT(24),
|
|
||||||
STATION_INFO_TX_BYTES64 = BIT(25),
|
|
||||||
STATION_INFO_CHAIN_SIGNAL = BIT(26),
|
|
||||||
STATION_INFO_CHAIN_SIGNAL_AVG = BIT(27),
|
|
||||||
STATION_INFO_EXPECTED_THROUGHPUT = BIT(28),
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enum station_info_rate_flags - bitrate info flags
|
* enum station_info_rate_flags - bitrate info flags
|
||||||
*
|
*
|
||||||
@ -1015,7 +946,8 @@ struct sta_bss_parameters {
|
|||||||
*
|
*
|
||||||
* Station information filled by driver for get_station() and dump_station.
|
* Station information filled by driver for get_station() and dump_station.
|
||||||
*
|
*
|
||||||
* @filled: bitflag of flags from &enum station_info_flags
|
* @filled: bitflag of flags using the bits of &enum nl80211_sta_info to
|
||||||
|
* indicate the relevant values in this struct for them
|
||||||
* @connected_time: time(in secs) since a station is last connected
|
* @connected_time: time(in secs) since a station is last connected
|
||||||
* @inactive_time: time since last station activity (tx/rx) in milliseconds
|
* @inactive_time: time since last station activity (tx/rx) in milliseconds
|
||||||
* @rx_bytes: bytes received from this station
|
* @rx_bytes: bytes received from this station
|
||||||
@ -1094,11 +1026,6 @@ struct station_info {
|
|||||||
enum nl80211_mesh_power_mode nonpeer_pm;
|
enum nl80211_mesh_power_mode nonpeer_pm;
|
||||||
|
|
||||||
u32 expected_throughput;
|
u32 expected_throughput;
|
||||||
|
|
||||||
/*
|
|
||||||
* Note: Add a new enum station_info_flags value for each new field and
|
|
||||||
* use it to check which fields are initialized.
|
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2373,6 +2373,8 @@ enum nl80211_sta_bss_param {
|
|||||||
* Same format as NL80211_STA_INFO_CHAIN_SIGNAL.
|
* Same format as NL80211_STA_INFO_CHAIN_SIGNAL.
|
||||||
* @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the
|
* @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the
|
||||||
* 802.11 header (u32, kbps)
|
* 802.11 header (u32, kbps)
|
||||||
|
* @NL80211_STA_INFO_RX_DROP_MISC: RX packets dropped for unspecified reasons
|
||||||
|
* (u64)
|
||||||
* @__NL80211_STA_INFO_AFTER_LAST: internal
|
* @__NL80211_STA_INFO_AFTER_LAST: internal
|
||||||
* @NL80211_STA_INFO_MAX: highest possible station info attribute
|
* @NL80211_STA_INFO_MAX: highest possible station info attribute
|
||||||
*/
|
*/
|
||||||
@ -2405,6 +2407,7 @@ enum nl80211_sta_info {
|
|||||||
NL80211_STA_INFO_CHAIN_SIGNAL,
|
NL80211_STA_INFO_CHAIN_SIGNAL,
|
||||||
NL80211_STA_INFO_CHAIN_SIGNAL_AVG,
|
NL80211_STA_INFO_CHAIN_SIGNAL_AVG,
|
||||||
NL80211_STA_INFO_EXPECTED_THROUGHPUT,
|
NL80211_STA_INFO_EXPECTED_THROUGHPUT,
|
||||||
|
NL80211_STA_INFO_RX_DROP_MISC,
|
||||||
|
|
||||||
/* keep last */
|
/* keep last */
|
||||||
__NL80211_STA_INFO_AFTER_LAST,
|
__NL80211_STA_INFO_AFTER_LAST,
|
||||||
|
@ -117,16 +117,16 @@ static void ieee80211_get_stats(struct net_device *dev,
|
|||||||
data[i++] = sta->sta_state;
|
data[i++] = sta->sta_state;
|
||||||
|
|
||||||
|
|
||||||
if (sinfo.filled & STATION_INFO_TX_BITRATE)
|
if (sinfo.filled & BIT(NL80211_STA_INFO_TX_BITRATE))
|
||||||
data[i] = 100000 *
|
data[i] = 100000 *
|
||||||
cfg80211_calculate_bitrate(&sinfo.txrate);
|
cfg80211_calculate_bitrate(&sinfo.txrate);
|
||||||
i++;
|
i++;
|
||||||
if (sinfo.filled & STATION_INFO_RX_BITRATE)
|
if (sinfo.filled & BIT(NL80211_STA_INFO_RX_BITRATE))
|
||||||
data[i] = 100000 *
|
data[i] = 100000 *
|
||||||
cfg80211_calculate_bitrate(&sinfo.rxrate);
|
cfg80211_calculate_bitrate(&sinfo.rxrate);
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
if (sinfo.filled & STATION_INFO_SIGNAL_AVG)
|
if (sinfo.filled & BIT(NL80211_STA_INFO_SIGNAL_AVG))
|
||||||
data[i] = (u8)sinfo.signal_avg;
|
data[i] = (u8)sinfo.signal_avg;
|
||||||
i++;
|
i++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1756,51 +1756,51 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
|
|||||||
|
|
||||||
drv_sta_statistics(local, sdata, &sta->sta, sinfo);
|
drv_sta_statistics(local, sdata, &sta->sta, sinfo);
|
||||||
|
|
||||||
sinfo->filled |= STATION_INFO_INACTIVE_TIME |
|
sinfo->filled |= BIT(NL80211_STA_INFO_INACTIVE_TIME) |
|
||||||
STATION_INFO_STA_FLAGS |
|
BIT(NL80211_STA_INFO_STA_FLAGS) |
|
||||||
STATION_INFO_BSS_PARAM |
|
BIT(NL80211_STA_INFO_BSS_PARAM) |
|
||||||
STATION_INFO_CONNECTED_TIME |
|
BIT(NL80211_STA_INFO_CONNECTED_TIME) |
|
||||||
STATION_INFO_RX_DROP_MISC |
|
BIT(NL80211_STA_INFO_RX_DROP_MISC) |
|
||||||
STATION_INFO_BEACON_LOSS_COUNT;
|
BIT(NL80211_STA_INFO_BEACON_LOSS);
|
||||||
|
|
||||||
ktime_get_ts(&uptime);
|
ktime_get_ts(&uptime);
|
||||||
sinfo->connected_time = uptime.tv_sec - sta->last_connected;
|
sinfo->connected_time = uptime.tv_sec - sta->last_connected;
|
||||||
sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx);
|
sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx);
|
||||||
|
|
||||||
if (!(sinfo->filled & (STATION_INFO_TX_BYTES64 |
|
if (!(sinfo->filled & (BIT(NL80211_STA_INFO_TX_BYTES64) |
|
||||||
STATION_INFO_TX_BYTES))) {
|
BIT(NL80211_STA_INFO_TX_BYTES)))) {
|
||||||
sinfo->tx_bytes = 0;
|
sinfo->tx_bytes = 0;
|
||||||
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
|
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
|
||||||
sinfo->tx_bytes += sta->tx_bytes[ac];
|
sinfo->tx_bytes += sta->tx_bytes[ac];
|
||||||
sinfo->filled |= STATION_INFO_TX_BYTES64;
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_BYTES64);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(sinfo->filled & STATION_INFO_TX_PACKETS)) {
|
if (!(sinfo->filled & BIT(NL80211_STA_INFO_TX_PACKETS))) {
|
||||||
sinfo->tx_packets = 0;
|
sinfo->tx_packets = 0;
|
||||||
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
|
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
|
||||||
sinfo->tx_packets += sta->tx_packets[ac];
|
sinfo->tx_packets += sta->tx_packets[ac];
|
||||||
sinfo->filled |= STATION_INFO_TX_PACKETS;
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(sinfo->filled & (STATION_INFO_RX_BYTES64 |
|
if (!(sinfo->filled & (BIT(NL80211_STA_INFO_RX_BYTES64) |
|
||||||
STATION_INFO_RX_BYTES))) {
|
BIT(NL80211_STA_INFO_RX_BYTES)))) {
|
||||||
sinfo->rx_bytes = sta->rx_bytes;
|
sinfo->rx_bytes = sta->rx_bytes;
|
||||||
sinfo->filled |= STATION_INFO_RX_BYTES64;
|
sinfo->filled |= BIT(NL80211_STA_INFO_RX_BYTES64);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(sinfo->filled & STATION_INFO_RX_PACKETS)) {
|
if (!(sinfo->filled & BIT(NL80211_STA_INFO_RX_PACKETS))) {
|
||||||
sinfo->rx_packets = sta->rx_packets;
|
sinfo->rx_packets = sta->rx_packets;
|
||||||
sinfo->filled |= STATION_INFO_RX_PACKETS;
|
sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(sinfo->filled & STATION_INFO_TX_RETRIES)) {
|
if (!(sinfo->filled & BIT(NL80211_STA_INFO_TX_RETRIES))) {
|
||||||
sinfo->tx_retries = sta->tx_retry_count;
|
sinfo->tx_retries = sta->tx_retry_count;
|
||||||
sinfo->filled |= STATION_INFO_TX_RETRIES;
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_RETRIES);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(sinfo->filled & STATION_INFO_TX_FAILED)) {
|
if (!(sinfo->filled & BIT(NL80211_STA_INFO_TX_FAILED))) {
|
||||||
sinfo->tx_failed = sta->tx_retry_failed;
|
sinfo->tx_failed = sta->tx_retry_failed;
|
||||||
sinfo->filled |= STATION_INFO_TX_FAILED;
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
sinfo->rx_dropped_misc = sta->rx_dropped;
|
sinfo->rx_dropped_misc = sta->rx_dropped;
|
||||||
@ -1808,22 +1808,22 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
|
|||||||
|
|
||||||
if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) ||
|
if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) ||
|
||||||
(sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) {
|
(sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) {
|
||||||
if (!(sinfo->filled & STATION_INFO_SIGNAL)) {
|
if (!(sinfo->filled & BIT(NL80211_STA_INFO_SIGNAL))) {
|
||||||
sinfo->signal = (s8)sta->last_signal;
|
sinfo->signal = (s8)sta->last_signal;
|
||||||
sinfo->filled |= STATION_INFO_SIGNAL;
|
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(sinfo->filled & STATION_INFO_SIGNAL_AVG)) {
|
if (!(sinfo->filled & BIT(NL80211_STA_INFO_SIGNAL_AVG))) {
|
||||||
sinfo->signal_avg = (s8) -ewma_read(&sta->avg_signal);
|
sinfo->signal_avg = (s8) -ewma_read(&sta->avg_signal);
|
||||||
sinfo->filled |= STATION_INFO_SIGNAL_AVG;
|
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL_AVG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sta->chains &&
|
if (sta->chains &&
|
||||||
!(sinfo->filled & (STATION_INFO_CHAIN_SIGNAL |
|
!(sinfo->filled & (BIT(NL80211_STA_INFO_CHAIN_SIGNAL) |
|
||||||
STATION_INFO_CHAIN_SIGNAL_AVG))) {
|
BIT(NL80211_STA_INFO_CHAIN_SIGNAL_AVG)))) {
|
||||||
sinfo->filled |= STATION_INFO_CHAIN_SIGNAL |
|
sinfo->filled |= BIT(NL80211_STA_INFO_CHAIN_SIGNAL) |
|
||||||
STATION_INFO_CHAIN_SIGNAL_AVG;
|
BIT(NL80211_STA_INFO_CHAIN_SIGNAL_AVG);
|
||||||
|
|
||||||
sinfo->chains = sta->chains;
|
sinfo->chains = sta->chains;
|
||||||
for (i = 0; i < ARRAY_SIZE(sinfo->chain_signal); i++) {
|
for (i = 0; i < ARRAY_SIZE(sinfo->chain_signal); i++) {
|
||||||
@ -1833,30 +1833,30 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(sinfo->filled & STATION_INFO_TX_BITRATE)) {
|
if (!(sinfo->filled & BIT(NL80211_STA_INFO_TX_BITRATE))) {
|
||||||
sta_set_rate_info_tx(sta, &sta->last_tx_rate, &sinfo->txrate);
|
sta_set_rate_info_tx(sta, &sta->last_tx_rate, &sinfo->txrate);
|
||||||
sinfo->filled |= STATION_INFO_TX_BITRATE;
|
sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(sinfo->filled & STATION_INFO_RX_BITRATE)) {
|
if (!(sinfo->filled & BIT(NL80211_STA_INFO_RX_BITRATE))) {
|
||||||
sta_set_rate_info_rx(sta, &sinfo->rxrate);
|
sta_set_rate_info_rx(sta, &sinfo->rxrate);
|
||||||
sinfo->filled |= STATION_INFO_RX_BITRATE;
|
sinfo->filled |= BIT(NL80211_STA_INFO_RX_BITRATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ieee80211_vif_is_mesh(&sdata->vif)) {
|
if (ieee80211_vif_is_mesh(&sdata->vif)) {
|
||||||
#ifdef CONFIG_MAC80211_MESH
|
#ifdef CONFIG_MAC80211_MESH
|
||||||
sinfo->filled |= STATION_INFO_LLID |
|
sinfo->filled |= BIT(NL80211_STA_INFO_LLID) |
|
||||||
STATION_INFO_PLID |
|
BIT(NL80211_STA_INFO_PLID) |
|
||||||
STATION_INFO_PLINK_STATE |
|
BIT(NL80211_STA_INFO_PLINK_STATE) |
|
||||||
STATION_INFO_LOCAL_PM |
|
BIT(NL80211_STA_INFO_LOCAL_PM) |
|
||||||
STATION_INFO_PEER_PM |
|
BIT(NL80211_STA_INFO_PEER_PM) |
|
||||||
STATION_INFO_NONPEER_PM;
|
BIT(NL80211_STA_INFO_NONPEER_PM);
|
||||||
|
|
||||||
sinfo->llid = sta->llid;
|
sinfo->llid = sta->llid;
|
||||||
sinfo->plid = sta->plid;
|
sinfo->plid = sta->plid;
|
||||||
sinfo->plink_state = sta->plink_state;
|
sinfo->plink_state = sta->plink_state;
|
||||||
if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) {
|
if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) {
|
||||||
sinfo->filled |= STATION_INFO_T_OFFSET;
|
sinfo->filled |= BIT(NL80211_STA_INFO_T_OFFSET);
|
||||||
sinfo->t_offset = sta->t_offset;
|
sinfo->t_offset = sta->t_offset;
|
||||||
}
|
}
|
||||||
sinfo->local_pm = sta->local_pm;
|
sinfo->local_pm = sta->local_pm;
|
||||||
@ -1905,7 +1905,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
|
|||||||
thr = drv_get_expected_throughput(local, &sta->sta);
|
thr = drv_get_expected_throughput(local, &sta->sta);
|
||||||
|
|
||||||
if (thr != 0) {
|
if (thr != 0) {
|
||||||
sinfo->filled |= STATION_INFO_EXPECTED_THROUGHPUT;
|
sinfo->filled |= BIT(NL80211_STA_INFO_EXPECTED_THROUGHPUT);
|
||||||
sinfo->expected_throughput = thr;
|
sinfo->expected_throughput = thr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3671,115 +3671,77 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
|
|||||||
sinfoattr = nla_nest_start(msg, NL80211_ATTR_STA_INFO);
|
sinfoattr = nla_nest_start(msg, NL80211_ATTR_STA_INFO);
|
||||||
if (!sinfoattr)
|
if (!sinfoattr)
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
if ((sinfo->filled & STATION_INFO_CONNECTED_TIME) &&
|
|
||||||
nla_put_u32(msg, NL80211_STA_INFO_CONNECTED_TIME,
|
#define PUT_SINFO(attr, memb, type) do { \
|
||||||
sinfo->connected_time))
|
if (sinfo->filled & BIT(NL80211_STA_INFO_ ## attr) && \
|
||||||
goto nla_put_failure;
|
nla_put_ ## type(msg, NL80211_STA_INFO_ ## attr, \
|
||||||
if ((sinfo->filled & STATION_INFO_INACTIVE_TIME) &&
|
sinfo->memb)) \
|
||||||
nla_put_u32(msg, NL80211_STA_INFO_INACTIVE_TIME,
|
goto nla_put_failure; \
|
||||||
sinfo->inactive_time))
|
} while (0)
|
||||||
goto nla_put_failure;
|
|
||||||
if ((sinfo->filled & (STATION_INFO_RX_BYTES |
|
PUT_SINFO(CONNECTED_TIME, connected_time, u32);
|
||||||
STATION_INFO_RX_BYTES64)) &&
|
PUT_SINFO(INACTIVE_TIME, inactive_time, u32);
|
||||||
|
|
||||||
|
if (sinfo->filled & (BIT(NL80211_STA_INFO_RX_BYTES) |
|
||||||
|
BIT(NL80211_STA_INFO_RX_BYTES64)) &&
|
||||||
nla_put_u32(msg, NL80211_STA_INFO_RX_BYTES,
|
nla_put_u32(msg, NL80211_STA_INFO_RX_BYTES,
|
||||||
(u32)sinfo->rx_bytes))
|
(u32)sinfo->rx_bytes))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
if ((sinfo->filled & (STATION_INFO_TX_BYTES |
|
|
||||||
STATION_INFO_TX_BYTES64)) &&
|
if (sinfo->filled & (BIT(NL80211_STA_INFO_TX_BYTES) |
|
||||||
|
BIT(NL80211_STA_INFO_TX_BYTES64)) &&
|
||||||
nla_put_u32(msg, NL80211_STA_INFO_TX_BYTES,
|
nla_put_u32(msg, NL80211_STA_INFO_TX_BYTES,
|
||||||
(u32)sinfo->tx_bytes))
|
(u32)sinfo->tx_bytes))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
if ((sinfo->filled & STATION_INFO_RX_BYTES64) &&
|
|
||||||
nla_put_u64(msg, NL80211_STA_INFO_RX_BYTES64,
|
PUT_SINFO(RX_BYTES64, rx_bytes, u64);
|
||||||
sinfo->rx_bytes))
|
PUT_SINFO(TX_BYTES64, tx_bytes, u64);
|
||||||
goto nla_put_failure;
|
PUT_SINFO(LLID, llid, u16);
|
||||||
if ((sinfo->filled & STATION_INFO_TX_BYTES64) &&
|
PUT_SINFO(PLID, plid, u16);
|
||||||
nla_put_u64(msg, NL80211_STA_INFO_TX_BYTES64,
|
PUT_SINFO(PLINK_STATE, plink_state, u8);
|
||||||
sinfo->tx_bytes))
|
|
||||||
goto nla_put_failure;
|
|
||||||
if ((sinfo->filled & STATION_INFO_LLID) &&
|
|
||||||
nla_put_u16(msg, NL80211_STA_INFO_LLID, sinfo->llid))
|
|
||||||
goto nla_put_failure;
|
|
||||||
if ((sinfo->filled & STATION_INFO_PLID) &&
|
|
||||||
nla_put_u16(msg, NL80211_STA_INFO_PLID, sinfo->plid))
|
|
||||||
goto nla_put_failure;
|
|
||||||
if ((sinfo->filled & STATION_INFO_PLINK_STATE) &&
|
|
||||||
nla_put_u8(msg, NL80211_STA_INFO_PLINK_STATE,
|
|
||||||
sinfo->plink_state))
|
|
||||||
goto nla_put_failure;
|
|
||||||
switch (rdev->wiphy.signal_type) {
|
switch (rdev->wiphy.signal_type) {
|
||||||
case CFG80211_SIGNAL_TYPE_MBM:
|
case CFG80211_SIGNAL_TYPE_MBM:
|
||||||
if ((sinfo->filled & STATION_INFO_SIGNAL) &&
|
PUT_SINFO(SIGNAL, signal, u8);
|
||||||
nla_put_u8(msg, NL80211_STA_INFO_SIGNAL,
|
PUT_SINFO(SIGNAL_AVG, signal_avg, u8);
|
||||||
sinfo->signal))
|
|
||||||
goto nla_put_failure;
|
|
||||||
if ((sinfo->filled & STATION_INFO_SIGNAL_AVG) &&
|
|
||||||
nla_put_u8(msg, NL80211_STA_INFO_SIGNAL_AVG,
|
|
||||||
sinfo->signal_avg))
|
|
||||||
goto nla_put_failure;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (sinfo->filled & STATION_INFO_CHAIN_SIGNAL) {
|
if (sinfo->filled & BIT(NL80211_STA_INFO_CHAIN_SIGNAL)) {
|
||||||
if (!nl80211_put_signal(msg, sinfo->chains,
|
if (!nl80211_put_signal(msg, sinfo->chains,
|
||||||
sinfo->chain_signal,
|
sinfo->chain_signal,
|
||||||
NL80211_STA_INFO_CHAIN_SIGNAL))
|
NL80211_STA_INFO_CHAIN_SIGNAL))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
}
|
}
|
||||||
if (sinfo->filled & STATION_INFO_CHAIN_SIGNAL_AVG) {
|
if (sinfo->filled & BIT(NL80211_STA_INFO_CHAIN_SIGNAL_AVG)) {
|
||||||
if (!nl80211_put_signal(msg, sinfo->chains,
|
if (!nl80211_put_signal(msg, sinfo->chains,
|
||||||
sinfo->chain_signal_avg,
|
sinfo->chain_signal_avg,
|
||||||
NL80211_STA_INFO_CHAIN_SIGNAL_AVG))
|
NL80211_STA_INFO_CHAIN_SIGNAL_AVG))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
}
|
}
|
||||||
if (sinfo->filled & STATION_INFO_TX_BITRATE) {
|
if (sinfo->filled & BIT(NL80211_STA_INFO_TX_BITRATE)) {
|
||||||
if (!nl80211_put_sta_rate(msg, &sinfo->txrate,
|
if (!nl80211_put_sta_rate(msg, &sinfo->txrate,
|
||||||
NL80211_STA_INFO_TX_BITRATE))
|
NL80211_STA_INFO_TX_BITRATE))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
}
|
}
|
||||||
if (sinfo->filled & STATION_INFO_RX_BITRATE) {
|
if (sinfo->filled & BIT(NL80211_STA_INFO_RX_BITRATE)) {
|
||||||
if (!nl80211_put_sta_rate(msg, &sinfo->rxrate,
|
if (!nl80211_put_sta_rate(msg, &sinfo->rxrate,
|
||||||
NL80211_STA_INFO_RX_BITRATE))
|
NL80211_STA_INFO_RX_BITRATE))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
}
|
}
|
||||||
if ((sinfo->filled & STATION_INFO_RX_PACKETS) &&
|
|
||||||
nla_put_u32(msg, NL80211_STA_INFO_RX_PACKETS,
|
PUT_SINFO(RX_PACKETS, rx_packets, u32);
|
||||||
sinfo->rx_packets))
|
PUT_SINFO(TX_PACKETS, tx_packets, u32);
|
||||||
goto nla_put_failure;
|
PUT_SINFO(TX_RETRIES, tx_retries, u32);
|
||||||
if ((sinfo->filled & STATION_INFO_TX_PACKETS) &&
|
PUT_SINFO(TX_FAILED, tx_failed, u32);
|
||||||
nla_put_u32(msg, NL80211_STA_INFO_TX_PACKETS,
|
PUT_SINFO(EXPECTED_THROUGHPUT, expected_throughput, u32);
|
||||||
sinfo->tx_packets))
|
PUT_SINFO(BEACON_LOSS, beacon_loss_count, u32);
|
||||||
goto nla_put_failure;
|
PUT_SINFO(LOCAL_PM, local_pm, u32);
|
||||||
if ((sinfo->filled & STATION_INFO_TX_RETRIES) &&
|
PUT_SINFO(PEER_PM, peer_pm, u32);
|
||||||
nla_put_u32(msg, NL80211_STA_INFO_TX_RETRIES,
|
PUT_SINFO(NONPEER_PM, nonpeer_pm, u32);
|
||||||
sinfo->tx_retries))
|
|
||||||
goto nla_put_failure;
|
if (sinfo->filled & BIT(NL80211_STA_INFO_BSS_PARAM)) {
|
||||||
if ((sinfo->filled & STATION_INFO_TX_FAILED) &&
|
|
||||||
nla_put_u32(msg, NL80211_STA_INFO_TX_FAILED,
|
|
||||||
sinfo->tx_failed))
|
|
||||||
goto nla_put_failure;
|
|
||||||
if ((sinfo->filled & STATION_INFO_EXPECTED_THROUGHPUT) &&
|
|
||||||
nla_put_u32(msg, NL80211_STA_INFO_EXPECTED_THROUGHPUT,
|
|
||||||
sinfo->expected_throughput))
|
|
||||||
goto nla_put_failure;
|
|
||||||
if ((sinfo->filled & STATION_INFO_BEACON_LOSS_COUNT) &&
|
|
||||||
nla_put_u32(msg, NL80211_STA_INFO_BEACON_LOSS,
|
|
||||||
sinfo->beacon_loss_count))
|
|
||||||
goto nla_put_failure;
|
|
||||||
if ((sinfo->filled & STATION_INFO_LOCAL_PM) &&
|
|
||||||
nla_put_u32(msg, NL80211_STA_INFO_LOCAL_PM,
|
|
||||||
sinfo->local_pm))
|
|
||||||
goto nla_put_failure;
|
|
||||||
if ((sinfo->filled & STATION_INFO_PEER_PM) &&
|
|
||||||
nla_put_u32(msg, NL80211_STA_INFO_PEER_PM,
|
|
||||||
sinfo->peer_pm))
|
|
||||||
goto nla_put_failure;
|
|
||||||
if ((sinfo->filled & STATION_INFO_NONPEER_PM) &&
|
|
||||||
nla_put_u32(msg, NL80211_STA_INFO_NONPEER_PM,
|
|
||||||
sinfo->nonpeer_pm))
|
|
||||||
goto nla_put_failure;
|
|
||||||
if (sinfo->filled & STATION_INFO_BSS_PARAM) {
|
|
||||||
bss_param = nla_nest_start(msg, NL80211_STA_INFO_BSS_PARAM);
|
bss_param = nla_nest_start(msg, NL80211_STA_INFO_BSS_PARAM);
|
||||||
if (!bss_param)
|
if (!bss_param)
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
@ -3798,18 +3760,19 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
|
|||||||
|
|
||||||
nla_nest_end(msg, bss_param);
|
nla_nest_end(msg, bss_param);
|
||||||
}
|
}
|
||||||
if ((sinfo->filled & STATION_INFO_STA_FLAGS) &&
|
if ((sinfo->filled & BIT(NL80211_STA_INFO_STA_FLAGS)) &&
|
||||||
nla_put(msg, NL80211_STA_INFO_STA_FLAGS,
|
nla_put(msg, NL80211_STA_INFO_STA_FLAGS,
|
||||||
sizeof(struct nl80211_sta_flag_update),
|
sizeof(struct nl80211_sta_flag_update),
|
||||||
&sinfo->sta_flags))
|
&sinfo->sta_flags))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
if ((sinfo->filled & STATION_INFO_T_OFFSET) &&
|
|
||||||
nla_put_u64(msg, NL80211_STA_INFO_T_OFFSET,
|
PUT_SINFO(T_OFFSET, t_offset, u64);
|
||||||
sinfo->t_offset))
|
PUT_SINFO(RX_DROP_MISC, rx_dropped_misc, u64);
|
||||||
goto nla_put_failure;
|
|
||||||
|
#undef PUT_SINFO
|
||||||
nla_nest_end(msg, sinfoattr);
|
nla_nest_end(msg, sinfoattr);
|
||||||
|
|
||||||
if ((sinfo->filled & STATION_INFO_ASSOC_REQ_IES) &&
|
if (sinfo->assoc_req_ies_len &&
|
||||||
nla_put(msg, NL80211_ATTR_IE, sinfo->assoc_req_ies_len,
|
nla_put(msg, NL80211_ATTR_IE, sinfo->assoc_req_ies_len,
|
||||||
sinfo->assoc_req_ies))
|
sinfo->assoc_req_ies))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
|
@ -1300,7 +1300,7 @@ static int cfg80211_wext_giwrate(struct net_device *dev,
|
|||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
if (!(sinfo.filled & STATION_INFO_TX_BITRATE))
|
if (!(sinfo.filled & BIT(NL80211_STA_INFO_TX_BITRATE)))
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
rate->value = 100000 * cfg80211_calculate_bitrate(&sinfo.txrate);
|
rate->value = 100000 * cfg80211_calculate_bitrate(&sinfo.txrate);
|
||||||
@ -1340,7 +1340,7 @@ static struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev)
|
|||||||
|
|
||||||
switch (rdev->wiphy.signal_type) {
|
switch (rdev->wiphy.signal_type) {
|
||||||
case CFG80211_SIGNAL_TYPE_MBM:
|
case CFG80211_SIGNAL_TYPE_MBM:
|
||||||
if (sinfo.filled & STATION_INFO_SIGNAL) {
|
if (sinfo.filled & BIT(NL80211_STA_INFO_SIGNAL)) {
|
||||||
int sig = sinfo.signal;
|
int sig = sinfo.signal;
|
||||||
wstats.qual.updated |= IW_QUAL_LEVEL_UPDATED;
|
wstats.qual.updated |= IW_QUAL_LEVEL_UPDATED;
|
||||||
wstats.qual.updated |= IW_QUAL_QUAL_UPDATED;
|
wstats.qual.updated |= IW_QUAL_QUAL_UPDATED;
|
||||||
@ -1354,7 +1354,7 @@ static struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CFG80211_SIGNAL_TYPE_UNSPEC:
|
case CFG80211_SIGNAL_TYPE_UNSPEC:
|
||||||
if (sinfo.filled & STATION_INFO_SIGNAL) {
|
if (sinfo.filled & BIT(NL80211_STA_INFO_SIGNAL)) {
|
||||||
wstats.qual.updated |= IW_QUAL_LEVEL_UPDATED;
|
wstats.qual.updated |= IW_QUAL_LEVEL_UPDATED;
|
||||||
wstats.qual.updated |= IW_QUAL_QUAL_UPDATED;
|
wstats.qual.updated |= IW_QUAL_QUAL_UPDATED;
|
||||||
wstats.qual.level = sinfo.signal;
|
wstats.qual.level = sinfo.signal;
|
||||||
@ -1367,9 +1367,9 @@ static struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wstats.qual.updated |= IW_QUAL_NOISE_INVALID;
|
wstats.qual.updated |= IW_QUAL_NOISE_INVALID;
|
||||||
if (sinfo.filled & STATION_INFO_RX_DROP_MISC)
|
if (sinfo.filled & BIT(NL80211_STA_INFO_RX_DROP_MISC))
|
||||||
wstats.discard.misc = sinfo.rx_dropped_misc;
|
wstats.discard.misc = sinfo.rx_dropped_misc;
|
||||||
if (sinfo.filled & STATION_INFO_TX_FAILED)
|
if (sinfo.filled & BIT(NL80211_STA_INFO_TX_FAILED))
|
||||||
wstats.discard.retries = sinfo.tx_failed;
|
wstats.discard.retries = sinfo.tx_failed;
|
||||||
|
|
||||||
return &wstats;
|
return &wstats;
|
||||||
|
Loading…
Reference in New Issue
Block a user