Pārlūkot izejas kodu

qcacld-3.0: Merge NAN component files from CMN into CLD

NAN component is not needed in the CMN repo. To reduce the
unnecessary lines of code, merge the NAN component files
from CMN into CLD with updated copyrights. Subsequently
remove these files from the CMN repo.

Merge NAN component files from CMN into CLD.

Change-Id: I63c2fb90ea517496946ea45a66bdf290af9d5a7c
Linux Build Service Account 6 gadi atpakaļ
vecāks
revīzija
4e044cf9f5

+ 4 - 6
core/inc/nan_public_structs.h → components/nan/core/inc/nan_public_structs.h

@@ -616,21 +616,19 @@ struct nan_datapath_sch_update_event {
 struct nan_callbacks {
 	/* callback to os_if layer from umac */
 	void (*os_if_event_handler)(struct wlan_objmgr_psoc *psoc,
-				   struct wlan_objmgr_vdev *vdev,
-				   uint32_t type, void *msg);
+				    struct wlan_objmgr_vdev *vdev,
+				    uint32_t type, void *msg);
 
 	int (*ndi_open)(char *iface_name);
 	int (*ndi_start)(char *iface_name, uint16_t);
 	void (*ndi_close)(uint8_t);
 	int (*ndi_delete)(uint8_t, char *iface_name, uint16_t transaction_id);
-	void (*drv_ndi_create_rsp_handler)(uint8_t,
-					struct nan_datapath_inf_create_rsp *);
+	void (*drv_ndi_create_rsp_handler)
+				(uint8_t, struct nan_datapath_inf_create_rsp *);
 	void (*drv_ndi_delete_rsp_handler)(uint8_t);
-
 	int (*new_peer_ind)(uint8_t, uint16_t, struct qdf_mac_addr *, bool);
 	int (*get_peer_idx)(uint8_t, struct qdf_mac_addr *);
 	QDF_STATUS (*add_ndi_peer)(uint32_t, struct qdf_mac_addr);
-
 	void (*peer_departed_ind)(uint8_t, uint16_t, struct qdf_mac_addr *,
 				  bool);
 	void (*ndp_delete_peers)(struct peer_nan_datapath_map*, uint8_t);

+ 1 - 1
core/inc/wlan_nan_api.h → components/nan/core/inc/wlan_nan_api.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

+ 10 - 10
core/src/nan_api.c → components/nan/core/src/nan_api.c

@@ -95,9 +95,9 @@ static QDF_STATUS nan_psoc_obj_created_notification(
 	}
 
 	qdf_spinlock_create(&nan_obj->lock);
-	status = wlan_objmgr_psoc_component_obj_attach(psoc,
-			WLAN_UMAC_COMP_NAN, nan_obj,
-			QDF_STATUS_SUCCESS);
+	status = wlan_objmgr_psoc_component_obj_attach(psoc, WLAN_UMAC_COMP_NAN,
+						       nan_obj,
+						       QDF_STATUS_SUCCESS);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		nan_alert("obj attach with psoc failed");
 		goto nan_psoc_notif_failed;
@@ -172,8 +172,8 @@ static QDF_STATUS nan_psoc_obj_destroyed_notification(
 				     nan_psoc_delete_vdev,
 				     NULL, 1, WLAN_NAN_ID);
 
-	status = wlan_objmgr_psoc_component_obj_detach(psoc,
-					WLAN_UMAC_COMP_NAN, nan_obj);
+	status = wlan_objmgr_psoc_component_obj_detach(psoc, WLAN_UMAC_COMP_NAN,
+						       nan_obj);
 	if (QDF_IS_STATUS_ERROR(status))
 		nan_err("nan_obj detach failed");
 
@@ -203,9 +203,9 @@ static QDF_STATUS nan_vdev_obj_created_notification(
 	}
 
 	qdf_spinlock_create(&nan_obj->lock);
-	status = wlan_objmgr_vdev_component_obj_attach(vdev,
-			WLAN_UMAC_COMP_NAN, (void *)nan_obj,
-			QDF_STATUS_SUCCESS);
+	status = wlan_objmgr_vdev_component_obj_attach(vdev, WLAN_UMAC_COMP_NAN,
+						       (void *)nan_obj,
+						       QDF_STATUS_SUCCESS);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		nan_alert("obj attach with vdev failed");
 		goto nan_vdev_notif_failed;
@@ -238,8 +238,8 @@ static QDF_STATUS nan_vdev_obj_destroyed_notification(
 		return QDF_STATUS_E_FAULT;
 	}
 
-	status = wlan_objmgr_vdev_component_obj_detach(vdev,
-					WLAN_UMAC_COMP_NAN, nan_obj);
+	status = wlan_objmgr_vdev_component_obj_detach(vdev, WLAN_UMAC_COMP_NAN,
+						       nan_obj);
 	if (QDF_IS_STATUS_ERROR(status))
 		nan_err("nan_obj detach failed");
 

+ 14 - 5
core/src/nan_main.c → components/nan/core/src/nan_main.c

@@ -70,16 +70,19 @@ void nan_release_cmd(void *in_req, uint32_t cmdtype)
 	switch (cmdtype) {
 	case WLAN_SER_CMD_NDP_INIT_REQ: {
 		struct nan_datapath_initiator_req *req = in_req;
+
 		vdev = req->vdev;
 		break;
 	}
 	case WLAN_SER_CMD_NDP_RESP_REQ: {
 		struct nan_datapath_responder_req *req = in_req;
+
 		vdev = req->vdev;
 		break;
 	}
 	case WLAN_SER_CMD_NDP_DATA_END_INIT_REQ: {
 		struct nan_datapath_end_req *req = in_req;
+
 		vdev = req->vdev;
 		break;
 	}
@@ -111,18 +114,21 @@ static void nan_req_activated(void *in_req, uint32_t cmdtype)
 	switch (cmdtype) {
 	case WLAN_SER_CMD_NDP_INIT_REQ: {
 		struct nan_datapath_initiator_req *req = in_req;
+
 		vdev = req->vdev;
 		req_type = NDP_INITIATOR_REQ;
 		break;
 	}
 	case WLAN_SER_CMD_NDP_RESP_REQ: {
 		struct nan_datapath_responder_req *req = in_req;
+
 		vdev = req->vdev;
 		req_type = NDP_RESPONDER_REQ;
 		break;
 	}
 	case WLAN_SER_CMD_NDP_DATA_END_INIT_REQ: {
 		struct nan_datapath_end_req *req = in_req;
+
 		vdev = req->vdev;
 		req_type = NDP_END_REQ;
 		break;
@@ -154,7 +160,7 @@ static void nan_req_activated(void *in_req, uint32_t cmdtype)
 }
 
 static QDF_STATUS nan_serialized_cb(void *cmd,
-				enum wlan_serialization_cb_reason reason)
+				    enum wlan_serialization_cb_reason reason)
 {
 	void *req;
 	struct wlan_serialization_command *ser_cmd = cmd;
@@ -197,18 +203,21 @@ QDF_STATUS nan_scheduled_msg_handler(struct scheduler_msg *msg)
 	switch (msg->type) {
 	case NDP_INITIATOR_REQ: {
 		struct nan_datapath_initiator_req *req = msg->bodyptr;
+
 		cmd.cmd_type = WLAN_SER_CMD_NDP_INIT_REQ;
 		cmd.vdev = req->vdev;
 		break;
 	}
 	case NDP_RESPONDER_REQ: {
 		struct nan_datapath_responder_req *req = msg->bodyptr;
+
 		cmd.cmd_type = WLAN_SER_CMD_NDP_RESP_REQ;
 		cmd.vdev = req->vdev;
 		break;
 	}
 	case NDP_END_REQ: {
 		struct nan_datapath_end_req *req = msg->bodyptr;
+
 		cmd.cmd_type = WLAN_SER_CMD_NDP_DATA_END_INIT_REQ;
 		cmd.vdev = req->vdev;
 		break;
@@ -259,7 +268,7 @@ static QDF_STATUS nan_handle_confirm(
 	}
 
 	if (confirm->rsp_code != NAN_DATAPATH_RESPONSE_ACCEPT &&
-		confirm->num_active_ndps_on_peer == 0) {
+	    confirm->num_active_ndps_on_peer == 0) {
 		/*
 		 * This peer was created at ndp_indication but
 		 * confirm failed, so it needs to be deleted
@@ -329,8 +338,8 @@ static QDF_STATUS nan_handle_ndp_ind(
 		QDF_MAC_ADDR_ARRAY(ndp_ind->peer_mac_addr.bytes));
 
 	if ((ndp_ind->role == NAN_DATAPATH_ROLE_INITIATOR) ||
-	   ((NAN_DATAPATH_ROLE_RESPONDER == ndp_ind->role) &&
-	   (NAN_DATAPATH_ACCEPT_POLICY_ALL == ndp_ind->policy))) {
+	    ((NAN_DATAPATH_ROLE_RESPONDER == ndp_ind->role) &&
+	    (NAN_DATAPATH_ACCEPT_POLICY_ALL == ndp_ind->policy))) {
 		status = psoc_nan_obj->cb_obj.add_ndi_peer(vdev_id,
 						ndp_ind->peer_mac_addr);
 		if (QDF_IS_STATUS_ERROR(status)) {
@@ -367,7 +376,7 @@ static QDF_STATUS nan_handle_responder_rsp(
 		return QDF_STATUS_E_NULL_VALUE;
 	}
 
-	if (QDF_IS_STATUS_SUCCESS(rsp->status) && rsp->create_peer == true) {
+	if (QDF_IS_STATUS_SUCCESS(rsp->status) && rsp->create_peer) {
 		status = psoc_nan_obj->cb_obj.add_ndi_peer(
 						wlan_vdev_get_id(rsp->vdev),
 						rsp->peer_mac_addr);

+ 0 - 0
core/src/nan_main_i.h → components/nan/core/src/nan_main_i.h


+ 0 - 0
dispatcher/inc/cfg_nan.h → components/nan/dispatcher/inc/cfg_nan.h


+ 0 - 0
dispatcher/inc/cfg_nan_api.h → components/nan/dispatcher/inc/cfg_nan_api.h


+ 6 - 6
dispatcher/inc/nan_ucfg_api.h → components/nan/dispatcher/inc/nan_ucfg_api.h

@@ -208,12 +208,12 @@ void ucfg_nan_event_handler(struct wlan_objmgr_psoc *psoc,
  *
  * Return: status of operation
  */
-int ucfg_nan_register_hdd_callbacks(struct wlan_objmgr_psoc *psoc,
-				    struct nan_callbacks *cb_obj,
-				    void (os_if_event_handler)(
-				    struct wlan_objmgr_psoc *,
-				    struct wlan_objmgr_vdev *,
-				    uint32_t, void *));
+int ucfg_nan_register_hdd_callbacks(struct wlan_objmgr_psoc *,
+				    struct nan_callbacks *,
+				    void (os_if_event_handler)
+						(struct wlan_objmgr_psoc *,
+						 struct wlan_objmgr_vdev *,
+						 uint32_t, void *));
 
 /*
  * ucfg_nan_register_lim_callbacks: ucfg API to set lim callbacks

+ 0 - 0
dispatcher/src/cfg_nan.c → components/nan/dispatcher/src/cfg_nan.c


+ 0 - 0
dispatcher/src/nan_ucfg_api.c → components/nan/dispatcher/src/nan_ucfg_api.c


+ 0 - 22
core/src/nan_utils.c

@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2017 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
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/**
- * DOC: contains nan utility functions
- */
-