wlan: Update key sequence counter to TL

Currently the key sequence counter received from user space is
not updated at TL. So update the sequence counter to TL.

Change-Id: I460d64511502fd414d0e8568c69712bbe54dd7fa
CRs-Fixed: 2136293
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 64ecb2b..edf1bf7 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -12039,6 +12039,9 @@
     VOS_STATUS vos_status;
     eHalStatus halStatus;
     hdd_context_t *pHddCtx;
+    uint8_t staid, i;
+    v_MACADDR_t *peerMacAddr;
+    u64 rsc_counter = 0;
 
     ENTER();
 
@@ -12082,6 +12085,8 @@
            "%s: called with key index = %d & key length %d & seq length %d",
            __func__, key_index, params->key_len, params->seq_len);
 
+    peerMacAddr = (v_MACADDR_t *)mac_addr;
+
     /*extract key idx, key len and key*/
     vos_mem_zero(&setKey,sizeof(tCsrRoamSetKey));
     setKey.keyId = key_index;
@@ -12223,6 +12228,8 @@
             hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
             vos_status = wlan_hdd_check_ula_done(pAdapter);
 
+            staid = hdd_sta_id_find_from_mac_addr(pAdapter, peerMacAddr);
+
             if ( vos_status != VOS_STATUS_SUCCESS )
             {
                 VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
@@ -12284,6 +12291,8 @@
             }
         }
 
+        staid = pHddStaCtx->conn_info.staId[0];
+
         pWextState->roamProfile.Keys.KeyLength[key_index] = (u8)params->key_len;
 
         pWextState->roamProfile.Keys.defaultIndex = key_index;
@@ -12391,6 +12400,14 @@
         }
     }
 
+    if (pairwise) {
+       for (i = 0; i < params->seq_len; i++) {
+          rsc_counter |= (params->seq[i] << i*8);
+       }
+
+       WLANTL_SetKeySeqCounter(pVosContext, rsc_counter, staid);
+    }
+
 end:
     /* Need to clear any trace of key value in the memory.
      * Thus zero out the memory even though it is local