summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrishna Kumaar Natarajan <kknatara@qca.qualcomm.com>2015-04-20 18:48:10 -0700
committerAnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com>2015-04-23 16:08:55 +0530
commitc994ddf822e3ea8094ca821dfa00bbd79d229c48 (patch)
tree0ce7b75012764bf7e13247274f3714ef15671bd2
parent8e0ba338175e03fb24effdec764b0dead4199bd4 (diff)
qcacld: Support to enhance debug framework
Add interface to provide information on supported logger features when requested by the user space application. Change-Id: If70001d431ffc63d54398107bbc685a55cae5011 CRs-Fixed: 826150
-rw-r--r--CORE/HDD/inc/wlan_hdd_cfg80211.h46
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h2
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c62
-rwxr-xr-xCORE/HDD/src/wlan_hdd_main.c16
4 files changed, 124 insertions, 2 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h
index 7e03380c4892..571ec6c03852 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg80211.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h
@@ -220,8 +220,10 @@ enum qca_nl80211_vendor_subcmds {
QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_PASSPOINT_NETWORK_FOUND = 73,
/* Wi-Fi Configuration subcommands */
- QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION = 74,
- QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION = 75,
+ QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION = 74,
+ QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION = 75,
+
+ QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET = 76,
/* OCB commands */
QCA_NL80211_VENDOR_SUBCMD_OCB_SET_CONFIG = 92,
@@ -1249,6 +1251,27 @@ enum qca_wlan_vendor_attr_get_wifi_info {
};
/**
+ * enum qca_wlan_vendor_attr_get_logger_features - value for logger
+ * supported features
+ * @QCA_WLAN_VENDOR_ATTR_LOGGER_INVALID - Invalid
+ * @QCA_WLAN_VENDOR_ATTR_LOGGER_SUPPORTED - Indicate the supported features
+ * @QCA_WLAN_VENDOR_ATTR_LOGGER_AFTER_LAST - To keep track of the last enum
+ * @QCA_WLAN_VENDOR_ATTR_LOGGER_MAX - max value possible for this type
+ *
+ * enum values are used for NL attributes for data used by
+ * QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET sub command.
+ */
+enum qca_wlan_vendor_attr_get_logger_features {
+ QCA_WLAN_VENDOR_ATTR_LOGGER_INVALID = 0,
+ QCA_WLAN_VENDOR_ATTR_LOGGER_SUPPORTED = 1,
+
+ /* keep last */
+ QCA_WLAN_VENDOR_ATTR_LOGGER_AFTER_LAST,
+ QCA_WLAN_VENDOR_ATTR_LOGGER_MAX =
+ QCA_WLAN_VENDOR_ATTR_LOGGER_AFTER_LAST - 1,
+};
+
+/**
* enum qca_wlan_vendor_features - vendor device/driver features
* @QCA_WLAN_VENDOR_FEATURE_KEY_MGMT_OFFLOAD: Device supports key
* management offload, a mechanism where the station's firmware
@@ -1288,6 +1311,25 @@ enum qca_wlan_vendor_features {
/* Add more features here */
+/**
+ * enum wifi_logger_supported_features - values for supported logger features
+ * @WIFI_LOGGER_MEMORY_DUMP_SUPPORTED - Memory dump of FW
+ * @WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED - Per packet statistics
+ * @WIFI_LOGGER_CONNECT_EVENT_SUPPORTED - Logging of Connectivity events
+ * @WIFI_LOGGER_POWER_EVENT_SUPPORTED - Power of driver
+ * @WIFI_LOGGER_WAKE_LOCK_SUPPORTED - Wakelock of driver
+ * @WIFI_LOGGER_WATCHDOG_TIMER_SUPPORTED - monitor FW health
+ */
+enum wifi_logger_supported_features {
+ WIFI_LOGGER_MEMORY_DUMP_SUPPORTED = (1 << (0)),
+ WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED = (1 << (1)),
+ WIFI_LOGGER_CONNECT_EVENT_SUPPORTED = (1 << (2)),
+ WIFI_LOGGER_POWER_EVENT_SUPPORTED = (1 << (3)),
+ WIFI_LOGGER_WAKE_LOCK_SUPPORTED = (1 << (4)),
+ WIFI_LOGGER_VERBOSE_SUPPORTED = (1 << (5)),
+ WIFI_LOGGER_WATCHDOG_TIMER_SUPPORTED = (1 << (6)),
+};
+
#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC)
#define HDD_MAX_AVOID_FREQ_RANGES 4
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index 3182839bbeae..061a2d337a5a 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -1748,4 +1748,6 @@ void hdd_get_fw_version(hdd_context_t *hdd_ctx,
uint32_t *major_spid, uint32_t *minor_spid,
uint32_t *siid, uint32_t *crmid);
+bool hdd_is_memdump_supported(void);
+
#endif // end #if !defined( WLAN_HDD_MAIN_H )
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 5e5b6f5fb28c..f764deb02b10 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -5584,6 +5584,59 @@ wlan_hdd_cfg80211_get_wifi_info(struct wiphy *wiphy,
}
/**
+ * wlan_hdd_cfg80211_get_logger_supp_feature() - Get the wifi logger features
+ * @wiphy: pointer to wireless wiphy structure.
+ * @wdev: pointer to wireless_dev structure.
+ * @data: Pointer to the data to be passed via vendor interface
+ * @data_len:Length of the data to be passed
+ *
+ * This is called by userspace to know the supported logger features
+ *
+ * Return: Return the Success or Failure code.
+ */
+static int
+wlan_hdd_cfg80211_get_logger_supp_feature(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ const void *data, int data_len)
+{
+ hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
+ int status;
+ uint32_t features;
+ struct sk_buff *reply_skb = NULL;
+
+ status = wlan_hdd_validate_context(hdd_ctx);
+ if (0 != status) {
+ hddLog(LOGE, FL("HDD context is not valid"));
+ return -EINVAL;
+ }
+
+ features = 0;
+
+ if (hdd_is_memdump_supported())
+ features |= WIFI_LOGGER_MEMORY_DUMP_SUPPORTED;
+ features |= WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED;
+ features |= WIFI_LOGGER_CONNECT_EVENT_SUPPORTED;
+ features |= WIFI_LOGGER_WAKE_LOCK_SUPPORTED;
+
+ reply_skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
+ sizeof(uint32_t) + NLA_HDRLEN + NLMSG_HDRLEN);
+ if (!reply_skb) {
+ hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
+ return -ENOMEM;
+ }
+
+ hddLog(LOG1, FL("Supported logger features: 0x%0x"), features);
+ if (nla_put_u32(reply_skb, QCA_WLAN_VENDOR_ATTR_LOGGER_SUPPORTED,
+ features)) {
+ hddLog(LOGE, FL("nla put fail"));
+ kfree_skb(reply_skb);
+ return -EINVAL;
+ }
+
+ return cfg80211_vendor_cmd_reply(reply_skb);
+}
+
+/**
* wlan_hdd_send_roam_auth_event() - Send the roamed and authorized event
* @hdd_ctx_ptr: pointer to HDD Context.
* @bssid: pointer to bssid of roamed AP.
@@ -7280,6 +7333,15 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] =
WIPHY_VENDOR_CMD_NEED_RUNNING,
.doit = wlan_hdd_cfg80211_dcc_update_ndl
},
+ {
+ .info.vendor_id = QCA_NL80211_VENDOR_ID,
+ .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET,
+ .flags = WIPHY_VENDOR_CMD_NEED_WDEV |
+ WIPHY_VENDOR_CMD_NEED_NETDEV |
+ WIPHY_VENDOR_CMD_NEED_RUNNING,
+ .doit = wlan_hdd_cfg80211_get_logger_supp_feature
+ },
+
};
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 5ed41aee1660..4e30b30eb7a2 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -14225,6 +14225,22 @@ void hdd_get_fw_version(hdd_context_t *hdd_ctx,
*crmid = hdd_ctx->target_fw_version & 0x7fff;
}
+/**
+ * hdd_is_memdump_supported() - to check if memdump feature support
+ *
+ * This function is used to check if memdump feature is supported in
+ * the host driver
+ *
+ * Return: true if supported and false otherwise
+ */
+bool hdd_is_memdump_supported(void)
+{
+#ifdef WLAN_FEATURE_MEMDUMP
+ return true;
+#endif
+ return false;
+}
+
//Register the module init/exit functions
module_init(hdd_module_init);
module_exit(hdd_module_exit);