qcacld-3.0: Enable QCA6390

1. Enable emulation flags for QCA6390 bring up.
2. Select QCA6390 header files based on
   CONFIG_QCA6390_11AX flag.
3. Compile API's based on QCA_WIFI_QCA6390 flag.

Change-Id: I6330c734587ef772b25e722762e194eadd043d28
CRs-Fixed: 2259314
diff --git a/Kbuild b/Kbuild
index 7e2409c..081a726 100644
--- a/Kbuild
+++ b/Kbuild
@@ -1175,10 +1175,16 @@
                 $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/regtable.o
 
 ifeq ($(CONFIG_LITHIUM), y)
-HIF_CE_OBJS +=  $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/qca6290def.o \
-                $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_service_srng.o
+ifeq ($(CONFIG_CNSS_QCA6290), y)
+HIF_CE_OBJS +=  $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/qca6290def.o
 endif
 
+ifeq ($(CONFIG_CNSS_QCA6390), y)
+HIF_CE_OBJS +=  $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/qca6390def.o
+endif
+
+HIF_CE_OBJS +=  $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_service_srng.o
+endif
 
 HIF_USB_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_USB_DIR)/usbdrv.o \
                 $(WLAN_COMMON_ROOT)/$(HIF_USB_DIR)/hif_usb.o \
@@ -1317,6 +1323,9 @@
 ifeq ($(CONFIG_QCA6290_11AX), y)
 TARGET_INC :=	-I$(WLAN_ROOT)/../fw-api/hw/qca6290/11ax/v2 \
 		-I$(WLAN_ROOT)/../fw-api/fw
+else ifeq ($(CONFIG_QCA6390_11AX), y)
+TARGET_INC :=	-I$(WLAN_ROOT)/../fw-api/hw/qca6390/v1 \
+		-I$(WLAN_ROOT)/../fw-api/fw
 else
 TARGET_INC :=	-I$(WLAN_ROOT)/../fw-api/hw/qca6290/v2 \
 		-I$(WLAN_ROOT)/../fw-api/fw
@@ -1922,6 +1931,8 @@
 cppflags-$(CONFIG_SHADOW_V2) += -DCONFIG_SHADOW_V2
 cppflags-$(CONFIG_QCA6290_HEADERS_DEF) += -DQCA6290_HEADERS_DEF
 cppflags-$(CONFIG_QCA_WIFI_QCA6290) += -DQCA_WIFI_QCA6290
+cppflags-$(CONFIG_QCA6390_HEADERS_DEF) += -DQCA6390_HEADERS_DEF
+cppflags-$(CONFIG_QCA_WIFI_QCA6390) += -DQCA_WIFI_QCA6390
 cppflags-$(CONFIG_QCA_WIFI_QCA8074) += -DQCA_WIFI_QCA8074
 cppflags-$(CONFIG_QCA_WIFI_QCA8074_VP) += -DQCA_WIFI_QCA8074_VP
 cppflags-$(CONFIG_DP_INTR_POLL_BASED) += -DDP_INTR_POLL_BASED
@@ -1938,6 +1949,7 @@
 cppflags-y += -DQCA_WIFI_QCA6290_11AX
 endif
 
+
 cppflags-$(CONFIG_WLAN_FEATURE_11AX) += -DWLAN_FEATURE_11AX
 cppflags-$(CONFIG_WLAN_FEATURE_11AX) += -DWLAN_FEATURE_11AX_BSS_COLOR
 
diff --git a/configs/default_defconfig b/configs/default_defconfig
index 31dcdb8..c86e360 100644
--- a/configs/default_defconfig
+++ b/configs/default_defconfig
@@ -8,6 +8,17 @@
 	CONFIG_IPA3 := n
 endif
 
+
+ifeq ($(CONFIG_CNSS_QCA6390), y)
+	ifeq ($(CONFIG_CNSS_EMULATION), y)
+		CONFIG_QCA_WIFI_NAPIER_EMULATION := y
+	endif
+	CONFIG_LITHIUM := y
+	CONFIG_WLAN_FEATURE_11AX := y
+	CONFIG_WLAN_FEATURE_DFS_OFFLOAD := y
+	CONFIG_IPA3 := n
+endif
+
 ifeq ($(CONFIG_CLD_HL_SDIO_CORE), y)
 	CONFIG_QCA_WIFI_SDIO := y
 ifndef CONFIG_SDIO_TRANSFER
@@ -255,9 +266,18 @@
 endif #CONFIG_HELIUMPLUS
 
 ifeq ($(CONFIG_LITHIUM), y)
-CONFIG_SHADOW_V2 := y
-CONFIG_QCA6290_HEADERS_DEF := y
-CONFIG_QCA_WIFI_QCA6290 := y
+ifneq ($(CONFIG_CNSS_QCA6390), y)
+	CONFIG_SHADOW_V2 := y
+endif
+ifeq ($(CONFIG_CNSS_QCA6290), y)
+	CONFIG_QCA6290_HEADERS_DEF := y
+	CONFIG_QCA_WIFI_QCA6290 := y
+endif
+ifeq ($(CONFIG_CNSS_QCA6390), y)
+	CONFIG_QCA6390_HEADERS_DEF := y
+	CONFIG_QCA_WIFI_QCA6390 := y
+endif
+
 CONFIG_QCA_WIFI_QCA8074 := y
 CONFIG_QCA_WIFI_QCA8074_VP := y
 CONFIG_DP_INTR_POLL_BASED := y
diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c
index 0dd94ff..0a16617 100644
--- a/core/hdd/src/wlan_hdd_lro.c
+++ b/core/hdd/src/wlan_hdd_lro.c
@@ -38,7 +38,7 @@
 	(LRO_DESC | LRO_ELIGIBILITY_CHECKED | LRO_TCP_ACK_NUM | \
 	 LRO_TCP_DATA_CSUM | LRO_TCP_SEQ_NUM | LRO_TCP_WIN)
 
-#if defined(QCA_WIFI_QCA6290)
+#if defined(QCA_WIFI_QCA6290) || defined(QCA_WIFI_QCA6390)
 static qdf_lro_ctx_t wlan_hdd_get_lro_ctx(struct sk_buff *skb)
 {
 	return (qdf_lro_ctx_t)QDF_NBUF_CB_RX_LRO_CTX(skb);
diff --git a/core/hdd/src/wlan_hdd_rx_monitor.h b/core/hdd/src/wlan_hdd_rx_monitor.h
index 9747a20..61f8ed2 100644
--- a/core/hdd/src/wlan_hdd_rx_monitor.h
+++ b/core/hdd/src/wlan_hdd_rx_monitor.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -21,7 +21,7 @@
 
 struct ol_txrx_ops;
 
-#if defined(QCA_WIFI_QCA6290)
+#if defined(QCA_WIFI_QCA6290) || defined(QCA_WIFI_QCA6390)
 void hdd_monitor_set_rx_monitor_cb(struct ol_txrx_ops *txrx,
 				ol_txrx_rx_mon_fp rx_monitor_cb);
 
diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c
index d6ec1b4..f215d90 100644
--- a/core/hdd/src/wlan_hdd_softap_tx_rx.c
+++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c
@@ -929,7 +929,8 @@
 		next = skb->next;
 		skb->next = NULL;
 
-#ifdef QCA_WIFI_QCA6290 /* Debug code, remove later */
+/* Debug code, remove later */
+#if defined(QCA_WIFI_QCA6290) || defined(QCA_WIFI_QCA6390)
 		QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_DEBUG,
 			 "%s: skb %pK skb->len %d\n", __func__, skb, skb->len);
 #endif
diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c
index de8b4c8..3cada3e 100644
--- a/core/hdd/src/wlan_hdd_tx_rx.c
+++ b/core/hdd/src/wlan_hdd_tx_rx.c
@@ -1876,7 +1876,8 @@
 		next = skb->next;
 		skb->next = NULL;
 
-#ifdef QCA_WIFI_QCA6290 /* Debug code, remove later */
+/* Debug code, remove later */
+#if defined(QCA_WIFI_QCA6290) || defined(QCA_WIFI_QCA6390)
 		QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_DEBUG,
 			 "%s: skb %pK skb->len %d\n", __func__, skb, skb->len);
 #endif