#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <net/cfg80211.h>
#include <net/mac80211.h>
#include <brcmu_utils.h>
#include <aiutils.h>
#include "types.h"
#include "main.h"
#include "dma.h"
#include "soc.h"
#include "scb.h"
#include "ampdu.h"
#include "debug.h"
#include "brcms_trace_events.h"
#define DMA64REGOFFS(field) …
#define DMA64TXREGOFFS(di, field) …
#define DMA64RXREGOFFS(di, field) …
#define D64RINGALIGN_BITS …
#define D64MAXRINGSZ …
#define D64RINGALIGN …
#define D64MAXDD …
#define D64_XC_XE …
#define D64_XC_SE …
#define D64_XC_LE …
#define D64_XC_FL …
#define D64_XC_PD …
#define D64_XC_AE …
#define D64_XC_AE_SHIFT …
#define D64_XP_LD_MASK …
#define D64_XS0_CD_MASK …
#define D64_XS0_XS_MASK …
#define D64_XS0_XS_SHIFT …
#define D64_XS0_XS_DISABLED …
#define D64_XS0_XS_ACTIVE …
#define D64_XS0_XS_IDLE …
#define D64_XS0_XS_STOPPED …
#define D64_XS0_XS_SUSP …
#define D64_XS1_AD_MASK …
#define D64_XS1_XE_MASK …
#define D64_XS1_XE_SHIFT …
#define D64_XS1_XE_NOERR …
#define D64_XS1_XE_DPE …
#define D64_XS1_XE_DFU …
#define D64_XS1_XE_DTE …
#define D64_XS1_XE_DESRE …
#define D64_XS1_XE_COREE …
#define D64_RC_RE …
#define D64_RC_RO_MASK …
#define D64_RC_RO_SHIFT …
#define D64_RC_FM …
#define D64_RC_SH …
#define D64_RC_OC …
#define D64_RC_PD …
#define D64_RC_AE …
#define D64_RC_AE_SHIFT …
#define DMA_CTRL_PEN …
#define DMA_CTRL_ROC …
#define DMA_CTRL_RXMULTI …
#define DMA_CTRL_UNFRAMED …
#define D64_RP_LD_MASK …
#define D64_RS0_CD_MASK …
#define D64_RS0_RS_MASK …
#define D64_RS0_RS_SHIFT …
#define D64_RS0_RS_DISABLED …
#define D64_RS0_RS_ACTIVE …
#define D64_RS0_RS_IDLE …
#define D64_RS0_RS_STOPPED …
#define D64_RS0_RS_SUSP …
#define D64_RS1_AD_MASK …
#define D64_RS1_RE_MASK …
#define D64_RS1_RE_SHIFT …
#define D64_RS1_RE_NOERR …
#define D64_RS1_RE_DPO …
#define D64_RS1_RE_DFU …
#define D64_RS1_RE_DTE …
#define D64_RS1_RE_DESRE …
#define D64_RS1_RE_COREE …
#define D64_FA_OFF_MASK …
#define D64_FA_SEL_MASK …
#define D64_FA_SEL_SHIFT …
#define D64_FA_SEL_XDD …
#define D64_FA_SEL_XDP …
#define D64_FA_SEL_RDD …
#define D64_FA_SEL_RDP …
#define D64_FA_SEL_XFD …
#define D64_FA_SEL_XFP …
#define D64_FA_SEL_RFD …
#define D64_FA_SEL_RFP …
#define D64_FA_SEL_RSD …
#define D64_FA_SEL_RSP …
#define D64_CTRL_COREFLAGS …
#define D64_CTRL1_EOT …
#define D64_CTRL1_IOC …
#define D64_CTRL1_EOF …
#define D64_CTRL1_SOF …
#define D64_CTRL2_BC_MASK …
#define D64_CTRL2_AE …
#define D64_CTRL2_AE_SHIFT …
#define D64_CTRL2_PARITY …
#define D64_CTRL_CORE_MASK …
#define D64_RX_FRM_STS_LEN …
#define D64_RX_FRM_STS_OVFL …
#define D64_RX_FRM_STS_DSCRCNT …
#define D64_RX_FRM_STS_DATATYPE …
#define BCMEXTRAHDROOM …
#define MAXNAMEL …
#define B2I(bytes, type) …
#define I2B(index, type) …
#define PCI32ADDR_HIGH …
#define PCI32ADDR_HIGH_SHIFT …
#define PCI64ADDR_HIGH …
#define PCI64ADDR_HIGH_SHIFT …
struct dma64desc { … };
struct dma_info { … };
static u32 parity32(__le32 data)
{ … }
static bool dma64_dd_parity(struct dma64desc *dd)
{ … }
static uint xxd(uint x, uint n)
{ … }
static uint txd(struct dma_info *di, uint x)
{ … }
static uint rxd(struct dma_info *di, uint x)
{ … }
static uint nexttxd(struct dma_info *di, uint i)
{ … }
static uint prevtxd(struct dma_info *di, uint i)
{ … }
static uint nextrxd(struct dma_info *di, uint i)
{ … }
static uint ntxdactive(struct dma_info *di, uint h, uint t)
{ … }
static uint nrxdactive(struct dma_info *di, uint h, uint t)
{ … }
static uint _dma_ctrlflags(struct dma_info *di, uint mask, uint flags)
{ … }
static bool _dma64_addrext(struct dma_info *di, uint ctrl_offset)
{ … }
static bool _dma_isaddrext(struct dma_info *di)
{ … }
static bool _dma_descriptor_align(struct dma_info *di)
{ … }
static void *dma_alloc_consistent(struct dma_info *di, uint size,
u16 align_bits, uint *alloced,
dma_addr_t *pap)
{ … }
static
u8 dma_align_sizetobits(uint size)
{ … }
static void *dma_ringalloc(struct dma_info *di, u32 boundary, uint size,
u16 *alignbits, uint *alloced,
dma_addr_t *descpa)
{ … }
static bool dma64_alloc(struct dma_info *di, uint direction)
{ … }
static bool _dma_alloc(struct dma_info *di, uint direction)
{ … }
struct dma_pub *dma_attach(char *name, struct brcms_c_info *wlc,
uint txregbase, uint rxregbase, uint ntxd, uint nrxd,
uint rxbufsize, int rxextheadroom,
uint nrxpost, uint rxoffset)
{ … }
static inline void
dma64_dd_upd(struct dma_info *di, struct dma64desc *ddring,
dma_addr_t pa, uint outidx, u32 *flags, u32 bufcount)
{ … }
void dma_detach(struct dma_pub *pub)
{ … }
static void
_dma_ddtable_init(struct dma_info *di, uint direction, dma_addr_t pa)
{ … }
static void _dma_rxenable(struct dma_info *di)
{ … }
void dma_rxinit(struct dma_pub *pub)
{ … }
static struct sk_buff *dma64_getnextrxp(struct dma_info *di, bool forceall)
{ … }
static struct sk_buff *_dma_getnextrxp(struct dma_info *di, bool forceall)
{ … }
int dma_rx(struct dma_pub *pub, struct sk_buff_head *skb_list)
{ … }
static bool dma64_rxidle(struct dma_info *di)
{ … }
static bool dma64_txidle(struct dma_info *di)
{ … }
bool dma_rxfill(struct dma_pub *pub)
{ … }
void dma_rxreclaim(struct dma_pub *pub)
{ … }
void dma_counterreset(struct dma_pub *pub)
{ … }
unsigned long dma_getvar(struct dma_pub *pub, const char *name)
{ … }
void dma_txinit(struct dma_pub *pub)
{ … }
void dma_txsuspend(struct dma_pub *pub)
{ … }
void dma_txresume(struct dma_pub *pub)
{ … }
bool dma_txsuspended(struct dma_pub *pub)
{ … }
void dma_txreclaim(struct dma_pub *pub, enum txd_range range)
{ … }
bool dma_txreset(struct dma_pub *pub)
{ … }
bool dma_rxreset(struct dma_pub *pub)
{ … }
static void dma_txenq(struct dma_info *di, struct sk_buff *p)
{ … }
static void ampdu_finalize(struct dma_info *di)
{ … }
static void prep_ampdu_frame(struct dma_info *di, struct sk_buff *p)
{ … }
static void dma_update_txavail(struct dma_info *di)
{ … }
int dma_txfast(struct brcms_c_info *wlc, struct dma_pub *pub,
struct sk_buff *p)
{ … }
void dma_txflush(struct dma_pub *pub)
{ … }
int dma_txpending(struct dma_pub *pub)
{ … }
void dma_kick_tx(struct dma_pub *pub)
{ … }
struct sk_buff *dma_getnexttxp(struct dma_pub *pub, enum txd_range range)
{ … }
void dma_walk_packets(struct dma_pub *dmah, void (*callback_fnc)
(void *pkt, void *arg_a), void *arg_a)
{ … }