#ifndef _FDMA_API_H_
#define _FDMA_API_H_
#include <linux/bits.h>
#include <linux/etherdevice.h>
#include <linux/types.h>
#define FDMA_DCB_INFO_DATAL(x) …
#define FDMA_DCB_INFO_TOKEN …
#define FDMA_DCB_INFO_INTR …
#define FDMA_DCB_INFO_SW(x) …
#define FDMA_DCB_STATUS_BLOCKL(x) …
#define FDMA_DCB_STATUS_SOF …
#define FDMA_DCB_STATUS_EOF …
#define FDMA_DCB_STATUS_INTR …
#define FDMA_DCB_STATUS_DONE …
#define FDMA_DCB_STATUS_BLOCKO(x) …
#define FDMA_DCB_INVALID_DATA …
#define FDMA_DB_MAX …
struct fdma;
struct fdma_db { … };
struct fdma_dcb { … };
struct fdma_ops { … };
struct fdma { … };
static inline void fdma_dcb_advance(struct fdma *fdma)
{ … }
static inline void fdma_db_advance(struct fdma *fdma)
{ … }
static inline void fdma_db_reset(struct fdma *fdma)
{ … }
static inline bool fdma_dcb_is_reusable(struct fdma *fdma)
{ … }
static inline bool fdma_db_is_done(struct fdma_db *db)
{ … }
static inline int fdma_db_len_get(struct fdma_db *db)
{ … }
static inline void fdma_dcb_len_set(struct fdma_dcb *dcb, u32 len)
{ … }
static inline struct fdma_db *fdma_db_get(struct fdma *fdma, int dcb_idx,
int db_idx)
{ … }
static inline struct fdma_db *fdma_db_next_get(struct fdma *fdma)
{ … }
static inline struct fdma_dcb *fdma_dcb_get(struct fdma *fdma, int dcb_idx)
{ … }
static inline struct fdma_dcb *fdma_dcb_next_get(struct fdma *fdma)
{ … }
static inline bool fdma_has_frames(struct fdma *fdma)
{ … }
static inline int fdma_nextptr_cb(struct fdma *fdma, int dcb_idx, u64 *nextptr)
{ … }
static inline u64 fdma_dataptr_get_contiguous(struct fdma *fdma, int dcb_idx,
int db_idx)
{ … }
static inline void *fdma_dataptr_virt_get_contiguous(struct fdma *fdma,
int dcb_idx, int db_idx)
{ … }
static inline bool fdma_is_last(struct fdma *fdma, struct fdma_dcb *dcb)
{ … }
int fdma_dcbs_init(struct fdma *fdma, u64 info, u64 status);
int fdma_db_add(struct fdma *fdma, int dcb_idx, int db_idx, u64 status);
int fdma_dcb_add(struct fdma *fdma, int dcb_idx, u64 info, u64 status);
int __fdma_dcb_add(struct fdma *fdma, int dcb_idx, u64 info, u64 status,
int (*dcb_cb)(struct fdma *fdma, int dcb_idx, u64 *nextptr),
int (*db_cb)(struct fdma *fdma, int dcb_idx, int db_idx,
u64 *dataptr));
int fdma_alloc_coherent(struct device *dev, struct fdma *fdma);
int fdma_alloc_phys(struct fdma *fdma);
void fdma_free_coherent(struct device *dev, struct fdma *fdma);
void fdma_free_phys(struct fdma *fdma);
u32 fdma_get_size(struct fdma *fdma);
u32 fdma_get_size_contiguous(struct fdma *fdma);
#endif