#include <linux/bitmap.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/io-64-nonatomic-lo-hi.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/nvme.h>
#include <linux/pci.h>
#include <linux/wait.h>
#include <linux/sched/signal.h>
#include "fun_queue.h"
#include "fun_dev.h"
#define FUN_ADMIN_CMD_TO_MS …
enum { … };
struct fun_cmd_ctx { … };
struct fun_sync_cmd_ctx { … };
static int fun_wait_ready(struct fun_dev *fdev, bool enabled)
{ … }
static int fun_check_csts_rdy(struct fun_dev *fdev, unsigned int expected_rdy)
{ … }
static int fun_update_cc_enable(struct fun_dev *fdev, unsigned int initial_rdy)
{ … }
static int fun_disable_ctrl(struct fun_dev *fdev)
{ … }
static int fun_enable_ctrl(struct fun_dev *fdev, u32 admin_cqesz_log2,
u32 admin_sqesz_log2)
{ … }
static int fun_map_bars(struct fun_dev *fdev, const char *name)
{ … }
static void fun_unmap_bars(struct fun_dev *fdev)
{ … }
static int fun_set_dma_masks(struct device *dev)
{ … }
static irqreturn_t fun_admin_irq(int irq, void *data)
{ … }
static void fun_complete_admin_cmd(struct fun_queue *funq, void *data,
void *entry, const struct fun_cqe_info *info)
{ … }
static int fun_init_cmd_ctx(struct fun_dev *fdev, unsigned int ntags)
{ … }
static int fun_enable_admin_queue(struct fun_dev *fdev,
const struct fun_dev_params *areq)
{ … }
static void fun_disable_admin_queue(struct fun_dev *fdev)
{ … }
static bool fun_adminq_stopped(struct fun_dev *fdev)
{ … }
static int fun_wait_for_tag(struct fun_dev *fdev, int *cpup)
{ … }
int fun_submit_admin_cmd(struct fun_dev *fdev, struct fun_admin_req_common *cmd,
fun_admin_callback_t cb, void *cb_data, bool wait_ok)
{ … }
static bool fun_abandon_admin_cmd(struct fun_dev *fd,
const struct fun_admin_req_common *cmd,
void *cb_data)
{ … }
static void fun_admin_stop(struct fun_dev *fdev)
{ … }
static void fun_admin_cmd_sync_cb(struct fun_dev *fd, void *rsp, void *cb_data)
{ … }
int fun_submit_admin_sync_cmd(struct fun_dev *fdev,
struct fun_admin_req_common *cmd, void *rsp,
size_t rspsize, unsigned int timeout)
{ … }
EXPORT_SYMBOL_GPL(…);
int fun_get_res_count(struct fun_dev *fdev, enum fun_admin_op res)
{ … }
EXPORT_SYMBOL_GPL(…);
int fun_res_destroy(struct fun_dev *fdev, enum fun_admin_op res,
unsigned int flags, u32 id)
{ … }
EXPORT_SYMBOL_GPL(…);
int fun_bind(struct fun_dev *fdev, enum fun_admin_bind_type type0,
unsigned int id0, enum fun_admin_bind_type type1,
unsigned int id1)
{ … }
EXPORT_SYMBOL_GPL(…);
static int fun_get_dev_limits(struct fun_dev *fdev)
{ … }
static int fun_alloc_irqs(struct pci_dev *pdev, unsigned int min_vecs)
{ … }
static int fun_alloc_irq_mgr(struct fun_dev *fdev)
{ … }
int fun_reserve_irqs(struct fun_dev *fdev, unsigned int nirqs, u16 *irq_indices)
{ … }
EXPORT_SYMBOL(…);
void fun_release_irqs(struct fun_dev *fdev, unsigned int nirqs,
u16 *irq_indices)
{ … }
EXPORT_SYMBOL(…);
static void fun_serv_handler(struct work_struct *work)
{ … }
void fun_serv_stop(struct fun_dev *fd)
{ … }
EXPORT_SYMBOL_GPL(…);
void fun_serv_restart(struct fun_dev *fd)
{ … }
EXPORT_SYMBOL_GPL(…);
void fun_serv_sched(struct fun_dev *fd)
{ … }
EXPORT_SYMBOL_GPL(…);
static int sanitize_dev(struct fun_dev *fdev)
{ … }
void fun_dev_disable(struct fun_dev *fdev)
{ … }
EXPORT_SYMBOL(…);
int fun_dev_enable(struct fun_dev *fdev, struct pci_dev *pdev,
const struct fun_dev_params *areq, const char *name)
{ … }
EXPORT_SYMBOL(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;