diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h index e19af31b9e..74b0bb3bd4 100644 --- a/core/hdd/inc/wlan_hdd_tdls.h +++ b/core/hdd/inc/wlan_hdd_tdls.h @@ -656,6 +656,7 @@ void hdd_wlan_tdls_enable_link_event(const uint8_t *peer_mac, uint8_t is_off_chan_supported, uint8_t is_off_chan_configured, uint8_t is_off_chan_established); +void hdd_wlan_block_scan_by_tdls_event(void); #else static inline void hdd_send_wlan_tdls_teardown_event(uint32_t reason, @@ -665,7 +666,7 @@ void hdd_wlan_tdls_enable_link_event(const uint8_t *peer_mac, uint8_t is_off_chan_supported, uint8_t is_off_chan_configured, uint8_t is_off_chan_established) {} - +static inline void hdd_wlan_block_scan_by_tdls_event(void) {} #endif /* FEATURE_WLAN_DIAG_SUPPORT */ #endif /* __HDD_TDLS_H */ diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index d35f21bd0d..b10068bfe9 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1378,6 +1378,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy, else hddLog(LOGE, FL("TDLS teardown is ongoing %d"), status); + hdd_wlan_block_scan_by_tdls_event(); return status; } #endif diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 52bab8b980..878bf0f059 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -143,6 +143,25 @@ void hdd_wlan_tdls_enable_link_event(const uint8_t *peer_mac, EVENT_WLAN_TDLS_ENABLE_LINK); } +/** + * hdd_wlan_block_scan_by_tdls_event()- send event + * if scan is blocked by tdls + * + * This Function send send diag event if scan is + * blocked by tdls + * + * Return: void. + */ +void hdd_wlan_block_scan_by_tdls_event(void) +{ + WLAN_HOST_DIAG_EVENT_DEF(tdls_scan_block_status, + struct host_event_tdls_scan_rejected); + + tdls_scan_block_status.status = true; + WLAN_HOST_DIAG_EVENT_REPORT(&tdls_scan_block_status, + EVENT_TDLS_SCAN_BLOCK); +} + #endif /** diff --git a/core/utils/host_diag_log/inc/host_diag_core_event.h b/core/utils/host_diag_log/inc/host_diag_core_event.h index 997b295999..09fb066cdd 100644 --- a/core/utils/host_diag_log/inc/host_diag_core_event.h +++ b/core/utils/host_diag_log/inc/host_diag_core_event.h @@ -349,6 +349,18 @@ struct host_event_offload_req { uint8_t state; }; +/** + * struct host_event_tdls_scan_rejected - scan + * rejected due to tdls + * @status: rejected status + * + * This structure contains scan rejected due to + * tdls event info + */ +struct host_event_tdls_scan_rejected { + uint8_t status; +}; + /*------------------------------------------------------------------------- Function declarations and documenation ------------------------------------------------------------------------*/ diff --git a/core/utils/host_diag_log/inc/host_diag_event_defs.h b/core/utils/host_diag_log/inc/host_diag_event_defs.h index 2ca73cfe68..38b806aa42 100644 --- a/core/utils/host_diag_log/inc/host_diag_event_defs.h +++ b/core/utils/host_diag_log/inc/host_diag_event_defs.h @@ -58,6 +58,7 @@ typedef enum { EVENT_WLAN_TDLS_ENABLE_LINK = 0XAB6, EVENT_WLAN_SUSPEND_RESUME = 0xAB7, EVENT_WLAN_OFFLOAD_REQ = 0xAB8, + EVENT_TDLS_SCAN_BLOCK = 0xAB9, EVENT_MAX_ID = 0x0FFF } event_id_enum_type;