diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index b7a3415c9d..a3fe1a8c4e 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1604,6 +1604,7 @@ struct hdd_context_s { unsigned long tdls_source_bitmap; /* tdls source timer to enable/disable TDLS on p2p listen */ qdf_mc_timer_t tdls_source_timer; + bool tdls_umac_comp_active; uint8_t beacon_probe_rsp_cnt_per_scan; uint8_t last_scan_reject_session_id; enum scan_reject_states last_scan_reject_reason; diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 37c879c722..35522e0c50 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1201,6 +1201,8 @@ static void hdd_send_association_event(struct net_device *dev, /* change logging before release */ hdd_debug("LFR3:hdd_send_association_event"); /* Update tdls module about the disconnection event */ + hdd_notify_sta_disconnect(pAdapter->sessionId, + true, pAdapter->hdd_vdev); wlan_hdd_tdls_notify_disconnect(pAdapter, true); } #endif @@ -1291,8 +1293,14 @@ static void hdd_send_association_event(struct net_device *dev, pAdapter->sessionId, &chan_info, pAdapter->device_mode); /* Update tdls module about connection event */ + hdd_notify_sta_connect(pAdapter->sessionId, + pCsrRoamInfo->tdls_chan_swit_prohibited, + pCsrRoamInfo->tdls_prohibited, + pAdapter->hdd_vdev); + wlan_hdd_tdls_notify_connect(pAdapter, pCsrRoamInfo); + #ifdef MSM_PLATFORM #if defined(CONFIG_ICNSS) || defined(CONFIG_CNSS) /* start timer in sta/p2p_cli */ @@ -1359,6 +1367,9 @@ static void hdd_send_association_event(struct net_device *dev, hdd_lpass_notify_disconnect(pAdapter); /* Update tdls module about the disconnection event */ + hdd_notify_sta_disconnect(pAdapter->sessionId, + false, + pAdapter->hdd_vdev); wlan_hdd_tdls_notify_disconnect(pAdapter, false); #ifdef MSM_PLATFORM diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index e93a9b51b6..99e45dc195 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -10580,7 +10580,8 @@ void wlan_hdd_cfg80211_update_wiphy_caps(struct wiphy *wiphy) } /* This function registers for all frame which supplicant is interested in */ -#ifdef CONVERGED_P2P_ENABLE +#if defined(CONVERGED_P2P_ENABLE) || defined(CONVERGED_TDLS_ENABLE) + void wlan_hdd_cfg80211_register_frames(hdd_adapter_t *pAdapter) { tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); @@ -11121,6 +11122,7 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, policy_mgr_clear_concurrency_mode(pHddCtx->hdd_psoc, pAdapter->device_mode); + hdd_notify_teardown_tdls_links(pAdapter->hdd_vdev); hdd_update_tdls_ct_and_teardown_links(pHddCtx); if ((pAdapter->device_mode == QDF_STA_MODE) || (pAdapter->device_mode == QDF_P2P_CLIENT_MODE) || @@ -13021,6 +13023,7 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter, goto ret_status; } + hdd_notify_teardown_tdls_links(pAdapter->hdd_vdev); wlan_hdd_tdls_disable_offchan_and_teardown_links(pHddCtx); pRoamProfile = &pWextState->roamProfile; diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 0efa6e248d..61888c093e 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -434,4 +434,59 @@ int wlan_hdd_try_disconnect(hdd_adapter_t *adapter); */ void hdd_process_defer_disconnect(hdd_adapter_t *adapter); +#ifndef CONVERGED_TDLS_ENABLE +static inline void +hdd_notify_sta_connect(uint8_t session_id, + bool tdls_chan_swit_prohibited, + bool tdls_prohibited, + struct wlan_objmgr_vdev *vdev) +{ +} + +static inline +void hdd_notify_sta_disconnect(uint8_t session_id, + bool lfr_roam, + struct wlan_objmgr_vdev *vdev) +{ + +} + +static inline +int wlan_cfg80211_tdls_configure_mode(struct wlan_objmgr_vdev *vdev, + uint32_t trigger_mode) +{ + return 0; +} + +static inline +void hdd_notify_teardown_tdls_links(struct wlan_objmgr_vdev *vdev) +{ + +} + +static inline +void ucfg_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev, + struct qdf_mac_addr *mac_addr) +{ + +} + +static inline +void ucfg_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev *vdev, + struct qdf_mac_addr *mac_addr) +{ + +} + +static inline +int wlan_cfg80211_tdls_mgmt(struct wlan_objmgr_pdev *pdev, + struct net_device *dev, const uint8_t *peer, + uint8_t action_code, uint8_t dialog_token, + uint16_t status_code, uint32_t peer_capability, + const uint8_t *buf, size_t len) +{ + return 0; +} + +#endif #endif diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 9c371af013..208b23e0bd 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -7401,6 +7401,8 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, return -EINVAL; } + hdd_notify_teardown_tdls_links(pHostapdAdapter->hdd_vdev); + wlan_hdd_tdls_disable_offchan_and_teardown_links(pHddCtx); if (policy_mgr_is_hw_mode_change_in_progress(pHddCtx->hdd_psoc)) { diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 67c029a8f8..7109372763 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -11265,6 +11265,7 @@ static int hdd_update_tdls_config(hdd_context_t *hdd_ctx) tdls_cfg.tdls_add_sta_req = eWNI_SME_TDLS_ADD_STA_REQ; tdls_cfg.tdls_del_sta_req = eWNI_SME_TDLS_DEL_STA_REQ; tdls_cfg.tdls_update_peer_state = WMA_UPDATE_TDLS_PEER_STATE; + tdls_cfg.tdls_del_all_peers = eWNI_SME_DEL_ALL_TDLS_PEERS; tdls_cfg.tdls_event_cb = wlan_cfg80211_tdls_event_callback; tdls_cfg.tdls_evt_cb_data = psoc; tdls_cfg.tdls_tl_peer_data = hdd_ctx; @@ -11281,11 +11282,14 @@ static int hdd_update_tdls_config(hdd_context_t *hdd_ctx) return -EINVAL; } + hdd_ctx->tdls_umac_comp_active = true; + return 0; } #else static int hdd_update_tdls_config(hdd_context_t *hdd_ctx) { + hdd_ctx->tdls_umac_comp_active = false; return 0; } #endif diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 67d7b3010d..a98a3197ca 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -221,6 +221,9 @@ void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx) hddTdlsPeer_t *curr_peer = NULL; hdd_adapter_t *adapter = NULL; + if (hddctx->tdls_umac_comp_active) + return; + if (eTDLS_SUPPORT_NOT_ENABLED == hddctx->tdls_mode) { hdd_notice("TDLS mode is disabled OR not enabled in FW"); return; @@ -747,6 +750,9 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) ENTER(); + if (pHddCtx->tdls_umac_comp_active) + return 0; + mutex_lock(&pHddCtx->tdls_lock); if (false == pHddCtx->config->fEnableTDLSSupport) { @@ -2081,8 +2087,16 @@ done: void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter, tCsrRoamInfo *csr_roam_info) { + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); + hdd_info("Check and update TDLS state"); + if (!hdd_ctx) + return; + + if (hdd_ctx->tdls_umac_comp_active) + return; + /* Association event */ if (adapter->device_mode == QDF_STA_MODE || adapter->device_mode == QDF_P2P_CLIENT_MODE) { @@ -2111,6 +2125,13 @@ void wlan_hdd_tdls_notify_disconnect(hdd_adapter_t *adapter, bool lfr_roam) hdd_info("Check and update TDLS state"); + if (!hdd_ctx) + return; + + if (hdd_ctx->tdls_umac_comp_active) + return; + + /* Disassociation event */ if (adapter->device_mode == QDF_STA_MODE || adapter->device_mode == QDF_P2P_CLIENT_MODE) { @@ -2828,6 +2849,9 @@ int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy, if (ret) return ret; + if (pHddCtx->tdls_umac_comp_active) + return 1; + /* if tdls is not enabled, then continue scan */ if (eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode) return 1; @@ -2999,6 +3023,9 @@ void wlan_hdd_tdls_scan_done_callback(hdd_adapter_t *pAdapter) if (0 != (wlan_hdd_validate_context(pHddCtx))) return; + if (pHddCtx->tdls_umac_comp_active) + return; + if (eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode) { hdd_info("TDLS mode is disabled OR not enabled"); return; @@ -3406,6 +3433,12 @@ __wlan_hdd_cfg80211_configure_tdls_mode(struct wiphy *wiphy, trigger_mode = nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_TRIGGER_MODE]); hdd_notice("TDLS trigger mode %d", trigger_mode); + if (hdd_ctx->tdls_umac_comp_active) { + ret = wlan_cfg80211_tdls_configure_mode(adapter->hdd_vdev, + trigger_mode); + return ret; + } + switch (trigger_mode) { case WLAN_HDD_VENDOR_TDLS_TRIGGER_MODE_EXPLICIT: tdls_mode = eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY; @@ -4110,12 +4143,12 @@ static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); -#ifdef CONVERGED_TDLS_ENABLE - return wlan_cfg80211_tdls_mgmt(pHddCtx->hdd_pdev, dev, peer, - action_code, dialog_token, - status_code, peer_capability, - buf, len); -#endif + if (pHddCtx->tdls_umac_comp_active) + return wlan_cfg80211_tdls_mgmt(pHddCtx->hdd_pdev, dev, + peer, + action_code, dialog_token, + status_code, peer_capability, + buf, len); /* * STA or P2P client should be connected and authenticated before @@ -5606,6 +5639,9 @@ void wlan_hdd_tdls_update_rx_pkt_cnt(hdd_adapter_t *adapter, hdd_ctx = WLAN_HDD_GET_CTX(adapter); + if (hdd_ctx->tdls_umac_comp_active) + return; + if (!hdd_ctx->enable_tdls_connection_tracker) return; @@ -5670,6 +5706,9 @@ void wlan_hdd_tdls_update_tx_pkt_cnt(hdd_adapter_t *adapter, hdd_ctx = WLAN_HDD_GET_CTX(adapter); + if (hdd_ctx->tdls_umac_comp_active) + return; + if (!hdd_ctx->enable_tdls_connection_tracker) return; diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 1438b5c3e4..1e596663c8 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -486,6 +486,7 @@ static int __hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) bool granted; uint8_t STAId; hdd_station_ctx_t *pHddStaCtx = &pAdapter->sessionCtx.station; + struct qdf_mac_addr *mac_addr; #ifdef QCA_PKT_PROTO_TRACE uint8_t proto_type = 0; hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter); @@ -644,6 +645,10 @@ static int __hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) pAdapter->stats.tx_bytes += skb->len; + mac_addr = (struct qdf_mac_addr *)skb->data; + + ucfg_tdls_update_tx_pkt_cnt(pAdapter->hdd_vdev, mac_addr); + wlan_hdd_tdls_update_tx_pkt_cnt(pAdapter, skb); if (qdf_nbuf_is_tso(skb)) @@ -1032,6 +1037,8 @@ QDF_STATUS hdd_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf) struct sk_buff *next = NULL; hdd_station_ctx_t *pHddStaCtx = NULL; unsigned int cpu_index; + struct qdf_mac_addr *mac_addr; + /* Sanity check on inputs */ if (unlikely((NULL == context) || (NULL == rxBuf))) { @@ -1097,6 +1104,10 @@ QDF_STATUS hdd_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf) (qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE), QDF_RX)); + mac_addr = (struct qdf_mac_addr *)(skb->data+QDF_MAC_ADDR_SIZE); + + ucfg_tdls_update_rx_pkt_cnt(pAdapter->hdd_vdev, mac_addr); + wlan_hdd_tdls_update_rx_pkt_cnt(pAdapter, skb); skb->dev = pAdapter->dev; diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c index c1005339a5..112d474847 100644 --- a/core/mac/src/pe/lim/lim_process_action_frame.c +++ b/core/mac/src/pe/lim/lim_process_action_frame.c @@ -2194,6 +2194,7 @@ void lim_process_action_frame(tpAniSirGlobal mac_ctx, WMA_GET_RX_CH(rx_pkt_info), session, 0); break; #ifdef FEATURE_WLAN_TDLS +#ifndef CONVERGED_TDLS_ENABLE case SIR_MAC_TDLS_DIS_RSP: mac_hdr = NULL; frame_len = 0; @@ -2210,6 +2211,7 @@ void lim_process_action_frame(tpAniSirGlobal mac_ctx, session->smeSessionId, WMA_GET_RX_CH(rx_pkt_info), session, rssi); break; +#endif #endif case SIR_MAC_ACTION_EXT_CHANNEL_SWITCH_ID: lim_process_ext_channel_switch_action_frame(mac_ctx, diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index c4b7bbf4d3..288d4b4743 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -2910,7 +2910,7 @@ lim_send_tdls_comp_mgmt_rsp(tpAniSirGlobal mac_ctx, uint16_t msg_type, tSirResultCodes result_code, uint8_t sme_session_id, uint16_t sme_transaction_id) { - struct scheduler_msg msg; + struct scheduler_msg msg = {0}; tSirSmeRsp *sme_rsp; lim_log(mac_ctx, LOG1, FL("Sending message %s with reasonCode %s"), @@ -2939,6 +2939,7 @@ lim_send_tdls_comp_mgmt_rsp(tpAniSirGlobal mac_ctx, uint16_t msg_type, } #endif + /** * lim_process_sme_tdls_mgmt_send_req() - send out tdls management frames * diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index 5426882858..78ccb8967d 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -60,8 +60,9 @@ #include "nan_datapath.h" #include "lim_assoc_utils.h" +#ifdef CONVERGED_TDLS_ENABLE #include "wlan_tdls_tgt_api.h" - +#endif static void lim_handle_join_rsp_status(tpAniSirGlobal mac_ctx, tpPESession session_entry, tSirResultCodes result_code,