bcm43xx.h 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003
  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 100
  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. #define BCM43xx_SBTMSTATELOW_G_MODE_ENABLE 0x20000000
  248. /* sbtmstatehigh state flags */
  249. #define BCM43xx_SBTMSTATEHIGH_SERROR 0x00000001
  250. #define BCM43xx_SBTMSTATEHIGH_BUSY 0x00000004
  251. #define BCM43xx_SBTMSTATEHIGH_TIMEOUT 0x00000020
  252. #define BCM43xx_SBTMSTATEHIGH_G_PHY_AVAIL 0x00010000
  253. #define BCM43xx_SBTMSTATEHIGH_A_PHY_AVAIL 0x00020000
  254. #define BCM43xx_SBTMSTATEHIGH_COREFLAGS 0x1FFF0000
  255. #define BCM43xx_SBTMSTATEHIGH_DMA64BIT 0x10000000
  256. #define BCM43xx_SBTMSTATEHIGH_GATEDCLK 0x20000000
  257. #define BCM43xx_SBTMSTATEHIGH_BISTFAILED 0x40000000
  258. #define BCM43xx_SBTMSTATEHIGH_BISTCOMPLETE 0x80000000
  259. /* sbimstate flags */
  260. #define BCM43xx_SBIMSTATE_IB_ERROR 0x20000
  261. #define BCM43xx_SBIMSTATE_TIMEOUT 0x40000
  262. /* PHYVersioning */
  263. #define BCM43xx_PHYTYPE_A 0x00
  264. #define BCM43xx_PHYTYPE_B 0x01
  265. #define BCM43xx_PHYTYPE_G 0x02
  266. /* PHYRegisters */
  267. #define BCM43xx_PHY_ILT_A_CTRL 0x0072
  268. #define BCM43xx_PHY_ILT_A_DATA1 0x0073
  269. #define BCM43xx_PHY_ILT_A_DATA2 0x0074
  270. #define BCM43xx_PHY_G_LO_CONTROL 0x0810
  271. #define BCM43xx_PHY_ILT_G_CTRL 0x0472
  272. #define BCM43xx_PHY_ILT_G_DATA1 0x0473
  273. #define BCM43xx_PHY_ILT_G_DATA2 0x0474
  274. #define BCM43xx_PHY_A_PCTL 0x007B
  275. #define BCM43xx_PHY_G_PCTL 0x0029
  276. #define BCM43xx_PHY_A_CRS 0x0029
  277. #define BCM43xx_PHY_RADIO_BITFIELD 0x0401
  278. #define BCM43xx_PHY_G_CRS 0x0429
  279. #define BCM43xx_PHY_NRSSILT_CTRL 0x0803
  280. #define BCM43xx_PHY_NRSSILT_DATA 0x0804
  281. /* RadioRegisters */
  282. #define BCM43xx_RADIOCTL_ID 0x01
  283. /* StatusBitField */
  284. #define BCM43xx_SBF_MAC_ENABLED 0x00000001
  285. #define BCM43xx_SBF_2 0x00000002 /*FIXME: fix name*/
  286. #define BCM43xx_SBF_CORE_READY 0x00000004
  287. #define BCM43xx_SBF_400 0x00000400 /*FIXME: fix name*/
  288. #define BCM43xx_SBF_4000 0x00004000 /*FIXME: fix name*/
  289. #define BCM43xx_SBF_8000 0x00008000 /*FIXME: fix name*/
  290. #define BCM43xx_SBF_XFER_REG_BYTESWAP 0x00010000
  291. #define BCM43xx_SBF_MODE_NOTADHOC 0x00020000
  292. #define BCM43xx_SBF_MODE_AP 0x00040000
  293. #define BCM43xx_SBF_RADIOREG_LOCK 0x00080000
  294. #define BCM43xx_SBF_MODE_MONITOR 0x00400000
  295. #define BCM43xx_SBF_MODE_PROMISC 0x01000000
  296. #define BCM43xx_SBF_PS1 0x02000000
  297. #define BCM43xx_SBF_PS2 0x04000000
  298. #define BCM43xx_SBF_NO_SSID_BCAST 0x08000000
  299. #define BCM43xx_SBF_TIME_UPDATE 0x10000000
  300. #define BCM43xx_SBF_MODE_G 0x80000000
  301. /* Microcode */
  302. #define BCM43xx_UCODE_REVISION 0x0000
  303. #define BCM43xx_UCODE_PATCHLEVEL 0x0002
  304. #define BCM43xx_UCODE_DATE 0x0004
  305. #define BCM43xx_UCODE_TIME 0x0006
  306. #define BCM43xx_UCODE_STATUS 0x0040
  307. /* MicrocodeFlagsBitfield (addr + lo-word values?)*/
  308. #define BCM43xx_UCODEFLAGS_OFFSET 0x005E
  309. #define BCM43xx_UCODEFLAG_AUTODIV 0x0001
  310. #define BCM43xx_UCODEFLAG_UNKBGPHY 0x0002
  311. #define BCM43xx_UCODEFLAG_UNKBPHY 0x0004
  312. #define BCM43xx_UCODEFLAG_UNKGPHY 0x0020
  313. #define BCM43xx_UCODEFLAG_UNKPACTRL 0x0040
  314. #define BCM43xx_UCODEFLAG_JAPAN 0x0080
  315. /* Hardware Radio Enable masks */
  316. #define BCM43xx_MMIO_RADIO_HWENABLED_HI_MASK (1 << 16)
  317. #define BCM43xx_MMIO_RADIO_HWENABLED_LO_MASK (1 << 4)
  318. /* Generic-Interrupt reasons. */
  319. #define BCM43xx_IRQ_READY (1 << 0)
  320. #define BCM43xx_IRQ_BEACON (1 << 1)
  321. #define BCM43xx_IRQ_PS (1 << 2)
  322. #define BCM43xx_IRQ_REG124 (1 << 5)
  323. #define BCM43xx_IRQ_PMQ (1 << 6)
  324. #define BCM43xx_IRQ_PIO_WORKAROUND (1 << 8)
  325. #define BCM43xx_IRQ_XMIT_ERROR (1 << 11)
  326. #define BCM43xx_IRQ_RX (1 << 15)
  327. #define BCM43xx_IRQ_SCAN (1 << 16)
  328. #define BCM43xx_IRQ_NOISE (1 << 18)
  329. #define BCM43xx_IRQ_XMIT_STATUS (1 << 29)
  330. #define BCM43xx_IRQ_ALL 0xffffffff
  331. #define BCM43xx_IRQ_INITIAL (BCM43xx_IRQ_PS | \
  332. BCM43xx_IRQ_REG124 | \
  333. BCM43xx_IRQ_PMQ | \
  334. BCM43xx_IRQ_XMIT_ERROR | \
  335. BCM43xx_IRQ_RX | \
  336. BCM43xx_IRQ_SCAN | \
  337. BCM43xx_IRQ_NOISE | \
  338. BCM43xx_IRQ_XMIT_STATUS)
  339. /* Initial default iw_mode */
  340. #define BCM43xx_INITIAL_IWMODE IW_MODE_INFRA
  341. /* Bus type PCI. */
  342. #define BCM43xx_BUSTYPE_PCI 0
  343. /* Bus type Silicone Backplane Bus. */
  344. #define BCM43xx_BUSTYPE_SB 1
  345. /* Bus type PCMCIA. */
  346. #define BCM43xx_BUSTYPE_PCMCIA 2
  347. /* Threshold values. */
  348. #define BCM43xx_MIN_RTS_THRESHOLD 1U
  349. #define BCM43xx_MAX_RTS_THRESHOLD 2304U
  350. #define BCM43xx_DEFAULT_RTS_THRESHOLD BCM43xx_MAX_RTS_THRESHOLD
  351. #define BCM43xx_DEFAULT_SHORT_RETRY_LIMIT 7
  352. #define BCM43xx_DEFAULT_LONG_RETRY_LIMIT 4
  353. /* FIXME: the next line is a guess as to what the maximum RSSI value might be */
  354. #define RX_RSSI_MAX 60
  355. /* Max size of a security key */
  356. #define BCM43xx_SEC_KEYSIZE 16
  357. /* Security algorithms. */
  358. enum {
  359. BCM43xx_SEC_ALGO_NONE = 0, /* unencrypted, as of TX header. */
  360. BCM43xx_SEC_ALGO_WEP,
  361. BCM43xx_SEC_ALGO_UNKNOWN,
  362. BCM43xx_SEC_ALGO_AES,
  363. BCM43xx_SEC_ALGO_WEP104,
  364. BCM43xx_SEC_ALGO_TKIP,
  365. };
  366. #ifdef assert
  367. # undef assert
  368. #endif
  369. #ifdef CONFIG_BCM43XX_DEBUG
  370. #define assert(expr) \
  371. do { \
  372. if (unlikely(!(expr))) { \
  373. printk(KERN_ERR PFX "ASSERTION FAILED (%s) at: %s:%d:%s()\n", \
  374. #expr, __FILE__, __LINE__, __FUNCTION__); \
  375. } \
  376. } while (0)
  377. #else
  378. #define assert(expr) do { /* nothing */ } while (0)
  379. #endif
  380. /* rate limited printk(). */
  381. #ifdef printkl
  382. # undef printkl
  383. #endif
  384. #define printkl(f, x...) do { if (printk_ratelimit()) printk(f ,##x); } while (0)
  385. /* rate limited printk() for debugging */
  386. #ifdef dprintkl
  387. # undef dprintkl
  388. #endif
  389. #ifdef CONFIG_BCM43XX_DEBUG
  390. # define dprintkl printkl
  391. #else
  392. # define dprintkl(f, x...) do { /* nothing */ } while (0)
  393. #endif
  394. /* Helper macro for if branches.
  395. * An if branch marked with this macro is only taken in DEBUG mode.
  396. * Example:
  397. * if (DEBUG_ONLY(foo == bar)) {
  398. * do something
  399. * }
  400. * In DEBUG mode, the branch will be taken if (foo == bar).
  401. * In non-DEBUG mode, the branch will never be taken.
  402. */
  403. #ifdef DEBUG_ONLY
  404. # undef DEBUG_ONLY
  405. #endif
  406. #ifdef CONFIG_BCM43XX_DEBUG
  407. # define DEBUG_ONLY(x) (x)
  408. #else
  409. # define DEBUG_ONLY(x) 0
  410. #endif
  411. /* debugging printk() */
  412. #ifdef dprintk
  413. # undef dprintk
  414. #endif
  415. #ifdef CONFIG_BCM43XX_DEBUG
  416. # define dprintk(f, x...) do { printk(f ,##x); } while (0)
  417. #else
  418. # define dprintk(f, x...) do { /* nothing */ } while (0)
  419. #endif
  420. struct net_device;
  421. struct pci_dev;
  422. struct bcm43xx_dmaring;
  423. struct bcm43xx_pioqueue;
  424. struct bcm43xx_initval {
  425. u16 offset;
  426. u16 size;
  427. u32 value;
  428. } __attribute__((__packed__));
  429. /* Values for bcm430x_sprominfo.locale */
  430. enum {
  431. BCM43xx_LOCALE_WORLD = 0,
  432. BCM43xx_LOCALE_THAILAND,
  433. BCM43xx_LOCALE_ISRAEL,
  434. BCM43xx_LOCALE_JORDAN,
  435. BCM43xx_LOCALE_CHINA,
  436. BCM43xx_LOCALE_JAPAN,
  437. BCM43xx_LOCALE_USA_CANADA_ANZ,
  438. BCM43xx_LOCALE_EUROPE,
  439. BCM43xx_LOCALE_USA_LOW,
  440. BCM43xx_LOCALE_JAPAN_HIGH,
  441. BCM43xx_LOCALE_ALL,
  442. BCM43xx_LOCALE_NONE,
  443. };
  444. #define BCM43xx_SPROM_SIZE 64 /* in 16-bit words. */
  445. struct bcm43xx_sprominfo {
  446. u16 boardflags2;
  447. u8 il0macaddr[6];
  448. u8 et0macaddr[6];
  449. u8 et1macaddr[6];
  450. u8 et0phyaddr:5;
  451. u8 et1phyaddr:5;
  452. u8 boardrev;
  453. u8 locale:4;
  454. u8 antennas_aphy:2;
  455. u8 antennas_bgphy:2;
  456. u16 pa0b0;
  457. u16 pa0b1;
  458. u16 pa0b2;
  459. u8 wl0gpio0;
  460. u8 wl0gpio1;
  461. u8 wl0gpio2;
  462. u8 wl0gpio3;
  463. u8 maxpower_aphy;
  464. u8 maxpower_bgphy;
  465. u16 pa1b0;
  466. u16 pa1b1;
  467. u16 pa1b2;
  468. u8 idle_tssi_tgt_aphy;
  469. u8 idle_tssi_tgt_bgphy;
  470. u16 boardflags;
  471. u16 antennagain_aphy;
  472. u16 antennagain_bgphy;
  473. };
  474. /* Value pair to measure the LocalOscillator. */
  475. struct bcm43xx_lopair {
  476. s8 low;
  477. s8 high;
  478. u8 used:1;
  479. };
  480. #define BCM43xx_LO_COUNT (14*4)
  481. struct bcm43xx_phyinfo {
  482. /* Hardware Data */
  483. u8 analog;
  484. u8 type;
  485. u8 rev;
  486. u16 antenna_diversity;
  487. u16 savedpctlreg;
  488. u16 minlowsig[2];
  489. u16 minlowsigpos[2];
  490. u8 connected:1,
  491. calibrated:1,
  492. is_locked:1, /* used in bcm43xx_phy_{un}lock() */
  493. dyn_tssi_tbl:1; /* used in bcm43xx_phy_init_tssi2dbm_table() */
  494. /* LO Measurement Data.
  495. * Use bcm43xx_get_lopair() to get a value.
  496. */
  497. struct bcm43xx_lopair *_lo_pairs;
  498. /* TSSI to dBm table in use */
  499. const s8 *tssi2dbm;
  500. /* idle TSSI value */
  501. s8 idle_tssi;
  502. /* Values from bcm43xx_calc_loopback_gain() */
  503. u16 loopback_gain[2];
  504. /* PHY lock for core.rev < 3
  505. * This lock is only used by bcm43xx_phy_{un}lock()
  506. */
  507. spinlock_t lock;
  508. /* Firmware. */
  509. const struct firmware *ucode;
  510. const struct firmware *pcm;
  511. const struct firmware *initvals0;
  512. const struct firmware *initvals1;
  513. };
  514. struct bcm43xx_radioinfo {
  515. u16 manufact;
  516. u16 version;
  517. u8 revision;
  518. /* Desired TX power in dBm Q5.2 */
  519. u16 txpower_desired;
  520. /* TX Power control values. */
  521. union {
  522. /* B/G PHY */
  523. struct {
  524. u16 baseband_atten;
  525. u16 radio_atten;
  526. u16 txctl1;
  527. u16 txctl2;
  528. };
  529. /* A PHY */
  530. struct {
  531. u16 txpwr_offset;
  532. };
  533. };
  534. /* Current Interference Mitigation mode */
  535. int interfmode;
  536. /* Stack of saved values from the Interference Mitigation code.
  537. * Each value in the stack is layed out as follows:
  538. * bit 0-11: offset
  539. * bit 12-15: register ID
  540. * bit 16-32: value
  541. * register ID is: 0x1 PHY, 0x2 Radio, 0x3 ILT
  542. */
  543. #define BCM43xx_INTERFSTACK_SIZE 26
  544. u32 interfstack[BCM43xx_INTERFSTACK_SIZE];
  545. /* Saved values from the NRSSI Slope calculation */
  546. s16 nrssi[2];
  547. s32 nrssislope;
  548. /* In memory nrssi lookup table. */
  549. s8 nrssi_lt[64];
  550. /* current channel */
  551. u8 channel;
  552. u8 initial_channel;
  553. u16 lofcal;
  554. u16 initval;
  555. u8 enabled:1;
  556. /* ACI (adjacent channel interference) flags. */
  557. u8 aci_enable:1,
  558. aci_wlan_automatic:1,
  559. aci_hw_rssi:1;
  560. };
  561. /* Data structures for DMA transmission, per 80211 core. */
  562. struct bcm43xx_dma {
  563. struct bcm43xx_dmaring *tx_ring0;
  564. struct bcm43xx_dmaring *tx_ring1;
  565. struct bcm43xx_dmaring *tx_ring2;
  566. struct bcm43xx_dmaring *tx_ring3;
  567. struct bcm43xx_dmaring *tx_ring4;
  568. struct bcm43xx_dmaring *tx_ring5;
  569. struct bcm43xx_dmaring *rx_ring0;
  570. struct bcm43xx_dmaring *rx_ring3; /* only available on core.rev < 5 */
  571. };
  572. /* Data structures for PIO transmission, per 80211 core. */
  573. struct bcm43xx_pio {
  574. struct bcm43xx_pioqueue *queue0;
  575. struct bcm43xx_pioqueue *queue1;
  576. struct bcm43xx_pioqueue *queue2;
  577. struct bcm43xx_pioqueue *queue3;
  578. };
  579. #define BCM43xx_MAX_80211_CORES 2
  580. /* Generic information about a core. */
  581. struct bcm43xx_coreinfo {
  582. u8 available:1,
  583. enabled:1,
  584. initialized:1;
  585. /** core_rev revision number */
  586. u8 rev;
  587. /** Index number for _switch_core() */
  588. u8 index;
  589. /** core_id ID number */
  590. u16 id;
  591. /** Core-specific data. */
  592. void *priv;
  593. };
  594. /* Additional information for each 80211 core. */
  595. struct bcm43xx_coreinfo_80211 {
  596. /* PHY device. */
  597. struct bcm43xx_phyinfo phy;
  598. /* Radio device. */
  599. struct bcm43xx_radioinfo radio;
  600. union {
  601. /* DMA context. */
  602. struct bcm43xx_dma dma;
  603. /* PIO context. */
  604. struct bcm43xx_pio pio;
  605. };
  606. };
  607. /* Context information for a noise calculation (Link Quality). */
  608. struct bcm43xx_noise_calculation {
  609. struct bcm43xx_coreinfo *core_at_start;
  610. u8 channel_at_start;
  611. u8 calculation_running:1;
  612. u8 nr_samples;
  613. s8 samples[8][4];
  614. };
  615. struct bcm43xx_stats {
  616. u8 noise;
  617. struct iw_statistics wstats;
  618. /* Store the last TX/RX times here for updating the leds. */
  619. unsigned long last_tx;
  620. unsigned long last_rx;
  621. };
  622. struct bcm43xx_key {
  623. u8 enabled:1;
  624. u8 algorithm;
  625. };
  626. /* Driver initialization status. */
  627. enum {
  628. BCM43xx_STAT_UNINIT, /* Uninitialized. */
  629. BCM43xx_STAT_INITIALIZING, /* init_board() in progress. */
  630. BCM43xx_STAT_INITIALIZED, /* Fully operational. */
  631. BCM43xx_STAT_SHUTTINGDOWN, /* free_board() in progress. */
  632. BCM43xx_STAT_RESTARTING, /* controller_restart() called. */
  633. };
  634. #define bcm43xx_status(bcm) atomic_read(&(bcm)->init_status)
  635. #define bcm43xx_set_status(bcm, stat) do { \
  636. atomic_set(&(bcm)->init_status, (stat)); \
  637. smp_wmb(); \
  638. } while (0)
  639. /* *** THEORY OF LOCKING ***
  640. *
  641. * We have two different locks in the bcm43xx driver.
  642. * => bcm->mutex: General sleeping mutex. Protects struct bcm43xx_private
  643. * and the device registers. This mutex does _not_ protect
  644. * against concurrency from the IRQ handler.
  645. * => bcm->irq_lock: IRQ spinlock. Protects against IRQ handler concurrency.
  646. *
  647. * Please note that, if you only take the irq_lock, you are not protected
  648. * against concurrency from the periodic work handlers.
  649. * Most times you want to take _both_ locks.
  650. */
  651. struct bcm43xx_private {
  652. struct ieee80211_device *ieee;
  653. struct ieee80211softmac_device *softmac;
  654. struct net_device *net_dev;
  655. struct pci_dev *pci_dev;
  656. unsigned int irq;
  657. void __iomem *mmio_addr;
  658. spinlock_t irq_lock;
  659. struct mutex mutex;
  660. /* Driver initialization status BCM43xx_STAT_*** */
  661. atomic_t init_status;
  662. u16 was_initialized:1, /* for PCI suspend/resume. */
  663. __using_pio:1, /* Internal, use bcm43xx_using_pio(). */
  664. bad_frames_preempt:1, /* Use "Bad Frames Preemption" (default off) */
  665. reg124_set_0x4:1, /* Some variable to keep track of IRQ stuff. */
  666. short_preamble:1, /* TRUE, if short preamble is enabled. */
  667. firmware_norelease:1, /* Do not release the firmware. Used on suspend. */
  668. radio_hw_enable:1; /* TRUE if radio is hardware enabled */
  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. u64 dma_mask;
  675. u16 board_vendor;
  676. u16 board_type;
  677. u16 board_revision;
  678. u16 chip_id;
  679. u8 chip_rev;
  680. u8 chip_package;
  681. struct bcm43xx_sprominfo sprom;
  682. #define BCM43xx_NR_LEDS 4
  683. struct bcm43xx_led leds[BCM43xx_NR_LEDS];
  684. spinlock_t leds_lock;
  685. /* The currently active core. */
  686. struct bcm43xx_coreinfo *current_core;
  687. struct bcm43xx_coreinfo *active_80211_core;
  688. /* coreinfo structs for all possible cores follow.
  689. * Note that a core might not exist.
  690. * So check the coreinfo flags before using it.
  691. */
  692. struct bcm43xx_coreinfo core_chipcommon;
  693. struct bcm43xx_coreinfo core_pci;
  694. struct bcm43xx_coreinfo core_80211[ BCM43xx_MAX_80211_CORES ];
  695. /* Additional information, specific to the 80211 cores. */
  696. struct bcm43xx_coreinfo_80211 core_80211_ext[ BCM43xx_MAX_80211_CORES ];
  697. /* Number of available 80211 cores. */
  698. int nr_80211_available;
  699. u32 chipcommon_capabilities;
  700. /* Reason code of the last interrupt. */
  701. u32 irq_reason;
  702. u32 dma_reason[6];
  703. /* saved irq enable/disable state bitfield. */
  704. u32 irq_savedstate;
  705. /* Link Quality calculation context. */
  706. struct bcm43xx_noise_calculation noisecalc;
  707. /* if > 0 MAC is suspended. if == 0 MAC is enabled. */
  708. int mac_suspended;
  709. /* Threshold values. */
  710. //TODO: The RTS thr has to be _used_. Currently, it is only set via WX.
  711. u32 rts_threshold;
  712. /* Interrupt Service Routine tasklet (bottom-half) */
  713. struct tasklet_struct isr_tasklet;
  714. /* Periodic tasks */
  715. struct delayed_work periodic_work;
  716. unsigned int periodic_state;
  717. struct work_struct restart_work;
  718. /* Informational stuff. */
  719. char nick[IW_ESSID_MAX_SIZE + 1];
  720. /* encryption/decryption */
  721. u16 security_offset;
  722. struct bcm43xx_key key[54];
  723. u8 default_key_idx;
  724. /* Random Number Generator. */
  725. struct hwrng rng;
  726. char rng_name[20 + 1];
  727. /* Debugging stuff follows. */
  728. #ifdef CONFIG_BCM43XX_DEBUG
  729. struct bcm43xx_dfsentry *dfsentry;
  730. #endif
  731. };
  732. static inline
  733. struct bcm43xx_private * bcm43xx_priv(struct net_device *dev)
  734. {
  735. return ieee80211softmac_priv(dev);
  736. }
  737. struct device;
  738. static inline
  739. struct bcm43xx_private * dev_to_bcm(struct device *dev)
  740. {
  741. struct net_device *net_dev;
  742. struct bcm43xx_private *bcm;
  743. net_dev = dev_get_drvdata(dev);
  744. bcm = bcm43xx_priv(net_dev);
  745. return bcm;
  746. }
  747. /* Helper function, which returns a boolean.
  748. * TRUE, if PIO is used; FALSE, if DMA is used.
  749. */
  750. #if defined(CONFIG_BCM43XX_DMA) && defined(CONFIG_BCM43XX_PIO)
  751. static inline
  752. int bcm43xx_using_pio(struct bcm43xx_private *bcm)
  753. {
  754. return bcm->__using_pio;
  755. }
  756. #elif defined(CONFIG_BCM43XX_DMA)
  757. static inline
  758. int bcm43xx_using_pio(struct bcm43xx_private *bcm)
  759. {
  760. return 0;
  761. }
  762. #elif defined(CONFIG_BCM43XX_PIO)
  763. static inline
  764. int bcm43xx_using_pio(struct bcm43xx_private *bcm)
  765. {
  766. return 1;
  767. }
  768. #else
  769. # error "Using neither DMA nor PIO? Confused..."
  770. #endif
  771. /* Helper functions to access data structures private to the 80211 cores.
  772. * Note that we _must_ have an 80211 core mapped when calling
  773. * any of these functions.
  774. */
  775. static inline
  776. struct bcm43xx_coreinfo_80211 *
  777. bcm43xx_current_80211_priv(struct bcm43xx_private *bcm)
  778. {
  779. assert(bcm->current_core->id == BCM43xx_COREID_80211);
  780. return bcm->current_core->priv;
  781. }
  782. static inline
  783. struct bcm43xx_pio * bcm43xx_current_pio(struct bcm43xx_private *bcm)
  784. {
  785. assert(bcm43xx_using_pio(bcm));
  786. return &(bcm43xx_current_80211_priv(bcm)->pio);
  787. }
  788. static inline
  789. struct bcm43xx_dma * bcm43xx_current_dma(struct bcm43xx_private *bcm)
  790. {
  791. assert(!bcm43xx_using_pio(bcm));
  792. return &(bcm43xx_current_80211_priv(bcm)->dma);
  793. }
  794. static inline
  795. struct bcm43xx_phyinfo * bcm43xx_current_phy(struct bcm43xx_private *bcm)
  796. {
  797. return &(bcm43xx_current_80211_priv(bcm)->phy);
  798. }
  799. static inline
  800. struct bcm43xx_radioinfo * bcm43xx_current_radio(struct bcm43xx_private *bcm)
  801. {
  802. return &(bcm43xx_current_80211_priv(bcm)->radio);
  803. }
  804. static inline
  805. struct bcm43xx_lopair * bcm43xx_get_lopair(struct bcm43xx_phyinfo *phy,
  806. u16 radio_attenuation,
  807. u16 baseband_attenuation)
  808. {
  809. return phy->_lo_pairs + (radio_attenuation + 14 * (baseband_attenuation / 2));
  810. }
  811. static inline
  812. u16 bcm43xx_read16(struct bcm43xx_private *bcm, u16 offset)
  813. {
  814. return ioread16(bcm->mmio_addr + offset);
  815. }
  816. static inline
  817. void bcm43xx_write16(struct bcm43xx_private *bcm, u16 offset, u16 value)
  818. {
  819. iowrite16(value, bcm->mmio_addr + offset);
  820. }
  821. static inline
  822. u32 bcm43xx_read32(struct bcm43xx_private *bcm, u16 offset)
  823. {
  824. return ioread32(bcm->mmio_addr + offset);
  825. }
  826. static inline
  827. void bcm43xx_write32(struct bcm43xx_private *bcm, u16 offset, u32 value)
  828. {
  829. iowrite32(value, bcm->mmio_addr + offset);
  830. }
  831. static inline
  832. int bcm43xx_pci_read_config16(struct bcm43xx_private *bcm, int offset, u16 *value)
  833. {
  834. return pci_read_config_word(bcm->pci_dev, offset, value);
  835. }
  836. static inline
  837. int bcm43xx_pci_read_config32(struct bcm43xx_private *bcm, int offset, u32 *value)
  838. {
  839. return pci_read_config_dword(bcm->pci_dev, offset, value);
  840. }
  841. static inline
  842. int bcm43xx_pci_write_config16(struct bcm43xx_private *bcm, int offset, u16 value)
  843. {
  844. return pci_write_config_word(bcm->pci_dev, offset, value);
  845. }
  846. static inline
  847. int bcm43xx_pci_write_config32(struct bcm43xx_private *bcm, int offset, u32 value)
  848. {
  849. return pci_write_config_dword(bcm->pci_dev, offset, value);
  850. }
  851. /** Limit a value between two limits */
  852. #ifdef limit_value
  853. # undef limit_value
  854. #endif
  855. #define limit_value(value, min, max) \
  856. ({ \
  857. typeof(value) __value = (value); \
  858. typeof(value) __min = (min); \
  859. typeof(value) __max = (max); \
  860. if (__value < __min) \
  861. __value = __min; \
  862. else if (__value > __max) \
  863. __value = __max; \
  864. __value; \
  865. })
  866. /** Helpers to print MAC addresses. */
  867. #define BCM43xx_MACFMT "%02x:%02x:%02x:%02x:%02x:%02x"
  868. #define BCM43xx_MACARG(x) ((u8*)(x))[0], ((u8*)(x))[1], \
  869. ((u8*)(x))[2], ((u8*)(x))[3], \
  870. ((u8*)(x))[4], ((u8*)(x))[5]
  871. #endif /* BCM43xx_H_ */