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 <vbandaru@codeaurora.org>
CRs-Fixed: 1040617
This commit is contained in:
Houston Hoffman 2016-07-12 18:43:32 -07:00 • committed by Vishwajith Upendra
commit 6296c3e8f0
5 changed files with 39 additions and 7 deletions

View file

@ -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;

View file

@ -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))

View file

@ -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);

View file

@ -32,11 +32,13 @@
#include "if_ahb.h"
#include <linux/clk.h>
#include <linux/reset.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/device.h>
#include <linux/of.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
#include <linux/reset.h>
#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

View file

@ -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);