From 1024ce0045d1a394825d854b9e486c21c050db71 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Wed, 22 Mar 2017 14:03:47 -0700 Subject: [PATCH] qcacmn: Add NAN changes in target_if and lmac common files 1) Invoke register tx and rx ops APIs for NAN component. 2) Define tx and rx ops in lmac common header. Change-Id: I2b06b31f6e9cd4eec5732567da635b9989cc6dd7 CRs-Fixed: 2014795 --- target_if/core/src/target_if_main.c | 20 +++++++++++++ .../lmac_if/inc/wlan_lmac_if_def.h | 28 +++++++++++++++++++ .../lmac_if/src/wlan_lmac_if.c | 16 +++++++++++ 3 files changed, 64 insertions(+) diff --git a/target_if/core/src/target_if_main.c b/target_if/core/src/target_if_main.c index 8778a765efc3..25f9c172dd12 100644 --- a/target_if/core/src/target_if_main.c +++ b/target_if/core/src/target_if_main.c @@ -37,6 +37,10 @@ #include "target_if_wifi_pos.h" #endif +#ifdef WLAN_FEATURE_NAN_CONVERGENCE +#include "target_if_nan.h" +#endif /* WLAN_FEATURE_NAN_CONVERGENCE */ + static struct target_if_ctx *g_target_if_ctx; struct target_if_ctx *target_if_get_ctx() @@ -117,6 +121,19 @@ static void target_if_wifi_pos_tx_ops_register( } #endif +#ifdef WLAN_FEATURE_NAN_CONVERGENCE +static void target_if_nan_tx_ops_register( + struct wlan_lmac_if_tx_ops *tx_ops) +{ + target_if_nan_register_tx_ops(tx_ops); +} +#else +static void target_if_nan_tx_ops_register( + struct wlan_lmac_if_tx_ops *tx_ops) +{ +} +#endif /* WLAN_FEATURE_NAN_CONVERGENCE */ + static QDF_STATUS target_if_register_umac_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) { @@ -126,6 +143,9 @@ QDF_STATUS target_if_register_umac_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) target_if_atf_tx_ops_register(tx_ops); target_if_wifi_pos_tx_ops_register(tx_ops); + + target_if_nan_tx_ops_register(tx_ops); + /* Converged UMAC components to register their TX-ops here */ return QDF_STATUS_SUCCESS; } diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index d4e0d4d24e8d..e6412bd5ffec 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -330,6 +330,17 @@ struct wlan_lmac_if_wifi_pos_tx_ops { }; #endif +#ifdef WLAN_FEATURE_NAN_CONVERGENCE +/** + * struct wlan_lmac_if_nan_tx_ops - structure of firwware tx function + * pointers for nan component + * @data_req_tx: function pointer to send nan req to firmware + */ +struct wlan_lmac_if_nan_tx_ops { + QDF_STATUS (*nan_req_tx)(struct wlan_objmgr_vdev *vdev, void *req); +}; +#endif + /** * struct wlan_lmac_if_tx_ops - south bound tx function pointers * @mgmt_txrx_tx_ops: mgmt txrx tx ops @@ -360,6 +371,9 @@ struct wlan_lmac_if_tx_ops { #ifdef WIFI_POS_CONVERGED struct wlan_lmac_if_wifi_pos_tx_ops wifi_pos_tx_ops; #endif +#ifdef WLAN_FEATURE_NAN_CONVERGENCE + struct wlan_lmac_if_nan_tx_ops nan_tx_ops; +#endif }; /** @@ -539,6 +553,17 @@ struct wlan_lmac_if_wifi_pos_rx_ops { }; #endif +#ifdef WLAN_FEATURE_NAN_CONVERGENCE +/** + * struct wlan_lmac_if_nan_rx_ops - structure of rx function + * pointers for nan component + * @oem_rsp_event_rx: callback for WMI_OEM_RESPONSE_EVENTID + */ +struct wlan_lmac_if_nan_rx_ops { + int (*nan_event_rx)(struct wlan_objmgr_vdev *vdev, void *ev); +}; +#endif + /** * struct wlan_lmac_if_rx_ops - south bound rx function pointers * @arg1 @@ -567,6 +592,9 @@ struct wlan_lmac_if_rx_ops { #ifdef WIFI_POS_CONVERGED struct wlan_lmac_if_wifi_pos_rx_ops wifi_pos_rx_ops; #endif +#ifdef WLAN_FEATURE_NAN_CONVERGENCE + struct wlan_lmac_if_nan_rx_ops nan_rx_ops; +#endif }; /* Function pointer to call legacy tx_ops registration in OL/WMA. diff --git a/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c b/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c index 14ac2a5d4a5d..684804fd4275 100644 --- a/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c +++ b/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c @@ -28,6 +28,9 @@ #ifdef WIFI_POS_CONVERGED #include "target_if_wifi_pos.h" #endif /* WIFI_POS_CONVERGED */ +#ifdef WLAN_FEATURE_NAN_CONVERGENCE +#include "target_if_nan.h" +#endif /* WLAN_FEATURE_NAN_CONVERGENCE */ /* Function pointer for OL/WMA specific UMAC tx_ops * registration. @@ -106,6 +109,17 @@ static void wlan_lmac_if_umac_rx_ops_register_wifi_pos( } #endif /* WIFI_POS_CONVERGED */ +#ifdef WLAN_FEATURE_NAN_CONVERGENCE +static void wlan_lmac_if_register_nan_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops) +{ + target_if_nan_register_rx_ops(rx_ops); +} +#else +static void wlan_lmac_if_register_nan_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops) +{ +} +#endif /* WLAN_FEATURE_NAN_CONVERGENCE */ + /** * wlan_lmac_if_umac_rx_ops_register() - UMAC rx handler register * @rx_ops: Pointer to rx_ops structure to be populated @@ -148,6 +162,8 @@ wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) /* wifi_pos rx ops */ wlan_lmac_if_umac_rx_ops_register_wifi_pos(rx_ops); + wlan_lmac_if_register_nan_rx_ops(rx_ops); + return QDF_STATUS_SUCCESS; }