qcacld-3.0: Add support for NDP vendor commands and NDI Create

Add support for NDP vendor commands and implement NAN Data Interface
create.

Propagation from qcacld-2.0 to qcacld-3.0

CRs-Fixed: 962367
Change-Id: I84e9ac5ccfe8faaa00dfc448defb81fb792263d5
diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c
index 1c0a796..7fdc769 100644
--- a/core/hdd/src/wlan_hdd_wext.c
+++ b/core/hdd/src/wlan_hdd_wext.c
@@ -87,6 +87,7 @@
 #include "wlan_hdd_ocb.h"
 #include "wlan_hdd_napi.h"
 #include "cdp_txrx_flow_ctrl_legacy.h"
+#include "wlan_hdd_nan_datapath.h"
 
 #define HDD_FINISH_ULA_TIME_OUT         800
 #define HDD_SET_MCBC_FILTERS_TO_FW      1
@@ -1598,7 +1599,12 @@
 void hdd_clear_roam_profile_ie(hdd_adapter_t *pAdapter)
 {
 	int i = 0;
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
+	hdd_wext_state_t *pWextState;
+
+	if (QDF_NDI_MODE == pAdapter->device_mode)
+		pWextState = WLAN_HDD_GET_NDP_WEXT_STATE_PTR(pAdapter);
+	else
+		pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
 
 	/* clear WPA/RSN/WSC IE information in the profile */
 	pWextState->roamProfile.nWPAReqIELength = 0;
@@ -10865,16 +10871,27 @@
 int hdd_set_wext(hdd_adapter_t *pAdapter)
 {
 	hdd_wext_state_t *pwextBuf;
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
+	hdd_station_ctx_t *pHddStaCtx;
+	tCsrSSIDInfo *ssid_list;
+	struct qdf_mac_addr *bssid;
 
-	pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
+	if (QDF_NDI_MODE == pAdapter->device_mode) {
+		pwextBuf = WLAN_HDD_GET_NDP_WEXT_STATE_PTR(pAdapter);
+		ssid_list = WLAN_HDD_NDP_GET_SSID(pAdapter);
+		bssid = WLAN_HDD_NDP_GET_BSSID(pAdapter);
+	} else {
+		pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
+		pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
+		ssid_list = &pHddStaCtx->conn_info.SSID;
+		bssid = &pHddStaCtx->conn_info.bssId;
+	}
 
 	/* Now configure the roaming profile links. To SSID and bssid. */
 	pwextBuf->roamProfile.SSIDs.numOfSSIDs = 0;
-	pwextBuf->roamProfile.SSIDs.SSIDList = &pHddStaCtx->conn_info.SSID;
+	pwextBuf->roamProfile.SSIDs.SSIDList = ssid_list;
 
 	pwextBuf->roamProfile.BSSIDs.numOfBSSIDs = 0;
-	pwextBuf->roamProfile.BSSIDs.bssid = &pHddStaCtx->conn_info.bssId;
+	pwextBuf->roamProfile.BSSIDs.bssid = bssid;
 
 	/*Set the numOfChannels to zero to scan all the channels */
 	pwextBuf->roamProfile.ChannelInfo.numOfChannels = 0;
@@ -10907,15 +10924,28 @@
 
 }
 
+/**
+ * hdd_register_wext() - register wext context
+ * @dev: net device handle
+ *
+ * Registers wext interface context for a given net device
+ *
+ * Returns: 0 on success, errno on failure
+ */
 int hdd_register_wext(struct net_device *dev)
 {
 	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_wext_state_t *pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
+	hdd_wext_state_t *pwextBuf;
 	QDF_STATUS status;
 
 	ENTER();
 
-	/* Zero the memory.  This zeros the profile structure. */
+	if (QDF_NDI_MODE == pAdapter->device_mode)
+		pwextBuf = WLAN_HDD_GET_NDP_WEXT_STATE_PTR(pAdapter);
+	else
+		pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
+
+	/* Zero the memory. This zeros the profile structure */
 	memset(pwextBuf, 0, sizeof(hdd_wext_state_t));
 
 	init_completion(&(WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter))->