diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index 103514657291..e60ae4fd52a0 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -242,4 +242,17 @@ QDF_STATUS cds_flush_logs(uint32_t is_fatal, uint32_t indicator, uint32_t reason_code); void cds_logging_set_fw_flush_complete(void); + +#ifdef FEATURE_WLAN_DIAG_SUPPORT +void cds_tdls_tx_rx_mgmt_event(uint8_t event_id, uint8_t tx_rx, + uint8_t type, uint8_t sub_type, uint8_t *peer_mac); +#else +static inline +void cds_tdls_tx_rx_mgmt_event(uint8_t event_id, uint8_t tx_rx, + uint8_t type, uint8_t sub_type, uint8_t *peer_mac) + +{ +} +#endif /* FEATURE_WLAN_DIAG_SUPPORT */ + #endif /* if !defined __CDS_API_H */ diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index cc950b32ae7b..8fe325c92ae5 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -130,6 +130,36 @@ void cds_deinit(void) return; } +#ifdef FEATURE_WLAN_DIAG_SUPPORT +/** + * cds_tdls_tx_rx_mgmt_event()- send tdls mgmt rx tx event + * @event_id: event id + * @tx_rx: tx or rx + * @type: type of frame + * @action_sub_type: action frame type + * @peer_mac: peer mac + * + * This Function sends tdls mgmt rx tx diag event + * + * Return: void. + */ +void cds_tdls_tx_rx_mgmt_event(uint8_t event_id, uint8_t tx_rx, + uint8_t type, uint8_t action_sub_type, uint8_t *peer_mac) +{ + WLAN_HOST_DIAG_EVENT_DEF(tdls_tx_rx_mgmt, + struct host_event_tdls_tx_rx_mgmt); + + tdls_tx_rx_mgmt.event_id = event_id; + tdls_tx_rx_mgmt.tx_rx = tx_rx; + tdls_tx_rx_mgmt.type = type; + tdls_tx_rx_mgmt.action_sub_type = action_sub_type; + qdf_mem_copy(tdls_tx_rx_mgmt.peer_mac, + peer_mac, CDS_MAC_ADDRESS_LEN); + WLAN_HOST_DIAG_EVENT_REPORT(&tdls_tx_rx_mgmt, + EVENT_WLAN_TDLS_TX_RX_MGMT); +} +#endif + #ifdef WLAN_FEATURE_NAN /** * cds_set_nan_enable() - set nan enable flag in mac open param diff --git a/core/hdd/inc/wlan_hdd_p2p.h b/core/hdd/inc/wlan_hdd_p2p.h index 3cc7dc7c0d18..9fcf9ecc2fed 100644 --- a/core/hdd/inc/wlan_hdd_p2p.h +++ b/core/hdd/inc/wlan_hdd_p2p.h @@ -51,6 +51,9 @@ #define WLAN_HDD_80211_FRM_DA_OFFSET 4 #define P2P_WILDCARD_SSID_LEN 7 #define P2P_WILDCARD_SSID "DIRECT-" +#define WLAN_HDD_80211_PEER_ADDR_OFFSET (WLAN_HDD_80211_FRM_DA_OFFSET + \ + MAC_ADDR_LEN) + #ifdef QCA_WIFI_3_0_EMU #define P2P_ROC_DURATION_MULTIPLIER_GO_PRESENT 2 diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index b54a41baba96..24f572a0e980 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -2247,8 +2247,8 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, + 2], SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE)) { /* P2P action frames */ - u8 *macFrom = - &pbFrames[WLAN_HDD_80211_FRM_DA_OFFSET + 6]; + u8 *macFrom = &pbFrames + [WLAN_HDD_80211_PEER_ADDR_OFFSET]; actionFrmType = pbFrames [WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET]; @@ -2409,8 +2409,8 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, else if (pbFrames [WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET + 1] == WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP) { - u8 *mac = - &pbFrames[WLAN_HDD_80211_FRM_DA_OFFSET + 6]; + u8 *mac = &pbFrames + [WLAN_HDD_80211_PEER_ADDR_OFFSET]; hddLog(LOG1, "[TDLS] TDLS Discovery Response," @@ -2420,6 +2420,10 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, wlan_hdd_tdls_set_rssi(pAdapter, mac, rxRssi); wlan_hdd_tdls_recv_discovery_resp(pAdapter, mac); + cds_tdls_tx_rx_mgmt_event(SIR_MAC_ACTION_TDLS, + SIR_MAC_ACTION_RX, SIR_MAC_MGMT_ACTION, + WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP, + &pbFrames[WLAN_HDD_80211_PEER_ADDR_OFFSET]); } #endif } @@ -2437,6 +2441,10 @@ void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter, "[TDLS] %s <--- OTA", tdls_action_frame_type[actionFrmType]); } + cds_tdls_tx_rx_mgmt_event(SIR_MAC_ACTION_TDLS, + SIR_MAC_ACTION_RX, SIR_MAC_MGMT_ACTION, + actionFrmType, + &pbFrames[WLAN_HDD_80211_PEER_ADDR_OFFSET]); } if ((pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] == diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h index 2585a4fa3445..596f55889671 100644 --- a/core/mac/inc/sir_mac_prot_def.h +++ b/core/mac/inc/sir_mac_prot_def.h @@ -145,6 +145,9 @@ #define SIR_MAC_ACTION_FST 18 #define SIR_MAC_ACTION_VHT 21 +#define SIR_MAC_ACTION_TX 1 +#define SIR_MAC_ACTION_RX 2 + /* QoS management action codes */ #define SIR_MAC_QOS_ADD_TS_REQ 0 diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index 5950dd373704..9016fbf2c412 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -2757,6 +2757,10 @@ tSirRetStatus lim_process_sme_tdls_mgmt_send_req(tpAniSirGlobal mac_ctx, goto lim_tdls_send_mgmt_error; } + cds_tdls_tx_rx_mgmt_event(SIR_MAC_ACTION_TDLS, + SIR_MAC_ACTION_TX, SIR_MAC_MGMT_ACTION, + send_req->reqType, send_req->peer_mac.bytes); + switch (send_req->reqType) { case SIR_MAC_TDLS_DIS_REQ: lim_log(mac_ctx, LOG1, FL("Transmit Discovery Request Frame")); 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 09fb066cdd76..c7cce228a80a 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 @@ -361,6 +361,24 @@ struct host_event_tdls_scan_rejected { uint8_t status; }; +/** + * struct host_event_tdls_tx_rx_mgmt - for TX RX management frame + * @event_id: event ID + * @tx_rx: tx or rx + * @type: type of frame + * @action_sub_type: action frame type + * @peer_mac: peer mac + * + * This structure contains tdls TX RX management frame info + */ +struct host_event_tdls_tx_rx_mgmt { + uint8_t event_id; + uint8_t tx_rx; + uint8_t type; + uint8_t action_sub_type; + uint8_t peer_mac[QDF_MAC_ADDR_SIZE]; +}; + /*------------------------------------------------------------------------- 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 38b806aa42d0..6b658ba37b81 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 @@ -59,6 +59,7 @@ typedef enum { EVENT_WLAN_SUSPEND_RESUME = 0xAB7, EVENT_WLAN_OFFLOAD_REQ = 0xAB8, EVENT_TDLS_SCAN_BLOCK = 0xAB9, + EVENT_WLAN_TDLS_TX_RX_MGMT = 0xABA, EVENT_MAX_ID = 0x0FFF } event_id_enum_type;