qcacld-3.0: TDLS UMAC legacy changes

Add legacy changes to enable TDLS UMAC component.

Change-Id: I3ddfe988cf09a6c37e51256d6040527571c75353
CRs-Fixed: 2035617
This commit is contained in:
Kabilan Kannan
2017-04-06 22:49:26 -07:00
committed by Sandeep Puligilla
parent f56f9d5960
commit 1c1c40276e
11 changed files with 139 additions and 9 deletions

View File

@@ -1604,6 +1604,7 @@ struct hdd_context_s {
unsigned long tdls_source_bitmap; unsigned long tdls_source_bitmap;
/* tdls source timer to enable/disable TDLS on p2p listen */ /* tdls source timer to enable/disable TDLS on p2p listen */
qdf_mc_timer_t tdls_source_timer; qdf_mc_timer_t tdls_source_timer;
bool tdls_umac_comp_active;
uint8_t beacon_probe_rsp_cnt_per_scan; uint8_t beacon_probe_rsp_cnt_per_scan;
uint8_t last_scan_reject_session_id; uint8_t last_scan_reject_session_id;
enum scan_reject_states last_scan_reject_reason; enum scan_reject_states last_scan_reject_reason;

View File

@@ -1201,6 +1201,8 @@ static void hdd_send_association_event(struct net_device *dev,
/* change logging before release */ /* change logging before release */
hdd_debug("LFR3:hdd_send_association_event"); hdd_debug("LFR3:hdd_send_association_event");
/* Update tdls module about the disconnection 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); wlan_hdd_tdls_notify_disconnect(pAdapter, true);
} }
#endif #endif
@@ -1291,8 +1293,14 @@ static void hdd_send_association_event(struct net_device *dev,
pAdapter->sessionId, &chan_info, pAdapter->sessionId, &chan_info,
pAdapter->device_mode); pAdapter->device_mode);
/* Update tdls module about connection event */ /* 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); wlan_hdd_tdls_notify_connect(pAdapter, pCsrRoamInfo);
#ifdef MSM_PLATFORM #ifdef MSM_PLATFORM
#if defined(CONFIG_ICNSS) || defined(CONFIG_CNSS) #if defined(CONFIG_ICNSS) || defined(CONFIG_CNSS)
/* start timer in sta/p2p_cli */ /* 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); hdd_lpass_notify_disconnect(pAdapter);
/* Update tdls module about the disconnection event */ /* Update tdls module about the disconnection event */
hdd_notify_sta_disconnect(pAdapter->sessionId,
false,
pAdapter->hdd_vdev);
wlan_hdd_tdls_notify_disconnect(pAdapter, false); wlan_hdd_tdls_notify_disconnect(pAdapter, false);
#ifdef MSM_PLATFORM #ifdef MSM_PLATFORM

View File

@@ -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 */ /* 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) void wlan_hdd_cfg80211_register_frames(hdd_adapter_t *pAdapter)
{ {
tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(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, policy_mgr_clear_concurrency_mode(pHddCtx->hdd_psoc,
pAdapter->device_mode); pAdapter->device_mode);
hdd_notify_teardown_tdls_links(pAdapter->hdd_vdev);
hdd_update_tdls_ct_and_teardown_links(pHddCtx); hdd_update_tdls_ct_and_teardown_links(pHddCtx);
if ((pAdapter->device_mode == QDF_STA_MODE) || if ((pAdapter->device_mode == QDF_STA_MODE) ||
(pAdapter->device_mode == QDF_P2P_CLIENT_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; goto ret_status;
} }
hdd_notify_teardown_tdls_links(pAdapter->hdd_vdev);
wlan_hdd_tdls_disable_offchan_and_teardown_links(pHddCtx); wlan_hdd_tdls_disable_offchan_and_teardown_links(pHddCtx);
pRoamProfile = &pWextState->roamProfile; pRoamProfile = &pWextState->roamProfile;

View File

@@ -434,4 +434,59 @@ int wlan_hdd_try_disconnect(hdd_adapter_t *adapter);
*/ */
void hdd_process_defer_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 #endif

View File

@@ -7401,6 +7401,8 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
return -EINVAL; return -EINVAL;
} }
hdd_notify_teardown_tdls_links(pHostapdAdapter->hdd_vdev);
wlan_hdd_tdls_disable_offchan_and_teardown_links(pHddCtx); wlan_hdd_tdls_disable_offchan_and_teardown_links(pHddCtx);
if (policy_mgr_is_hw_mode_change_in_progress(pHddCtx->hdd_psoc)) { if (policy_mgr_is_hw_mode_change_in_progress(pHddCtx->hdd_psoc)) {

View File

@@ -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_add_sta_req = eWNI_SME_TDLS_ADD_STA_REQ;
tdls_cfg.tdls_del_sta_req = eWNI_SME_TDLS_DEL_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_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_event_cb = wlan_cfg80211_tdls_event_callback;
tdls_cfg.tdls_evt_cb_data = psoc; tdls_cfg.tdls_evt_cb_data = psoc;
tdls_cfg.tdls_tl_peer_data = hdd_ctx; 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; return -EINVAL;
} }
hdd_ctx->tdls_umac_comp_active = true;
return 0; return 0;
} }
#else #else
static int hdd_update_tdls_config(hdd_context_t *hdd_ctx) static int hdd_update_tdls_config(hdd_context_t *hdd_ctx)
{ {
hdd_ctx->tdls_umac_comp_active = false;
return 0; return 0;
} }
#endif #endif

View File

@@ -221,6 +221,9 @@ void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx)
hddTdlsPeer_t *curr_peer = NULL; hddTdlsPeer_t *curr_peer = NULL;
hdd_adapter_t *adapter = NULL; hdd_adapter_t *adapter = NULL;
if (hddctx->tdls_umac_comp_active)
return;
if (eTDLS_SUPPORT_NOT_ENABLED == hddctx->tdls_mode) { if (eTDLS_SUPPORT_NOT_ENABLED == hddctx->tdls_mode) {
hdd_notice("TDLS mode is disabled OR not enabled in FW"); hdd_notice("TDLS mode is disabled OR not enabled in FW");
return; return;
@@ -747,6 +750,9 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter)
ENTER(); ENTER();
if (pHddCtx->tdls_umac_comp_active)
return 0;
mutex_lock(&pHddCtx->tdls_lock); mutex_lock(&pHddCtx->tdls_lock);
if (false == pHddCtx->config->fEnableTDLSSupport) { if (false == pHddCtx->config->fEnableTDLSSupport) {
@@ -2081,8 +2087,16 @@ done:
void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter, void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter,
tCsrRoamInfo *csr_roam_info) tCsrRoamInfo *csr_roam_info)
{ {
hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
hdd_info("Check and update TDLS state"); hdd_info("Check and update TDLS state");
if (!hdd_ctx)
return;
if (hdd_ctx->tdls_umac_comp_active)
return;
/* Association event */ /* Association event */
if (adapter->device_mode == QDF_STA_MODE || if (adapter->device_mode == QDF_STA_MODE ||
adapter->device_mode == QDF_P2P_CLIENT_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"); hdd_info("Check and update TDLS state");
if (!hdd_ctx)
return;
if (hdd_ctx->tdls_umac_comp_active)
return;
/* Disassociation event */ /* Disassociation event */
if (adapter->device_mode == QDF_STA_MODE || if (adapter->device_mode == QDF_STA_MODE ||
adapter->device_mode == QDF_P2P_CLIENT_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) if (ret)
return ret; return ret;
if (pHddCtx->tdls_umac_comp_active)
return 1;
/* if tdls is not enabled, then continue scan */ /* if tdls is not enabled, then continue scan */
if (eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode) if (eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode)
return 1; return 1;
@@ -2999,6 +3023,9 @@ void wlan_hdd_tdls_scan_done_callback(hdd_adapter_t *pAdapter)
if (0 != (wlan_hdd_validate_context(pHddCtx))) if (0 != (wlan_hdd_validate_context(pHddCtx)))
return; return;
if (pHddCtx->tdls_umac_comp_active)
return;
if (eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode) { if (eTDLS_SUPPORT_NOT_ENABLED == pHddCtx->tdls_mode) {
hdd_info("TDLS mode is disabled OR not enabled"); hdd_info("TDLS mode is disabled OR not enabled");
return; 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]); trigger_mode = nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_TRIGGER_MODE]);
hdd_notice("TDLS trigger mode %d", 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) { switch (trigger_mode) {
case WLAN_HDD_VENDOR_TDLS_TRIGGER_MODE_EXPLICIT: case WLAN_HDD_VENDOR_TDLS_TRIGGER_MODE_EXPLICIT:
tdls_mode = eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY; 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); hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
#ifdef CONVERGED_TDLS_ENABLE if (pHddCtx->tdls_umac_comp_active)
return wlan_cfg80211_tdls_mgmt(pHddCtx->hdd_pdev, dev, peer, return wlan_cfg80211_tdls_mgmt(pHddCtx->hdd_pdev, dev,
action_code, dialog_token, peer,
status_code, peer_capability, action_code, dialog_token,
buf, len); status_code, peer_capability,
#endif buf, len);
/* /*
* STA or P2P client should be connected and authenticated before * 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); hdd_ctx = WLAN_HDD_GET_CTX(adapter);
if (hdd_ctx->tdls_umac_comp_active)
return;
if (!hdd_ctx->enable_tdls_connection_tracker) if (!hdd_ctx->enable_tdls_connection_tracker)
return; return;
@@ -5670,6 +5706,9 @@ void wlan_hdd_tdls_update_tx_pkt_cnt(hdd_adapter_t *adapter,
hdd_ctx = WLAN_HDD_GET_CTX(adapter); hdd_ctx = WLAN_HDD_GET_CTX(adapter);
if (hdd_ctx->tdls_umac_comp_active)
return;
if (!hdd_ctx->enable_tdls_connection_tracker) if (!hdd_ctx->enable_tdls_connection_tracker)
return; return;

View File

@@ -486,6 +486,7 @@ static int __hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
bool granted; bool granted;
uint8_t STAId; uint8_t STAId;
hdd_station_ctx_t *pHddStaCtx = &pAdapter->sessionCtx.station; hdd_station_ctx_t *pHddStaCtx = &pAdapter->sessionCtx.station;
struct qdf_mac_addr *mac_addr;
#ifdef QCA_PKT_PROTO_TRACE #ifdef QCA_PKT_PROTO_TRACE
uint8_t proto_type = 0; uint8_t proto_type = 0;
hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter); 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; 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); wlan_hdd_tdls_update_tx_pkt_cnt(pAdapter, skb);
if (qdf_nbuf_is_tso(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; struct sk_buff *next = NULL;
hdd_station_ctx_t *pHddStaCtx = NULL; hdd_station_ctx_t *pHddStaCtx = NULL;
unsigned int cpu_index; unsigned int cpu_index;
struct qdf_mac_addr *mac_addr;
/* Sanity check on inputs */ /* Sanity check on inputs */
if (unlikely((NULL == context) || (NULL == rxBuf))) { 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_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE),
QDF_RX)); 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); wlan_hdd_tdls_update_rx_pkt_cnt(pAdapter, skb);
skb->dev = pAdapter->dev; skb->dev = pAdapter->dev;

View File

@@ -2194,6 +2194,7 @@ void lim_process_action_frame(tpAniSirGlobal mac_ctx,
WMA_GET_RX_CH(rx_pkt_info), session, 0); WMA_GET_RX_CH(rx_pkt_info), session, 0);
break; break;
#ifdef FEATURE_WLAN_TDLS #ifdef FEATURE_WLAN_TDLS
#ifndef CONVERGED_TDLS_ENABLE
case SIR_MAC_TDLS_DIS_RSP: case SIR_MAC_TDLS_DIS_RSP:
mac_hdr = NULL; mac_hdr = NULL;
frame_len = 0; frame_len = 0;
@@ -2210,6 +2211,7 @@ void lim_process_action_frame(tpAniSirGlobal mac_ctx,
session->smeSessionId, session->smeSessionId,
WMA_GET_RX_CH(rx_pkt_info), session, rssi); WMA_GET_RX_CH(rx_pkt_info), session, rssi);
break; break;
#endif
#endif #endif
case SIR_MAC_ACTION_EXT_CHANNEL_SWITCH_ID: case SIR_MAC_ACTION_EXT_CHANNEL_SWITCH_ID:
lim_process_ext_channel_switch_action_frame(mac_ctx, lim_process_ext_channel_switch_action_frame(mac_ctx,

View File

@@ -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, tSirResultCodes result_code, uint8_t sme_session_id,
uint16_t sme_transaction_id) uint16_t sme_transaction_id)
{ {
struct scheduler_msg msg; struct scheduler_msg msg = {0};
tSirSmeRsp *sme_rsp; tSirSmeRsp *sme_rsp;
lim_log(mac_ctx, LOG1, FL("Sending message %s with reasonCode %s"), 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 #endif
/** /**
* lim_process_sme_tdls_mgmt_send_req() - send out tdls management frames * lim_process_sme_tdls_mgmt_send_req() - send out tdls management frames
* *

View File

@@ -60,8 +60,9 @@
#include "nan_datapath.h" #include "nan_datapath.h"
#include "lim_assoc_utils.h" #include "lim_assoc_utils.h"
#ifdef CONVERGED_TDLS_ENABLE
#include "wlan_tdls_tgt_api.h" #include "wlan_tdls_tgt_api.h"
#endif
static void lim_handle_join_rsp_status(tpAniSirGlobal mac_ctx, static void lim_handle_join_rsp_status(tpAniSirGlobal mac_ctx,
tpPESession session_entry, tSirResultCodes result_code, tpPESession session_entry, tSirResultCodes result_code,