qcacld-3.0: TDLS: remove legacy event process

Clear up the tdls legacy tdls firmware events and
implicit tdls discovery request process.

Change-Id: I2e2380b1789cce7841ff0be4120184d1bce0b7e7
CRs-Fixed: 2105075
This commit is contained in:
Frank Liu 2017-09-07 13:13:54 +08:00 • committed by snandini
commit 1b8212057d
10 changed files with 1 additions and 873 deletions

5
Kbuild
View file

@ -706,11 +706,6 @@ SME_CSR_OBJS += $(SME_SRC_DIR)/csr/csr_roam_preauth.o \
$(SME_SRC_DIR)/csr/csr_host_scan_roam.o
endif
ifeq ($(CONFIG_QCOM_TDLS),y)
SME_CSR_OBJS += $(SME_SRC_DIR)/csr/csr_tdls_process.o
endif
SME_QOS_OBJS := $(SME_SRC_DIR)/qos/sme_qos.o
SME_CMN_OBJS := $(SME_SRC_DIR)/common/sme_api.o \

View file

@ -353,7 +353,6 @@ struct tdls_set_state_info {
* @peer_list: peer list
* @pAdapter: pointer to adapter
* @peerDiscoverTimer: peer discovery timer
* @peerDiscoveryTimeoutTimer: peer discovery timeout timer
* @threshold_config: threshold config
* @discovery_peer_cnt: discovery peer count
* @discovery_sent_cnt: discovery sent count
@ -366,7 +365,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 peerDiscoveryTimeoutTimer;
tdls_config_params_t threshold_config;
int32_t discovery_peer_cnt;
uint32_t discovery_sent_cnt;
@ -515,22 +513,10 @@ uint16_t wlan_hdd_tdls_connected_peers(struct hdd_adapter *pAdapter);
int wlan_hdd_tdls_get_all_peers(struct hdd_adapter *pAdapter, char *buf,
int buflen);
void wlan_hdd_tdls_increment_peer_count(struct hdd_adapter *pAdapter);
void wlan_hdd_tdls_decrement_peer_count(struct hdd_adapter *pAdapter);
hddTdlsPeer_t *wlan_hdd_tdls_is_progress(struct hdd_context *hdd_ctx,
const uint8_t *mac, uint8_t skip_self);
void wlan_hdd_tdls_timer_restart(struct hdd_adapter *pAdapter,
qdf_mc_timer_t *timer,
uint32_t expirationTime);
void wlan_hdd_tdls_indicate_teardown(struct hdd_adapter *pAdapter,
hddTdlsPeer_t *curr_peer,
uint16_t reason);
void wlan_hdd_tdls_implicit_send_discovery_request(tdlsCtx_t *hdd_tdls_ctx);
int wlan_hdd_tdls_set_extctrl_param(struct hdd_adapter *pAdapter,
const uint8_t *mac,
uint32_t chan,

View file

@ -3795,245 +3795,6 @@ QDF_STATUS hdd_roam_deregister_tdlssta(struct hdd_adapter *pAdapter, uint8_t sta
return qdf_status;
}
/**
* hdd_roam_tdls_status_update_handler() - TDLS status update handler
* @pAdapter: pointer to adapter
* @pRoamInfo: pointer to roam info
* @roamId: roam id
* @roamStatus: roam status
* @roamResult: roam result
*
* HDD interface between SME and TL to ensure TDLS client registration with
* TL in case of new TDLS client is added and deregistration at the time
* TDLS client is deleted.
*
* Return: QDF_STATUS enumeration
*/
static QDF_STATUS
hdd_roam_tdls_status_update_handler(struct hdd_adapter *pAdapter,
tCsrRoamInfo *pRoamInfo,
uint32_t roamId,
eRoamCmdStatus roamStatus,
eCsrRoamResult roamResult)
{
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
tdlsCtx_t *pHddTdlsCtx;
QDF_STATUS status = QDF_STATUS_E_FAILURE;
hddTdlsPeer_t *curr_peer;
uint32_t reason;
hdd_debug("hdd_tdlsStatusUpdate: %s staIdx %d " MAC_ADDRESS_STR,
roamResult ==
eCSR_ROAM_RESULT_ADD_TDLS_PEER ? "ADD_TDLS_PEER" : roamResult
==
eCSR_ROAM_RESULT_DELETE_TDLS_PEER ? "DEL_TDLS_PEER" :
roamResult ==
eCSR_ROAM_RESULT_TEARDOWN_TDLS_PEER_IND ? "DEL_TDLS_PEER_IND"
: roamResult ==
eCSR_ROAM_RESULT_DELETE_ALL_TDLS_PEER_IND ?
"DEL_ALL_TDLS_PEER_IND" : roamResult ==
eCSR_ROAM_RESULT_UPDATE_TDLS_PEER ? "UPDATE_TDLS_PEER" :
roamResult ==
eCSR_ROAM_RESULT_LINK_ESTABLISH_REQ_RSP ?
"LINK_ESTABLISH_REQ_RSP" : roamResult ==
eCSR_ROAM_RESULT_TDLS_SHOULD_DISCOVER ? "TDLS_SHOULD_DISCOVER"
: roamResult ==
eCSR_ROAM_RESULT_TDLS_SHOULD_TEARDOWN ? "TDLS_SHOULD_TEARDOWN"
: roamResult ==
eCSR_ROAM_RESULT_TDLS_SHOULD_PEER_DISCONNECTED ?
"TDLS_SHOULD_PEER_DISCONNECTED" : "UNKNOWN", pRoamInfo->staId,
MAC_ADDR_ARRAY(pRoamInfo->peerMac.bytes));
switch (roamResult) {
case eCSR_ROAM_RESULT_TDLS_SHOULD_DISCOVER:
{
/* ignore TDLS_SHOULD_DISCOVER if any concurrency detected */
if (!cds_check_is_tdls_allowed(pAdapter->device_mode)) {
hdd_err("TDLS not allowed, ignore SHOULD_DISCOVER");
status = QDF_STATUS_E_FAILURE;
break;
}
if (hdd_ctx->tdls_nss_switch_in_progress) {
hdd_debug("TDLS antenna switch is in progress, ignore SHOULD_DISCOVER");
status = QDF_STATUS_SUCCESS;
break;
}
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;
}
curr_peer =
wlan_hdd_tdls_get_peer(pAdapter,
pRoamInfo->peerMac.bytes);
if (!curr_peer) {
hdd_debug("curr_peer is null");
status = QDF_STATUS_E_FAILURE;
} else {
if (eTDLS_LINK_CONNECTED ==
curr_peer->link_status) {
hdd_debug("TDLS link status is connected, ignore SHOULD_DISCOVER");
} else {
/*
* If external control is enabled then initiate
* TDLS only if forced peer is set otherwise
* ignore should Discover trigger from fw.
*/
if (hdd_ctx->config->
fTDLSExternalControl
&& (false ==
curr_peer->isForcedPeer)) {
hdd_debug("TDLS ExternalControl enabled but curr_peer is not forced, ignore SHOULD_DISCOVER");
status = QDF_STATUS_SUCCESS;
break;
}
hdd_debug("initiate TDLS setup on SHOULD_DISCOVER, fTDLSExternalControl: %d, curr_peer->isForcedPeer: %d, reason: %d",
hdd_ctx->config->
fTDLSExternalControl,
curr_peer->isForcedPeer,
pRoamInfo->reasonCode);
pHddTdlsCtx->curr_candidate = curr_peer;
wlan_hdd_tdls_implicit_send_discovery_request(
pHddTdlsCtx);
}
status = QDF_STATUS_SUCCESS;
}
mutex_unlock(&hdd_ctx->tdls_lock);
break;
}
case eCSR_ROAM_RESULT_TDLS_SHOULD_TEARDOWN:
{
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;
}
curr_peer =
wlan_hdd_tdls_find_peer(pAdapter,
pRoamInfo->peerMac.bytes);
if (!curr_peer) {
hdd_debug("curr_peer is null");
status = QDF_STATUS_E_FAILURE;
} else {
if (eTDLS_LINK_CONNECTED ==
curr_peer->link_status) {
hdd_debug("Received SHOULD_TEARDOWN for peer "
MAC_ADDRESS_STR
" staId: %d, reason: %d",
MAC_ADDR_ARRAY(pRoamInfo->
peerMac.bytes),
pRoamInfo->staId,
pRoamInfo->reasonCode);
if (pRoamInfo->reasonCode ==
eWNI_TDLS_TEARDOWN_REASON_RSSI ||
pRoamInfo->reasonCode ==
eWNI_TDLS_DISCONNECTED_REASON_PEER_DELETE ||
pRoamInfo->reasonCode ==
eWNI_TDLS_TEARDOWN_REASON_PTR_TIMEOUT ||
pRoamInfo->reasonCode ==
eWNI_TDLS_TEARDOWN_REASON_NO_RESPONSE) {
reason =
eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE;
} else
reason =
eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON;
wlan_hdd_tdls_indicate_teardown
(pHddTdlsCtx->pAdapter, curr_peer,
reason);
hdd_send_wlan_tdls_teardown_event(
eTDLS_TEARDOWN_BSS_DISCONNECT,
curr_peer->peerMac);
} else {
hdd_debug("TDLS link is not connected, ignore SHOULD_TEARDOWN, reason: %d",
pRoamInfo->reasonCode);
}
status = QDF_STATUS_SUCCESS;
}
mutex_unlock(&hdd_ctx->tdls_lock);
break;
}
case eCSR_ROAM_RESULT_TDLS_SHOULD_PEER_DISCONNECTED:
{
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;
}
curr_peer =
wlan_hdd_tdls_find_peer(pAdapter,
pRoamInfo->peerMac.bytes);
if (!curr_peer) {
hdd_debug("curr_peer is null");
status = QDF_STATUS_E_FAILURE;
} else {
if (eTDLS_LINK_CONNECTED ==
curr_peer->link_status) {
hdd_debug("Received SHOULD_PEER_DISCONNECTED for peer "
MAC_ADDRESS_STR
" staId: %d reason: %d",
MAC_ADDR_ARRAY(pRoamInfo->peerMac.bytes),
pRoamInfo->staId,
pRoamInfo->reasonCode);
if (pRoamInfo->reasonCode ==
eWNI_TDLS_TEARDOWN_REASON_RSSI ||
pRoamInfo->reasonCode ==
eWNI_TDLS_DISCONNECTED_REASON_PEER_DELETE ||
pRoamInfo->reasonCode ==
eWNI_TDLS_TEARDOWN_REASON_PTR_TIMEOUT ||
pRoamInfo->reasonCode ==
eWNI_TDLS_TEARDOWN_REASON_NO_RESPONSE) {
reason =
eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE;
} else
reason =
eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON;
wlan_hdd_tdls_indicate_teardown
(pHddTdlsCtx->pAdapter, curr_peer,
reason);
hdd_send_wlan_tdls_teardown_event(
eTDLS_TEARDOWN_BSS_DISCONNECT,
curr_peer->peerMac);
} else {
hdd_debug("TDLS link is not connected, ignore SHOULD_PEER_DISCONNECTED, reason: %d",
pRoamInfo->reasonCode);
}
status = QDF_STATUS_SUCCESS;
}
mutex_unlock(&hdd_ctx->tdls_lock);
break;
}
default:
{
break;
}
}
return status;
}
#else
inline QDF_STATUS hdd_roam_deregister_tdlssta(struct hdd_adapter *pAdapter,
@ -4856,15 +4617,6 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId,
case eCSR_ROAM_REMAIN_CHAN_READY:
hdd_remain_chan_ready_handler(pAdapter, pRoamInfo->roc_scan_id);
break;
#ifdef FEATURE_WLAN_TDLS
case eCSR_ROAM_TDLS_STATUS_UPDATE:
qdf_ret_status =
hdd_roam_tdls_status_update_handler(pAdapter, pRoamInfo,
roamId,
roamStatus,
roamResult);
break;
#endif
#ifdef WLAN_FEATURE_11W
case eCSR_ROAM_UNPROT_MGMT_FRAME_IND:
hdd_indicate_unprot_mgmt_frame(pAdapter,

View file

@ -51,8 +51,6 @@
#include <qca_vendor.h>
#include "wlan_hdd_ipa.h"
static void wlan_hdd_tdls_timers_destroy(tdlsCtx_t *pHddTdlsCtx);
/**
* enum qca_wlan_vendor_tdls_trigger_mode_hdd_map: Maps the user space TDLS
* trigger mode in the host driver.
@ -204,134 +202,6 @@ static u8 wlan_hdd_tdls_hash_key(const u8 *mac)
return key;
}
/**
* wlan_hdd_tdls_discovery_sent_cnt() - get value of discovery counter sent
* @hdd_ctx: HDD context
*
* Return: the value of the transmitted TDLS discovery counter
*/
static uint32_t wlan_hdd_tdls_discovery_sent_cnt(struct hdd_context *hdd_ctx)
{
hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL;
struct hdd_adapter *pAdapter = NULL;
tdlsCtx_t *pHddTdlsCtx = NULL;
QDF_STATUS status = 0;
uint32_t count = 0;
status = hdd_get_front_adapter(hdd_ctx, &pAdapterNode);
while (NULL != pAdapterNode && QDF_STATUS_SUCCESS == status) {
pAdapter = pAdapterNode->pAdapter;
pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter);
if (NULL != pHddTdlsCtx)
count = count + pHddTdlsCtx->discovery_sent_cnt;
status = hdd_get_next_adapter(hdd_ctx, pAdapterNode, &pNext);
pAdapterNode = pNext;
}
return count;
}
/**
* wlan_hdd_tdls_check_power_save_prohibited() - set/clear proper TDLS power
* save probihited bit
* @pAdapter: HDD adapter handle
*
* Ensure TDLS power save probihited bit is set/cleared properly
*
* Return: None
*/
static void
wlan_hdd_tdls_check_power_save_prohibited(struct hdd_adapter *pAdapter)
{
tdlsCtx_t *pHddTdlsCtx;
struct hdd_context *hdd_ctx;
if ((NULL == pAdapter) ||
(WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) {
hdd_err("invalid pAdapter: %pK", pAdapter);
return;
}
pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter);
hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
if ((NULL == pHddTdlsCtx) || (NULL == hdd_ctx)) {
QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
FL("hdd_ctx or pHddTdlsCtx points to NULL"));
return;
}
if ((0 == hdd_ctx->connected_peer_count) &&
(0 == wlan_hdd_tdls_discovery_sent_cnt(hdd_ctx))) {
sme_set_tdls_power_save_prohibited(WLAN_HDD_GET_HAL_CTX
(pHddTdlsCtx->pAdapter),
pAdapter->sessionId, 0);
return;
}
sme_set_tdls_power_save_prohibited(WLAN_HDD_GET_HAL_CTX
(pHddTdlsCtx->pAdapter),
pAdapter->sessionId, 1);
}
/**
* wlan_hdd_tdls_discovery_timeout_peer_cb() - tdls discovery timeout callback
* @userData: tdls context
*
* Return: None
*/
static void wlan_hdd_tdls_discovery_timeout_peer_cb(void *userData)
{
int i;
struct list_head *head;
hddTdlsPeer_t *tmp;
struct list_head *pos, *q;
tdlsCtx_t *pHddTdlsCtx;
struct hdd_context *hdd_ctx;
ENTER();
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (0 != (wlan_hdd_validate_context(hdd_ctx)))
return;
mutex_lock(&hdd_ctx->tdls_lock);
pHddTdlsCtx = (tdlsCtx_t *) userData;
if ((NULL == pHddTdlsCtx) || (NULL == pHddTdlsCtx->pAdapter)) {
mutex_unlock(&hdd_ctx->tdls_lock);
QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
FL("pHddTdlsCtx or pAdapter points to NULL"));
return;
}
if (WLAN_HDD_ADAPTER_MAGIC != pHddTdlsCtx->pAdapter->magic) {
mutex_unlock(&hdd_ctx->tdls_lock);
hdd_err("pAdapter has invalid magic");
return;
}
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);
if (eTDLS_LINK_DISCOVERING == tmp->link_status) {
hdd_debug(MAC_ADDRESS_STR " to idle state",
MAC_ADDR_ARRAY(tmp->peerMac));
wlan_hdd_tdls_set_peer_link_status(tmp,
eTDLS_LINK_IDLE,
eTDLS_LINK_NOT_SUPPORTED);
}
}
}
pHddTdlsCtx->discovery_sent_cnt = 0;
wlan_hdd_tdls_check_power_save_prohibited(pHddTdlsCtx->pAdapter);
mutex_unlock(&hdd_ctx->tdls_lock);
EXIT();
}
/**
* wlan_hdd_tdls_free_list() - free TDLS peer list
* @pHddTdlsCtx: TDLS context
@ -390,29 +260,6 @@ static void dump_tdls_state_param_setting(tdlsInfo_t *info)
}
/**
* wlan_hdd_tdls_monitor_timers_stop() - stop all monitoring timers
* @hdd_tdls_ctx: TDLS context
*
* Return: none
*/
static void wlan_hdd_tdls_monitor_timers_stop(tdlsCtx_t *hdd_tdls_ctx)
{
qdf_mc_timer_stop(&hdd_tdls_ctx->peerDiscoveryTimeoutTimer);
}
/**
* wlan_hdd_tdls_timers_stop() - stop all the tdls timers running
* @hdd_tdls_ctx: TDLS context
*
* Return: none
*/
static void wlan_hdd_tdls_timers_stop(tdlsCtx_t *hdd_tdls_ctx)
{
wlan_hdd_tdls_monitor_timers_stop(hdd_tdls_ctx);
}
/**
* wlan_hdd_tdls_del_non_forced_peers() - delete non forced tdls peers
* @hdd_tdls_ctx: TDLS context
@ -578,19 +425,12 @@ int wlan_hdd_tdls_init(struct hdd_adapter *pAdapter)
return -ENOMEM;
}
qdf_mc_timer_init(&pHddTdlsCtx->peerDiscoveryTimeoutTimer,
QDF_TIMER_TYPE_SW,
wlan_hdd_tdls_discovery_timeout_peer_cb,
pHddTdlsCtx);
pAdapter->sessionCtx.station.pHddTdlsCtx = pHddTdlsCtx;
for (i = 0; i < TDLS_PEER_LIST_SIZE; i++)
INIT_LIST_HEAD(&pHddTdlsCtx->peer_list[i]);
} else {
pHddTdlsCtx = pAdapter->sessionCtx.station.pHddTdlsCtx;
wlan_hdd_tdls_timers_stop(pHddTdlsCtx);
wlan_hdd_tdls_del_non_forced_peers(pHddTdlsCtx);
hdd_tdls_context_init(hdd_ctx, true);
@ -679,7 +519,6 @@ void wlan_hdd_tdls_exit(struct hdd_adapter *pAdapter)
* must stop timer here before freeing peer list, because
* peerIdleTimer is part of peer list structure.
*/
wlan_hdd_tdls_timers_destroy(pHddTdlsCtx);
wlan_hdd_tdls_free_list(pHddTdlsCtx);
pHddTdlsCtx->magic = 0;
@ -694,29 +533,6 @@ done:
clear_bit(TDLS_INIT_DONE, &pAdapter->event_flags);
}
/**
* wlan_hdd_tdls_monitor_timers_destroy() - destroy all tdls monitoring timers
* @pHddTdlsCtx: TDLS context
*
* Return: Void
*/
static void wlan_hdd_tdls_monitor_timers_destroy(tdlsCtx_t *pHddTdlsCtx)
{
qdf_mc_timer_stop(&pHddTdlsCtx->peerDiscoveryTimeoutTimer);
qdf_mc_timer_destroy(&pHddTdlsCtx->peerDiscoveryTimeoutTimer);
}
/**
* wlan_hdd_tdls_timers_destroy() - Destroy all the tdls timers running
* @pHddTdlsCtx: TDLS Context
*
* Return: Void
*/
static void wlan_hdd_tdls_timers_destroy(tdlsCtx_t *pHddTdlsCtx)
{
wlan_hdd_tdls_monitor_timers_destroy(pHddTdlsCtx);
}
/**
* wlan_hdd_tdls_get_peer() - find or add an peer given mac address
* @pAdapter: HDD adapter
@ -919,18 +735,6 @@ static int wlan_hdd_tdls_check_config(tdls_config_params_t *config)
return 0;
}
/**
* wlan_hdd_tdls_implicit_disable() - disable implicit tdls triggering
* @pHddTdlsCtx: TDLS context
*
* Return: Void
*/
static void wlan_hdd_tdls_implicit_disable(tdlsCtx_t *pHddTdlsCtx)
{
hdd_debug("Disable Implicit TDLS");
wlan_hdd_tdls_timers_stop(pHddTdlsCtx);
}
/**
* wlan_hdd_tdls_set_mode() - set TDLS mode
* @hdd_ctx: HDD context
@ -1013,12 +817,10 @@ static void wlan_hdd_tdls_set_mode(struct hdd_context *hdd_ctx,
} else if (eTDLS_SUPPORT_DISABLED == tdls_mode) {
set_bit((unsigned long)source,
&hdd_ctx->tdls_source_bitmap);
wlan_hdd_tdls_implicit_disable(pHddTdlsCtx);
} 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);
/*
* Check if any TDLS source bit is set and if
@ -1425,182 +1227,6 @@ int wlan_hdd_tdls_get_all_peers(struct hdd_adapter *pAdapter,
return init_len - buflen;
}
/**
* wlan_hdd_tdls_increment_peer_count() - increment connected TDLS peer counter
* @pAdapter: HDD adapter
*
* Return: Void
*/
void wlan_hdd_tdls_increment_peer_count(struct hdd_adapter *pAdapter)
{
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
ENTER();
if (0 != (wlan_hdd_validate_context(hdd_ctx)))
return;
mutex_lock(&hdd_ctx->tdls_lock);
hdd_ctx->connected_peer_count++;
wlan_hdd_tdls_check_power_save_prohibited(pAdapter);
hdd_debug("Connected peer count %d",
hdd_ctx->connected_peer_count);
mutex_unlock(&hdd_ctx->tdls_lock);
EXIT();
}
/**
* wlan_hdd_tdls_decrement_peer_count() - decrement connected TDLS peer counter
* @pAdapter: HDD adapter
*
* Return: Void
*/
void wlan_hdd_tdls_decrement_peer_count(struct hdd_adapter *pAdapter)
{
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
uint16_t connected_peer_count;
ENTER();
if (0 != (wlan_hdd_validate_context(hdd_ctx)))
return;
mutex_lock(&hdd_ctx->tdls_lock);
if (hdd_ctx->connected_peer_count)
hdd_ctx->connected_peer_count--;
wlan_hdd_tdls_check_power_save_prohibited(pAdapter);
connected_peer_count = hdd_ctx->connected_peer_count;
mutex_unlock(&hdd_ctx->tdls_lock);
hdd_debug("Connected peer count %d", connected_peer_count);
EXIT();
}
/**
* wlan_hdd_tdls_find_progress_peer() - find peer if TDLS is ongoing
* @pAdapter: HDD adapter
* @mac: If NULL check for all the peer list, otherwise, skip this mac when
* skip_self is true
* @skip_self: If true, skip this mac. otherwise, check all the peer list. if
* mac is NULL, this argument is ignored, and check for all the peer
* list.
*
* Return: Pointer to hddTdlsPeer_t if TDLS is ongoing. Otherwise return NULL.
*/
static hddTdlsPeer_t *
wlan_hdd_tdls_find_progress_peer(struct hdd_adapter *pAdapter,
const u8 *mac,
u8 skip_self)
{
int i;
struct list_head *head;
hddTdlsPeer_t *curr_peer;
struct list_head *pos;
tdlsCtx_t *pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter);
if (NULL == pHddTdlsCtx) {
hdd_debug("pHddTdlsCtx is NULL");
return NULL;
}
for (i = 0; i < TDLS_PEER_LIST_SIZE; i++) {
head = &pHddTdlsCtx->peer_list[i];
list_for_each(pos, head) {
curr_peer = list_entry(pos, hddTdlsPeer_t, node);
if (skip_self && mac
&& !memcmp(mac, curr_peer->peerMac, 6)) {
continue;
} else {
if (eTDLS_LINK_CONNECTING ==
curr_peer->link_status) {
hdd_notice(MAC_ADDRESS_STR
" eTDLS_LINK_CONNECTING",
MAC_ADDR_ARRAY(curr_peer->peerMac));
return curr_peer;
}
}
}
}
return NULL;
}
/**
* wlan_hdd_tdls_is_progress() - find the peer with ongoing TDLS progress
* @hdd_ctx: HDD context
* @mac: mac address of the peer
* @skip_self: if 1, skip checking self. If 0, search includes self
*
* Return: TDLS peer if found; NULL otherwise
*/
hddTdlsPeer_t *wlan_hdd_tdls_is_progress(struct hdd_context *hdd_ctx,
const uint8_t *mac,
uint8_t skip_self)
{
hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL;
struct hdd_adapter *pAdapter = NULL;
tdlsCtx_t *pHddTdlsCtx = NULL;
hddTdlsPeer_t *curr_peer = NULL;
QDF_STATUS status = 0;
status = hdd_get_front_adapter(hdd_ctx, &pAdapterNode);
while (NULL != pAdapterNode && QDF_STATUS_SUCCESS == status) {
pAdapter = pAdapterNode->pAdapter;
pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter);
if (NULL != pHddTdlsCtx) {
curr_peer =
wlan_hdd_tdls_find_progress_peer(pAdapter, mac,
skip_self);
if (curr_peer)
return curr_peer;
}
status = hdd_get_next_adapter(hdd_ctx, pAdapterNode, &pNext);
pAdapterNode = pNext;
}
return NULL;
}
/**
* wlan_hdd_tdls_timer_restart() - restart TDLS timer
* @pAdapter: HDD adapter
* @timer: timer to restart
* @expirationTime: new expiration time to set for the timer
*
* Return: Void
*/
void wlan_hdd_tdls_timer_restart(struct hdd_adapter *pAdapter,
qdf_mc_timer_t *timer,
uint32_t expirationTime)
{
struct hdd_station_ctx *pHddStaCtx;
if (NULL == pAdapter || WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) {
hdd_err("invalid pAdapter: %pK", pAdapter);
return;
}
pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
/* Check whether driver load unload is in progress */
if (cds_is_load_or_unload_in_progress()) {
hdd_err("Driver load/unload is in progress.");
return;
}
if (hdd_conn_is_connected(pHddStaCtx)) {
qdf_mc_timer_stop(timer);
qdf_mc_timer_start(timer, expirationTime);
}
}
/**
* wlan_hdd_tdls_indicate_teardown() - indicate tdls teardown
* @pAdapter: HDD adapter
@ -3116,70 +2742,6 @@ ret_status:
return ret_value;
}
/**
* wlan_hdd_tdls_implicit_send_discovery_request() - send discovery request
* @hdd_tdls_ctx: tdls context
*
* Return: None
*/
void wlan_hdd_tdls_implicit_send_discovery_request(tdlsCtx_t *hdd_tdls_ctx)
{
struct hdd_context *hdd_ctx;
hddTdlsPeer_t *curr_peer, *temp_peer;
ENTER();
if (NULL == hdd_tdls_ctx) {
hdd_info("hdd_tdls_ctx is NULL");
return;
}
hdd_ctx = WLAN_HDD_GET_CTX(hdd_tdls_ctx->pAdapter);
if (0 != (wlan_hdd_validate_context(hdd_ctx)))
return;
curr_peer = hdd_tdls_ctx->curr_candidate;
if (NULL == curr_peer) {
hdd_err("curr_peer is NULL");
return;
}
/* This function is called in mutex_lock */
temp_peer = wlan_hdd_tdls_is_progress(hdd_ctx, NULL, 0);
if (NULL != temp_peer) {
hdd_info(MAC_ADDRESS_STR " ongoing. pre_setup ignored",
MAC_ADDR_ARRAY(temp_peer->peerMac));
goto done;
}
if (eTDLS_CAP_UNKNOWN != curr_peer->tdls_support)
wlan_hdd_tdls_set_peer_link_status(curr_peer,
eTDLS_LINK_DISCOVERING,
eTDLS_LINK_SUCCESS);
hdd_debug("Implicit TDLS, Send Discovery request event");
cfg80211_tdls_oper_request(hdd_tdls_ctx->pAdapter->dev,
curr_peer->peerMac,
NL80211_TDLS_DISCOVERY_REQ,
false,
GFP_KERNEL);
hdd_tdls_ctx->discovery_sent_cnt++;
wlan_hdd_tdls_timer_restart(hdd_tdls_ctx->pAdapter,
&hdd_tdls_ctx->peerDiscoveryTimeoutTimer,
hdd_tdls_ctx->threshold_config.tx_period_t -
TDLS_DISCOVERY_TIMEOUT_BEFORE_UPDATE);
hdd_debug("discovery count %u timeout %u msec",
hdd_tdls_ctx->discovery_sent_cnt,
hdd_tdls_ctx->threshold_config.tx_period_t -
TDLS_DISCOVERY_TIMEOUT_BEFORE_UPDATE);
done:
hdd_tdls_ctx->curr_candidate = NULL;
hdd_tdls_ctx->magic = 0;
EXIT();
}
/**
* hdd_set_tdls_scan_type - set scan during active tdls session
* @hdd_ctx: ptr to hdd context.

View file

@ -1684,16 +1684,6 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx,
case SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT:
lim_handle_update_olbc_cache(mac_ctx);
break;
#ifdef FEATURE_WLAN_TDLS
case SIR_HAL_TDLS_SHOULD_DISCOVER:
case SIR_HAL_TDLS_SHOULD_TEARDOWN:
case SIR_HAL_TDLS_PEER_DISCONNECTED:
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,
(void *)msg->bodyptr);
break;
#endif
case WMA_ADD_BSS_RSP:
lim_process_mlm_add_bss_rsp(mac_ctx, msg);
break;

View file

@ -1280,28 +1280,6 @@ lim_send_sme_mgmt_tx_completion(tpAniSirGlobal pMac,
return;
} /*** end lim_send_sme_tdls_delete_all_peer_ind() ***/
void lim_send_sme_tdls_event_notify(tpAniSirGlobal pMac, uint16_t msgType,
void *events)
{
struct scheduler_msg mmhMsg = {0};
switch (msgType) {
case SIR_HAL_TDLS_SHOULD_DISCOVER:
mmhMsg.type = eWNI_SME_TDLS_SHOULD_DISCOVER;
break;
case SIR_HAL_TDLS_SHOULD_TEARDOWN:
mmhMsg.type = eWNI_SME_TDLS_SHOULD_TEARDOWN;
break;
case SIR_HAL_TDLS_PEER_DISCONNECTED:
mmhMsg.type = eWNI_SME_TDLS_PEER_DISCONNECTED;
break;
}
mmhMsg.bodyptr = events;
mmhMsg.bodyval = 0;
lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT);
return;
}
#endif /* FEATURE_WLAN_TDLS */
/**

View file

@ -101,10 +101,7 @@ void lim_send_sme_ibss_peer_ind(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,
uint8_t sessionId);
void lim_send_sme_max_assoc_exceeded_ntf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,
uint8_t smesessionId);
#ifdef FEATURE_WLAN_TDLS
void lim_send_sme_tdls_event_notify(tpAniSirGlobal pMac, uint16_t msgType,
void *events);
#endif
void lim_send_sme_ap_channel_switch_resp(tpAniSirGlobal pMac,
tpPESession psessionEntry,
tpSwitchChannelParams pChnlParams);

View file

@ -244,10 +244,6 @@ QDF_STATUS csr_process_add_sta_session_rsp(tpAniSirGlobal pMac, uint8_t *pMsg);
QDF_STATUS csr_process_del_sta_session_rsp(tpAniSirGlobal pMac, uint8_t *pMsg);
bool csr_roamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
#ifdef FEATURE_WLAN_TDLS
QDF_STATUS tdls_msg_processor(tpAniSirGlobal pMac, uint16_t msg_type,
void *pMsgBuf);
#endif /* FEATURE_WLAN_TDLS */
QDF_STATUS csr_flush_cfg_bg_scan_roam_channel_list(tpAniSirGlobal pMac,
uint8_t sessionId);

View file

@ -2211,30 +2211,6 @@ QDF_STATUS sme_process_msg(tHalHandle hHal, struct scheduler_msg *pMsg)
sme_err("Empty message for: %d", pMsg->type);
}
break;
#ifdef FEATURE_WLAN_TDLS
/*
* command rescived from PE, SME tdls msg processor shall be called
* to process commands recieved from PE
*/
case eWNI_SME_TDLS_SEND_MGMT_RSP:
case eWNI_SME_TDLS_ADD_STA_RSP:
case eWNI_SME_TDLS_DEL_STA_RSP:
case eWNI_SME_TDLS_DEL_STA_IND:
case eWNI_SME_TDLS_DEL_ALL_PEER_IND:
case eWNI_SME_MGMT_FRM_TX_COMPLETION_IND:
case eWNI_SME_TDLS_LINK_ESTABLISH_RSP:
case eWNI_SME_TDLS_SHOULD_DISCOVER:
case eWNI_SME_TDLS_SHOULD_TEARDOWN:
case eWNI_SME_TDLS_PEER_DISCONNECTED:
if (pMsg->bodyptr) {
status = tdls_msg_processor(pMac, pMsg->type,
pMsg->bodyptr);
qdf_mem_free(pMsg->bodyptr);
} else {
sme_err("Empty message for: %d", pMsg->type);
}
break;
#endif
#ifdef WLAN_FEATURE_11W
case eWNI_SME_UNPROT_MGMT_FRM_IND:
if (pMsg->bodyptr) {

View file

@ -1,104 +0,0 @@
/*
* Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/*
* This file was originally distributed by Qualcomm Atheros, Inc.
* under proprietary terms before Copyright ownership was assigned
* to the Linux Foundation.
*/
/*
* DOC: csr_tdls_process.c
*
* Implementation for the TDLS interface to PE.
*/
#ifdef FEATURE_WLAN_TDLS
#include "ani_global.h" /* for tpAniSirGlobal */
#include "csr_inside_api.h"
#include "sme_inside.h"
#include "csr_support.h"
#include "host_diag_core_log.h"
#include "host_diag_core_event.h"
#include "csr_internal.h"
/*
* TDLS Message processor, will be called after TDLS message recieved from
* PE
*/
QDF_STATUS tdls_msg_processor(tpAniSirGlobal pMac, uint16_t msgType,
void *pMsgBuf)
{
tCsrRoamInfo *roamInfo;
tSirTdlsEventnotify *tevent = (tSirTdlsEventnotify *) pMsgBuf;
roamInfo = qdf_mem_malloc(sizeof(*roamInfo));
if (!roamInfo) {
sme_err("failed to allocate memory");
return QDF_STATUS_E_FAILURE;
}
switch (msgType) {
case eWNI_SME_TDLS_SHOULD_DISCOVER:
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_SHOULD_DISCOVER 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_SHOULD_DISCOVER);
break;
case eWNI_SME_TDLS_SHOULD_TEARDOWN:
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_SHOULD_TEARDOWN 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_SHOULD_TEARDOWN);
break;
case eWNI_SME_TDLS_PEER_DISCONNECTED:
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_PEER_DISCONNECTED 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_SHOULD_PEER_DISCONNECTED);
break;
default:
break;
}
qdf_mem_free(roamInfo);
return QDF_STATUS_SUCCESS;
}
#endif