wlan: Update SMD and SMSM header includes

The SMD and SMSM kernel header files are being relocated and renamed.
Update the WLAN build logic to determine which flavor of include files
are present, and update the WLAN driver to include the appropriate
files.

Note that this is an interim change.  Once the kernel header file
changes have been deployed, the WLAN driver will again be modified to
only use the new header files.

Change-Id: Icfadb5b9fae0a9489c14e3eaf6a2894dfabafd5b
CRs-fixed: 595745
diff --git a/Android.mk b/Android.mk
index 93b8143..0d069e5 100644
--- a/Android.mk
+++ b/Android.mk
@@ -43,6 +43,17 @@
        DLKM_DIR := build/dlkm
 endif
 
+# Some kernel include files are being moved.  Check to see if
+# the old version of the files are present
+INCLUDE_SELECT :=
+ifneq ($(wildcard $(TOP)/kernel//arch/arm/mach-msm/include/mach/msm_smd.h),)
+        INCLUDE_SELECT += EXISTS_MSM_SMD=1
+endif
+
+ifneq ($(wildcard $(TOP)/kernel//arch/arm/mach-msm/include/mach/msm_smsm.h),)
+        INCLUDE_SELECT += EXISTS_MSM_SMSM=1
+endif
+
 ifeq ($(WLAN_PROPRIETARY),1)
 # For the proprietary driver the firmware files are handled here
 include $(CLEAR_VARS)
@@ -83,6 +94,7 @@
 KBUILD_OPTIONS += MODNAME=wlan
 KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
 KBUILD_OPTIONS += $(WLAN_SELECT)
+KBUILD_OPTIONS += $(INCLUDE_SELECT)
 
 include $(CLEAR_VARS)
 LOCAL_MODULE              := $(WLAN_CHIPSET)_wlan.ko
diff --git a/CORE/WDI/TRP/CTS/src/wlan_qct_wdi_cts.c b/CORE/WDI/TRP/CTS/src/wlan_qct_wdi_cts.c
index 2b38d84..29c7fd7 100644
--- a/CORE/WDI/TRP/CTS/src/wlan_qct_wdi_cts.c
+++ b/CORE/WDI/TRP/CTS/src/wlan_qct_wdi_cts.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -99,7 +99,11 @@
 #include "wlan_qct_wdi.h"
 #include "wlan_qct_wdi_i.h"
 #ifdef CONFIG_ANDROID
+#ifdef EXISTS_MSM_SMD
 #include <mach/msm_smd.h>
+#else
+#include <soc/qcom/smd.h>
+#endif
 #include <linux/delay.h>
 #else
 #include "msm_smd.h"
diff --git a/CORE/WDI/WPAL/src/wlan_qct_pal_device.c b/CORE/WDI/WPAL/src/wlan_qct_pal_device.c
index d2df440..d8d88ec 100644
--- a/CORE/WDI/WPAL/src/wlan_qct_pal_device.c
+++ b/CORE/WDI/WPAL/src/wlan_qct_pal_device.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -77,7 +77,11 @@
 #include <linux/irqreturn.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
+#ifdef EXISTS_MSM_SMSM
 #include <mach/msm_smsm.h>
+#else
+#include <soc/qcom/smsm.h>
+#endif
 #include "wlan_qct_pal_api.h"
 #include "wlan_qct_pal_device.h"
 #include "wlan_hdd_main.h"
diff --git a/Kbuild b/Kbuild
index ca2f403..749a6e8 100644
--- a/Kbuild
+++ b/Kbuild
@@ -645,6 +645,14 @@
 
 CDEFINES += -DFEATURE_WLAN_CH_AVOID
 
+ifeq ($(EXISTS_MSM_SMD),1)
+CDEFINES += -DEXISTS_MSM_SMD
+endif
+
+ifeq ($(EXISTS_MSM_SMSM),1)
+CDEFINES += -DEXISTS_MSM_SMSM
+endif
+
 # Fix build for GCC 4.7
 EXTRA_CFLAGS += -Wno-maybe-uninitialized -Wno-unused-function