qcacld-3.0: Remove eWNI_SME_SEND_DISASSOC_FRAME serdes logic

An ancestor of the current driver used mailboxes for communication
between SME and LIM, and serialization/deserialization routines were
used to encode and decode the mailbox messages. This mechanism is no
longer in use, but there are remnants still present.

One remnant is the eWNI_SME_SEND_DISASSOC_FRAME message processing
which is still serialized by SME and deserialized by LIM even though
the message is no longer sent via a mailbox.  Bring this message
handling up to date by exclusively using the underlying struct
sme_send_disassoc_frm_req.

As part of the change remove the trans_id field from the struct since
it is not actually used by LIM.

Change-Id: I067c9f7461fddd7a25090e691836d7d9276c4e89
CRs-Fixed: 2402289
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index 1b4a98d..6092e46 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -5492,7 +5492,6 @@
  * @msg_type: message type
  * @length: length of message
  * @session_id: session id
- * @trans_id: transaction id
  * @peer_mac: peer mac address
  * @reason: reason for disassoc
  * @wait_for_ack: wait for acknowledgment
@@ -5501,7 +5500,6 @@
 	uint16_t msg_type;
 	uint16_t length;
 	uint8_t session_id;
-	uint16_t trans_id;
 	uint8_t peer_mac[6];
 	uint16_t reason;
 	uint8_t wait_for_ack;
diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
index 83ab724..9976283 100644
--- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
@@ -82,8 +82,6 @@
 static void __lim_process_sme_set_context_req(struct mac_context *, uint32_t *);
 static bool __lim_process_sme_stop_bss_req(struct mac_context *,
 					   struct scheduler_msg *pMsg);
-static void __lim_process_send_disassoc_frame(struct mac_context *mac_ctx,
-				uint32_t *msg_buf);
 static void lim_process_sme_channel_change_request(struct mac_context *mac,
 						   uint32_t *pMsg);
 static void lim_process_sme_start_beacon_req(struct mac_context *mac, uint32_t *pMsg);
@@ -4282,63 +4280,46 @@
 }
 
 /**
- *__lim_process_send_disassoc_frame: function processes disassoc frame
+ *__lim_process_send_disassoc_frame() - processes send disassoc frame request
  * @mac_ctx: pointer to mac context
- * @msg_buf: message buffer
+ * @msg_buf: request message buffer
  *
- * function processes disassoc request received from SME
+ * Process a request from SME to send a disassoc frame
  *
- * return: none
+ * Return: none
  */
 static void __lim_process_send_disassoc_frame(struct mac_context *mac_ctx,
-					uint32_t *msg_buf)
+					      void *msg_buf)
 {
-	struct sme_send_disassoc_frm_req sme_send_disassoc_frame_req;
-	QDF_STATUS status;
-	struct pe_session *session_entry = NULL;
-	uint8_t sme_session_id;
-	uint16_t sme_trans_id;
+	struct sme_send_disassoc_frm_req *req = msg_buf;
+	struct pe_session *session_entry;
 
-	if (msg_buf == NULL) {
-		pe_err("Buffer is Pointing to NULL");
+	if (!req) {
+		pe_err("NULL req");
 		return;
 	}
 
-	lim_get_session_info(mac_ctx, (uint8_t *)msg_buf, &sme_session_id,
-			&sme_trans_id);
-
-	status = lim_send_disassoc_frm_req_ser_des(mac_ctx,
-				&sme_send_disassoc_frame_req,
-				(uint8_t *)msg_buf);
-
-	if ((QDF_STATUS_E_FAILURE == status) ||
-		(lim_is_group_addr(sme_send_disassoc_frame_req.peer_mac) &&
-		!lim_is_addr_bc(sme_send_disassoc_frame_req.peer_mac))) {
+	if ((lim_is_group_addr(req->peer_mac) &&
+	     !lim_is_addr_bc(req->peer_mac))) {
 		pe_err("received invalid SME_DISASSOC_REQ message");
 		return;
 	}
 
-	session_entry = pe_find_session_by_sme_session_id(
-				mac_ctx, sme_session_id);
-	if (session_entry == NULL) {
-		pe_err("session does not exist for given bssId "MAC_ADDRESS_STR,
-			MAC_ADDR_ARRAY(sme_send_disassoc_frame_req.peer_mac));
+	session_entry = pe_find_session_by_sme_session_id(mac_ctx,
+							  req->session_id);
+	if (!session_entry) {
+		pe_err("session does not exist for given bssId "
+		       MAC_ADDRESS_STR, MAC_ADDR_ARRAY(req->peer_mac));
 		return;
 	}
 
-	pe_debug("msg_type->%d len->%d sess_id->%d trans_id->%d mac->"MAC_ADDRESS_STR" reason->%d wait_for_ack->%d",
-			sme_send_disassoc_frame_req.msg_type,
-			sme_send_disassoc_frame_req.length,
-			sme_send_disassoc_frame_req.session_id,
-			sme_send_disassoc_frame_req.trans_id,
-			MAC_ADDR_ARRAY(sme_send_disassoc_frame_req.peer_mac),
-			sme_send_disassoc_frame_req.reason,
-			sme_send_disassoc_frame_req.wait_for_ack);
+	pe_debug("msg_type->%d len->%d sess_id->%d mac->"
+		 MAC_ADDRESS_STR " reason->%d wait_for_ack->%d",
+		 req->msg_type, req->length,  req->session_id,
+		 MAC_ADDR_ARRAY(req->peer_mac), req->reason, req->wait_for_ack);
 
-	lim_send_disassoc_mgmt_frame(mac_ctx,
-		sme_send_disassoc_frame_req.reason,
-		sme_send_disassoc_frame_req.peer_mac,
-		session_entry, sme_send_disassoc_frame_req.wait_for_ack);
+	lim_send_disassoc_mgmt_frame(mac_ctx, req->reason, req->peer_mac,
+				     session_entry, req->wait_for_ack);
 }
 
 /**
diff --git a/core/mac/src/pe/lim/lim_ser_des_utils.c b/core/mac/src/pe/lim/lim_ser_des_utils.c
index e781939..849e452 100644
--- a/core/mac/src/pe/lim/lim_ser_des_utils.c
+++ b/core/mac/src/pe/lim/lim_ser_des_utils.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-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
@@ -68,73 +68,3 @@
 
 	return;
 }
-
-/**
- * lim_send_disassoc_frm_req_ser_des - called on receiving SME_DISASSOC_REQ
- * @mac_ctx: pointer to mac context
- * @disassoc_frm_req: pointer to structure sme_send_disassoc_frm_req
- *
- * function send's disassoc frame request on receiving SME_DISASSOC_REQ
- *
- * return: QDF_STATUS_SUCCESS:Success Error value: Failure
- */
-QDF_STATUS lim_send_disassoc_frm_req_ser_des(struct mac_context *mac_ctx,
-			struct sme_send_disassoc_frm_req *disassoc_frm_req,
-			uint8_t *buf)
-{
-	A_INT16 len = 0;
-
-	if (!disassoc_frm_req || !buf)
-		return QDF_STATUS_E_FAILURE;
-
-	disassoc_frm_req->msg_type = lim_get_u16(buf);
-	buf += sizeof(A_UINT16);
-
-	len = disassoc_frm_req->length = lim_get_u16(buf);
-	buf += sizeof(A_UINT16);
-
-	if (len < (A_INT16) sizeof(A_UINT32))
-		return QDF_STATUS_E_FAILURE;
-
-	/* skip message header */
-	len -= sizeof(A_UINT32);
-	if (len < 0)
-		return QDF_STATUS_E_FAILURE;
-
-	/* Extract sessionID */
-	disassoc_frm_req->session_id = *buf;
-	buf += sizeof(A_UINT8);
-	len -= sizeof(A_UINT8);
-	if (len < 0)
-		return QDF_STATUS_E_FAILURE;
-
-	/* Extract transactionid */
-	disassoc_frm_req->trans_id = lim_get_u16(buf);
-	buf += sizeof(A_UINT16);
-	len -= sizeof(A_UINT16);
-
-	if (len < 0)
-		return QDF_STATUS_E_FAILURE;
-
-	/* Extract peerMacAddr */
-	qdf_mem_copy(disassoc_frm_req->peer_mac, buf, sizeof(tSirMacAddr));
-	buf += sizeof(tSirMacAddr);
-	len  -= sizeof(tSirMacAddr);
-
-	if (len < 0)
-		return QDF_STATUS_E_FAILURE;
-
-	/* Extract reasonCode */
-	disassoc_frm_req->reason = lim_get_u16(buf);
-	buf += sizeof(A_UINT16);
-	len  -= sizeof(A_UINT16);
-
-	if (len < 0)
-		return QDF_STATUS_E_FAILURE;
-
-	disassoc_frm_req->wait_for_ack = *buf;
-	buf += sizeof(A_UINT8);
-	len -= sizeof(A_UINT8);
-
-	return QDF_STATUS_SUCCESS;
-}
diff --git a/core/mac/src/pe/lim/lim_ser_des_utils.h b/core/mac/src/pe/lim/lim_ser_des_utils.h
index bb8db09..b05f5ef 100644
--- a/core/mac/src/pe/lim/lim_ser_des_utils.h
+++ b/core/mac/src/pe/lim/lim_ser_des_utils.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-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
@@ -110,9 +110,4 @@
 {
 	return (buf[0] << 8) | buf[1];
 }
-
-QDF_STATUS lim_send_disassoc_frm_req_ser_des(struct mac_context *mac_ctx,
-		struct sme_send_disassoc_frm_req *disassoc_frm_req,
-		uint8_t *buf);
-
 #endif /* __LIM_SERDES_UTILS_H */
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index 9c6b7b1..229bfcf 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -12377,46 +12377,22 @@
 {
 	struct sme_send_disassoc_frm_req *msg;
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
-	A_UINT8  *buf;
-	A_UINT16 tmp;
 
-	msg = qdf_mem_malloc(sizeof(struct sme_send_disassoc_frm_req));
+	msg = qdf_mem_malloc(sizeof(*msg));
 	if (!msg)
 		return;
 
-	msg->msg_type = (uint16_t) eWNI_SME_SEND_DISASSOC_FRAME;
-
-	msg->length = (uint16_t) sizeof(struct sme_send_disassoc_frm_req);
-
-	buf = &msg->session_id;
-
-	/* session id */
-	*buf = (A_UINT8) session_id;
-	buf += sizeof(A_UINT8);
-
-	/* transaction id */
-	*buf = 0;
-	*(buf + 1) = 0;
-	buf += sizeof(A_UINT16);
-
-	/* Set the peer MAC address before sending the message to LIM */
-	qdf_mem_copy(buf, peer_mac, QDF_MAC_ADDR_SIZE);
-
-	buf += QDF_MAC_ADDR_SIZE;
-
-	/* reasoncode */
-	tmp = (uint16_t) reason;
-	qdf_mem_copy(buf, &tmp, sizeof(uint16_t));
-	buf += sizeof(uint16_t);
-
-	*buf =  wait_for_ack;
-	buf += sizeof(uint8_t);
+	msg->msg_type = eWNI_SME_SEND_DISASSOC_FRAME;
+	msg->length = sizeof(*msg);
+	msg->session_id = session_id;
+	qdf_mem_copy(msg->peer_mac, peer_mac, QDF_MAC_ADDR_SIZE);
+	msg->reason = reason;
+	msg->wait_for_ack = wait_for_ack;
 
 	qdf_status = umac_send_mb_message_to_mac(msg);
-
-	if (qdf_status != QDF_STATUS_SUCCESS)
-		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
-			FL("cds_send_mb_message Failed"));
+	if (QDF_IS_STATUS_ERROR(qdf_status))
+		sme_err("umac_send_mb_message_to_mac failed, %d",
+			qdf_status);
 }
 
 #ifdef FEATURE_WLAN_APF