linux/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c

// SPDX-License-Identifier: GPL-2.0+
/* Copyright (c) 2018 Quantenna Communications */

#include <linux/kernel.h>
#include <linux/firmware.h>
#include <linux/pci.h>
#include <linux/vmalloc.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/crc32.h>
#include <linux/completion.h>
#include <linux/spinlock.h>
#include <linux/circ_buf.h>

#include "pcie_priv.h"
#include "topaz_pcie_regs.h"
#include "topaz_pcie_ipc.h"
#include "qtn_hw_ids.h"
#include "core.h"
#include "bus.h"
#include "shm_ipc.h"
#include "debug.h"

#define TOPAZ_TX_BD_SIZE_DEFAULT
#define TOPAZ_RX_BD_SIZE_DEFAULT

struct qtnf_topaz_tx_bd {} __packed;

struct qtnf_topaz_rx_bd {} __packed;

struct qtnf_extra_bd_params {} __packed;

#define QTNF_BD_PARAM_OFFSET(n)

struct vmac_pkt_info {};

struct qtnf_topaz_bda {} __packed;

struct qtnf_pcie_topaz_state {};

static void qtnf_deassert_intx(struct qtnf_pcie_topaz_state *ts)
{}

static inline int qtnf_topaz_intx_asserted(struct qtnf_pcie_topaz_state *ts)
{}

static void qtnf_topaz_reset_ep(struct qtnf_pcie_topaz_state *ts)
{}

static void setup_rx_irqs(struct qtnf_pcie_topaz_state *ts)
{}

static void enable_rx_irqs(struct qtnf_pcie_topaz_state *ts)
{}

static void disable_rx_irqs(struct qtnf_pcie_topaz_state *ts)
{}

static void qtnf_topaz_ipc_gen_ep_int(void *arg)
{}

static int qtnf_is_state(__le32 __iomem *reg, u32 state)
{}

static void qtnf_set_state(__le32 __iomem *reg, u32 state)
{}

static int qtnf_poll_state(__le32 __iomem *reg, u32 state, u32 delay_in_ms)
{}

static int topaz_alloc_bd_table(struct qtnf_pcie_topaz_state *ts,
				struct qtnf_topaz_bda __iomem *bda)
{}

static int
topaz_skb2rbd_attach(struct qtnf_pcie_topaz_state *ts, u16 index, u32 wrap)
{}

static int topaz_alloc_rx_buffers(struct qtnf_pcie_topaz_state *ts)
{}

/* all rx/tx activity should have ceased before calling this function */
static void qtnf_topaz_free_xfer_buffers(struct qtnf_pcie_topaz_state *ts)
{}

static int qtnf_pcie_topaz_init_xfer(struct qtnf_pcie_topaz_state *ts,
				     unsigned int tx_bd_size,
				     unsigned int rx_bd_size)
{}

static void qtnf_topaz_data_tx_reclaim(struct qtnf_pcie_topaz_state *ts)
{}

static void qtnf_try_stop_xmit(struct qtnf_bus *bus, struct net_device *ndev)
{}

static void qtnf_try_wake_xmit(struct qtnf_bus *bus, struct net_device *ndev)
{}

static int qtnf_tx_queue_ready(struct qtnf_pcie_topaz_state *ts)
{}

static int qtnf_pcie_data_tx(struct qtnf_bus *bus, struct sk_buff *skb,
			     unsigned int macid, unsigned int vifid)
{}

static irqreturn_t qtnf_pcie_topaz_interrupt(int irq, void *data)
{}

static int qtnf_rx_data_ready(struct qtnf_pcie_topaz_state *ts)
{}

static int qtnf_topaz_rx_poll(struct napi_struct *napi, int budget)
{}

static void
qtnf_pcie_data_tx_timeout(struct qtnf_bus *bus, struct net_device *ndev)
{}

static void qtnf_pcie_data_rx_start(struct qtnf_bus *bus)
{}

static void qtnf_pcie_data_rx_stop(struct qtnf_bus *bus)
{}

static struct qtnf_bus_ops qtnf_pcie_topaz_bus_ops =;

static int qtnf_dbg_irq_stats(struct seq_file *s, void *data)
{}

static int qtnf_dbg_pkt_stats(struct seq_file *s, void *data)
{}

static void qtnf_reset_dma_offset(struct qtnf_pcie_topaz_state *ts)
{}

static int qtnf_pcie_endian_detect(struct qtnf_pcie_topaz_state *ts)
{}

static int qtnf_pre_init_ep(struct qtnf_bus *bus)
{}

static int qtnf_post_init_ep(struct qtnf_pcie_topaz_state *ts)
{}

static int
qtnf_ep_fw_load(struct qtnf_pcie_topaz_state *ts, const u8 *fw, u32 fw_size)
{}

static int qtnf_topaz_fw_upload(struct qtnf_pcie_topaz_state *ts,
				const char *fwname)
{}

static void qtnf_topaz_fw_work_handler(struct work_struct *work)
{}

static void qtnf_reclaim_tasklet_fn(struct tasklet_struct *t)
{}

static u64 qtnf_topaz_dma_mask_get(void)
{}

static int qtnf_pcie_topaz_probe(struct qtnf_bus *bus,
				 unsigned int tx_bd_num, unsigned int rx_bd_num)
{}

static void qtnf_pcie_topaz_remove(struct qtnf_bus *bus)
{}

#ifdef CONFIG_PM_SLEEP
static int qtnf_pcie_topaz_suspend(struct qtnf_bus *bus)
{}

static int qtnf_pcie_topaz_resume(struct qtnf_bus *bus)
{}
#endif

struct qtnf_bus *qtnf_pcie_topaz_alloc(struct pci_dev *pdev)
{}