#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/completion.h>
#include <linux/crc32.h>
#include <linux/spinlock.h>
#include <linux/circ_buf.h>
#include <linux/log2.h>
#include "pcie_priv.h"
#include "pearl_pcie_regs.h"
#include "pearl_pcie_ipc.h"
#include "qtn_hw_ids.h"
#include "core.h"
#include "bus.h"
#include "shm_ipc.h"
#include "debug.h"
#define PEARL_TX_BD_SIZE_DEFAULT …
#define PEARL_RX_BD_SIZE_DEFAULT …
struct qtnf_pearl_bda { … } __packed;
struct qtnf_pearl_tx_bd { … } __packed;
struct qtnf_pearl_rx_bd { … } __packed;
struct qtnf_pearl_fw_hdr { … } __packed;
struct qtnf_pcie_pearl_state { … };
static inline void qtnf_init_hdp_irqs(struct qtnf_pcie_pearl_state *ps)
{ … }
static inline void qtnf_enable_hdp_irqs(struct qtnf_pcie_pearl_state *ps)
{ … }
static inline void qtnf_disable_hdp_irqs(struct qtnf_pcie_pearl_state *ps)
{ … }
static inline void qtnf_en_rxdone_irq(struct qtnf_pcie_pearl_state *ps)
{ … }
static inline void qtnf_dis_rxdone_irq(struct qtnf_pcie_pearl_state *ps)
{ … }
static inline void qtnf_en_txdone_irq(struct qtnf_pcie_pearl_state *ps)
{ … }
static inline void qtnf_dis_txdone_irq(struct qtnf_pcie_pearl_state *ps)
{ … }
static void qtnf_deassert_intx(struct qtnf_pcie_pearl_state *ps)
{ … }
static void qtnf_pearl_reset_ep(struct qtnf_pcie_pearl_state *ps)
{ … }
static void qtnf_pcie_pearl_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 void qtnf_clear_state(__le32 __iomem *reg, u32 state)
{ … }
static int qtnf_poll_state(__le32 __iomem *reg, u32 state, u32 delay_in_ms)
{ … }
static int pearl_alloc_bd_table(struct qtnf_pcie_pearl_state *ps)
{ … }
static int pearl_skb2rbd_attach(struct qtnf_pcie_pearl_state *ps, u16 index)
{ … }
static int pearl_alloc_rx_buffers(struct qtnf_pcie_pearl_state *ps)
{ … }
static void qtnf_pearl_free_xfer_buffers(struct qtnf_pcie_pearl_state *ps)
{ … }
static int pearl_hhbm_init(struct qtnf_pcie_pearl_state *ps)
{ … }
static int qtnf_pcie_pearl_init_xfer(struct qtnf_pcie_pearl_state *ps,
unsigned int tx_bd_size,
unsigned int rx_bd_size)
{ … }
static void qtnf_pearl_data_tx_reclaim(struct qtnf_pcie_pearl_state *ps)
{ … }
static int qtnf_tx_queue_ready(struct qtnf_pcie_pearl_state *ps)
{ … }
static int qtnf_pcie_skb_send(struct qtnf_bus *bus, struct sk_buff *skb)
{ … }
static int qtnf_pcie_data_tx(struct qtnf_bus *bus, struct sk_buff *skb,
unsigned int macid, unsigned int vifid)
{ … }
static int qtnf_pcie_data_tx_meta(struct qtnf_bus *bus, struct sk_buff *skb,
unsigned int macid, unsigned int vifid)
{ … }
static irqreturn_t qtnf_pcie_pearl_interrupt(int irq, void *data)
{ … }
static int qtnf_rx_data_ready(struct qtnf_pcie_pearl_state *ps)
{ … }
static int qtnf_pcie_pearl_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 void qtnf_pearl_tx_use_meta_info_set(struct qtnf_bus *bus, bool use_meta)
{ … }
static struct qtnf_bus_ops qtnf_pcie_pearl_bus_ops = …;
static int qtnf_dbg_irq_stats(struct seq_file *s, void *data)
{ … }
static int qtnf_dbg_hdp_stats(struct seq_file *s, void *data)
{ … }
static int qtnf_ep_fw_send(struct pci_dev *pdev, uint32_t size,
int blk, const u8 *pblk, const u8 *fw)
{ … }
static int
qtnf_ep_fw_load(struct qtnf_pcie_pearl_state *ps, const u8 *fw, u32 fw_size)
{ … }
static void qtnf_pearl_fw_work_handler(struct work_struct *work)
{ … }
static void qtnf_pearl_reclaim_tasklet_fn(struct tasklet_struct *t)
{ … }
static u64 qtnf_pearl_dma_mask_get(void)
{ … }
static int qtnf_pcie_pearl_probe(struct qtnf_bus *bus, unsigned int tx_bd_size,
unsigned int rx_bd_size)
{ … }
static void qtnf_pcie_pearl_remove(struct qtnf_bus *bus)
{ … }
#ifdef CONFIG_PM_SLEEP
static int qtnf_pcie_pearl_suspend(struct qtnf_bus *bus)
{ … }
static int qtnf_pcie_pearl_resume(struct qtnf_bus *bus)
{ … }
#endif
struct qtnf_bus *qtnf_pcie_pearl_alloc(struct pci_dev *pdev)
{ … }