summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandrasekaran, Manishekar <cmshekar@qti.qualcomm.com>2014-03-15 10:12:22 +0530
committerAkash Patel <c_akashp@qca.qualcomm.com>2014-03-16 21:21:03 -0700
commit71eef7da5fffa14a671df60446819012ccfc5eb5 (patch)
treec70da0f2be6b68d32ba8bf699dfd4f9aea6f6d70
parentcf988e42196e3ff0013f38425debd5ae3e2e588d (diff)
qcacld: Fix for adding sequence number in management frames
In the current implementation, the sequence number is zero for management frames. This fix will ensure that non-zero sequence numbers are added to the management frames. Change-Id: I35103f686765ee23aee72eee63f86209be84357a CRs-Fixed: 631221
-rw-r--r--CORE/MAC/inc/aniGlobal.h10
-rw-r--r--CORE/MAC/src/pe/lim/limSendManagementFrames.c42
-rw-r--r--CORE/SYS/legacy/src/system/src/macInitApi.c5
3 files changed, 57 insertions, 0 deletions
diff --git a/CORE/MAC/inc/aniGlobal.h b/CORE/MAC/inc/aniGlobal.h
index 1529b7b4950a..4d38f3e6bc88 100644
--- a/CORE/MAC/inc/aniGlobal.h
+++ b/CORE/MAC/inc/aniGlobal.h
@@ -142,6 +142,13 @@ typedef struct sAniSirGlobal *tpAniSirGlobal;
#define EQUALS_TO_ASCII_VALUE (61)
#endif
+#ifdef QCA_WIFI_2_0
+#define WLAN_HOST_SEQ_NUM_MIN 2048
+#define WLAN_HOST_SEQ_NUM_MAX 4095
+#define LOW_SEQ_NUM_MASK 0x000F
+#define HIGH_SEQ_NUM_MASK 0x0FF0
+#define HIGH_SEQ_NUM_OFFSET 4
+#endif /* QCA_WIFI_2_0 */
// -------------------------------------------------------------------
// Change channel generic scheme
@@ -1095,6 +1102,9 @@ typedef struct sAniSirGlobal
tANI_U8 lteCoexAntShare;
tANI_U8 beacon_offload;
tANI_U32 fEnableDebugLog;
+#ifdef QCA_WIFI_2_0
+ tANI_U16 mgmtSeqNum;
+#endif /* QCA_WIFI_2_0 */
} tAniSirGlobal;
typedef enum
diff --git a/CORE/MAC/src/pe/lim/limSendManagementFrames.c b/CORE/MAC/src/pe/lim/limSendManagementFrames.c
index 973dc3723199..9f86e950d4a4 100644
--- a/CORE/MAC/src/pe/lim/limSendManagementFrames.c
+++ b/CORE/MAC/src/pe/lim/limSendManagementFrames.c
@@ -209,6 +209,38 @@ void limMergeExtCapIEStruct(tDot11fIEExtCap *pDst,
}
}
+#ifdef QCA_WIFI_2_0
+/**
+ *
+ * \brief This function is called to add the sequence number to the
+ * management frames
+ *
+ * \param pMac Pointer to Global MAC structure
+ *
+ * \param pMacHdr Pointer to MAC management header
+ *
+ * The pMacHdr argument points to the MAC management header. The
+ * sequence number stored in the pMac structure will be incremented
+ * and updated to the MAC management header. The start sequence
+ * number is WLAN_HOST_SEQ_NUM_MIN and the end value is
+ * WLAN_HOST_SEQ_NUM_MAX. After reaching the MAX value, the sequence
+ * number will roll over.
+ *
+ */
+void
+limAddMgmtSeqNum (tpAniSirGlobal pMac, tpSirMacMgmtHdr pMacHdr)
+{
+ if (pMac->mgmtSeqNum >= WLAN_HOST_SEQ_NUM_MAX) {
+ pMac->mgmtSeqNum = WLAN_HOST_SEQ_NUM_MIN-1;
+ }
+
+ pMac->mgmtSeqNum++;
+
+ pMacHdr->seqControl.seqNumLo = (pMac->mgmtSeqNum & LOW_SEQ_NUM_MASK);
+ pMacHdr->seqControl.seqNumHi =
+ ((pMac->mgmtSeqNum & HIGH_SEQ_NUM_MASK) >> HIGH_SEQ_NUM_OFFSET);
+}
+#endif /* QCA_WIFI_2_0 */
/**
*
@@ -264,6 +296,16 @@ tSirRetStatus limPopulateMacHeader( tpAniSirGlobal pMac,
vos_mem_copy( (tANI_U8 *) pMacHdr->bssId,
(tANI_U8 *) peerAddr,
sizeof( tSirMacAddr ));
+
+#ifdef QCA_WIFI_2_0
+ /* Prepare sequence number */
+ limAddMgmtSeqNum(pMac, pMacHdr);
+ limLog(pMac, LOG1,"seqNumLo=%d, seqNumHi=%d, mgmtSeqNum=%d",
+ pMacHdr->seqControl.seqNumLo,
+ pMacHdr->seqControl.seqNumHi,
+ pMac->mgmtSeqNum);
+#endif /* QCA_WIFI_2_0 */
+
return statusCode;
} /*** end limPopulateMacHeader() ***/
diff --git a/CORE/SYS/legacy/src/system/src/macInitApi.c b/CORE/SYS/legacy/src/system/src/macInitApi.c
index fcaac7bb7405..9397289fced7 100644
--- a/CORE/SYS/legacy/src/system/src/macInitApi.c
+++ b/CORE/SYS/legacy/src/system/src/macInitApi.c
@@ -244,6 +244,11 @@ tSirRetStatus macOpen(tHalHandle *pHalHandle, tHddHandle hHdd, tMacOpenParameter
pMac->psOffloadEnabled = FALSE;
}
+#ifdef QCA_WIFI_2_0
+ /* FW: 0 to 2047 and Host: 2048 to 4095 */
+ pMac->mgmtSeqNum = WLAN_HOST_SEQ_NUM_MIN-1;
+#endif /* QCA_WIFI_2_0 */
+
return peOpen(pMac, pMacOpenParms);
}