summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRongjing Liao <liaor@codeaurora.org>2018-08-28 10:03:46 +0800
committerRongjing Liao <liaor@codeaurora.org>2018-08-28 12:49:12 +0800
commiteddc8234cb09ad09e6ccdd2cc6d9131ce0083249 (patch)
tree458e514f7ee1acc66c41a1e172f989b1eee8b685
parent2497e55a2aa2c2c9dd73eb3fa78b3bbe45893e59 (diff)
qcacld-2.0: fix compile errors
fix compile errors caused by undefined variable "STATION_INFO_TX_PACKETS" on linux kernel version 4.0.0 or higher. Change-Id: I8bc2ce5a0eb71a627d02d14a29ea284ad685248e CRs-Fixed: 2304056
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 88f36dd84e35..c740528144e6 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -26708,6 +26708,7 @@ static int wlan_hdd_get_station_remote(struct wiphy *wiphy,
return status;
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0))
/*
* wlan_hdd_fill_summary_stats() - populate station_info summary stats
* @stats: summary stats to use as a source
@@ -26736,7 +26737,36 @@ static void wlan_hdd_fill_summary_stats(tCsrSummaryStatsInfo *stats,
STATION_INFO_TX_FAILED |
STATION_INFO_RX_PACKETS;
}
+#else
+/*
+ * wlan_hdd_fill_summary_stats() - populate station_info summary stats
+ * @stats: summary stats to use as a source
+ * @info: kernel station_info struct to use as a destination
+ *
+ * Return: None
+ */
+static void wlan_hdd_fill_summary_stats(tCsrSummaryStatsInfo *stats,
+ struct station_info *info)
+{
+ int i;
+ info->rx_packets = stats->rx_frm_cnt;
+ info->tx_packets = 0;
+ info->tx_retries = 0;
+ info->tx_failed = 0;
+
+ for (i = 0; i < 4; ++i) {
+ info->tx_packets += stats->tx_frm_cnt[i];
+ info->tx_retries += stats->multiple_retry_cnt[i];
+ info->tx_failed += stats->fail_cnt[i];
+ }
+
+ info->filled |= BIT(NL80211_STA_INFO_TX_PACKETS) |
+ BIT(NL80211_STA_INFO_TX_RETRIES) |
+ BIT(NL80211_STA_INFO_TX_FAILED) |
+ BIT(NL80211_STA_INFO_RX_PACKETS);
+}
+#endif
/**
* wlan_hdd_get_sap_stats() - get aggregate SAP stats
* @adapter: sap adapter to get stats for