bcm43xx.h 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006
  1. #ifndef BCM43xx_H_
  2. #define BCM43xx_H_
  3. #include <linux/hw_random.h>
  4. #include <linux/version.h>
  5. #include <linux/kernel.h>
  6. #include <linux/spinlock.h>
  7. #include <linux/interrupt.h>
  8. #include <linux/stringify.h>
  9. #include <linux/pci.h>
  10. #include <net/ieee80211.h>
  11. #include <net/ieee80211softmac.h>
  12. #include <asm/atomic.h>
  13. #include <asm/io.h>
  14. #include "bcm43xx_debugfs.h"
  15. #include "bcm43xx_leds.h"
  16. #define PFX KBUILD_MODNAME ": "
  17. #define BCM43xx_SWITCH_CORE_MAX_RETRIES 50
  18. #define BCM43xx_IRQWAIT_MAX_RETRIES 50
  19. #define BCM43xx_IO_SIZE 8192
  20. /* Active Core PCI Configuration Register. */
  21. #define BCM43xx_PCICFG_ACTIVE_CORE 0x80
  22. /* SPROM control register. */
  23. #define BCM43xx_PCICFG_SPROMCTL 0x88
  24. /* Interrupt Control PCI Configuration Register. (Only on PCI cores with rev >= 6) */
  25. #define BCM43xx_PCICFG_ICR 0x94
  26. /* MMIO offsets */
  27. #define BCM43xx_MMIO_DMA0_REASON 0x20
  28. #define BCM43xx_MMIO_DMA0_IRQ_MASK 0x24
  29. #define BCM43xx_MMIO_DMA1_REASON 0x28
  30. #define BCM43xx_MMIO_DMA1_IRQ_MASK 0x2C
  31. #define BCM43xx_MMIO_DMA2_REASON 0x30
  32. #define BCM43xx_MMIO_DMA2_IRQ_MASK 0x34
  33. #define BCM43xx_MMIO_DMA3_REASON 0x38
  34. #define BCM43xx_MMIO_DMA3_IRQ_MASK 0x3C
  35. #define BCM43xx_MMIO_DMA4_REASON 0x40
  36. #define BCM43xx_MMIO_DMA4_IRQ_MASK 0x44
  37. #define BCM43xx_MMIO_DMA5_REASON 0x48
  38. #define BCM43xx_MMIO_DMA5_IRQ_MASK 0x4C
  39. #define BCM43xx_MMIO_STATUS_BITFIELD 0x120
  40. #define BCM43xx_MMIO_STATUS2_BITFIELD 0x124
  41. #define BCM43xx_MMIO_GEN_IRQ_REASON 0x128
  42. #define BCM43xx_MMIO_GEN_IRQ_MASK 0x12C
  43. #define BCM43xx_MMIO_RAM_CONTROL 0x130
  44. #define BCM43xx_MMIO_RAM_DATA 0x134
  45. #define BCM43xx_MMIO_PS_STATUS 0x140
  46. #define BCM43xx_MMIO_RADIO_HWENABLED_HI 0x158
  47. #define BCM43xx_MMIO_SHM_CONTROL 0x160
  48. #define BCM43xx_MMIO_SHM_DATA 0x164
  49. #define BCM43xx_MMIO_SHM_DATA_UNALIGNED 0x166
  50. #define BCM43xx_MMIO_XMITSTAT_0 0x170
  51. #define BCM43xx_MMIO_XMITSTAT_1 0x174
  52. #define BCM43xx_MMIO_REV3PLUS_TSF_LOW 0x180 /* core rev >= 3 only */
  53. #define BCM43xx_MMIO_REV3PLUS_TSF_HIGH 0x184 /* core rev >= 3 only */
  54. /* 32-bit DMA */
  55. #define BCM43xx_MMIO_DMA32_BASE0 0x200
  56. #define BCM43xx_MMIO_DMA32_BASE1 0x220
  57. #define BCM43xx_MMIO_DMA32_BASE2 0x240
  58. #define BCM43xx_MMIO_DMA32_BASE3 0x260
  59. #define BCM43xx_MMIO_DMA32_BASE4 0x280
  60. #define BCM43xx_MMIO_DMA32_BASE5 0x2A0
  61. /* 64-bit DMA */
  62. #define BCM43xx_MMIO_DMA64_BASE0 0x200
  63. #define BCM43xx_MMIO_DMA64_BASE1 0x240
  64. #define BCM43xx_MMIO_DMA64_BASE2 0x280
  65. #define BCM43xx_MMIO_DMA64_BASE3 0x2C0
  66. #define BCM43xx_MMIO_DMA64_BASE4 0x300
  67. #define BCM43xx_MMIO_DMA64_BASE5 0x340
  68. /* PIO */
  69. #define BCM43xx_MMIO_PIO1_BASE 0x300
  70. #define BCM43xx_MMIO_PIO2_BASE 0x310
  71. #define BCM43xx_MMIO_PIO3_BASE 0x320
  72. #define BCM43xx_MMIO_PIO4_BASE 0x330
  73. #define BCM43xx_MMIO_PHY_VER 0x3E0
  74. #define BCM43xx_MMIO_PHY_RADIO 0x3E2
  75. #define BCM43xx_MMIO_ANTENNA 0x3E8
  76. #define BCM43xx_MMIO_CHANNEL 0x3F0
  77. #define BCM43xx_MMIO_CHANNEL_EXT 0x3F4
  78. #define BCM43xx_MMIO_RADIO_CONTROL 0x3F6
  79. #define BCM43xx_MMIO_RADIO_DATA_HIGH 0x3F8
  80. #define BCM43xx_MMIO_RADIO_DATA_LOW 0x3FA
  81. #define BCM43xx_MMIO_PHY_CONTROL 0x3FC
  82. #define BCM43xx_MMIO_PHY_DATA 0x3FE
  83. #define BCM43xx_MMIO_MACFILTER_CONTROL 0x420
  84. #define BCM43xx_MMIO_MACFILTER_DATA 0x422
  85. #define BCM43xx_MMIO_RADIO_HWENABLED_LO 0x49A
  86. #define BCM43xx_MMIO_GPIO_CONTROL 0x49C
  87. #define BCM43xx_MMIO_GPIO_MASK 0x49E
  88. #define BCM43xx_MMIO_TSF_0 0x632 /* core rev < 3 only */
  89. #define BCM43xx_MMIO_TSF_1 0x634 /* core rev < 3 only */
  90. #define BCM43xx_MMIO_TSF_2 0x636 /* core rev < 3 only */
  91. #define BCM43xx_MMIO_TSF_3 0x638 /* core rev < 3 only */
  92. #define BCM43xx_MMIO_RNG 0x65A
  93. #define BCM43xx_MMIO_POWERUP_DELAY 0x6A8
  94. /* SPROM offsets. */
  95. #define BCM43xx_SPROM_BASE 0x1000
  96. #define BCM43xx_SPROM_BOARDFLAGS2 0x1c
  97. #define BCM43xx_SPROM_IL0MACADDR 0x24
  98. #define BCM43xx_SPROM_ET0MACADDR 0x27
  99. #define BCM43xx_SPROM_ET1MACADDR 0x2a
  100. #define BCM43xx_SPROM_ETHPHY 0x2d
  101. #define BCM43xx_SPROM_BOARDREV 0x2e
  102. #define BCM43xx_SPROM_PA0B0 0x2f
  103. #define BCM43xx_SPROM_PA0B1 0x30
  104. #define BCM43xx_SPROM_PA0B2 0x31
  105. #define BCM43xx_SPROM_WL0GPIO0 0x32
  106. #define BCM43xx_SPROM_WL0GPIO2 0x33
  107. #define BCM43xx_SPROM_MAXPWR 0x34
  108. #define BCM43xx_SPROM_PA1B0 0x35
  109. #define BCM43xx_SPROM_PA1B1 0x36
  110. #define BCM43xx_SPROM_PA1B2 0x37
  111. #define BCM43xx_SPROM_IDL_TSSI_TGT 0x38
  112. #define BCM43xx_SPROM_BOARDFLAGS 0x39
  113. #define BCM43xx_SPROM_ANTENNA_GAIN 0x3a
  114. #define BCM43xx_SPROM_VERSION 0x3f
  115. /* BCM43xx_SPROM_BOARDFLAGS values */
  116. #define BCM43xx_BFL_BTCOEXIST 0x0001 /* implements Bluetooth coexistance */
  117. #define BCM43xx_BFL_PACTRL 0x0002 /* GPIO 9 controlling the PA */
  118. #define BCM43xx_BFL_AIRLINEMODE 0x0004 /* implements GPIO 13 radio disable indication */
  119. #define BCM43xx_BFL_RSSI 0x0008 /* software calculates nrssi slope. */
  120. #define BCM43xx_BFL_ENETSPI 0x0010 /* has ephy roboswitch spi */
  121. #define BCM43xx_BFL_XTAL_NOSLOW 0x0020 /* no slow clock available */
  122. #define BCM43xx_BFL_CCKHIPWR 0x0040 /* can do high power CCK transmission */
  123. #define BCM43xx_BFL_ENETADM 0x0080 /* has ADMtek switch */
  124. #define BCM43xx_BFL_ENETVLAN 0x0100 /* can do vlan */
  125. #define BCM43xx_BFL_AFTERBURNER 0x0200 /* supports Afterburner mode */
  126. #define BCM43xx_BFL_NOPCI 0x0400 /* leaves PCI floating */
  127. #define BCM43xx_BFL_FEM 0x0800 /* supports the Front End Module */
  128. #define BCM43xx_BFL_EXTLNA 0x1000 /* has an external LNA */
  129. #define BCM43xx_BFL_HGPA 0x2000 /* had high gain PA */
  130. #define BCM43xx_BFL_BTCMOD 0x4000 /* BFL_BTCOEXIST is given in alternate GPIOs */
  131. #define BCM43xx_BFL_ALTIQ 0x8000 /* alternate I/Q settings */
  132. /* GPIO register offset, in both ChipCommon and PCI core. */
  133. #define BCM43xx_GPIO_CONTROL 0x6c
  134. /* SHM Routing */
  135. #define BCM43xx_SHM_SHARED 0x0001
  136. #define BCM43xx_SHM_WIRELESS 0x0002
  137. #define BCM43xx_SHM_PCM 0x0003
  138. #define BCM43xx_SHM_HWMAC 0x0004
  139. #define BCM43xx_SHM_UCODE 0x0300
  140. /* MacFilter offsets. */
  141. #define BCM43xx_MACFILTER_SELF 0x0000
  142. #define BCM43xx_MACFILTER_ASSOC 0x0003
  143. /* Chipcommon registers. */
  144. #define BCM43xx_CHIPCOMMON_CAPABILITIES 0x04
  145. #define BCM43xx_CHIPCOMMON_CTL 0x28
  146. #define BCM43xx_CHIPCOMMON_PLLONDELAY 0xB0
  147. #define BCM43xx_CHIPCOMMON_FREFSELDELAY 0xB4
  148. #define BCM43xx_CHIPCOMMON_SLOWCLKCTL 0xB8
  149. #define BCM43xx_CHIPCOMMON_SYSCLKCTL 0xC0
  150. /* PCI core specific registers. */
  151. #define BCM43xx_PCICORE_BCAST_ADDR 0x50
  152. #define BCM43xx_PCICORE_BCAST_DATA 0x54
  153. #define BCM43xx_PCICORE_SBTOPCI2 0x108
  154. /* SBTOPCI2 values. */
  155. #define BCM43xx_SBTOPCI2_PREFETCH 0x4
  156. #define BCM43xx_SBTOPCI2_BURST 0x8
  157. #define BCM43xx_SBTOPCI2_MEMREAD_MULTI 0x20
  158. /* PCI-E core registers. */
  159. #define BCM43xx_PCIECORE_REG_ADDR 0x0130
  160. #define BCM43xx_PCIECORE_REG_DATA 0x0134
  161. #define BCM43xx_PCIECORE_MDIO_CTL 0x0128
  162. #define BCM43xx_PCIECORE_MDIO_DATA 0x012C
  163. /* PCI-E registers. */
  164. #define BCM43xx_PCIE_TLP_WORKAROUND 0x0004
  165. #define BCM43xx_PCIE_DLLP_LINKCTL 0x0100
  166. /* PCI-E MDIO bits. */
  167. #define BCM43xx_PCIE_MDIO_ST 0x40000000
  168. #define BCM43xx_PCIE_MDIO_WT 0x10000000
  169. #define BCM43xx_PCIE_MDIO_DEV 22
  170. #define BCM43xx_PCIE_MDIO_REG 18
  171. #define BCM43xx_PCIE_MDIO_TA 0x00020000
  172. #define BCM43xx_PCIE_MDIO_TC 0x0100
  173. /* MDIO devices. */
  174. #define BCM43xx_MDIO_SERDES_RX 0x1F
  175. /* SERDES RX registers. */
  176. #define BCM43xx_SERDES_RXTIMER 0x2
  177. #define BCM43xx_SERDES_CDR 0x6
  178. #define BCM43xx_SERDES_CDR_BW 0x7
  179. /* Chipcommon capabilities. */
  180. #define BCM43xx_CAPABILITIES_PCTL 0x00040000
  181. #define BCM43xx_CAPABILITIES_PLLMASK 0x00030000
  182. #define BCM43xx_CAPABILITIES_PLLSHIFT 16
  183. #define BCM43xx_CAPABILITIES_FLASHMASK 0x00000700
  184. #define BCM43xx_CAPABILITIES_FLASHSHIFT 8
  185. #define BCM43xx_CAPABILITIES_EXTBUSPRESENT 0x00000040
  186. #define BCM43xx_CAPABILITIES_UARTGPIO 0x00000020
  187. #define BCM43xx_CAPABILITIES_UARTCLOCKMASK 0x00000018
  188. #define BCM43xx_CAPABILITIES_UARTCLOCKSHIFT 3
  189. #define BCM43xx_CAPABILITIES_MIPSBIGENDIAN 0x00000004
  190. #define BCM43xx_CAPABILITIES_NRUARTSMASK 0x00000003
  191. /* PowerControl */
  192. #define BCM43xx_PCTL_IN 0xB0
  193. #define BCM43xx_PCTL_OUT 0xB4
  194. #define BCM43xx_PCTL_OUTENABLE 0xB8
  195. #define BCM43xx_PCTL_XTAL_POWERUP 0x40
  196. #define BCM43xx_PCTL_PLL_POWERDOWN 0x80
  197. /* PowerControl Clock Modes */
  198. #define BCM43xx_PCTL_CLK_FAST 0x00
  199. #define BCM43xx_PCTL_CLK_SLOW 0x01
  200. #define BCM43xx_PCTL_CLK_DYNAMIC 0x02
  201. #define BCM43xx_PCTL_FORCE_SLOW 0x0800
  202. #define BCM43xx_PCTL_FORCE_PLL 0x1000
  203. #define BCM43xx_PCTL_DYN_XTAL 0x2000
  204. /* COREIDs */
  205. #define BCM43xx_COREID_CHIPCOMMON 0x800
  206. #define BCM43xx_COREID_ILINE20 0x801
  207. #define BCM43xx_COREID_SDRAM 0x803
  208. #define BCM43xx_COREID_PCI 0x804
  209. #define BCM43xx_COREID_MIPS 0x805
  210. #define BCM43xx_COREID_ETHERNET 0x806
  211. #define BCM43xx_COREID_V90 0x807
  212. #define BCM43xx_COREID_USB11_HOSTDEV 0x80a
  213. #define BCM43xx_COREID_IPSEC 0x80b
  214. #define BCM43xx_COREID_PCMCIA 0x80d
  215. #define BCM43xx_COREID_EXT_IF 0x80f
  216. #define BCM43xx_COREID_80211 0x812
  217. #define BCM43xx_COREID_MIPS_3302 0x816
  218. #define BCM43xx_COREID_USB11_HOST 0x817
  219. #define BCM43xx_COREID_USB11_DEV 0x818
  220. #define BCM43xx_COREID_USB20_HOST 0x819
  221. #define BCM43xx_COREID_USB20_DEV 0x81a
  222. #define BCM43xx_COREID_SDIO_HOST 0x81b
  223. #define BCM43xx_COREID_PCIE 0x820
  224. /* Core Information Registers */
  225. #define BCM43xx_CIR_BASE 0xf00
  226. #define BCM43xx_CIR_SBTPSFLAG (BCM43xx_CIR_BASE + 0x18)
  227. #define BCM43xx_CIR_SBIMSTATE (BCM43xx_CIR_BASE + 0x90)
  228. #define BCM43xx_CIR_SBINTVEC (BCM43xx_CIR_BASE + 0x94)
  229. #define BCM43xx_CIR_SBTMSTATELOW (BCM43xx_CIR_BASE + 0x98)
  230. #define BCM43xx_CIR_SBTMSTATEHIGH (BCM43xx_CIR_BASE + 0x9c)
  231. #define BCM43xx_CIR_SBIMCONFIGLOW (BCM43xx_CIR_BASE + 0xa8)
  232. #define BCM43xx_CIR_SB_ID_HI (BCM43xx_CIR_BASE + 0xfc)
  233. /* Mask to get the Backplane Flag Number from SBTPSFLAG. */
  234. #define BCM43xx_BACKPLANE_FLAG_NR_MASK 0x3f
  235. /* SBIMCONFIGLOW values/masks. */
  236. #define BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK 0x00000007
  237. #define BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_SHIFT 0
  238. #define BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK 0x00000070
  239. #define BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_SHIFT 4
  240. #define BCM43xx_SBIMCONFIGLOW_CONNID_MASK 0x00ff0000
  241. #define BCM43xx_SBIMCONFIGLOW_CONNID_SHIFT 16
  242. /* sbtmstatelow state flags */
  243. #define BCM43xx_SBTMSTATELOW_RESET 0x01
  244. #define BCM43xx_SBTMSTATELOW_REJECT 0x02
  245. #define BCM43xx_SBTMSTATELOW_CLOCK 0x10000
  246. #define BCM43xx_SBTMSTATELOW_FORCE_GATE_CLOCK 0x20000
  247. /* sbtmstatehigh state flags */
  248. #define BCM43xx_SBTMSTATEHIGH_SERROR 0x00000001
  249. #define BCM43xx_SBTMSTATEHIGH_BUSY 0x00000004
  250. #define BCM43xx_SBTMSTATEHIGH_TIMEOUT 0x00000020
  251. #define BCM43xx_SBTMSTATEHIGH_COREFLAGS 0x1FFF0000
  252. #define BCM43xx_SBTMSTATEHIGH_DMA64BIT 0x10000000
  253. #define BCM43xx_SBTMSTATEHIGH_GATEDCLK 0x20000000
  254. #define BCM43xx_SBTMSTATEHIGH_BISTFAILED 0x40000000
  255. #define BCM43xx_SBTMSTATEHIGH_BISTCOMPLETE 0x80000000
  256. /* sbimstate flags */
  257. #define BCM43xx_SBIMSTATE_IB_ERROR 0x20000
  258. #define BCM43xx_SBIMSTATE_TIMEOUT 0x40000
  259. /* PHYVersioning */
  260. #define BCM43xx_PHYTYPE_A 0x00
  261. #define BCM43xx_PHYTYPE_B 0x01
  262. #define BCM43xx_PHYTYPE_G 0x02
  263. /* PHYRegisters */
  264. #define BCM43xx_PHY_ILT_A_CTRL 0x0072
  265. #define BCM43xx_PHY_ILT_A_DATA1 0x0073
  266. #define BCM43xx_PHY_ILT_A_DATA2 0x0074
  267. #define BCM43xx_PHY_G_LO_CONTROL 0x0810
  268. #define BCM43xx_PHY_ILT_G_CTRL 0x0472
  269. #define BCM43xx_PHY_ILT_G_DATA1 0x0473
  270. #define BCM43xx_PHY_ILT_G_DATA2 0x0474
  271. #define BCM43xx_PHY_A_PCTL 0x007B
  272. #define BCM43xx_PHY_G_PCTL 0x0029
  273. #define BCM43xx_PHY_A_CRS 0x0029
  274. #define BCM43xx_PHY_RADIO_BITFIELD 0x0401
  275. #define BCM43xx_PHY_G_CRS 0x0429
  276. #define BCM43xx_PHY_NRSSILT_CTRL 0x0803
  277. #define BCM43xx_PHY_NRSSILT_DATA 0x0804
  278. /* RadioRegisters */
  279. #define BCM43xx_RADIOCTL_ID 0x01
  280. /* StatusBitField */
  281. #define BCM43xx_SBF_MAC_ENABLED 0x00000001
  282. #define BCM43xx_SBF_2 0x00000002 /*FIXME: fix name*/
  283. #define BCM43xx_SBF_CORE_READY 0x00000004
  284. #define BCM43xx_SBF_400 0x00000400 /*FIXME: fix name*/
  285. #define BCM43xx_SBF_4000 0x00004000 /*FIXME: fix name*/
  286. #define BCM43xx_SBF_8000 0x00008000 /*FIXME: fix name*/
  287. #define BCM43xx_SBF_XFER_REG_BYTESWAP 0x00010000
  288. #define BCM43xx_SBF_MODE_NOTADHOC 0x00020000
  289. #define BCM43xx_SBF_MODE_AP 0x00040000
  290. #define BCM43xx_SBF_RADIOREG_LOCK 0x00080000
  291. #define BCM43xx_SBF_MODE_MONITOR 0x00400000
  292. #define BCM43xx_SBF_MODE_PROMISC 0x01000000
  293. #define BCM43xx_SBF_PS1 0x02000000
  294. #define BCM43xx_SBF_PS2 0x04000000
  295. #define BCM43xx_SBF_NO_SSID_BCAST 0x08000000
  296. #define BCM43xx_SBF_TIME_UPDATE 0x10000000
  297. #define BCM43xx_SBF_80000000 0x80000000 /*FIXME: fix name*/
  298. /* Microcode */
  299. #define BCM43xx_UCODE_REVISION 0x0000
  300. #define BCM43xx_UCODE_PATCHLEVEL 0x0002
  301. #define BCM43xx_UCODE_DATE 0x0004
  302. #define BCM43xx_UCODE_TIME 0x0006
  303. #define BCM43xx_UCODE_STATUS 0x0040
  304. /* MicrocodeFlagsBitfield (addr + lo-word values?)*/
  305. #define BCM43xx_UCODEFLAGS_OFFSET 0x005E
  306. #define BCM43xx_UCODEFLAG_AUTODIV 0x0001
  307. #define BCM43xx_UCODEFLAG_UNKBGPHY 0x0002
  308. #define BCM43xx_UCODEFLAG_UNKBPHY 0x0004
  309. #define BCM43xx_UCODEFLAG_UNKGPHY 0x0020
  310. #define BCM43xx_UCODEFLAG_UNKPACTRL 0x0040
  311. #define BCM43xx_UCODEFLAG_JAPAN 0x0080
  312. /* Generic-Interrupt reasons. */
  313. #define BCM43xx_IRQ_READY (1 << 0)
  314. #define BCM43xx_IRQ_BEACON (1 << 1)
  315. #define BCM43xx_IRQ_PS (1 << 2)
  316. #define BCM43xx_IRQ_REG124 (1 << 5)
  317. #define BCM43xx_IRQ_PMQ (1 << 6)
  318. #define BCM43xx_IRQ_PIO_WORKAROUND (1 << 8)
  319. #define BCM43xx_IRQ_XMIT_ERROR (1 << 11)
  320. #define BCM43xx_IRQ_RX (1 << 15)
  321. #define BCM43xx_IRQ_SCAN (1 << 16)
  322. #define BCM43xx_IRQ_NOISE (1 << 18)
  323. #define BCM43xx_IRQ_XMIT_STATUS (1 << 29)
  324. #define BCM43xx_IRQ_ALL 0xffffffff
  325. #define BCM43xx_IRQ_INITIAL (BCM43xx_IRQ_PS | \
  326. BCM43xx_IRQ_REG124 | \
  327. BCM43xx_IRQ_PMQ | \
  328. BCM43xx_IRQ_XMIT_ERROR | \
  329. BCM43xx_IRQ_RX | \
  330. BCM43xx_IRQ_SCAN | \
  331. BCM43xx_IRQ_NOISE | \
  332. BCM43xx_IRQ_XMIT_STATUS)
  333. /* Initial default iw_mode */
  334. #define BCM43xx_INITIAL_IWMODE IW_MODE_INFRA
  335. /* Bus type PCI. */
  336. #define BCM43xx_BUSTYPE_PCI 0
  337. /* Bus type Silicone Backplane Bus. */
  338. #define BCM43xx_BUSTYPE_SB 1
  339. /* Bus type PCMCIA. */
  340. #define BCM43xx_BUSTYPE_PCMCIA 2
  341. /* Threshold values. */
  342. #define BCM43xx_MIN_RTS_THRESHOLD 1U
  343. #define BCM43xx_MAX_RTS_THRESHOLD 2304U
  344. #define BCM43xx_DEFAULT_RTS_THRESHOLD BCM43xx_MAX_RTS_THRESHOLD
  345. #define BCM43xx_DEFAULT_SHORT_RETRY_LIMIT 7
  346. #define BCM43xx_DEFAULT_LONG_RETRY_LIMIT 4
  347. /* FIXME: the next line is a guess as to what the maximum RSSI value might be */
  348. #define RX_RSSI_MAX 60
  349. /* Max size of a security key */
  350. #define BCM43xx_SEC_KEYSIZE 16
  351. /* Security algorithms. */
  352. enum {
  353. BCM43xx_SEC_ALGO_NONE = 0, /* unencrypted, as of TX header. */
  354. BCM43xx_SEC_ALGO_WEP,
  355. BCM43xx_SEC_ALGO_UNKNOWN,
  356. BCM43xx_SEC_ALGO_AES,
  357. BCM43xx_SEC_ALGO_WEP104,
  358. BCM43xx_SEC_ALGO_TKIP,
  359. };
  360. #ifdef assert
  361. # undef assert
  362. #endif
  363. #ifdef CONFIG_BCM43XX_DEBUG
  364. #define assert(expr) \
  365. do { \
  366. if (unlikely(!(expr))) { \
  367. printk(KERN_ERR PFX "ASSERTION FAILED (%s) at: %s:%d:%s()\n", \
  368. #expr, __FILE__, __LINE__, __FUNCTION__); \
  369. } \
  370. } while (0)
  371. #else
  372. #define assert(expr) do { /* nothing */ } while (0)
  373. #endif
  374. /* rate limited printk(). */
  375. #ifdef printkl
  376. # undef printkl
  377. #endif
  378. #define printkl(f, x...) do { if (printk_ratelimit()) printk(f ,##x); } while (0)
  379. /* rate limited printk() for debugging */
  380. #ifdef dprintkl
  381. # undef dprintkl
  382. #endif
  383. #ifdef CONFIG_BCM43XX_DEBUG
  384. # define dprintkl printkl
  385. #else
  386. # define dprintkl(f, x...) do { /* nothing */ } while (0)
  387. #endif
  388. /* Helper macro for if branches.
  389. * An if branch marked with this macro is only taken in DEBUG mode.
  390. * Example:
  391. * if (DEBUG_ONLY(foo == bar)) {
  392. * do something
  393. * }
  394. * In DEBUG mode, the branch will be taken if (foo == bar).
  395. * In non-DEBUG mode, the branch will never be taken.
  396. */
  397. #ifdef DEBUG_ONLY
  398. # undef DEBUG_ONLY
  399. #endif
  400. #ifdef CONFIG_BCM43XX_DEBUG
  401. # define DEBUG_ONLY(x) (x)
  402. #else
  403. # define DEBUG_ONLY(x) 0
  404. #endif
  405. /* debugging printk() */
  406. #ifdef dprintk
  407. # undef dprintk
  408. #endif
  409. #ifdef CONFIG_BCM43XX_DEBUG
  410. # define dprintk(f, x...) do { printk(f ,##x); } while (0)
  411. #else
  412. # define dprintk(f, x...) do { /* nothing */ } while (0)
  413. #endif
  414. struct net_device;
  415. struct pci_dev;
  416. struct bcm43xx_dmaring;
  417. struct bcm43xx_pioqueue;
  418. struct bcm43xx_initval {
  419. u16 offset;
  420. u16 size;
  421. u32 value;
  422. } __attribute__((__packed__));
  423. /* Values for bcm430x_sprominfo.locale */
  424. enum {
  425. BCM43xx_LOCALE_WORLD = 0,
  426. BCM43xx_LOCALE_THAILAND,
  427. BCM43xx_LOCALE_ISRAEL,
  428. BCM43xx_LOCALE_JORDAN,
  429. BCM43xx_LOCALE_CHINA,
  430. BCM43xx_LOCALE_JAPAN,
  431. BCM43xx_LOCALE_USA_CANADA_ANZ,
  432. BCM43xx_LOCALE_EUROPE,
  433. BCM43xx_LOCALE_USA_LOW,
  434. BCM43xx_LOCALE_JAPAN_HIGH,
  435. BCM43xx_LOCALE_ALL,
  436. BCM43xx_LOCALE_NONE,
  437. };
  438. #define BCM43xx_SPROM_SIZE 64 /* in 16-bit words. */
  439. struct bcm43xx_sprominfo {
  440. u16 boardflags2;
  441. u8 il0macaddr[6];
  442. u8 et0macaddr[6];
  443. u8 et1macaddr[6];
  444. u8 et0phyaddr:5;
  445. u8 et1phyaddr:5;
  446. u8 et0mdcport:1;
  447. u8 et1mdcport:1;
  448. u8 boardrev;
  449. u8 locale:4;
  450. u8 antennas_aphy:2;
  451. u8 antennas_bgphy:2;
  452. u16 pa0b0;
  453. u16 pa0b1;
  454. u16 pa0b2;
  455. u8 wl0gpio0;
  456. u8 wl0gpio1;
  457. u8 wl0gpio2;
  458. u8 wl0gpio3;
  459. u8 maxpower_aphy;
  460. u8 maxpower_bgphy;
  461. u16 pa1b0;
  462. u16 pa1b1;
  463. u16 pa1b2;
  464. u8 idle_tssi_tgt_aphy;
  465. u8 idle_tssi_tgt_bgphy;
  466. u16 boardflags;
  467. u16 antennagain_aphy;
  468. u16 antennagain_bgphy;
  469. };
  470. /* Value pair to measure the LocalOscillator. */
  471. struct bcm43xx_lopair {
  472. s8 low;
  473. s8 high;
  474. u8 used:1;
  475. };
  476. #define BCM43xx_LO_COUNT (14*4)
  477. struct bcm43xx_phyinfo {
  478. /* Hardware Data */
  479. u8 version;
  480. u8 type;
  481. u8 rev;
  482. u16 antenna_diversity;
  483. u16 savedpctlreg;
  484. u16 minlowsig[2];
  485. u16 minlowsigpos[2];
  486. u8 connected:1,
  487. calibrated:1,
  488. is_locked:1, /* used in bcm43xx_phy_{un}lock() */
  489. dyn_tssi_tbl:1; /* used in bcm43xx_phy_init_tssi2dbm_table() */
  490. /* LO Measurement Data.
  491. * Use bcm43xx_get_lopair() to get a value.
  492. */
  493. struct bcm43xx_lopair *_lo_pairs;
  494. /* TSSI to dBm table in use */
  495. const s8 *tssi2dbm;
  496. /* idle TSSI value */
  497. s8 idle_tssi;
  498. /* Values from bcm43xx_calc_loopback_gain() */
  499. u16 loopback_gain[2];
  500. /* PHY lock for core.rev < 3
  501. * This lock is only used by bcm43xx_phy_{un}lock()
  502. */
  503. spinlock_t lock;
  504. /* Firmware. */
  505. const struct firmware *ucode;
  506. const struct firmware *pcm;
  507. const struct firmware *initvals0;
  508. const struct firmware *initvals1;
  509. };
  510. struct bcm43xx_radioinfo {
  511. u16 manufact;
  512. u16 version;
  513. u8 revision;
  514. /* Desired TX power in dBm Q5.2 */
  515. u16 txpower_desired;
  516. /* TX Power control values. */
  517. union {
  518. /* B/G PHY */
  519. struct {
  520. u16 baseband_atten;
  521. u16 radio_atten;
  522. u16 txctl1;
  523. u16 txctl2;
  524. };
  525. /* A PHY */
  526. struct {
  527. u16 txpwr_offset;
  528. };
  529. };
  530. /* Current Interference Mitigation mode */
  531. int interfmode;
  532. /* Stack of saved values from the Interference Mitigation code.
  533. * Each value in the stack is layed out as follows:
  534. * bit 0-11: offset
  535. * bit 12-15: register ID
  536. * bit 16-32: value
  537. * register ID is: 0x1 PHY, 0x2 Radio, 0x3 ILT
  538. */
  539. #define BCM43xx_INTERFSTACK_SIZE 26
  540. u32 interfstack[BCM43xx_INTERFSTACK_SIZE];
  541. /* Saved values from the NRSSI Slope calculation */
  542. s16 nrssi[2];
  543. s32 nrssislope;
  544. /* In memory nrssi lookup table. */
  545. s8 nrssi_lt[64];
  546. /* current channel */
  547. u8 channel;
  548. u8 initial_channel;
  549. u16 lofcal;
  550. u16 initval;
  551. u8 enabled:1;
  552. /* ACI (adjacent channel interference) flags. */
  553. u8 aci_enable:1,
  554. aci_wlan_automatic:1,
  555. aci_hw_rssi:1;
  556. };
  557. /* Data structures for DMA transmission, per 80211 core. */
  558. struct bcm43xx_dma {
  559. struct bcm43xx_dmaring *tx_ring0;
  560. struct bcm43xx_dmaring *tx_ring1;
  561. struct bcm43xx_dmaring *tx_ring2;
  562. struct bcm43xx_dmaring *tx_ring3;
  563. struct bcm43xx_dmaring *tx_ring4;
  564. struct bcm43xx_dmaring *tx_ring5;
  565. struct bcm43xx_dmaring *rx_ring0;
  566. struct bcm43xx_dmaring *rx_ring3; /* only available on core.rev < 5 */
  567. };
  568. /* Data structures for PIO transmission, per 80211 core. */
  569. struct bcm43xx_pio {
  570. struct bcm43xx_pioqueue *queue0;
  571. struct bcm43xx_pioqueue *queue1;
  572. struct bcm43xx_pioqueue *queue2;
  573. struct bcm43xx_pioqueue *queue3;
  574. };
  575. #define BCM43xx_MAX_80211_CORES 2
  576. #ifdef CONFIG_BCM947XX
  577. #define core_offset(bcm) (bcm)->current_core_offset
  578. #else
  579. #define core_offset(bcm) 0
  580. #endif
  581. /* Generic information about a core. */
  582. struct bcm43xx_coreinfo {
  583. u8 available:1,
  584. enabled:1,
  585. initialized:1;
  586. /** core_rev revision number */
  587. u8 rev;
  588. /** Index number for _switch_core() */
  589. u8 index;
  590. /** core_id ID number */
  591. u16 id;
  592. /** Core-specific data. */
  593. void *priv;
  594. };
  595. /* Additional information for each 80211 core. */
  596. struct bcm43xx_coreinfo_80211 {
  597. /* PHY device. */
  598. struct bcm43xx_phyinfo phy;
  599. /* Radio device. */
  600. struct bcm43xx_radioinfo radio;
  601. union {
  602. /* DMA context. */
  603. struct bcm43xx_dma dma;
  604. /* PIO context. */
  605. struct bcm43xx_pio pio;
  606. };
  607. };
  608. /* Context information for a noise calculation (Link Quality). */
  609. struct bcm43xx_noise_calculation {
  610. struct bcm43xx_coreinfo *core_at_start;
  611. u8 channel_at_start;
  612. u8 calculation_running:1;
  613. u8 nr_samples;
  614. s8 samples[8][4];
  615. };
  616. struct bcm43xx_stats {
  617. u8 noise;
  618. struct iw_statistics wstats;
  619. /* Store the last TX/RX times here for updating the leds. */
  620. unsigned long last_tx;
  621. unsigned long last_rx;
  622. };
  623. struct bcm43xx_key {
  624. u8 enabled:1;
  625. u8 algorithm;
  626. };
  627. /* Driver initialization status. */
  628. enum {
  629. BCM43xx_STAT_UNINIT, /* Uninitialized. */
  630. BCM43xx_STAT_INITIALIZING, /* init_board() in progress. */
  631. BCM43xx_STAT_INITIALIZED, /* Fully operational. */
  632. BCM43xx_STAT_SHUTTINGDOWN, /* free_board() in progress. */
  633. BCM43xx_STAT_RESTARTING, /* controller_restart() called. */
  634. };
  635. #define bcm43xx_status(bcm) atomic_read(&(bcm)->init_status)
  636. #define bcm43xx_set_status(bcm, stat) do { \
  637. atomic_set(&(bcm)->init_status, (stat)); \
  638. smp_wmb(); \
  639. } while (0)
  640. /* *** THEORY OF LOCKING ***
  641. *
  642. * We have two different locks in the bcm43xx driver.
  643. * => bcm->mutex: General sleeping mutex. Protects struct bcm43xx_private
  644. * and the device registers. This mutex does _not_ protect
  645. * against concurrency from the IRQ handler.
  646. * => bcm->irq_lock: IRQ spinlock. Protects against IRQ handler concurrency.
  647. *
  648. * Please note that, if you only take the irq_lock, you are not protected
  649. * against concurrency from the periodic work handlers.
  650. * Most times you want to take _both_ locks.
  651. */
  652. struct bcm43xx_private {
  653. struct ieee80211_device *ieee;
  654. struct ieee80211softmac_device *softmac;
  655. struct net_device *net_dev;
  656. struct pci_dev *pci_dev;
  657. unsigned int irq;
  658. void __iomem *mmio_addr;
  659. spinlock_t irq_lock;
  660. struct mutex mutex;
  661. /* Driver initialization status BCM43xx_STAT_*** */
  662. atomic_t init_status;
  663. u16 was_initialized:1, /* for PCI suspend/resume. */
  664. __using_pio:1, /* Internal, use bcm43xx_using_pio(). */
  665. bad_frames_preempt:1, /* Use "Bad Frames Preemption" (default off) */
  666. reg124_set_0x4:1, /* Some variable to keep track of IRQ stuff. */
  667. short_preamble:1, /* TRUE, if short preamble is enabled. */
  668. firmware_norelease:1; /* Do not release the firmware. Used on suspend. */
  669. struct bcm43xx_stats stats;
  670. /* Bus type we are connected to.
  671. * This is currently always BCM43xx_BUSTYPE_PCI
  672. */
  673. u8 bustype;
  674. u16 board_vendor;
  675. u16 board_type;
  676. u16 board_revision;
  677. u16 chip_id;
  678. u8 chip_rev;
  679. u8 chip_package;
  680. struct bcm43xx_sprominfo sprom;
  681. #define BCM43xx_NR_LEDS 4
  682. struct bcm43xx_led leds[BCM43xx_NR_LEDS];
  683. spinlock_t leds_lock;
  684. /* The currently active core. */
  685. struct bcm43xx_coreinfo *current_core;
  686. #ifdef CONFIG_BCM947XX
  687. /** current core memory offset */
  688. u32 current_core_offset;
  689. #endif
  690. struct bcm43xx_coreinfo *active_80211_core;
  691. /* coreinfo structs for all possible cores follow.
  692. * Note that a core might not exist.
  693. * So check the coreinfo flags before using it.
  694. */
  695. struct bcm43xx_coreinfo core_chipcommon;
  696. struct bcm43xx_coreinfo core_pci;
  697. struct bcm43xx_coreinfo core_80211[ BCM43xx_MAX_80211_CORES ];
  698. /* Additional information, specific to the 80211 cores. */
  699. struct bcm43xx_coreinfo_80211 core_80211_ext[ BCM43xx_MAX_80211_CORES ];
  700. /* Number of available 80211 cores. */
  701. int nr_80211_available;
  702. u32 chipcommon_capabilities;
  703. /* Reason code of the last interrupt. */
  704. u32 irq_reason;
  705. u32 dma_reason[6];
  706. /* saved irq enable/disable state bitfield. */
  707. u32 irq_savedstate;
  708. /* Link Quality calculation context. */
  709. struct bcm43xx_noise_calculation noisecalc;
  710. /* if > 0 MAC is suspended. if == 0 MAC is enabled. */
  711. int mac_suspended;
  712. /* Threshold values. */
  713. //TODO: The RTS thr has to be _used_. Currently, it is only set via WX.
  714. u32 rts_threshold;
  715. /* Interrupt Service Routine tasklet (bottom-half) */
  716. struct tasklet_struct isr_tasklet;
  717. /* Periodic tasks */
  718. struct work_struct periodic_work;
  719. unsigned int periodic_state;
  720. struct work_struct restart_work;
  721. /* Informational stuff. */
  722. char nick[IW_ESSID_MAX_SIZE + 1];
  723. /* encryption/decryption */
  724. u16 security_offset;
  725. struct bcm43xx_key key[54];
  726. u8 default_key_idx;
  727. /* Random Number Generator. */
  728. struct hwrng rng;
  729. char rng_name[20 + 1];
  730. /* Debugging stuff follows. */
  731. #ifdef CONFIG_BCM43XX_DEBUG
  732. struct bcm43xx_dfsentry *dfsentry;
  733. #endif
  734. };
  735. static inline
  736. struct bcm43xx_private * bcm43xx_priv(struct net_device *dev)
  737. {
  738. return ieee80211softmac_priv(dev);
  739. }
  740. struct device;
  741. static inline
  742. struct bcm43xx_private * dev_to_bcm(struct device *dev)
  743. {
  744. struct net_device *net_dev;
  745. struct bcm43xx_private *bcm;
  746. net_dev = dev_get_drvdata(dev);
  747. bcm = bcm43xx_priv(net_dev);
  748. return bcm;
  749. }
  750. /* Helper function, which returns a boolean.
  751. * TRUE, if PIO is used; FALSE, if DMA is used.
  752. */
  753. #if defined(CONFIG_BCM43XX_DMA) && defined(CONFIG_BCM43XX_PIO)
  754. static inline
  755. int bcm43xx_using_pio(struct bcm43xx_private *bcm)
  756. {
  757. return bcm->__using_pio;
  758. }
  759. #elif defined(CONFIG_BCM43XX_DMA)
  760. static inline
  761. int bcm43xx_using_pio(struct bcm43xx_private *bcm)
  762. {
  763. return 0;
  764. }
  765. #elif defined(CONFIG_BCM43XX_PIO)
  766. static inline
  767. int bcm43xx_using_pio(struct bcm43xx_private *bcm)
  768. {
  769. return 1;
  770. }
  771. #else
  772. # error "Using neither DMA nor PIO? Confused..."
  773. #endif
  774. /* Helper functions to access data structures private to the 80211 cores.
  775. * Note that we _must_ have an 80211 core mapped when calling
  776. * any of these functions.
  777. */
  778. static inline
  779. struct bcm43xx_coreinfo_80211 *
  780. bcm43xx_current_80211_priv(struct bcm43xx_private *bcm)
  781. {
  782. assert(bcm->current_core->id == BCM43xx_COREID_80211);
  783. return bcm->current_core->priv;
  784. }
  785. static inline
  786. struct bcm43xx_pio * bcm43xx_current_pio(struct bcm43xx_private *bcm)
  787. {
  788. assert(bcm43xx_using_pio(bcm));
  789. return &(bcm43xx_current_80211_priv(bcm)->pio);
  790. }
  791. static inline
  792. struct bcm43xx_dma * bcm43xx_current_dma(struct bcm43xx_private *bcm)
  793. {
  794. assert(!bcm43xx_using_pio(bcm));
  795. return &(bcm43xx_current_80211_priv(bcm)->dma);
  796. }
  797. static inline
  798. struct bcm43xx_phyinfo * bcm43xx_current_phy(struct bcm43xx_private *bcm)
  799. {
  800. return &(bcm43xx_current_80211_priv(bcm)->phy);
  801. }
  802. static inline
  803. struct bcm43xx_radioinfo * bcm43xx_current_radio(struct bcm43xx_private *bcm)
  804. {
  805. return &(bcm43xx_current_80211_priv(bcm)->radio);
  806. }
  807. static inline
  808. struct bcm43xx_lopair * bcm43xx_get_lopair(struct bcm43xx_phyinfo *phy,
  809. u16 radio_attenuation,
  810. u16 baseband_attenuation)
  811. {
  812. return phy->_lo_pairs + (radio_attenuation + 14 * (baseband_attenuation / 2));
  813. }
  814. static inline
  815. u16 bcm43xx_read16(struct bcm43xx_private *bcm, u16 offset)
  816. {
  817. return ioread16(bcm->mmio_addr + core_offset(bcm) + offset);
  818. }
  819. static inline
  820. void bcm43xx_write16(struct bcm43xx_private *bcm, u16 offset, u16 value)
  821. {
  822. iowrite16(value, bcm->mmio_addr + core_offset(bcm) + offset);
  823. }
  824. static inline
  825. u32 bcm43xx_read32(struct bcm43xx_private *bcm, u16 offset)
  826. {
  827. return ioread32(bcm->mmio_addr + core_offset(bcm) + offset);
  828. }
  829. static inline
  830. void bcm43xx_write32(struct bcm43xx_private *bcm, u16 offset, u32 value)
  831. {
  832. iowrite32(value, bcm->mmio_addr + core_offset(bcm) + offset);
  833. }
  834. static inline
  835. int bcm43xx_pci_read_config16(struct bcm43xx_private *bcm, int offset, u16 *value)
  836. {
  837. return pci_read_config_word(bcm->pci_dev, offset, value);
  838. }
  839. static inline
  840. int bcm43xx_pci_read_config32(struct bcm43xx_private *bcm, int offset, u32 *value)
  841. {
  842. return pci_read_config_dword(bcm->pci_dev, offset, value);
  843. }
  844. static inline
  845. int bcm43xx_pci_write_config16(struct bcm43xx_private *bcm, int offset, u16 value)
  846. {
  847. return pci_write_config_word(bcm->pci_dev, offset, value);
  848. }
  849. static inline
  850. int bcm43xx_pci_write_config32(struct bcm43xx_private *bcm, int offset, u32 value)
  851. {
  852. return pci_write_config_dword(bcm->pci_dev, offset, value);
  853. }
  854. /** Limit a value between two limits */
  855. #ifdef limit_value
  856. # undef limit_value
  857. #endif
  858. #define limit_value(value, min, max) \
  859. ({ \
  860. typeof(value) __value = (value); \
  861. typeof(value) __min = (min); \
  862. typeof(value) __max = (max); \
  863. if (__value < __min) \
  864. __value = __min; \
  865. else if (__value > __max) \
  866. __value = __max; \
  867. __value; \
  868. })
  869. /** Helpers to print MAC addresses. */
  870. #define BCM43xx_MACFMT "%02x:%02x:%02x:%02x:%02x:%02x"
  871. #define BCM43xx_MACARG(x) ((u8*)(x))[0], ((u8*)(x))[1], \
  872. ((u8*)(x))[2], ((u8*)(x))[3], \
  873. ((u8*)(x))[4], ((u8*)(x))[5]
  874. #endif /* BCM43xx_H_ */