aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/cfg80211.h6
-rw-r--r--net/wireless/nl80211.c29
2 files changed, 23 insertions, 12 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 69b7ad3a9925..5ccac722739f 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -619,8 +619,10 @@ struct sta_bss_parameters {
619 * @llid: mesh local link id 619 * @llid: mesh local link id
620 * @plid: mesh peer link id 620 * @plid: mesh peer link id
621 * @plink_state: mesh peer link state 621 * @plink_state: mesh peer link state
622 * @signal: signal strength of last received packet in dBm 622 * @signal: the signal strength, type depends on the wiphy's signal_type
623 * @signal_avg: signal strength average in dBm 623 NOTE: For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.
624 * @signal_avg: avg signal strength, type depends on the wiphy's signal_type
625 NOTE: For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.
624 * @txrate: current unicast bitrate from this station 626 * @txrate: current unicast bitrate from this station
625 * @rxrate: current unicast bitrate to this station 627 * @rxrate: current unicast bitrate to this station
626 * @rx_packets: packets received from this station 628 * @rx_packets: packets received from this station
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 4c1eb9472ddb..e49da2797022 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2386,7 +2386,9 @@ nla_put_failure:
2386} 2386}
2387 2387
2388static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq, 2388static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
2389 int flags, struct net_device *dev, 2389 int flags,
2390 struct cfg80211_registered_device *rdev,
2391 struct net_device *dev,
2390 const u8 *mac_addr, struct station_info *sinfo) 2392 const u8 *mac_addr, struct station_info *sinfo)
2391{ 2393{
2392 void *hdr; 2394 void *hdr;
@@ -2425,12 +2427,18 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
2425 if (sinfo->filled & STATION_INFO_PLINK_STATE) 2427 if (sinfo->filled & STATION_INFO_PLINK_STATE)
2426 NLA_PUT_U8(msg, NL80211_STA_INFO_PLINK_STATE, 2428 NLA_PUT_U8(msg, NL80211_STA_INFO_PLINK_STATE,
2427 sinfo->plink_state); 2429 sinfo->plink_state);
2428 if (sinfo->filled & STATION_INFO_SIGNAL) 2430 switch (rdev->wiphy.signal_type) {
2429 NLA_PUT_U8(msg, NL80211_STA_INFO_SIGNAL, 2431 case CFG80211_SIGNAL_TYPE_MBM:
2430 sinfo->signal); 2432 if (sinfo->filled & STATION_INFO_SIGNAL)
2431 if (sinfo->filled & STATION_INFO_SIGNAL_AVG) 2433 NLA_PUT_U8(msg, NL80211_STA_INFO_SIGNAL,
2432 NLA_PUT_U8(msg, NL80211_STA_INFO_SIGNAL_AVG, 2434 sinfo->signal);
2433 sinfo->signal_avg); 2435 if (sinfo->filled & STATION_INFO_SIGNAL_AVG)
2436 NLA_PUT_U8(msg, NL80211_STA_INFO_SIGNAL_AVG,
2437 sinfo->signal_avg);
2438 break;
2439 default:
2440 break;
2441 }
2434 if (sinfo->filled & STATION_INFO_TX_BITRATE) { 2442 if (sinfo->filled & STATION_INFO_TX_BITRATE) {
2435 if (!nl80211_put_sta_rate(msg, &sinfo->txrate, 2443 if (!nl80211_put_sta_rate(msg, &sinfo->txrate,
2436 NL80211_STA_INFO_TX_BITRATE)) 2444 NL80211_STA_INFO_TX_BITRATE))
@@ -2523,7 +2531,7 @@ static int nl80211_dump_station(struct sk_buff *skb,
2523 if (nl80211_send_station(skb, 2531 if (nl80211_send_station(skb,
2524 NETLINK_CB(cb->skb).pid, 2532 NETLINK_CB(cb->skb).pid,
2525 cb->nlh->nlmsg_seq, NLM_F_MULTI, 2533 cb->nlh->nlmsg_seq, NLM_F_MULTI,
2526 netdev, mac_addr, 2534 dev, netdev, mac_addr,
2527 &sinfo) < 0) 2535 &sinfo) < 0)
2528 goto out; 2536 goto out;
2529 2537
@@ -2568,7 +2576,7 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
2568 return -ENOMEM; 2576 return -ENOMEM;
2569 2577
2570 if (nl80211_send_station(msg, info->snd_pid, info->snd_seq, 0, 2578 if (nl80211_send_station(msg, info->snd_pid, info->snd_seq, 0,
2571 dev, mac_addr, &sinfo) < 0) { 2579 rdev, dev, mac_addr, &sinfo) < 0) {
2572 nlmsg_free(msg); 2580 nlmsg_free(msg);
2573 return -ENOBUFS; 2581 return -ENOBUFS;
2574 } 2582 }
@@ -7596,7 +7604,8 @@ void nl80211_send_sta_event(struct cfg80211_registered_device *rdev,
7596 if (!msg) 7604 if (!msg)
7597 return; 7605 return;
7598 7606
7599 if (nl80211_send_station(msg, 0, 0, 0, dev, mac_addr, sinfo) < 0) { 7607 if (nl80211_send_station(msg, 0, 0, 0,
7608 rdev, dev, mac_addr, sinfo) < 0) {
7600 nlmsg_free(msg); 7609 nlmsg_free(msg);
7601 return; 7610 return;
7602 } 7611 }