qcacmn: Componentize and enable conv WIFI POS

Componentize and enable converged WIFI POS

Change-Id: I8e3f745dbb087818c9d411c7a00e1cdb2907d4d3
This commit is contained in:
Abhiram Jogadenu
2019-07-12 11:03:04 +05:30
committed by nshrivas
parent 316c0fdb45
commit 1c2b583ee2
13 changed files with 99 additions and 65 deletions

View File

@@ -23,6 +23,7 @@
*/ */
#include "qdf_platform.h" #include "qdf_platform.h"
#include "qdf_module.h"
#include "wlan_nlink_srv.h" #include "wlan_nlink_srv.h"
#include "wlan_ptt_sock_svc.h" #include "wlan_ptt_sock_svc.h"
#include "wlan_nlink_common.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); return nl_srv_register(WLAN_NL_MSG_OEM, os_if_wifi_pos_callback);
} }
#endif /* CNSS_GENL */ #endif /* CNSS_GENL */
qdf_export_symbol(os_if_wifi_pos_register_nl);
#ifdef CNSS_GENL #ifdef CNSS_GENL
int os_if_wifi_pos_deregister_nl(void) int os_if_wifi_pos_deregister_nl(void)

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * 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 #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 * target_if_wifi_pos_get_rxops: api to get rx ops
* @psoc: pointer to psoc object * @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); 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 #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( static inline struct wlan_lmac_if_wifi_pos_rx_ops *target_if_wifi_pos_get_rxops(
struct wlan_objmgr_psoc *psoc) 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 #endif
#if defined(WLAN_FEATURE_CIF_CFR) && defined(WIFI_POS_CONVERGED) #if defined(WLAN_FEATURE_CIF_CFR) && defined(WIFI_POS_CONVERGED)

View File

@@ -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 wmi_host_oem_indirect_data *indirect;
struct oem_data_rsp oem_rsp = {0}; struct oem_data_rsp oem_rsp = {0};
struct wifi_pos_psoc_priv_obj *priv_obj; struct wifi_pos_psoc_priv_obj *priv_obj;
struct wlan_objmgr_psoc *psoc = wifi_pos_get_psoc(); struct wlan_objmgr_psoc *psoc;
struct wlan_lmac_if_wifi_pos_rx_ops *wifi_pos_rx_ops = NULL; struct wlan_lmac_if_wifi_pos_rx_ops *wifi_pos_rx_ops;
struct wmi_oem_response_param oem_resp_param = {0}; struct wmi_oem_response_param oem_resp_param = {0};
wmi_unified_t wmi_handle; wmi_unified_t wmi_handle;
psoc = target_if_get_psoc_from_scn_hdl(scn);
if (!psoc) { if (!psoc) {
target_if_err("psoc is null"); target_if_err("psoc is null");
return QDF_STATUS_NOT_INITIALIZED; 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 * target_if_wifi_pos_oem_data_req() - start OEM data request to target
* @psoc: the pointer to psoc object manager * @psoc: pointer to psoc object mgr
* @req: start request params * @req: start request params
* *
* Return: QDF_STATUS * Return: QDF_STATUS
*/ */
static QDF_STATUS wifi_pos_oem_data_req(struct wlan_objmgr_psoc *psoc, static QDF_STATUS
target_if_wifi_pos_oem_data_req(struct wlan_objmgr_psoc *psoc,
struct oem_data_req *req) struct oem_data_req *req)
{ {
QDF_STATUS status; 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"); 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; 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 = &tx_ops->wifi_pos_tx_ops;
wifi_pos_tx_ops->data_req_tx = wifi_pos_oem_data_req; 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;
void target_if_wifi_pos_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops) wifi_pos_tx_ops->wifi_pos_deregister_events =
{ target_if_wifi_pos_deregister_events;
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;
} }
inline struct wlan_lmac_if_wifi_pos_rx_ops *target_if_wifi_pos_get_rxops( inline struct wlan_lmac_if_wifi_pos_rx_ops *target_if_wifi_pos_get_rxops(

View File

@@ -560,10 +560,14 @@ struct wlan_lmac_if_sptrl_tx_ops {
* struct wlan_lmac_if_wifi_pos_tx_ops - structure of firmware tx function * struct wlan_lmac_if_wifi_pos_tx_ops - structure of firmware tx function
* pointers for wifi_pos component * pointers for wifi_pos component
* @data_req_tx: function pointer to send wifi_pos req to firmware * @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 { struct wlan_lmac_if_wifi_pos_tx_ops {
QDF_STATUS (*data_req_tx)(struct wlan_objmgr_psoc *psoc, QDF_STATUS (*data_req_tx)(struct wlan_objmgr_psoc *psoc,
struct oem_data_req *req); 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 #endif

View File

@@ -73,6 +73,10 @@
#include "wlan_cfr_tgt_api.h" #include "wlan_cfr_tgt_api.h"
#endif #endif
#ifdef WIFI_POS_CONVERGED
#include "wifi_pos_api.h"
#endif
/* Function pointer for OL/WMA specific UMAC tx_ops /* Function pointer for OL/WMA specific UMAC tx_ops
* registration. * 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( static void wlan_lmac_if_umac_rx_ops_register_wifi_pos(
struct wlan_lmac_if_rx_ops *rx_ops) 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 #else
static void wlan_lmac_if_umac_rx_ops_register_wifi_pos( static void wlan_lmac_if_umac_rx_ops_register_wifi_pos(

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * 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, QDF_STATUS wifi_pos_populate_caps(struct wlan_objmgr_psoc *psoc,
struct wifi_pos_driver_caps *caps); 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 * ucfg_wifi_pos_get_ftm_cap: API to get fine timing measurement caps
* @psoc: psoc object * @psoc: psoc object

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * 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 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)) if (QDF_IS_STATUS_ERROR(status))
wifi_pos_err("target_if_wifi_pos_register_events failed"); 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 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)) if (QDF_IS_STATUS_ERROR(status))
wifi_pos_err("target_if_wifi_pos_deregister_events failed"); wifi_pos_err("target_if_wifi_pos_deregister_events failed");

View File

@@ -77,6 +77,17 @@ static bool wifi_pos_get_tlv_support(struct wlan_objmgr_psoc *psoc)
return true; 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, static QDF_STATUS wifi_pos_process_data_req(struct wlan_objmgr_psoc *psoc,
struct wifi_pos_req_msg *req) 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 * this is legacy MCL operation. pass whole msg to firmware as
* it is. * it is.
*/ */
tx_ops = target_if_wifi_pos_get_txops(psoc); tx_ops = wifi_pos_get_tx_ops(psoc);
if (!tx_ops) { if (!tx_ops) {
wifi_pos_err("tx ops null"); wifi_pos_err("tx ops null");
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
@@ -629,6 +640,14 @@ int wifi_pos_oem_rsp_handler(struct wlan_objmgr_psoc *psoc,
return 0; 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, static void wifi_pos_pdev_iterator(struct wlan_objmgr_psoc *psoc,
void *obj, void *arg) void *obj, void *arg)
{ {

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * 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, int wifi_pos_oem_rsp_handler(struct wlan_objmgr_psoc *psoc,
struct oem_data_rsp *oem_rsp); 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 #endif

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * 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; return tmp;
} }
qdf_export_symbol(wifi_pos_get_psoc);
void wifi_pos_set_psoc(struct wlan_objmgr_psoc *psoc) void wifi_pos_set_psoc(struct wlan_objmgr_psoc *psoc)
{ {
struct wlan_objmgr_psoc *tmp; struct wlan_objmgr_psoc *tmp;
@@ -103,3 +105,5 @@ struct wifi_pos_psoc_priv_obj *wifi_pos_get_psoc_priv_obj(
return obj; return obj;
} }
qdf_export_symbol(wifi_pos_get_psoc_priv_obj);

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -30,6 +30,7 @@
#include "qdf_status.h" #include "qdf_status.h"
#include "ol_defines.h" #include "ol_defines.h"
#include "qdf_trace.h" #include "qdf_trace.h"
#include "qdf_module.h"
struct wlan_objmgr_psoc; struct wlan_objmgr_psoc;
struct wifi_pos_req_msg; struct wifi_pos_req_msg;

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * 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_PUMAC = ANI_NL_MSG_BASE + 0x01, /* PTT Socket App */
ANI_NL_MSG_PTT = ANI_NL_MSG_BASE + 0x07, /* Quarky GUI */ ANI_NL_MSG_PTT = ANI_NL_MSG_BASE + 0x07, /* Quarky GUI */
WLAN_NL_MSG_OEM = ANI_NL_MSG_BASE + 0x09, 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 */ WLAN_NL_MSG_CNSS_DIAG = ANI_NL_MSG_BASE + 0x0B, /* Value needs to be 27 */
ANI_NL_MSG_LOG, ANI_NL_MSG_LOG,
WLAN_NL_MSG_SPECTRAL_SCAN, WLAN_NL_MSG_SPECTRAL_SCAN,

View File

@@ -552,6 +552,8 @@ int nl_srv_register(tWlanNlModTypes msg_type, nl_srv_msg_callback msg_handler)
return retcode; return retcode;
} }
qdf_export_symbol(nl_srv_register);
/* /*
* Unregister the message handler for a specified module. * 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); nl_srv_ucast(skb, dst_pid, flag);
} }
qdf_export_symbol(nl_srv_ucast_oem);
#endif #endif