sta_info.c (8689c051a20195b228e19acb155c7d6e48a86753) sta_info.c (0fdf1493b41eb64fc7e8c8e1b8830a4bd8c4bbca)
1/*
2 * Copyright 2002-2005, Instant802 Networks, Inc.
3 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
4 * Copyright 2013-2014 Intel Mobile Communications GmbH
5 * Copyright (C) 2015 - 2017 Intel Deutschland GmbH
6 * Copyright (C) 2018 Intel Corporation
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 994 unchanged lines hidden (view full) ---

1003 IEEE80211_STA_NOTEXIST);
1004 WARN_ON_ONCE(ret != 0);
1005 }
1006
1007 sta_dbg(sdata, "Removed STA %pM\n", sta->sta.addr);
1008
1009 sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
1010 if (sinfo)
1/*
2 * Copyright 2002-2005, Instant802 Networks, Inc.
3 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
4 * Copyright 2013-2014 Intel Mobile Communications GmbH
5 * Copyright (C) 2015 - 2017 Intel Deutschland GmbH
6 * Copyright (C) 2018 Intel Corporation
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 994 unchanged lines hidden (view full) ---

1003 IEEE80211_STA_NOTEXIST);
1004 WARN_ON_ONCE(ret != 0);
1005 }
1006
1007 sta_dbg(sdata, "Removed STA %pM\n", sta->sta.addr);
1008
1009 sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
1010 if (sinfo)
1011 sta_set_sinfo(sta, sinfo);
1011 sta_set_sinfo(sta, sinfo, true);
1012 cfg80211_del_sta_sinfo(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL);
1013 kfree(sinfo);
1014
1015 rate_control_remove_sta_debugfs(sta);
1016 ieee80211_sta_debugfs_remove(sta);
1017
1018 cleanup_single_sta(sta);
1019}

--- 1054 unchanged lines hidden (view full) ---

2074 do {
2075 start = u64_stats_fetch_begin(&rxstats->syncp);
2076 value = rxstats->bytes;
2077 } while (u64_stats_fetch_retry(&rxstats->syncp, start));
2078
2079 return value;
2080}
2081
1012 cfg80211_del_sta_sinfo(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL);
1013 kfree(sinfo);
1014
1015 rate_control_remove_sta_debugfs(sta);
1016 ieee80211_sta_debugfs_remove(sta);
1017
1018 cleanup_single_sta(sta);
1019}

--- 1054 unchanged lines hidden (view full) ---

2074 do {
2075 start = u64_stats_fetch_begin(&rxstats->syncp);
2076 value = rxstats->bytes;
2077 } while (u64_stats_fetch_retry(&rxstats->syncp, start));
2078
2079 return value;
2080}
2081
2082void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
2082void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo,
2083 bool tidstats)
2083{
2084 struct ieee80211_sub_if_data *sdata = sta->sdata;
2085 struct ieee80211_local *local = sdata->local;
2086 u32 thr = 0;
2087 int i, ac, cpu;
2088 struct ieee80211_sta_rx_stats *last_rxstats;
2089
2090 last_rxstats = sta_get_last_rx_stats(sta);

--- 137 unchanged lines hidden (view full) ---

2228 sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
2229 }
2230
2231 if (!(sinfo->filled & BIT(NL80211_STA_INFO_RX_BITRATE))) {
2232 if (sta_set_rate_info_rx(sta, &sinfo->rxrate) == 0)
2233 sinfo->filled |= BIT(NL80211_STA_INFO_RX_BITRATE);
2234 }
2235
2084{
2085 struct ieee80211_sub_if_data *sdata = sta->sdata;
2086 struct ieee80211_local *local = sdata->local;
2087 u32 thr = 0;
2088 int i, ac, cpu;
2089 struct ieee80211_sta_rx_stats *last_rxstats;
2090
2091 last_rxstats = sta_get_last_rx_stats(sta);

--- 137 unchanged lines hidden (view full) ---

2229 sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
2230 }
2231
2232 if (!(sinfo->filled & BIT(NL80211_STA_INFO_RX_BITRATE))) {
2233 if (sta_set_rate_info_rx(sta, &sinfo->rxrate) == 0)
2234 sinfo->filled |= BIT(NL80211_STA_INFO_RX_BITRATE);
2235 }
2236
2236 if (!cfg80211_sinfo_alloc_tid_stats(sinfo, GFP_KERNEL)) {
2237 if (tidstats && !cfg80211_sinfo_alloc_tid_stats(sinfo, GFP_KERNEL)) {
2237 for (i = 0; i < IEEE80211_NUM_TIDS + 1; i++) {
2238 struct cfg80211_tid_stats *tidstats = &sinfo->pertid[i];
2239
2240 sta_set_tidstats(sta, tidstats, i);
2241 }
2242 }
2243
2244 if (ieee80211_vif_is_mesh(&sdata->vif)) {

--- 128 unchanged lines hidden ---
2238 for (i = 0; i < IEEE80211_NUM_TIDS + 1; i++) {
2239 struct cfg80211_tid_stats *tidstats = &sinfo->pertid[i];
2240
2241 sta_set_tidstats(sta, tidstats, i);
2242 }
2243 }
2244
2245 if (ieee80211_vif_is_mesh(&sdata->vif)) {

--- 128 unchanged lines hidden ---