qcacmn: Add support to send connectivity logs from logging thread
Add support to send connectivity logs from g_wlan_logging thread. Add new HOST_LOG_DRIVER_CONNECTIVITY_MSG event flag which wakes up the gwlan_logging thread when set. Also register connection manager callbacks to send the logging event. Check if logging queue is empty whenever the gwlan_logging thread is woken up and send the logs to userspace if the count doesn't exceed the allowed threshold. Change-Id: I3fdb8358f9048a277e2f03894c0e6a17376b0da0 CRs-Fixed: 3029279
This commit is contained in:

committed by
Madan Koyyalamudi

parent
114c654e69
commit
b001e0e130
@@ -242,6 +242,9 @@ enum qca_nl80211_vendor_subcmds_index {
|
|||||||
#ifdef WLAN_CFR_ENABLE
|
#ifdef WLAN_CFR_ENABLE
|
||||||
QCA_NL80211_VENDOR_SUBCMD_PEER_CFR_CAPTURE_CFG_INDEX,
|
QCA_NL80211_VENDOR_SUBCMD_PEER_CFR_CAPTURE_CFG_INDEX,
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef WLAN_FEATURE_CONNECTIVITY_LOGGING
|
||||||
|
QCA_NL80211_VENDOR_SUBCMD_DIAG_EVENT_INDEX,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined(SUPPORT_WDEV_CFG80211_VENDOR_EVENT_ALLOC) && \
|
#if !defined(SUPPORT_WDEV_CFG80211_VENDOR_EVENT_ALLOC) && \
|
||||||
|
@@ -39,8 +39,11 @@
|
|||||||
#define IEEE80211_CCMP_MICLEN 8
|
#define IEEE80211_CCMP_MICLEN 8
|
||||||
#define WLAN_IEEE80211_GCMP_HEADERLEN 8
|
#define WLAN_IEEE80211_GCMP_HEADERLEN 8
|
||||||
#define WLAN_IEEE80211_GCMP_MICLEN 16
|
#define WLAN_IEEE80211_GCMP_MICLEN 16
|
||||||
|
|
||||||
|
#define IEEE80211_FC1_RETRY 0x08
|
||||||
#define IEEE80211_FC1_WEP 0x40
|
#define IEEE80211_FC1_WEP 0x40
|
||||||
#define IEEE80211_FC1_ORDER 0x80
|
#define IEEE80211_FC1_ORDER 0x80
|
||||||
|
|
||||||
#define WLAN_HDR_IV_LEN 3
|
#define WLAN_HDR_IV_LEN 3
|
||||||
#define WLAN_HDR_EXT_IV_BIT 0x20
|
#define WLAN_HDR_EXT_IV_BIT 0x20
|
||||||
#define WLAN_HDR_EXT_IV_LEN 4
|
#define WLAN_HDR_EXT_IV_LEN 4
|
||||||
|
@@ -77,6 +77,14 @@ int wlan_logging_notifier_deinit(bool dump_at_kernel_enable);
|
|||||||
QDF_STATUS wlan_logging_wait_for_flush_log_completion(void);
|
QDF_STATUS wlan_logging_wait_for_flush_log_completion(void);
|
||||||
|
|
||||||
void wlan_logging_set_per_pkt_stats(void);
|
void wlan_logging_set_per_pkt_stats(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wlan_logging_set_connectivity_log() - INterrupt the gwlan_logging thread
|
||||||
|
* to send the connectivity logs
|
||||||
|
*
|
||||||
|
* Return: None
|
||||||
|
*/
|
||||||
|
void wlan_logging_set_connectivity_log(void);
|
||||||
void wlan_logging_set_fw_flush_complete(void);
|
void wlan_logging_set_fw_flush_complete(void);
|
||||||
void wlan_flush_host_logs_for_fatal(void);
|
void wlan_flush_host_logs_for_fatal(void);
|
||||||
void wlan_logging_set_active(bool active);
|
void wlan_logging_set_active(bool active);
|
||||||
|
@@ -36,6 +36,9 @@
|
|||||||
#include <qdf_event.h>
|
#include <qdf_event.h>
|
||||||
#include <qdf_module.h>
|
#include <qdf_module.h>
|
||||||
#include <qdf_str.h>
|
#include <qdf_str.h>
|
||||||
|
#ifdef WLAN_FEATURE_CONNECTIVITY_LOGGING
|
||||||
|
#include <wlan_connectivity_logging.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CNSS_GENL
|
#ifdef CNSS_GENL
|
||||||
#ifdef CONFIG_CNSS_OUT_OF_TREE
|
#ifdef CONFIG_CNSS_OUT_OF_TREE
|
||||||
@@ -99,9 +102,11 @@
|
|||||||
#endif /* FEATURE_PKTLOG */
|
#endif /* FEATURE_PKTLOG */
|
||||||
|
|
||||||
#define MAX_PKTSTATS_BUFF 16
|
#define MAX_PKTSTATS_BUFF 16
|
||||||
#define HOST_LOG_DRIVER_MSG 0x001
|
#define HOST_LOG_DRIVER_MSG 0x001
|
||||||
#define HOST_LOG_PER_PKT_STATS 0x002
|
#define HOST_LOG_PER_PKT_STATS 0x002
|
||||||
#define HOST_LOG_FW_FLUSH_COMPLETE 0x003
|
#define HOST_LOG_FW_FLUSH_COMPLETE 0x003
|
||||||
|
#define HOST_LOG_DRIVER_CONNECTIVITY_MSG 0x004
|
||||||
|
|
||||||
#define DIAG_TYPE_LOGS 1
|
#define DIAG_TYPE_LOGS 1
|
||||||
#define PTT_MSG_DIAG_CMDS_TYPE 0x5050
|
#define PTT_MSG_DIAG_CMDS_TYPE 0x5050
|
||||||
#define MAX_LOG_LINE 500
|
#define MAX_LOG_LINE 500
|
||||||
@@ -801,6 +806,20 @@ static void setup_flush_timer(void)
|
|||||||
qdf_spin_unlock(&gwlan_logging.flush_timer_lock);
|
qdf_spin_unlock(&gwlan_logging.flush_timer_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WLAN_FEATURE_CONNECTIVITY_LOGGING
|
||||||
|
static QDF_STATUS
|
||||||
|
wlan_logging_send_connectivity_event(void)
|
||||||
|
{
|
||||||
|
return wlan_connectivity_log_dequeue();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static inline QDF_STATUS
|
||||||
|
wlan_logging_send_connectivity_event(void)
|
||||||
|
{
|
||||||
|
return QDF_STATUS_E_NOSUPPORT;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wlan_logging_thread() - The WLAN Logger thread
|
* wlan_logging_thread() - The WLAN Logger thread
|
||||||
* @Arg - pointer to the HDD context
|
* @Arg - pointer to the HDD context
|
||||||
@@ -828,6 +847,9 @@ static int wlan_logging_thread(void *Arg)
|
|||||||
|| test_bit(
|
|| test_bit(
|
||||||
HOST_LOG_FW_FLUSH_COMPLETE,
|
HOST_LOG_FW_FLUSH_COMPLETE,
|
||||||
&gwlan_logging.eventFlag)
|
&gwlan_logging.eventFlag)
|
||||||
|
|| test_bit(
|
||||||
|
HOST_LOG_DRIVER_CONNECTIVITY_MSG,
|
||||||
|
&gwlan_logging.eventFlag)
|
||||||
|| gwlan_logging.exit));
|
|| gwlan_logging.exit));
|
||||||
|
|
||||||
if (ret_wait_status == -ERESTARTSYS) {
|
if (ret_wait_status == -ERESTARTSYS) {
|
||||||
@@ -892,6 +914,11 @@ static int wlan_logging_thread(void *Arg)
|
|||||||
&gwlan_logging.wait_queue);
|
&gwlan_logging.wait_queue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Dequeue the connectivity_log */
|
||||||
|
wlan_logging_send_connectivity_event();
|
||||||
|
clear_bit(HOST_LOG_DRIVER_CONNECTIVITY_MSG,
|
||||||
|
&gwlan_logging.eventFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
complete_and_exit(&gwlan_logging.shutdown_comp, 0);
|
complete_and_exit(&gwlan_logging.shutdown_comp, 0);
|
||||||
@@ -1166,6 +1193,7 @@ int wlan_logging_sock_init_svc(void)
|
|||||||
clear_bit(HOST_LOG_DRIVER_MSG, &gwlan_logging.eventFlag);
|
clear_bit(HOST_LOG_DRIVER_MSG, &gwlan_logging.eventFlag);
|
||||||
clear_bit(HOST_LOG_PER_PKT_STATS, &gwlan_logging.eventFlag);
|
clear_bit(HOST_LOG_PER_PKT_STATS, &gwlan_logging.eventFlag);
|
||||||
clear_bit(HOST_LOG_FW_FLUSH_COMPLETE, &gwlan_logging.eventFlag);
|
clear_bit(HOST_LOG_FW_FLUSH_COMPLETE, &gwlan_logging.eventFlag);
|
||||||
|
clear_bit(HOST_LOG_DRIVER_CONNECTIVITY_MSG, &gwlan_logging.eventFlag);
|
||||||
init_completion(&gwlan_logging.shutdown_comp);
|
init_completion(&gwlan_logging.shutdown_comp);
|
||||||
gwlan_logging.thread = kthread_create(wlan_logging_thread, NULL,
|
gwlan_logging.thread = kthread_create(wlan_logging_thread, NULL,
|
||||||
"wlan_logging_thread");
|
"wlan_logging_thread");
|
||||||
@@ -1226,6 +1254,7 @@ int wlan_logging_sock_deinit_svc(void)
|
|||||||
clear_bit(HOST_LOG_DRIVER_MSG, &gwlan_logging.eventFlag);
|
clear_bit(HOST_LOG_DRIVER_MSG, &gwlan_logging.eventFlag);
|
||||||
clear_bit(HOST_LOG_PER_PKT_STATS, &gwlan_logging.eventFlag);
|
clear_bit(HOST_LOG_PER_PKT_STATS, &gwlan_logging.eventFlag);
|
||||||
clear_bit(HOST_LOG_FW_FLUSH_COMPLETE, &gwlan_logging.eventFlag);
|
clear_bit(HOST_LOG_FW_FLUSH_COMPLETE, &gwlan_logging.eventFlag);
|
||||||
|
clear_bit(HOST_LOG_DRIVER_CONNECTIVITY_MSG, &gwlan_logging.eventFlag);
|
||||||
wake_up_interruptible(&gwlan_logging.wait_queue);
|
wake_up_interruptible(&gwlan_logging.wait_queue);
|
||||||
wait_for_completion(&gwlan_logging.shutdown_comp);
|
wait_for_completion(&gwlan_logging.shutdown_comp);
|
||||||
|
|
||||||
@@ -1271,6 +1300,15 @@ void wlan_logging_set_per_pkt_stats(void)
|
|||||||
wake_up_interruptible(&gwlan_logging.wait_queue);
|
wake_up_interruptible(&gwlan_logging.wait_queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wlan_logging_set_connectivity_log(void)
|
||||||
|
{
|
||||||
|
if (gwlan_logging.is_active == false)
|
||||||
|
return;
|
||||||
|
|
||||||
|
set_bit(HOST_LOG_DRIVER_CONNECTIVITY_MSG, &gwlan_logging.eventFlag);
|
||||||
|
wake_up_interruptible(&gwlan_logging.wait_queue);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* wlan_logging_set_fw_flush_complete() - FW log flush completion
|
* wlan_logging_set_fw_flush_complete() - FW log flush completion
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user