diff --git a/target_if/nan/inc/target_if_nan.h b/target_if/nan/inc/target_if_nan.h index fa96ba83d3ed..2563efae7d0e 100644 --- a/target_if/nan/inc/target_if_nan.h +++ b/target_if/nan/inc/target_if_nan.h @@ -23,4 +23,75 @@ #ifndef _WLAN_NAN_TGT_IF_H_ #define _WLAN_NAN_TGT_IF_H_ +#include "qdf_types.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct wlan_objmgr_psoc; +struct wlan_lmac_if_rx_ops; +struct wlan_lmac_if_tx_ops; +struct wlan_lmac_if_nan_rx_ops; + +/** + * target_if_nan_get_tx_ops() - retrieve the nan tx_ops + * @psoc: psoc context + * + * API to retrieve the nan tx_ops from the psoc context + * + * Return: nan tx_ops pointer + */ +struct wlan_lmac_if_nan_tx_ops *target_if_nan_get_tx_ops( + struct wlan_objmgr_psoc *psoc); + +/** + * target_if_nan_get_rx_ops() - retrieve the nan rx_ops + * @psoc: psoc context + * + * API to retrieve the nan rx_ops from the psoc context + * + * Return: nan rx_ops pointer + */ +struct wlan_lmac_if_nan_rx_ops *target_if_nan_get_rx_ops( + struct wlan_objmgr_psoc *psoc); + +/** + * target_if_nan_register_tx_ops() - registers nan tx ops + * @tx_ops: tx ops + * + * Return: none + */ +void target_if_nan_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops); + +/** + * target_if_nan_register_rx_ops() - registers nan rx ops + * @tx_ops: rx ops + * + * Return: none + */ +void target_if_nan_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops); + +/** + * target_if_nan_register_events() - registers with NDP events + * @psoc: pointer to psoc object + * + * Return: status of operation + */ +QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc); + +/** + * target_if_nan_deregister_events() - registers nan rx ops + * @psoc: pointer to psoc object + * + * Return: status of operation + */ +QDF_STATUS target_if_nan_deregister_events(struct wlan_objmgr_psoc *psoc); + #endif /* _WIFI_POS_TGT_IF_H_ */ diff --git a/target_if/nan/src/target_if_nan.c b/target_if/nan/src/target_if_nan.c index 3e46ca711d4f..cdf51d016940 100644 --- a/target_if/nan/src/target_if_nan.c +++ b/target_if/nan/src/target_if_nan.c @@ -19,3 +19,57 @@ /** * DOC: contains nan target if functions */ + +#include "wlan_nan_api.h" +#include "nan_public_structs.h" +#include "target_if_nan.h" + +static QDF_STATUS target_if_nan_req(void *in_req, uint32_t req_type) +{ + return QDF_STATUS_SUCCESS; +} + +void target_if_nan_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) +{ + tx_ops->nan_tx_ops.nan_req_tx = target_if_nan_req; +} + +void target_if_nan_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops) +{ + /* TBD */ + rx_ops->nan_rx_ops.nan_event_rx = NULL; +} + +inline struct wlan_lmac_if_nan_tx_ops *target_if_nan_get_tx_ops( + struct wlan_objmgr_psoc *psoc) +{ + if (!psoc) { + target_if_err("psoc is null"); + return NULL; + } + + return &psoc->soc_cb.tx_ops.nan_tx_ops; +} + +inline struct wlan_lmac_if_nan_rx_ops *target_if_nan_get_rx_ops( + struct wlan_objmgr_psoc *psoc) +{ + if (!psoc) { + target_if_err("psoc is null"); + return NULL; + } + + return &psoc->soc_cb.rx_ops.nan_rx_ops; +} + +QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc) +{ + /* TBD */ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS target_if_nan_deregister_events(struct wlan_objmgr_psoc *psoc) +{ + /* TBD */ + return QDF_STATUS_SUCCESS; +} diff --git a/umac/nan/core/src/nan_api.c b/umac/nan/core/src/nan_api.c index bc46510d9822..8cca4e9445a7 100644 --- a/umac/nan/core/src/nan_api.c +++ b/umac/nan/core/src/nan_api.c @@ -22,6 +22,7 @@ #include "nan_main_i.h" #include "wlan_nan_api.h" +#include "target_if_nan.h" #include "nan_public_structs.h" #include "wlan_objmgr_cmn.h" #include "wlan_objmgr_global_obj.h" @@ -251,14 +252,20 @@ QDF_STATUS nan_deinit(void) QDF_STATUS nan_psoc_enable(struct wlan_objmgr_psoc *psoc) { - /* TBD */ + QDF_STATUS status = target_if_nan_register_events(psoc); + + if (QDF_IS_STATUS_ERROR(status)) + nan_err("target_if_nan_register_events failed"); return QDF_STATUS_SUCCESS; } QDF_STATUS nan_psoc_disable(struct wlan_objmgr_psoc *psoc) { - /* TBD */ + QDF_STATUS status = target_if_nan_deregister_events(psoc); + + if (QDF_IS_STATUS_ERROR(status)) + nan_err("target_if_nan_deregister_events failed"); return QDF_STATUS_SUCCESS; }