qcacld-3.0: Complete the NAN component movement into CLD

NAN related OS IF, Target IF and component files have been
merged into CLD. Add Makefile changes, include correct
files, replace lmac tx/rx ops with the new ops and call
updated API's such as init/deinit.

Complete the remaining changes for moving NAN component
into CLD.

Change-Id: Idcf8816337aa49b399596ce3cdfc9cdab811d386
CRs-Fixed: 2338060
This commit is contained in:
Nachiket Kukade
2018-11-21 14:42:14 +05:30
committed by nshrivas
parent 3079478a5b
commit 63bb63d833
11 changed files with 206 additions and 129 deletions

18
Kbuild
View File

@@ -1365,19 +1365,19 @@ CP_STATS_OBJS := $(CP_STATS_TGT_SRC)/target_if_mc_cp_stats.o \
endif endif
######################### NAN ######################### ######################### NAN #########################
NAN_CORE_DIR := $(WLAN_COMMON_ROOT)/umac/nan/core/src NAN_CORE_DIR := components/nan/core/src
NAN_CORE_INC := -I$(WLAN_COMMON_INC)/umac/nan/core/inc NAN_CORE_INC := -I$(WLAN_ROOT)/components/nan/core/inc
NAN_UCFG_DIR := $(WLAN_COMMON_ROOT)/umac/nan/dispatcher/src NAN_UCFG_DIR := components/nan/dispatcher/src
NAN_UCFG_INC := -I$(WLAN_COMMON_INC)/umac/nan/dispatcher/inc NAN_UCFG_INC := -I$(WLAN_ROOT)/components/nan/dispatcher/inc
NAN_TGT_DIR := $(WLAN_COMMON_ROOT)/target_if/nan/src NAN_TGT_DIR := components/target_if/nan/src
NAN_TGT_INC := -I$(WLAN_COMMON_INC)/target_if/nan/inc NAN_TGT_INC := -I$(WLAN_ROOT)/components/target_if/nan/inc
NAN_OS_IF_DIR := $(WLAN_COMMON_ROOT)/os_if/linux/nan/src
NAN_OS_IF_INC := -I$(WLAN_COMMON_INC)/os_if/linux/nan/inc NAN_OS_IF_DIR := os_if/nan/src
NAN_OS_IF_INC := -I$(WLAN_ROOT)/os_if/nan/inc
ifeq ($(CONFIG_NAN_CONVERGENCE), y) ifeq ($(CONFIG_NAN_CONVERGENCE), y)
WLAN_NAN_OBJS := $(NAN_CORE_DIR)/nan_main.o \ WLAN_NAN_OBJS := $(NAN_CORE_DIR)/nan_main.o \
$(NAN_CORE_DIR)/nan_api.o \ $(NAN_CORE_DIR)/nan_api.o \
$(NAN_CORE_DIR)/nan_utils.o \
$(NAN_UCFG_DIR)/nan_ucfg_api.o \ $(NAN_UCFG_DIR)/nan_ucfg_api.o \
$(NAN_UCFG_DIR)/cfg_nan.o \ $(NAN_UCFG_DIR)/cfg_nan.o \
$(NAN_TGT_DIR)/target_if_nan.o \ $(NAN_TGT_DIR)/target_if_nan.o \

View File

@@ -26,6 +26,7 @@
#include "qdf_types.h" #include "qdf_types.h"
#include "qdf_status.h" #include "qdf_status.h"
#include "scheduler_api.h"
struct wlan_objmgr_psoc; struct wlan_objmgr_psoc;
struct wlan_objmgr_vdev; struct wlan_objmgr_vdev;
@@ -133,7 +134,6 @@ enum nan_datapath_reason_code {
* @NAN_DATAPATH_RESPONSE_REJECT: ndp request rejected * @NAN_DATAPATH_RESPONSE_REJECT: ndp request rejected
* @NAN_DATAPATH_RESPONSE_DEFER: ndp request deferred until later (response to * @NAN_DATAPATH_RESPONSE_DEFER: ndp request deferred until later (response to
* follow any time later) * follow any time later)
*
*/ */
enum nan_datapath_response_code { enum nan_datapath_response_code {
NAN_DATAPATH_RESPONSE_ACCEPT = 0, NAN_DATAPATH_RESPONSE_ACCEPT = 0,
@@ -145,7 +145,6 @@ enum nan_datapath_response_code {
* enum nan_datapath_accept_policy - nan data path accept policy * enum nan_datapath_accept_policy - nan data path accept policy
* @NAN_DATAPATH_ACCEPT_POLICY_NONE: the framework will decide the policy * @NAN_DATAPATH_ACCEPT_POLICY_NONE: the framework will decide the policy
* @NAN_DATAPATH_ACCEPT_POLICY_ALL: accept policy offloaded to fw * @NAN_DATAPATH_ACCEPT_POLICY_ALL: accept policy offloaded to fw
*
*/ */
enum nan_datapath_accept_policy { enum nan_datapath_accept_policy {
NAN_DATAPATH_ACCEPT_POLICY_NONE = 0, NAN_DATAPATH_ACCEPT_POLICY_NONE = 0,
@@ -156,7 +155,6 @@ enum nan_datapath_accept_policy {
* enum nan_datapath_self_role - nan data path role * enum nan_datapath_self_role - nan data path role
* @NAN_DATAPATH_ROLE_INITIATOR: initiator of nan data path request * @NAN_DATAPATH_ROLE_INITIATOR: initiator of nan data path request
* @NAN_DATAPATH_ROLE_RESPONDER: responder to nan data path request * @NAN_DATAPATH_ROLE_RESPONDER: responder to nan data path request
*
*/ */
enum nan_datapath_self_role { enum nan_datapath_self_role {
NAN_DATAPATH_ROLE_INITIATOR = 0, NAN_DATAPATH_ROLE_INITIATOR = 0,
@@ -168,7 +166,6 @@ enum nan_datapath_self_role {
* @NAN_DATAPATH_END_TYPE_UNSPECIFIED: type is unspecified * @NAN_DATAPATH_END_TYPE_UNSPECIFIED: type is unspecified
* @NAN_DATAPATH_END_TYPE_PEER_UNAVAILABLE: type is peer unavailable * @NAN_DATAPATH_END_TYPE_PEER_UNAVAILABLE: type is peer unavailable
* @NAN_DATAPATH_END_TYPE_OTA_FRAME: NDP end frame received from peer * @NAN_DATAPATH_END_TYPE_OTA_FRAME: NDP end frame received from peer
*
*/ */
enum nan_datapath_end_type { enum nan_datapath_end_type {
NAN_DATAPATH_END_TYPE_UNSPECIFIED = 0x00, NAN_DATAPATH_END_TYPE_UNSPECIFIED = 0x00,
@@ -182,7 +179,6 @@ enum nan_datapath_end_type {
* @NAN_DATAPATH_END_REASON_INACTIVITY: reason is peer inactivity * @NAN_DATAPATH_END_REASON_INACTIVITY: reason is peer inactivity
* @NAN_DATAPATH_END_REASON_PEER_DATA_END: data end indication received from * @NAN_DATAPATH_END_REASON_PEER_DATA_END: data end indication received from
* peer * peer
*
*/ */
enum nan_datapath_end_reason_code { enum nan_datapath_end_reason_code {
NAN_DATAPATH_END_REASON_UNSPECIFIED = 0x00, NAN_DATAPATH_END_REASON_UNSPECIFIED = 0x00,
@@ -190,7 +186,8 @@ enum nan_datapath_end_reason_code {
NAN_DATAPATH_END_REASON_PEER_DATA_END = 0x02, NAN_DATAPATH_END_REASON_PEER_DATA_END = 0x02,
}; };
/** enum nan_datapath_state - NAN datapath states /**
* enum nan_datapath_state - NAN datapath states
* @NAN_DATA_NDI_CREATING_STATE: NDI create is in progress * @NAN_DATA_NDI_CREATING_STATE: NDI create is in progress
* @NAN_DATA_NDI_CREATED_STATE: NDI successfully crated * @NAN_DATA_NDI_CREATED_STATE: NDI successfully crated
* @NAN_DATA_NDI_DELETING_STATE: NDI delete is in progress * @NAN_DATA_NDI_DELETING_STATE: NDI delete is in progress
@@ -220,7 +217,6 @@ enum nan_datapath_state {
* struct nan_datapath_app_info - application info shared during ndp setup * struct nan_datapath_app_info - application info shared during ndp setup
* @ndp_app_info_len: ndp app info length * @ndp_app_info_len: ndp app info length
* @ndp_app_info: variable length application information * @ndp_app_info: variable length application information
*
*/ */
struct nan_datapath_app_info { struct nan_datapath_app_info {
uint32_t ndp_app_info_len; uint32_t ndp_app_info_len;
@@ -231,7 +227,6 @@ struct nan_datapath_app_info {
* struct nan_datapath_cfg - ndp configuration * struct nan_datapath_cfg - ndp configuration
* @ndp_cfg_len: ndp configuration length * @ndp_cfg_len: ndp configuration length
* @ndp_cfg: variable length ndp configuration * @ndp_cfg: variable length ndp configuration
*
*/ */
struct nan_datapath_cfg { struct nan_datapath_cfg {
uint32_t ndp_cfg_len; uint32_t ndp_cfg_len;
@@ -242,7 +237,6 @@ struct nan_datapath_cfg {
* struct nan_datapath_pmk - structure to hold pairwise master key * struct nan_datapath_pmk - structure to hold pairwise master key
* @pmk_len: length of pairwise master key * @pmk_len: length of pairwise master key
* @pmk: buffer containing pairwise master key * @pmk: buffer containing pairwise master key
*
*/ */
struct nan_datapath_pmk { struct nan_datapath_pmk {
uint32_t pmk_len; uint32_t pmk_len;
@@ -253,7 +247,6 @@ struct nan_datapath_pmk {
* struct nan_datapath_scid - structure to hold sceurity context identifier * struct nan_datapath_scid - structure to hold sceurity context identifier
* @scid_len: length of scid * @scid_len: length of scid
* @scid: scid * @scid: scid
*
*/ */
struct nan_datapath_scid { struct nan_datapath_scid {
uint32_t scid_len; uint32_t scid_len;
@@ -264,7 +257,6 @@ struct nan_datapath_scid {
* struct ndp_passphrase - structure to hold passphrase * struct ndp_passphrase - structure to hold passphrase
* @passphrase_len: length of passphrase * @passphrase_len: length of passphrase
* @passphrase: buffer containing passphrase * @passphrase: buffer containing passphrase
*
*/ */
struct ndp_passphrase { struct ndp_passphrase {
uint32_t passphrase_len; uint32_t passphrase_len;
@@ -275,7 +267,6 @@ struct ndp_passphrase {
* struct ndp_service_name - structure to hold service_name * struct ndp_service_name - structure to hold service_name
* @service_name_len: length of service_name * @service_name_len: length of service_name
* @service_name: buffer containing service_name * @service_name: buffer containing service_name
*
*/ */
struct ndp_service_name { struct ndp_service_name {
uint32_t service_name_len; uint32_t service_name_len;
@@ -290,7 +281,6 @@ struct ndp_service_name {
* @type: NDP end indication type * @type: NDP end indication type
* @reason_code: NDP end indication reason code * @reason_code: NDP end indication reason code
* @ndp_instance_id: NDP instance ID * @ndp_instance_id: NDP instance ID
*
*/ */
struct peer_nan_datapath_map { struct peer_nan_datapath_map {
uint32_t vdev_id; uint32_t vdev_id;
@@ -306,7 +296,6 @@ struct peer_nan_datapath_map {
* @channel: channel freq in mhz of the ndp connection * @channel: channel freq in mhz of the ndp connection
* @ch_width: channel width (wmi_channel_width) of the ndp connection * @ch_width: channel width (wmi_channel_width) of the ndp connection
* @nss: nss used for ndp connection * @nss: nss used for ndp connection
*
*/ */
struct nan_datapath_channel_info { struct nan_datapath_channel_info {
uint32_t channel; uint32_t channel;
@@ -321,18 +310,16 @@ struct nan_datapath_channel_info {
* struct nan_datapath_inf_create_req - ndi create request params * struct nan_datapath_inf_create_req - ndi create request params
* @transaction_id: unique identifier * @transaction_id: unique identifier
* @iface_name: interface name * @iface_name: interface name
*
*/ */
struct nan_datapath_inf_create_req { struct nan_datapath_inf_create_req {
uint32_t transaction_id; uint32_t transaction_id;
char iface_name[IFACE_NAME_SIZE]; char iface_name[IFACE_NAME_SIZE];
}; };
/* /**
* struct nan_datapath_inf_create_rsp - ndi create response params * struct nan_datapath_inf_create_rsp - ndi create response params
* @status: request status * @status: request status
* @reason: reason if any * @reason: reason if any
*
*/ */
struct nan_datapath_inf_create_rsp { struct nan_datapath_inf_create_rsp {
uint32_t status; uint32_t status;
@@ -344,7 +331,6 @@ struct nan_datapath_inf_create_rsp {
* struct nan_datapath_inf_delete_rsp - ndi delete response params * struct nan_datapath_inf_delete_rsp - ndi delete response params
* @status: request status * @status: request status
* @reason: reason if any * @reason: reason if any
*
*/ */
struct nan_datapath_inf_delete_rsp { struct nan_datapath_inf_delete_rsp {
uint32_t status; uint32_t status;
@@ -394,7 +380,6 @@ struct nan_datapath_initiator_req {
* @ndp_instance_id: locally created NDP instance ID * @ndp_instance_id: locally created NDP instance ID
* @status: status of the ndp request * @status: status of the ndp request
* @reason: reason for failure if any * @reason: reason for failure if any
*
*/ */
struct nan_datapath_initiator_rsp { struct nan_datapath_initiator_rsp {
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
@@ -423,7 +408,6 @@ struct nan_datapath_initiator_rsp {
* @port: port specified by for this NDP * @port: port specified by for this NDP
* @is_protocol_present: indicates if following protocol is valid * @is_protocol_present: indicates if following protocol is valid
* @protocol: protocol used by this NDP * @protocol: protocol used by this NDP
*
*/ */
struct nan_datapath_responder_req { struct nan_datapath_responder_req {
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
@@ -468,7 +452,6 @@ struct nan_datapath_responder_rsp {
* @transaction_id: unique transaction identifier * @transaction_id: unique transaction identifier
* @num_ndp_instances: number of ndp instances to be terminated * @num_ndp_instances: number of ndp instances to be terminated
* @ndp_ids: array of ndp_instance_id to be terminated * @ndp_ids: array of ndp_instance_id to be terminated
*
*/ */
struct nan_datapath_end_req { struct nan_datapath_end_req {
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
@@ -483,7 +466,6 @@ struct nan_datapath_end_req {
* @transaction_id: unique identifier for the request * @transaction_id: unique identifier for the request
* @status: status of operation * @status: status of operation
* @reason: reason(opaque to host driver) * @reason: reason(opaque to host driver)
*
*/ */
struct nan_datapath_end_rsp_event { struct nan_datapath_end_rsp_event {
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
@@ -498,7 +480,6 @@ struct nan_datapath_end_rsp_event {
* @vdev: pointer to vdev object * @vdev: pointer to vdev object
* @num_ndp_ids: number of NDP ids * @num_ndp_ids: number of NDP ids
* @ndp_map: mapping of NDP instances to peer and vdev * @ndp_map: mapping of NDP instances to peer and vdev
*
*/ */
struct nan_datapath_end_indication_event { struct nan_datapath_end_indication_event {
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
@@ -523,7 +504,6 @@ struct nan_datapath_end_indication_event {
* @port: port specified by for this NDP * @port: port specified by for this NDP
* @is_protocol_present: indicates if following protocol is valid * @is_protocol_present: indicates if following protocol is valid
* @protocol: protocol used by this NDP * @protocol: protocol used by this NDP
*
*/ */
struct nan_datapath_confirm_event { struct nan_datapath_confirm_event {
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
@@ -559,7 +539,6 @@ struct nan_datapath_confirm_event {
* @scid: security context identifier * @scid: security context identifier
* @is_ipv6_addr_present: indicates if following ipv6 address is valid * @is_ipv6_addr_present: indicates if following ipv6 address is valid
* @ipv6_addr: ipv6 address address used by ndp * @ipv6_addr: ipv6 address address used by ndp
*
*/ */
struct nan_datapath_indication_event { struct nan_datapath_indication_event {
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
@@ -597,7 +576,6 @@ struct nan_datapath_peer_ind {
* @num_ndp_instances: num of ndp instances * @num_ndp_instances: num of ndp instances
* @ch: channel info array * @ch: channel info array
* @ndp_instances: array of ndp instances * @ndp_instances: array of ndp instances
*
*/ */
struct nan_datapath_sch_update_event { struct nan_datapath_sch_update_event {
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
@@ -611,7 +589,19 @@ struct nan_datapath_sch_update_event {
/** /**
* struct nan_callbacks - struct containing callback to non-converged driver * struct nan_callbacks - struct containing callback to non-converged driver
* * @os_if_event_handler: OS IF Callback for handling the events
* @ndi_open: HDD callback for creating the NAN Datapath Interface
* @ndi_start: HDD callback for starting the NAN Datapath Interface
* @ndi_close: HDD callback for closing the NAN Datapath Interface
* @ndi_delete: HDD callback for deleting the NAN Datapath Interface
* @drv_ndi_create_rsp_handler: HDD callback for handling NDI interface creation
* @drv_ndi_delete_rsp_handler: HDD callback for handling NDI interface deletion
* @new_peer_ind: HDD callback for handling new NDP peer
* @get_peer_idx: HDD callback for getting NDP peer index
* @add_ndi_peer: LIM callback for adding NDP peer
* @peer_departed_ind: HDD callback for handling departing of NDP peer
* @ndp_delete_peers: LIM callback for deleting NDP peer
* @delete_peers_by_addr: LIM callback for deleting peer by MAC address
*/ */
struct nan_callbacks { struct nan_callbacks {
/* callback to os_if layer from umac */ /* callback to os_if layer from umac */
@@ -635,5 +625,21 @@ struct nan_callbacks {
void (*delete_peers_by_addr)(uint8_t, struct qdf_mac_addr); void (*delete_peers_by_addr)(uint8_t, struct qdf_mac_addr);
}; };
/**
* struct wlan_nan_tx_ops - structure of tx function pointers for nan component
* @nan_req_tx: Message handler for TX operations for the NAN Datapath
*/
struct wlan_nan_tx_ops {
QDF_STATUS (*nan_req_tx)(void *req, uint32_t req_id);
};
/**
* struct wlan_nan_rx_ops - structure of rx function pointers for nan component
* @nan_event_rx: Event handler for RX operations for the NAN Datapath
*/
struct wlan_nan_rx_ops {
QDF_STATUS (*nan_event_rx)(struct scheduler_msg *event);
};
#endif #endif
#endif /* WLAN_FEATURE_NAN_CONVERGENCE */ #endif /* WLAN_FEATURE_NAN_CONVERGENCE */

View File

@@ -22,8 +22,12 @@
#ifndef _WLAN_NAN_API_H_ #ifndef _WLAN_NAN_API_H_
#define _WLAN_NAN_API_H_ #define _WLAN_NAN_API_H_
#ifdef WLAN_FEATURE_NAN_CONVERGENCE
#include "wlan_objmgr_vdev_obj.h"
#include "wlan_objmgr_psoc_obj.h"
#include "qdf_status.h" #include "qdf_status.h"
#include "../src/nan_main_i.h"
struct wlan_objmgr_psoc; struct wlan_objmgr_psoc;
@@ -57,4 +61,115 @@ QDF_STATUS nan_psoc_enable(struct wlan_objmgr_psoc *psoc);
*/ */
QDF_STATUS nan_psoc_disable(struct wlan_objmgr_psoc *psoc); QDF_STATUS nan_psoc_disable(struct wlan_objmgr_psoc *psoc);
#endif /**
* nan_get_vdev_priv_obj: get NAN priv object from vdev object
* @vdev: pointer to vdev object
*
* Return: pointer to NAN vdev private object
*/
static inline
struct nan_vdev_priv_obj *nan_get_vdev_priv_obj(struct wlan_objmgr_vdev *vdev)
{
struct nan_vdev_priv_obj *obj;
if (!vdev) {
nan_err("vdev is null");
return NULL;
}
obj = wlan_objmgr_vdev_get_comp_private_obj(vdev, WLAN_UMAC_COMP_NAN);
return obj;
}
/**
* nan_get_psoc_priv_obj: get NAN priv object from psoc object
* @psoc: pointer to psoc object
*
* Return: pointer to NAN psoc private object
*/
static inline
struct nan_psoc_priv_obj *nan_get_psoc_priv_obj(struct wlan_objmgr_psoc *psoc)
{
struct nan_psoc_priv_obj *obj;
if (!psoc) {
nan_err("psoc is null");
return NULL;
}
obj = wlan_objmgr_psoc_get_comp_private_obj(psoc, WLAN_UMAC_COMP_NAN);
return obj;
}
/**
* nan_psoc_get_tx_ops: get TX ops from the NAN private object
* @psoc: pointer to psoc object
*
* Return: pointer to TX op callback
*/
static inline
struct wlan_nan_tx_ops *nan_psoc_get_tx_ops(struct wlan_objmgr_psoc *psoc)
{
struct nan_psoc_priv_obj *nan_priv;
if (!psoc) {
nan_err("psoc is null");
return NULL;
}
nan_priv = nan_get_psoc_priv_obj(psoc);
if (!nan_priv) {
nan_err("psoc private object is null");
return NULL;
}
return &nan_priv->tx_ops;
}
/**
* nan_psoc_get_rx_ops: get RX ops from the NAN private object
* @psoc: pointer to psoc object
*
* Return: pointer to RX op callback
*/
static inline
struct wlan_nan_rx_ops *nan_psoc_get_rx_ops(struct wlan_objmgr_psoc *psoc)
{
struct nan_psoc_priv_obj *nan_priv;
if (!psoc) {
nan_err("psoc is null");
return NULL;
}
nan_priv = nan_get_psoc_priv_obj(psoc);
if (!nan_priv) {
nan_err("psoc private object is null");
return NULL;
}
return &nan_priv->rx_ops;
}
#else /* WLAN_FEATURE_NAN_CONVERGENCE */
static inline QDF_STATUS nan_init(void)
{
return QDF_STATUS_SUCCESS;
}
static inline QDF_STATUS nan_deinit(void)
{
return QDF_STATUS_SUCCESS;
}
static inline QDF_STATUS nan_psoc_enable(struct wlan_objmgr_psoc *psoc)
{
return QDF_STATUS_SUCCESS;
}
static inline QDF_STATUS nan_psoc_disable(struct wlan_objmgr_psoc *psoc)
{
return QDF_STATUS_SUCCESS;
}
#endif /* WLAN_FEATURE_NAN_CONVERGENCE */
#endif /* _WLAN_NAN_API_H_ */

View File

@@ -105,6 +105,8 @@ static QDF_STATUS nan_psoc_obj_created_notification(
nan_cfg_init(psoc, nan_obj); nan_cfg_init(psoc, nan_obj);
nan_cfg_dp_init(psoc, nan_obj); nan_cfg_dp_init(psoc, nan_obj);
target_if_nan_register_tx_ops(&nan_obj->tx_ops);
target_if_nan_register_rx_ops(&nan_obj->rx_ops);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;

View File

@@ -20,7 +20,6 @@
* DOC: contains core nan function definitions * DOC: contains core nan function definitions
*/ */
#include "nan_main_i.h"
#include "nan_ucfg_api.h" #include "nan_ucfg_api.h"
#include "wlan_nan_api.h" #include "wlan_nan_api.h"
#include "target_if_nan.h" #include "target_if_nan.h"
@@ -32,33 +31,6 @@
#include "wlan_objmgr_pdev_obj.h" #include "wlan_objmgr_pdev_obj.h"
#include "wlan_objmgr_vdev_obj.h" #include "wlan_objmgr_vdev_obj.h"
struct nan_vdev_priv_obj *nan_get_vdev_priv_obj(
struct wlan_objmgr_vdev *vdev)
{
struct nan_vdev_priv_obj *obj;
if (!vdev) {
nan_err("vdev is null");
return NULL;
}
obj = wlan_objmgr_vdev_get_comp_private_obj(vdev, WLAN_UMAC_COMP_NAN);
return obj;
}
struct nan_psoc_priv_obj *nan_get_psoc_priv_obj(
struct wlan_objmgr_psoc *psoc)
{
struct nan_psoc_priv_obj *obj;
if (!psoc) {
nan_err("psoc is null");
return NULL;
}
obj = wlan_objmgr_psoc_get_comp_private_obj(psoc, WLAN_UMAC_COMP_NAN);
return obj;
}
void nan_release_cmd(void *in_req, uint32_t cmdtype) void nan_release_cmd(void *in_req, uint32_t cmdtype)
{ {
@@ -109,7 +81,8 @@ static void nan_req_activated(void *in_req, uint32_t cmdtype)
uint32_t req_type; uint32_t req_type;
struct wlan_objmgr_psoc *psoc; struct wlan_objmgr_psoc *psoc;
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
struct wlan_lmac_if_nan_tx_ops *tx_ops; struct wlan_nan_tx_ops *tx_ops;
struct nan_psoc_priv_obj *psoc_nan_obj;
switch (cmdtype) { switch (cmdtype) {
case WLAN_SER_CMD_NDP_INIT_REQ: { case WLAN_SER_CMD_NDP_INIT_REQ: {
@@ -149,7 +122,13 @@ static void nan_req_activated(void *in_req, uint32_t cmdtype)
return; return;
} }
tx_ops = target_if_nan_get_tx_ops(psoc); psoc_nan_obj = nan_get_psoc_priv_obj(psoc);
if (!psoc_nan_obj) {
nan_err("psoc_nan_obj is null");
return;
}
tx_ops = &psoc_nan_obj->tx_ops;
if (!tx_ops) { if (!tx_ops) {
nan_alert("tx_ops is null"); nan_alert("tx_ops is null");
return; return;

View File

@@ -21,6 +21,7 @@
* used in NAN modules * used in NAN modules
*/ */
#ifdef WLAN_FEATURE_NAN_CONVERGENCE
#ifndef _WLAN_NAN_MAIN_I_H_ #ifndef _WLAN_NAN_MAIN_I_H_
#define _WLAN_NAN_MAIN_I_H_ #define _WLAN_NAN_MAIN_I_H_
@@ -88,6 +89,8 @@ struct nan_psoc_priv_obj {
qdf_spinlock_t lock; qdf_spinlock_t lock;
struct nan_callbacks cb_obj; struct nan_callbacks cb_obj;
struct nan_cfg_params cfg_param; struct nan_cfg_params cfg_param;
struct wlan_nan_tx_ops tx_ops;
struct wlan_nan_rx_ops rx_ops;
}; };
/** /**
@@ -113,22 +116,6 @@ struct nan_vdev_priv_obj {
uint32_t ndi_delete_rsp_status; uint32_t ndi_delete_rsp_status;
}; };
/**
* nan_get_vdev_priv_obj: get NAN priv object from vdev object
* @vdev: pointer to vdev object
*
* Return: pointer to NAN vdev private object
*/
struct nan_vdev_priv_obj *nan_get_vdev_priv_obj(struct wlan_objmgr_vdev *vdev);
/**
* nan_get_psoc_priv_obj: get NAN priv object from psoc object
* @psoc: pointer to psoc object
*
* Return: pointer to NAN psoc private object
*/
struct nan_psoc_priv_obj *nan_get_psoc_priv_obj(struct wlan_objmgr_psoc *psoc);
/** /**
* nan_release_cmd: frees resources for NAN command. * nan_release_cmd: frees resources for NAN command.
* @in_req: pointer to msg buffer to be freed * @in_req: pointer to msg buffer to be freed
@@ -155,4 +142,5 @@ QDF_STATUS nan_scheduled_msg_handler(struct scheduler_msg *msg);
*/ */
QDF_STATUS nan_event_handler(struct scheduler_msg *msg); QDF_STATUS nan_event_handler(struct scheduler_msg *msg);
#endif #endif /* _WLAN_NAN_MAIN_I_H_ */
#endif /* WLAN_FEATURE_NAN_CONVERGENCE */

View File

@@ -22,6 +22,7 @@
#include "nan_ucfg_api.h" #include "nan_ucfg_api.h"
#include "nan_public_structs.h" #include "nan_public_structs.h"
#include "wlan_nan_api.h"
#include "../../core/src/nan_main_i.h" #include "../../core/src/nan_main_i.h"
#include "scheduler_api.h" #include "scheduler_api.h"
#include "wlan_objmgr_psoc_obj.h" #include "wlan_objmgr_psoc_obj.h"

View File

@@ -33,12 +33,9 @@
#include <wlan_objmgr_psoc_obj.h> #include <wlan_objmgr_psoc_obj.h>
#include <wlan_scan_tgt_api.h> #include <wlan_scan_tgt_api.h>
#include <target_if.h> #include <target_if.h>
#include <target_if_scan.h> #include "nan_public_structs.h"
struct wlan_objmgr_psoc; 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 * target_if_nan_get_tx_ops() - retrieve the nan tx_ops
@@ -48,8 +45,7 @@ struct wlan_lmac_if_nan_rx_ops;
* *
* Return: nan tx_ops pointer * Return: nan tx_ops pointer
*/ */
struct wlan_lmac_if_nan_tx_ops *target_if_nan_get_tx_ops( struct wlan_nan_tx_ops *target_if_nan_get_tx_ops(struct wlan_objmgr_psoc *psoc);
struct wlan_objmgr_psoc *psoc);
/** /**
* target_if_nan_get_rx_ops() - retrieve the nan rx_ops * target_if_nan_get_rx_ops() - retrieve the nan rx_ops
@@ -59,8 +55,7 @@ struct wlan_lmac_if_nan_tx_ops *target_if_nan_get_tx_ops(
* *
* Return: nan rx_ops pointer * Return: nan rx_ops pointer
*/ */
struct wlan_lmac_if_nan_rx_ops *target_if_nan_get_rx_ops( struct wlan_nan_rx_ops *target_if_nan_get_rx_ops(struct wlan_objmgr_psoc *psoc);
struct wlan_objmgr_psoc *psoc);
/** /**
* target_if_nan_register_tx_ops() - registers nan tx ops * target_if_nan_register_tx_ops() - registers nan tx ops
@@ -68,7 +63,7 @@ struct wlan_lmac_if_nan_rx_ops *target_if_nan_get_rx_ops(
* *
* Return: none * Return: none
*/ */
void target_if_nan_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops); void target_if_nan_register_tx_ops(struct wlan_nan_tx_ops *tx_ops);
/** /**
* target_if_nan_register_rx_ops() - registers nan rx ops * target_if_nan_register_rx_ops() - registers nan rx ops
@@ -76,7 +71,7 @@ void target_if_nan_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
* *
* Return: none * Return: none
*/ */
void target_if_nan_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops); void target_if_nan_register_rx_ops(struct wlan_nan_rx_ops *rx_ops);
/** /**
* target_if_nan_register_events() - registers with NDP events * target_if_nan_register_events() - registers with NDP events

View File

@@ -20,10 +20,11 @@
* DOC: contains nan target if functions * DOC: contains nan target if functions
*/ */
#include "../../../umac/nan/core/src/nan_main_i.h" #include "../../../nan/core/src/nan_main_i.h"
#include "nan_public_structs.h" #include "nan_public_structs.h"
#include "nan_ucfg_api.h" #include "nan_ucfg_api.h"
#include "target_if_nan.h" #include "target_if_nan.h"
#include "wlan_nan_api.h"
#include "wmi_unified_api.h" #include "wmi_unified_api.h"
#include "scheduler_api.h" #include "scheduler_api.h"
@@ -72,7 +73,7 @@ static QDF_STATUS target_if_nan_event_dispatcher(struct scheduler_msg *msg)
void *ptr = msg->bodyptr; void *ptr = msg->bodyptr;
struct wlan_objmgr_psoc *psoc; struct wlan_objmgr_psoc *psoc;
struct wlan_objmgr_vdev *vdev = NULL; struct wlan_objmgr_vdev *vdev = NULL;
struct wlan_lmac_if_nan_rx_ops *nan_rx_ops; struct wlan_nan_rx_ops *nan_rx_ops;
switch (msg->type) { switch (msg->type) {
case NDP_INITIATOR_RSP: case NDP_INITIATOR_RSP:
@@ -115,7 +116,7 @@ static QDF_STATUS target_if_nan_event_dispatcher(struct scheduler_msg *msg)
goto free_res; goto free_res;
} }
nan_rx_ops = target_if_nan_get_rx_ops(psoc); nan_rx_ops = nan_psoc_get_rx_ops(psoc);
if (!nan_rx_ops) { if (!nan_rx_ops) {
target_if_err("nan_rx_ops is null"); target_if_err("nan_rx_ops is null");
status = QDF_STATUS_E_NULL_VALUE; status = QDF_STATUS_E_NULL_VALUE;
@@ -138,7 +139,7 @@ static QDF_STATUS target_if_nan_ndp_initiator_req(
struct wmi_unified *wmi_handle; struct wmi_unified *wmi_handle;
struct wlan_objmgr_psoc *psoc; struct wlan_objmgr_psoc *psoc;
struct scheduler_msg pe_msg = {0}; struct scheduler_msg pe_msg = {0};
struct wlan_lmac_if_nan_rx_ops *nan_rx_ops; struct wlan_nan_rx_ops *nan_rx_ops;
struct nan_datapath_initiator_rsp ndp_rsp = {0}; struct nan_datapath_initiator_rsp ndp_rsp = {0};
if (!ndp_req) { if (!ndp_req) {
@@ -158,7 +159,7 @@ static QDF_STATUS target_if_nan_ndp_initiator_req(
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
} }
nan_rx_ops = target_if_nan_get_rx_ops(psoc); nan_rx_ops = nan_psoc_get_rx_ops(psoc);
if (!nan_rx_ops) { if (!nan_rx_ops) {
target_if_err("nan_rx_ops is null."); target_if_err("nan_rx_ops is null.");
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
@@ -340,7 +341,7 @@ static QDF_STATUS target_if_nan_ndp_responder_req(
struct wmi_unified *wmi_handle; struct wmi_unified *wmi_handle;
struct wlan_objmgr_psoc *psoc; struct wlan_objmgr_psoc *psoc;
struct scheduler_msg pe_msg = {0}; struct scheduler_msg pe_msg = {0};
struct wlan_lmac_if_nan_rx_ops *nan_rx_ops; struct wlan_nan_rx_ops *nan_rx_ops;
struct nan_datapath_responder_rsp rsp = {0}; struct nan_datapath_responder_rsp rsp = {0};
if (!req) { if (!req) {
@@ -360,7 +361,7 @@ static QDF_STATUS target_if_nan_ndp_responder_req(
return QDF_STATUS_E_NULL_VALUE; return QDF_STATUS_E_NULL_VALUE;
} }
nan_rx_ops = target_if_nan_get_rx_ops(psoc); nan_rx_ops = nan_psoc_get_rx_ops(psoc);
if (!nan_rx_ops) { if (!nan_rx_ops) {
target_if_err("nan_rx_ops is null."); target_if_err("nan_rx_ops is null.");
return QDF_STATUS_E_NULL_VALUE; return QDF_STATUS_E_NULL_VALUE;
@@ -439,7 +440,7 @@ static QDF_STATUS target_if_nan_ndp_end_req(struct nan_datapath_end_req *req)
struct wmi_unified *wmi_handle; struct wmi_unified *wmi_handle;
struct wlan_objmgr_psoc *psoc; struct wlan_objmgr_psoc *psoc;
struct scheduler_msg msg = {0}; struct scheduler_msg msg = {0};
struct wlan_lmac_if_nan_rx_ops *nan_rx_ops; struct wlan_nan_rx_ops *nan_rx_ops;
struct nan_datapath_end_rsp_event end_rsp = {0}; struct nan_datapath_end_rsp_event end_rsp = {0};
if (!req) { if (!req) {
@@ -459,7 +460,7 @@ static QDF_STATUS target_if_nan_ndp_end_req(struct nan_datapath_end_req *req)
return QDF_STATUS_E_NULL_VALUE; return QDF_STATUS_E_NULL_VALUE;
} }
nan_rx_ops = target_if_nan_get_rx_ops(psoc); nan_rx_ops = nan_psoc_get_rx_ops(psoc);
if (!nan_rx_ops) { if (!nan_rx_ops) {
target_if_err("nan_rx_ops is null."); target_if_err("nan_rx_ops is null.");
return QDF_STATUS_E_NULL_VALUE; return QDF_STATUS_E_NULL_VALUE;
@@ -656,36 +657,14 @@ static QDF_STATUS target_if_nan_req(void *req, uint32_t req_type)
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
void target_if_nan_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) void target_if_nan_register_tx_ops(struct wlan_nan_tx_ops *tx_ops)
{ {
tx_ops->nan_tx_ops.nan_req_tx = target_if_nan_req; tx_ops->nan_req_tx = target_if_nan_req;
} }
void target_if_nan_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops) void target_if_nan_register_rx_ops(struct wlan_nan_rx_ops *rx_ops)
{ {
rx_ops->nan_rx_ops.nan_event_rx = nan_event_handler; rx_ops->nan_event_rx = nan_event_handler;
}
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) QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc)

View File

@@ -108,6 +108,7 @@
#include <wlan_hdd_regulatory.h> #include <wlan_hdd_regulatory.h>
#include "wlan_hdd_lpass.h" #include "wlan_hdd_lpass.h"
#include "nan_api.h" #include "nan_api.h"
#include "wlan_nan_api.h"
#include <wlan_hdd_napi.h> #include <wlan_hdd_napi.h>
#include "wlan_hdd_disa.h" #include "wlan_hdd_disa.h"
#include <dispatcher_init_deinit.h> #include <dispatcher_init_deinit.h>
@@ -12905,8 +12906,14 @@ static QDF_STATUS hdd_component_init(void)
if (QDF_IS_STATUS_ERROR(status)) if (QDF_IS_STATUS_ERROR(status))
goto ipa_deinit; goto ipa_deinit;
status = nan_init();
if (QDF_IS_STATUS_ERROR(status))
goto action_oui_deinit;
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
action_oui_deinit:
ucfg_action_oui_deinit();
ipa_deinit: ipa_deinit:
ipa_deinit(); ipa_deinit();
ocb_deinit: ocb_deinit:
@@ -12933,6 +12940,7 @@ dispatcher_deinit:
static void hdd_component_deinit(void) static void hdd_component_deinit(void)
{ {
/* deinitialize non-converged components */ /* deinitialize non-converged components */
nan_deinit();
ucfg_action_oui_deinit(); ucfg_action_oui_deinit();
ipa_deinit(); ipa_deinit();
ucfg_ocb_deinit(); ucfg_ocb_deinit();
@@ -12989,10 +12997,12 @@ void hdd_component_psoc_enable(struct wlan_objmgr_psoc *psoc)
{ {
ocb_psoc_enable(psoc); ocb_psoc_enable(psoc);
disa_psoc_enable(psoc); disa_psoc_enable(psoc);
nan_psoc_enable(psoc);
} }
void hdd_component_psoc_disable(struct wlan_objmgr_psoc *psoc) void hdd_component_psoc_disable(struct wlan_objmgr_psoc *psoc)
{ {
nan_psoc_disable(psoc);
disa_psoc_disable(psoc); disa_psoc_disable(psoc);
ocb_psoc_disable(psoc); ocb_psoc_disable(psoc);
} }

View File

@@ -138,6 +138,8 @@ typedef uint8_t tSirVersionString[SIR_VERSION_STRING_LEN];
#endif #endif
struct scheduler_msg;
/** /**
* enum sir_roam_op_code - Operation to be done by the callback. * enum sir_roam_op_code - Operation to be done by the callback.
* @SIR_ROAM_SYNCH_PROPAGATION: Propagate the new BSS info after roaming. * @SIR_ROAM_SYNCH_PROPAGATION: Propagate the new BSS info after roaming.