From 6296c3e8f06c6aeee84b550765f582973e387eaa Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Tue, 12 Jul 2016 18:43:32 -0700 Subject: [PATCH] qcacmn: Compilation fixes for AP135 platform 1. AP135 platform uses 3.4.104 kernel. Fixed API names for the kernel. 2. Implicit declaration function errors fixed. 3. Stack frame size exceed error fixed for hif_dump_ce_registers function. 4. BIG Endian #define fixed. Change-Id: I761762f6e51c0890e672f76817a911ade7126dd5 Acked-by: Venkateswara Swamy Bandaru CRs-Fixed: 1040617 --- hif/src/ce/ce_main.c | 6 +++--- hif/src/ce/ce_reg.h | 4 ++-- hif/src/snoc/if_ahb.c | 8 ++++++++ hif/src/snoc/if_ahb_reset.c | 24 ++++++++++++++++++++++-- hif/src/snoc/if_snoc.c | 4 ++++ 5 files changed, 39 insertions(+), 7 deletions(-) diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 60ff55618e98..7fd2b1c0d63a 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -2736,7 +2736,7 @@ int hif_dump_ce_registers(struct hif_softc *scn) { struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); uint32_t ce_reg_address = CE0_BASE_ADDRESS; - uint32_t ce_reg_values[CE_COUNT_MAX][CE_USEFUL_SIZE >> 2]; + uint32_t ce_reg_values[CE_USEFUL_SIZE >> 2]; uint32_t ce_reg_word_size = CE_USEFUL_SIZE >> 2; uint16_t i; QDF_STATUS status; @@ -2748,7 +2748,7 @@ int hif_dump_ce_registers(struct hif_softc *scn) } status = hif_diag_read_mem(hif_hdl, ce_reg_address, - (uint8_t *) &ce_reg_values[i][0], + (uint8_t *) &ce_reg_values[0], ce_reg_word_size * sizeof(uint32_t)); if (status != QDF_STATUS_SUCCESS) { @@ -2757,7 +2757,7 @@ int hif_dump_ce_registers(struct hif_softc *scn) } HIF_ERROR("CE%d Registers:", i); qdf_trace_hex_dump(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_DEBUG, - (uint8_t *) &ce_reg_values[i][0], + (uint8_t *) &ce_reg_values[0], ce_reg_word_size * sizeof(uint32_t)); } return 0; diff --git a/hif/src/ce/ce_reg.h b/hif/src/ce/ce_reg.h index 9651f756d9b9..297e88f7c25b 100644 --- a/hif/src/ce/ce_reg.h +++ b/hif/src/ce/ce_reg.h @@ -351,14 +351,14 @@ unsigned int hif_get_dst_ring_read_index(struct hif_softc *scn, #define CE_SRC_RING_BYTE_SWAP_SET(scn, CE_ctrl_addr, n) \ A_TARGET_WRITE(scn, (CE_ctrl_addr) + CE_CTRL1_ADDRESS, \ - (A_TARGET_READ((targid), \ + (A_TARGET_READ(scn, \ (CE_ctrl_addr) + CE_CTRL1_ADDRESS) \ & ~CE_CTRL1_SRC_RING_BYTE_SWAP_EN_MASK) | \ CE_CTRL1_SRC_RING_BYTE_SWAP_EN_SET(n)) #define CE_DEST_RING_BYTE_SWAP_SET(scn, CE_ctrl_addr, n) \ A_TARGET_WRITE(scn, (CE_ctrl_addr)+CE_CTRL1_ADDRESS, \ - (A_TARGET_READ((targid), \ + (A_TARGET_READ(scn, \ (CE_ctrl_addr) + CE_CTRL1_ADDRESS) \ & ~CE_CTRL1_DST_RING_BYTE_SWAP_EN_MASK) | \ CE_CTRL1_DST_RING_BYTE_SWAP_EN_SET(n)) diff --git a/hif/src/snoc/if_ahb.c b/hif/src/snoc/if_ahb.c index 362584ff0aba..dc6077841894 100644 --- a/hif/src/snoc/if_ahb.c +++ b/hif/src/snoc/if_ahb.c @@ -298,7 +298,11 @@ QDF_STATUS hif_ahb_enable_bus(struct hif_softc *ol_sc, goto err_cleanup1; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)); +#else + ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); +#endif if (ret) { HIF_ERROR("%s: failed to set dma mask error = %d", __func__, ret); @@ -306,7 +310,11 @@ QDF_STATUS hif_ahb_enable_bus(struct hif_softc *ol_sc, } /* Arrange for access to Target SoC registers. */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) mem = devm_ioremap_resource(&pdev->dev, memres); +#else + mem = devm_request_and_ioremap(&pdev->dev, memres); +#endif if (IS_ERR(mem)) { HIF_INFO("ath: ioremap error\n"); ret = PTR_ERR(mem); diff --git a/hif/src/snoc/if_ahb_reset.c b/hif/src/snoc/if_ahb_reset.c index 5cb1040929cb..6901f4251fee 100644 --- a/hif/src/snoc/if_ahb_reset.c +++ b/hif/src/snoc/if_ahb_reset.c @@ -32,11 +32,13 @@ #include "if_ahb.h" #include -#include #include #include #include #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) +#include +#endif /** * clk_enable_disable() - Enable/disable clock @@ -115,6 +117,7 @@ int hif_ahb_clk_enable_disable(struct device *dev, int enable) * * Return : zero on success, non-zero incase of error. */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) int hif_ahb_enable_radio(struct hif_pci_softc *sc, struct platform_device *pdev, const struct platform_device_id *id) @@ -237,8 +240,17 @@ int hif_ahb_enable_radio(struct hif_pci_softc *sc, err_reset: return -EIO; - } +#else +int hif_ahb_enable_radio(struct hif_pci_softc *sc, + struct platform_device *pdev, + const struct platform_device_id *id) +{ + qdf_print("%s:%d:Reset routines not available in kernel version.\n", + __func__, __LINE__); + return -EIO; +} +#endif /* "wifi_core_warm" is the other reset type */ #define AHB_RESET_TYPE "wifi_core_cold" @@ -252,6 +264,7 @@ err_reset: * * Return : n/a. */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) void hif_ahb_device_reset(struct hif_softc *scn) { struct reset_control *resetctl = NULL; @@ -367,6 +380,13 @@ void hif_ahb_device_reset(struct hif_softc *scn) iounmap(mem_tcsr); HIF_INFO("Reset complete for wifi core id : %d\n", wifi_core_id); } +#else +void hif_ahb_device_reset(struct hif_softc *scn) +{ + qdf_print("%s:%d:Reset routines not available in kernel version.\n", + __func__, __LINE__); +} +#endif diff --git a/hif/src/snoc/if_snoc.c b/hif/src/snoc/if_snoc.c index e0227251d0ef..df7937f62f5c 100644 --- a/hif/src/snoc/if_snoc.c +++ b/hif/src/snoc/if_snoc.c @@ -220,7 +220,11 @@ QDF_STATUS hif_snoc_enable_bus(struct hif_softc *ol_sc, int ret; int hif_type; int target_type; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(37)); +#else + ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(37)); +#endif if (ret) { HIF_ERROR("%s: failed to set dma mask error = %d", __func__, ret);