#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/log2.h>
#include <linux/mm.h>
#include <linux/netdevice.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include "fun_dev.h"
#include "fun_queue.h"
void *fun_alloc_ring_mem(struct device *dma_dev, size_t depth,
size_t hw_desc_sz, size_t sw_desc_sz, bool wb,
int numa_node, dma_addr_t *dma_addr, void **sw_va,
volatile __be64 **wb_va)
{ … }
EXPORT_SYMBOL_GPL(…);
void fun_free_ring_mem(struct device *dma_dev, size_t depth, size_t hw_desc_sz,
bool wb, void *hw_va, dma_addr_t dma_addr, void *sw_va)
{ … }
EXPORT_SYMBOL_GPL(…);
int fun_sq_create(struct fun_dev *fdev, u16 flags, u32 sqid, u32 cqid,
u8 sqe_size_log2, u32 sq_depth, dma_addr_t dma_addr,
u8 coal_nentries, u8 coal_usec, u32 irq_num,
u32 scan_start_id, u32 scan_end_id,
u32 rq_buf_size_log2, u32 *sqidp, u32 __iomem **dbp)
{ … }
EXPORT_SYMBOL_GPL(…);
int fun_cq_create(struct fun_dev *fdev, u16 flags, u32 cqid, u32 rqid,
u8 cqe_size_log2, u32 cq_depth, dma_addr_t dma_addr,
u16 headroom, u16 tailroom, u8 coal_nentries, u8 coal_usec,
u32 irq_num, u32 scan_start_id, u32 scan_end_id, u32 *cqidp,
u32 __iomem **dbp)
{ … }
EXPORT_SYMBOL_GPL(…);
static bool fun_sq_is_head_wb(const struct fun_queue *funq)
{ … }
static void fun_clean_rq(struct fun_queue *funq)
{ … }
static int fun_fill_rq(struct fun_queue *funq)
{ … }
static void fun_rq_update_pos(struct fun_queue *funq, int buf_offset)
{ … }
static void *fun_data_from_rq(struct fun_queue *funq,
const struct fun_rsp_common *rsp, bool *need_free)
{ … }
unsigned int __fun_process_cq(struct fun_queue *funq, unsigned int max)
{ … }
unsigned int fun_process_cq(struct fun_queue *funq, unsigned int max)
{ … }
static int fun_alloc_sqes(struct fun_queue *funq)
{ … }
static int fun_alloc_cqes(struct fun_queue *funq)
{ … }
static int fun_alloc_rqes(struct fun_queue *funq)
{ … }
void fun_free_queue(struct fun_queue *funq)
{ … }
struct fun_queue *fun_alloc_queue(struct fun_dev *fdev, int qid,
const struct fun_queue_alloc_req *req)
{ … }
static int fun_create_cq(struct fun_queue *funq)
{ … }
static int fun_create_sq(struct fun_queue *funq)
{ … }
int fun_create_rq(struct fun_queue *funq)
{ … }
static unsigned int funq_irq(struct fun_queue *funq)
{ … }
int fun_request_irq(struct fun_queue *funq, const char *devname,
irq_handler_t handler, void *data)
{ … }
int fun_create_queue(struct fun_queue *funq)
{ … }
void fun_free_irq(struct fun_queue *funq)
{ … }