qcacmn: Introduce new versions of TDLS peer callbacks
The parameters to function typedef tdls_register_tl_peer_callback()
currently includes ucastsig. This "unicast signature" parameter dates
back to a previous version of the driver that used signatures to
synchronize the data plane with the control plane. However the current
version of the driver does not use this mechanism, so there is a
desire to remove this parameter from the callback.
In addition both typedef tdls_register_tl_peer_callback() and typedef
tdls_deregister_tl_peer_callback() suffer from poor naming since the
"_tl_" in the names refers to a datapath component that was present in
an older version of the driver but which is no longer present.
Therefore introduce a new version of these typedefs with better naming
and which removes the ucastsig parameter.
Use temporary conditional compilation to allow support for both the
old and new interfaces until such time as all registrants have
converted to the new interfaces. This is part of the plan to
completely remove the obsolete unicast and broadcast signatures from
throughout the driver.
Change-Id: Id4ea23266b0f3e1480b645c5afce6c17585ccb46
CRs-Fixed: 2200931
diff --git a/core/src/wlan_tdls_cmds_process.c b/core/src/wlan_tdls_cmds_process.c
index f8622a8..06f6813 100644
--- a/core/src/wlan_tdls_cmds_process.c
+++ b/core/src/wlan_tdls_cmds_process.c
@@ -1501,6 +1501,19 @@
id = wlan_vdev_get_id(vdev);
+#ifdef USE_NEW_TDLS_PEER_CALLBACKS
+ if (TDLS_IS_LINK_CONNECTED(curr_peer)) {
+ soc_obj->tdls_dereg_peer(
+ soc_obj->tdls_peer_context,
+ id, curr_peer->sta_id);
+ tdls_decrement_peer_count(soc_obj);
+ } else if (TDLS_LINK_CONNECTING ==
+ curr_peer->link_status) {
+ soc_obj->tdls_dereg_peer(
+ soc_obj->tdls_peer_context,
+ id, curr_peer->sta_id);
+ }
+#else
if (TDLS_IS_LINK_CONNECTED(curr_peer)) {
soc_obj->tdls_dereg_tl_peer(
soc_obj->tdls_tl_peer_data,
@@ -1512,6 +1525,7 @@
soc_obj->tdls_tl_peer_data,
id, curr_peer->sta_id);
}
+#endif
}
tdls_reset_peer(vdev_obj, macaddr);
conn_rec[sta_idx].sta_id = 0;
@@ -1683,11 +1697,17 @@
TDLS_LINK_SUCCESS);
id = wlan_vdev_get_id(vdev);
+#ifdef USE_NEW_TDLS_PEER_CALLBACKS
+ status = soc_obj->tdls_reg_peer(soc_obj->tdls_peer_context,
+ id, mac, peer->sta_id,
+ peer->qos);
+#else
status = soc_obj->tdls_reg_tl_peer(soc_obj->tdls_tl_peer_data,
id, mac, peer->sta_id,
peer->signature, peer->qos);
+#endif
if (QDF_IS_STATUS_ERROR(status)) {
- tdls_err("TDLS register with TL fail, status %d", status);
+ tdls_err("TDLS register peer fail, status %d", status);
goto error;
}
diff --git a/core/src/wlan_tdls_ct.c b/core/src/wlan_tdls_ct.c
index 2327fc4..d6839a3 100644
--- a/core/src/wlan_tdls_ct.c
+++ b/core/src/wlan_tdls_ct.c
@@ -1274,12 +1274,19 @@
*/
tdls_reset_peer(tdls_vdev, curr_peer->peer_mac.bytes);
+#ifdef USE_NEW_TDLS_PEER_CALLBACKS
+ if (tdls_soc->tdls_dereg_peer)
+ tdls_soc->tdls_dereg_peer(
+ tdls_soc->tdls_peer_context,
+ wlan_vdev_get_id(vdev),
+ curr_peer->sta_id);
+#else
if (tdls_soc->tdls_dereg_tl_peer)
tdls_soc->tdls_dereg_tl_peer(
tdls_soc->tdls_tl_peer_data,
wlan_vdev_get_id(vdev),
curr_peer->sta_id);
-
+#endif
tdls_decrement_peer_count(tdls_soc);
tdls_soc->tdls_conn_info[staidx].sta_id = 0;
tdls_soc->tdls_conn_info[staidx].session_id = 255;
diff --git a/core/src/wlan_tdls_main.h b/core/src/wlan_tdls_main.h
index 0dee99c..14b2b65 100644
--- a/core/src/wlan_tdls_main.h
+++ b/core/src/wlan_tdls_main.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -170,9 +170,15 @@
* @tx_ack_cnf_cb_data: user data to tdls_tx_cnf_cb
* @tdls_event_cb: tdls event callback
* @tdls_evt_cb_data: tdls event user data
+#ifdef USE_NEW_TDLS_PEER_CALLBACKS
+ * @tdls_peer_context: userdata for register/deregister TDLS peer
+ * @tdls_reg_peer: register tdls peer with datapath
+ * @tdls_dereg_peer: deregister tdls peer from datapath
+#else
+ * @tdls_tl_peer_data: userdata for register/deregister TDLS peer
* @tdls_reg_tl_peer: callback to register the TDLS peer with TL
* @tdls_dereg_tl_peer: callback to unregister the TDLS peer
- * @tdls_tl_peer_data: userdata for register/deregister TDLS peer
+#endif
* @tx_q_ack: queue for tx frames waiting for ack
* @tdls_con_cap: tdls concurrency support
* @tdls_send_mgmt_req: store eWNI_SME_TDLS_SEND_MGMT_REQ value
@@ -213,10 +219,16 @@
void *tx_ack_cnf_cb_data;
tdls_evt_callback tdls_event_cb;
void *tdls_evt_cb_data;
+#ifdef USE_NEW_TDLS_PEER_CALLBACKS
+ void *tdls_peer_context;
+ tdls_register_peer_callback tdls_reg_peer;
+ tdls_deregister_peer_callback tdls_dereg_peer;
+#else
+ void *tdls_tl_peer_data;
tdls_register_tl_peer_callback tdls_reg_tl_peer;
tdls_deregister_tl_peer_callback tdls_dereg_tl_peer;
+#endif
tdls_dp_vdev_update_flags_callback tdls_dp_vdev_update;
- void *tdls_tl_peer_data;
qdf_list_t tx_q_ack;
enum tdls_conc_cap tdls_con_cap;
uint16_t tdls_send_mgmt_req;
diff --git a/dispatcher/inc/wlan_tdls_public_structs.h b/dispatcher/inc/wlan_tdls_public_structs.h
index 457a3de..0ada980 100644
--- a/dispatcher/inc/wlan_tdls_public_structs.h
+++ b/dispatcher/inc/wlan_tdls_public_structs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -547,6 +547,22 @@
typedef int (*tdls_tx_ack_cnf_callback)(void *user_data,
struct tdls_tx_cnf *tx_ack_cnf_cb_data);
+#ifdef USE_NEW_TDLS_PEER_CALLBACKS
+
+/* This callback is used to register TDLS peer with the datapath */
+typedef QDF_STATUS (*tdls_register_peer_callback)(void *userdata,
+ uint32_t vdev_id,
+ const uint8_t *mac,
+ uint16_t stat_id,
+ uint8_t qos);
+
+/* This callback is used to deregister TDLS peer from the datapath */
+typedef QDF_STATUS (*tdls_deregister_peer_callback)(void *userdata,
+ uint32_t vdev_id,
+ uint8_t sta_id);
+
+#else
+
/* This callback is used to register TDLS peer with TL */
typedef QDF_STATUS (*tdls_register_tl_peer_callback)(void *userdata,
uint32_t vdev_id,
@@ -560,6 +576,8 @@
uint32_t vdev_id,
uint8_t sta_id);
+#endif
+
/* This callback is used to update datapath vdev flags */
typedef QDF_STATUS
(*tdls_dp_vdev_update_flags_callback)(void *cbk_data,
@@ -580,10 +598,16 @@
* @tdls_evt_cb_data: tdls event data
* @ack_cnf_cb: tdls tx ack callback to indicate the tx status
* @tx_ack_cnf_cb_data: tdls tx ack user data
+#ifdef USE_NEW_TDLS_PEER_CALLBACKS
+ * @tdls_peer_context: userdata for register/deregister TDLS peer
+ * @tdls_reg_peer: register tdls peer with datapath
+ * @tdls_dereg_peer: deregister tdls peer from datapath
+#else
+ * @tdls_tl_peer_data: userdata for register/deregister TDLS peer
* @tdls_reg_tl_peer: tdls register tdls peer
* @tdls_dereg_tl_peer: tdls deregister tdls peer
+#endif
* @tdls_dp_vdev_update: update vdev flags in datapath
- * @tdls_tl_peer_data: userdata for register/deregister TDLS peer
*/
struct tdls_start_params {
struct tdls_user_config config;
@@ -601,10 +625,16 @@
void *tdls_evt_cb_data;
tdls_tx_ack_cnf_callback ack_cnf_cb;
void *tx_ack_cnf_cb_data;
+#ifdef USE_NEW_TDLS_PEER_CALLBACKS
+ void *tdls_peer_context;
+ tdls_register_peer_callback tdls_reg_peer;
+ tdls_deregister_peer_callback tdls_dereg_peer;
+#else
+ void *tdls_tl_peer_data;
tdls_register_tl_peer_callback tdls_reg_tl_peer;
tdls_deregister_tl_peer_callback tdls_dereg_tl_peer;
+#endif
tdls_dp_vdev_update_flags_callback tdls_dp_vdev_update;
- void *tdls_tl_peer_data;
};
/**
diff --git a/dispatcher/src/wlan_tdls_ucfg_api.c b/dispatcher/src/wlan_tdls_ucfg_api.c
index 1bae8eb..f4aecc1 100644
--- a/dispatcher/src/wlan_tdls_ucfg_api.c
+++ b/dispatcher/src/wlan_tdls_ucfg_api.c
@@ -207,10 +207,17 @@
soc_obj->tdls_tx_cnf_cb = req->ack_cnf_cb;
soc_obj->tx_ack_cnf_cb_data = req->tx_ack_cnf_cb_data;
+#ifdef USE_NEW_TDLS_PEER_CALLBACKS
+ /* Save callbacks to register/deregister TDLS sta with TL */
+ soc_obj->tdls_reg_peer = req->tdls_reg_peer;
+ soc_obj->tdls_dereg_peer = req->tdls_dereg_peer;
+ soc_obj->tdls_peer_context = req->tdls_peer_context;
+#else
/* Save callbacks to register/deregister TDLS sta with TL */
soc_obj->tdls_reg_tl_peer = req->tdls_reg_tl_peer;
soc_obj->tdls_dereg_tl_peer = req->tdls_dereg_tl_peer;
soc_obj->tdls_tl_peer_data = req->tdls_tl_peer_data;
+#endif
/* Save legacy PE/WMA commands in TDLS soc object */
soc_obj->tdls_send_mgmt_req = req->tdls_send_mgmt_req;