#include <linux/bitfield.h>
#include <linux/io.h>
#include <linux/skbuff.h>
#include "ccm.h"
#include "nfp_net.h"
#define NFP_CCM_MBOX_BATCH_LIMIT …
#define NFP_CCM_TIMEOUT …
#define NFP_CCM_MAX_QLEN …
enum nfp_net_mbox_cmsg_state { … };
struct nfp_ccm_mbox_cmsg_cb { … };
static u32 nfp_ccm_mbox_max_msg(struct nfp_net *nn)
{ … }
static void
nfp_ccm_mbox_msg_init(struct sk_buff *skb, unsigned int exp_reply, int max_len)
{ … }
static int nfp_ccm_mbox_maxlen(const struct sk_buff *skb)
{ … }
static bool nfp_ccm_mbox_done(struct sk_buff *skb)
{ … }
static bool nfp_ccm_mbox_in_progress(struct sk_buff *skb)
{ … }
static void nfp_ccm_mbox_set_busy(struct sk_buff *skb)
{ … }
static bool nfp_ccm_mbox_is_posted(struct sk_buff *skb)
{ … }
static void nfp_ccm_mbox_mark_posted(struct sk_buff *skb)
{ … }
static bool nfp_ccm_mbox_is_first(struct nfp_net *nn, struct sk_buff *skb)
{ … }
static bool nfp_ccm_mbox_should_run(struct nfp_net *nn, struct sk_buff *skb)
{ … }
static void nfp_ccm_mbox_mark_next_runner(struct nfp_net *nn)
{ … }
static void
nfp_ccm_mbox_write_tlv(struct nfp_net *nn, u32 off, u32 type, u32 len)
{ … }
static void nfp_ccm_mbox_copy_in(struct nfp_net *nn, struct sk_buff *last)
{ … }
static struct sk_buff *
nfp_ccm_mbox_find_req(struct nfp_net *nn, __be16 tag, struct sk_buff *last)
{ … }
static void nfp_ccm_mbox_copy_out(struct nfp_net *nn, struct sk_buff *last)
{ … }
static void
nfp_ccm_mbox_mark_all_err(struct nfp_net *nn, struct sk_buff *last, int err)
{ … }
static void nfp_ccm_mbox_run_queue_unlock(struct nfp_net *nn)
__releases(&nn->mbox_cmsg.queue.lock)
{ … }
static int nfp_ccm_mbox_skb_return(struct sk_buff *skb)
{ … }
static int
nfp_ccm_mbox_unlink_unlock(struct nfp_net *nn, struct sk_buff *skb,
enum nfp_ccm_type type)
__releases(&nn->mbox_cmsg.queue.lock)
{ … }
static int
nfp_ccm_mbox_msg_prepare(struct nfp_net *nn, struct sk_buff *skb,
enum nfp_ccm_type type,
unsigned int reply_size, unsigned int max_reply_size,
gfp_t flags)
{ … }
static int
nfp_ccm_mbox_msg_enqueue(struct nfp_net *nn, struct sk_buff *skb,
enum nfp_ccm_type type, bool critical)
{ … }
int __nfp_ccm_mbox_communicate(struct nfp_net *nn, struct sk_buff *skb,
enum nfp_ccm_type type,
unsigned int reply_size,
unsigned int max_reply_size, bool critical)
{ … }
int nfp_ccm_mbox_communicate(struct nfp_net *nn, struct sk_buff *skb,
enum nfp_ccm_type type,
unsigned int reply_size,
unsigned int max_reply_size)
{ … }
static void nfp_ccm_mbox_post_runq_work(struct work_struct *work)
{ … }
static void nfp_ccm_mbox_post_wait_work(struct work_struct *work)
{ … }
int nfp_ccm_mbox_post(struct nfp_net *nn, struct sk_buff *skb,
enum nfp_ccm_type type, unsigned int max_reply_size)
{ … }
struct sk_buff *
nfp_ccm_mbox_msg_alloc(struct nfp_net *nn, unsigned int req_size,
unsigned int reply_size, gfp_t flags)
{ … }
bool nfp_ccm_mbox_fits(struct nfp_net *nn, unsigned int size)
{ … }
int nfp_ccm_mbox_init(struct nfp_net *nn)
{ … }
void nfp_ccm_mbox_clean(struct nfp_net *nn)
{ … }
int nfp_ccm_mbox_alloc(struct nfp_net *nn)
{ … }
void nfp_ccm_mbox_free(struct nfp_net *nn)
{ … }