diff --git a/os_if/linux/wlan_cfg80211.h b/os_if/linux/wlan_cfg80211.h index 981b377de1..129e7262d6 100644 --- a/os_if/linux/wlan_cfg80211.h +++ b/os_if/linux/wlan_cfg80211.h @@ -242,6 +242,9 @@ enum qca_nl80211_vendor_subcmds_index { #ifdef WLAN_CFR_ENABLE QCA_NL80211_VENDOR_SUBCMD_PEER_CFR_CAPTURE_CFG_INDEX, #endif +#ifdef WLAN_FEATURE_CONNECTIVITY_LOGGING + QCA_NL80211_VENDOR_SUBCMD_DIAG_EVENT_INDEX, +#endif }; #if !defined(SUPPORT_WDEV_CFG80211_VENDOR_EVENT_ALLOC) && \ diff --git a/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h b/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h index e53f85ae05..451964e3c9 100644 --- a/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h +++ b/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h @@ -39,8 +39,11 @@ #define IEEE80211_CCMP_MICLEN 8 #define WLAN_IEEE80211_GCMP_HEADERLEN 8 #define WLAN_IEEE80211_GCMP_MICLEN 16 + +#define IEEE80211_FC1_RETRY 0x08 #define IEEE80211_FC1_WEP 0x40 #define IEEE80211_FC1_ORDER 0x80 + #define WLAN_HDR_IV_LEN 3 #define WLAN_HDR_EXT_IV_BIT 0x20 #define WLAN_HDR_EXT_IV_LEN 4 diff --git a/utils/logging/inc/wlan_logging_sock_svc.h b/utils/logging/inc/wlan_logging_sock_svc.h index 32546e9e47..063a2d3b70 100644 --- a/utils/logging/inc/wlan_logging_sock_svc.h +++ b/utils/logging/inc/wlan_logging_sock_svc.h @@ -77,6 +77,14 @@ int wlan_logging_notifier_deinit(bool dump_at_kernel_enable); QDF_STATUS wlan_logging_wait_for_flush_log_completion(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_flush_host_logs_for_fatal(void); void wlan_logging_set_active(bool active); diff --git a/utils/logging/src/wlan_logging_sock_svc.c b/utils/logging/src/wlan_logging_sock_svc.c index a9beaa2c17..4c1e356f08 100644 --- a/utils/logging/src/wlan_logging_sock_svc.c +++ b/utils/logging/src/wlan_logging_sock_svc.c @@ -36,6 +36,9 @@ #include #include #include +#ifdef WLAN_FEATURE_CONNECTIVITY_LOGGING +#include +#endif #ifdef CNSS_GENL #ifdef CONFIG_CNSS_OUT_OF_TREE @@ -99,9 +102,11 @@ #endif /* FEATURE_PKTLOG */ #define MAX_PKTSTATS_BUFF 16 -#define HOST_LOG_DRIVER_MSG 0x001 -#define HOST_LOG_PER_PKT_STATS 0x002 -#define HOST_LOG_FW_FLUSH_COMPLETE 0x003 +#define HOST_LOG_DRIVER_MSG 0x001 +#define HOST_LOG_PER_PKT_STATS 0x002 +#define HOST_LOG_FW_FLUSH_COMPLETE 0x003 +#define HOST_LOG_DRIVER_CONNECTIVITY_MSG 0x004 + #define DIAG_TYPE_LOGS 1 #define PTT_MSG_DIAG_CMDS_TYPE 0x5050 #define MAX_LOG_LINE 500 @@ -801,6 +806,20 @@ static void setup_flush_timer(void) 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 * @Arg - pointer to the HDD context @@ -828,6 +847,9 @@ static int wlan_logging_thread(void *Arg) || test_bit( HOST_LOG_FW_FLUSH_COMPLETE, &gwlan_logging.eventFlag) + || test_bit( + HOST_LOG_DRIVER_CONNECTIVITY_MSG, + &gwlan_logging.eventFlag) || gwlan_logging.exit)); if (ret_wait_status == -ERESTARTSYS) { @@ -892,6 +914,11 @@ static int wlan_logging_thread(void *Arg) &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); @@ -1166,6 +1193,7 @@ int wlan_logging_sock_init_svc(void) clear_bit(HOST_LOG_DRIVER_MSG, &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_DRIVER_CONNECTIVITY_MSG, &gwlan_logging.eventFlag); init_completion(&gwlan_logging.shutdown_comp); gwlan_logging.thread = kthread_create(wlan_logging_thread, NULL, "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_PER_PKT_STATS, &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); 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); } +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 *