qcacmn: Componentize and enable conv WIFI POS

Componentize and enable converged WIFI POS

Change-Id: I8e3f745dbb087818c9d411c7a00e1cdb2907d4d3
Cette révision appartient à :
Abhiram Jogadenu
2019-07-12 11:03:04 +05:30
révisé par nshrivas
Parent 316c0fdb45
révision 1c2b583ee2
13 fichiers modifiés avec 99 ajouts et 65 suppressions

Voir le fichier

@@ -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)

Voir le fichier

@@ -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)

Voir le fichier

@@ -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(

Voir le fichier

@@ -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

Voir le fichier

@@ -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(

Voir le fichier

@@ -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

Voir le fichier

@@ -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");

Voir le fichier

@@ -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)
{

Voir le fichier

@@ -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

Voir le fichier

@@ -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);

Voir le fichier

@@ -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;

Voir le fichier

@@ -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,

Voir le fichier

@@ -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