qcacld-3.0: TDLS: remove legacy core functions
Clear up the tdls legacy functions which handle add/delete
tdls peer, tdls mgmt frame process and tdls_oper callback.
Change-Id: I8ba344ce5593df44bd15527e2ff68e872b6d23b8
CRs-Fixed: 2105075
diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h
index a8f13d7..2acb1e3 100644
--- a/core/hdd/inc/wlan_hdd_tdls.h
+++ b/core/hdd/inc/wlan_hdd_tdls.h
@@ -494,66 +494,27 @@
void wlan_hdd_tdls_extract_sa(struct sk_buff *skb, uint8_t *mac);
-int wlan_hdd_tdls_set_sta_id(struct hdd_adapter *pAdapter, const uint8_t *mac,
- uint8_t staId);
-
hddTdlsPeer_t *wlan_hdd_tdls_find_peer(struct hdd_adapter *pAdapter,
const uint8_t *mac);
hddTdlsPeer_t *wlan_hdd_tdls_find_all_peer(struct hdd_context *hdd_ctx,
const uint8_t *mac);
-int wlan_hdd_tdls_get_link_establish_params(struct hdd_adapter *pAdapter,
- const uint8_t *mac,
- tCsrTdlsLinkEstablishParams *
- tdlsLinkEstablishParams);
hddTdlsPeer_t *wlan_hdd_tdls_get_peer(struct hdd_adapter *pAdapter,
const uint8_t *mac);
-int wlan_hdd_tdls_set_cap(struct hdd_adapter *pAdapter, const uint8_t *mac,
- enum tdls_cap_type cap);
-
void wlan_hdd_tdls_set_peer_link_status(hddTdlsPeer_t *curr_peer,
enum tdls_link_status status,
enum tdls_link_reason reason);
-void wlan_hdd_tdls_set_link_status(struct hdd_adapter *pAdapter,
- const uint8_t *mac,
- enum tdls_link_status linkStatus,
- enum tdls_link_reason reason);
-
-int wlan_hdd_tdls_recv_discovery_resp(struct hdd_adapter *pAdapter,
- const uint8_t *mac);
-
-int wlan_hdd_tdls_set_peer_caps(struct hdd_adapter *pAdapter,
- const uint8_t *mac,
- tCsrStaParams *StaParams,
- bool isBufSta, bool isOffChannelSupported,
- bool is_qos_wmm_sta);
-
-int wlan_hdd_tdls_set_rssi(struct hdd_adapter *pAdapter, const uint8_t *mac,
- int8_t rxRssi);
-
-int wlan_hdd_tdls_set_responder(struct hdd_adapter *pAdapter,
- const uint8_t *mac,
- uint8_t responder);
-
-int wlan_hdd_tdls_set_signature(struct hdd_adapter *pAdapter,
- const uint8_t *mac,
- uint8_t uSignature);
int wlan_hdd_tdls_set_params(struct net_device *dev,
tdls_config_params_t *config);
-int wlan_hdd_tdls_reset_peer(struct hdd_adapter *pAdapter, const uint8_t *mac);
-
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_mgmt_completion_callback(struct hdd_adapter *pAdapter,
- uint32_t statusCode);
-
void wlan_hdd_tdls_increment_peer_count(struct hdd_adapter *pAdapter);
void wlan_hdd_tdls_decrement_peer_count(struct hdd_adapter *pAdapter);
@@ -601,10 +562,6 @@
int wlan_hdd_set_callback(hddTdlsPeer_t *curr_peer,
cfg80211_exttdls_callback callback);
-int wlan_hdd_tdls_add_station(struct wiphy *wiphy,
- struct net_device *dev, const uint8_t *mac,
- bool update, tCsrStaParams *StaParams);
-
int wlan_hdd_cfg80211_exttdls_enable(struct wiphy *wiphy,
struct wireless_dev *wdev,
const void *data,
diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c
index f520dfa..9b4e291 100644
--- a/core/hdd/src/wlan_hdd_assoc.c
+++ b/core/hdd/src/wlan_hdd_assoc.c
@@ -3818,9 +3818,7 @@
{
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
tdlsCtx_t *pHddTdlsCtx;
- tSmeTdlsPeerStateParams smeTdlsPeerStateParams;
QDF_STATUS status = QDF_STATUS_E_FAILURE;
- uint8_t staIdx;
hddTdlsPeer_t *curr_peer;
uint32_t reason;
@@ -3847,267 +3845,6 @@
MAC_ADDR_ARRAY(pRoamInfo->peerMac.bytes));
switch (roamResult) {
- case eCSR_ROAM_RESULT_ADD_TDLS_PEER:
- {
- if (eSIR_SME_SUCCESS != pRoamInfo->statusCode) {
- hdd_err("Add Sta failed. status code: %d",
- pRoamInfo->statusCode);
- pAdapter->tdlsAddStaStatus = QDF_STATUS_E_FAILURE;
- } else {
- /*
- * Check if there is available index for this new TDLS
- * STA.
- */
- for (staIdx = 0;
- staIdx < hdd_ctx->max_num_tdls_sta;
- staIdx++) {
- if (0 ==
- hdd_ctx->tdlsConnInfo[staIdx].
- staId) {
- hdd_ctx->tdlsConnInfo[staIdx].
- sessionId =
- pRoamInfo->sessionId;
- hdd_ctx->tdlsConnInfo[staIdx].
- staId = pRoamInfo->staId;
-
- hdd_debug("TDLS: STA IDX at %d is %d "
- "of mac "
- MAC_ADDRESS_STR,
- staIdx,
- hdd_ctx->
- tdlsConnInfo[staIdx].
- staId,
- MAC_ADDR_ARRAY
- (pRoamInfo->peerMac.bytes));
-
- qdf_copy_macaddr(&hdd_ctx->
- tdlsConnInfo
- [staIdx].
- peerMac,
- &pRoamInfo->
- peerMac);
- status = QDF_STATUS_SUCCESS;
- break;
- }
- }
- if (staIdx < hdd_ctx->max_num_tdls_sta) {
- if (-1 ==
- wlan_hdd_tdls_set_sta_id(pAdapter,
- pRoamInfo->
- peerMac.bytes,
- pRoamInfo->
- staId)) {
- hdd_err("wlan_hdd_tdls_set_sta_id() failed");
- return QDF_STATUS_E_FAILURE;
- }
-
- (WLAN_HDD_GET_CTX(pAdapter))->
- sta_to_adapter[pRoamInfo->staId] =
- pAdapter;
- /*
- * store the ucast signature,
- * if required for further reference.
- */
-
- wlan_hdd_tdls_set_signature(pAdapter,
- pRoamInfo->
- peerMac.bytes,
- pRoamInfo->
- ucastSig);
- } else {
- status = QDF_STATUS_E_FAILURE;
- hdd_debug("no available slot in conn_info. staId: %d cannot be stored",
- pRoamInfo->staId);
- }
- pAdapter->tdlsAddStaStatus = status;
- }
- complete(&pAdapter->tdls_add_station_comp);
- break;
- }
- case eCSR_ROAM_RESULT_UPDATE_TDLS_PEER:
- {
- if (eSIR_SME_SUCCESS != pRoamInfo->statusCode) {
- hdd_err("Add Sta failed. status code: %d",
- pRoamInfo->statusCode);
- pAdapter->tdlsAddStaStatus = QDF_STATUS_E_FAILURE;
- } else {
- pAdapter->tdlsAddStaStatus = QDF_STATUS_SUCCESS;
- }
- complete(&pAdapter->tdls_add_station_comp);
- break;
- }
- case eCSR_ROAM_RESULT_LINK_ESTABLISH_REQ_RSP:
- {
- if (eSIR_SME_SUCCESS != pRoamInfo->statusCode) {
- hdd_err("Link Establish Request failed. status: %d",
- pRoamInfo->statusCode);
- }
- complete(&pAdapter->tdls_link_establish_req_comp);
- break;
- }
- case eCSR_ROAM_RESULT_DELETE_TDLS_PEER:
- {
- for (staIdx = 0; staIdx < hdd_ctx->max_num_tdls_sta;
- staIdx++) {
- if ((hdd_ctx->tdlsConnInfo[staIdx].sessionId ==
- pRoamInfo->sessionId)
- && pRoamInfo->staId ==
- hdd_ctx->tdlsConnInfo[staIdx].staId) {
- hdd_debug("HDD: del STA IDX = %x",
- pRoamInfo->staId);
- mutex_lock(&hdd_ctx->tdls_lock);
- curr_peer =
- wlan_hdd_tdls_find_peer(pAdapter,
- pRoamInfo->
- peerMac.bytes);
- if (NULL != curr_peer) {
- hdd_debug("Current status for peer " MAC_ADDRESS_STR " is %d",
- MAC_ADDR_ARRAY(pRoamInfo->peerMac.bytes),
- curr_peer->link_status);
- if (TDLS_IS_CONNECTED(curr_peer)) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- hdd_roam_deregister_tdlssta
- (pAdapter,
- pRoamInfo->staId);
- wlan_hdd_tdls_decrement_peer_count
- (pAdapter);
- } else if (eTDLS_LINK_CONNECTING ==
- curr_peer->link_status) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- hdd_roam_deregister_tdlssta
- (pAdapter,
- pRoamInfo->staId);
- } else
- mutex_unlock(&hdd_ctx->tdls_lock);
- } else
- mutex_unlock(&hdd_ctx->tdls_lock);
-
- mutex_lock(&hdd_ctx->tdls_lock);
- wlan_hdd_tdls_reset_peer(pAdapter,
- pRoamInfo->
- peerMac.bytes);
- mutex_unlock(&hdd_ctx->tdls_lock);
-
- hdd_ctx->tdlsConnInfo[staIdx].staId = 0;
- hdd_ctx->tdlsConnInfo[staIdx].
- sessionId = 255;
- qdf_mem_zero(&hdd_ctx->
- tdlsConnInfo[staIdx].
- peerMac,
- QDF_MAC_ADDR_SIZE);
- status = QDF_STATUS_SUCCESS;
- break;
- }
- }
- complete(&pAdapter->tdls_del_station_comp);
- }
- break;
- case eCSR_ROAM_RESULT_TEARDOWN_TDLS_PEER_IND:
- {
- hdd_debug("Sending teardown to supplicant with reason code %u",
- pRoamInfo->reasonCode);
-
- mutex_lock(&hdd_ctx->tdls_lock);
- curr_peer =
- wlan_hdd_tdls_find_peer(pAdapter,
- pRoamInfo->peerMac.bytes);
-
- if (!curr_peer) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- hdd_debug("peer doesn't exists");
- status = QDF_STATUS_SUCCESS;
- break;
- }
-
- wlan_hdd_tdls_indicate_teardown(pAdapter, curr_peer,
- pRoamInfo->reasonCode);
- hdd_send_wlan_tdls_teardown_event(eTDLS_TEARDOWN_BSS_DISCONNECT,
- curr_peer->peerMac);
- mutex_unlock(&hdd_ctx->tdls_lock);
- status = QDF_STATUS_SUCCESS;
- break;
- }
- case eCSR_ROAM_RESULT_DELETE_ALL_TDLS_PEER_IND:
- {
- /* 0 staIdx is assigned to AP we dont want to touch that */
- for (staIdx = 0; staIdx < hdd_ctx->max_num_tdls_sta;
- staIdx++) {
- if ((hdd_ctx->tdlsConnInfo[staIdx].sessionId ==
- pRoamInfo->sessionId)
- && hdd_ctx->tdlsConnInfo[staIdx].staId) {
- hdd_debug("hdd_tdlsStatusUpdate: staIdx %d "
- MAC_ADDRESS_STR,
- hdd_ctx->tdlsConnInfo[staIdx].
- staId,
- MAC_ADDR_ARRAY(hdd_ctx->
- tdlsConnInfo
- [staIdx].
- peerMac.
- bytes));
- mutex_lock(&hdd_ctx->tdls_lock);
- wlan_hdd_tdls_reset_peer(pAdapter,
- hdd_ctx->
- tdlsConnInfo
- [staIdx].
- peerMac.bytes);
- mutex_unlock(&hdd_ctx->tdls_lock);
- hdd_roam_deregister_tdlssta(pAdapter,
- hdd_ctx->
- tdlsConnInfo
- [staIdx].
- staId);
- qdf_mem_zero(&smeTdlsPeerStateParams,
- sizeof
- (smeTdlsPeerStateParams));
- smeTdlsPeerStateParams.vdevId =
- hdd_ctx->tdlsConnInfo[staIdx].
- sessionId;
- qdf_mem_copy(&smeTdlsPeerStateParams.
- peerMacAddr,
- &hdd_ctx->
- tdlsConnInfo[staIdx].
- peerMac.bytes,
- QDF_MAC_ADDR_SIZE);
- smeTdlsPeerStateParams.peerState =
- eSME_TDLS_PEER_STATE_TEARDOWN;
-
- hdd_debug("calling sme_update_tdls_peer_state for staIdx %d "
- MAC_ADDRESS_STR,
- hdd_ctx->tdlsConnInfo[staIdx].
- staId,
- MAC_ADDR_ARRAY(hdd_ctx->
- tdlsConnInfo
- [staIdx].
- peerMac.
- bytes));
- status =
- sme_update_tdls_peer_state(
- hdd_ctx->hHal,
- &smeTdlsPeerStateParams);
- if (QDF_STATUS_SUCCESS != status) {
- hdd_err("sme_update_tdls_peer_state failed for "
- MAC_ADDRESS_STR,
- MAC_ADDR_ARRAY
- (hdd_ctx->
- tdlsConnInfo[staIdx].
- peerMac.bytes));
- }
- wlan_hdd_tdls_decrement_peer_count
- (pAdapter);
-
- qdf_mem_zero(&hdd_ctx->
- tdlsConnInfo[staIdx].
- peerMac,
- QDF_MAC_ADDR_SIZE);
- hdd_ctx->tdlsConnInfo[staIdx].staId = 0;
- hdd_ctx->tdlsConnInfo[staIdx].
- sessionId = 255;
-
- status = QDF_STATUS_SUCCESS;
- }
- }
- break;
- }
case eCSR_ROAM_RESULT_TDLS_SHOULD_DISCOVER:
{
/* ignore TDLS_SHOULD_DISCOVER if any concurrency detected */
@@ -5127,10 +4864,6 @@
roamStatus,
roamResult);
break;
- case eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND:
- wlan_hdd_tdls_mgmt_completion_callback(pAdapter,
- pRoamInfo->reasonCode);
- break;
#endif
#ifdef WLAN_FEATURE_11W
case eCSR_ROAM_UNPROT_MGMT_FRAME_IND:
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index c350301..113f466 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -12915,8 +12915,6 @@
}
/* This function registers for all frame which supplicant is interested in */
-#if defined(CONVERGED_P2P_ENABLE) || defined(CONVERGED_TDLS_ENABLE)
-
int wlan_hdd_cfg80211_register_frames(struct hdd_adapter *pAdapter)
{
tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
@@ -13024,67 +13022,6 @@
ret_status:
return qdf_status_to_os_return(status);
}
-#else
-int wlan_hdd_cfg80211_register_frames(struct hdd_adapter *pAdapter)
-{
- tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
- /* Register for all P2P action, public action etc frames */
- uint16_t type = (SIR_MAC_MGMT_FRAME << 2) | (SIR_MAC_MGMT_ACTION << 4);
-
- ENTER();
-
- /* Register frame indication call back */
- sme_register_mgmt_frame_ind_callback(hHal, hdd_indicate_mgmt_frame);
-
- /* Register for p2p ack indication */
- sme_register_p2p_ack_ind_callback(hHal, hdd_send_action_cnf_cb);
-
- /* Right now we are registering these frame when driver is getting
- * initialized. Once we will move to 2.6.37 kernel, in which we have
- * frame register ops, we will move this code as a part of that
- */
-
- /* GAS Initial Request */
- sme_register_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
- (uint8_t *) GAS_INITIAL_REQ,
- GAS_INITIAL_REQ_SIZE);
-
- /* GAS Initial Response */
- sme_register_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
- (uint8_t *) GAS_INITIAL_RSP,
- GAS_INITIAL_RSP_SIZE);
-
- /* GAS Comeback Request */
- sme_register_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
- (uint8_t *) GAS_COMEBACK_REQ,
- GAS_COMEBACK_REQ_SIZE);
-
- /* GAS Comeback Response */
- sme_register_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
- (uint8_t *) GAS_COMEBACK_RSP,
- GAS_COMEBACK_RSP_SIZE);
-
- /* P2P Public Action */
- sme_register_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
- (uint8_t *) P2P_PUBLIC_ACTION_FRAME,
- P2P_PUBLIC_ACTION_FRAME_SIZE);
-
- /* P2P Action */
- sme_register_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
- (uint8_t *) P2P_ACTION_FRAME,
- P2P_ACTION_FRAME_SIZE);
-
- /* WNM BSS Transition Request frame */
- sme_register_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
- (uint8_t *) WNM_BSS_ACTION_FRAME,
- WNM_BSS_ACTION_FRAME_SIZE);
-
- /* WNM-Notification */
- sme_register_mgmt_frame(hHal, pAdapter->sessionId, type,
- (uint8_t *) WNM_NOTIFICATION_FRAME,
- WNM_NOTIFICATION_FRAME_SIZE);
-}
-#endif
void wlan_hdd_cfg80211_deregister_frames(struct hdd_adapter *pAdapter)
{
@@ -13692,20 +13629,6 @@
}
#endif /* KERNEL_VERSION(4, 12, 0) */
-#if defined(FEATURE_WLAN_TDLS) && !defined(CONVERGED_TDLS_ENABLE)
-static bool wlan_hdd_is_duplicate_channel(uint8_t *arr,
- int index, uint8_t match)
-{
- int i;
-
- for (i = 0; i < index; i++) {
- if (arr[i] == match)
- return true;
- }
- return false;
-}
-#endif
-
/**
* __wlan_hdd_change_station() - change station
* @wiphy: Pointer to the wiphy structure
@@ -13732,12 +13655,6 @@
struct hdd_context *hdd_ctx;
struct hdd_station_ctx *pHddStaCtx;
struct qdf_mac_addr STAMacAddress;
-#if defined(FEATURE_WLAN_TDLS) && !defined(CONVERGED_TDLS_ENABLE)
- tCsrStaParams StaParams = { 0 };
- uint8_t isBufSta = 0;
- uint8_t isOffChannelSupported = 0;
- bool is_qos_wmm_sta = false;
-#endif
int ret;
ENTER();
@@ -13781,202 +13698,9 @@
} else if ((pAdapter->device_mode == QDF_STA_MODE) ||
(pAdapter->device_mode == QDF_P2P_CLIENT_MODE)) {
if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) {
-#if defined(FEATURE_WLAN_TDLS) && defined(CONVERGED_TDLS_ENABLE)
+#if defined(FEATURE_WLAN_TDLS)
ret = wlan_cfg80211_tdls_update_peer(hdd_ctx->hdd_pdev,
dev, mac, params);
-#else
-
- if (cds_is_sub_20_mhz_enabled()) {
- hdd_err("TDLS not allowed with sub 20 MHz");
- return -EINVAL;
- }
-
- StaParams.capability = params->capability;
- StaParams.uapsd_queues = params->uapsd_queues;
- StaParams.max_sp = params->max_sp;
-
- /* Convert (first channel , number of channels) tuple to
- * the total list of channels. This goes with the assumption
- * that if the first channel is < 14, then the next channels
- * are an incremental of 1 else an incremental of 4 till the number
- * of channels.
- */
- hdd_debug("params->supported_channels_len: %d", params->supported_channels_len);
- if (0 != params->supported_channels_len) {
- int i = 0, j = 0, k = 0, no_of_channels = 0;
- int num_unique_channels;
- int next;
-
- for (i = 0;
- i < params->supported_channels_len
- && j < SIR_MAC_MAX_SUPP_CHANNELS; i += 2) {
- int wifi_chan_index;
-
- if (!wlan_hdd_is_duplicate_channel
- (StaParams.supported_channels, j,
- params->supported_channels[i])) {
- StaParams.
- supported_channels[j] =
- params->
- supported_channels[i];
- } else {
- continue;
- }
- wifi_chan_index =
- ((StaParams.supported_channels[j] <=
- HDD_CHANNEL_14) ? 1 : 4);
- no_of_channels =
- params->supported_channels[i + 1];
-
- hdd_debug("i: %d, j: %d, k: %d, StaParams.supported_channels[%d]: %d, wifi_chan_index: %d, no_of_channels: %d", i, j, k, j,
- StaParams.
- supported_channels[j],
- wifi_chan_index,
- no_of_channels);
- for (k = 1; k <= no_of_channels &&
- j < SIR_MAC_MAX_SUPP_CHANNELS - 1;
- k++) {
- next =
- StaParams.
- supported_channels[j] +
- wifi_chan_index;
- if (!wlan_hdd_is_duplicate_channel(StaParams.supported_channels, j + 1, next)) {
- StaParams.
- supported_channels[j
- +
- 1]
- = next;
- } else {
- continue;
- }
- hdd_debug("i: %d, j: %d, k: %d, StaParams.supported_channels[%d]: %d", i, j, k,
- j + 1,
- StaParams.
- supported_channels[j +
- 1]);
- j += 1;
- }
- }
- num_unique_channels = j + 1;
- hdd_debug("Unique Channel List");
- for (i = 0; i < num_unique_channels; i++) {
- hdd_debug("StaParams.supported_channels[%d]: %d,", i,
- StaParams.
- supported_channels[i]);
- }
- if (MAX_CHANNEL < num_unique_channels)
- num_unique_channels = MAX_CHANNEL;
- StaParams.supported_channels_len =
- num_unique_channels;
- hdd_debug("After removing duplcates StaParams.supported_channels_len: %d",
- StaParams.supported_channels_len);
- }
- if (params->supported_oper_classes_len >
- CDS_MAX_SUPP_OPER_CLASSES) {
- hdd_debug("rcvd oper classes:%d, rst to max %d",
- params->supported_oper_classes_len,
- CDS_MAX_SUPP_OPER_CLASSES);
- params->supported_oper_classes_len =
- CDS_MAX_SUPP_OPER_CLASSES;
- }
- qdf_mem_copy(StaParams.supported_oper_classes,
- params->supported_oper_classes,
- params->supported_oper_classes_len);
- StaParams.supported_oper_classes_len =
- params->supported_oper_classes_len;
-
- if (params->ext_capab_len >
- sizeof(StaParams.extn_capability)) {
- hdd_debug("received extn capabilities:%d, resetting it to max supported",
- params->ext_capab_len);
- params->ext_capab_len =
- sizeof(StaParams.extn_capability);
- }
- if (0 != params->ext_capab_len)
- qdf_mem_copy(StaParams.extn_capability,
- params->ext_capab,
- params->ext_capab_len);
-
- if (NULL != params->ht_capa) {
- StaParams.htcap_present = 1;
- qdf_mem_copy(&StaParams.HTCap, params->ht_capa,
- sizeof(tSirHTCap));
- }
-
- StaParams.supported_rates_len =
- params->supported_rates_len;
-
- /* Note : The Maximum sizeof supported_rates sent by the Supplicant is 32.
- * The supported_rates array , for all the structures propogating till Add Sta
- * to the firmware has to be modified , if the supplicant (ieee80211) is
- * modified to send more rates.
- */
-
- /* To avoid Data Currption , set to max length to SIR_MAC_MAX_SUPP_RATES
- */
- if (StaParams.supported_rates_len >
- SIR_MAC_MAX_SUPP_RATES)
- StaParams.supported_rates_len =
- SIR_MAC_MAX_SUPP_RATES;
-
- if (0 != StaParams.supported_rates_len) {
- int i = 0;
-
- qdf_mem_copy(StaParams.supported_rates,
- params->supported_rates,
- StaParams.supported_rates_len);
- hdd_debug("Supported Rates with Length %d",
- StaParams.supported_rates_len);
- for (i = 0; i < StaParams.supported_rates_len;
- i++)
- hdd_debug("[%d]: %0x", i,
- StaParams.supported_rates[i]);
- }
-
- if (NULL != params->vht_capa) {
- StaParams.vhtcap_present = 1;
- qdf_mem_copy(&StaParams.VHTCap,
- params->vht_capa,
- sizeof(tSirVHTCap));
- }
-
- if (0 != params->ext_capab_len) {
- /*Define A Macro : TODO Sunil */
- if ((1 << 4) & StaParams.extn_capability[3])
- isBufSta = 1;
-
- /* TDLS Channel Switching Support */
- if ((1 << 6) & StaParams.extn_capability[3])
- isOffChannelSupported = 1;
- }
-
- if (hdd_ctx->config->fEnableTDLSWmmMode &&
- (params->ht_capa || params->vht_capa ||
- (params->sta_flags_set & BIT(NL80211_STA_FLAG_WME))))
- is_qos_wmm_sta = true;
-
- hdd_debug("%s: TDLS Peer is QOS capable"
- " is_qos_wmm_sta= %d HTcapPresent = %d",
- __func__, is_qos_wmm_sta,
- StaParams.htcap_present);
-
- status = wlan_hdd_tdls_set_peer_caps(pAdapter, mac,
- &StaParams,
- isBufSta,
- isOffChannelSupported,
- is_qos_wmm_sta);
- if (QDF_STATUS_SUCCESS != status) {
- hdd_err("wlan_hdd_tdls_set_peer_caps failed!");
- return -EINVAL;
- }
-
- status =
- wlan_hdd_tdls_add_station(wiphy, dev, mac, 1,
- &StaParams);
- if (QDF_STATUS_SUCCESS != status) {
- hdd_err("wlan_hdd_tdls_add_station failed!");
- return -EINVAL;
- }
#endif
}
}
@@ -17261,11 +16985,9 @@
{
struct hdd_adapter *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
int status;
- struct hdd_station_ctx *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
+ struct hdd_station_ctx *pHddStaCtx =
+ WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-#ifdef FEATURE_WLAN_TDLS
- uint8_t staIdx;
-#endif
ENTER();
@@ -17340,23 +17062,7 @@
wlan_hdd_cleanup_remain_on_channel_ctx(pAdapter);
#ifdef FEATURE_WLAN_TDLS
/* First clean up the tdls peers if any */
- for (staIdx = 0; staIdx < hdd_ctx->max_num_tdls_sta; staIdx++) {
- if ((hdd_ctx->tdlsConnInfo[staIdx].sessionId ==
- pAdapter->sessionId)
- && (hdd_ctx->tdlsConnInfo[staIdx].staId)) {
- uint8_t *mac;
- mac =
- hdd_ctx->tdlsConnInfo[staIdx].peerMac.bytes;
- hdd_debug("call sme_delete_tdls_peer_sta staId %d sessionId %d "
- MAC_ADDRESS_STR,
- hdd_ctx->tdlsConnInfo[staIdx].staId,
- pAdapter->sessionId,
- MAC_ADDR_ARRAY(mac));
- sme_delete_tdls_peer_sta(WLAN_HDD_GET_HAL_CTX
- (pAdapter),
- pAdapter->sessionId, mac);
- }
- }
+ /* TDLS-TODO */
hdd_notify_sta_disconnect(pAdapter->sessionId,
true, pAdapter->hdd_vdev);
#endif
@@ -18312,15 +18018,9 @@
MAC_ADDR_ARRAY(mac));
if (mask & BIT(NL80211_STA_FLAG_TDLS_PEER)) {
- if (set & BIT(NL80211_STA_FLAG_TDLS_PEER)) {
-#if defined(CONVERGED_TDLS_ENABLE)
+ if (set & BIT(NL80211_STA_FLAG_TDLS_PEER))
status = wlan_cfg80211_tdls_add_peer(hdd_ctx->hdd_pdev,
dev, mac);
-#else
- status =
- wlan_hdd_tdls_add_station(wiphy, dev, mac, 0, NULL);
-#endif
- }
}
#endif
EXIT();
diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h
index 9e5af48..7d5c11e 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.h
+++ b/core/hdd/src/wlan_hdd_cfg80211.h
@@ -36,9 +36,7 @@
#include <wlan_cfg80211_scan.h>
#include <wlan_cfg80211.h>
-#ifdef CONVERGED_TDLS_ENABLE
#include <wlan_cfg80211_tdls.h>
-#endif
struct hdd_context;
@@ -494,62 +492,6 @@
*/
int wlan_hdd_try_disconnect(struct hdd_adapter *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
-
/**
* hdd_update_cca_info_cb() - stores congestion value in station context
* @context : HDD context
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 5644941..01ae314 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -12022,7 +12022,6 @@
return 0;
}
-#ifdef CONVERGED_TDLS_ENABLE
static int hdd_update_tdls_config(struct hdd_context *hdd_ctx)
{
struct wlan_objmgr_psoc *psoc = hdd_ctx->hdd_psoc;
@@ -12089,15 +12088,6 @@
return 0;
}
-#else
-static int hdd_update_tdls_config(struct hdd_context *hdd_ctx)
-{
- hdd_ctx->tdls_umac_comp_active = false;
- /* disable napier specific tdls data path */
- hdd_ctx->tdls_nap_active = false;
- return 0;
-}
-#endif
int hdd_update_components_config(struct hdd_context *hdd_ctx)
{
diff --git a/core/hdd/src/wlan_hdd_object_manager.c b/core/hdd/src/wlan_hdd_object_manager.c
index 9e976b6..4b690a9 100644
--- a/core/hdd/src/wlan_hdd_object_manager.c
+++ b/core/hdd/src/wlan_hdd_object_manager.c
@@ -56,9 +56,7 @@
{
/* Initialize the vdev OS private structure*/
os_priv->wdev = adapter->dev->ieee80211_ptr;
-#ifdef CONVERGED_TDLS_ENABLE
wlan_cfg80211_tdls_priv_init(os_priv);
-#endif
}
static void hdd_init_psoc_qdf_ctx(struct wlan_objmgr_psoc *psoc)
@@ -222,9 +220,8 @@
osif_priv = wlan_vdev_get_ospriv(vdev);
wlan_vdev_reset_ospriv(vdev);
-#ifdef CONVERGED_TDLS_ENABLE
wlan_cfg80211_tdls_priv_deinit(osif_priv);
-#endif
+
qdf_mem_free(osif_priv);
if (hdd_objmgr_remove_peer_object(vdev,
diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c
index aeb64d0..40a59c9 100644
--- a/core/hdd/src/wlan_hdd_p2p.c
+++ b/core/hdd/src/wlan_hdd_p2p.c
@@ -2775,26 +2775,6 @@
hdd_send_action_cnf(pAdapter, true);
}
}
-#ifdef FEATURE_WLAN_TDLS
- else if (pbFrames
- [WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET + 1] ==
- WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP) {
- u8 *mac = &pbFrames
- [WLAN_HDD_80211_PEER_ADDR_OFFSET];
-
- hdd_debug("[TDLS] TDLS Discovery Response,"
- MAC_ADDRESS_STR " RSSI[%d] <--- OTA",
- MAC_ADDR_ARRAY(mac), rxRssi);
-
- wlan_hdd_tdls_set_rssi(pAdapter, mac, rxRssi);
- wlan_hdd_tdls_recv_discovery_resp(pAdapter,
- mac);
- cds_tdls_tx_rx_mgmt_event(SIR_MAC_ACTION_TDLS,
- SIR_MAC_ACTION_RX, SIR_MAC_MGMT_ACTION,
- WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP,
- &pbFrames[WLAN_HDD_80211_PEER_ADDR_OFFSET]);
- }
-#endif
}
if (pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] ==
diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c
index cd5b85c..f77eb20 100644
--- a/core/hdd/src/wlan_hdd_tdls.c
+++ b/core/hdd/src/wlan_hdd_tdls.c
@@ -776,42 +776,6 @@
}
/**
- * wlan_hdd_tdls_set_cap() - set TDLS capability type
- * @pAdapter: HDD adapter
- * @mac: peer mac address
- * @cap: TDLS capability type
- *
- * Return: 0 if successful or negative errno otherwise
- */
-int wlan_hdd_tdls_set_cap(struct hdd_adapter *pAdapter, const uint8_t *mac,
- enum tdls_cap_type cap)
-{
- hddTdlsPeer_t *curr_peer;
- struct hdd_context *hdd_ctx;
- int status = 0;
-
- hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
- if (0 != (wlan_hdd_validate_context(hdd_ctx))) {
- status = -EINVAL;
- goto ret_status;
- }
-
- mutex_lock(&hdd_ctx->tdls_lock);
- curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac);
- if (curr_peer == NULL) {
- hdd_err("curr_peer is NULL");
- status = -EINVAL;
- goto rel_lock;
- }
-
- curr_peer->tdls_support = cap;
-rel_lock:
- mutex_unlock(&hdd_ctx->tdls_lock);
-ret_status:
- return status;
-}
-
-/**
* wlan_hdd_tdls_set_peer_link_status() - set TDLS peer link status
* @curr_peer: peer
* @status: status
@@ -871,381 +835,6 @@
}
/**
- * wlan_hdd_tdls_set_link_status() - set TDLS peer link status
- * @pAdapter: HDD adapter
- * @mac: mac address of TDLS peer
- * @linkStatus: status
- * @reason: reason
- *
- * Return: Void
- */
-void wlan_hdd_tdls_set_link_status(struct hdd_adapter *pAdapter,
- const uint8_t *mac,
- enum tdls_link_status linkStatus,
- enum tdls_link_reason reason)
-{
- uint32_t state = 0;
- int32_t res = 0;
- hddTdlsPeer_t *curr_peer;
- struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-
- if (wlan_hdd_validate_context(hdd_ctx))
- return;
-
- curr_peer = wlan_hdd_tdls_find_peer(pAdapter, mac);
- if (curr_peer == NULL) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- FL("curr_peer is NULL"));
- return;
- }
-
- curr_peer->link_status = linkStatus;
-
- /* If TDLS link status is already passed the discovery state
- * then clear discovery attempt count
- */
- if (linkStatus >= eTDLS_LINK_DISCOVERED)
- curr_peer->discovery_attempt = 0;
-
- if (curr_peer->isForcedPeer && curr_peer->state_change_notification) {
- uint32_t opclass;
- uint32_t channel;
- struct hdd_adapter *adapter = curr_peer->pHddTdlsCtx->pAdapter;
-
- curr_peer->reason = reason;
-
- wlan_hdd_tdls_determine_channel_opclass(hdd_ctx, adapter,
- curr_peer, &channel, &opclass);
-
- wlan_hdd_tdls_get_wifi_hal_state(curr_peer, &state, &res);
- (curr_peer->state_change_notification)(mac, opclass, channel,
- state, res, adapter);
- }
-}
-
-/**
- * wlan_hdd_tdls_recv_discovery_resp() - handling of tdls discovery response
- * @pAdapter: HDD adapter
- * @mac: mac address of peer from which the response was received
- *
- * Return: 0 for success or negative errno otherwise
- */
-int wlan_hdd_tdls_recv_discovery_resp(struct hdd_adapter *pAdapter,
- const uint8_t *mac)
-{
- hddTdlsPeer_t *curr_peer;
- tdlsCtx_t *pHddTdlsCtx;
- struct hdd_context *hdd_ctx;
- int status = 0;
-
- ENTER();
-
- hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-
- if (0 != (wlan_hdd_validate_context(hdd_ctx))) {
- status = -EINVAL;
- goto ret_status;
- }
-
- mutex_lock(&hdd_ctx->tdls_lock);
-
- pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter);
- if (NULL == pHddTdlsCtx) {
- hdd_err("pHddTdlsCtx is NULL");
- status = -EINVAL;
- goto rel_lock;
- }
-
- curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac);
- if (NULL == curr_peer) {
- hdd_err("curr_peer is NULL");
- status = -EINVAL;
- goto rel_lock;
- }
-
- if (pHddTdlsCtx->discovery_sent_cnt)
- pHddTdlsCtx->discovery_sent_cnt--;
-
- wlan_hdd_tdls_check_power_save_prohibited(pAdapter);
-
- if (0 == pHddTdlsCtx->discovery_sent_cnt)
- qdf_mc_timer_stop(&pHddTdlsCtx->peerDiscoveryTimeoutTimer);
-
- hdd_debug("Discovery(%u) Response from " MAC_ADDRESS_STR
- " link_status %d", pHddTdlsCtx->discovery_sent_cnt,
- MAC_ADDR_ARRAY(curr_peer->peerMac), curr_peer->link_status);
-
- if (eTDLS_LINK_DISCOVERING == curr_peer->link_status) {
- /* Since we are here, it means Throughput threshold is
- * already met. Make sure RSSI threshold is also met
- * before setting up TDLS link.
- */
- if ((int32_t) curr_peer->rssi >
- (int32_t) pHddTdlsCtx->threshold_config.
- rssi_trigger_threshold) {
- wlan_hdd_tdls_set_peer_link_status(curr_peer,
- eTDLS_LINK_DISCOVERED,
- eTDLS_LINK_SUCCESS);
- hdd_debug("Rssi Threshold met: " MAC_ADDRESS_STR
- " rssi = %d threshold= %d",
- MAC_ADDR_ARRAY(curr_peer->peerMac),
- curr_peer->rssi,
- pHddTdlsCtx->threshold_config.rssi_trigger_threshold);
-
- cfg80211_tdls_oper_request(pAdapter->dev,
- curr_peer->peerMac,
- NL80211_TDLS_SETUP, false,
- GFP_KERNEL);
- } else {
- hdd_debug("Rssi Threshold not met: " MAC_ADDRESS_STR
- " rssi = %d threshold = %d ",
- MAC_ADDR_ARRAY(curr_peer->peerMac),
- curr_peer->rssi,
- pHddTdlsCtx->threshold_config.rssi_trigger_threshold);
-
- wlan_hdd_tdls_set_peer_link_status(curr_peer,
- eTDLS_LINK_IDLE,
- eTDLS_LINK_UNSPECIFIED);
-
- /* if RSSI threshold is not met then allow
- * further discovery attempts by decrementing
- * count for the last attempt
- */
- if (curr_peer->discovery_attempt)
- curr_peer->discovery_attempt--;
- }
- }
-
- curr_peer->tdls_support = eTDLS_CAP_SUPPORTED;
-rel_lock:
- mutex_unlock(&hdd_ctx->tdls_lock);
-ret_status:
- EXIT();
- return status;
-}
-
-/**
- * wlan_hdd_tdls_set_peer_caps() - set TDLS peer capability
- * @pAdapter: HDD adapter
- * @mac: MAC address of the TDLS peer
- * @StaParams: CSR Station Parameter
- * @isBufSta: is peer buffer station
- * @isOffChannelSupported: Is off channel supported
- * @is_qos_wmm_sta: Is QoS-WMM supported
- *
- * Return: 0 for success or negative errno otherwise
- */
-int wlan_hdd_tdls_set_peer_caps(struct hdd_adapter *pAdapter,
- const uint8_t *mac,
- tCsrStaParams *StaParams,
- bool isBufSta, bool isOffChannelSupported,
- bool is_qos_wmm_sta)
-{
- hddTdlsPeer_t *curr_peer;
- struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
- int status = 0;
-
- if (0 != (wlan_hdd_validate_context(hdd_ctx))) {
- status = -EINVAL;
- goto ret_status;
- }
-
- mutex_lock(&hdd_ctx->tdls_lock);
- curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac);
- if (curr_peer == NULL) {
- hdd_err("curr_peer is NULL");
- status = -EINVAL;
- goto rel_lock;
- }
-
- curr_peer->uapsdQueues = StaParams->uapsd_queues;
- curr_peer->maxSp = StaParams->max_sp;
- curr_peer->isBufSta = isBufSta;
- curr_peer->isOffChannelSupported = isOffChannelSupported;
-
- qdf_mem_copy(curr_peer->supported_channels,
- StaParams->supported_channels,
- StaParams->supported_channels_len);
-
- curr_peer->supported_channels_len = StaParams->supported_channels_len;
-
- qdf_mem_copy(curr_peer->supported_oper_classes,
- StaParams->supported_oper_classes,
- StaParams->supported_oper_classes_len);
-
- curr_peer->supported_oper_classes_len =
- StaParams->supported_oper_classes_len;
- curr_peer->qos = is_qos_wmm_sta;
-rel_lock:
- mutex_unlock(&hdd_ctx->tdls_lock);
-ret_status:
- return status;
-}
-
-/**
- * wlan_hdd_tdls_get_link_establish_params() - get TDLS link establish
- * parameter
- * @pAdapter: HDD adapter
- * @mac: mac address
- * @tdlsLinkEstablishParams: output parameter to store the result
- *
- * Return: 0 for success or negative errno otherwise
- */
-int wlan_hdd_tdls_get_link_establish_params(struct hdd_adapter *pAdapter,
- const u8 *mac,
- tCsrTdlsLinkEstablishParams *
- tdlsLinkEstablishParams)
-{
- hddTdlsPeer_t *curr_peer;
- struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
- int status = 0;
-
- if (0 != (wlan_hdd_validate_context(hdd_ctx))) {
- status = -EINVAL;
- goto ret_status;
- }
-
- mutex_lock(&hdd_ctx->tdls_lock);
- curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac);
- if (curr_peer == NULL) {
- hdd_err("curr_peer is NULL");
- status = -EINVAL;
- goto rel_lock;
- }
-
- tdlsLinkEstablishParams->isResponder = curr_peer->is_responder;
- tdlsLinkEstablishParams->uapsdQueues = curr_peer->uapsdQueues;
- tdlsLinkEstablishParams->maxSp = curr_peer->maxSp;
- tdlsLinkEstablishParams->isBufSta = curr_peer->isBufSta;
- tdlsLinkEstablishParams->isOffChannelSupported =
- curr_peer->isOffChannelSupported;
-
- qdf_mem_copy(tdlsLinkEstablishParams->supportedChannels,
- curr_peer->supported_channels,
- curr_peer->supported_channels_len);
-
- tdlsLinkEstablishParams->supportedChannelsLen =
- curr_peer->supported_channels_len;
-
- qdf_mem_copy(tdlsLinkEstablishParams->supportedOperClasses,
- curr_peer->supported_oper_classes,
- curr_peer->supported_oper_classes_len);
-
- tdlsLinkEstablishParams->supportedOperClassesLen =
- curr_peer->supported_oper_classes_len;
- tdlsLinkEstablishParams->qos = curr_peer->qos;
-rel_lock:
- mutex_unlock(&hdd_ctx->tdls_lock);
-ret_status:
- return status;
-}
-
-/**
- * wlan_hdd_tdls_set_rssi() - Set TDLS RSSI on peer given by mac
- * @pAdapter: HDD adapter
- * @mac: MAC address of Peer
- * @rxRssi: rssi value
- *
- * Set RSSI on TDSL peer
- *
- * Return: 0 for success or -EINVAL otherwise
- */
-int wlan_hdd_tdls_set_rssi(struct hdd_adapter *pAdapter, const uint8_t *mac,
- int8_t rxRssi)
-{
- hddTdlsPeer_t *curr_peer;
- struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-
- if (0 != (wlan_hdd_validate_context(hdd_ctx)))
- return -EINVAL;
-
- mutex_lock(&hdd_ctx->tdls_lock);
- curr_peer = wlan_hdd_tdls_find_peer(pAdapter, mac);
- if (curr_peer == NULL) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- hdd_err("curr_peer is NULL");
- return -EINVAL;
- }
-
- curr_peer->rssi = rxRssi;
- mutex_unlock(&hdd_ctx->tdls_lock);
-
- return 0;
-}
-
-/**
- * wlan_hdd_tdls_set_responder() - Set/clear TDLS peer's responder role
- * @pAdapter: HDD adapter
- * @mac: MAC address of Peer
- * @responder: flag that indicates if the TDLS peer should be responder or not
- *
- * Return: 0 for success or -EINVAL otherwise
- */
-int wlan_hdd_tdls_set_responder(struct hdd_adapter *pAdapter,
- const uint8_t *mac,
- uint8_t responder)
-{
- hddTdlsPeer_t *curr_peer;
- struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
- int status = 0;
-
- if (0 != (wlan_hdd_validate_context(hdd_ctx))) {
- status = -EINVAL;
- goto ret_status;
- }
- mutex_lock(&hdd_ctx->tdls_lock);
- curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac);
- if (curr_peer == NULL) {
- hdd_err("curr_peer is NULL");
- status = -EINVAL;
- goto rel_lock;
- }
-
- curr_peer->is_responder = responder;
-
-rel_lock:
- mutex_unlock(&hdd_ctx->tdls_lock);
-ret_status:
- return status;
-}
-
-/**
- * wlan_hdd_tdls_set_signature() - Set TDLS peer's signature
- * @pAdapter: HDD adapter
- * @mac: MAC address of TDLS Peer
- * @uSignature: signature value
- *
- * Return: 0 for success or -EINVAL otherwise
- */
-int wlan_hdd_tdls_set_signature(struct hdd_adapter *pAdapter,
- const uint8_t *mac,
- uint8_t uSignature)
-{
- hddTdlsPeer_t *curr_peer;
- struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
- int status = 0;
-
- if (0 != (wlan_hdd_validate_context(hdd_ctx))) {
- status = -EINVAL;
- goto ret_status;
- }
-
- mutex_lock(&hdd_ctx->tdls_lock);
- curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac);
- if (curr_peer == NULL) {
- hdd_err("curr_peer is NULL");
- status = -EINVAL;
- goto rel_lock;
- }
-
- curr_peer->signature = uSignature;
-rel_lock:
- mutex_unlock(&hdd_ctx->tdls_lock);
-ret_status:
- return status;
-}
-
-/**
* wlan_hdd_tdls_extract_sa() - Extract source address from socket buffer
* @skb: socket buffer
* @mac: output mac address buffer to store the source address
@@ -1560,41 +1149,6 @@
}
/**
- * wlan_hdd_tdls_set_sta_id() - set station ID on a tdls peer
- * @pAdapter: HDD adapter
- * @mac: MAC address of a tdls peer
- * @staId: station ID
- *
- * Return: 0 if success; negative errno otherwise
- */
-int wlan_hdd_tdls_set_sta_id(struct hdd_adapter *pAdapter, const uint8_t *mac,
- uint8_t staId)
-{
- hddTdlsPeer_t *curr_peer;
- struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
- int status = 0;
-
- if (0 != (wlan_hdd_validate_context(hdd_ctx))) {
- status = -EINVAL;
- goto ret_status;
- }
-
- mutex_lock(&hdd_ctx->tdls_lock);
- curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac);
- if (curr_peer == NULL) {
- hdd_err("curr_peer is NULL");
- status = -EINVAL;
- goto rel_lock;
- }
-
- curr_peer->staId = staId;
-rel_lock:
- mutex_unlock(&hdd_ctx->tdls_lock);
-ret_status:
- return status;
-}
-
-/**
* wlan_hdd_tdls_set_extctrl_param() - set external control parameter on a peer
* @pAdapter: HDD adapter
* @mac: MAC address of the peer
@@ -1768,57 +1322,6 @@
}
/**
- * wlan_hdd_tdls_reset_peer() - reset TDLS peer identified by MAC address
- * @pAdapter: HDD adapter
- * @mac: MAC address of the peer
- *
- * Return: 0 for success; negative errno otherwise
- */
-int wlan_hdd_tdls_reset_peer(struct hdd_adapter *pAdapter, const uint8_t *mac)
-{
- struct hdd_context *hdd_ctx;
- hddTdlsPeer_t *curr_peer;
- int status = 0;
-
- hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-
- if (0 != (wlan_hdd_validate_context(hdd_ctx))) {
- status = -EINVAL;
- goto ret_status;
- }
-
- curr_peer = wlan_hdd_tdls_get_peer(pAdapter, mac);
- if (curr_peer == NULL) {
- hdd_err("curr_peer is NULL");
- status = -EINVAL;
- goto ret_status;
- }
-
- /*
- * Reset preferred offchannel and opclass for offchannel as
- * per INI configuration only if peer is not forced one. For
- * forced peer, offchannel and opclass is set in HAL API at the
- * time of enabling TDLS for that specific peer and so do not overwrite
- * those set by user space.
- */
- if (false == curr_peer->isForcedPeer) {
- curr_peer->pref_off_chan_num =
- hdd_ctx->config->fTDLSPrefOffChanNum;
- curr_peer->op_class_for_pref_off_chan =
- wlan_hdd_find_opclass(WLAN_HDD_GET_HAL_CTX(pAdapter),
- curr_peer->pref_off_chan_num,
- hdd_ctx->config->fTDLSPrefOffChanBandwidth);
- }
-
- wlan_hdd_tdls_set_peer_link_status(curr_peer,
- eTDLS_LINK_IDLE,
- eTDLS_LINK_UNSPECIFIED);
- curr_peer->staId = OL_TXRX_INVALID_TDLS_PEER_ID;
-ret_status:
- return status;
-}
-
-/**
* wlan_hdd_tdls_connected_peers() - Find the number of connected TDLS peers
* @pAdapter: HDD adapter
*
@@ -1923,22 +1426,6 @@
}
/**
- * wlan_hdd_tdls_mgmt_completion_callback() - callback for TDLS management
- * TX completion
- * @pAdapter: HDD adapter
- * @statusCode: management TX completion status
- *
- * Return: Void
- */
-void wlan_hdd_tdls_mgmt_completion_callback(struct hdd_adapter *pAdapter,
- uint32_t statusCode)
-{
- pAdapter->mgmtTxCompletionStatus = statusCode;
- hdd_debug("Mgmt TX Completion %d", statusCode);
- complete(&pAdapter->tdls_mgmt_comp);
-}
-
-/**
* wlan_hdd_tdls_increment_peer_count() - increment connected TDLS peer counter
* @pAdapter: HDD adapter
*
@@ -2831,8 +2318,8 @@
if (hdd_ctx->config->fTDLSExternalControl == false)
return -ENOTSUPP;
- if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_MAX, data,
- data_len, wlan_hdd_tdls_config_disable_policy)) {
+ if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_MAX,
+ data, data_len, wlan_hdd_tdls_config_disable_policy)) {
hdd_err("Invalid ATTR");
return -EINVAL;
}
@@ -2871,214 +2358,6 @@
return ret;
}
-/**
- * wlan_hdd_tdls_add_station() - add or change a TDLS peer station
- * @wiphy: wiphy
- * @dev: net device
- * @mac: MAC address of the TDLS peer
- * @update: if non-0, modify the peer with StaParams; if 0, add new peer
- * @StaParams: station parameters for the TDLS to change
- *
- * Return: 0 if success; negative errno otherwise
- */
-int wlan_hdd_tdls_add_station(struct wiphy *wiphy,
- struct net_device *dev, const uint8_t *mac,
- bool update, tCsrStaParams *StaParams)
-{
- struct hdd_adapter *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
- struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
- QDF_STATUS status;
- hddTdlsPeer_t *pTdlsPeer;
- enum tdls_link_status link_status;
- uint16_t numCurrTdlsPeers;
- unsigned long rc;
- int ret;
- int rate_idx;
-
- ENTER();
-
- ret = wlan_hdd_validate_context(hdd_ctx);
- if (ret)
- return ret;
-
- if ((eTDLS_SUPPORT_NOT_ENABLED == hdd_ctx->tdls_mode) ||
- (eTDLS_SUPPORT_DISABLED == hdd_ctx->tdls_mode)) {
- hdd_debug("TDLS disabled" MAC_ADDRESS_STR "Request declined.",
- MAC_ADDR_ARRAY(mac));
- return -ENOTSUPP;
- }
-
- mutex_lock(&hdd_ctx->tdls_lock);
- pTdlsPeer = wlan_hdd_tdls_get_peer(pAdapter, mac);
-
- if (NULL == pTdlsPeer) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- hdd_err(MAC_ADDRESS_STR " update %d not exist. return invalid",
- MAC_ADDR_ARRAY(mac), update);
- ret = -EINVAL;
- goto ret_status;
- }
-
- link_status = pTdlsPeer->link_status;
- /* in add station, we accept existing valid staId if there is */
- if ((0 == update) &&
- ((pTdlsPeer->link_status >= eTDLS_LINK_CONNECTING) ||
- (TDLS_STA_INDEX_VALID(pTdlsPeer->staId)))) {
- hdd_debug(MAC_ADDRESS_STR " status %d.staId %d.add sta ignored",
- MAC_ADDR_ARRAY(mac), pTdlsPeer->link_status,
- pTdlsPeer->staId);
- ret = 0;
- goto rel_lock;
- }
- /* in change station, we accept only when staId is valid */
- if ((1 == update) &&
- ((pTdlsPeer->link_status > eTDLS_LINK_CONNECTING) ||
- (!TDLS_STA_INDEX_VALID(pTdlsPeer->staId)))) {
- hdd_err(MAC_ADDRESS_STR " link status %d. staId %d. change station %s.",
- MAC_ADDR_ARRAY(mac), pTdlsPeer->link_status,
- pTdlsPeer->staId,
- (TDLS_STA_INDEX_VALID(pTdlsPeer->staId)) ? "ignored" :
- "declined");
- ret = (TDLS_STA_INDEX_VALID(pTdlsPeer->staId)) ? 0 : -EPERM;
- goto rel_lock;
- }
-
- /* when others are on-going, we want to change link_status to idle */
- if (NULL != wlan_hdd_tdls_is_progress(hdd_ctx, mac, true)) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- hdd_debug(MAC_ADDRESS_STR " TDLS setup ongoing.req declined.",
- MAC_ADDR_ARRAY(mac));
- ret = -EPERM;
- goto error;
- }
-
- /* first to check if we reached to maximum supported TDLS peer.
- * TODO: for now, return -EPERM looks working fine,
- * but need to check if any other errno fit into this category.
- */
- numCurrTdlsPeers = wlan_hdd_tdls_connected_peers(pAdapter);
- if (hdd_ctx->max_num_tdls_sta <= numCurrTdlsPeers) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: " MAC_ADDRESS_STR
- " TDLS Max peer already connected. Request declined."
- " Num of peers (%d), Max allowed (%d).",
- __func__, MAC_ADDR_ARRAY(mac), numCurrTdlsPeers,
- hdd_ctx->max_num_tdls_sta);
- mutex_unlock(&hdd_ctx->tdls_lock);
- ret = -EPERM;
- goto error;
- } else {
- hddTdlsPeer_t *pTdlsPeer;
-
- pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, mac);
- if (pTdlsPeer) {
- link_status = pTdlsPeer->link_status;
- if (TDLS_IS_CONNECTED(pTdlsPeer)) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: " MAC_ADDRESS_STR
- " already connected. "
- "Request declined.",
- __func__, MAC_ADDR_ARRAY(mac));
- ret = -EPERM;
- goto ret_status;
- }
- }
- }
- if (0 == update)
- wlan_hdd_tdls_set_link_status(pAdapter,
- mac,
- eTDLS_LINK_CONNECTING,
- eTDLS_LINK_SUCCESS);
-
- /* debug code */
- if (NULL != StaParams) {
- hdd_debug("TDLS Peer Parameters.");
- if (StaParams->htcap_present) {
- hdd_debug("ht_capa->cap_info: %0x",
- StaParams->HTCap.capInfo);
- hdd_debug("ht_capa->extended_capabilities: %0x",
- StaParams->HTCap.extendedHtCapInfo);
- }
- hdd_debug("params->capability: %0x", StaParams->capability);
- hdd_debug("params->ext_capab_len: %0x",
- StaParams->extn_capability[0]);
- if (StaParams->vhtcap_present) {
- hdd_debug("rxMcsMap %x rxHigh %x txMcsMap %x txHigh %x",
- StaParams->VHTCap.suppMcs.rxMcsMap,
- StaParams->VHTCap.suppMcs.rxHighest,
- StaParams->VHTCap.suppMcs.txMcsMap,
- StaParams->VHTCap.suppMcs.txHighest);
- }
- hdd_debug("Supported rates:");
- for (rate_idx = 0;
- rate_idx < sizeof(StaParams->supported_rates);
- rate_idx++)
- hdd_debug("rate_idx [%d]: supported_rates %x ",
- rate_idx,
- StaParams->supported_rates[rate_idx]);
- } /* end debug code */
- else if ((1 == update) && (NULL == StaParams)) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- hdd_err("update is true, but staParams is NULL. Error!");
- ret = -EPERM;
- goto ret_status;
- }
-
- INIT_COMPLETION(pAdapter->tdls_add_station_comp);
-
- /* Update the number of stream for each peer */
- if ((NULL != StaParams) && (StaParams->htcap_present)) {
- hddTdlsPeer_t *tdls_peer;
-
- tdls_peer = wlan_hdd_tdls_find_peer(pAdapter, mac);
- if (NULL != tdls_peer)
- tdls_peer->spatial_streams =
- StaParams->HTCap.suppMcsSet[1];
- }
- mutex_unlock(&hdd_ctx->tdls_lock);
-
- if (!update) {
- status = sme_add_tdls_peer_sta(WLAN_HDD_GET_HAL_CTX(pAdapter),
- pAdapter->sessionId, mac);
- } else {
- status = sme_change_tdls_peer_sta(WLAN_HDD_GET_HAL_CTX(pAdapter),
- pAdapter->sessionId, mac,
- StaParams);
- }
-
- rc = wait_for_completion_timeout(&pAdapter->tdls_add_station_comp,
- msecs_to_jiffies
- (WAIT_TIME_TDLS_ADD_STA));
-
- if (!rc) {
- hdd_err("timeout waiting for tdls add station indication %ld peer link status %u",
- rc, link_status);
- ret = -EPERM;
- goto error;
- }
-
- if (QDF_STATUS_SUCCESS != pAdapter->tdlsAddStaStatus) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: Add Station is unsuccessful", __func__);
- ret = -EPERM;
- goto error;
- }
-
- goto ret_status;
-
-error:
- wlan_hdd_tdls_set_link_status(pAdapter,
- mac,
- eTDLS_LINK_IDLE, eTDLS_LINK_UNSPECIFIED);
- goto ret_status;
-rel_lock:
- mutex_unlock(&hdd_ctx->tdls_lock);
-ret_status:
- return ret;
-}
-
#if TDLS_MGMT_VERSION2
/**
* __wlan_hdd_cfg80211_tdls_mgmt() - handle management actions on a given peer
@@ -3141,17 +2420,8 @@
#endif
#endif
{
-
struct hdd_adapter *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
- struct hdd_station_ctx *hdd_sta_ctx;
- tdlsCtx_t *hdd_tdls_ctx;
- u8 peerMac[QDF_MAC_ADDR_SIZE];
- QDF_STATUS status;
- int max_sta_failed = 0;
- int responder;
- unsigned long rc;
- uint16_t numCurrTdlsPeers;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0))
#if !(TDLS_MGMT_VERSION2)
u32 peer_capability;
@@ -3177,14 +2447,6 @@
if (wlan_hdd_validate_context(hdd_ctx))
return -EINVAL;
- if (eTDLS_SUPPORT_NOT_ENABLED == hdd_ctx->tdls_mode) {
- hdd_debug("TDLS disabled" MAC_ADDRESS_STR " action %d declined",
- MAC_ADDR_ARRAY(peer), action_code);
- return -ENOTSUPP;
- }
-
- hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
if (hdd_ctx->tdls_umac_comp_active)
return wlan_cfg80211_tdls_mgmt(hdd_ctx->hdd_pdev, dev,
peer,
@@ -3192,284 +2454,7 @@
status_code, peer_capability,
buf, len);
- /*
- * STA or P2P client should be connected and authenticated before
- * sending any TDLS frames
- */
- if ((eConnectionState_Associated !=
- hdd_sta_ctx->conn_info.connState) ||
- (false == hdd_sta_ctx->conn_info.uIsAuthenticated)) {
- hdd_err("STA is not connected or not authenticated. connState %u, uIsAuthenticated %u",
- hdd_sta_ctx->conn_info.connState,
- hdd_sta_ctx->conn_info.uIsAuthenticated);
- return -EAGAIN;
- }
-
- /* other than teardown frame, mgmt frames are not sent if disabled */
- if (SIR_MAC_TDLS_TEARDOWN != action_code) {
- if (!cds_check_is_tdls_allowed(pAdapter->device_mode)) {
- hdd_err("TDLS not allowed, reject TDLS MGMT, action_code=%d",
- action_code);
- return -EPERM;
- }
- /* if tdls_mode is disabled, then decline the peer's request */
- if (eTDLS_SUPPORT_DISABLED == hdd_ctx->tdls_mode) {
- hdd_debug(MAC_ADDRESS_STR "TDLS disabled. %d declined.",
- MAC_ADDR_ARRAY(peer), action_code);
- return -ENOTSUPP;
- }
- if (hdd_ctx->tdls_nss_switch_in_progress) {
- hdd_err("TDLS antenna switch in progress, action %d declined for "
- MAC_ADDRESS_STR, action_code, MAC_ADDR_ARRAY(peer));
- return -EAGAIN;
- }
- }
-
- if (WLAN_IS_TDLS_SETUP_ACTION(action_code)) {
- mutex_lock(&hdd_ctx->tdls_lock);
- if (NULL != wlan_hdd_tdls_is_progress(hdd_ctx, peer, true)) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: " MAC_ADDRESS_STR
- " TDLS setup is ongoing. action %d declined.",
- __func__, MAC_ADDR_ARRAY(peer), action_code);
- return -EPERM;
- }
- mutex_unlock(&hdd_ctx->tdls_lock);
- }
- /*
- * Discard TDLS Discovery request and setup confirm if violates
- * ACM rules
- */
- if ((SIR_MAC_TDLS_DIS_REQ == action_code ||
- SIR_MAC_TDLS_SETUP_CNF == action_code) &&
- (hdd_wmm_is_active(pAdapter)) &&
- !(pAdapter->hddWmmStatus.wmmAcStatus[OL_TX_WMM_AC_VI].wmmAcAccessAllowed)) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,
- "%s: Admission control is set to VI, action %d is not allowed.",
- __func__, action_code);
- return -EPERM;
- }
-
- if (SIR_MAC_TDLS_SETUP_REQ == action_code ||
- SIR_MAC_TDLS_SETUP_RSP == action_code) {
- numCurrTdlsPeers = wlan_hdd_tdls_connected_peers(pAdapter);
- if (hdd_ctx->max_num_tdls_sta <= numCurrTdlsPeers) {
- /* supplicant still sends tdls_mgmt(SETUP_REQ)
- * even after we return error code at
- * 'add_station()'. Hence we have this check
- * again in addition to add_station(). Anyway,
- * there is no harm to double-check.
- */
- if (SIR_MAC_TDLS_SETUP_REQ == action_code) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: " MAC_ADDRESS_STR
- " TDLS Max peer already connected. action (%d) declined. Num of peers (%d), Max allowed (%d).",
- __func__, MAC_ADDR_ARRAY(peer),
- action_code, numCurrTdlsPeers,
- hdd_ctx->max_num_tdls_sta);
- return -EINVAL;
- }
- /* maximum reached. tweak to send
- * error code to peer and return error
- * code to supplicant
- */
- status_code = eSIR_MAC_UNSPEC_FAILURE_STATUS;
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: " MAC_ADDRESS_STR
- " TDLS Max peer already connected, send response status (%d). Num of peers (%d), Max allowed (%d).",
- __func__, MAC_ADDR_ARRAY(peer),
- status_code, numCurrTdlsPeers,
- hdd_ctx->max_num_tdls_sta);
- max_sta_failed = -EPERM;
- /* fall through to send setup resp
- * with failure status code
- */
- } else {
- hddTdlsPeer_t *pTdlsPeer;
-
- mutex_lock(&hdd_ctx->tdls_lock);
- pTdlsPeer =
- wlan_hdd_tdls_find_peer(pAdapter, peer);
- if (pTdlsPeer) {
- if (TDLS_IS_CONNECTED(pTdlsPeer)) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s:" MAC_ADDRESS_STR
- " already connected."
- " action %d declined.",
- __func__,
- MAC_ADDR_ARRAY(peer),
- action_code);
- return -EPERM;
- }
- }
- mutex_unlock(&hdd_ctx->tdls_lock);
- }
- }
- qdf_mem_copy(peerMac, peer, 6);
-
- hdd_debug("tdls" MAC_ADDRESS_STR "action %d,token %d,status %d,len %zu",
- MAC_ADDR_ARRAY(peer), action_code, dialog_token,
- status_code, len);
-
- /*Except teardown responder will not be used so just make 0 */
- responder = 0;
- if (SIR_MAC_TDLS_TEARDOWN == action_code) {
- hddTdlsPeer_t *pTdlsPeer;
-
- mutex_lock(&hdd_ctx->tdls_lock);
- pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, peerMac);
- if (!pTdlsPeer) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: " MAC_ADDRESS_STR " peer doesn't exist",
- __func__, MAC_ADDR_ARRAY(peer));
- return -EPERM;
- }
-
- if (TDLS_IS_CONNECTED(pTdlsPeer))
- responder = pTdlsPeer->is_responder;
- else {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: " MAC_ADDRESS_STR
- " peer doesn't exist or not connected %d "
- "dialog_token %d status %d, len = %zu",
- __func__, MAC_ADDR_ARRAY(peer),
- pTdlsPeer->link_status,
- dialog_token, status_code, len);
- mutex_unlock(&hdd_ctx->tdls_lock);
- return -EPERM;
- }
- mutex_unlock(&hdd_ctx->tdls_lock);
- }
-
- /* For explicit trigger of DIS_REQ come out of BMPS for
- * successfully receiving DIS_RSP from peer.
- */
- if ((SIR_MAC_TDLS_SETUP_RSP == action_code) ||
- (SIR_MAC_TDLS_SETUP_CNF == action_code) ||
- (SIR_MAC_TDLS_DIS_RSP == action_code) ||
- (SIR_MAC_TDLS_DIS_REQ == action_code)) {
- /* Fw will take care if PS offload is enabled. */
- if (SIR_MAC_TDLS_DIS_REQ != action_code)
- wlan_hdd_tdls_set_cap(pAdapter, peerMac,
- eTDLS_CAP_SUPPORTED);
- }
-
- /* make sure doesn't call send_mgmt() while it is pending */
- if (TDLS_CTX_MAGIC == pAdapter->mgmtTxCompletionStatus) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: " MAC_ADDRESS_STR
- " action %d couldn't sent, as one is pending. return EBUSY",
- __func__, MAC_ADDR_ARRAY(peer), action_code);
- return -EBUSY;
- }
-
- pAdapter->mgmtTxCompletionStatus = TDLS_CTX_MAGIC;
- INIT_COMPLETION(pAdapter->tdls_mgmt_comp);
-
- status = sme_send_tdls_mgmt_frame(WLAN_HDD_GET_HAL_CTX(pAdapter),
- pAdapter->sessionId, peerMac,
- action_code, dialog_token,
- status_code, peer_capability,
- (uint8_t *) buf, len,
- !responder);
-
- if (QDF_STATUS_SUCCESS != status) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: sme_send_tdls_mgmt_frame failed!", __func__);
- pAdapter->mgmtTxCompletionStatus = false;
- return -EINVAL;
- }
-
- if (SIR_MAC_TDLS_TEARDOWN == action_code &&
- hdd_ctx->tdls_nss_switch_in_progress) {
- mutex_lock(&hdd_ctx->tdls_lock);
- if (hdd_ctx->tdls_teardown_peers_cnt != 0)
- hdd_ctx->tdls_teardown_peers_cnt--;
- if (hdd_ctx->tdls_teardown_peers_cnt == 0) {
- if (hdd_ctx->tdls_nss_transition_mode ==
- TDLS_NSS_TRANSITION_1x1_to_2x2) {
- /* TDLS NSS switch is fully completed, so
- * reset the flags.
- */
- hdd_debug("TDLS NSS switch is fully completed");
- hdd_ctx->tdls_nss_switch_in_progress = false;
- hdd_ctx->tdls_nss_teardown_complete = false;
- } else {
- /* TDLS NSS switch is not yet completed, but
- * tdls teardown is completed for all the
- * peers.
- */
- hdd_debug("TDLS teardown is completed and NSS switch still in progress");
- hdd_ctx->tdls_nss_teardown_complete = true;
- }
- }
- mutex_unlock(&hdd_ctx->tdls_lock);
- }
- hdd_debug("Wait for tdls_mgmt_comp. Timeout %u ms",
- WAIT_TIME_TDLS_MGMT);
-
- rc = wait_for_completion_timeout(&pAdapter->tdls_mgmt_comp,
- msecs_to_jiffies(WAIT_TIME_TDLS_MGMT));
-
- if ((0 == rc) || (true != pAdapter->mgmtTxCompletionStatus)) {
- hdd_err("%s rc %ld mgmtTxCompletionStatus %u",
- !rc ? "Mgmt Tx Completion timed out" : "Mgmt Tx Completion failed",
- rc, pAdapter->mgmtTxCompletionStatus);
-
- if (cds_is_driver_recovering() ||
- cds_is_driver_in_bad_state()) {
- hdd_err("Recovery in Progress. State: 0x%x Ignore!!!",
- cds_get_driver_state());
- return -EAGAIN;
- }
-
- if (cds_is_driver_unloading()) {
- hdd_err("Unload in progress. State: 0x%x Ignore!!!",
- cds_get_driver_state());
- return -EAGAIN;
- }
-
- mutex_lock(&hdd_ctx->tdls_lock);
- hdd_tdls_ctx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter);
- if (hdd_tdls_ctx) {
- if (rc <= 0 &&
- (((qdf_get_monotonic_boottime() -
- hdd_tdls_ctx->last_flush_ts) >
- TDLS_ENABLE_CDS_FLUSH_INTERVAL)
- || !(hdd_tdls_ctx->last_flush_ts))) {
- hdd_tdls_ctx->last_flush_ts =
- qdf_get_monotonic_boottime();
- mutex_unlock(&hdd_ctx->tdls_lock);
- cds_flush_logs(WLAN_LOG_TYPE_FATAL,
- WLAN_LOG_INDICATOR_HOST_DRIVER,
- WLAN_LOG_REASON_HDD_TIME_OUT,
- true, false);
- } else
- mutex_unlock(&hdd_ctx->tdls_lock);
- } else
- mutex_unlock(&hdd_ctx->tdls_lock);
-
- pAdapter->mgmtTxCompletionStatus = false;
- return -EINVAL;
- }
- hdd_debug("Mgmt Tx Completion status %ld TxCompletion %u",
- rc, pAdapter->mgmtTxCompletionStatus);
-
- if (max_sta_failed)
- return max_sta_failed;
-
- if (SIR_MAC_TDLS_SETUP_RSP == action_code)
- return wlan_hdd_tdls_set_responder(pAdapter, peerMac, false);
- else if (SIR_MAC_TDLS_SETUP_CNF == action_code)
- return wlan_hdd_tdls_set_responder(pAdapter, peerMac, true);
-
- return 0;
+ return -EINVAL;
}
/**
@@ -3757,7 +2742,6 @@
return status;
}
-#if defined(CONVERGED_TDLS_ENABLE)
/**
* __wlan_hdd_cfg80211_tdls_oper() - helper function to handle cfg80211 operation
* on an TDLS peer
@@ -3803,484 +2787,16 @@
if (0 != status)
return status;
- status = wlan_cfg80211_tdls_oper(hdd_ctx->hdd_pdev, dev, peer, oper);
-
- EXIT();
- return status;
-}
-#else
-/**
- * __wlan_hdd_cfg80211_tdls_oper() - helper function to handle cfg80211
- * operation on an TDLS peer
- * @wiphy: wiphy
- * @dev: net device
- * @peer: MAC address of the TDLS peer
- * @oper: cfg80211 TDLS operation
- *
- * Return: 0 on success; negative errno otherwise
- */
-static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
- struct net_device *dev,
- const uint8_t *peer,
- enum nl80211_tdls_operation oper)
-{
- struct hdd_adapter *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
- struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
- int status;
- tSmeTdlsPeerStateParams smeTdlsPeerStateParams;
- QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
- hddTdlsPeer_t *pTdlsPeer;
- enum tdls_link_status peer_status = eTDLS_LINK_IDLE;
- uint16_t peer_staid;
- uint8_t peer_offchannelsupp;
-
- ENTER();
-
- if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
- hdd_err("Command not allowed in FTM mode");
- return -EINVAL;
- }
-
- if (wlan_hdd_validate_session_id(pAdapter->sessionId)) {
- hdd_err("invalid session id: %d", pAdapter->sessionId);
- return -EINVAL;
- }
-
- MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
- TRACE_CODE_HDD_CFG80211_TDLS_OPER,
- pAdapter->sessionId, oper));
- if (NULL == peer) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: Invalid arguments", __func__);
- return -EINVAL;
- }
-
- status = wlan_hdd_validate_context(hdd_ctx);
-
- if (0 != status)
+ if (hdd_ctx->tdls_umac_comp_active) {
+ status = wlan_cfg80211_tdls_oper(hdd_ctx->hdd_pdev,
+ dev, peer, oper);
+ EXIT();
return status;
-
- /* QCA 2.0 Discrete ANDs feature capability in HDD config with that
- * received from target, so HDD config gives combined intersected result
- */
- if (false == hdd_ctx->config->fEnableTDLSSupport) {
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "TDLS Disabled in INI OR not enabled in FW. "
- "Cannot process TDLS commands");
- return -ENOTSUPP;
- }
-
- switch (oper) {
- case NL80211_TDLS_ENABLE_LINK:
- {
- QDF_STATUS status;
- unsigned long rc;
- tCsrTdlsLinkEstablishParams tdlsLinkEstablishParams = { {0}, 0,
- 0, 0, 0, 0, 0, {0}, 0, {0} };
-
- mutex_lock(&hdd_ctx->tdls_lock);
- pTdlsPeer =
- wlan_hdd_tdls_find_peer(pAdapter, peer);
-
- if (NULL == pTdlsPeer) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: peer matching " MAC_ADDRESS_STR
- " not found, ignore NL80211_TDLS_ENABLE_LINK",
- __func__, MAC_ADDR_ARRAY(peer));
- return -EINVAL;
- }
-
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: NL80211_TDLS_ENABLE_LINK for peer "
- MAC_ADDRESS_STR " link_status: %d",
- __func__, MAC_ADDR_ARRAY(peer),
- pTdlsPeer->link_status);
-
- if (!TDLS_STA_INDEX_VALID(pTdlsPeer->staId)) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: invalid sta index %u for "
- MAC_ADDRESS_STR
- " TDLS_ENABLE_LINK failed", __func__,
- pTdlsPeer->staId,
- MAC_ADDR_ARRAY(peer));
- mutex_unlock(&hdd_ctx->tdls_lock);
- return -EINVAL;
- }
- peer_status = pTdlsPeer->link_status;
- peer_offchannelsupp = pTdlsPeer->isOffChannelSupported;
- mutex_unlock(&hdd_ctx->tdls_lock);
-
- wlan_hdd_tdls_set_cap(pAdapter, peer, eTDLS_CAP_SUPPORTED);
-
- qdf_mem_set(&tdlsLinkEstablishParams,
- sizeof(tdlsLinkEstablishParams), 0);
-
- if (eTDLS_LINK_CONNECTED != peer_status) {
- if (IS_ADVANCE_TDLS_ENABLE) {
-
- hdd_debug("Advance TDLS is enabled");
- if (0 !=
- wlan_hdd_tdls_get_link_establish_params
- (pAdapter, peer,
- &tdlsLinkEstablishParams)) {
- return -EINVAL;
- }
- INIT_COMPLETION(pAdapter->
- tdls_link_establish_req_comp);
-
- sme_send_tdls_link_establish_params
- (WLAN_HDD_GET_HAL_CTX(pAdapter),
- pAdapter->sessionId, peer,
- &tdlsLinkEstablishParams);
- /* Send TDLS peer UAPSD capabilities to the
- * firmware and register with the TL on after
- * the response for this operation is received
- */
- rc = wait_for_completion_timeout
- (&pAdapter->
- tdls_link_establish_req_comp,
- msecs_to_jiffies
- (WAIT_TIME_TDLS_LINK_ESTABLISH_REQ));
- if (!rc) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: Link Establish Request timed out",
- __func__);
- return -EINVAL;
- }
- }
-
- mutex_lock(&hdd_ctx->tdls_lock);
- pTdlsPeer =
- wlan_hdd_tdls_find_peer(pAdapter, peer);
-
- if (NULL == pTdlsPeer) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: peer matching " MAC_ADDRESS_STR
- " (oper %d) peer got freed in other"
- "context. ignored",
- __func__, MAC_ADDR_ARRAY(peer),
- (int)oper);
- return -EINVAL;
- }
-
- wlan_hdd_tdls_set_peer_link_status(pTdlsPeer,
- eTDLS_LINK_CONNECTED,
- eTDLS_LINK_SUCCESS);
- peer_staid = pTdlsPeer->staId;
-
- hdd_debug("%s: tdlsLinkEstablishParams of peer "
- MAC_ADDRESS_STR "uapsdQueues: %d"
- " qos: %d maxSp: %d isBufSta: %d"
- " isOffChannelSupported: %d"
- " isResponder: %d peerstaId: %d",
- __func__,
- MAC_ADDR_ARRAY(
- tdlsLinkEstablishParams.peerMac),
- tdlsLinkEstablishParams.uapsdQueues,
- tdlsLinkEstablishParams.qos,
- tdlsLinkEstablishParams.maxSp,
- tdlsLinkEstablishParams.isBufSta,
- tdlsLinkEstablishParams.isOffChannelSupported,
- tdlsLinkEstablishParams.isResponder,
- pTdlsPeer->staId);
- /* start TDLS client registration with TL */
- status =
- hdd_roam_register_tdlssta(
- pAdapter, peer,
- pTdlsPeer->staId,
- pTdlsPeer->signature,
- pTdlsPeer->qos);
- if (QDF_STATUS_SUCCESS == status) {
- uint8_t i;
-
- qdf_mem_zero(&smeTdlsPeerStateParams,
- sizeof
- (tSmeTdlsPeerStateParams));
-
- smeTdlsPeerStateParams.vdevId =
- pAdapter->sessionId;
- qdf_mem_copy(&smeTdlsPeerStateParams.
- peerMacAddr,
- &pTdlsPeer->peerMac,
- sizeof(tSirMacAddr));
- smeTdlsPeerStateParams.peerState =
- eSME_TDLS_PEER_STATE_CONNECTED;
- smeTdlsPeerStateParams.peerCap.
- isPeerResponder =
- pTdlsPeer->is_responder;
- smeTdlsPeerStateParams.peerCap.
- peerUapsdQueue =
- pTdlsPeer->uapsdQueues;
- smeTdlsPeerStateParams.peerCap.
- peerMaxSp = pTdlsPeer->maxSp;
- smeTdlsPeerStateParams.peerCap.
- peerBuffStaSupport =
- pTdlsPeer->isBufSta;
- smeTdlsPeerStateParams.peerCap.
- peerOffChanSupport =
- pTdlsPeer->isOffChannelSupported;
- smeTdlsPeerStateParams.peerCap.
- peerCurrOperClass = 0;
- smeTdlsPeerStateParams.peerCap.
- selfCurrOperClass = 0;
- smeTdlsPeerStateParams.peerCap.
- peerChanLen =
- pTdlsPeer->supported_channels_len;
- smeTdlsPeerStateParams.peerCap.
- prefOffChanNum =
- pTdlsPeer->pref_off_chan_num;
- smeTdlsPeerStateParams.peerCap.
- prefOffChanBandwidth =
- hdd_ctx->config->
- fTDLSPrefOffChanBandwidth;
- smeTdlsPeerStateParams.peerCap.
- opClassForPrefOffChan =
- pTdlsPeer->
- op_class_for_pref_off_chan;
-
- if (wlan_reg_is_dfs_ch(hdd_ctx->hdd_pdev,
- smeTdlsPeerStateParams.
- peerCap.prefOffChanNum)) {
- hdd_err("Resetting TDLS off-channel from %d to %d",
- smeTdlsPeerStateParams.peerCap.
- prefOffChanNum,
- CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEFAULT);
- smeTdlsPeerStateParams.peerCap.prefOffChanNum =
- CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEFAULT;
- }
-
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_INFO,
- "%s: Peer " MAC_ADDRESS_STR
- "vdevId: %d, peerState: %d, isPeerResponder: %d, uapsdQueues: 0x%x, maxSp: 0x%x, peerBuffStaSupport: %d, peerOffChanSupport: %d, peerCurrOperClass: %d, selfCurrOperClass: %d, peerChanLen: %d, peerOperClassLen: %d, prefOffChanNum: %d, prefOffChanBandwidth: %d, op_class_for_pref_off_chan: %d",
- __func__,
- MAC_ADDR_ARRAY(peer),
- smeTdlsPeerStateParams.vdevId,
- smeTdlsPeerStateParams.
- peerState,
- smeTdlsPeerStateParams.
- peerCap.isPeerResponder,
- smeTdlsPeerStateParams.
- peerCap.peerUapsdQueue,
- smeTdlsPeerStateParams.
- peerCap.peerMaxSp,
- smeTdlsPeerStateParams.
- peerCap.peerBuffStaSupport,
- smeTdlsPeerStateParams.
- peerCap.peerOffChanSupport,
- smeTdlsPeerStateParams.
- peerCap.peerCurrOperClass,
- smeTdlsPeerStateParams.
- peerCap.selfCurrOperClass,
- smeTdlsPeerStateParams.
- peerCap.peerChanLen,
- smeTdlsPeerStateParams.
- peerCap.peerOperClassLen,
- smeTdlsPeerStateParams.
- peerCap.prefOffChanNum,
- smeTdlsPeerStateParams.
- peerCap.prefOffChanBandwidth,
- pTdlsPeer->
- op_class_for_pref_off_chan);
-
- for (i = 0;
- i <
- pTdlsPeer->supported_channels_len;
- i++) {
- smeTdlsPeerStateParams.peerCap.
- peerChan[i] =
- pTdlsPeer->
- supported_channels[i];
- }
- smeTdlsPeerStateParams.peerCap.
- peerOperClassLen =
- pTdlsPeer->
- supported_oper_classes_len;
- for (i = 0;
- i <
- pTdlsPeer->
- supported_oper_classes_len; i++) {
- smeTdlsPeerStateParams.peerCap.
- peerOperClass[i] =
- pTdlsPeer->
- supported_oper_classes[i];
- }
- mutex_unlock(&hdd_ctx->tdls_lock);
-
- qdf_ret_status =
- sme_update_tdls_peer_state(hdd_ctx->
- hHal,
- &smeTdlsPeerStateParams);
- if (QDF_STATUS_SUCCESS !=
- qdf_ret_status) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: sme_update_tdls_peer_state failed for "
- MAC_ADDRESS_STR,
- __func__,
- MAC_ADDR_ARRAY(peer));
- return -EPERM;
- }
- wlan_hdd_tdls_increment_peer_count
- (pAdapter);
- } else
- mutex_unlock(&hdd_ctx->tdls_lock);
-
- /* Update TL about the UAPSD masks,
- * to route the packets to firmware
- */
- if ((true ==
- hdd_ctx->config->fEnableTDLSBufferSta)
- || hdd_ctx->config->fTDLSUapsdMask) {
- int ac;
- uint8_t ucAc[4] = { SME_AC_VO,
- SME_AC_VI,
- SME_AC_BK,
- SME_AC_BE};
- uint8_t tlTid[4] = { 7, 5, 2, 3 };
-
- hdd_debug("Update TL about UAPSD masks");
- for (ac = 0; ac < 4; ac++) {
- status = sme_enable_uapsd_for_ac(
- peer_staid, ucAc[ac],
- tlTid[ac], tlTid[ac], 0, 0,
- SME_QOS_WMM_TS_DIR_BOTH, 1,
- pAdapter->sessionId,
- hdd_ctx->config->DelayedTriggerFrmInt);
- }
- }
- }
- hdd_wlan_tdls_enable_link_event(peer,
- peer_offchannelsupp,
- 0, 0);
- }
- break;
- case NL80211_TDLS_DISABLE_LINK:
- {
- mutex_lock(&hdd_ctx->tdls_lock);
- pTdlsPeer =
- wlan_hdd_tdls_find_peer(pAdapter, peer);
-
- if (NULL == pTdlsPeer) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: peer matching " MAC_ADDRESS_STR
- " not found, ignore NL80211_TDLS_DISABLE_LINK",
- __func__, MAC_ADDR_ARRAY(peer));
- return -EINVAL;
- }
-
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: NL80211_TDLS_DISABLE_LINK for peer "
- MAC_ADDRESS_STR " link_status: %d",
- __func__, MAC_ADDR_ARRAY(peer),
- pTdlsPeer->link_status);
- peer_staid = pTdlsPeer->staId;
- mutex_unlock(&hdd_ctx->tdls_lock);
-
- if (TDLS_STA_INDEX_VALID(peer_staid)) {
- unsigned long rc;
-
- INIT_COMPLETION(pAdapter->
- tdls_del_station_comp);
-
- sme_delete_tdls_peer_sta(WLAN_HDD_GET_HAL_CTX
- (pAdapter),
- pAdapter->sessionId,
- peer);
-
- rc = wait_for_completion_timeout(&pAdapter->
- tdls_del_station_comp,
- msecs_to_jiffies
- (WAIT_TIME_TDLS_DEL_STA));
- if (!rc) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: Del station timed out",
- __func__);
- return -EPERM;
- }
-
- mutex_lock(&hdd_ctx->tdls_lock);
- pTdlsPeer =
- wlan_hdd_tdls_find_peer(pAdapter, peer);
- if (NULL == pTdlsPeer) {
- mutex_unlock(&hdd_ctx->tdls_lock);
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: peer matching " MAC_ADDRESS_STR
- " (oper %d) peer got freed in other"
- " context. ignored",
- __func__, MAC_ADDR_ARRAY(peer),
- (int)oper);
- return -EINVAL;
- }
-
- wlan_hdd_tdls_set_peer_link_status(pTdlsPeer,
- eTDLS_LINK_IDLE,
- (pTdlsPeer->link_status ==
- eTDLS_LINK_TEARING) ?
- eTDLS_LINK_UNSPECIFIED :
- eTDLS_LINK_DROPPED_BY_REMOTE);
- mutex_unlock(&hdd_ctx->tdls_lock);
- } else {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: TDLS Peer Station doesn't exist.",
- __func__);
- }
- }
- break;
- case NL80211_TDLS_TEARDOWN:
- {
- status =
- wlan_hdd_tdls_extctrl_deconfig_peer(pAdapter, peer);
-
- if (0 != status) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: Error in TDLS Teardown",
- __func__);
- return status;
- }
- }
- break;
- case NL80211_TDLS_SETUP:
- {
- status = wlan_hdd_tdls_extctrl_config_peer(pAdapter,
- peer, NULL,
- hdd_ctx->config->fTDLSPrefOffChanNum, 0, 0, 0);
- if (0 != status) {
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: Error in TDLS Setup", __func__);
- return status;
- }
- }
- break;
- case NL80211_TDLS_DISCOVERY_REQ:
- /* We don't support in-driver setup/teardown/discovery */
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,
- "%s: We don't support in-driver setup/teardown/discovery",
- __func__);
- return -ENOTSUPP;
- default:
- QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
- "%s: unsupported event %d", __func__, oper);
- return -ENOTSUPP;
}
EXIT();
- return 0;
+ return -EINVAL;
}
-#endif
/**
* wlan_hdd_cfg80211_tdls_oper() - handle cfg80211 operation on an TDLS peer
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index 7ee4087..f70febb 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -457,9 +457,7 @@
uint8_t sessionId; /* To support BT-AMP */
uint16_t transactionId; /* To support BT-AMP */
tSirResultCodes statusCode;
-#ifdef CONVERGED_TDLS_ENABLE
struct wlan_objmgr_psoc *psoc;
-#endif
} tSirSmeRsp, *tpSirSmeRsp;
/* / Definition for indicating all modules ready on STA */
@@ -3505,9 +3503,7 @@
uint8_t ucastSig;
uint8_t bcastSig;
eTdlsAddOper tdlsAddOper;
-#ifdef CONVERGED_TDLS_ENABLE
struct wlan_objmgr_psoc *psoc;
-#endif
} tSirTdlsAddStaRsp;
/* TDLS Request struct SME-->PE */
@@ -3559,9 +3555,7 @@
tSirResultCodes statusCode;
struct qdf_mac_addr peermac;
uint16_t staId;
-#ifdef CONVERGED_TDLS_ENABLE
struct wlan_objmgr_psoc *psoc;
-#endif
} tSirTdlsDelStaRsp, *tpSirTdlsDelStaRsp;
/* TDLS Delete Indication struct PE-->SME */
typedef struct sSirTdlsDelStaInd {
@@ -3582,9 +3576,7 @@
uint16_t length;
uint8_t sessionId; /* Session ID */
uint32_t txCompleteStatus;
-#ifdef CONVERGED_TDLS_ENABLE
struct wlan_objmgr_psoc *psoc;
-#endif
} tSirMgmtTxCompletionInd, *tpSirMgmtTxCompletionInd;
typedef struct sSirTdlsEventnotify {
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 1761371..b593aa5 100644
--- a/core/mac/src/pe/lim/lim_process_action_frame.c
+++ b/core/mac/src/pe/lim/lim_process_action_frame.c
@@ -2105,25 +2105,7 @@
WMA_GET_RX_RSSI_NORMALIZED(
rx_pkt_info));
break;
-#ifdef FEATURE_WLAN_TDLS
-#ifndef CONVERGED_TDLS_ENABLE
- case SIR_MAC_TDLS_DIS_RSP:
- mac_hdr = NULL;
- frame_len = 0;
- rssi = 0;
- mac_hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
- frame_len = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info);
- rssi = WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info);
- pe_debug("Public Action TDLS Discovery RSP");
- lim_send_sme_mgmt_frame_ind(mac_ctx,
- mac_hdr->fc.subType, (uint8_t *) mac_hdr,
- frame_len + sizeof(tSirMacMgmtHdr),
- 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,
rx_pkt_info, session);
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 7c4c7be..4f0573c 100644
--- a/core/mac/src/pe/lim/lim_process_message_queue.c
+++ b/core/mac/src/pe/lim/lim_process_message_queue.c
@@ -1269,7 +1269,6 @@
#ifdef FEATURE_WLAN_TDLS
tSirTdlsInd *tdls_ind = NULL;
tpDphHashNode sta_ds = NULL;
- tTdlsLinkEstablishParams *tdls_link_params = NULL;
#endif
tSirMbMsgP2p *p2p_msg = NULL;
tSirSetActiveModeSetBncFilterReq *bcn_filter_req = NULL;
@@ -1779,29 +1778,6 @@
qdf_mem_free((void *)(msg->bodyptr));
msg->bodyptr = NULL;
break;
-#ifdef FEATURE_WLAN_TDLS
- case WMA_SET_TDLS_LINK_ESTABLISH_REQ_RSP:
- tdls_link_params = (tTdlsLinkEstablishParams *) msg->bodyptr;
- session_entry = pe_find_session_by_sta_id(mac_ctx,
- tdls_link_params->staIdx, &session_id);
- if (session_entry == NULL) {
- pe_err("session %u does not exist", session_id);
- /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP
- * message to SME with session id as zero and status
- * as FAILURE so, that message queued in SME queue
- * can be freed to prevent the SME cmd buffer leak
- */
- lim_send_sme_tdls_link_establish_req_rsp(mac_ctx, 0,
- NULL, NULL, eSIR_FAILURE);
- } else {
- lim_send_sme_tdls_link_establish_req_rsp(mac_ctx,
- session_entry->smeSessionId, NULL, NULL,
- tdls_link_params->status);
- }
- qdf_mem_free((void *)(msg->bodyptr));
- msg->bodyptr = NULL;
- break;
-#endif
case WMA_RX_CHN_STATUS_EVENT:
lim_process_rx_channel_status_event(mac_ctx, msg->bodyptr);
diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
index 11249d3..1613fd6 100644
--- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
@@ -5059,9 +5059,6 @@
case eWNI_SME_TDLS_DEL_STA_REQ:
lim_process_sme_tdls_del_sta_req(pMac, pMsgBuf);
break;
- case eWNI_SME_TDLS_LINK_ESTABLISH_REQ:
- lim_process_sme_tdls_link_establish_req(pMac, pMsgBuf);
- break;
#endif
case eWNI_SME_RESET_AP_CAPS_CHANGED:
__lim_process_sme_reset_ap_caps_change(pMac, pMsgBuf);
diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c
index a2524d5..f59bb63 100644
--- a/core/mac/src/pe/lim/lim_process_tdls.c
+++ b/core/mac/src/pe/lim/lim_process_tdls.c
@@ -79,10 +79,7 @@
#include "cds_regdomain.h"
#include "cds_utils.h"
#include "wlan_reg_services_api.h"
-
-#ifdef CONVERGED_TDLS_ENABLE
#include "wlan_tdls_tgt_api.h"
-#endif
/* define NO_PAD_TDLS_MIN_8023_SIZE to NOT padding: See CR#447630
There was IOT issue with cisco 1252 open mode, where it pads
@@ -2677,18 +2674,11 @@
addStaRsp->length = sizeof(tSirTdlsAddStaRsp);
addStaRsp->messageType = eWNI_SME_TDLS_ADD_STA_RSP;
-#ifdef CONVERGED_TDLS_ENABLE
addStaRsp->psoc = pMac->psoc;
mmhMsg.bodyptr = addStaRsp;
mmhMsg.callback = tgt_tdls_add_peer_rsp;
return scheduler_post_msg(QDF_MODULE_ID_TARGET_IF, &mmhMsg);
-#else
- mmhMsg.bodyptr = addStaRsp;
- mmhMsg.bodyval = 0;
- lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT);
-#endif
- return QDF_STATUS_SUCCESS;
}
/*
@@ -2737,7 +2727,6 @@
return status;
}
-#ifdef CONVERGED_TDLS_ENABLE
/**
* lim_send_tdls_comp_mgmt_rsp() - Send Response to upper layers
* @mac_ctx: Pointer to Global MAC structure
@@ -2786,7 +2775,6 @@
scheduler_post_msg(QDF_MODULE_ID_TARGET_IF, &msg);
}
-#endif
/**
* lim_process_sme_tdls_mgmt_send_req() - send out tdls management frames
@@ -2908,52 +2896,14 @@
}
lim_tdls_send_mgmt_error:
-#ifdef CONVERGED_TDLS_ENABLE
lim_send_tdls_comp_mgmt_rsp(mac_ctx, eWNI_SME_TDLS_SEND_MGMT_RSP,
result_code, send_req->sessionId,
send_req->transactionId);
-#else
- lim_send_sme_rsp(mac_ctx, eWNI_SME_TDLS_SEND_MGMT_RSP,
- result_code, send_req->sessionId,
- send_req->transactionId);
-#endif
return eSIR_SUCCESS;
}
/*
- * Send Response to Link Establish Request to SME
- */
-void lim_send_sme_tdls_link_establish_req_rsp(tpAniSirGlobal pMac,
- uint8_t sessionId,
- struct qdf_mac_addr *peermac,
- tDphHashNode *pStaDs, uint8_t status)
-{
- struct scheduler_msg mmhMsg = { 0 };
-
- tSirTdlsLinkEstablishReqRsp *pTdlsLinkEstablishReqRsp = NULL;
-
- pTdlsLinkEstablishReqRsp =
- qdf_mem_malloc(sizeof(tSirTdlsLinkEstablishReqRsp));
- if (NULL == pTdlsLinkEstablishReqRsp) {
- pe_err("Failed to allocate memory");
- return;
- }
- pe_debug("Send Resp to TDL Link Establish Req to SME");
- pTdlsLinkEstablishReqRsp->statusCode = status;
- if (peermac)
- qdf_copy_macaddr(&pTdlsLinkEstablishReqRsp->peermac, peermac);
-
- pTdlsLinkEstablishReqRsp->sessionId = sessionId;
- mmhMsg.type = eWNI_SME_TDLS_LINK_ESTABLISH_RSP;
- mmhMsg.bodyptr = pTdlsLinkEstablishReqRsp;
- mmhMsg.bodyval = 0;
- lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT);
- return;
-
-}
-
-/*
* Once link is teardown, send Del Peer Ind to SME
*/
static QDF_STATUS lim_send_sme_tdls_del_sta_rsp(tpAniSirGlobal pMac,
@@ -2982,19 +2932,10 @@
pDelSta->length = sizeof(tSirTdlsDelStaRsp);
pDelSta->messageType = eWNI_SME_TDLS_DEL_STA_RSP;
-#ifdef CONVERGED_TDLS_ENABLE
pDelSta->psoc = pMac->psoc;
mmhMsg.bodyptr = pDelSta;
mmhMsg.callback = tgt_tdls_del_peer_rsp;
return scheduler_post_msg(QDF_MODULE_ID_TARGET_IF, &mmhMsg);
-#else
- mmhMsg.bodyptr = pDelSta;
-
- mmhMsg.bodyval = 0;
-#endif
- lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT);
- return QDF_STATUS_SUCCESS;
-
}
/*
@@ -3122,163 +3063,6 @@
return eSIR_SUCCESS;
}
-/* Intersects the two input arrays and outputs an array */
-/* For now the array length of uint8_t suffices */
-static void lim_tdls_get_intersection(uint8_t *input_array1,
- uint8_t input1_length,
- uint8_t *input_array2,
- uint8_t input2_length,
- uint8_t *output_array,
- uint8_t *output_length)
-{
- uint8_t i, j, k = 0, flag = 0;
- for (i = 0; i < input1_length; i++) {
- flag = 0;
- for (j = 0; j < input2_length; j++) {
- if (input_array1[i] == input_array2[j]) {
- flag = 1;
- break;
- }
- }
- if (flag == 1) {
- output_array[k] = input_array1[i];
- k++;
- }
- }
- *output_length = k;
-}
-
-/**
- * lim_process_sme_tdls_link_establish_req() - process tdls link establishment
- * request
- *
- * @mac_ctx - global MAC context
- * @msg_buf - message buffer from SME
- *
- * Process Link Establishment Request from SME
- *
- * Return: eSIR_SUCCESS on success, failure code otherwise.
- */
-tSirRetStatus lim_process_sme_tdls_link_establish_req(tpAniSirGlobal mac_ctx,
- uint32_t *msg_buf)
-{
- /* get all discovery request parameters */
- tSirTdlsLinkEstablishReq *tdls_req =
- (tSirTdlsLinkEstablishReq *) msg_buf;
- tpPESession session_entry;
- uint8_t session_id;
- tpTdlsLinkEstablishParams tdls_req_params;
- struct scheduler_msg msg = {0};
- uint16_t peer_idx = 0;
- tpDphHashNode stads = NULL;
- uint32_t self_num_chan = WNI_CFG_VALID_CHANNEL_LIST_LEN;
- uint8_t self_supp_chan[WNI_CFG_VALID_CHANNEL_LIST_LEN];
-
- pe_debug("Process TDLS Link Establishment Request from SME");
-
- session_entry = pe_find_session_by_bssid(mac_ctx, tdls_req->bssid.bytes,
- &session_id);
- if (NULL == session_entry) {
- pe_err("PE Session does not exist for sme session_id: %d",
- tdls_req->sessionId);
- lim_send_sme_tdls_link_establish_req_rsp(mac_ctx,
- tdls_req->sessionId, &tdls_req->peermac, NULL,
- eSIR_FAILURE);
- return eSIR_FAILURE;
- }
-
- /* check if we are in proper state to work as TDLS client */
- if (!LIM_IS_STA_ROLE(session_entry)) {
- pe_err("TDLS Link Establish Request received in wrong system Role: %d",
- GET_LIM_SYSTEM_ROLE(session_entry));
- goto lim_tdls_link_establish_error;
- }
-
- /*
- * if we are still good, go ahead and check if we are in proper state to
- * do TDLS discovery req/rsp/....frames.
- */
- if ((session_entry->limSmeState != eLIM_SME_ASSOCIATED_STATE) &&
- (session_entry->limSmeState != eLIM_SME_LINK_EST_STATE)) {
- pe_err("TDLS Link Establish Request received in invalid LIMsme state: %d",
- session_entry->limSmeState);
- goto lim_tdls_link_establish_error;
- }
-
- stads = dph_lookup_hash_entry(mac_ctx, tdls_req->peermac.bytes,
- &peer_idx,
- &session_entry->dph.dphHashTable);
- if (NULL == stads) {
- pe_err("stads is NULL");
- goto lim_tdls_link_establish_error;
- }
- tdls_req_params = qdf_mem_malloc(sizeof(tTdlsLinkEstablishParams));
- if (NULL == tdls_req_params) {
- pe_err("Unable to allocate memory TDLS Link Establish Request");
- return eSIR_MEM_ALLOC_FAILED;
- }
-
- tdls_req_params->staIdx = stads->staIndex;
- tdls_req_params->isResponder = tdls_req->isResponder;
- tdls_req_params->uapsdQueues = tdls_req->uapsdQueues;
- tdls_req_params->maxSp = tdls_req->maxSp;
- tdls_req_params->isBufsta = tdls_req->isBufSta;
- tdls_req_params->isOffChannelSupported =
- tdls_req->isOffChannelSupported;
-
- if (0 == tdls_req->supportedChannelsLen)
- goto send_tdls_establish_request;
-
- if (wlan_cfg_get_str(mac_ctx, WNI_CFG_VALID_CHANNEL_LIST,
- self_supp_chan,
- &self_num_chan) != eSIR_SUCCESS) {
- /**
- * Could not get Valid channel list from CFG.
- * Log error.
- */
- pe_warn("could not retrieve Valid channel list");
- }
-
- if (self_num_chan > WNI_CFG_VALID_CHANNEL_LIST_LEN) {
- pe_warn("Channel List more than Valid Channel list");
- self_num_chan = WNI_CFG_VALID_CHANNEL_LIST_LEN;
- }
-
- if (tdls_req->supportedChannelsLen > SIR_MAC_MAX_SUPP_CHANNELS) {
- pe_warn("Channel List is more than the supported Channel list");
- tdls_req->supportedChannelsLen = SIR_MAC_MAX_SUPP_CHANNELS;
- }
-
- lim_tdls_get_intersection(self_supp_chan, self_num_chan,
- tdls_req->supportedChannels, tdls_req->supportedChannelsLen,
- tdls_req_params->validChannels,
- &tdls_req_params->validChannelsLen);
-
-send_tdls_establish_request:
- qdf_mem_copy(tdls_req_params->validOperClasses,
- tdls_req->supportedOperClasses,
- tdls_req->supportedOperClassesLen);
- tdls_req_params->validOperClassesLen =
- tdls_req->supportedOperClassesLen;
-
- msg.type = WMA_SET_TDLS_LINK_ESTABLISH_REQ;
- msg.reserved = 0;
- msg.bodyptr = tdls_req_params;
- msg.bodyval = 0;
- if (eSIR_SUCCESS != wma_post_ctrl_msg(mac_ctx, &msg)) {
- pe_err("halPostMsgApi failed");
- goto lim_tdls_link_establish_error;
- }
- return eSIR_SUCCESS;
-
-lim_tdls_link_establish_error:
- lim_send_sme_tdls_link_establish_req_rsp(mac_ctx,
- session_entry->smeSessionId, &tdls_req->peermac, NULL,
- eSIR_FAILURE);
-
- return eSIR_SUCCESS;
-}
-
/**
* lim_check_aid_and_delete_peer() - Funtion to check aid and delete peer
* @p_mac: pointer to mac context
@@ -3341,53 +3125,6 @@
}
}
-#ifndef CONVERGED_TDLS_ENABLE
-/**
- * lim_delete_tdls_peers() - delete tdls peers
- *
- * @mac_ctx - global MAC context
- * @session_entry - PE session entry
- *
- * Delete all the TDLS peer connected before leaving the BSS
- *
- * Return: eSIR_SUCCESS on success, error code otherwise
- */
-tSirRetStatus lim_delete_tdls_peers(tpAniSirGlobal mac_ctx,
- tpPESession session_entry)
-{
- cds_msg_t msg;
- struct sir_tdls_notify_set_state_disable *tdls_state_disable;
-
- pe_debug("Enter");
-
- if (NULL == session_entry) {
- pe_err("NULL session_entry");
- return eSIR_FAILURE;
- }
-
- lim_check_aid_and_delete_peer(mac_ctx, session_entry);
- if (lim_is_roam_synch_in_progress(session_entry))
- return eSIR_SUCCESS;
-
- if (mac_ctx->lim.sme_msg_callback) {
- tdls_state_disable = qdf_mem_malloc(
- sizeof(*tdls_state_disable));
- if (NULL == tdls_state_disable) {
- pe_err("memory allocation failed");
- return eSIR_FAILURE;
- }
- tdls_state_disable->session_id = session_entry->smeSessionId;
- msg.type = eWNI_SME_TDLS_NOTIFY_SET_STATE_DISABLE;
- msg.bodyptr = tdls_state_disable;
- msg.bodyval = 0;
- mac_ctx->lim.sme_msg_callback(mac_ctx, &msg);
- }
-
- lim_send_sme_tdls_delete_all_peer_ind(mac_ctx, session_entry);
- pe_debug("Exit");
- return eSIR_SUCCESS;
-}
-#else
/**
* lim_delete_tdls_peers() - delete tdls peers
*
@@ -3419,7 +3156,6 @@
pe_debug("Exit");
return eSIR_SUCCESS;
}
-#endif
/**
* lim_process_sme_del_all_tdls_peers(): process delete tdls peers
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 7f8da95..1a18b29 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
@@ -62,9 +62,7 @@
#include "wlan_reg_services_api.h"
#include "wlan_utility.h"
-#ifdef CONVERGED_TDLS_ENABLE
#include "wlan_tdls_tgt_api.h"
-#endif
#include "lim_process_fils.h"
static void lim_handle_join_rsp_status(tpAniSirGlobal mac_ctx,
@@ -1215,87 +1213,21 @@
lim_send_sme_tdls_del_sta_ind(tpAniSirGlobal pMac, tpDphHashNode pStaDs,
tpPESession psessionEntry, uint16_t reasonCode)
{
- struct scheduler_msg mmhMsg = {0};
- tSirTdlsDelStaInd *pSirTdlsDelStaInd;
+ struct tdls_event_info info;
- pSirTdlsDelStaInd = qdf_mem_malloc(sizeof(tSirTdlsDelStaInd));
- if (NULL == pSirTdlsDelStaInd) {
- pe_err("AllocateMemory failed for eWNI_SME_TDLS_DEL_STA_IND");
- return;
- }
pe_debug("Delete TDLS Peer "MAC_ADDRESS_STR "with reason code: %d",
MAC_ADDR_ARRAY(pStaDs->staAddr), reasonCode);
- /* messageType */
- pSirTdlsDelStaInd->messageType = eWNI_SME_TDLS_DEL_STA_IND;
- pSirTdlsDelStaInd->length = sizeof(tSirTdlsDelStaInd);
+ info.vdev_id = psessionEntry->smeSessionId;
+ qdf_mem_copy(info.peermac.bytes, pStaDs->staAddr, QDF_MAC_ADDR_SIZE);
+ info.message_type = TDLS_PEER_DISCONNECTED;
+ info.peer_reason = TDLS_DISCONNECTED_PEER_DELETE;
- /* sessionId */
- pSirTdlsDelStaInd->sessionId = psessionEntry->smeSessionId;
+ tgt_tdls_event_handler(pMac->psoc, &info);
- /* peerMacAddr */
- qdf_mem_copy(pSirTdlsDelStaInd->peermac.bytes, pStaDs->staAddr,
- QDF_MAC_ADDR_SIZE);
-
- /* staId */
- lim_copy_u16((uint8_t *) (&pSirTdlsDelStaInd->staId),
- (uint16_t) pStaDs->staIndex);
-
- /* reasonCode */
- lim_copy_u16((uint8_t *) (&pSirTdlsDelStaInd->reasonCode), reasonCode);
-
- mmhMsg.type = eWNI_SME_TDLS_DEL_STA_IND;
- mmhMsg.bodyptr = pSirTdlsDelStaInd;
- mmhMsg.bodyval = 0;
-
- lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT);
return;
} /*** end lim_send_sme_tdls_del_sta_ind() ***/
/**
- * lim_send_sme_tdls_delete_all_peer_ind()
- *
- ***FUNCTION:
- * This function is called to send the eWNI_SME_TDLS_DEL_ALL_PEER_IND
- * message to SME.
- *
- ***LOGIC:
- *
- ***ASSUMPTIONS:
- *
- ***NOTE:
- * NA
- *
- * @param pMac - Pointer to global MAC structure
- * @param psessionEntry - Pointer to the session entry
- * @return None
- */
-void
-lim_send_sme_tdls_delete_all_peer_ind(tpAniSirGlobal pMac, tpPESession psessionEntry)
-{
- struct scheduler_msg mmhMsg = {0};
- tSirTdlsDelAllPeerInd *pSirTdlsDelAllPeerInd;
-
- pSirTdlsDelAllPeerInd = qdf_mem_malloc(sizeof(tSirTdlsDelAllPeerInd));
- if (NULL == pSirTdlsDelAllPeerInd) {
- pe_err("AllocateMemory failed for eWNI_SME_TDLS_DEL_ALL_PEER_IND");
- return;
- }
- /* messageType */
- pSirTdlsDelAllPeerInd->messageType = eWNI_SME_TDLS_DEL_ALL_PEER_IND;
- pSirTdlsDelAllPeerInd->length = sizeof(tSirTdlsDelAllPeerInd);
-
- /* sessionId */
- pSirTdlsDelAllPeerInd->sessionId = psessionEntry->smeSessionId;
-
- mmhMsg.type = eWNI_SME_TDLS_DEL_ALL_PEER_IND;
- mmhMsg.bodyptr = pSirTdlsDelAllPeerInd;
- mmhMsg.bodyval = 0;
-
- lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT);
- return;
-} /*** end lim_send_sme_tdls_delete_all_peer_ind() ***/
-
-/**
* lim_send_sme_mgmt_tx_completion()
*
***FUNCTION:
@@ -1342,15 +1274,10 @@
mmhMsg.bodyptr = pSirMgmtTxCompletionInd;
mmhMsg.bodyval = 0;
-#ifdef CONVERGED_TDLS_ENABLE
pSirMgmtTxCompletionInd->psoc = pMac->psoc;
mmhMsg.callback = tgt_tdls_send_mgmt_tx_completion;
scheduler_post_msg(QDF_MODULE_ID_TARGET_IF, &mmhMsg);
return;
-#else
- lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT);
- return;
-#endif
} /*** end lim_send_sme_tdls_delete_all_peer_ind() ***/
void lim_send_sme_tdls_event_notify(tpAniSirGlobal pMac, uint16_t msgType,
diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h
index 6714f5a..c20c903 100644
--- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h
+++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h
@@ -102,9 +102,6 @@
void lim_send_sme_max_assoc_exceeded_ntf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr,
uint8_t smesessionId);
#ifdef FEATURE_WLAN_TDLS
-void lim_send_sme_tdls_link_establish_req_rsp(tpAniSirGlobal pMac, uint8_t sessionId,
- struct qdf_mac_addr *peermac,
- tDphHashNode *pStaDs, uint8_t status);
void lim_send_sme_tdls_event_notify(tpAniSirGlobal pMac, uint16_t msgType,
void *events);
#endif
diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h
index 52ec012..45d6e50 100644
--- a/core/mac/src/pe/lim/lim_types.h
+++ b/core/mac/src/pe/lim/lim_types.h
@@ -554,12 +554,8 @@
uint32_t *pMsgBuf);
tSirRetStatus lim_process_sme_tdls_add_sta_req(tpAniSirGlobal pMac,
uint32_t *pMsgBuf);
-tSirRetStatus lim_process_sme_tdls_link_establish_req(tpAniSirGlobal pMac,
- uint32_t *pMsgBuf);
tSirRetStatus lim_process_sme_tdls_del_sta_req(tpAniSirGlobal pMac,
uint32_t *pMsgBuf);
-void lim_send_sme_tdls_delete_all_peer_ind(tpAniSirGlobal pMac,
- tpPESession psessionEntry);
void lim_send_sme_mgmt_tx_completion(
tpAniSirGlobal pMac,
uint32_t sme_session_id,
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index 9e68303..fd4b1a4 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.h
@@ -679,23 +679,6 @@
bool nRoamScanOffloadEnabled);
bool sme_is_feature_supported_by_fw(enum cap_bitmap feature);
#ifdef FEATURE_WLAN_TDLS
-QDF_STATUS sme_send_tdls_link_establish_params(tHalHandle hHal,
- uint8_t sessionId,
- const tSirMacAddr peerMac,
- tCsrTdlsLinkEstablishParams *
- tdlsLinkEstablishParams);
-QDF_STATUS sme_send_tdls_mgmt_frame(tHalHandle hHal, uint8_t sessionId,
- const tSirMacAddr peerMac, uint8_t frame_type,
- uint8_t dialog, uint16_t status,
- uint32_t peerCapability, uint8_t *buf,
- uint8_t len, uint8_t responder);
-QDF_STATUS sme_change_tdls_peer_sta(tHalHandle hHal, uint8_t sessionId,
- const tSirMacAddr peerMac,
- tCsrStaParams *pstaParams);
-QDF_STATUS sme_add_tdls_peer_sta(tHalHandle hHal, uint8_t sessionId,
- const tSirMacAddr peerMac);
-QDF_STATUS sme_delete_tdls_peer_sta(tHalHandle hHal, uint8_t sessionId,
- const tSirMacAddr peerMac);
void sme_set_tdls_power_save_prohibited(tHalHandle hHal, uint32_t sessionId,
bool val);
QDF_STATUS sme_send_tdls_chan_switch_req(
@@ -1531,8 +1514,6 @@
QDF_STATUS sme_congestion_register_callback(tHalHandle hal,
void (*congestion_cb)(void *, uint32_t congestion, uint32_t vdev_id));
-QDF_STATUS sme_delete_all_tdls_peers(tHalHandle hal, uint8_t session_id);
-
/**
* sme_rso_cmd_status_cb() - Set RSO cmd status callback
* @hal: HAL Handle
diff --git a/core/sme/inc/sme_inside.h b/core/sme/inc/sme_inside.h
index 36eaef9..5480918 100644
--- a/core/sme/inc/sme_inside.h
+++ b/core/sme/inc/sme_inside.h
@@ -245,20 +245,6 @@
bool csr_roamGetConcurrencyConnectStatusForBmps(tpAniSirGlobal pMac);
#ifdef FEATURE_WLAN_TDLS
-QDF_STATUS csr_tdls_send_mgmt_req(tHalHandle hHal, uint8_t sessionId,
- tCsrTdlsSendMgmt * tdlsSendMgmt);
-QDF_STATUS csr_tdls_send_link_establish_params(tHalHandle hHal,
- uint8_t sessionId, const tSirMacAddr peerMac,
- tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams);
-QDF_STATUS csr_tdls_add_peer_sta(tHalHandle hHal, uint8_t sessionId,
- const tSirMacAddr peerMac);
-QDF_STATUS csr_tdls_change_peer_sta(tHalHandle hHal, uint8_t sessionId,
- const tSirMacAddr peerMac,
- tCsrStaParams *pstaParams);
-QDF_STATUS csr_tdls_del_peer_sta(tHalHandle hHal, uint8_t sessionId,
- const tSirMacAddr peerMac);
-QDF_STATUS csr_tdls_process_cmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
-QDF_STATUS csr_tdls_process_link_establish(tpAniSirGlobal pMac, tSmeCmd *cmd);
QDF_STATUS tdls_msg_processor(tpAniSirGlobal pMac, uint16_t msg_type,
void *pMsgBuf);
#endif /* FEATURE_WLAN_TDLS */
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index 9546721..b73c69b 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -553,14 +553,6 @@
status = QDF_STATUS_E_FAILURE;
#endif
break;
-#ifdef FEATURE_WLAN_TDLS
- case eSmeCommandTdlsSendMgmt:
- case eSmeCommandTdlsAddPeer:
- case eSmeCommandTdlsDelPeer:
- case eSmeCommandTdlsLinkEstablish:
- status = csr_tdls_process_cmd(mac_ctx, sme_cmd);
- break;
-#endif
case e_sme_command_set_hw_mode:
csr_process_set_hw_mode(mac_ctx, sme_cmd);
break;
@@ -9017,181 +9009,12 @@
}
#ifdef FEATURE_WLAN_TDLS
+/* ---------------------------------------------------------------------------
+ \fn sme_set_tdls_power_save_prohibited
+ \API to set/reset the is_tdls_power_save_prohibited.
-/*
- * sme_send_tdls_link_establish_params() -
- * API to send TDLS Peer Link Establishment Parameters.
- *
- * peerMac - peer's Mac Adress.
- * tdlsLinkEstablishParams - TDLS Peer Link Establishment Parameters
- * Return QDF_STATUS_SUCCES
- */
-QDF_STATUS sme_send_tdls_link_establish_params(tHalHandle hHal,
- uint8_t sessionId,
- const tSirMacAddr peerMac,
- tCsrTdlsLinkEstablishParams *
- tdlsLinkEstablishParams)
-{
- QDF_STATUS status = QDF_STATUS_SUCCESS;
- tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
-
- MTRACE(qdf_trace(QDF_MODULE_ID_SME,
- TRACE_CODE_SME_RX_HDD_TDLS_LINK_ESTABLISH_PARAM,
- sessionId,
- tdlsLinkEstablishParams->isOffChannelSupported));
- status = sme_acquire_global_lock(&pMac->sme);
-
- if (QDF_IS_STATUS_SUCCESS(status)) {
- status = csr_tdls_send_link_establish_params(hHal, sessionId,
- peerMac, tdlsLinkEstablishParams);
- sme_release_global_lock(&pMac->sme);
- }
- return status;
-}
-
-/*
- * sme_send_tdls_mgmt_frame() -
- * API to send TDLS management frames.
- *
- * peerMac - peer's Mac Adress.
- * frame_type - Type of TDLS mgmt frame to be sent.
- * dialog - dialog token used in the frame.
- * status - status to be incuded in the frame.
- * peerCapability - peer cpabilities
- * buf - additional IEs to be included
- * len - lenght of additional Ies
- * responder - Tdls request type
- * Return QDF_STATUS_SUCCES
- */
-QDF_STATUS sme_send_tdls_mgmt_frame(tHalHandle hHal, uint8_t sessionId,
- const tSirMacAddr peerMac,
- uint8_t frame_type,
- uint8_t dialog, uint16_t statusCode,
- uint32_t peerCapability, uint8_t *buf,
- uint8_t len, uint8_t responder)
-{
- QDF_STATUS status = QDF_STATUS_SUCCESS;
- tCsrTdlsSendMgmt sendTdlsReq = { {0} };
- tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
-
- MTRACE(qdf_trace(QDF_MODULE_ID_SME,
- TRACE_CODE_SME_RX_HDD_TDLS_SEND_MGMT_FRAME,
- sessionId, statusCode));
- status = sme_acquire_global_lock(&pMac->sme);
- if (QDF_IS_STATUS_SUCCESS(status)) {
- qdf_mem_copy(sendTdlsReq.peerMac, peerMac, sizeof(tSirMacAddr));
- sendTdlsReq.frameType = frame_type;
- sendTdlsReq.buf = buf;
- sendTdlsReq.len = len;
- sendTdlsReq.dialog = dialog;
- sendTdlsReq.statusCode = statusCode;
- sendTdlsReq.responder = responder;
- sendTdlsReq.peerCapability = peerCapability;
-
- status = csr_tdls_send_mgmt_req(hHal, sessionId, &sendTdlsReq);
-
- sme_release_global_lock(&pMac->sme);
- }
-
- return status;
-
-}
-
-/*
- * sme_change_tdls_peer_sta() -
- * API to Update TDLS peer sta parameters.
- *
- * peerMac - peer's Mac Adress.
- * staParams - Peer Station Parameters
- * Return QDF_STATUS_SUCCES
- */
-QDF_STATUS sme_change_tdls_peer_sta(tHalHandle hHal, uint8_t sessionId,
- const tSirMacAddr peerMac,
- tCsrStaParams *pstaParams)
-{
- QDF_STATUS status = QDF_STATUS_SUCCESS;
- tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
-
- if (NULL == pstaParams) {
- QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
- "%s :pstaParams is NULL", __func__);
- return QDF_STATUS_E_FAILURE;
- }
- MTRACE(qdf_trace(QDF_MODULE_ID_SME,
- TRACE_CODE_SME_RX_HDD_TDLS_CHANGE_PEER_STA,
- sessionId, pstaParams->capability));
- status = sme_acquire_global_lock(&pMac->sme);
- if (QDF_IS_STATUS_SUCCESS(status)) {
- status = csr_tdls_change_peer_sta(hHal, sessionId, peerMac,
- pstaParams);
-
- sme_release_global_lock(&pMac->sme);
- }
-
- return status;
-
-}
-
-/*
- * sme_add_tdls_peer_sta() -
- * API to Add TDLS peer sta entry.
- *
- * peerMac - peer's Mac Adress.
- * Return QDF_STATUS_SUCCES
- */
-QDF_STATUS sme_add_tdls_peer_sta(tHalHandle hHal, uint8_t sessionId,
- const tSirMacAddr peerMac)
-{
- QDF_STATUS status = QDF_STATUS_SUCCESS;
- tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
-
- MTRACE(qdf_trace(QDF_MODULE_ID_SME,
- TRACE_CODE_SME_RX_HDD_TDLS_ADD_PEER_STA,
- sessionId, 0));
- status = sme_acquire_global_lock(&pMac->sme);
- if (QDF_IS_STATUS_SUCCESS(status)) {
- status = csr_tdls_add_peer_sta(hHal, sessionId, peerMac);
-
- sme_release_global_lock(&pMac->sme);
- }
-
- return status;
-
-}
-
-/*
- * sme_delete_tdls_peer_sta() -
- * API to Delete TDLS peer sta entry.
- *
- * peerMac - peer's Mac Adress.
- * Return QDF_STATUS_SUCCES
- */
-QDF_STATUS sme_delete_tdls_peer_sta(tHalHandle hHal, uint8_t sessionId,
- const tSirMacAddr peerMac)
-{
- QDF_STATUS status = QDF_STATUS_SUCCESS;
- tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
-
- MTRACE(qdf_trace(QDF_MODULE_ID_SME,
- TRACE_CODE_SME_RX_HDD_TDLS_DEL_PEER_STA,
- sessionId, 0));
- status = sme_acquire_global_lock(&pMac->sme);
- if (QDF_IS_STATUS_SUCCESS(status)) {
- status = csr_tdls_del_peer_sta(hHal, sessionId, peerMac);
-
- sme_release_global_lock(&pMac->sme);
- }
-
- return status;
-
-}
-
-/*
- * sme_set_tdls_power_save_prohibited() -
- * API to set/reset the is_tdls_power_save_prohibited.
- *
- * Return void
- */
+ \- return void
+ -------------------------------------------------------------------------*/
void sme_set_tdls_power_save_prohibited(tHalHandle hHal, uint32_t sessionId,
bool val)
{
@@ -16152,46 +15975,6 @@
return status;
}
-/**
- * sme_delete_all_tdls_peers(): send request to delete tdls peers
- * @hal: handler for HAL
- * @session_id: session id
- *
- * This function sends request to lim to delete tdls peers
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS sme_delete_all_tdls_peers(tHalHandle hal, uint8_t session_id)
-{
- struct sir_del_all_tdls_peers *msg;
- QDF_STATUS status = QDF_STATUS_SUCCESS;
- tpAniSirGlobal p_mac = PMAC_STRUCT(hal);
- struct csr_roam_session *session = CSR_GET_SESSION(p_mac, session_id);
-
- msg = qdf_mem_malloc(sizeof(*msg));
- if (NULL == msg) {
- sme_err("memory alloc failed");
- return QDF_STATUS_E_FAILURE;
- }
-
- qdf_mem_zero(msg, sizeof(*msg));
-
- msg->msg_type = eWNI_SME_DEL_ALL_TDLS_PEERS;
- msg->msg_len = (uint16_t) sizeof(*msg);
-
- qdf_mem_copy(msg->bssid.bytes, session->connectedProfile.bssid.bytes,
- sizeof(struct qdf_mac_addr));
-
- status = umac_send_mb_message_to_mac(msg);
-
- if (status != QDF_STATUS_SUCCESS) {
- sme_err("cds_send_mb_message_to_mac Failed");
- status = QDF_STATUS_E_FAILURE;
- }
-
- return status;
-}
-
/* ARP DEBUG STATS */
/**
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 3704ed1..538fd81 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -58,6 +58,7 @@
#include <wlan_logging_sock_svc.h>
#include "wlan_objmgr_psoc_obj.h"
#include <wlan_scan_ucfg_api.h>
+#include <wlan_tdls_tgt_api.h>
#define MAX_PWR_FCC_CHAN_12 8
#define MAX_PWR_FCC_CHAN_13 2
@@ -20531,9 +20532,8 @@
csr_scan_save_roam_offload_ap_to_scan_cache(mac_ctx, roam_synch_data,
bss_desc);
roam_info->sessionId = session_id;
- csr_roam_call_callback(mac_ctx, roam_synch_data->roamedVdevId,
- roam_info, 0, eCSR_ROAM_TDLS_STATUS_UPDATE,
- eCSR_ROAM_RESULT_DELETE_ALL_TDLS_PEER_IND);
+ tgt_tdls_peers_deleted_notification(mac_ctx->psoc, session_id);
+
qdf_mem_copy(&roam_info->bssid.bytes, &bss_desc->bssId,
sizeof(struct qdf_mac_addr));
csr_roam_save_connected_infomation(mac_ctx, session_id,
diff --git a/core/sme/src/csr/csr_tdls_process.c b/core/sme/src/csr/csr_tdls_process.c
index bcf728c..d5af7ac 100644
--- a/core/sme/src/csr/csr_tdls_process.c
+++ b/core/sme/src/csr/csr_tdls_process.c
@@ -43,627 +43,6 @@
#include "csr_internal.h"
/*
- * common routine to remove TDLS cmd from SME command list..
- * commands are removed after getting reponse from PE.
- */
-static QDF_STATUS csr_tdls_remove_sme_cmd(tpAniSirGlobal pMac,
- eSmeCommandType cmdType, uint8_t session_id)
-{
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
- tListElem *pEntry;
- tSmeCmd *pCommand;
-
- pEntry = csr_nonscan_active_ll_peek_head(pMac, LL_ACCESS_LOCK);
- if (pEntry) {
- pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
- if (cmdType == pCommand->command) {
- if (csr_nonscan_active_ll_remove_entry(pMac,
- pEntry, LL_ACCESS_LOCK)) {
- qdf_mem_zero(&pCommand->u.tdlsCmd,
- sizeof(tTdlsCmd));
- csr_release_command(pMac, pCommand);
- status = QDF_STATUS_SUCCESS;
- }
- }
- }
- return status;
-}
-
-/**
- * csr_tdls_send_mgmt_req() - to send a TDLS frame to PE through SME
- * @hHal: HAL context
- * @sessionId: SME session id
- * @tdlsSendMgmt: tdls mgmt pointer
- *
- * TDLS request API, called from HDD to send a TDLS frame in SME/CSR and
- * send message to PE to trigger TDLS discovery procedure.
- */
-QDF_STATUS csr_tdls_send_mgmt_req(tHalHandle hHal, uint8_t sessionId,
- tCsrTdlsSendMgmt *tdlsSendMgmt)
-{
- tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
- tSmeCmd *tdlsSendMgmtCmd;
- tTdlsSendMgmtCmdInfo *tdlsSendMgmtCmdInfo;
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
-
- /* If connected and in Infra. Only then allow this */
- if (!CSR_IS_SESSION_VALID(pMac, sessionId) ||
- !csr_is_conn_state_connected_infra(pMac, sessionId) ||
- (NULL == tdlsSendMgmt))
- return status;
- tdlsSendMgmtCmd = csr_get_command_buffer(pMac);
- if (!tdlsSendMgmtCmd)
- return status;
- tdlsSendMgmtCmdInfo = &tdlsSendMgmtCmd->u.tdlsCmd.u.tdlsSendMgmtCmdInfo;
- tdlsSendMgmtCmd->sessionId = sessionId;
- tdlsSendMgmtCmdInfo->frameType = tdlsSendMgmt->frameType;
- tdlsSendMgmtCmdInfo->dialog = tdlsSendMgmt->dialog;
- tdlsSendMgmtCmdInfo->statusCode = tdlsSendMgmt->statusCode;
- tdlsSendMgmtCmdInfo->responder = tdlsSendMgmt->responder;
- tdlsSendMgmtCmdInfo->peerCapability = tdlsSendMgmt->peerCapability;
- qdf_mem_copy(tdlsSendMgmtCmdInfo->peerMac, tdlsSendMgmt->peerMac,
- sizeof(tSirMacAddr));
-
- if ((0 != tdlsSendMgmt->len) && (NULL != tdlsSendMgmt->buf)) {
- tdlsSendMgmtCmdInfo->buf = qdf_mem_malloc(tdlsSendMgmt->len);
- if (NULL == tdlsSendMgmtCmdInfo->buf) {
- status = QDF_STATUS_E_NOMEM;
- sme_err("Alloc Failed");
- return status;
- }
- qdf_mem_copy(tdlsSendMgmtCmdInfo->buf, tdlsSendMgmt->buf,
- tdlsSendMgmt->len);
- tdlsSendMgmtCmdInfo->len = tdlsSendMgmt->len;
- } else {
- tdlsSendMgmtCmdInfo->buf = NULL;
- tdlsSendMgmtCmdInfo->len = 0;
- }
-
- tdlsSendMgmtCmd->command = eSmeCommandTdlsSendMgmt;
- tdlsSendMgmtCmd->u.tdlsCmd.size = sizeof(tTdlsSendMgmtCmdInfo);
- csr_queue_sme_command(pMac, tdlsSendMgmtCmd, false);
- status = QDF_STATUS_SUCCESS;
-
- return status;
-}
-
-/*
- * TDLS request API, called from HDD to add a TDLS peer
- */
-QDF_STATUS csr_tdls_change_peer_sta(tHalHandle hHal, uint8_t sessionId,
- const tSirMacAddr peerMac,
- tCsrStaParams *pstaParams)
-{
- tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
- tSmeCmd *tdlsAddStaCmd;
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
-
- /* If connected and in Infra. Only then allow this */
- if (CSR_IS_SESSION_VALID(pMac, sessionId) &&
- csr_is_conn_state_connected_infra(pMac, sessionId) &&
- (NULL != peerMac) && (NULL != pstaParams)) {
-
- tdlsAddStaCmd = csr_get_command_buffer(pMac);
-
- if (tdlsAddStaCmd) {
- tTdlsAddStaCmdInfo *tdlsAddStaCmdInfo =
- &tdlsAddStaCmd->u.tdlsCmd.u.tdlsAddStaCmdInfo;
-
- tdlsAddStaCmdInfo->tdlsAddOper = TDLS_OPER_UPDATE;
-
- tdlsAddStaCmd->sessionId = sessionId;
-
- qdf_mem_copy(tdlsAddStaCmdInfo->peermac.bytes,
- peerMac, QDF_MAC_ADDR_SIZE);
- tdlsAddStaCmdInfo->capability = pstaParams->capability;
- tdlsAddStaCmdInfo->uapsdQueues =
- pstaParams->uapsd_queues;
- tdlsAddStaCmdInfo->maxSp = pstaParams->max_sp;
- qdf_mem_copy(tdlsAddStaCmdInfo->extnCapability,
- pstaParams->extn_capability,
- sizeof(pstaParams->extn_capability));
-
- tdlsAddStaCmdInfo->htcap_present =
- pstaParams->htcap_present;
- if (pstaParams->htcap_present)
- qdf_mem_copy(&tdlsAddStaCmdInfo->HTCap,
- &pstaParams->HTCap,
- sizeof(pstaParams->HTCap));
- else
- qdf_mem_set(&tdlsAddStaCmdInfo->HTCap,
- sizeof(pstaParams->HTCap), 0);
-
- tdlsAddStaCmdInfo->vhtcap_present =
- pstaParams->vhtcap_present;
- if (pstaParams->vhtcap_present)
- qdf_mem_copy(&tdlsAddStaCmdInfo->VHTCap,
- &pstaParams->VHTCap,
- sizeof(pstaParams->VHTCap));
- else
- qdf_mem_set(&tdlsAddStaCmdInfo->VHTCap,
- sizeof(pstaParams->VHTCap), 0);
-
- tdlsAddStaCmdInfo->supportedRatesLen =
- pstaParams->supported_rates_len;
-
- if (0 != pstaParams->supported_rates_len)
- qdf_mem_copy(&tdlsAddStaCmdInfo->supportedRates,
- pstaParams->supported_rates,
- pstaParams->supported_rates_len);
-
- tdlsAddStaCmd->command = eSmeCommandTdlsAddPeer;
- tdlsAddStaCmd->u.tdlsCmd.size =
- sizeof(tTdlsAddStaCmdInfo);
- csr_queue_sme_command(pMac, tdlsAddStaCmd, false);
- status = QDF_STATUS_SUCCESS;
- }
- }
-
- return status;
-}
-
-/*
- * TDLS request API, called from HDD to Send Link Establishment Parameters
- */
-QDF_STATUS csr_tdls_send_link_establish_params(tHalHandle hHal,
- uint8_t sessionId,
- const tSirMacAddr peerMac,
- tCsrTdlsLinkEstablishParams *
- tdlsLinkEstablishParams)
-{
- tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
- tSmeCmd *tdlsLinkEstablishCmd;
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
- /* If connected and in Infra. Only then allow this */
- if (CSR_IS_SESSION_VALID(pMac, sessionId) &&
- csr_is_conn_state_connected_infra(pMac, sessionId) &&
- (NULL != peerMac)) {
- tdlsLinkEstablishCmd = csr_get_command_buffer(pMac);
-
- if (tdlsLinkEstablishCmd) {
- tTdlsLinkEstablishCmdInfo *tdlsLinkEstablishCmdInfo =
- &tdlsLinkEstablishCmd->u.tdlsCmd.u.
- tdlsLinkEstablishCmdInfo;
-
- tdlsLinkEstablishCmd->sessionId = sessionId;
-
- qdf_mem_copy(tdlsLinkEstablishCmdInfo->peermac.bytes,
- peerMac, QDF_MAC_ADDR_SIZE);
- tdlsLinkEstablishCmdInfo->isBufSta =
- tdlsLinkEstablishParams->isBufSta;
- tdlsLinkEstablishCmdInfo->isResponder =
- tdlsLinkEstablishParams->isResponder;
- tdlsLinkEstablishCmdInfo->maxSp =
- tdlsLinkEstablishParams->maxSp;
- tdlsLinkEstablishCmdInfo->uapsdQueues =
- tdlsLinkEstablishParams->uapsdQueues;
- tdlsLinkEstablishCmdInfo->isOffChannelSupported =
- tdlsLinkEstablishParams->isOffChannelSupported;
- qdf_mem_copy(tdlsLinkEstablishCmdInfo->
- supportedChannels,
- tdlsLinkEstablishParams->supportedChannels,
- tdlsLinkEstablishParams->
- supportedChannelsLen);
- tdlsLinkEstablishCmdInfo->supportedChannelsLen =
- tdlsLinkEstablishParams->supportedChannelsLen;
- qdf_mem_copy(tdlsLinkEstablishCmdInfo->
- supportedOperClasses,
- tdlsLinkEstablishParams->
- supportedOperClasses,
- tdlsLinkEstablishParams->
- supportedOperClassesLen);
- tdlsLinkEstablishCmdInfo->supportedOperClassesLen =
- tdlsLinkEstablishParams->supportedOperClassesLen;
- tdlsLinkEstablishCmdInfo->isResponder =
- tdlsLinkEstablishParams->isResponder;
- tdlsLinkEstablishCmdInfo->maxSp =
- tdlsLinkEstablishParams->maxSp;
- tdlsLinkEstablishCmdInfo->uapsdQueues =
- tdlsLinkEstablishParams->uapsdQueues;
- tdlsLinkEstablishCmd->command =
- eSmeCommandTdlsLinkEstablish;
- tdlsLinkEstablishCmd->u.tdlsCmd.size =
- sizeof(tTdlsLinkEstablishCmdInfo);
- csr_queue_sme_command(pMac, tdlsLinkEstablishCmd,
- false);
- status = QDF_STATUS_SUCCESS;
- }
- }
-
- return status;
-}
-
-/*
- * TDLS request API, called from HDD to add a TDLS peer
- */
-QDF_STATUS csr_tdls_add_peer_sta(tHalHandle hHal, uint8_t sessionId,
- const tSirMacAddr peerMac)
-{
- tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
- tSmeCmd *tdlsAddStaCmd;
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
-
- /* If connected and in Infra. Only then allow this */
- if (CSR_IS_SESSION_VALID(pMac, sessionId) &&
- csr_is_conn_state_connected_infra(pMac, sessionId) &&
- (NULL != peerMac)) {
- tdlsAddStaCmd = csr_get_command_buffer(pMac);
-
- if (tdlsAddStaCmd) {
- tTdlsAddStaCmdInfo *tdlsAddStaCmdInfo =
- &tdlsAddStaCmd->u.tdlsCmd.u.tdlsAddStaCmdInfo;
-
- tdlsAddStaCmd->sessionId = sessionId;
- tdlsAddStaCmdInfo->tdlsAddOper = TDLS_OPER_ADD;
-
- qdf_mem_copy(tdlsAddStaCmdInfo->peermac.bytes,
- peerMac, QDF_MAC_ADDR_SIZE);
-
- tdlsAddStaCmd->command = eSmeCommandTdlsAddPeer;
- tdlsAddStaCmd->u.tdlsCmd.size =
- sizeof(tTdlsAddStaCmdInfo);
- csr_queue_sme_command(pMac, tdlsAddStaCmd, false);
- status = QDF_STATUS_SUCCESS;
- }
- }
-
- return status;
-}
-
-/*
- * TDLS request API, called from HDD to delete a TDLS peer
- */
-QDF_STATUS csr_tdls_del_peer_sta(tHalHandle hHal, uint8_t sessionId,
- const tSirMacAddr peerMac)
-{
- tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
- tSmeCmd *tdlsDelStaCmd;
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
-
- /* If connected and in Infra. Only then allow this */
- if (CSR_IS_SESSION_VALID(pMac, sessionId) &&
- csr_is_conn_state_connected_infra(pMac, sessionId) &&
- (NULL != peerMac)) {
- tdlsDelStaCmd = csr_get_command_buffer(pMac);
-
- if (tdlsDelStaCmd) {
- tTdlsDelStaCmdInfo *tdlsDelStaCmdInfo =
- &tdlsDelStaCmd->u.tdlsCmd.u.tdlsDelStaCmdInfo;
-
- tdlsDelStaCmd->sessionId = sessionId;
-
- qdf_mem_copy(tdlsDelStaCmdInfo->peermac.bytes,
- peerMac, QDF_MAC_ADDR_SIZE);
-
- tdlsDelStaCmd->command = eSmeCommandTdlsDelPeer;
- tdlsDelStaCmd->u.tdlsCmd.size =
- sizeof(tTdlsDelStaCmdInfo);
- csr_queue_sme_command(pMac, tdlsDelStaCmd, false);
- status = QDF_STATUS_SUCCESS;
- }
- }
-
- return status;
-}
-
-/*
- * TDLS messages sent to PE .
- */
-static QDF_STATUS tdls_send_message(tpAniSirGlobal pMac, uint16_t msg_type,
- void *msg_data, uint32_t msg_size)
-{
-
- tSirMbMsg *pMsg = (tSirMbMsg *) msg_data;
-
- pMsg->type = msg_type;
- pMsg->msgLen = (uint16_t) (msg_size);
- QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
- ("sending msg = %d"), pMsg->type);
- if (umac_send_mb_message_to_mac(pMsg) != QDF_STATUS_SUCCESS) {
- sme_err("Cannot send message");
- return QDF_STATUS_E_FAILURE;
- }
-
- return QDF_STATUS_SUCCESS;
-}
-
-static QDF_STATUS csr_tdls_process_send_mgmt(tpAniSirGlobal pMac, tSmeCmd *cmd)
-{
- tTdlsSendMgmtCmdInfo *tdlsSendMgmtCmdInfo =
- &cmd->u.tdlsCmd.u.tdlsSendMgmtCmdInfo;
- tSirTdlsSendMgmtReq *tdlsSendMgmtReq = NULL;
- struct csr_roam_session *pSession = CSR_GET_SESSION(pMac,
- cmd->sessionId);
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
-
- if (NULL == pSession) {
- sme_err("pSession is NULL");
- return QDF_STATUS_E_FAILURE;
- }
- if (NULL == pSession->pConnectBssDesc) {
- sme_err("BSS Description is not present");
- return QDF_STATUS_E_FAILURE;
- }
-
- tdlsSendMgmtReq =
- qdf_mem_malloc(sizeof(tSirTdlsSendMgmtReq) +
- tdlsSendMgmtCmdInfo->len);
- if (NULL == tdlsSendMgmtReq)
- status = QDF_STATUS_E_NOMEM;
- else
- status = QDF_STATUS_SUCCESS;
-
- if (!QDF_IS_STATUS_SUCCESS(status)) {
- sme_err("alloc failed");
- return status;
- }
- tdlsSendMgmtReq->sessionId = cmd->sessionId;
- /* Using dialog as transactionId. This can be used to match
- * response with request
- */
- tdlsSendMgmtReq->transactionId = tdlsSendMgmtCmdInfo->dialog;
- tdlsSendMgmtReq->reqType = tdlsSendMgmtCmdInfo->frameType;
- tdlsSendMgmtReq->dialog = tdlsSendMgmtCmdInfo->dialog;
- tdlsSendMgmtReq->statusCode = tdlsSendMgmtCmdInfo->statusCode;
- tdlsSendMgmtReq->responder = tdlsSendMgmtCmdInfo->responder;
- tdlsSendMgmtReq->peerCapability = tdlsSendMgmtCmdInfo->peerCapability;
-
- qdf_mem_copy(tdlsSendMgmtReq->bssid.bytes,
- pSession->pConnectBssDesc->bssId, QDF_MAC_ADDR_SIZE);
-
- qdf_mem_copy(tdlsSendMgmtReq->peer_mac.bytes,
- tdlsSendMgmtCmdInfo->peerMac, QDF_MAC_ADDR_SIZE);
-
- if (tdlsSendMgmtCmdInfo->len && tdlsSendMgmtCmdInfo->buf) {
- qdf_mem_copy(tdlsSendMgmtReq->addIe, tdlsSendMgmtCmdInfo->buf,
- tdlsSendMgmtCmdInfo->len);
-
- }
- /* Send the request to PE. */
- sme_debug("sending TDLS Mgmt Frame req to PE");
- status = tdls_send_message(pMac, eWNI_SME_TDLS_SEND_MGMT_REQ,
- (void *)tdlsSendMgmtReq,
- sizeof(tSirTdlsSendMgmtReq) +
- tdlsSendMgmtCmdInfo->len);
- if (!QDF_IS_STATUS_SUCCESS(status))
- sme_err("Failed to send request to MAC");
-
- if (tdlsSendMgmtCmdInfo->len && tdlsSendMgmtCmdInfo->buf) {
- /* Done with the buf. Free it. */
- qdf_mem_free(tdlsSendMgmtCmdInfo->buf);
- tdlsSendMgmtCmdInfo->buf = NULL;
- tdlsSendMgmtCmdInfo->len = 0;
- }
-
- return status;
-}
-
-static QDF_STATUS csr_tdls_process_add_sta(tpAniSirGlobal pMac, tSmeCmd *cmd)
-{
- tTdlsAddStaCmdInfo *tdlsAddStaCmdInfo =
- &cmd->u.tdlsCmd.u.tdlsAddStaCmdInfo;
- tSirTdlsAddStaReq *tdlsAddStaReq = NULL;
- struct csr_roam_session *pSession = CSR_GET_SESSION(pMac,
- cmd->sessionId);
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
-
- if (NULL == pSession) {
- sme_err("pSession is NULL");
- return QDF_STATUS_E_FAILURE;
- }
-
- if (NULL == pSession->pConnectBssDesc) {
- sme_err("BSS description is not present");
- return QDF_STATUS_E_FAILURE;
- }
-
- tdlsAddStaReq = qdf_mem_malloc(sizeof(tSirTdlsAddStaReq));
- if (NULL == tdlsAddStaReq)
- status = QDF_STATUS_E_NOMEM;
- else
- status = QDF_STATUS_SUCCESS;
-
- if (!QDF_IS_STATUS_SUCCESS(status)) {
- sme_err("alloc failed");
- return status;
- }
- tdlsAddStaReq->sessionId = cmd->sessionId;
- tdlsAddStaReq->tdlsAddOper = tdlsAddStaCmdInfo->tdlsAddOper;
- /* Using dialog as transactionId. This can be used to match
- * response with request
- */
- tdlsAddStaReq->transactionId = 0;
-
- qdf_mem_copy(tdlsAddStaReq->bssid.bytes,
- pSession->pConnectBssDesc->bssId, QDF_MAC_ADDR_SIZE);
-
- qdf_copy_macaddr(&tdlsAddStaReq->peermac,
- &tdlsAddStaCmdInfo->peermac);
-
- tdlsAddStaReq->capability = tdlsAddStaCmdInfo->capability;
- tdlsAddStaReq->uapsd_queues = tdlsAddStaCmdInfo->uapsdQueues;
- tdlsAddStaReq->max_sp = tdlsAddStaCmdInfo->maxSp;
-
- qdf_mem_copy(tdlsAddStaReq->extn_capability,
- tdlsAddStaCmdInfo->extnCapability, SIR_MAC_MAX_EXTN_CAP);
- tdlsAddStaReq->htcap_present = tdlsAddStaCmdInfo->htcap_present;
- qdf_mem_copy(&tdlsAddStaReq->htCap,
- &tdlsAddStaCmdInfo->HTCap,
- sizeof(tdlsAddStaCmdInfo->HTCap));
- tdlsAddStaReq->vhtcap_present = tdlsAddStaCmdInfo->vhtcap_present;
- qdf_mem_copy(&tdlsAddStaReq->vhtCap,
- &tdlsAddStaCmdInfo->VHTCap,
- sizeof(tdlsAddStaCmdInfo->VHTCap));
- tdlsAddStaReq->supported_rates_length =
- tdlsAddStaCmdInfo->supportedRatesLen;
- qdf_mem_copy(&tdlsAddStaReq->supported_rates,
- tdlsAddStaCmdInfo->supportedRates,
- tdlsAddStaCmdInfo->supportedRatesLen);
-
- sme_debug("sending TDLS Add Sta req to PE");
- status = tdls_send_message(pMac, eWNI_SME_TDLS_ADD_STA_REQ,
- (void *)tdlsAddStaReq,
- sizeof(tSirTdlsAddStaReq));
- if (!QDF_IS_STATUS_SUCCESS(status))
- sme_err("Failed to send request to MAC");
-
- return status;
-}
-
-static QDF_STATUS csr_tdls_process_del_sta(tpAniSirGlobal pMac,
- tSmeCmd *cmd)
-{
- tTdlsDelStaCmdInfo *tdlsDelStaCmdInfo =
- &cmd->u.tdlsCmd.u.tdlsDelStaCmdInfo;
- tSirTdlsDelStaReq *tdlsDelStaReq = NULL;
- struct csr_roam_session *pSession = CSR_GET_SESSION(pMac,
- cmd->sessionId);
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
-
- if (NULL == pSession) {
- sme_err("pSession is NULL");
- return QDF_STATUS_E_FAILURE;
- }
-
- if (NULL == pSession->pConnectBssDesc) {
- sme_err("BSS description is not present");
- return QDF_STATUS_E_FAILURE;
- }
-
- tdlsDelStaReq = qdf_mem_malloc(sizeof(tSirTdlsDelStaReq));
- if (NULL == tdlsDelStaReq)
- status = QDF_STATUS_E_NOMEM;
- else
- status = QDF_STATUS_SUCCESS;
-
- if (!QDF_IS_STATUS_SUCCESS(status)) {
- sme_err("alloc failed");
- return status;
- }
- tdlsDelStaReq->sessionId = cmd->sessionId;
- /* Using dialog as transactionId. This can be used to match
- * response with request
- */
- tdlsDelStaReq->transactionId = 0;
-
- qdf_mem_copy(tdlsDelStaReq->bssid.bytes,
- pSession->pConnectBssDesc->bssId, QDF_MAC_ADDR_SIZE);
-
- qdf_copy_macaddr(&tdlsDelStaReq->peermac,
- &tdlsDelStaCmdInfo->peermac);
-
- sme_debug("sending TDLS Del Sta " MAC_ADDRESS_STR " req to PE",
- MAC_ADDR_ARRAY(tdlsDelStaCmdInfo->peermac.bytes));
- status = tdls_send_message(pMac, eWNI_SME_TDLS_DEL_STA_REQ,
- (void *)tdlsDelStaReq,
- sizeof(tSirTdlsDelStaReq));
- if (!QDF_IS_STATUS_SUCCESS(status))
- sme_err("Failed to send request to MAC");
-
- return status;
-}
-
-/*
- * commands received from CSR
- */
-QDF_STATUS csr_tdls_process_cmd(tpAniSirGlobal pMac, tSmeCmd *cmd)
-{
- eSmeCommandType cmdType = cmd->command;
- bool status = true;
-
- switch (cmdType) {
- case eSmeCommandTdlsSendMgmt:
- {
- status = csr_tdls_process_send_mgmt(pMac, cmd);
- if (QDF_IS_STATUS_SUCCESS(status))
- status = false;
- }
- break;
- case eSmeCommandTdlsAddPeer:
- {
- status = csr_tdls_process_add_sta(pMac, cmd);
- if (QDF_IS_STATUS_SUCCESS(status))
- status = false;
- }
- break;
- case eSmeCommandTdlsDelPeer:
- {
- status = csr_tdls_process_del_sta(pMac, cmd);
- if (QDF_IS_STATUS_SUCCESS(status))
- status = false;
- }
- break;
- case eSmeCommandTdlsLinkEstablish:
- {
- status = csr_tdls_process_link_establish(pMac, cmd);
- if (QDF_IS_STATUS_SUCCESS(status))
- status = false;
- }
- break;
- default:
- /* TODO: Add defualt handling */
- break;
- }
- return status;
-}
-
-QDF_STATUS csr_tdls_process_link_establish(tpAniSirGlobal pMac, tSmeCmd *cmd)
-{
- tTdlsLinkEstablishCmdInfo *tdlsLinkEstablishCmdInfo =
- &cmd->u.tdlsCmd.u.tdlsLinkEstablishCmdInfo;
- tSirTdlsLinkEstablishReq *tdlsLinkEstablishReq = NULL;
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
- struct csr_roam_session *pSession = CSR_GET_SESSION(pMac,
- cmd->sessionId);
-
- if (NULL == pSession) {
- sme_err("pSession is NULL");
- return QDF_STATUS_E_FAILURE;
- }
-
- tdlsLinkEstablishReq = qdf_mem_malloc(sizeof(tSirTdlsLinkEstablishReq));
-
- if (tdlsLinkEstablishReq == NULL) {
- sme_err("alloc failed");
- return QDF_STATUS_E_NOMEM;
- }
- tdlsLinkEstablishReq->sessionId = cmd->sessionId;
- /* Using dialog as transactionId. This can be used to match
- * response with request
- */
- tdlsLinkEstablishReq->transactionId = 0;
- qdf_copy_macaddr(&tdlsLinkEstablishReq->peermac,
- &tdlsLinkEstablishCmdInfo->peermac);
- qdf_mem_copy(tdlsLinkEstablishReq->bssid.bytes,
- pSession->pConnectBssDesc->bssId, QDF_MAC_ADDR_SIZE);
- qdf_mem_copy(tdlsLinkEstablishReq->supportedChannels,
- tdlsLinkEstablishCmdInfo->supportedChannels,
- tdlsLinkEstablishCmdInfo->supportedChannelsLen);
- tdlsLinkEstablishReq->supportedChannelsLen =
- tdlsLinkEstablishCmdInfo->supportedChannelsLen;
- qdf_mem_copy(tdlsLinkEstablishReq->supportedOperClasses,
- tdlsLinkEstablishCmdInfo->supportedOperClasses,
- tdlsLinkEstablishCmdInfo->supportedOperClassesLen);
- tdlsLinkEstablishReq->supportedOperClassesLen =
- tdlsLinkEstablishCmdInfo->supportedOperClassesLen;
- tdlsLinkEstablishReq->isBufSta = tdlsLinkEstablishCmdInfo->isBufSta;
- tdlsLinkEstablishReq->isResponder =
- tdlsLinkEstablishCmdInfo->isResponder;
- tdlsLinkEstablishReq->uapsdQueues =
- tdlsLinkEstablishCmdInfo->uapsdQueues;
- tdlsLinkEstablishReq->maxSp = tdlsLinkEstablishCmdInfo->maxSp;
-
- sme_debug("sending TDLS Link Establish Request to PE");
- status = tdls_send_message(pMac, eWNI_SME_TDLS_LINK_ESTABLISH_REQ,
- (void *)tdlsLinkEstablishReq,
- sizeof(tSirTdlsLinkEstablishReq));
- if (!QDF_IS_STATUS_SUCCESS(status))
- sme_err("Failed to send request to MAC");
-
- return status;
-}
-
-/*
* TDLS Message processor, will be called after TDLS message recieved from
* PE
*/
@@ -671,17 +50,6 @@
void *pMsgBuf)
{
tCsrRoamInfo *roamInfo;
- eCsrRoamResult roamResult;
- tSirSmeRsp *sme_rsp = pMsgBuf;
- tSirTdlsAddStaRsp *addStaRsp = (tSirTdlsAddStaRsp *) pMsgBuf;
- tSirTdlsDelStaRsp *delStaRsp = (tSirTdlsDelStaRsp *) pMsgBuf;
- tpSirTdlsDelStaInd pSirTdlsDelStaInd = (tpSirTdlsDelStaInd) pMsgBuf;
- tpSirTdlsDelAllPeerInd pSirTdlsDelAllPeerInd =
- (tpSirTdlsDelAllPeerInd) pMsgBuf;
- tpSirMgmtTxCompletionInd tdls_tx_comp_ind =
- (tpSirMgmtTxCompletionInd) pMsgBuf;
- tSirTdlsLinkEstablishReqRsp *linkEstablishReqRsp =
- (tSirTdlsLinkEstablishReqRsp *) pMsgBuf;
tSirTdlsEventnotify *tevent = (tSirTdlsEventnotify *) pMsgBuf;
roamInfo = qdf_mem_malloc(sizeof(*roamInfo));
@@ -690,107 +58,6 @@
return QDF_STATUS_E_FAILURE;
}
switch (msgType) {
- case eWNI_SME_TDLS_SEND_MGMT_RSP:
- {
- tSirSmeRsp *msg = (tSirSmeRsp *) pMsgBuf;
- tCsrRoamInfo roam_info = {0};
-
- /* remove pending eSmeCommandTdlsDiscovery command */
- QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
- FL("sme_rsp->sessionId[%d] eSmeCommandTdlsSendMgmt"),
- sme_rsp->sessionId);
- csr_tdls_remove_sme_cmd(pMac, eSmeCommandTdlsSendMgmt,
- sme_rsp->sessionId);
-
- if (eSIR_SME_SUCCESS != msg->statusCode) {
- /* Tx failed, so there wont be any ack confirmation*/
- /* Indicate ack failure to upper layer */
- roamInfo->reasonCode = 0;
- csr_roam_call_callback(pMac, msg->sessionId,
- &roam_info, 0,
- eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND,
- 0);
- }
- break;
- }
- case eWNI_SME_TDLS_ADD_STA_RSP:
- qdf_copy_macaddr(&roamInfo->peerMac, &addStaRsp->peermac);
- roamInfo->staId = addStaRsp->staId;
- roamInfo->ucastSig = addStaRsp->ucastSig;
- roamInfo->bcastSig = addStaRsp->bcastSig;
- roamInfo->statusCode = addStaRsp->statusCode;
- /*
- * register peer with TL, we have to go through HDD as
- * this is the only way to register any STA with TL.
- */
- if (addStaRsp->tdlsAddOper == TDLS_OPER_ADD)
- roamResult = eCSR_ROAM_RESULT_ADD_TDLS_PEER;
- else /* addStaRsp->tdlsAddOper must be TDLS_OPER_UPDATE */
- roamResult = eCSR_ROAM_RESULT_UPDATE_TDLS_PEER;
- csr_roam_call_callback(pMac, addStaRsp->sessionId,
- roamInfo, 0, eCSR_ROAM_TDLS_STATUS_UPDATE,
- roamResult);
-
- /* remove pending eSmeCommandTdlsDiscovery command */
- csr_tdls_remove_sme_cmd(pMac, eSmeCommandTdlsAddPeer,
- addStaRsp->sessionId);
- break;
- case eWNI_SME_TDLS_DEL_STA_RSP:
- qdf_copy_macaddr(&roamInfo->peerMac, &delStaRsp->peermac);
- roamInfo->staId = delStaRsp->staId;
- roamInfo->statusCode = delStaRsp->statusCode;
- /*
- * register peer with TL, we have to go through HDD as
- * this is the only way to register any STA with TL.
- */
- csr_roam_call_callback(pMac, delStaRsp->sessionId,
- roamInfo, 0,
- eCSR_ROAM_TDLS_STATUS_UPDATE,
- eCSR_ROAM_RESULT_DELETE_TDLS_PEER);
-
- csr_tdls_remove_sme_cmd(pMac, eSmeCommandTdlsDelPeer,
- delStaRsp->sessionId);
- break;
- case eWNI_SME_TDLS_DEL_STA_IND:
- qdf_copy_macaddr(&roamInfo->peerMac,
- &pSirTdlsDelStaInd->peermac);
- roamInfo->staId = pSirTdlsDelStaInd->staId;
- roamInfo->reasonCode = pSirTdlsDelStaInd->reasonCode;
-
- /* Sending the TEARDOWN indication to HDD. */
- csr_roam_call_callback(pMac,
- pSirTdlsDelStaInd->sessionId, roamInfo,
- 0, eCSR_ROAM_TDLS_STATUS_UPDATE,
- eCSR_ROAM_RESULT_TEARDOWN_TDLS_PEER_IND);
- break;
- case eWNI_SME_TDLS_DEL_ALL_PEER_IND:
- /* Sending the TEARDOWN indication to HDD. */
- csr_roam_call_callback(pMac,
- pSirTdlsDelAllPeerInd->sessionId,
- roamInfo, 0,
- eCSR_ROAM_TDLS_STATUS_UPDATE,
- eCSR_ROAM_RESULT_DELETE_ALL_TDLS_PEER_IND);
- break;
- case eWNI_SME_MGMT_FRM_TX_COMPLETION_IND:
- roamInfo->reasonCode =
- tdls_tx_comp_ind->txCompleteStatus;
-
- csr_roam_call_callback(pMac,
- tdls_tx_comp_ind->sessionId,
- roamInfo, 0,
- eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND,
- 0);
- break;
- case eWNI_SME_TDLS_LINK_ESTABLISH_RSP:
- csr_roam_call_callback(pMac,
- linkEstablishReqRsp->sessionId,
- roamInfo, 0,
- eCSR_ROAM_TDLS_STATUS_UPDATE,
- eCSR_ROAM_RESULT_LINK_ESTABLISH_REQ_RSP);
- /* remove pending eSmeCommandTdlsLinkEstablish command */
- csr_tdls_remove_sme_cmd(pMac, eSmeCommandTdlsLinkEstablish,
- linkEstablishReqRsp->sessionId);
- break;
case eWNI_SME_TDLS_SHOULD_DISCOVER:
qdf_copy_macaddr(&roamInfo->peerMac, &tevent->peermac);
roamInfo->reasonCode = tevent->peer_reason;
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index 34e5309..431179e 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -2695,13 +2695,6 @@
wma_handle->ptrn_match_enable_all_vdev =
(cds_cfg->wow_enable & 0x02) ? true : false;
-#if defined(FEATURE_WLAN_TDLS) && !defined(CONVERGED_TDLS_ENABLE)
- wmi_unified_register_event_handler(wma_handle->wmi_handle,
- WMI_TDLS_PEER_EVENTID,
- wma_tdls_event_handler,
- WMA_RX_SERIALIZER_CTX);
-#endif /* FEATURE_WLAN_TDLS */
-
/* register for install key completion event */
wmi_unified_register_event_handler(wma_handle->wmi_handle,
WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID,