diff --git a/os_if/linux/wifi_pos/src/os_if_wifi_pos.c b/os_if/linux/wifi_pos/src/os_if_wifi_pos.c index 17762a085a..79f4623897 100644 --- a/os_if/linux/wifi_pos/src/os_if_wifi_pos.c +++ b/os_if/linux/wifi_pos/src/os_if_wifi_pos.c @@ -23,6 +23,7 @@ */ #include "qdf_platform.h" +#include "qdf_module.h" #include "wlan_nlink_srv.h" #include "wlan_ptt_sock_svc.h" #include "wlan_nlink_common.h" @@ -265,6 +266,7 @@ int os_if_wifi_pos_register_nl(void) return nl_srv_register(WLAN_NL_MSG_OEM, os_if_wifi_pos_callback); } #endif /* CNSS_GENL */ +qdf_export_symbol(os_if_wifi_pos_register_nl); #ifdef CNSS_GENL int os_if_wifi_pos_deregister_nl(void) diff --git a/target_if/wifi_pos/inc/target_if_wifi_pos.h b/target_if/wifi_pos/inc/target_if_wifi_pos.h index b1a6b3fd85..093a2211ea 100644 --- a/target_if/wifi_pos/inc/target_if_wifi_pos.h +++ b/target_if/wifi_pos/inc/target_if_wifi_pos.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2017, 2019 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 @@ -35,15 +35,6 @@ struct wlan_lmac_if_rx_ops; #ifdef WIFI_POS_CONVERGED -/** - * target_if_wifi_pos_get_txops: api to get tx ops - * @psoc: pointer to psoc object - * - * Return: tx ops - */ -struct wlan_lmac_if_wifi_pos_tx_ops *target_if_wifi_pos_get_txops( - struct wlan_objmgr_psoc *psoc); - /** * target_if_wifi_pos_get_rxops: api to get rx ops * @psoc: pointer to psoc object @@ -78,21 +69,7 @@ QDF_STATUS target_if_wifi_pos_deregister_events(struct wlan_objmgr_psoc *psoc); */ void target_if_wifi_pos_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops); -/** - * target_if_wifi_pos_register_rx_ops: function to register with lmac rx ops - * @rx_ops: lmac rx ops struct object - * - * Return: none - */ -void target_if_wifi_pos_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops); - #else -static inline struct wlan_lmac_if_wifi_pos_tx_ops *target_if_wifi_pos_get_txops( - struct wlan_objmgr_psoc *psoc) -{ - return NULL; -} - static inline struct wlan_lmac_if_wifi_pos_rx_ops *target_if_wifi_pos_get_rxops( struct wlan_objmgr_psoc *psoc) { @@ -104,10 +81,6 @@ static inline void target_if_wifi_pos_register_tx_ops( { } -static inline void target_if_wifi_pos_register_rx_ops( - struct wlan_lmac_if_rx_ops *rx_ops) -{ -} #endif #if defined(WLAN_FEATURE_CIF_CFR) && defined(WIFI_POS_CONVERGED) diff --git a/target_if/wifi_pos/src/target_if_wifi_pos.c b/target_if/wifi_pos/src/target_if_wifi_pos.c index 01b89b79d0..ec2f507dc1 100644 --- a/target_if/wifi_pos/src/target_if_wifi_pos.c +++ b/target_if/wifi_pos/src/target_if_wifi_pos.c @@ -154,11 +154,12 @@ static int target_if_wifi_pos_oem_rsp_ev_handler(ol_scn_t scn, struct wmi_host_oem_indirect_data *indirect; struct oem_data_rsp oem_rsp = {0}; struct wifi_pos_psoc_priv_obj *priv_obj; - struct wlan_objmgr_psoc *psoc = wifi_pos_get_psoc(); - struct wlan_lmac_if_wifi_pos_rx_ops *wifi_pos_rx_ops = NULL; + struct wlan_objmgr_psoc *psoc; + struct wlan_lmac_if_wifi_pos_rx_ops *wifi_pos_rx_ops; struct wmi_oem_response_param oem_resp_param = {0}; wmi_unified_t wmi_handle; + psoc = target_if_get_psoc_from_scn_hdl(scn); if (!psoc) { target_if_err("psoc is null"); return QDF_STATUS_NOT_INITIALIZED; @@ -270,17 +271,18 @@ static int wifi_pos_oem_err_rpt_ev_handler(ol_scn_t scn, uint8_t *buf, } /** - * wifi_pos_oem_data_req() - start OEM data request to target - * @psoc: the pointer to psoc object manager + * target_if_wifi_pos_oem_data_req() - start OEM data request to target + * @psoc: pointer to psoc object mgr * @req: start request params * * Return: QDF_STATUS */ -static QDF_STATUS wifi_pos_oem_data_req(struct wlan_objmgr_psoc *psoc, - struct oem_data_req *req) +static QDF_STATUS +target_if_wifi_pos_oem_data_req(struct wlan_objmgr_psoc *psoc, + struct oem_data_req *req) { QDF_STATUS status; - wmi_unified_t wmi_hdl = GET_WMI_HDL_FROM_PSOC(psoc); + wmi_unified_t wmi_hdl = get_wmi_unified_hdl_from_psoc(psoc); target_if_debug("Send oem data req to target"); @@ -307,25 +309,11 @@ void target_if_wifi_pos_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) { struct wlan_lmac_if_wifi_pos_tx_ops *wifi_pos_tx_ops; wifi_pos_tx_ops = &tx_ops->wifi_pos_tx_ops; - wifi_pos_tx_ops->data_req_tx = wifi_pos_oem_data_req; -} - -void target_if_wifi_pos_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops) -{ - struct wlan_lmac_if_wifi_pos_rx_ops *wifi_pos_rx_ops; - wifi_pos_rx_ops = &rx_ops->wifi_pos_rx_ops; - wifi_pos_rx_ops->oem_rsp_event_rx = wifi_pos_oem_rsp_handler; -} - -inline struct wlan_lmac_if_wifi_pos_tx_ops *target_if_wifi_pos_get_txops( - struct wlan_objmgr_psoc *psoc) -{ - if (!psoc) { - target_if_err("passed psoc is NULL"); - return NULL; - } - - return &psoc->soc_cb.tx_ops.wifi_pos_tx_ops; + wifi_pos_tx_ops->data_req_tx = target_if_wifi_pos_oem_data_req; + wifi_pos_tx_ops->wifi_pos_register_events = + target_if_wifi_pos_register_events; + wifi_pos_tx_ops->wifi_pos_deregister_events = + target_if_wifi_pos_deregister_events; } inline struct wlan_lmac_if_wifi_pos_rx_ops *target_if_wifi_pos_get_rxops( 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 776854bd54..efd6cf2c94 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 @@ -560,10 +560,14 @@ struct wlan_lmac_if_sptrl_tx_ops { * struct wlan_lmac_if_wifi_pos_tx_ops - structure of firmware tx function * pointers for wifi_pos component * @data_req_tx: function pointer to send wifi_pos req to firmware + * @wifi_pos_register_events: function pointer to register wifi_pos events + * @wifi_pos_deregister_events: function pointer to deregister wifi_pos events */ struct wlan_lmac_if_wifi_pos_tx_ops { QDF_STATUS (*data_req_tx)(struct wlan_objmgr_psoc *psoc, struct oem_data_req *req); + QDF_STATUS (*wifi_pos_register_events)(struct wlan_objmgr_psoc *psoc); + QDF_STATUS (*wifi_pos_deregister_events)(struct wlan_objmgr_psoc *psoc); }; #endif 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 654489eaf2..d5ada6a8b7 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 @@ -73,6 +73,10 @@ #include "wlan_cfr_tgt_api.h" #endif +#ifdef WIFI_POS_CONVERGED +#include "wifi_pos_api.h" +#endif + /* Function pointer for OL/WMA specific UMAC tx_ops * registration. */ @@ -272,7 +276,7 @@ wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) static void wlan_lmac_if_umac_rx_ops_register_wifi_pos( struct wlan_lmac_if_rx_ops *rx_ops) { - target_if_wifi_pos_register_rx_ops(rx_ops); + wifi_pos_register_rx_ops(rx_ops); } #else static void wlan_lmac_if_umac_rx_ops_register_wifi_pos( diff --git a/umac/wifi_pos/inc/wifi_pos_api.h b/umac/wifi_pos/inc/wifi_pos_api.h index 2c23328f28..952056cc22 100644 --- a/umac/wifi_pos/inc/wifi_pos_api.h +++ b/umac/wifi_pos/inc/wifi_pos_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2019 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 @@ -282,6 +282,15 @@ void wifi_pos_set_current_dwell_time_max(struct wlan_objmgr_psoc *psoc, QDF_STATUS wifi_pos_populate_caps(struct wlan_objmgr_psoc *psoc, struct wifi_pos_driver_caps *caps); +struct wlan_lmac_if_rx_ops; +/** + * wifi_pos_register_rx_ops: function to register with lmac rx ops + * @rx_ops: lmac rx ops struct object + * + * Return: None + */ +void wifi_pos_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops); + /** * ucfg_wifi_pos_get_ftm_cap: API to get fine timing measurement caps * @psoc: psoc object diff --git a/umac/wifi_pos/src/wifi_pos_api.c b/umac/wifi_pos/src/wifi_pos_api.c index b465b2a1fc..c421fa38bd 100644 --- a/umac/wifi_pos/src/wifi_pos_api.c +++ b/umac/wifi_pos/src/wifi_pos_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019 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 @@ -91,7 +91,16 @@ QDF_STATUS wifi_pos_deinit(void) QDF_STATUS wifi_pos_psoc_enable(struct wlan_objmgr_psoc *psoc) { - QDF_STATUS status = target_if_wifi_pos_register_events(psoc); + QDF_STATUS status; + struct wlan_lmac_if_wifi_pos_tx_ops *tx_ops; + + tx_ops = wifi_pos_get_tx_ops(psoc); + if (!tx_ops) { + wifi_pos_err("tx_ops is null"); + return QDF_STATUS_E_NULL_VALUE; + } + + status = tx_ops->wifi_pos_register_events(psoc); if (QDF_IS_STATUS_ERROR(status)) wifi_pos_err("target_if_wifi_pos_register_events failed"); @@ -101,7 +110,16 @@ QDF_STATUS wifi_pos_psoc_enable(struct wlan_objmgr_psoc *psoc) QDF_STATUS wifi_pos_psoc_disable(struct wlan_objmgr_psoc *psoc) { - QDF_STATUS status = target_if_wifi_pos_deregister_events(psoc); + QDF_STATUS status; + struct wlan_lmac_if_wifi_pos_tx_ops *tx_ops; + + tx_ops = wifi_pos_get_tx_ops(psoc); + if (!tx_ops) { + wifi_pos_err("tx_ops is null"); + return QDF_STATUS_E_NULL_VALUE; + } + + status = tx_ops->wifi_pos_deregister_events(psoc); if (QDF_IS_STATUS_ERROR(status)) wifi_pos_err("target_if_wifi_pos_deregister_events failed"); diff --git a/umac/wifi_pos/src/wifi_pos_main.c b/umac/wifi_pos/src/wifi_pos_main.c index 7baa5f542a..16d8d85a84 100644 --- a/umac/wifi_pos/src/wifi_pos_main.c +++ b/umac/wifi_pos/src/wifi_pos_main.c @@ -77,6 +77,17 @@ static bool wifi_pos_get_tlv_support(struct wlan_objmgr_psoc *psoc) return true; } +struct wlan_lmac_if_wifi_pos_tx_ops * + wifi_pos_get_tx_ops(struct wlan_objmgr_psoc *psoc) +{ + if (!psoc) { + wifi_pos_err("psoc is null"); + return NULL; + } + + return &psoc->soc_cb.tx_ops.wifi_pos_tx_ops; +} + static QDF_STATUS wifi_pos_process_data_req(struct wlan_objmgr_psoc *psoc, struct wifi_pos_req_msg *req) { @@ -143,7 +154,7 @@ static QDF_STATUS wifi_pos_process_data_req(struct wlan_objmgr_psoc *psoc, * this is legacy MCL operation. pass whole msg to firmware as * it is. */ - tx_ops = target_if_wifi_pos_get_txops(psoc); + tx_ops = wifi_pos_get_tx_ops(psoc); if (!tx_ops) { wifi_pos_err("tx ops null"); return QDF_STATUS_E_INVAL; @@ -629,6 +640,14 @@ int wifi_pos_oem_rsp_handler(struct wlan_objmgr_psoc *psoc, return 0; } +void wifi_pos_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops) +{ + struct wlan_lmac_if_wifi_pos_rx_ops *wifi_pos_rx_ops; + + wifi_pos_rx_ops = &rx_ops->wifi_pos_rx_ops; + wifi_pos_rx_ops->oem_rsp_event_rx = wifi_pos_oem_rsp_handler; +} + static void wifi_pos_pdev_iterator(struct wlan_objmgr_psoc *psoc, void *obj, void *arg) { diff --git a/umac/wifi_pos/src/wifi_pos_main_i.h b/umac/wifi_pos/src/wifi_pos_main_i.h index 1d423103d5..864f709162 100644 --- a/umac/wifi_pos/src/wifi_pos_main_i.h +++ b/umac/wifi_pos/src/wifi_pos_main_i.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2017, 2019 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 @@ -65,4 +65,12 @@ QDF_STATUS wifi_pos_psoc_obj_destroyed_notification( int wifi_pos_oem_rsp_handler(struct wlan_objmgr_psoc *psoc, struct oem_data_rsp *oem_rsp); +/** + * wifi_pos_get_tx_ops: api to get tx ops + * @psoc: pointer to psoc object + * + * Return: tx ops + */ +struct wlan_lmac_if_wifi_pos_tx_ops * + wifi_pos_get_tx_ops(struct wlan_objmgr_psoc *psoc); #endif diff --git a/umac/wifi_pos/src/wifi_pos_utils.c b/umac/wifi_pos/src/wifi_pos_utils.c index ce7a9adac4..d4144d0104 100644 --- a/umac/wifi_pos/src/wifi_pos_utils.c +++ b/umac/wifi_pos/src/wifi_pos_utils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019 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 @@ -59,6 +59,8 @@ struct wlan_objmgr_psoc *wifi_pos_get_psoc(void) return tmp; } +qdf_export_symbol(wifi_pos_get_psoc); + void wifi_pos_set_psoc(struct wlan_objmgr_psoc *psoc) { struct wlan_objmgr_psoc *tmp; @@ -103,3 +105,5 @@ struct wifi_pos_psoc_priv_obj *wifi_pos_get_psoc_priv_obj( return obj; } + +qdf_export_symbol(wifi_pos_get_psoc_priv_obj); diff --git a/umac/wifi_pos/src/wifi_pos_utils_i.h b/umac/wifi_pos/src/wifi_pos_utils_i.h index 5ee0380d26..4c23460b1b 100644 --- a/umac/wifi_pos/src/wifi_pos_utils_i.h +++ b/umac/wifi_pos/src/wifi_pos_utils_i.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2019 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 @@ -30,6 +30,7 @@ #include "qdf_status.h" #include "ol_defines.h" #include "qdf_trace.h" +#include "qdf_module.h" struct wlan_objmgr_psoc; struct wifi_pos_req_msg; diff --git a/utils/nlink/inc/wlan_nlink_common.h b/utils/nlink/inc/wlan_nlink_common.h index 6b43052389..2ca6f2b0fb 100644 --- a/utils/nlink/inc/wlan_nlink_common.h +++ b/utils/nlink/inc/wlan_nlink_common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2019 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 @@ -94,7 +94,7 @@ typedef enum eAniNlModuleTypes { ANI_NL_MSG_PUMAC = ANI_NL_MSG_BASE + 0x01, /* PTT Socket App */ ANI_NL_MSG_PTT = ANI_NL_MSG_BASE + 0x07, /* Quarky GUI */ WLAN_NL_MSG_OEM = ANI_NL_MSG_BASE + 0x09, - WLAN_NL_MSG_SVC, + WLAN_NL_MSG_SVC = ANI_NL_MSG_BASE + 0x0a, WLAN_NL_MSG_CNSS_DIAG = ANI_NL_MSG_BASE + 0x0B, /* Value needs to be 27 */ ANI_NL_MSG_LOG, WLAN_NL_MSG_SPECTRAL_SCAN, diff --git a/utils/nlink/src/wlan_nlink_srv.c b/utils/nlink/src/wlan_nlink_srv.c index 171d599e10..95370a9964 100644 --- a/utils/nlink/src/wlan_nlink_srv.c +++ b/utils/nlink/src/wlan_nlink_srv.c @@ -552,6 +552,8 @@ int nl_srv_register(tWlanNlModTypes msg_type, nl_srv_msg_callback msg_handler) return retcode; } +qdf_export_symbol(nl_srv_register); + /* * Unregister the message handler for a specified module. */ @@ -797,4 +799,6 @@ void nl_srv_ucast_oem(struct sk_buff *skb, int dst_pid, int flag) { nl_srv_ucast(skb, dst_pid, flag); } + +qdf_export_symbol(nl_srv_ucast_oem); #endif