qcacld-3.0: Add CDP API to set key in data path

Add CDP API to set RX MIC key in datapath.
Required to perform RX demic of fragmented packets.

Change-Id: I3c05da62ff20f8551cdc5780ce2f7b8d23c73a37
CRs-Fixed: 2217884
diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c
index 0b17618..f6c102c 100644
--- a/core/dp/txrx/ol_txrx.c
+++ b/core/dp/txrx/ol_txrx.c
@@ -2819,7 +2819,8 @@
  * fails
  */
 static void *
-ol_txrx_peer_attach(struct cdp_vdev *pvdev, uint8_t *peer_mac_addr)
+ol_txrx_peer_attach(struct cdp_vdev *pvdev, uint8_t *peer_mac_addr,
+		    void *ol_peer)
 {
 	struct ol_txrx_vdev_t *vdev = (struct ol_txrx_vdev_t *)pvdev;
 	struct ol_txrx_peer_t *peer;
diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h
index b28df58..7eb5132 100644
--- a/core/wma/inc/wma.h
+++ b/core/wma/inc/wma.h
@@ -337,6 +337,7 @@
 
 #define WMA_TXMIC_LEN 8
 #define WMA_RXMIC_LEN 8
+#define WMA_IV_KEY_LEN 16
 
 /*
  * Length = (2 octets for Index and CTWin/Opp PS) and
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index d78c34e..9fd6b3c 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -1732,7 +1732,7 @@
 	 * where the HTT peer map event is received before the peer object
 	 * is created in the data path
 	 */
-	peer = cdp_peer_create(dp_soc, vdev, peer_addr);
+	peer = cdp_peer_create(dp_soc, vdev, peer_addr, NULL);
 	if (!peer) {
 		WMA_LOGE("%s : Unable to attach peer %pM", __func__, peer_addr);
 		wlan_objmgr_peer_obj_delete(obj_peer);
diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c
index 619dda9..d149c9e 100644
--- a/core/wma/src/wma_mgmt.c
+++ b/core/wma/src/wma_mgmt.c
@@ -1965,6 +1965,10 @@
 
 	/* Set PN check & security type in data path */
 	cdp_set_pn_check(soc, txrx_vdev, peer, sec_type, pn);
+	cdp_set_key(soc, peer, key_params->unicast,
+		    (uint32_t *)(key_params->key_data +
+				WMA_IV_KEY_LEN +
+				WMA_TXMIC_LEN));
 
 	status = wmi_unified_setup_install_key_cmd(wma_handle->wmi_handle,
 								&params);