diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/brcm80211/brcmsmac/bcmsrom.c | 1 | ||||
-rw-r--r-- | drivers/staging/brcm80211/brcmsmac/dma.c | 36 | ||||
-rw-r--r-- | drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c | 1 | ||||
-rw-r--r-- | drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c | 1 | ||||
-rw-r--r-- | drivers/staging/brcm80211/brcmsmac/wl_ucode.h | 2 | ||||
-rw-r--r-- | drivers/staging/brcm80211/brcmsmac/wlc_main.h | 20 | ||||
-rw-r--r-- | drivers/staging/brcm80211/brcmsmac/wlc_pub.h | 1 | ||||
-rw-r--r-- | drivers/staging/brcm80211/brcmsmac/wlc_types.h | 18 | ||||
-rw-r--r-- | drivers/staging/brcm80211/include/bcmdefs.h | 108 |
9 files changed, 82 insertions, 106 deletions
diff --git a/drivers/staging/brcm80211/brcmsmac/bcmsrom.c b/drivers/staging/brcm80211/brcmsmac/bcmsrom.c index 311bc0cdaa8..952bc402263 100644 --- a/drivers/staging/brcm80211/brcmsmac/bcmsrom.c +++ b/drivers/staging/brcm80211/brcmsmac/bcmsrom.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
21 | #include <linux/pci.h> | 21 | #include <linux/pci.h> |
22 | #include <stdarg.h> | 22 | #include <stdarg.h> |
23 | #include "wlc_types.h" | ||
23 | #include <bcmutils.h> | 24 | #include <bcmutils.h> |
24 | #include <bcmsoc.h> | 25 | #include <bcmsoc.h> |
25 | #include <sbchipc.h> | 26 | #include <sbchipc.h> |
diff --git a/drivers/staging/brcm80211/brcmsmac/dma.c b/drivers/staging/brcm80211/brcmsmac/dma.c index 77baef2eebe..611a7e21e7e 100644 --- a/drivers/staging/brcm80211/brcmsmac/dma.c +++ b/drivers/staging/brcm80211/brcmsmac/dma.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <bcmutils.h> | 24 | #include <bcmutils.h> |
25 | #include <aiutils.h> | 25 | #include <aiutils.h> |
26 | 26 | ||
27 | #include "wlc_types.h" | ||
27 | #include <sbdma.h> | 28 | #include <sbdma.h> |
28 | #include <bcmdma.h> | 29 | #include <bcmdma.h> |
29 | 30 | ||
@@ -148,6 +149,19 @@ | |||
148 | #define D64_RX_FRM_STS_DSCRCNT 0x0f000000 /* no. of descriptors used - 1 */ | 149 | #define D64_RX_FRM_STS_DSCRCNT 0x0f000000 /* no. of descriptors used - 1 */ |
149 | #define D64_RX_FRM_STS_DATATYPE 0xf0000000 /* core-dependent data type */ | 150 | #define D64_RX_FRM_STS_DATATYPE 0xf0000000 /* core-dependent data type */ |
150 | 151 | ||
152 | #define DMADDRWIDTH_30 30 /* 30-bit addressing capability */ | ||
153 | #define DMADDRWIDTH_32 32 /* 32-bit addressing capability */ | ||
154 | #define DMADDRWIDTH_63 63 /* 64-bit addressing capability */ | ||
155 | #define DMADDRWIDTH_64 64 /* 64-bit addressing capability */ | ||
156 | |||
157 | /* packet headroom necessary to accommodate the largest header in the system, (i.e TXOFF). | ||
158 | * By doing, we avoid the need to allocate an extra buffer for the header when bridging to WL. | ||
159 | * There is a compile time check in wlc.c which ensure that this value is at least as big | ||
160 | * as TXOFF. This value is used in dma_rxfill (dma.c). | ||
161 | */ | ||
162 | |||
163 | #define BCMEXTRAHDROOM 172 | ||
164 | |||
151 | /* debug/trace */ | 165 | /* debug/trace */ |
152 | #ifdef BCMDBG | 166 | #ifdef BCMDBG |
153 | #define DMA_ERROR(args) \ | 167 | #define DMA_ERROR(args) \ |
@@ -171,6 +185,15 @@ | |||
171 | 185 | ||
172 | #define DMA_NONE(args) | 186 | #define DMA_NONE(args) |
173 | 187 | ||
188 | typedef unsigned long dmaaddr_t; | ||
189 | #define PHYSADDRHI(_pa) (0) | ||
190 | #define PHYSADDRHISET(_pa, _val) | ||
191 | #define PHYSADDRLO(_pa) ((_pa)) | ||
192 | #define PHYSADDRLOSET(_pa, _val) \ | ||
193 | do { \ | ||
194 | (_pa) = (_val); \ | ||
195 | } while (0) | ||
196 | |||
174 | #define d64txregs dregs.d64_u.txregs_64 | 197 | #define d64txregs dregs.d64_u.txregs_64 |
175 | #define d64rxregs dregs.d64_u.rxregs_64 | 198 | #define d64rxregs dregs.d64_u.rxregs_64 |
176 | #define txd64 dregs.d64_u.txd_64 | 199 | #define txd64 dregs.d64_u.txd_64 |
@@ -186,6 +209,19 @@ static uint dma_msg_level; | |||
186 | #define R_SM(r) (*(r)) | 209 | #define R_SM(r) (*(r)) |
187 | #define W_SM(r, v) (*(r) = (v)) | 210 | #define W_SM(r, v) (*(r) = (v)) |
188 | 211 | ||
212 | /* One physical DMA segment */ | ||
213 | typedef struct { | ||
214 | dmaaddr_t addr; | ||
215 | u32 length; | ||
216 | } dma_seg_t; | ||
217 | |||
218 | typedef struct { | ||
219 | void *oshdmah; /* Opaque handle for OSL to store its information */ | ||
220 | uint origsize; /* Size of the virtual packet */ | ||
221 | uint nsegs; | ||
222 | dma_seg_t segs[MAX_DMA_SEGS]; | ||
223 | } dma_seg_map_t; | ||
224 | |||
189 | /* | 225 | /* |
190 | * DMA Descriptor | 226 | * DMA Descriptor |
191 | * Descriptors are only read by the hardware, never written back. | 227 | * Descriptors are only read by the hardware, never written back. |
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c index 22ba415c047..1e9865fb955 100644 --- a/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c +++ b/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <bcmdevs.h> | 29 | #include <bcmdevs.h> |
30 | #include <sbdma.h> | 30 | #include <sbdma.h> |
31 | 31 | ||
32 | #include <wlc_types.h> | ||
32 | #include <wlc_phy_int.h> | 33 | #include <wlc_phy_int.h> |
33 | #include <wlc_phyreg_n.h> | 34 | #include <wlc_phyreg_n.h> |
34 | #include <wlc_phy_radio.h> | 35 | #include <wlc_phy_radio.h> |
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c index 620eb86f1fe..78d8cbe2887 100644 --- a/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c +++ b/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_n.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <bcmdevs.h> | 27 | #include <bcmdevs.h> |
28 | #include <sbdma.h> | 28 | #include <sbdma.h> |
29 | 29 | ||
30 | #include <wlc_types.h> | ||
30 | #include <wlc_phy_radio.h> | 31 | #include <wlc_phy_radio.h> |
31 | #include <wlc_phy_int.h> | 32 | #include <wlc_phy_int.h> |
32 | #include <wlc_phyreg_n.h> | 33 | #include <wlc_phyreg_n.h> |
diff --git a/drivers/staging/brcm80211/brcmsmac/wl_ucode.h b/drivers/staging/brcm80211/brcmsmac/wl_ucode.h index 6933fda0e6a..28838d83854 100644 --- a/drivers/staging/brcm80211/brcmsmac/wl_ucode.h +++ b/drivers/staging/brcm80211/brcmsmac/wl_ucode.h | |||
@@ -14,6 +14,8 @@ | |||
14 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 14 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "wlc_types.h" /* forward structure declarations */ | ||
18 | |||
17 | #define MIN_FW_SIZE 40000 /* minimum firmware file size in bytes */ | 19 | #define MIN_FW_SIZE 40000 /* minimum firmware file size in bytes */ |
18 | #define MAX_FW_SIZE 150000 | 20 | #define MAX_FW_SIZE 150000 |
19 | 21 | ||
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_main.h b/drivers/staging/brcm80211/brcmsmac/wlc_main.h index d06633973de..4e62b11a8ed 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_main.h +++ b/drivers/staging/brcm80211/brcmsmac/wlc_main.h | |||
@@ -47,6 +47,24 @@ | |||
47 | 47 | ||
48 | #define AC_COUNT 4 | 48 | #define AC_COUNT 4 |
49 | 49 | ||
50 | /* Macros for doing definition and get/set of bitfields | ||
51 | * Usage example, e.g. a three-bit field (bits 4-6): | ||
52 | * #define <NAME>_M BITFIELD_MASK(3) | ||
53 | * #define <NAME>_S 4 | ||
54 | * ... | ||
55 | * regval = R_REG(osh, ®s->regfoo); | ||
56 | * field = GFIELD(regval, <NAME>); | ||
57 | * regval = SFIELD(regval, <NAME>, 1); | ||
58 | * W_REG(osh, ®s->regfoo, regval); | ||
59 | */ | ||
60 | #define BITFIELD_MASK(width) \ | ||
61 | (((unsigned)1 << (width)) - 1) | ||
62 | #define GFIELD(val, field) \ | ||
63 | (((val) >> field ## _S) & field ## _M) | ||
64 | #define SFIELD(val, field, bits) \ | ||
65 | (((val) & (~(field ## _M << field ## _S))) | \ | ||
66 | ((unsigned)(bits) << field ## _S)) | ||
67 | |||
50 | /* For managing scan result lists */ | 68 | /* For managing scan result lists */ |
51 | struct wlc_bss_list { | 69 | struct wlc_bss_list { |
52 | uint count; | 70 | uint count; |
@@ -158,6 +176,8 @@ extern const u8 prio2fifo[]; | |||
158 | #define EDCF_LONG_M BITFIELD_MASK(4) | 176 | #define EDCF_LONG_M BITFIELD_MASK(4) |
159 | #define EDCF_LFB_M BITFIELD_MASK(4) | 177 | #define EDCF_LFB_M BITFIELD_MASK(4) |
160 | 178 | ||
179 | #define NFIFO 6 /* # tx/rx fifopairs */ | ||
180 | |||
161 | #define WLC_WME_RETRY_SHORT_GET(wlc, ac) GFIELD(wlc->wme_retries[ac], EDCF_SHORT) | 181 | #define WLC_WME_RETRY_SHORT_GET(wlc, ac) GFIELD(wlc->wme_retries[ac], EDCF_SHORT) |
162 | #define WLC_WME_RETRY_SFB_GET(wlc, ac) GFIELD(wlc->wme_retries[ac], EDCF_SFB) | 182 | #define WLC_WME_RETRY_SFB_GET(wlc, ac) GFIELD(wlc->wme_retries[ac], EDCF_SFB) |
163 | #define WLC_WME_RETRY_LONG_GET(wlc, ac) GFIELD(wlc->wme_retries[ac], EDCF_LONG) | 183 | #define WLC_WME_RETRY_LONG_GET(wlc, ac) GFIELD(wlc->wme_retries[ac], EDCF_LONG) |
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_pub.h b/drivers/staging/brcm80211/brcmsmac/wlc_pub.h index bd0885e11bb..0ab16c45def 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_pub.h +++ b/drivers/staging/brcm80211/brcmsmac/wlc_pub.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #ifndef _wlc_pub_h_ | 17 | #ifndef _wlc_pub_h_ |
18 | #define _wlc_pub_h_ | 18 | #define _wlc_pub_h_ |
19 | 19 | ||
20 | #include "wlc_types.h" /* forward structure declarations */ | ||
20 | #include "bcmwifi.h" /* for chanspec_t */ | 21 | #include "bcmwifi.h" /* for chanspec_t */ |
21 | 22 | ||
22 | #define WLC_NUMRATES 16 /* max # of rates in a rateset */ | 23 | #define WLC_NUMRATES 16 /* max # of rates in a rateset */ |
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_types.h b/drivers/staging/brcm80211/brcmsmac/wlc_types.h index b8cede1e6d6..76a1348e119 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_types.h +++ b/drivers/staging/brcm80211/brcmsmac/wlc_types.h | |||
@@ -17,7 +17,24 @@ | |||
17 | #ifndef _wlc_types_h_ | 17 | #ifndef _wlc_types_h_ |
18 | #define _wlc_types_h_ | 18 | #define _wlc_types_h_ |
19 | 19 | ||
20 | /* Bus types */ | ||
21 | #define SI_BUS 0 /* SOC Interconnect */ | ||
22 | #define PCI_BUS 1 /* PCI target */ | ||
23 | #define SDIO_BUS 3 /* SDIO target */ | ||
24 | #define JTAG_BUS 4 /* JTAG */ | ||
25 | #define USB_BUS 5 /* USB (does not support R/W REG) */ | ||
26 | #define SPI_BUS 6 /* gSPI target */ | ||
27 | #define RPC_BUS 7 /* RPC target */ | ||
28 | |||
29 | #define WL_CHAN_FREQ_RANGE_2G 0 | ||
30 | #define WL_CHAN_FREQ_RANGE_5GL 1 | ||
31 | #define WL_CHAN_FREQ_RANGE_5GM 2 | ||
32 | #define WL_CHAN_FREQ_RANGE_5GH 3 | ||
33 | |||
34 | #define MAX_DMA_SEGS 4 | ||
35 | |||
20 | /* forward declarations */ | 36 | /* forward declarations */ |
37 | struct wl_info; | ||
21 | struct wlc_info; | 38 | struct wlc_info; |
22 | struct wlc_hw_info; | 39 | struct wlc_hw_info; |
23 | struct wlc_if; | 40 | struct wlc_if; |
@@ -27,5 +44,6 @@ struct antsel_info; | |||
27 | struct bmac_pmq; | 44 | struct bmac_pmq; |
28 | struct d11init; | 45 | struct d11init; |
29 | struct dma_pub; | 46 | struct dma_pub; |
47 | struct wlc_bsscfg; | ||
30 | 48 | ||
31 | #endif /* _wlc_types_h_ */ | 49 | #endif /* _wlc_types_h_ */ |
diff --git a/drivers/staging/brcm80211/include/bcmdefs.h b/drivers/staging/brcm80211/include/bcmdefs.h index 76138458c62..cf9dc0e132d 100644 --- a/drivers/staging/brcm80211/include/bcmdefs.h +++ b/drivers/staging/brcm80211/include/bcmdefs.h | |||
@@ -25,7 +25,6 @@ | |||
25 | #define USB_BUS 5 | 25 | #define USB_BUS 5 |
26 | #define SPI_BUS 6 | 26 | #define SPI_BUS 6 |
27 | 27 | ||
28 | |||
29 | #ifndef OFF | 28 | #ifndef OFF |
30 | #define OFF 0 | 29 | #define OFF 0 |
31 | #endif | 30 | #endif |
@@ -36,96 +35,6 @@ | |||
36 | 35 | ||
37 | #define AUTO (-1) /* Auto = -1 */ | 36 | #define AUTO (-1) /* Auto = -1 */ |
38 | 37 | ||
39 | /* Bus types */ | ||
40 | #define SI_BUS 0 /* SOC Interconnect */ | ||
41 | #define PCI_BUS 1 /* PCI target */ | ||
42 | #define SDIO_BUS 3 /* SDIO target */ | ||
43 | #define JTAG_BUS 4 /* JTAG */ | ||
44 | #define USB_BUS 5 /* USB (does not support R/W REG) */ | ||
45 | #define SPI_BUS 6 /* gSPI target */ | ||
46 | #define RPC_BUS 7 /* RPC target */ | ||
47 | |||
48 | |||
49 | /* Defines for DMA Address Width - Shared between OSL and HNDDMA */ | ||
50 | #define DMADDR_MASK_32 0x0 /* Address mask for 32-bits */ | ||
51 | #define DMADDR_MASK_30 0xc0000000 /* Address mask for 30-bits */ | ||
52 | #define DMADDR_MASK_0 0xffffffff /* Address mask for 0-bits (hi-part) */ | ||
53 | |||
54 | #define DMADDRWIDTH_30 30 /* 30-bit addressing capability */ | ||
55 | #define DMADDRWIDTH_32 32 /* 32-bit addressing capability */ | ||
56 | #define DMADDRWIDTH_63 63 /* 64-bit addressing capability */ | ||
57 | #define DMADDRWIDTH_64 64 /* 64-bit addressing capability */ | ||
58 | |||
59 | #ifdef BCMDMA64OSL | ||
60 | typedef struct { | ||
61 | u32 loaddr; | ||
62 | u32 hiaddr; | ||
63 | } dma64addr_t; | ||
64 | |||
65 | typedef dma64addr_t dmaaddr_t; | ||
66 | #define PHYSADDRHI(_pa) ((_pa).hiaddr) | ||
67 | #define PHYSADDRHISET(_pa, _val) \ | ||
68 | do { \ | ||
69 | (_pa).hiaddr = (_val); \ | ||
70 | } while (0) | ||
71 | #define PHYSADDRLO(_pa) ((_pa).loaddr) | ||
72 | #define PHYSADDRLOSET(_pa, _val) \ | ||
73 | do { \ | ||
74 | (_pa).loaddr = (_val); \ | ||
75 | } while (0) | ||
76 | |||
77 | #else | ||
78 | typedef unsigned long dmaaddr_t; | ||
79 | #define PHYSADDRHI(_pa) (0) | ||
80 | #define PHYSADDRHISET(_pa, _val) | ||
81 | #define PHYSADDRLO(_pa) ((_pa)) | ||
82 | #define PHYSADDRLOSET(_pa, _val) \ | ||
83 | do { \ | ||
84 | (_pa) = (_val); \ | ||
85 | } while (0) | ||
86 | #endif /* BCMDMA64OSL */ | ||
87 | |||
88 | /* One physical DMA segment */ | ||
89 | typedef struct { | ||
90 | dmaaddr_t addr; | ||
91 | u32 length; | ||
92 | } dma_seg_t; | ||
93 | |||
94 | #define MAX_DMA_SEGS 4 | ||
95 | |||
96 | typedef struct { | ||
97 | void *oshdmah; /* Opaque handle for OSL to store its information */ | ||
98 | uint origsize; /* Size of the virtual packet */ | ||
99 | uint nsegs; | ||
100 | dma_seg_t segs[MAX_DMA_SEGS]; | ||
101 | } dma_seg_map_t; | ||
102 | |||
103 | /* packet headroom necessary to accommodate the largest header in the system, (i.e TXOFF). | ||
104 | * By doing, we avoid the need to allocate an extra buffer for the header when bridging to WL. | ||
105 | * There is a compile time check in wlc.c which ensure that this value is at least as big | ||
106 | * as TXOFF. This value is used in dma_rxfill (dma.c). | ||
107 | */ | ||
108 | |||
109 | #define BCMEXTRAHDROOM 172 | ||
110 | |||
111 | /* Macros for doing definition and get/set of bitfields | ||
112 | * Usage example, e.g. a three-bit field (bits 4-6): | ||
113 | * #define <NAME>_M BITFIELD_MASK(3) | ||
114 | * #define <NAME>_S 4 | ||
115 | * ... | ||
116 | * regval = R_REG(osh, ®s->regfoo); | ||
117 | * field = GFIELD(regval, <NAME>); | ||
118 | * regval = SFIELD(regval, <NAME>, 1); | ||
119 | * W_REG(osh, ®s->regfoo, regval); | ||
120 | */ | ||
121 | #define BITFIELD_MASK(width) \ | ||
122 | (((unsigned)1 << (width)) - 1) | ||
123 | #define GFIELD(val, field) \ | ||
124 | (((val) >> field ## _S) & field ## _M) | ||
125 | #define SFIELD(val, field, bits) \ | ||
126 | (((val) & (~(field ## _M << field ## _S))) | \ | ||
127 | ((unsigned)(bits) << field ## _S)) | ||
128 | |||
129 | /* | 38 | /* |
130 | * Priority definitions according 802.1D | 39 | * Priority definitions according 802.1D |
131 | */ | 40 | */ |
@@ -137,17 +46,12 @@ typedef struct { | |||
137 | #define PRIO_8021D_VI 5 | 46 | #define PRIO_8021D_VI 5 |
138 | #define PRIO_8021D_VO 6 | 47 | #define PRIO_8021D_VO 6 |
139 | #define PRIO_8021D_NC 7 | 48 | #define PRIO_8021D_NC 7 |
49 | |||
140 | #define MAXPRIO 7 | 50 | #define MAXPRIO 7 |
141 | #define NUMPRIO (MAXPRIO + 1) | 51 | #define NUMPRIO (MAXPRIO + 1) |
142 | 52 | ||
143 | /* Max. nvram variable table size */ | ||
144 | #define MAXSZ_NVRAM_VARS 4096 | ||
145 | |||
146 | /* handle forward declaration */ | ||
147 | struct wl_info; | ||
148 | struct wlc_bsscfg; | ||
149 | |||
150 | #define WL_NUMRATES 16 /* max # of rates in a rateset */ | 53 | #define WL_NUMRATES 16 /* max # of rates in a rateset */ |
54 | |||
151 | typedef struct wl_rateset { | 55 | typedef struct wl_rateset { |
152 | u32 count; /* # rates in this set */ | 56 | u32 count; /* # rates in this set */ |
153 | u8 rates[WL_NUMRATES]; /* rates in 500kbps units w/hi bit set if basic */ | 57 | u8 rates[WL_NUMRATES]; /* rates in 500kbps units w/hi bit set if basic */ |
@@ -187,16 +91,8 @@ typedef struct wl_rateset { | |||
187 | #define WL_ERROR_VAL 0x00000001 | 91 | #define WL_ERROR_VAL 0x00000001 |
188 | #define WL_TRACE_VAL 0x00000002 | 92 | #define WL_TRACE_VAL 0x00000002 |
189 | 93 | ||
190 | #define NFIFO 6 /* # tx/rx fifopairs */ | ||
191 | |||
192 | #define PM_OFF 0 | 94 | #define PM_OFF 0 |
193 | #define PM_MAX 1 | 95 | #define PM_MAX 1 |
194 | #define PM_FAST 2 | 96 | #define PM_FAST 2 |
195 | 97 | ||
196 | /* band range returned by band_range iovar */ | ||
197 | #define WL_CHAN_FREQ_RANGE_2G 0 | ||
198 | #define WL_CHAN_FREQ_RANGE_5GL 1 | ||
199 | #define WL_CHAN_FREQ_RANGE_5GM 2 | ||
200 | #define WL_CHAN_FREQ_RANGE_5GH 3 | ||
201 | |||
202 | #endif /* _bcmdefs_h_ */ | 98 | #endif /* _bcmdefs_h_ */ |