From 637d58a4c12b5c7ec3049629ec801841de6e5e4b Mon Sep 17 00:00:00 2001 From: Wu Gao Date: Sat, 8 Dec 2018 10:37:34 +0800 Subject: [PATCH] qcacld-3.0: Enable P2P component in CLD P2P component related files moved from hostcmn to CLD, this change adds initial functions, enables P2P in Kbuild. Change-Id: I04102a5f3e59ded13ada15b1b417ae81c7a10e90 CRs-Fixed: 2361500 --- Kbuild | 44 +++++++++---------- components/p2p/core/src/wlan_p2p_main.h | 1 + .../p2p/dispatcher/inc/wlan_p2p_tgt_api.h | 1 + .../p2p/dispatcher/inc/wlan_p2p_ucfg_api.h | 1 + core/hdd/src/wlan_hdd_main.c | 16 +++++++ os_if/p2p/inc/wlan_cfg80211_p2p.h | 14 +++--- os_if/p2p/src/wlan_cfg80211_p2p.c | 4 +- 7 files changed, 50 insertions(+), 31 deletions(-) diff --git a/Kbuild b/Kbuild index 4c87eaf2b05d..8383799474dc 100644 --- a/Kbuild +++ b/Kbuild @@ -595,15 +595,13 @@ QAL_OBJS := $(QAL_LINUX_OBJ_DIR)/qal_devcfg.o \ ##########OS_IF ####### OS_IF_DIR := $(WLAN_COMMON_ROOT)/os_if -OS_IF_INC := -I$(WLAN_COMMON_INC)/os_if/linux \ +OS_IF_INC += -I$(WLAN_COMMON_INC)/os_if/linux \ -I$(WLAN_COMMON_INC)/os_if/linux/scan/inc \ - -I$(WLAN_COMMON_INC)/os_if/linux/p2p/inc \ -I$(WLAN_COMMON_INC)/os_if/linux/spectral/inc \ -I$(WLAN_COMMON_INC)/os_if/linux/tdls/inc \ -I$(WLAN_COMMON_INC)/os_if/linux/crypto/inc -OS_IF_OBJ := $(OS_IF_DIR)/linux/p2p/src/wlan_cfg80211_p2p.o \ - $(OS_IF_DIR)/linux/wlan_osif_request_manager.o \ +OS_IF_OBJ += $(OS_IF_DIR)/linux/wlan_osif_request_manager.o \ $(OS_IF_DIR)/linux/crypto/src/wlan_nl_to_crypto_params.o ############ UMAC_DISP ############ @@ -955,22 +953,26 @@ CLD_TARGET_IF_OBJ += $(CLD_TARGET_IF_DIR)/action_oui/src/target_if_action_oui.o endif ############## UMAC P2P ########### -P2P_DIR := umac/p2p -P2P_CORE_DIR := $(P2P_DIR)/core -P2P_CORE_SRC_DIR := $(P2P_CORE_DIR)/src -P2P_CORE_OBJ_DIR := $(WLAN_COMMON_ROOT)/$(P2P_CORE_SRC_DIR) +P2P_DIR := components/p2p +P2P_CORE_OBJ_DIR := $(P2P_DIR)/core/src P2P_DISPATCHER_DIR := $(P2P_DIR)/dispatcher P2P_DISPATCHER_INC_DIR := $(P2P_DISPATCHER_DIR)/inc -P2P_DISPATCHER_SRC_DIR := $(P2P_DISPATCHER_DIR)/src -P2P_DISPATCHER_OBJ_DIR := $(WLAN_COMMON_ROOT)/$(P2P_DISPATCHER_SRC_DIR) -UMAC_P2P_INC := -I$(WLAN_COMMON_INC)/$(P2P_DISPATCHER_INC_DIR) \ - -I$(WLAN_COMMON_INC)/umac/scan/dispatcher/inc -UMAC_P2P_OBJS := $(P2P_DISPATCHER_OBJ_DIR)/wlan_p2p_ucfg_api.o \ - $(P2P_DISPATCHER_OBJ_DIR)/wlan_p2p_tgt_api.o \ - $(P2P_DISPATCHER_OBJ_DIR)/wlan_p2p_cfg.o \ - $(P2P_CORE_OBJ_DIR)/wlan_p2p_main.o \ - $(P2P_CORE_OBJ_DIR)/wlan_p2p_roc.o \ - $(P2P_CORE_OBJ_DIR)/wlan_p2p_off_chan_tx.o +P2P_DISPATCHER_OBJ_DIR := $(P2P_DISPATCHER_DIR)/src +P2P_OS_IF_INC := os_if/p2p/inc +P2P_OS_IF_SRC := os_if/p2p/src +P2P_TARGET_IF_INC := components/target_if/p2p/inc +P2P_TARGET_IF_SRC := components/target_if/p2p/src +P2P_INC := -I$(WLAN_ROOT)/$(P2P_DISPATCHER_INC_DIR) \ + -I$(WLAN_ROOT)/$(P2P_OS_IF_INC) \ + -I$(WLAN_ROOT)/$(P2P_TARGET_IF_INC) +P2P_OBJS := $(P2P_DISPATCHER_OBJ_DIR)/wlan_p2p_ucfg_api.o \ + $(P2P_DISPATCHER_OBJ_DIR)/wlan_p2p_tgt_api.o \ + $(P2P_DISPATCHER_OBJ_DIR)/wlan_p2p_cfg.o \ + $(P2P_CORE_OBJ_DIR)/wlan_p2p_main.o \ + $(P2P_CORE_OBJ_DIR)/wlan_p2p_roc.o \ + $(P2P_CORE_OBJ_DIR)/wlan_p2p_off_chan_tx.o \ + $(P2P_OS_IF_SRC)/wlan_cfg80211_p2p.o \ + $(P2P_TARGET_IF_SRC)/target_if_p2p.o ###### UMAC POLICY MGR ######## UMAC_POLICY_MGR_DIR := $(WLAN_COMMON_ROOT)/umac/cmn_services/policy_mgr @@ -1019,12 +1021,10 @@ TARGET_IF_DIR := $(WLAN_COMMON_ROOT)/target_if TARGET_IF_INC := -I$(WLAN_COMMON_INC)/target_if/core/inc \ -I$(WLAN_COMMON_INC)/target_if/core/src \ -I$(WLAN_COMMON_INC)/target_if/init_deinit/inc \ - -I$(WLAN_COMMON_INC)/target_if/p2p/inc \ -I$(WLAN_COMMON_INC)/target_if/regulatory/inc \ -I$(WLAN_COMMON_INC)/target_if/tdls/inc TARGET_IF_OBJ := $(TARGET_IF_DIR)/core/src/target_if_main.o \ - $(TARGET_IF_DIR)/p2p/src/target_if_p2p.o \ $(TARGET_IF_DIR)/regulatory/src/target_if_reg.o \ $(TARGET_IF_DIR)/tdls/src/target_if_tdls.o \ $(TARGET_IF_DIR)/init_deinit/src/init_cmd_api.o \ @@ -1702,7 +1702,7 @@ INCS += $(NAN_OS_IF_INC) INCS += $(UMAC_OBJMGR_INC) INCS += $(UMAC_MGMT_TXRX_INC) INCS += $(PMO_INC) -INCS += $(UMAC_P2P_INC) +INCS += $(P2P_INC) INCS += $(UMAC_POLICY_MGR_INC) INCS += $(TARGET_INC) INCS += $(UMAC_TDLS_INC) @@ -1791,7 +1791,7 @@ OBJS += $(WLAN_NAN_OBJS) OBJS += $(UMAC_MGMT_TXRX_OBJS) OBJS += $(UMAC_TDLS_OBJS) OBJS += $(PMO_OBJS) -OBJS += $(UMAC_P2P_OBJS) +OBJS += $(P2P_OBJS) OBJS += $(UMAC_POLICY_MGR_OBJS) OBJS += $(WLAN_LOGGING_OBJS) OBJS += $(NLINK_OBJS) diff --git a/components/p2p/core/src/wlan_p2p_main.h b/components/p2p/core/src/wlan_p2p_main.h index 61921d910a2b..2f5a5bc65dab 100644 --- a/components/p2p/core/src/wlan_p2p_main.h +++ b/components/p2p/core/src/wlan_p2p_main.h @@ -29,6 +29,7 @@ #include #include #include +#include #define MAX_QUEUE_LENGTH 20 #define P2P_NOA_ATTR_IND 0x1090 diff --git a/components/p2p/dispatcher/inc/wlan_p2p_tgt_api.h b/components/p2p/dispatcher/inc/wlan_p2p_tgt_api.h index 0ca20749892d..f5938d6981bc 100644 --- a/components/p2p/dispatcher/inc/wlan_p2p_tgt_api.h +++ b/components/p2p/dispatcher/inc/wlan_p2p_tgt_api.h @@ -33,6 +33,7 @@ struct p2p_noa_info; struct p2p_lo_event; struct mgmt_rx_event_params; enum mgmt_frame_type; +struct p2p_set_mac_filter_evt; #ifdef FEATURE_P2P_LISTEN_OFFLOAD diff --git a/components/p2p/dispatcher/inc/wlan_p2p_ucfg_api.h b/components/p2p/dispatcher/inc/wlan_p2p_ucfg_api.h index da397205140f..4f1c4d38fbd7 100644 --- a/components/p2p/dispatcher/inc/wlan_p2p_ucfg_api.h +++ b/components/p2p/dispatcher/inc/wlan_p2p_ucfg_api.h @@ -34,6 +34,7 @@ struct p2p_mgmt_tx; struct p2p_ps_config; struct p2p_lo_start; struct p2p_lo_event; +struct p2p_protocol_callbacks; /** * p2p_rx_callback() - Callback for rx mgmt frame diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 6ff9c89e6589..870a986d661e 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -143,6 +143,7 @@ #include "qc_sap_ioctl.h" #include "wlan_mlme_main.h" #include "wlan_p2p_cfg_api.h" +#include "wlan_cfg80211_p2p.h" #include "wlan_tdls_cfg_api.h" #include #include "wlan_mlme_ucfg_api.h" @@ -13016,8 +13017,14 @@ static QDF_STATUS hdd_component_init(void) if (QDF_IS_STATUS_ERROR(status)) goto action_oui_deinit; + status = ucfg_p2p_init(); + if (QDF_IS_STATUS_ERROR(status)) + goto nan_deinit; + return QDF_STATUS_SUCCESS; +nan_deinit: + nan_deinit(); action_oui_deinit: ucfg_action_oui_deinit(); ipa_deinit: @@ -13046,6 +13053,7 @@ dispatcher_deinit: static void hdd_component_deinit(void) { /* deinitialize non-converged components */ + ucfg_p2p_deinit(); nan_deinit(); ucfg_action_oui_deinit(); ipa_deinit(); @@ -13079,8 +13087,13 @@ QDF_STATUS hdd_component_psoc_open(struct wlan_objmgr_psoc *psoc) if (QDF_IS_STATUS_ERROR(status)) goto err_plcy_mgr; + status = ucfg_p2p_psoc_open(psoc); + if (QDF_IS_STATUS_ERROR(status)) + goto err_p2p; return status; +err_p2p: + ucfg_p2p_psoc_close(psoc); err_plcy_mgr: ucfg_pmo_psoc_close(psoc); err_pmo: @@ -13093,6 +13106,7 @@ err_fwol: void hdd_component_psoc_close(struct wlan_objmgr_psoc *psoc) { + ucfg_p2p_psoc_close(psoc); ucfg_policy_mgr_psoc_close(psoc); ucfg_pmo_psoc_close(psoc); ucfg_fwol_psoc_close(psoc); @@ -13104,10 +13118,12 @@ void hdd_component_psoc_enable(struct wlan_objmgr_psoc *psoc) ocb_psoc_enable(psoc); disa_psoc_enable(psoc); nan_psoc_enable(psoc); + p2p_psoc_enable(psoc); } void hdd_component_psoc_disable(struct wlan_objmgr_psoc *psoc) { + p2p_psoc_disable(psoc); nan_psoc_disable(psoc); disa_psoc_disable(psoc); ocb_psoc_disable(psoc); diff --git a/os_if/p2p/inc/wlan_cfg80211_p2p.h b/os_if/p2p/inc/wlan_cfg80211_p2p.h index 1c8484b8de4b..9e7a94798d99 100644 --- a/os_if/p2p/inc/wlan_cfg80211_p2p.h +++ b/os_if/p2p/inc/wlan_cfg80211_p2p.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018 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,24 +30,24 @@ struct wlan_objmgr_vdev; struct ieee80211_channel; /** - * wlan_p2p_start() - start p2p component + * p2p_psoc_enable() - psoc API to enable p2p component * @psoc: soc object * - * This function used to start P2P component and register events. + * This function used to enable P2P component and register events. * * Return: QDF_STATUS_SUCCESS - in case of success */ -QDF_STATUS wlan_p2p_start(struct wlan_objmgr_psoc *psoc); +QDF_STATUS p2p_psoc_enable(struct wlan_objmgr_psoc *psoc); /** - * wlan_p2p_stop() - stop p2p component + * p2p_psoc_disable() - psoc API to disable p2p component * @psoc: soc object * - * This function used to stop P2P component and unregister events. + * This function used to disable P2P component and unregister events. * * Return: QDF_STATUS_SUCCESS - in case of success */ -QDF_STATUS wlan_p2p_stop(struct wlan_objmgr_psoc *psoc); +QDF_STATUS p2p_psoc_disable(struct wlan_objmgr_psoc *psoc); /** * wlan_cfg80211_roc() - API to process cfg80211 roc request diff --git a/os_if/p2p/src/wlan_cfg80211_p2p.c b/os_if/p2p/src/wlan_cfg80211_p2p.c index e4911ae8e23f..009b3e88dc54 100644 --- a/os_if/p2p/src/wlan_cfg80211_p2p.c +++ b/os_if/p2p/src/wlan_cfg80211_p2p.c @@ -319,7 +319,7 @@ fail: wlan_objmgr_vdev_release_ref(vdev, WLAN_P2P_ID); } -QDF_STATUS wlan_p2p_start(struct wlan_objmgr_psoc *psoc) +QDF_STATUS p2p_psoc_enable(struct wlan_objmgr_psoc *psoc) { struct p2p_start_param start_param; @@ -339,7 +339,7 @@ QDF_STATUS wlan_p2p_start(struct wlan_objmgr_psoc *psoc) return ucfg_p2p_psoc_start(psoc, &start_param); } -QDF_STATUS wlan_p2p_stop(struct wlan_objmgr_psoc *psoc) +QDF_STATUS p2p_psoc_disable(struct wlan_objmgr_psoc *psoc) { if (!psoc) { cfg80211_err("psoc null");