This source file includes following definitions.
- dma_spin_for_len
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #ifndef _BRCM_DMA_H_
18 #define _BRCM_DMA_H_
19
20 #include <linux/delay.h>
21 #include <linux/skbuff.h>
22 #include "types.h"
23
24
25 #define DMA_TX 1
26 #define DMA_RX 2
27
28
29
30
31
32
33
34
35
36 struct dma32diag {
37 u32 fifoaddr;
38 u32 fifodatalow;
39 u32 fifodatahigh;
40 u32 pad;
41 };
42
43
44
45
46 struct dma64regs {
47 u32 control;
48 u32 ptr;
49 u32 addrlow;
50 u32 addrhigh;
51 u32 status0;
52 u32 status1;
53 };
54
55
56 enum txd_range {
57 DMA_RANGE_ALL = 1,
58 DMA_RANGE_TRANSMITTED,
59 DMA_RANGE_TRANSFERED
60 };
61
62
63
64
65
66 struct dma_pub {
67 uint txavail;
68 uint dmactrlflags;
69
70
71 uint rxgiants;
72 uint rxnobuf;
73
74 uint txnobuf;
75 };
76
77 extern struct dma_pub *dma_attach(char *name, struct brcms_c_info *wlc,
78 uint txregbase, uint rxregbase,
79 uint ntxd, uint nrxd,
80 uint rxbufsize, int rxextheadroom,
81 uint nrxpost, uint rxoffset);
82
83 void dma_rxinit(struct dma_pub *pub);
84 int dma_rx(struct dma_pub *pub, struct sk_buff_head *skb_list);
85 bool dma_rxfill(struct dma_pub *pub);
86 bool dma_rxreset(struct dma_pub *pub);
87 bool dma_txreset(struct dma_pub *pub);
88 void dma_txinit(struct dma_pub *pub);
89 int dma_txfast(struct brcms_c_info *wlc, struct dma_pub *pub,
90 struct sk_buff *p0);
91 void dma_txflush(struct dma_pub *pub);
92 int dma_txpending(struct dma_pub *pub);
93 void dma_kick_tx(struct dma_pub *pub);
94 void dma_txsuspend(struct dma_pub *pub);
95 bool dma_txsuspended(struct dma_pub *pub);
96 void dma_txresume(struct dma_pub *pub);
97 void dma_txreclaim(struct dma_pub *pub, enum txd_range range);
98 void dma_rxreclaim(struct dma_pub *pub);
99 void dma_detach(struct dma_pub *pub);
100 unsigned long dma_getvar(struct dma_pub *pub, const char *name);
101 struct sk_buff *dma_getnexttxp(struct dma_pub *pub, enum txd_range range);
102 void dma_counterreset(struct dma_pub *pub);
103
104 void dma_walk_packets(struct dma_pub *dmah, void (*callback_fnc)
105 (void *pkt, void *arg_a), void *arg_a);
106
107
108
109
110
111
112
113 static inline void dma_spin_for_len(uint len, struct sk_buff *head)
114 {
115 #if defined(CONFIG_BCM47XX)
116 if (!len) {
117 while (!(len = *(u16 *) KSEG1ADDR(head->data)))
118 udelay(1);
119
120 *(u16 *) (head->data) = cpu_to_le16((u16) len);
121 }
122 #endif
123 }
124
125 #endif