#include <linux/cpumask.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/netdevice.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <soc/fsl/qman.h>
#include "debugfs.h"
#include "regs.h"
#include "qi.h"
#include "desc.h"
#include "intern.h"
#include "desc_constr.h"
#define PREHDR_RSLS_SHIFT …
#define PREHDR_ABS …
#define MAX_RSP_FQ_BACKLOG_PER_CPU …
#define CAAM_QI_ENQUEUE_RETRIES …
#define CAAM_NAPI_WEIGHT …
struct caam_napi { … };
struct caam_qi_pcpu_priv { … } ____cacheline_aligned;
static DEFINE_PER_CPU(struct caam_qi_pcpu_priv, pcpu_qipriv);
static DEFINE_PER_CPU(int, last_cpu);
struct caam_qi_priv { … };
static struct caam_qi_priv qipriv ____cacheline_aligned;
bool caam_congested __read_mostly;
EXPORT_SYMBOL(…);
static struct kmem_cache *qi_cache;
static void *caam_iova_to_virt(struct iommu_domain *domain,
dma_addr_t iova_addr)
{ … }
int caam_qi_enqueue(struct device *qidev, struct caam_drv_req *req)
{ … }
EXPORT_SYMBOL(…);
static void caam_fq_ern_cb(struct qman_portal *qm, struct qman_fq *fq,
const union qm_mr_entry *msg)
{ … }
static struct qman_fq *create_caam_req_fq(struct device *qidev,
struct qman_fq *rsp_fq,
dma_addr_t hwdesc,
int fq_sched_flag)
{ … }
static int empty_retired_fq(struct device *qidev, struct qman_fq *fq)
{ … }
static int kill_fq(struct device *qidev, struct qman_fq *fq)
{ … }
static int empty_caam_fq(struct qman_fq *fq, struct caam_drv_ctx *drv_ctx)
{ … }
int caam_drv_ctx_update(struct caam_drv_ctx *drv_ctx, u32 *sh_desc)
{ … }
EXPORT_SYMBOL(…);
struct caam_drv_ctx *caam_drv_ctx_init(struct device *qidev,
int *cpu,
u32 *sh_desc)
{ … }
EXPORT_SYMBOL(…);
void *qi_cache_alloc(gfp_t flags)
{ … }
EXPORT_SYMBOL(…);
void qi_cache_free(void *obj)
{ … }
EXPORT_SYMBOL(…);
static int caam_qi_poll(struct napi_struct *napi, int budget)
{ … }
void caam_drv_ctx_rel(struct caam_drv_ctx *drv_ctx)
{ … }
EXPORT_SYMBOL(…);
static void caam_qi_shutdown(void *data)
{ … }
static void cgr_cb(struct qman_portal *qm, struct qman_cgr *cgr, int congested)
{ … }
static int caam_qi_napi_schedule(struct qman_portal *p, struct caam_napi *np,
bool sched_napi)
{ … }
static enum qman_cb_dqrr_result caam_rsp_fq_dqrr_cb(struct qman_portal *p,
struct qman_fq *rsp_fq,
const struct qm_dqrr_entry *dqrr,
bool sched_napi)
{ … }
static int alloc_rsp_fq_cpu(struct device *qidev, unsigned int cpu)
{ … }
static int init_cgr(struct device *qidev)
{ … }
static int alloc_rsp_fqs(struct device *qidev)
{ … }
static void free_rsp_fqs(void)
{ … }
static void free_caam_qi_pcpu_netdev(const cpumask_t *cpus)
{ … }
int caam_qi_init(struct platform_device *caam_pdev)
{ … }