qcacmn: Pointerize more HIF apis
Pointerizing these apis is easier than removing external references or unifying them. Support multibus by pointerizing them. Change-Id: Iab86adf2076a082b75d9ba393123798e16f5b82e CRs-Fixed: 986480
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
4411ad4d0c
commit
8f239f67a2
@@ -220,7 +220,7 @@ static void ce_tasklet(unsigned long data)
|
||||
}
|
||||
|
||||
if (scn->target_status != OL_TRGET_STATUS_RESET)
|
||||
ce_irq_enable(scn, tasklet_entry->ce_id);
|
||||
hif_irq_enable(scn, tasklet_entry->ce_id);
|
||||
|
||||
hif_record_ce_desc_event(scn, tasklet_entry->ce_id, HIF_CE_TASKLET_EXIT,
|
||||
NULL, NULL, 0);
|
||||
@@ -297,7 +297,7 @@ static irqreturn_t ce_irq_handler(int irq, void *context)
|
||||
#ifndef HIF_PCI
|
||||
disable_irq_nosync(irq);
|
||||
#endif
|
||||
ce_irq_disable(scn, ce_id);
|
||||
hif_irq_disable(scn, ce_id);
|
||||
ce_irq_status(scn, ce_id, &host_status);
|
||||
qdf_atomic_inc(&scn->active_tasklet_cnt);
|
||||
hif_record_ce_desc_event(scn, ce_id, HIF_IRQ_EVENT, NULL, NULL, 0);
|
||||
|
@@ -158,3 +158,41 @@ int hif_target_sleep_state_adjust(struct hif_softc *hif_sc,
|
||||
return hif_sc->bus_ops.hif_target_sleep_state_adjust(hif_sc,
|
||||
sleep_ok, wait_for_it);
|
||||
}
|
||||
|
||||
void hif_disable_isr(struct hif_opaque_softc *hif_hdl)
|
||||
{
|
||||
struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_hdl);
|
||||
hif_sc->bus_ops.hif_disable_isr(hif_sc);
|
||||
}
|
||||
|
||||
void hif_nointrs(struct hif_softc *hif_sc)
|
||||
{
|
||||
hif_sc->bus_ops.hif_nointrs(hif_sc);
|
||||
}
|
||||
|
||||
QDF_STATUS hif_enable_bus(struct hif_softc *hif_sc, struct device *dev,
|
||||
void *bdev, const hif_bus_id *bid,
|
||||
enum hif_enable_type type)
|
||||
{
|
||||
return hif_sc->bus_ops.hif_enable_bus(hif_sc, dev, bdev, bid, type);
|
||||
}
|
||||
|
||||
void hif_disable_bus(struct hif_softc *hif_sc)
|
||||
{
|
||||
hif_sc->bus_ops.hif_disable_bus(hif_sc);
|
||||
}
|
||||
|
||||
int hif_bus_configure(struct hif_softc *hif_sc)
|
||||
{
|
||||
return hif_sc->bus_ops.hif_bus_configure(hif_sc);
|
||||
}
|
||||
|
||||
void hif_irq_enable(struct hif_softc *hif_sc, int irq_id)
|
||||
{
|
||||
hif_sc->bus_ops.hif_irq_enable(hif_sc, irq_id);
|
||||
}
|
||||
|
||||
void hif_irq_disable(struct hif_softc *hif_sc, int irq_id)
|
||||
{
|
||||
hif_sc->bus_ops.hif_irq_disable(hif_sc, irq_id);
|
||||
}
|
||||
|
@@ -44,6 +44,15 @@ struct hif_bus_ops {
|
||||
int (*hif_bus_resume)(struct hif_softc *hif_ctx);
|
||||
int (*hif_target_sleep_state_adjust)(struct hif_softc *scn,
|
||||
bool sleep_ok, bool wait_for_it);
|
||||
void (*hif_disable_isr)(struct hif_softc *hif_sc);
|
||||
void (*hif_nointrs)(struct hif_softc *hif_sc);
|
||||
QDF_STATUS (*hif_enable_bus)(struct hif_softc *hif_sc,
|
||||
struct device *dev, void *bdev, const hif_bus_id *bid,
|
||||
enum hif_enable_type type);
|
||||
void (*hif_disable_bus)(struct hif_softc *hif_sc);
|
||||
int (*hif_bus_configure)(struct hif_softc *hif_sc);
|
||||
void (*hif_irq_disable)(struct hif_softc *hif_sc, int ce_id);
|
||||
void (*hif_irq_enable)(struct hif_softc *hif_sc, int ce_id);
|
||||
};
|
||||
|
||||
#ifdef HIF_SNOC
|
||||
|
@@ -59,5 +59,13 @@ QDF_STATUS hif_initialize_pci_ops(struct hif_softc *hif_sc)
|
||||
bus_ops->hif_target_sleep_state_adjust =
|
||||
&hif_dummy_target_sleep_state_adjust;
|
||||
|
||||
bus_ops->hif_disable_isr = &hif_pci_disable_isr;
|
||||
bus_ops->hif_nointrs = &hif_pci_nointrs;
|
||||
bus_ops->hif_enable_bus = &hif_pci_enable_bus;
|
||||
bus_ops->hif_disable_bus = &hif_pci_disable_bus;
|
||||
bus_ops->hif_bus_configure = &hif_pci_bus_configure;
|
||||
bus_ops->hif_irq_disable = &hif_pci_irq_disable;
|
||||
bus_ops->hif_irq_enable = &hif_pci_irq_enable;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
@@ -25,9 +25,9 @@
|
||||
* to the Linux Foundation.
|
||||
*/
|
||||
|
||||
#include "multibus.h"
|
||||
#include "hif.h"
|
||||
#include "hif_main.h"
|
||||
#include "multibus.h"
|
||||
#include "snoc_api.h"
|
||||
#include "dummy.h"
|
||||
|
||||
@@ -48,5 +48,13 @@ QDF_STATUS hif_initialize_snoc_ops(struct hif_bus_ops *bus_ops)
|
||||
bus_ops->hif_target_sleep_state_adjust =
|
||||
&hif_dummy_target_sleep_state_adjust;
|
||||
|
||||
bus_ops->hif_disable_isr = &hif_snoc_disable_isr;
|
||||
bus_ops->hif_nointrs = &hif_snoc_nointrs;
|
||||
bus_ops->hif_enable_bus = &hif_snoc_enable_bus;
|
||||
bus_ops->hif_disable_bus = &hif_snoc_disable_bus;
|
||||
bus_ops->hif_bus_configure = &hif_snoc_bus_configure;
|
||||
bus_ops->hif_irq_disable = &hif_snoc_irq_disable;
|
||||
bus_ops->hif_irq_enable = &hif_snoc_irq_enable;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
@@ -34,3 +34,14 @@ int hif_pci_bus_suspend(struct hif_softc *scn);
|
||||
int hif_pci_bus_resume(struct hif_softc *scn);
|
||||
int hif_pci_target_sleep_state_adjust(struct hif_softc *scn,
|
||||
bool sleep_ok, bool wait_for_it);
|
||||
|
||||
void hif_pci_disable_isr(struct hif_softc *scn);
|
||||
void hif_pci_nointrs(struct hif_softc *scn);
|
||||
QDF_STATUS hif_pci_enable_bus(struct hif_softc *scn,
|
||||
struct device *dev, void *bdev,
|
||||
const hif_bus_id *bid,
|
||||
enum hif_enable_type type);
|
||||
void hif_pci_disable_bus(struct hif_softc *scn);
|
||||
int hif_pci_bus_configure(struct hif_softc *scn);
|
||||
void hif_pci_irq_disable(struct hif_softc *scn, int ce_id);
|
||||
void hif_pci_irq_enable(struct hif_softc *scn, int ce_id);
|
||||
|
@@ -28,3 +28,15 @@
|
||||
QDF_STATUS hif_snoc_open(struct hif_softc *hif_ctx,
|
||||
enum qdf_bus_type bus_type);
|
||||
void hif_snoc_close(struct hif_softc *hif_ctx);
|
||||
|
||||
|
||||
void hif_snoc_disable_isr(struct hif_softc *hif_ctx);
|
||||
void hif_snoc_nointrs(struct hif_softc *scn);
|
||||
QDF_STATUS hif_snoc_enable_bus(struct hif_softc *ol_sc,
|
||||
struct device *dev, void *bdev,
|
||||
const hif_bus_id *bid,
|
||||
enum hif_enable_type type);
|
||||
void hif_snoc_disable_bus(struct hif_softc *scn);
|
||||
int hif_snoc_bus_configure(struct hif_softc *scn);
|
||||
void hif_snoc_irq_disable(struct hif_softc *scn, int ce_id);
|
||||
void hif_snoc_irq_enable(struct hif_softc *scn, int ce_id);
|
||||
|
@@ -103,5 +103,8 @@ void hif_target_write_checked(struct hif_softc *scn, uint32_t offset,
|
||||
hif_write32_mb((scn->mem) + (offset), value)
|
||||
#endif
|
||||
|
||||
void hif_irq_enable(struct hif_softc *scn, int irq_id);
|
||||
void hif_irq_disable(struct hif_softc *scn, int irq_id);
|
||||
|
||||
|
||||
#endif /* __HIF_IO32_H__ */
|
||||
|
@@ -362,7 +362,7 @@ inline void hif_napi_enable_irq(struct hif_opaque_softc *hif, int id)
|
||||
{
|
||||
struct hif_softc *scn = HIF_GET_SOFTC(hif);
|
||||
|
||||
ce_irq_enable(scn, NAPI_ID2PIPE(id));
|
||||
hif_irq_enable(scn, NAPI_ID2PIPE(id));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -73,58 +73,5 @@
|
||||
#define CONFIG_PCIE_ENABLE_AXI_CLK_GATE 0
|
||||
|
||||
irqreturn_t hif_fw_interrupt_handler(int irq, void *arg);
|
||||
|
||||
/**
|
||||
* ce_irq_enable() - ce_irq_enable
|
||||
* @scn: hif_softc
|
||||
* @ce_id: ce_id
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static inline void ce_irq_enable(struct hif_softc *scn, int ce_id)
|
||||
{
|
||||
uint32_t tmp = 1 << ce_id;
|
||||
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn);
|
||||
|
||||
qdf_spin_lock_irqsave(&sc->irq_lock);
|
||||
scn->ce_irq_summary &= ~tmp;
|
||||
if (scn->ce_irq_summary == 0) {
|
||||
/* Enable Legacy PCI line interrupts */
|
||||
if (LEGACY_INTERRUPTS(sc) &&
|
||||
(scn->target_status != OL_TRGET_STATUS_RESET) &&
|
||||
(!qdf_atomic_read(&scn->link_suspended))) {
|
||||
|
||||
hif_write32_mb(scn->mem +
|
||||
(SOC_CORE_BASE_ADDRESS |
|
||||
PCIE_INTR_ENABLE_ADDRESS),
|
||||
HOST_GROUP0_MASK);
|
||||
|
||||
hif_read32_mb(scn->mem +
|
||||
(SOC_CORE_BASE_ADDRESS |
|
||||
PCIE_INTR_ENABLE_ADDRESS));
|
||||
}
|
||||
}
|
||||
if (scn->hif_init_done == true)
|
||||
Q_TARGET_ACCESS_END(scn);
|
||||
|
||||
qdf_spin_unlock_irqrestore(&sc->irq_lock);
|
||||
|
||||
/* check for missed firmware crash */
|
||||
hif_fw_interrupt_handler(0, scn);
|
||||
}
|
||||
/**
|
||||
* ce_irq_disable() - ce_irq_disable
|
||||
* @scn: hif_softc
|
||||
* @ce_id: ce_id
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static inline void ce_irq_disable(struct hif_softc *scn, int ce_id)
|
||||
{
|
||||
/* For Rome only need to wake up target */
|
||||
/* target access is maintained untill interrupts are re-enabled */
|
||||
Q_TARGET_ACCESS_BEGIN(scn);
|
||||
|
||||
}
|
||||
#endif /* HIF_PCI */
|
||||
#endif /* __HIF_IO32_PCI_H__ */
|
||||
|
@@ -1693,7 +1693,7 @@ done:
|
||||
*
|
||||
* return: 0 for success. nonzero for failure.
|
||||
*/
|
||||
int hif_bus_configure(struct hif_softc *hif_sc)
|
||||
int hif_pci_bus_configure(struct hif_softc *hif_sc)
|
||||
{
|
||||
int status = 0;
|
||||
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_sc);
|
||||
@@ -2156,7 +2156,7 @@ end:
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void hif_nointrs(struct hif_softc *scn)
|
||||
void hif_pci_nointrs(struct hif_softc *scn)
|
||||
{
|
||||
int i;
|
||||
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn);
|
||||
@@ -2187,7 +2187,7 @@ void hif_nointrs(struct hif_softc *scn)
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void hif_disable_bus(struct hif_softc *scn)
|
||||
void hif_pci_disable_bus(struct hif_softc *scn)
|
||||
{
|
||||
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn);
|
||||
struct pci_dev *pdev = sc->pdev;
|
||||
@@ -2727,9 +2727,8 @@ static void hif_free_msi_ctx(struct hif_softc *scn)
|
||||
}
|
||||
#endif
|
||||
|
||||
void hif_disable_isr(struct hif_opaque_softc *ol_sc)
|
||||
void hif_pci_disable_isr(struct hif_softc *scn)
|
||||
{
|
||||
struct hif_softc *scn = HIF_GET_SOFTC(ol_sc);
|
||||
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn);
|
||||
|
||||
hif_nointrs(scn);
|
||||
@@ -3169,7 +3168,7 @@ void hif_target_sync(struct hif_softc *scn)
|
||||
* type: enum hif_enable_type such as HIF_ENABLE_TYPE_PROBE
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS hif_enable_bus(struct hif_softc *ol_sc,
|
||||
QDF_STATUS hif_pci_enable_bus(struct hif_softc *ol_sc,
|
||||
struct device *dev, void *bdev,
|
||||
const hif_bus_id *bid,
|
||||
enum hif_enable_type type)
|
||||
@@ -3298,6 +3297,57 @@ int hif_get_target_type(struct hif_softc *ol_sc, struct device *dev,
|
||||
hif_type, target_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* hif_pci_irq_enable() - ce_irq_enable
|
||||
* @scn: hif_softc
|
||||
* @ce_id: ce_id
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void hif_pci_irq_enable(struct hif_softc *scn, int ce_id)
|
||||
{
|
||||
uint32_t tmp = 1 << ce_id;
|
||||
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn);
|
||||
|
||||
qdf_spin_lock_irqsave(&sc->irq_lock);
|
||||
scn->ce_irq_summary &= ~tmp;
|
||||
if (scn->ce_irq_summary == 0) {
|
||||
/* Enable Legacy PCI line interrupts */
|
||||
if (LEGACY_INTERRUPTS(sc) &&
|
||||
(scn->target_status != OL_TRGET_STATUS_RESET) &&
|
||||
(!qdf_atomic_read(&scn->link_suspended))) {
|
||||
|
||||
hif_write32_mb(scn->mem +
|
||||
(SOC_CORE_BASE_ADDRESS |
|
||||
PCIE_INTR_ENABLE_ADDRESS),
|
||||
HOST_GROUP0_MASK);
|
||||
|
||||
hif_read32_mb(scn->mem +
|
||||
(SOC_CORE_BASE_ADDRESS |
|
||||
PCIE_INTR_ENABLE_ADDRESS));
|
||||
}
|
||||
}
|
||||
if (scn->hif_init_done == true)
|
||||
Q_TARGET_ACCESS_END(scn);
|
||||
qdf_spin_unlock_irqrestore(&sc->irq_lock);
|
||||
|
||||
/* check for missed firmware crash */
|
||||
hif_fw_interrupt_handler(0, scn);
|
||||
}
|
||||
/**
|
||||
* hif_pci_irq_disable() - ce_irq_disable
|
||||
* @scn: hif_softc
|
||||
* @ce_id: ce_id
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void hif_pci_irq_disable(struct hif_softc *scn, int ce_id)
|
||||
{
|
||||
/* For Rome only need to wake up target */
|
||||
/* target access is maintained untill interrupts are re-enabled */
|
||||
Q_TARGET_ACCESS_BEGIN(scn);
|
||||
}
|
||||
|
||||
#ifdef FEATURE_RUNTIME_PM
|
||||
|
||||
void hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx)
|
||||
|
@@ -126,33 +126,4 @@ static inline void ce_disable_irq_in_group_reg(struct hif_softc *scn,
|
||||
mask = hif_read32_mb(scn->mem +
|
||||
ADRASTEA_CE_INTR_ENABLES);
|
||||
}
|
||||
|
||||
/**
|
||||
* ce_irq_enable() - enable copy engine IRQ
|
||||
* @scn: struct hif_softc
|
||||
* @ce_id: ce_id
|
||||
*
|
||||
* Return: N/A
|
||||
*/
|
||||
static inline void ce_irq_enable(struct hif_softc *scn,
|
||||
int ce_id)
|
||||
{
|
||||
icnss_enable_irq(ce_id);
|
||||
ce_enable_irq_in_individual_register(scn, ce_id);
|
||||
ce_enable_irq_in_group_reg(scn, 1<<ce_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* ce_irq_disable() - disable copy engine IRQ
|
||||
* @scn: struct hif_softc
|
||||
* @ce_id: ce_id
|
||||
*
|
||||
* Return: N/A
|
||||
*/
|
||||
static inline void ce_irq_disable(struct hif_softc *scn, int ce_id)
|
||||
{
|
||||
ce_disable_irq_in_group_reg(scn, 1<<ce_id);
|
||||
ce_clear_irq_group_status(scn, 1<<ce_id);
|
||||
ce_disable_irq_in_individual_register(scn, ce_id);
|
||||
}
|
||||
#endif
|
||||
|
@@ -37,6 +37,7 @@
|
||||
#include "hif_io32.h"
|
||||
#include "ce_main.h"
|
||||
#include "ce_tasklet.h"
|
||||
#include "snoc_api.h"
|
||||
|
||||
/**
|
||||
* hif_disable_isr(): disable isr
|
||||
@@ -47,10 +48,8 @@
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void hif_disable_isr(struct hif_opaque_softc *hif_ctx)
|
||||
void hif_snoc_disable_isr(struct hif_softc *scn)
|
||||
{
|
||||
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
|
||||
|
||||
hif_nointrs(scn);
|
||||
ce_tasklet_kill(scn);
|
||||
qdf_atomic_set(&scn->active_tasklet_cnt, 0);
|
||||
@@ -155,7 +154,7 @@ static QDF_STATUS hif_snoc_get_soc_info(struct hif_softc *scn)
|
||||
*
|
||||
* return: 0 for success. nonzero for failure.
|
||||
*/
|
||||
int hif_bus_configure(struct hif_softc *scn)
|
||||
int hif_snoc_bus_configure(struct hif_softc *scn)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -216,7 +215,7 @@ int hif_get_target_type(struct hif_softc *ol_sc, struct device *dev,
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS hif_enable_bus(struct hif_softc *ol_sc,
|
||||
QDF_STATUS hif_snoc_enable_bus(struct hif_softc *ol_sc,
|
||||
struct device *dev, void *bdev,
|
||||
const hif_bus_id *bid,
|
||||
enum hif_enable_type type)
|
||||
@@ -261,7 +260,7 @@ QDF_STATUS hif_enable_bus(struct hif_softc *ol_sc,
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void hif_disable_bus(struct hif_softc *scn)
|
||||
void hif_snoc_disable_bus(struct hif_softc *scn)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -274,7 +273,7 @@ void hif_disable_bus(struct hif_softc *scn)
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void hif_nointrs(struct hif_softc *scn)
|
||||
void hif_snoc_nointrs(struct hif_softc *scn)
|
||||
{
|
||||
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn);
|
||||
if (scn->request_irq_done) {
|
||||
@@ -282,3 +281,32 @@ void hif_nointrs(struct hif_softc *scn)
|
||||
scn->request_irq_done = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ce_irq_enable() - enable copy engine IRQ
|
||||
* @scn: struct hif_softc
|
||||
* @ce_id: ce_id
|
||||
*
|
||||
* Return: N/A
|
||||
*/
|
||||
void hif_snoc_irq_enable(struct hif_softc *scn,
|
||||
int ce_id)
|
||||
{
|
||||
icnss_enable_irq(ce_id);
|
||||
ce_enable_irq_in_individual_register(scn, ce_id);
|
||||
ce_enable_irq_in_group_reg(scn, 1<<ce_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* ce_irq_disable() - disable copy engine IRQ
|
||||
* @scn: struct hif_softc
|
||||
* @ce_id: ce_id
|
||||
*
|
||||
* Return: N/A
|
||||
*/
|
||||
void hif_snoc_irq_disable(struct hif_softc *scn, int ce_id)
|
||||
{
|
||||
ce_disable_irq_in_group_reg(scn, 1<<ce_id);
|
||||
ce_clear_irq_group_status(scn, 1<<ce_id);
|
||||
ce_disable_irq_in_individual_register(scn, ce_id);
|
||||
}
|
||||
|
Reference in New Issue
Block a user