Browse Source

qcacmn: Use new HIF_SNOC flag

Use new HIF_SNOC instead of assuming snoc when pci is not defined.
Exposes duplicate function defs with HIF_SNOC and HIF_PCI both defined.
Remove some trivial HIF_PCI conditional compilation.

Change-Id: I958740f49b3298c165e662b89b586bda2b3d2ee8
CRs-Fixed: 986480
Houston Hoffman 9 years ago
parent
commit
bc69349d0d

+ 3 - 65
hif/inc/hif.h

@@ -306,76 +306,12 @@ bool hif_is_fastpath_mode_enabled(struct hif_opaque_softc *hif_ctx);
 void *hif_get_ce_handle(struct hif_opaque_softc *hif_ctx, int);
 #endif
 
-#if defined(HIF_PCI) && !defined(A_SIMOS_DEVHOST)
-/*
- * This API allows the Host to access Target registers of a given
- * A_target_id_t directly and relatively efficiently over PCIe.
- * This allows the Host to avoid extra overhead associated with
- * sending a message to firmware and waiting for a response message
- * from firmware, as is done on other interconnects.
- *
- * Yet there is some complexity with direct accesses because the
- * Target's power state is not known a priori. The Host must issue
- * special PCIe reads/writes in order to explicitly wake the Target
- * and to verify that it is awake and will remain awake.
- *
- * NB: Host endianness conversion is left for the caller to handle.
- *     These interfaces handle access; not interpretation.
- *
- * Usage:
- *   During initialization, use A_TARGET_ID to obtain an 'target ID'
- *   for use with these interfaces.
- *
- *   Use A_TARGET_READ and A_TARGET_WRITE to access Target space.
- *   These calls must be bracketed by A_TARGET_ACCESS_BEGIN and
- *   A_TARGET_ACCESS_END.  A single BEGIN/END pair is adequate for
- *   multiple READ/WRITE operations.
- *
- *   Use A_TARGET_ACCESS_BEGIN to put the Target in a state in
- *   which it is legal for the Host to directly access it. This
- *   may involve waking the Target from a low power state, which
- *   may take up to 2Ms!
- *
- *   Use A_TARGET_ACCESS_END to tell the Target that as far as
- *   this code path is concerned, it no longer needs to remain
- *   directly accessible.  BEGIN/END is under a reference counter;
- *   multiple code paths may issue BEGIN/END on a single targid.
- *
- *   For added efficiency, the Host may use A_TARGET_ACCESS_LIKELY.
- *   The LIKELY interface works just like A_TARGET_ACCESS_BEGIN,
- *   except that it may return before the Target is actually
- *   available. It's a vague indication that some Target accesses
- *   are expected "soon".  When the LIKELY API is used,
- *   A_TARGET_ACCESS_BEGIN must be used before any access.
- *
- *   There are several uses for the LIKELY/UNLIKELY API:
- *     -If there is some potential time before Target accesses
- *      and we want to get a head start on waking the Target
- *      (e.g. to overlap Target wake with Host-side malloc)
- *     -High-level code knows that it will call low-level
- *      functions that will use BEGIN/END, and we don't want
- *      to allow the Target to sleep until the entire sequence
- *      has completed.
- *
- *   A_TARGET_ACCESS_OK verifies that the Target can be
- *   accessed. In general, this should not be needed, but it
- *   may be useful for debugging or for special uses.
- *
- *   Note that there must be a matching END for each BEGIN
- *       AND   there must be a matching UNLIKELY for each LIKELY!
- *
- *   NB: This API is designed to allow some flexibility in tradeoffs
- *   between Target power utilization and Host efficiency and
- *   system performance.
- */
-
 /*
  * Enable/disable CDC max performance workaround
  * For max-performace set this to 0
  * To allow SoC to enter sleep set this to 1
  */
 #define CONFIG_DISABLE_CDC_MAX_PERF_WAR 0
-#endif
 
 #ifdef IPA_OFFLOAD
 void hif_ipa_get_ce_resource(struct hif_opaque_softc *scn,
@@ -437,7 +373,9 @@ struct hif_msg_callbacks {
 
 #ifdef HIF_PCI
 typedef struct pci_device_id hif_bus_id;
-#else
+#endif
+
+#ifdef HIF_SNOC
 typedef struct device hif_bus_id;
 #endif
 

+ 3 - 1
hif/inc/platform_icnss.h

@@ -30,7 +30,9 @@
 
 #ifdef HIF_PCI
 #include "icnss_stub.h"
-#else
+#endif
+
+#ifdef HIF_SNOC
 #include <soc/qcom/icnss.h>
 #endif
 

+ 3 - 4
hif/src/ath_procfs.c

@@ -33,11 +33,10 @@
 #include <asm/uaccess.h>        /* for copy_from_user */
 #include "ol_if_athvar.h"
 #include "hif.h"
-#if defined(HIF_PCI)
-#include "if_pci.h"
-#elif defined(HIF_USB)
+#if defined(HIF_USB)
 #include "if_usb.h"
-#elif defined(HIF_SDIO)
+#endif
+#if defined(HIF_SDIO)
 #include "if_ath_sdio.h"
 #endif
 #include "hif_debug.h"

+ 1 - 8
hif/src/ce/ce_main.c

@@ -41,9 +41,6 @@
 #define ATH_MODULE_NAME hif
 #include <a_debug.h>
 #include "hif_main.h"
-#ifdef HIF_PCI
-#include "ce_bmi.h"
-#endif
 #include "ce_api.h"
 #include "qdf_trace.h"
 #ifdef CONFIG_CNSS
@@ -55,11 +52,7 @@
 #include "ce_reg.h"
 #include "ce_assignment.h"
 #include "ce_tasklet.h"
-#ifdef HIF_PCI
-#include "icnss_stub.h"
-#else
-#include <soc/qcom/icnss.h>
-#endif
+#include "platform_icnss.h"
 #include "qwlan_version.h"
 
 #define CE_POLL_TIMEOUT 10      /* ms */

+ 1 - 5
hif/src/ce/ce_tasklet.c

@@ -44,11 +44,7 @@
 #include "ce_internal.h"
 #ifdef CONFIG_CNSS
 #include <net/cnss.h>
-#ifdef HIF_PCI
-#include "icnss_stub.h"
-#else
-#include <soc/qcom/icnss.h>
-#endif /* HIF_PCI */
+#include "platform_icnss.h"
 #endif
 #include "hif_debug.h"
 #include "hif_napi.h"

+ 3 - 1
hif/src/hif_io32.h

@@ -33,7 +33,9 @@
 #include "hif.h"
 #ifdef HIF_PCI
 #include "hif_io32_pci.h"
-#else
+#endif
+
+#ifdef HIF_SNOC
 #include "hif_io32_snoc.h"
 #endif /* HIF_PCI */
 #endif /* __HIF_IO32_H__ */

+ 8 - 8
hif/src/hif_main.c

@@ -54,11 +54,7 @@
 #include "epping_main.h"
 #include "hif_debug.h"
 #include "mp_dev.h"
-#ifdef HIF_PCI
-#include "icnss_stub.h"
-#else
-#include <soc/qcom/icnss.h>
-#endif
+#include "platform_icnss.h"
 
 #define AGC_DUMP         1
 #define CHANINFO_DUMP    2
@@ -635,7 +631,7 @@ void hif_disable(struct hif_opaque_softc *hif_ctx, enum hif_disable_type type)
  * Return: n/a
  */
 #if defined(TARGET_RAMDUMP_AFTER_KERNEL_PANIC) \
-&& defined(HIF_PCI) && defined(DEBUG)
+&& defined(DEBUG)
 
 static void hif_crash_shutdown_dump_bus_register(void *hif_ctx)
 {
@@ -660,11 +656,15 @@ static void hif_crash_shutdown_dump_bus_register(void *hif_ctx)
 void hif_crash_shutdown(struct hif_opaque_softc *hif_ctx)
 {
 	struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
-	struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_ctx);
 
-	if (!hif_state)
+	if (!hif_ctx)
 		return;
 
+	if (scn->bus_type == QDF_BUS_TYPE_SNOC) {
+		HIF_INFO_MED("%s: RAM dump disabled for bustype %d",
+				__func__, scn->bus_type);
+		return;
+	}
 
 	if (OL_TRGET_STATUS_RESET == scn->target_status) {
 		HIF_INFO_MED("%s: Target is already asserted, ignore!",

+ 0 - 4
hif/src/snoc/hif_io32_snoc.h

@@ -34,10 +34,6 @@
 #ifndef __HIF_IO32_SNOC_H__
 #define __HIF_IO32_SNOC_H__
 
-#ifdef HIF_PCI
-#error snoc and pci cannot be supported in parrallel at this time
-#endif
-
 #include "hif.h"
 #include "regtable.h"
 #include "ce_reg.h"