qcacmn: Add CDP API to set key in data path

1. Add CDP API to set encryption key in datapath.
   Used to perform RX TKIP demic.
2. Fixes to RX TKIP demic function.

Change-Id: Ia14caeb71a320b4746f4303cf6611f1b6e4947ae
CRs-Fixed: 2214749
diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h
index d90181d..4fb7272 100644
--- a/dp/inc/cdp_txrx_cmn.h
+++ b/dp/inc/cdp_txrx_cmn.h
@@ -270,7 +270,7 @@
 
 static inline void *cdp_peer_create
 	(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
-	uint8_t *peer_mac_addr)
+	uint8_t *peer_mac_addr, void *ol_peer)
 {
 	if (!soc || !soc->ops) {
 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
@@ -284,7 +284,7 @@
 		return NULL;
 
 	return soc->ops->cmn_drv_ops->txrx_peer_create(vdev,
-			peer_mac_addr);
+			peer_mac_addr, ol_peer);
 }
 
 static inline void cdp_peer_setup
@@ -1237,6 +1237,26 @@
 	return 0;
 }
 
+static inline int cdp_set_key(ol_txrx_soc_handle soc,
+			      struct cdp_peer *peer_handle,
+			      bool is_unicast, uint32_t *key)
+{
+	if (!soc || !soc->ops) {
+		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
+			  "%s: Invalid Instance:", __func__);
+		QDF_BUG(0);
+		return 0;
+	}
+
+	if (!soc->ops->ctrl_ops ||
+	    !soc->ops->ctrl_ops->set_key)
+		return 0;
+
+	soc->ops->ctrl_ops->set_key(peer_handle,
+			is_unicast, key);
+	return 0;
+}
+
 /**
  * cdp_update_config_parameters(): function to propagate configuration
  *                                 parameters to datapath