prima:  Changes to support new OEM_DATA_REQ msg

Add changes to handle OEM_DATA_REQ_IND_NEW/OEM_DATA_RSP_IND_NEW.

Change-Id: I86af0eae6b726fa8b347fb4a66b78297e41301bb
CRs-Fixed: 927234
diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h
index 2fe0f9d..d54f7a9 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg80211.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h
@@ -1361,6 +1361,11 @@
 
 void wlan_hdd_cfg80211_nan_init(hdd_context_t *pHddCtx);
 
+#ifdef FEATURE_OEM_DATA_SUPPORT
+void wlan_hdd_cfg80211_oemdata_callback(void *ctx, const tANI_U16 evType,
+                                      void *pMsg);
+#endif /* FEATURE_OEM_DATA_SUPPORT */
+
 #if !(defined (SUPPORT_WDEV_CFG80211_VENDOR_EVENT_ALLOC))
 static inline struct sk_buff *
 backported_cfg80211_vendor_event_alloc(struct wiphy *wiphy,
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 1d43e6d..84c7f48 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -18979,6 +18979,56 @@
 
     return ret;
 }
+
+#ifdef FEATURE_OEM_DATA_SUPPORT
+static void wlan_hdd_cfg80211_oem_data_rsp_ind_new(void *ctx,
+                                                      void *pMsg)
+{
+    hdd_context_t *pHddCtx         = (hdd_context_t *)ctx;
+
+    ENTER();
+
+    if (wlan_hdd_validate_context(pHddCtx)) {
+        return;
+    }
+    if (!pMsg)
+    {
+        hddLog(VOS_TRACE_LEVEL_ERROR, FL("pMsg is null"));
+        return;
+    }
+
+    send_oem_data_rsp_msg(sizeof(tOemDataRspNew), pMsg);
+
+    EXIT();
+    return;
+
+}
+
+void wlan_hdd_cfg80211_oemdata_callback(void *ctx, const tANI_U16 evType,
+                                      void *pMsg)
+{
+    hdd_context_t *pHddCtx = (hdd_context_t *)ctx;
+
+    ENTER();
+
+    if (wlan_hdd_validate_context(pHddCtx)) {
+        return;
+    }
+
+    hddLog(VOS_TRACE_LEVEL_INFO, FL("Rcvd Event (%d)"), evType);
+
+    switch(evType) {
+    case SIR_HAL_START_OEM_DATA_RSP_IND_NEW:
+        wlan_hdd_cfg80211_oem_data_rsp_ind_new(ctx, pMsg);
+        break;
+    default:
+        hddLog(VOS_TRACE_LEVEL_ERROR, FL("invalid event type %d "), evType);
+        break;
+    }
+    EXIT();
+}
+#endif
+
 /* cfg80211_ops */
 static struct cfg80211_ops wlan_hdd_cfg80211_ops =
 {
diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c
index 9bacff4..7f40951 100644
--- a/CORE/HDD/src/wlan_hdd_early_suspend.c
+++ b/CORE/HDD/src/wlan_hdd_early_suspend.c
@@ -2283,6 +2283,13 @@
             wlan_hdd_cfg80211_extscan_callback,
                            pHddCtx);
 #endif /* WLAN_FEATURE_EXTSCAN */
+
+#ifdef FEATURE_OEM_DATA_SUPPORT
+    sme_OemDataRegisterCallback(pHddCtx->hHal,
+             wlan_hdd_cfg80211_oemdata_callback,
+                          pHddCtx);
+#endif /* FEATURE_OEM_DATA_SUPPORT */
+
    goto success;
 
 err_unregister_pmops:
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index eabfaed..4eb2ff1 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -10479,6 +10479,12 @@
                            pHddCtx);
 #endif /* WLAN_FEATURE_EXTSCAN */
 
+#ifdef FEATURE_OEM_DATA_SUPPORT
+    sme_OemDataRegisterCallback(pHddCtx->hHal,
+            wlan_hdd_cfg80211_oemdata_callback,
+                           pHddCtx);
+#endif /* FEATURE_OEM_DATA_SUPPORT */
+
    sme_set_rssi_threshold_breached_cb(pHddCtx->hHal, hdd_rssi_threshold_breached_cb);
 #ifdef WLAN_NS_OFFLOAD
    // Register IPv6 notifier to notify if any change in IP
diff --git a/CORE/HDD/src/wlan_hdd_oemdata.c b/CORE/HDD/src/wlan_hdd_oemdata.c
index d662266..b9a873a 100644
--- a/CORE/HDD/src/wlan_hdd_oemdata.c
+++ b/CORE/HDD/src/wlan_hdd_oemdata.c
@@ -816,6 +816,9 @@
    tAniMsgHdr *msg_hdr;
    int ret;
    char *sign_str = NULL;
+   char* aniMsgBody;
+   tANI_U32 *oemMsgSubType;
+
    nlh = (struct nlmsghdr *)skb->data;
 
    if (!nlh) {
@@ -845,6 +848,8 @@
        return -EPERM;
    }
 
+   hddLog(LOG1, FL("Received App msg type: %d"), msg_hdr->type);
+
    switch (msg_hdr->type) {
    case ANI_MSG_APP_REG_REQ:
       /* Registration request is only allowed for Qualcomm Application */
@@ -891,6 +896,10 @@
                                        OEM_ERR_INVALID_MESSAGE_LENGTH);
           return -EPERM;
       }
+      aniMsgBody = (char *)((char *)msg_hdr + sizeof(tAniMsgHdr));
+      oemMsgSubType = (tANI_U32*) aniMsgBody;
+      hddLog(LOGE, FL("oemMsgSubType: 0x%x"), *oemMsgSubType);
+
       oem_process_data_req_msg(msg_hdr->length,
                               (char *) ((char *)msg_hdr +
                               sizeof(tAniMsgHdr)));