diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 02a4e01a4f7b..a8d9e5d393a3 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1649,7 +1649,6 @@ struct hdd_context { uint8_t tdls_off_channel; uint16_t tdls_channel_offset; int32_t tdls_fw_off_chan_mode; - bool enable_tdls_connection_tracker; uint8_t tdls_external_peer_count; bool tdls_nss_switch_in_progress; bool tdls_nss_teardown_complete; diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h index a09c35c7f22a..cfbffda84461 100644 --- a/core/hdd/inc/wlan_hdd_tdls.h +++ b/core/hdd/inc/wlan_hdd_tdls.h @@ -374,7 +374,6 @@ struct tdls_set_state_info { * * @peer_list: peer list * @pAdapter: pointer to adapter - * @peer_update_timer: connection tracker timer * @peerDiscoverTimer: peer discovery timer * @peerDiscoveryTimeoutTimer: peer discovery timeout timer * @threshold_config: threshold config @@ -389,7 +388,6 @@ struct tdls_set_state_info { typedef struct { struct list_head peer_list[TDLS_PEER_LIST_SIZE]; struct hdd_adapter *pAdapter; - qdf_mc_timer_t peer_update_timer; qdf_mc_timer_t peerDiscoveryTimeoutTimer; tdls_config_params_t threshold_config; int32_t discovery_peer_cnt; @@ -414,8 +412,6 @@ typedef struct { * @is_responder: is responder * @discovery_processed: discovery processed flag * @discovery_attempt: discovery attempt - * @tx_pkt: tx packet - * @rx_pkt: rx packet * @uapsdQueues: uapsd queues * @maxSp: max sp * @isBufSta: is buffer sta @@ -428,8 +424,6 @@ typedef struct { * @op_class_for_pref_off_chan: op class for preferred off channel * @pref_off_chan_num: preferred off channel number * @op_class_for_pref_off_chan_is_set: op class for preferred off channel set - * @peer_idle_timer: time to check idle traffic in tdls peers - * @is_peer_idle_timer_initialised: Flag to check idle timer init * @spatial_streams: Number of TX/RX spatial streams for TDLS * @reason: reason * @state_change_notification: state change notification @@ -447,8 +441,6 @@ typedef struct _hddTdlsPeer_t { uint8_t is_responder; uint8_t discovery_processed; uint16_t discovery_attempt; - uint16_t tx_pkt; - uint16_t rx_pkt; uint8_t uapsdQueues; uint8_t maxSp; uint8_t isBufSta; @@ -461,8 +453,6 @@ typedef struct _hddTdlsPeer_t { uint8_t op_class_for_pref_off_chan; uint8_t pref_off_chan_num; uint8_t op_class_for_pref_off_chan_is_set; - qdf_mc_timer_t peer_idle_timer; - bool is_peer_idle_timer_initialised; uint8_t spatial_streams; enum tdls_link_reason reason; cfg80211_exttdls_callback state_change_notification; @@ -717,18 +707,15 @@ int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, #endif #endif -void hdd_update_tdls_ct_and_teardown_links(struct hdd_context *hdd_ctx); -void wlan_hdd_tdls_disable_offchan_and_teardown_links(struct hdd_context *hddctx); +void +wlan_hdd_tdls_disable_offchan_and_teardown_links(struct hdd_context *hddctx); hddTdlsPeer_t * wlan_hdd_tdls_find_first_connected_peer(struct hdd_adapter *adapter); int hdd_set_tdls_offchannel(struct hdd_context *hdd_ctx, int offchannel); -int hdd_set_tdls_secoffchanneloffset(struct hdd_context *hdd_ctx, int offchanoffset); +int hdd_set_tdls_secoffchanneloffset(struct hdd_context *hdd_ctx, + int offchanoffset); int hdd_set_tdls_offchannelmode(struct hdd_adapter *adapter, int offchanmode); -void wlan_hdd_tdls_update_tx_pkt_cnt(struct hdd_adapter *adapter, - struct sk_buff *skb); -void wlan_hdd_tdls_update_rx_pkt_cnt(struct hdd_adapter *adapter, - struct sk_buff *skb); int hdd_set_tdls_scan_type(struct hdd_context *hdd_ctx, int val); void hdd_tdls_context_init(struct hdd_context *hdd_ctx, bool ssr); void hdd_tdls_context_destroy(struct hdd_context *hdd_ctx); @@ -814,16 +801,12 @@ wlan_hdd_tdls_disable_offchan_and_teardown_links(struct hdd_context *hddctx) static inline void wlan_hdd_tdls_exit(struct hdd_adapter *adapter) { } -static inline void wlan_hdd_tdls_update_tx_pkt_cnt(struct hdd_adapter *adapter, - struct sk_buff *skb) +static inline void hdd_tdls_context_init(struct hdd_context *hdd_ctx, bool ssr) { } -static inline void wlan_hdd_tdls_update_rx_pkt_cnt(struct hdd_adapter *adapter, - struct sk_buff *skb) +static inline void hdd_tdls_context_destroy(struct hdd_context *hdd_ctx) { } -static inline void hdd_tdls_context_init(struct hdd_context *hdd_ctx, bool ssr) { } -static inline void hdd_tdls_context_destroy(struct hdd_context *hdd_ctx) { } static inline int wlan_hdd_tdls_antenna_switch(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter, @@ -898,5 +881,4 @@ void hdd_wlan_tdls_enable_link_event(const uint8_t *peer_mac, static inline void hdd_wlan_block_scan_by_tdls_event(void) {} #endif /* FEATURE_WLAN_DIAG_SUPPORT */ bool cds_check_is_tdls_allowed(enum tQDF_ADAPTER_MODE device_mode); -void cds_set_tdls_ct_mode(struct hdd_context *hdd_ctx); #endif /* __HDD_TDLS_H */ diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 76324820615a..050febe730c2 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -3809,65 +3809,6 @@ QDF_STATUS hdd_roam_deregister_tdlssta(struct hdd_adapter *pAdapter, uint8_t sta return qdf_status; } -/** - * hdd_tdls_connection_tracker_update() - update connection tracker state - * @adapter: pointer to adapter - * @roam_info: pointer to roam info - * @hdd_tdls_ctx: tdls context - * - * Return: QDF_STATUS enumeration - */ -static QDF_STATUS hdd_tdls_connection_tracker_update(struct hdd_adapter *adapter, - tCsrRoamInfo *roam_info, - tdlsCtx_t *hdd_tdls_ctx) -{ - hddTdlsPeer_t *curr_peer; - struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); - - curr_peer = wlan_hdd_tdls_find_peer(adapter, - roam_info->peerMac.bytes); - - if (!curr_peer) { - hdd_err("curr_peer is null"); - return QDF_STATUS_E_FAILURE; - } - - if (eTDLS_LINK_CONNECTED == - curr_peer->link_status) { - hdd_debug("Received CONNECTION_TRACKER_NOTIFICATION " - MAC_ADDRESS_STR - " staId: %d, reason: %d", - MAC_ADDR_ARRAY(roam_info->peerMac.bytes), - roam_info->staId, - roam_info->reasonCode); - - if (roam_info->reasonCode == - eWNI_TDLS_PEER_ENTER_BUF_STA || - roam_info->reasonCode == - eWNI_TDLS_ENTER_BT_BUSY_MODE || - roam_info->reasonCode == - eWMI_TDLS_SCAN_STARTED_EVENT) - hdd_ctx->enable_tdls_connection_tracker = false; - else if (roam_info->reasonCode == - eWNI_TDLS_PEER_EXIT_BUF_STA || - roam_info->reasonCode == - eWNI_TDLS_EXIT_BT_BUSY_MODE || - roam_info->reasonCode == - eWMI_TDLS_SCAN_COMPLETED_EVENT) - hdd_ctx->enable_tdls_connection_tracker = true; - hdd_debug("hdd_ctx->enable_tdls_connection_tracker %d", - hdd_ctx->enable_tdls_connection_tracker); - } else { - hdd_debug("TDLS not connected, ignore notification, reason: %d", - roam_info->reasonCode); - } - - return QDF_STATUS_SUCCESS; -} - - - - /** * hdd_roam_tdls_status_update_handler() - TDLS status update handler * @pAdapter: pointer to adapter @@ -4362,23 +4303,6 @@ hdd_roam_tdls_status_update_handler(struct hdd_adapter *pAdapter, break; } - case eCSR_ROAM_RESULT_TDLS_CONNECTION_TRACKER_NOTIFICATION: - mutex_lock(&hdd_ctx->tdls_lock); - pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); - if (!pHddTdlsCtx) { - mutex_unlock(&hdd_ctx->tdls_lock); - hdd_debug("TDLS ctx is null, ignore roamResult (%d)", - roamResult); - status = QDF_STATUS_E_FAILURE; - break; - } - - status = hdd_tdls_connection_tracker_update(pAdapter, - pRoamInfo, - pHddTdlsCtx); - mutex_unlock(&hdd_ctx->tdls_lock); - break; - default: { break; diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 293a7aafa2b7..eb13329ea454 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -13506,7 +13506,6 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, pAdapter->device_mode); hdd_notify_teardown_tdls_links(pAdapter->hdd_vdev); - hdd_update_tdls_ct_and_teardown_links(hdd_ctx); if ((pAdapter->device_mode == QDF_STA_MODE) || (pAdapter->device_mode == QDF_P2P_CLIENT_MODE) || (pAdapter->device_mode == QDF_P2P_DEVICE_MODE) || diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 4e0bab66cefb..8e9853ca5f6c 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -54,7 +54,6 @@ static int32_t wlan_hdd_tdls_peer_reset_discovery_processed(tdlsCtx_t * pHddTdlsCtx); static void wlan_hdd_tdls_timers_destroy(tdlsCtx_t *pHddTdlsCtx); -static void wlan_hdd_tdls_ct_handler(void *user_data); /** * enum qca_wlan_vendor_tdls_trigger_mode_hdd_map: Maps the user space TDLS @@ -306,20 +305,6 @@ void wlan_hdd_tdls_disable_offchan_and_teardown_links(struct hdd_context *hddctx } } -/** - * hdd_update_tdls_ct_and_teardown_links - Update TDLS connection tracker and - * teardown links. - * @hdd_ctx : pointer to hdd context - * - * Return: None - */ -void hdd_update_tdls_ct_and_teardown_links(struct hdd_context *hdd_ctx) -{ - /* set tdls connection tracker state */ - cds_set_tdls_ct_mode(hdd_ctx); - wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_ctx); -} - /** * wlan_hdd_tdls_discovery_sent_cnt() - get value of discovery counter sent * @hdd_ctx: HDD context @@ -564,43 +549,6 @@ static void wlan_hdd_tdls_monitor_timers_stop(tdlsCtx_t *hdd_tdls_ctx) qdf_mc_timer_stop(&hdd_tdls_ctx->peerDiscoveryTimeoutTimer); } -/** - * wlan_hdd_tdls_peer_idle_timers_stop() - stop peer idle timers - * @hdd_tdls_ctx: TDLS context - * - * Loop through the idle peer list and stop their timers - * - * Return: None - */ -static void wlan_hdd_tdls_peer_idle_timers_stop(tdlsCtx_t *hdd_tdls_ctx) -{ - int i; - struct list_head *head; - struct list_head *pos; - hddTdlsPeer_t *curr_peer; - - for (i = 0; i < TDLS_PEER_LIST_SIZE; i++) { - head = &hdd_tdls_ctx->peer_list[i]; - list_for_each(pos, head) { - curr_peer = list_entry(pos, hddTdlsPeer_t, node); - if (curr_peer->is_peer_idle_timer_initialised) - qdf_mc_timer_stop(&curr_peer->peer_idle_timer); - } - } -} - -/** - * wlan_hdd_tdls_ct_timers_stop() - stop tdls connection tracker timers - * @hdd_tdls_ctx: TDLS context - * - * Return: None - */ -static void wlan_hdd_tdls_ct_timers_stop(tdlsCtx_t *hdd_tdls_ctx) -{ - qdf_mc_timer_stop(&hdd_tdls_ctx->peer_update_timer); - wlan_hdd_tdls_peer_idle_timers_stop(hdd_tdls_ctx); -} - /** * wlan_hdd_tdls_timers_stop() - stop all the tdls timers running * @hdd_tdls_ctx: TDLS context @@ -610,7 +558,6 @@ static void wlan_hdd_tdls_ct_timers_stop(tdlsCtx_t *hdd_tdls_ctx) static void wlan_hdd_tdls_timers_stop(tdlsCtx_t *hdd_tdls_ctx) { wlan_hdd_tdls_monitor_timers_stop(hdd_tdls_ctx); - wlan_hdd_tdls_ct_timers_stop(hdd_tdls_ctx); } /** @@ -705,12 +652,6 @@ void hdd_tdls_context_init(struct hdd_context *hdd_ctx, bool ssr) /* Don't reset TDLS external peer count for SSR case */ if (!ssr) hdd_ctx->tdls_external_peer_count = 0; - - /* This flag will set be true, only when device operates in - * standalone STA mode - */ - hdd_ctx->enable_tdls_connection_tracker = false; - hdd_debug("hdd_ctx->enable_tdls_connection_tracker: 0"); } /** @@ -724,8 +665,7 @@ void hdd_tdls_context_init(struct hdd_context *hdd_ctx, bool ssr) void hdd_tdls_context_destroy(struct hdd_context *hdd_ctx) { hdd_ctx->tdls_external_peer_count = 0; - hdd_ctx->enable_tdls_connection_tracker = false; - hdd_debug("hdd_ctx->enable_tdls_connection_tracker: 0"); + hdd_info("hdd_ctx->enable_tdls_connection_tracker: 0"); mutex_destroy(&hdd_ctx->tdls_lock); qdf_spinlock_destroy(&hdd_ctx->tdls_ct_spinlock); } @@ -772,11 +712,6 @@ int wlan_hdd_tdls_init(struct hdd_adapter *pAdapter) */ if (0 == WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter)) { mutex_unlock(&hdd_ctx->tdls_lock); - /* Check whether connection tracker can be enabled in - * the system. - */ - if (pAdapter->device_mode == QDF_P2P_DEVICE_MODE) - cds_set_tdls_ct_mode(hdd_ctx); return 0; } /* Check for the valid pHddTdlsCtx. If valid do not further @@ -795,11 +730,6 @@ int wlan_hdd_tdls_init(struct hdd_adapter *pAdapter) return -ENOMEM; } - /* Initialize connection tracker timer */ - qdf_mc_timer_init(&pHddTdlsCtx->peer_update_timer, - QDF_TIMER_TYPE_SW, - wlan_hdd_tdls_ct_handler, - pAdapter); qdf_mc_timer_init(&pHddTdlsCtx->peerDiscoveryTimeoutTimer, QDF_TIMER_TYPE_SW, wlan_hdd_tdls_discovery_timeout_peer_cb, @@ -923,49 +853,6 @@ done: clear_bit(TDLS_INIT_DONE, &pAdapter->event_flags); } -/** - * wlan_hdd_tdls_peer_idle_timers_destroy() - destroy peer idle timers - * @hdd_tdls_ctx: TDLS context - * - * Loop through the idle peer list and destroy their timers - * - * Return: None - */ -static void wlan_hdd_tdls_peer_idle_timers_destroy(tdlsCtx_t *hdd_tdls_ctx) -{ - int i; - struct list_head *head; - struct list_head *pos; - hddTdlsPeer_t *curr_peer; - - for (i = 0; i < TDLS_PEER_LIST_SIZE; i++) { - head = &hdd_tdls_ctx->peer_list[i]; - list_for_each(pos, head) { - curr_peer = list_entry(pos, hddTdlsPeer_t, node); - if (curr_peer != NULL && - curr_peer->is_peer_idle_timer_initialised) { - hdd_debug(MAC_ADDRESS_STR ": destroy idle timer", - MAC_ADDR_ARRAY(curr_peer->peerMac)); - qdf_mc_timer_stop(&curr_peer->peer_idle_timer); - qdf_mc_timer_destroy(&curr_peer->peer_idle_timer); - } - } - } -} - -/** - * wlan_hdd_tdls_ct_timers_destroy() - destroy tdls connection tracker timers - * @hdd_tdls_ctx: TDLS context - * - * Return: None - */ -static void wlan_hdd_tdls_ct_timers_destroy(tdlsCtx_t *hdd_tdls_ctx) -{ - qdf_mc_timer_stop(&hdd_tdls_ctx->peer_update_timer); - qdf_mc_timer_destroy(&hdd_tdls_ctx->peer_update_timer); - wlan_hdd_tdls_peer_idle_timers_destroy(hdd_tdls_ctx); -} - /** * wlan_hdd_tdls_monitor_timers_destroy() - destroy all tdls monitoring timers * @pHddTdlsCtx: TDLS context @@ -987,7 +874,6 @@ static void wlan_hdd_tdls_monitor_timers_destroy(tdlsCtx_t *pHddTdlsCtx) static void wlan_hdd_tdls_timers_destroy(tdlsCtx_t *pHddTdlsCtx) { wlan_hdd_tdls_monitor_timers_destroy(pHddTdlsCtx); - wlan_hdd_tdls_ct_timers_destroy(pHddTdlsCtx); } /** @@ -1603,31 +1489,6 @@ static int wlan_hdd_tdls_check_config(tdls_config_params_t *config) return 0; } -/** - * wlan_tdd_tdls_reset_tx_rx() - reset tx/rx counters for all tdls peers - * @pHddTdlsCtx: TDLS context - * - * Caller has to take the TDLS lock before calling this function - * - * Return: Void - */ -static void wlan_tdd_tdls_reset_tx_rx(tdlsCtx_t *pHddTdlsCtx) -{ - int i; - struct list_head *head; - hddTdlsPeer_t *tmp; - struct list_head *pos, *q; - - for (i = 0; i < TDLS_PEER_LIST_SIZE; i++) { - head = &pHddTdlsCtx->peer_list[i]; - list_for_each_safe(pos, q, head) { - tmp = list_entry(pos, hddTdlsPeer_t, node); - tmp->tx_pkt = 0; - tmp->rx_pkt = 0; - } - } -} - /** * wlan_hdd_tdls_implicit_disable() - disable implicit tdls triggering * @pHddTdlsCtx: TDLS context @@ -1640,27 +1501,6 @@ static void wlan_hdd_tdls_implicit_disable(tdlsCtx_t *pHddTdlsCtx) wlan_hdd_tdls_timers_stop(pHddTdlsCtx); } -/** - * wlan_hdd_tdls_implicit_enable() - enable implicit tdls triggering - * @pHddTdlsCtx: TDLS context - * - * Return: Void - */ -static void wlan_hdd_tdls_implicit_enable(tdlsCtx_t *pHddTdlsCtx) -{ - hdd_debug("Enable Implicit TDLS"); - wlan_hdd_tdls_peer_reset_discovery_processed(pHddTdlsCtx); - pHddTdlsCtx->discovery_sent_cnt = 0; - wlan_tdd_tdls_reset_tx_rx(pHddTdlsCtx); - wlan_hdd_tdls_check_power_save_prohibited(pHddTdlsCtx->pAdapter); - - /* Restart the connection tracker timer */ - wlan_hdd_tdls_timer_restart(pHddTdlsCtx->pAdapter, - &pHddTdlsCtx->peer_update_timer, - pHddTdlsCtx->threshold_config.tx_period_t); - -} - /** * wlan_hdd_tdls_set_mode() - set TDLS mode * @hdd_ctx: HDD context @@ -1740,31 +1580,15 @@ static void wlan_hdd_tdls_set_mode(struct hdd_context *hdd_ctx, hdd_ctx->tdls_source_bitmap); return; } - wlan_hdd_tdls_implicit_enable(pHddTdlsCtx); - /* tdls implicit mode is enabled, so - * enable the connection tracker - */ - hdd_ctx->enable_tdls_connection_tracker = - true; } else if (eTDLS_SUPPORT_DISABLED == tdls_mode) { set_bit((unsigned long)source, &hdd_ctx->tdls_source_bitmap); wlan_hdd_tdls_implicit_disable(pHddTdlsCtx); - /* If tdls implicit mode is disabled, then - * stop the connection tracker. - */ - hdd_ctx->enable_tdls_connection_tracker = - false; } else if (eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY == tdls_mode) { clear_bit((unsigned long)source, &hdd_ctx->tdls_source_bitmap); wlan_hdd_tdls_implicit_disable(pHddTdlsCtx); - /* If tdls implicit mode is disabled, then - * stop the connection tracker. - */ - hdd_ctx->enable_tdls_connection_tracker = - false; /* * Check if any TDLS source bit is set and if @@ -1948,7 +1772,7 @@ void wlan_hdd_update_tdls_info(struct hdd_adapter *adapter, /* If TDLS support is disabled then no need to update target */ if (false == hdd_ctx->config->fEnableTDLSSupport) { hdd_err("TDLS not enabled"); - goto done; + return; } hdd_debug("tdls_prohibited: %d, tdls_chan_swit_prohibited: %d", @@ -1961,13 +1785,13 @@ void wlan_hdd_update_tdls_info(struct hdd_adapter *adapter, mutex_unlock(&hdd_ctx->tdls_lock); /* may be TDLS is not applicable for this adapter */ hdd_err("HDD TDLS context is null"); - goto done; + return; } if (hdd_ctx->set_state_info.set_state_cnt == 0 && tdls_prohibited) { mutex_unlock(&hdd_ctx->tdls_lock); - goto done; + return; } /* If AP or caller indicated TDLS Prohibited then disable tdls mode */ @@ -1985,7 +1809,7 @@ void wlan_hdd_update_tdls_info(struct hdd_adapter *adapter, if (!tdls_param) { mutex_unlock(&hdd_ctx->tdls_lock); hdd_err("memory allocation failed for tdlsParams"); - goto done; + return; } tdls_param->notification_interval_ms = @@ -2057,7 +1881,7 @@ void wlan_hdd_update_tdls_info(struct hdd_adapter *adapter, true); if (QDF_STATUS_SUCCESS != qdf_ret_status) { qdf_mem_free(tdls_param); - goto done; + return; } mutex_lock(&hdd_ctx->tdls_lock); @@ -2073,8 +1897,6 @@ void wlan_hdd_update_tdls_info(struct hdd_adapter *adapter, hdd_ctx->set_state_info.set_state_cnt); mutex_unlock(&hdd_ctx->tdls_lock); -done: - cds_set_tdls_ct_mode(hdd_ctx); } /** @@ -2587,10 +2409,6 @@ void wlan_hdd_tdls_connection_callback(struct hdd_adapter *pAdapter) wlan_hdd_tdls_peer_reset_discovery_processed(pHddTdlsCtx); pHddTdlsCtx->discovery_sent_cnt = 0; wlan_hdd_tdls_check_power_save_prohibited(pHddTdlsCtx->pAdapter); - /* Start the connection tracker timer */ - wlan_hdd_tdls_timer_restart(pHddTdlsCtx->pAdapter, - &pHddTdlsCtx->peer_update_timer, - tx_period_t); } mutex_unlock(&hdd_ctx->tdls_lock); @@ -4654,9 +4472,6 @@ int wlan_hdd_tdls_extctrl_config_peer(struct hdd_adapter *pAdapter, mutex_unlock(&hdd_ctx->tdls_lock); - /* set tdls connection tracker state */ - cds_set_tdls_ct_mode(hdd_ctx); - return status; rel_lock: mutex_unlock(&hdd_ctx->tdls_lock); @@ -4744,8 +4559,6 @@ int wlan_hdd_tdls_extctrl_deconfig_peer(struct hdd_adapter *pAdapter, goto ret_status; } - /* set tdls connection tracker state */ - cds_set_tdls_ct_mode(hdd_ctx); goto ret_status; rel_lock: @@ -5597,191 +5410,6 @@ ret_status: return ret_value; } -/** - * wlan_hdd_tdls_ct_sampling_tx_rx() - collect tx/rx traffic sample - * @adapter: pointer to hdd adapter - * @hdd_ctx: hdd context - * - * Function to update data traffic information in tdls connection - * tracker data structure for connection tracker operation - * - * Return: None - */ -static void wlan_hdd_tdls_ct_sampling_tx_rx(struct hdd_adapter *adapter, - struct hdd_context *hdd_ctx) -{ - hddTdlsPeer_t *curr_peer; - uint8_t mac[QDF_MAC_ADDR_SIZE]; - uint8_t mac_cnt; - uint8_t valid_mac_entries; - struct tdls_ct_mac_table ct_peer_mac_table[TDLS_CT_MAC_MAX_TABLE_SIZE]; - - qdf_spin_lock_bh(&hdd_ctx->tdls_ct_spinlock); - - if (0 == hdd_ctx->valid_mac_entries) { - qdf_spin_unlock_bh(&hdd_ctx->tdls_ct_spinlock); - return; - } - - valid_mac_entries = hdd_ctx->valid_mac_entries; - - memcpy(ct_peer_mac_table, hdd_ctx->ct_peer_mac_table, - (sizeof(struct tdls_ct_mac_table)) * valid_mac_entries); - - memset(hdd_ctx->ct_peer_mac_table, 0, - (sizeof(struct tdls_ct_mac_table)) * valid_mac_entries); - - hdd_ctx->valid_mac_entries = 0; - - qdf_spin_unlock_bh(&hdd_ctx->tdls_ct_spinlock); - mutex_lock(&hdd_ctx->tdls_lock); - for (mac_cnt = 0; mac_cnt < valid_mac_entries; mac_cnt++) { - memcpy(mac, ct_peer_mac_table[mac_cnt].mac_address.bytes, - QDF_MAC_ADDR_SIZE); - curr_peer = wlan_hdd_tdls_get_peer(adapter, mac); - if (NULL != curr_peer) { - curr_peer->tx_pkt = - ct_peer_mac_table[mac_cnt].tx_packet_cnt; - curr_peer->rx_pkt = - ct_peer_mac_table[mac_cnt].rx_packet_cnt; - } - } - mutex_unlock(&hdd_ctx->tdls_lock); -} - -/** - * wlan_hdd_tdls_update_rx_pkt_cnt() - Update rx packet count - * @adapter: pointer to hdd adapter - * @skb: pointer to sk_buff - * - * Increase the rx packet count, if the sender is not bssid and the packet is - * not broadcast and muticast packet - * - * This sampling information will be used in TDLS connection tracker - * - * This function expected to be called in an atomic context so blocking APIs - * not allowed - * - * Return: None - */ -void wlan_hdd_tdls_update_rx_pkt_cnt(struct hdd_adapter *adapter, - struct sk_buff *skb) -{ - struct hdd_context *hdd_ctx; - struct hdd_station_ctx *hdd_sta_ctx; - uint8_t mac_cnt; - uint8_t valid_mac_entries; - struct qdf_mac_addr *mac_addr; - - hdd_ctx = WLAN_HDD_GET_CTX(adapter); - - if (hdd_ctx->tdls_umac_comp_active) - return; - - if (!hdd_ctx->enable_tdls_connection_tracker) - return; - - mac_addr = (struct qdf_mac_addr *)(skb->data+QDF_MAC_ADDR_SIZE); - if (qdf_is_macaddr_group(mac_addr)) - return; - - hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); - if (memcmp(hdd_sta_ctx->conn_info.bssId.bytes, - mac_addr, QDF_MAC_ADDR_SIZE) == 0) - return; - - - qdf_spin_lock_bh(&hdd_ctx->tdls_ct_spinlock); - valid_mac_entries = hdd_ctx->valid_mac_entries; - - for (mac_cnt = 0; mac_cnt < valid_mac_entries; mac_cnt++) { - if (memcmp(hdd_ctx->ct_peer_mac_table[mac_cnt].mac_address.bytes, - mac_addr, QDF_MAC_ADDR_SIZE) == 0) { - hdd_ctx->ct_peer_mac_table[mac_cnt].rx_packet_cnt++; - goto rx_cnt_return; - } - } - - /* If we have more than 8 peers within 30 mins. we will - * stop tracking till the old entries are removed - */ - if (mac_cnt < TDLS_CT_MAC_MAX_TABLE_SIZE) { - memcpy(hdd_ctx->ct_peer_mac_table[mac_cnt].mac_address.bytes, - mac_addr, QDF_MAC_ADDR_SIZE); - hdd_ctx->valid_mac_entries = mac_cnt+1; - hdd_ctx->ct_peer_mac_table[mac_cnt].rx_packet_cnt = 1; - } - -rx_cnt_return: - qdf_spin_unlock_bh(&hdd_ctx->tdls_ct_spinlock); -} - -/** - * wlan_hdd_tdls_update_tx_pkt_cnt() - update tx packet - * @adapter: pointer to hdd adapter - * @skb: pointer to sk_buff - * - * Increase the tx packet count, if the sender is not bssid and the packet is - * not broadcast and muticast packet - * - * This sampling information will be used in TDLS connection tracker - * - * This function expected to be called in an atomic context so blocking APIs - * not allowed - * - * Return: None - */ -void wlan_hdd_tdls_update_tx_pkt_cnt(struct hdd_adapter *adapter, - struct sk_buff *skb) -{ - struct hdd_context *hdd_ctx; - struct hdd_station_ctx *hdd_sta_ctx; - uint8_t mac_cnt; - uint8_t valid_mac_entries; - struct qdf_mac_addr *mac_addr; - - hdd_ctx = WLAN_HDD_GET_CTX(adapter); - - if (hdd_ctx->tdls_umac_comp_active) - return; - - if (!hdd_ctx->enable_tdls_connection_tracker) - return; - - mac_addr = (struct qdf_mac_addr *)skb->data; - if (qdf_is_macaddr_group(mac_addr)) - return; - - hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); - if (memcmp(hdd_sta_ctx->conn_info.bssId.bytes, mac_addr, - QDF_MAC_ADDR_SIZE) == 0) - return; - - qdf_spin_lock_bh(&hdd_ctx->tdls_ct_spinlock); - valid_mac_entries = hdd_ctx->valid_mac_entries; - - for (mac_cnt = 0; mac_cnt < valid_mac_entries; mac_cnt++) { - if (memcmp(hdd_ctx->ct_peer_mac_table[mac_cnt].mac_address.bytes, - mac_addr, QDF_MAC_ADDR_SIZE) == 0) { - hdd_ctx->ct_peer_mac_table[mac_cnt].tx_packet_cnt++; - goto tx_cnt_return; - } - } - - /* If we have more than 8 peers within 30 mins. we will - * stop tracking till the old entries are removed - */ - if (mac_cnt < TDLS_CT_MAC_MAX_TABLE_SIZE) { - memcpy(hdd_ctx->ct_peer_mac_table[mac_cnt].mac_address.bytes, - mac_addr, QDF_MAC_ADDR_SIZE); - hdd_ctx->ct_peer_mac_table[mac_cnt].tx_packet_cnt = 1; - hdd_ctx->valid_mac_entries++; - } - -tx_cnt_return: - qdf_spin_unlock_bh(&hdd_ctx->tdls_ct_spinlock); -} - /** * wlan_hdd_tdls_implicit_send_discovery_request() - send discovery request * @hdd_tdls_ctx: tdls context @@ -5846,390 +5474,6 @@ done: EXIT(); } -/** - * wlan_hdd_get_conn_info() - get the tdls connection information. - * @hdd_ctx: hdd context - * @hdd_ctx: sta id - * - * Function to check tdls sta index - * - * Return: None - */ -static tdlsConnInfo_t *wlan_hdd_get_conn_info(struct hdd_context *hdd_ctx, - uint8_t idx) -{ - uint8_t sta_idx; - - /* check if there is available index for this new TDLS STA */ - for (sta_idx = 0; sta_idx < HDD_MAX_NUM_TDLS_STA; sta_idx++) { - if (idx == hdd_ctx->tdlsConnInfo[sta_idx].staId) { - hdd_info("tdls peer with staIdx %u exists", idx); - return &hdd_ctx->tdlsConnInfo[sta_idx]; - } - } - hdd_err("tdls peer with staIdx %u not exists", idx); - return NULL; -} - -/** - * wlan_hdd_tdls_idle_handler() - Check tdls idle traffic - * @user_data: data from tdls idle timer - * - * Function to check the tdls idle traffic and make a decision about - * tdls teardown - * - * Return: None - */ -static void wlan_hdd_tdls_idle_handler(void *user_data) -{ - tdlsConnInfo_t *tdls_info = (tdlsConnInfo_t *) user_data; - hddTdlsPeer_t *curr_peer; - tdlsCtx_t *hdd_tdls_ctx; - struct hdd_context *hdd_ctx; - struct hdd_adapter *adapter; - - if (!tdls_info->staId) { - hdd_err("peer (staidx %u) doesn't exists", tdls_info->staId); - return; - } - - hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); - if (0 != (wlan_hdd_validate_context(hdd_ctx))) - return; - - adapter = hdd_get_adapter_by_sme_session_id(hdd_ctx, - tdls_info->sessionId); - - if (!adapter) { - hdd_err("adapter is NULL"); - return; - } - - mutex_lock(&hdd_ctx->tdls_lock); - curr_peer = wlan_hdd_tdls_find_peer(adapter, - (u8 *) &tdls_info->peerMac.bytes[0]); - - if (NULL == curr_peer) { - hdd_err("Invalid tdls idle timer expired"); - goto error_idle_return; - } - - hdd_tdls_ctx = curr_peer->pHddTdlsCtx; - if (NULL == hdd_tdls_ctx) { - hdd_err("Invalid hdd_tdls_ctx context"); - goto error_idle_return; - } - - hdd_debug(MAC_ADDRESS_STR " tx_pkt: %d, rx_pkt: %d, idle_packet_n: %d", - MAC_ADDR_ARRAY(curr_peer->peerMac), - curr_peer->tx_pkt, - curr_peer->rx_pkt, - curr_peer->pHddTdlsCtx->threshold_config.idle_packet_n); - - /* Check tx/rx statistics on this tdls link for recent activities and - * then decide whether to tear down the link or keep it. - */ - if ((curr_peer->tx_pkt >= - curr_peer->pHddTdlsCtx->threshold_config.idle_packet_n) || - (curr_peer->rx_pkt >= - curr_peer->pHddTdlsCtx->threshold_config.idle_packet_n)) { - /* this tdls link got back to normal, so keep it */ - hdd_debug("tdls link to " MAC_ADDRESS_STR - " back to normal, will stay", - MAC_ADDR_ARRAY(curr_peer->peerMac)); - } else { - /* this tdls link needs to get torn down */ - hdd_debug("trigger tdls link to "MAC_ADDRESS_STR - " down", MAC_ADDR_ARRAY(curr_peer->peerMac)); - wlan_hdd_tdls_indicate_teardown(curr_peer->pHddTdlsCtx->pAdapter, - curr_peer, - eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON); - } -error_idle_return: - mutex_unlock(&hdd_ctx->tdls_lock); -} - -/** - * tdls_ct_process_idle_and_discovery() - process the traffic data - * @curr_peer: tdls peer needs to be examined - * @hdd_ctx: hdd context - * @hdd_tdls_ctx: tdls context - * - * Function to check the peer traffic data in idle link and tdls - * discovering link - * - * Return: None - */ -static void tdls_ct_process_idle_and_discovery(hddTdlsPeer_t *curr_peer, - tdlsCtx_t *hdd_tdls_ctx) -{ - uint16_t valid_peers; - - valid_peers = wlan_hdd_tdls_connected_peers(hdd_tdls_ctx->pAdapter); - - if ((curr_peer->tx_pkt + curr_peer->rx_pkt) >= - hdd_tdls_ctx->threshold_config.tx_packet_n) { - if (HDD_MAX_NUM_TDLS_STA > valid_peers) { - hdd_debug("Tput trigger TDLS pre-setup"); - hdd_tdls_ctx->curr_candidate = curr_peer; - wlan_hdd_tdls_implicit_send_discovery_request( - hdd_tdls_ctx); - } else { - hdd_debug("Maximum peers connected already! %d", - valid_peers); - } - } -} - - -/** - * tdls_ct_process_connected_link() - process the traffic - * @curr_peer: tdls peer needs to be examined - * @hdd_ctx: hdd context - * @hdd_tdls_ctx: tdls context - * - * Function to check the peer traffic data in active STA - * session - * - * Return: None - */ -static void tdls_ct_process_connected_link(hddTdlsPeer_t *curr_peer, - struct hdd_context *hdd_ctx, - tdlsCtx_t *hdd_tdls_ctx) -{ - if ((int32_t)curr_peer->rssi < - (int32_t)hdd_tdls_ctx->threshold_config.rssi_teardown_threshold) { - hdd_warn("Tear down - low RSSI: " MAC_ADDRESS_STR "!", - MAC_ADDR_ARRAY(curr_peer->peerMac)); - wlan_hdd_tdls_indicate_teardown(hdd_tdls_ctx->pAdapter, - curr_peer, - eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON); - return; - } - - /* Only teardown based on non zero idle packet threshold, to address - * a use case where this threshold does not get consider for TEAR DOWN - */ - if ((0 != hdd_tdls_ctx->threshold_config.idle_packet_n) && - ((curr_peer->tx_pkt < - hdd_tdls_ctx->threshold_config.idle_packet_n) && - (curr_peer->rx_pkt < - hdd_tdls_ctx->threshold_config.idle_packet_n))) { - if (!curr_peer->is_peer_idle_timer_initialised) { - uint8_t staId = (uint8_t)curr_peer->staId; - - tdlsConnInfo_t *tdls_info; - - tdls_info = wlan_hdd_get_conn_info(hdd_ctx, staId); - qdf_mc_timer_init(&curr_peer->peer_idle_timer, - QDF_TIMER_TYPE_SW, - wlan_hdd_tdls_idle_handler, - tdls_info); - curr_peer->is_peer_idle_timer_initialised = true; - } - if (QDF_TIMER_STATE_RUNNING != - curr_peer->peer_idle_timer.state) { - hdd_warn("Tx/Rx Idle timer start: " MAC_ADDRESS_STR "!", - MAC_ADDR_ARRAY(curr_peer->peerMac)); - wlan_hdd_tdls_timer_restart(hdd_tdls_ctx->pAdapter, - &curr_peer->peer_idle_timer, - hdd_tdls_ctx->threshold_config.idle_timeout_t); - } - } else if (QDF_TIMER_STATE_RUNNING == - curr_peer->peer_idle_timer.state) { - hdd_warn("Tx/Rx Idle timer stop: " MAC_ADDRESS_STR "!", - MAC_ADDR_ARRAY(curr_peer->peerMac)); - qdf_mc_timer_stop(&curr_peer->peer_idle_timer); - } -} - -/** - * wlan_hdd_tdls_ct_process_cap_supported() - process TDLS supported peer. - * @curr_peer: tdls peer needs to be examined - * @hdd_ctx: hdd context - * @hdd_tdls_ctx: tdls context - * - * Function to check the peer traffic data for tdls supported peer - * - * Return: None - */ -static void wlan_hdd_tdls_ct_process_cap_supported(hddTdlsPeer_t *curr_peer, - struct hdd_context *hdd_ctx, - tdlsCtx_t *hdd_tdls_ctx) -{ - hdd_debug("tx %d, rx %d (thr.pkt %d/idle %d), rssi %d (thr.trig %d/tear %d)", - curr_peer->tx_pkt, curr_peer->rx_pkt, - hdd_tdls_ctx->threshold_config.tx_packet_n, - hdd_tdls_ctx->threshold_config.idle_packet_n, - curr_peer->rssi, - hdd_tdls_ctx->threshold_config.rssi_trigger_threshold, - hdd_tdls_ctx->threshold_config.rssi_teardown_threshold); - - switch (curr_peer->link_status) { - case eTDLS_LINK_IDLE: - case eTDLS_LINK_DISCOVERING: - if (hdd_ctx->config->fTDLSExternalControl && - (!curr_peer->isForcedPeer)) - break; - tdls_ct_process_idle_and_discovery(curr_peer, hdd_tdls_ctx); - break; - case eTDLS_LINK_CONNECTED: - tdls_ct_process_connected_link(curr_peer, hdd_ctx, - hdd_tdls_ctx); - break; - default: - break; - } -} - -/** - * wlan_hdd_tdls_ct_process_cap_unknown() - process unknown peer - * @curr_peer: tdls peer needs to be examined - * @hdd_ctx: hdd context - * @hdd_tdls_ctx: tdls context - * - * Function check the peer traffic data , when tdls capability is unknown - * - * Return: None - */ -static void wlan_hdd_tdls_ct_process_cap_unknown(hddTdlsPeer_t *curr_peer, - struct hdd_context *hdd_ctx, - tdlsCtx_t *hdd_tdls_ctx) -{ - if (hdd_ctx->config->fTDLSExternalControl && - (!curr_peer->isForcedPeer)) { - return; - } - - hdd_debug("threshold_config.tx_packet_n = %d curr_peer->tx_pkt = %d curr_peer->rx_pkt = %d ", - hdd_tdls_ctx->threshold_config.tx_packet_n, curr_peer->tx_pkt, - curr_peer->rx_pkt); - - if (!TDLS_IS_CONNECTED(curr_peer) && - ((curr_peer->tx_pkt + curr_peer->rx_pkt) >= - hdd_tdls_ctx->threshold_config.tx_packet_n)) { - /* Ignore discovery attempt if External Control is enabled, that - * is, peer is forced. In that case, continue discovery attempt - * regardless attempt count - */ - hdd_debug("TDLS UNKNOWN pre discover "); - if (curr_peer->isForcedPeer || curr_peer->discovery_attempt++ < - hdd_tdls_ctx->threshold_config.discovery_tries_n) { - hdd_debug("TDLS UNKNOWN discover "); - hdd_tdls_ctx->curr_candidate = curr_peer; - wlan_hdd_tdls_implicit_send_discovery_request(hdd_tdls_ctx); - } else { - curr_peer->tdls_support = eTDLS_CAP_NOT_SUPPORTED; - wlan_hdd_tdls_set_peer_link_status( - curr_peer, - eTDLS_LINK_IDLE, - eTDLS_LINK_NOT_SUPPORTED); - } - } -} - - -/** - * wlan_hdd_tdls_ct_process_peers() - process the peer - * @curr_peer: tdls peer needs to be examined - * @hdd_ctx: hdd context - * @hdd_tdls_ctx: tdls context - * - * This function check the peer capability and process the metadata from - * the peer - * - * Return: None - */ -static void wlan_hdd_tdls_ct_process_peers(hddTdlsPeer_t *curr_peer, - struct hdd_context *hdd_ctx, - tdlsCtx_t *hdd_tdls_ctx) -{ - hdd_debug(MAC_ADDRESS_STR " link_status %d tdls_support %d", - MAC_ADDR_ARRAY(curr_peer->peerMac), - curr_peer->link_status, curr_peer->tdls_support); - - switch (curr_peer->tdls_support) { - case eTDLS_CAP_SUPPORTED: - wlan_hdd_tdls_ct_process_cap_supported(curr_peer, hdd_ctx, - hdd_tdls_ctx); - break; - - case eTDLS_CAP_UNKNOWN: - wlan_hdd_tdls_ct_process_cap_unknown(curr_peer, hdd_ctx, - hdd_tdls_ctx); - break; - default: - break; - } - -} - -/** - * wlan_hdd_tdls_ct_handler() - TDLS connection tracker handler - * @user_data: user data from timer - * - * tdls connection tracker timer starts, when the STA connected to AP - * and it's scan the traffic between two STA peers and make TDLS - * connection and teardown, based on the traffic threshold - * - * Return: None - */ -static void wlan_hdd_tdls_ct_handler(void *user_data) -{ - int i; - struct hdd_adapter *adapter; - struct list_head *head; - struct list_head *pos; - hddTdlsPeer_t *curr_peer; - tdlsCtx_t *hdd_tdls_ctx; - struct hdd_context *hdd_ctx; - - adapter = (struct hdd_adapter *)user_data; - - if (NULL == adapter) { - hdd_err("Invalid adapter context"); - return; - } - - hdd_ctx = WLAN_HDD_GET_CTX(adapter); - - if (0 != (wlan_hdd_validate_context(hdd_ctx))) - return; - /* If any concurrency is detected */ - if (!hdd_ctx->enable_tdls_connection_tracker) { - hdd_debug("Connection tracker is disabled"); - return; - } - - /* Update tx rx traffic sample in tdls data structures */ - wlan_hdd_tdls_ct_sampling_tx_rx(adapter, hdd_ctx); - - mutex_lock(&hdd_ctx->tdls_lock); - hdd_tdls_ctx = WLAN_HDD_GET_TDLS_CTX_PTR(adapter); - - if (NULL == hdd_tdls_ctx) { - mutex_unlock(&hdd_ctx->tdls_lock); - hdd_err("Invalid hdd_tdls_ctx context"); - return; - } - - for (i = 0; i < TDLS_PEER_LIST_SIZE; i++) { - head = &hdd_tdls_ctx->peer_list[i]; - list_for_each(pos, head) { - curr_peer = list_entry(pos, hddTdlsPeer_t, node); - wlan_hdd_tdls_ct_process_peers(curr_peer, hdd_ctx, - hdd_tdls_ctx); - curr_peer->tx_pkt = 0; - curr_peer->rx_pkt = 0; - } - } - - wlan_hdd_tdls_timer_restart(hdd_tdls_ctx->pAdapter, - &hdd_tdls_ctx->peer_update_timer, - hdd_tdls_ctx->threshold_config.tx_period_t); - mutex_unlock(&hdd_ctx->tdls_lock); -} - /** * hdd_set_tdls_scan_type - set scan during active tdls session * @hdd_ctx: ptr to hdd context. @@ -6452,51 +5696,6 @@ bool cds_check_is_tdls_allowed(enum tQDF_ADAPTER_MODE device_mode) return state; } -void cds_set_tdls_ct_mode(struct hdd_context *hdd_ctx) -{ - bool state = false; - - /* If any concurrency is detected, skip tdls pkt tracker */ - if (policy_mgr_get_connection_count(hdd_ctx->hdd_psoc) > 1) { - state = false; - goto set_state; - } - - if (eTDLS_SUPPORT_DISABLED == hdd_ctx->tdls_mode || - eTDLS_SUPPORT_NOT_ENABLED == hdd_ctx->tdls_mode || - (!hdd_ctx->config->fEnableTDLSImplicitTrigger)) { - state = false; - goto set_state; - } else if (policy_mgr_mode_specific_connection_count(hdd_ctx->hdd_psoc, - QDF_STA_MODE, NULL) == 1) { - state = true; - } else if (policy_mgr_mode_specific_connection_count(hdd_ctx->hdd_psoc, - QDF_P2P_CLIENT_MODE, NULL) == 1){ - state = true; - } else { - state = false; - goto set_state; - } - - /* In case of TDLS external control, peer should be added - * by the user space to start connection tracker. - */ - if (hdd_ctx->config->fTDLSExternalControl) { - if (hdd_ctx->tdls_external_peer_count) - state = true; - else - state = false; - } - -set_state: - mutex_lock(&hdd_ctx->tdls_lock); - hdd_ctx->enable_tdls_connection_tracker = state; - mutex_unlock(&hdd_ctx->tdls_lock); - - hdd_info("enable_tdls_connection_tracker %d", - hdd_ctx->enable_tdls_connection_tracker); -} - QDF_STATUS hdd_tdls_register_tdls_peer(void *userdata, uint32_t vdev_id, const uint8_t *mac, uint16_t sta_id, uint8_t ucastsig, uint8_t qos) diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 80e917eb632c..54f78438f1d8 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -708,8 +708,6 @@ static int __hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) 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)) pAdapter->stats.tx_packets += qdf_nbuf_get_tso_num_seg(skb); else @@ -1258,8 +1256,6 @@ QDF_STATUS hdd_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf) ucfg_tdls_update_rx_pkt_cnt(pAdapter->hdd_vdev, mac_addr); - wlan_hdd_tdls_update_rx_pkt_cnt(pAdapter, skb); - skb->dev = pAdapter->dev; skb->protocol = eth_type_trans(skb, skb->dev); ++pAdapter->hdd_stats.hddTxRxStats.rxPackets[cpu_index]; diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index 1e1c7e14b591..7c4c7be3853b 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -1689,7 +1689,6 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx, case SIR_HAL_TDLS_SHOULD_DISCOVER: case SIR_HAL_TDLS_SHOULD_TEARDOWN: case SIR_HAL_TDLS_PEER_DISCONNECTED: - case SIR_HAL_TDLS_CONNECTION_TRACKER_NOTIFICATION: QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, ("%s received tdls event: 0x%x"), __func__, msg->type); lim_send_sme_tdls_event_notify(mac_ctx, msg->type, 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 e0c20579ecdf..7f8da9548cbd 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 @@ -1368,9 +1368,6 @@ void lim_send_sme_tdls_event_notify(tpAniSirGlobal pMac, uint16_t msgType, case SIR_HAL_TDLS_PEER_DISCONNECTED: mmhMsg.type = eWNI_SME_TDLS_PEER_DISCONNECTED; break; - case SIR_HAL_TDLS_CONNECTION_TRACKER_NOTIFICATION: - mmhMsg.type = eWNI_SME_TDLS_CONNECTION_TRACKER_NOTIFICATION; - break; } mmhMsg.bodyptr = events; diff --git a/core/sme/src/csr/csr_tdls_process.c b/core/sme/src/csr/csr_tdls_process.c index 42be415b700e..bcf728c213e7 100644 --- a/core/sme/src/csr/csr_tdls_process.c +++ b/core/sme/src/csr/csr_tdls_process.c @@ -827,18 +827,6 @@ QDF_STATUS tdls_msg_processor(tpAniSirGlobal pMac, uint16_t msgType, 0, eCSR_ROAM_TDLS_STATUS_UPDATE, eCSR_ROAM_RESULT_TDLS_SHOULD_PEER_DISCONNECTED); break; - case eWNI_SME_TDLS_CONNECTION_TRACKER_NOTIFICATION: - qdf_copy_macaddr(&roamInfo->peerMac, &tevent->peermac); - roamInfo->reasonCode = tevent->peer_reason; - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG, - "%s: eWNI_SME_TDLS_CONNECTION_TRACKER_NOTIFICATION for peer mac: " - MAC_ADDRESS_STR " peer_reason: %d", - __func__, MAC_ADDR_ARRAY(tevent->peermac.bytes), - tevent->peer_reason); - csr_roam_call_callback(pMac, tevent->sessionId, roamInfo, - 0, eCSR_ROAM_TDLS_STATUS_UPDATE, - eCSR_ROAM_RESULT_TDLS_CONNECTION_TRACKER_NOTIFICATION); - break; default: break; } diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 01182a4104f8..97f3670d0883 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -3942,116 +3942,7 @@ static inline void wma_suspend_target_timeout(bool is_self_recovery_enabled) */ int wma_tdls_event_handler(void *handle, uint8_t *event, uint32_t len) { - tp_wma_handle wma = (tp_wma_handle) handle; - WMI_TDLS_PEER_EVENTID_param_tlvs *param_buf = NULL; - wmi_tdls_peer_event_fixed_param *peer_event = NULL; - tSirTdlsEventnotify *tdls_event; - - if (!event) { - WMA_LOGE("%s: event param null", __func__); - return -EINVAL; - } - - param_buf = (WMI_TDLS_PEER_EVENTID_param_tlvs *) event; - if (!param_buf) { - WMA_LOGE("%s: received null buf from target", __func__); - return -EINVAL; - } - - peer_event = param_buf->fixed_param; - if (!peer_event) { - WMA_LOGE("%s: received null event data from target", __func__); - return -EINVAL; - } - - tdls_event = (tSirTdlsEventnotify *) - qdf_mem_malloc(sizeof(*tdls_event)); - if (!tdls_event) { - WMA_LOGE("%s: failed to allocate memory for tdls_event", - __func__); - return -ENOMEM; - } - - tdls_event->sessionId = peer_event->vdev_id; - WMI_MAC_ADDR_TO_CHAR_ARRAY(&peer_event->peer_macaddr, - tdls_event->peermac.bytes); - - switch (peer_event->peer_status) { - case WMI_TDLS_SHOULD_DISCOVER: - tdls_event->messageType = WMA_TDLS_SHOULD_DISCOVER_CMD; - break; - case WMI_TDLS_SHOULD_TEARDOWN: - tdls_event->messageType = WMA_TDLS_SHOULD_TEARDOWN_CMD; - break; - case WMI_TDLS_PEER_DISCONNECTED: - tdls_event->messageType = WMA_TDLS_PEER_DISCONNECTED_CMD; - break; - case WMI_TDLS_CONNECTION_TRACKER_NOTIFICATION: - tdls_event->messageType = - WMA_TDLS_CONNECTION_TRACKER_NOTIFICATION_CMD; - break; - default: - qdf_mem_free(tdls_event); - WMA_LOGE("%s: Discarding unknown tdls event(%d) from target", - __func__, peer_event->peer_status); - return -EINVAL; - } - - switch (peer_event->peer_reason) { - case WMI_TDLS_TEARDOWN_REASON_TX: - tdls_event->peer_reason = eWNI_TDLS_TEARDOWN_REASON_TX; - break; - case WMI_TDLS_TEARDOWN_REASON_RSSI: - tdls_event->peer_reason = eWNI_TDLS_TEARDOWN_REASON_RSSI; - break; - case WMI_TDLS_TEARDOWN_REASON_SCAN: - tdls_event->peer_reason = eWNI_TDLS_TEARDOWN_REASON_SCAN; - break; - case WMI_TDLS_DISCONNECTED_REASON_PEER_DELETE: - tdls_event->peer_reason = - eWNI_TDLS_DISCONNECTED_REASON_PEER_DELETE; - break; - case WMI_TDLS_TEARDOWN_REASON_PTR_TIMEOUT: - tdls_event->peer_reason = eWNI_TDLS_TEARDOWN_REASON_PTR_TIMEOUT; - break; - case WMI_TDLS_TEARDOWN_REASON_BAD_PTR: - tdls_event->peer_reason = eWNI_TDLS_TEARDOWN_REASON_BAD_PTR; - break; - case WMI_TDLS_TEARDOWN_REASON_NO_RESPONSE: - tdls_event->peer_reason = eWNI_TDLS_TEARDOWN_REASON_NO_RESPONSE; - break; - case WMI_TDLS_ENTER_BUF_STA: - tdls_event->peer_reason = eWNI_TDLS_PEER_ENTER_BUF_STA; - break; - case WMI_TDLS_EXIT_BUF_STA: - tdls_event->peer_reason = eWNI_TDLS_PEER_EXIT_BUF_STA; - break; - case WMI_TDLS_ENTER_BT_BUSY_MODE: - tdls_event->peer_reason = eWNI_TDLS_ENTER_BT_BUSY_MODE; - break; - case WMI_TDLS_EXIT_BT_BUSY_MODE: - tdls_event->peer_reason = eWNI_TDLS_EXIT_BT_BUSY_MODE; - break; - case WMI_TDLS_SCAN_STARTED_EVENT: - tdls_event->peer_reason = eWMI_TDLS_SCAN_STARTED_EVENT; - break; - case WMI_TDLS_SCAN_COMPLETED_EVENT: - tdls_event->peer_reason = eWMI_TDLS_SCAN_COMPLETED_EVENT; - break; - - default: - qdf_mem_free(tdls_event); - WMA_LOGE("%s: unknown reason(%d) in tdls event(%d) from target", - __func__, peer_event->peer_reason, - peer_event->peer_status); - return -EINVAL; - } - - WMA_LOGD("%s: sending msg to umac, messageType: 0x%x, for peer: %pM, reason: %d, smesessionId: %d", - __func__, tdls_event->messageType, tdls_event->peermac.bytes, - tdls_event->peer_reason, tdls_event->sessionId); - - wma_send_msg(wma, tdls_event->messageType, (void *)tdls_event, 0); + /* TODO update with target rx ops */ return 0; }