mac.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946
  1. /*
  2. * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  3. * All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. *
  19. *
  20. * File: mac.h
  21. *
  22. * Purpose: MAC routines
  23. *
  24. * Author: Tevin Chen
  25. *
  26. * Date: May 21, 1996
  27. *
  28. * Revision History:
  29. * 07-01-2003 Bryan YC Fan: Re-write codes to support VT3253 spec.
  30. * 08-25-2003 Kyle Hsu: Porting MAC functions from sim53.
  31. * 09-03-2003 Bryan YC Fan: Add MACvDisableProtectMD & MACvEnableProtectMD
  32. */
  33. #ifndef __MAC_H__
  34. #define __MAC_H__
  35. #include "tmacro.h"
  36. #include "upc.h"
  37. /*--------------------- Export Definitions -------------------------*/
  38. /* Registers in the MAC */
  39. #define MAC_MAX_CONTEXT_SIZE_PAGE0 256
  40. #define MAC_MAX_CONTEXT_SIZE_PAGE1 128
  41. /* Registers not related to 802.11b */
  42. #define MAC_REG_BCFG0 0x00
  43. #define MAC_REG_BCFG1 0x01
  44. #define MAC_REG_FCR0 0x02
  45. #define MAC_REG_FCR1 0x03
  46. #define MAC_REG_BISTCMD 0x04
  47. #define MAC_REG_BISTSR0 0x05
  48. #define MAC_REG_BISTSR1 0x06
  49. #define MAC_REG_BISTSR2 0x07
  50. #define MAC_REG_I2MCSR 0x08
  51. #define MAC_REG_I2MTGID 0x09
  52. #define MAC_REG_I2MTGAD 0x0A
  53. #define MAC_REG_I2MCFG 0x0B
  54. #define MAC_REG_I2MDIPT 0x0C
  55. #define MAC_REG_I2MDOPT 0x0E
  56. #define MAC_REG_PMC0 0x10
  57. #define MAC_REG_PMC1 0x11
  58. #define MAC_REG_STICKHW 0x12
  59. #define MAC_REG_LOCALID 0x14
  60. #define MAC_REG_TESTCFG 0x15
  61. #define MAC_REG_JUMPER0 0x16
  62. #define MAC_REG_JUMPER1 0x17
  63. #define MAC_REG_TMCTL0 0x18
  64. #define MAC_REG_TMCTL1 0x19
  65. #define MAC_REG_TMDATA0 0x1C
  66. /* MAC Parameter related */
  67. #define MAC_REG_LRT 0x20
  68. #define MAC_REG_SRT 0x21
  69. #define MAC_REG_SIFS 0x22
  70. #define MAC_REG_DIFS 0x23
  71. #define MAC_REG_EIFS 0x24
  72. #define MAC_REG_SLOT 0x25
  73. #define MAC_REG_BI 0x26
  74. #define MAC_REG_CWMAXMIN0 0x28
  75. #define MAC_REG_LINKOFFTOTM 0x2A
  76. #define MAC_REG_SWTMOT 0x2B
  77. #define MAC_REG_MIBCNTR 0x2C
  78. #define MAC_REG_RTSOKCNT 0x2C
  79. #define MAC_REG_RTSFAILCNT 0x2D
  80. #define MAC_REG_ACKFAILCNT 0x2E
  81. #define MAC_REG_FCSERRCNT 0x2F
  82. /* TSF Related */
  83. #define MAC_REG_TSFCNTR 0x30
  84. #define MAC_REG_NEXTTBTT 0x38
  85. #define MAC_REG_TSFOFST 0x40
  86. #define MAC_REG_TFTCTL 0x48
  87. /* WMAC Control/Status Related */
  88. #define MAC_REG_ENCFG 0x4C
  89. #define MAC_REG_PAGE1SEL 0x4F
  90. #define MAC_REG_CFG 0x50
  91. #define MAC_REG_TEST 0x52
  92. #define MAC_REG_HOSTCR 0x54
  93. #define MAC_REG_MACCR 0x55
  94. #define MAC_REG_RCR 0x56
  95. #define MAC_REG_TCR 0x57
  96. #define MAC_REG_IMR 0x58
  97. #define MAC_REG_ISR 0x5C
  98. /* Power Saving Related */
  99. #define MAC_REG_PSCFG 0x60
  100. #define MAC_REG_PSCTL 0x61
  101. #define MAC_REG_PSPWRSIG 0x62
  102. #define MAC_REG_BBCR13 0x63
  103. #define MAC_REG_AIDATIM 0x64
  104. #define MAC_REG_PWBT 0x66
  105. #define MAC_REG_WAKEOKTMR 0x68
  106. #define MAC_REG_CALTMR 0x69
  107. #define MAC_REG_SYNSPACCNT 0x6A
  108. #define MAC_REG_WAKSYNOPT 0x6B
  109. /* Baseband/IF Control Group */
  110. #define MAC_REG_BBREGCTL 0x6C
  111. #define MAC_REG_CHANNEL 0x6D
  112. #define MAC_REG_BBREGADR 0x6E
  113. #define MAC_REG_BBREGDATA 0x6F
  114. #define MAC_REG_IFREGCTL 0x70
  115. #define MAC_REG_IFDATA 0x71
  116. #define MAC_REG_ITRTMSET 0x74
  117. #define MAC_REG_PAPEDELAY 0x77
  118. #define MAC_REG_SOFTPWRCTL 0x78
  119. #define MAC_REG_GPIOCTL0 0x7A
  120. #define MAC_REG_GPIOCTL1 0x7B
  121. /* MAC DMA Related Group */
  122. #define MAC_REG_TXDMACTL0 0x7C
  123. #define MAC_REG_TXDMAPTR0 0x80
  124. #define MAC_REG_AC0DMACTL 0x84
  125. #define MAC_REG_AC0DMAPTR 0x88
  126. #define MAC_REG_BCNDMACTL 0x8C
  127. #define MAC_REG_BCNDMAPTR 0x90
  128. #define MAC_REG_RXDMACTL0 0x94
  129. #define MAC_REG_RXDMAPTR0 0x98
  130. #define MAC_REG_RXDMACTL1 0x9C
  131. #define MAC_REG_RXDMAPTR1 0xA0
  132. #define MAC_REG_SYNCDMACTL 0xA4
  133. #define MAC_REG_SYNCDMAPTR 0xA8
  134. #define MAC_REG_ATIMDMACTL 0xAC
  135. #define MAC_REG_ATIMDMAPTR 0xB0
  136. /* MiscFF PIO related */
  137. #define MAC_REG_MISCFFNDEX 0xB4
  138. #define MAC_REG_MISCFFCTL 0xB6
  139. #define MAC_REG_MISCFFDATA 0xB8
  140. /* Extend SW Timer */
  141. #define MAC_REG_TMDATA1 0xBC
  142. /* WOW Related Group */
  143. #define MAC_REG_WAKEUPEN0 0xC0
  144. #define MAC_REG_WAKEUPEN1 0xC1
  145. #define MAC_REG_WAKEUPSR0 0xC2
  146. #define MAC_REG_WAKEUPSR1 0xC3
  147. #define MAC_REG_WAKE128_0 0xC4
  148. #define MAC_REG_WAKE128_1 0xD4
  149. #define MAC_REG_WAKE128_2 0xE4
  150. #define MAC_REG_WAKE128_3 0xF4
  151. /************** Page 1 ******************/
  152. #define MAC_REG_CRC_128_0 0x04
  153. #define MAC_REG_CRC_128_1 0x06
  154. #define MAC_REG_CRC_128_2 0x08
  155. #define MAC_REG_CRC_128_3 0x0A
  156. /* MAC Configuration Group */
  157. #define MAC_REG_PAR0 0x0C
  158. #define MAC_REG_PAR4 0x10
  159. #define MAC_REG_BSSID0 0x14
  160. #define MAC_REG_BSSID4 0x18
  161. #define MAC_REG_MAR0 0x1C
  162. #define MAC_REG_MAR4 0x20
  163. /* MAC RSPPKT INFO Group */
  164. #define MAC_REG_RSPINF_B_1 0x24
  165. #define MAC_REG_RSPINF_B_2 0x28
  166. #define MAC_REG_RSPINF_B_5 0x2C
  167. #define MAC_REG_RSPINF_B_11 0x30
  168. #define MAC_REG_RSPINF_A_6 0x34
  169. #define MAC_REG_RSPINF_A_9 0x36
  170. #define MAC_REG_RSPINF_A_12 0x38
  171. #define MAC_REG_RSPINF_A_18 0x3A
  172. #define MAC_REG_RSPINF_A_24 0x3C
  173. #define MAC_REG_RSPINF_A_36 0x3E
  174. #define MAC_REG_RSPINF_A_48 0x40
  175. #define MAC_REG_RSPINF_A_54 0x42
  176. #define MAC_REG_RSPINF_A_72 0x44
  177. /* 802.11h relative */
  178. #define MAC_REG_QUIETINIT 0x60
  179. #define MAC_REG_QUIETGAP 0x62
  180. #define MAC_REG_QUIETDUR 0x64
  181. #define MAC_REG_MSRCTL 0x66
  182. #define MAC_REG_MSRBBSTS 0x67
  183. #define MAC_REG_MSRSTART 0x68
  184. #define MAC_REG_MSRDURATION 0x70
  185. #define MAC_REG_CCAFRACTION 0x72
  186. #define MAC_REG_PWRCCK 0x73
  187. #define MAC_REG_PWROFDM 0x7C
  188. /* Bits in the BCFG0 register */
  189. #define BCFG0_PERROFF 0x40
  190. #define BCFG0_MRDMDIS 0x20
  191. #define BCFG0_MRDLDIS 0x10
  192. #define BCFG0_MWMEN 0x08
  193. #define BCFG0_VSERREN 0x02
  194. #define BCFG0_LATMEN 0x01
  195. /* Bits in the BCFG1 register */
  196. #define BCFG1_CFUNOPT 0x80
  197. #define BCFG1_CREQOPT 0x40
  198. #define BCFG1_DMA8 0x10
  199. #define BCFG1_ARBITOPT 0x08
  200. #define BCFG1_PCIMEN 0x04
  201. #define BCFG1_MIOEN 0x02
  202. #define BCFG1_CISDLYEN 0x01
  203. /* Bits in RAMBIST registers */
  204. #define BISTCMD_TSTPAT5 0x00
  205. #define BISTCMD_TSTPATA 0x80
  206. #define BISTCMD_TSTERR 0x20
  207. #define BISTCMD_TSTPATF 0x18
  208. #define BISTCMD_TSTPAT0 0x10
  209. #define BISTCMD_TSTMODE 0x04
  210. #define BISTCMD_TSTITTX 0x03
  211. #define BISTCMD_TSTATRX 0x02
  212. #define BISTCMD_TSTATTX 0x01
  213. #define BISTCMD_TSTRX 0x00
  214. #define BISTSR0_BISTGO 0x01
  215. #define BISTSR1_TSTSR 0x01
  216. #define BISTSR2_CMDPRTEN 0x02
  217. #define BISTSR2_RAMTSTEN 0x01
  218. /* Bits in the I2MCFG EEPROM register */
  219. #define I2MCFG_BOUNDCTL 0x80
  220. #define I2MCFG_WAITCTL 0x20
  221. #define I2MCFG_SCLOECTL 0x10
  222. #define I2MCFG_WBUSYCTL 0x08
  223. #define I2MCFG_NORETRY 0x04
  224. #define I2MCFG_I2MLDSEQ 0x02
  225. #define I2MCFG_I2CMFAST 0x01
  226. /* Bits in the I2MCSR EEPROM register */
  227. #define I2MCSR_EEMW 0x80
  228. #define I2MCSR_EEMR 0x40
  229. #define I2MCSR_AUTOLD 0x08
  230. #define I2MCSR_NACK 0x02
  231. #define I2MCSR_DONE 0x01
  232. /* Bits in the PMC1 register */
  233. #define SPS_RST 0x80
  234. #define PCISTIKY 0x40
  235. #define PME_OVR 0x02
  236. /* Bits in the STICKYHW register */
  237. #define STICKHW_DS1_SHADOW 0x02
  238. #define STICKHW_DS0_SHADOW 0x01
  239. /* Bits in the TMCTL register */
  240. #define TMCTL_TSUSP 0x04
  241. #define TMCTL_TMD 0x02
  242. #define TMCTL_TE 0x01
  243. /* Bits in the TFTCTL register */
  244. #define TFTCTL_HWUTSF 0x80
  245. #define TFTCTL_TBTTSYNC 0x40
  246. #define TFTCTL_HWUTSFEN 0x20
  247. #define TFTCTL_TSFCNTRRD 0x10
  248. #define TFTCTL_TBTTSYNCEN 0x08
  249. #define TFTCTL_TSFSYNCEN 0x04
  250. #define TFTCTL_TSFCNTRST 0x02
  251. #define TFTCTL_TSFCNTREN 0x01
  252. /* Bits in the EnhanceCFG register */
  253. #define EnCFG_BarkerPream 0x00020000
  254. #define EnCFG_NXTBTTCFPSTR 0x00010000
  255. #define EnCFG_BcnSusClr 0x00000200
  256. #define EnCFG_BcnSusInd 0x00000100
  257. #define EnCFG_CFP_ProtectEn 0x00000040
  258. #define EnCFG_ProtectMd 0x00000020
  259. #define EnCFG_HwParCFP 0x00000010
  260. #define EnCFG_CFNULRSP 0x00000004
  261. #define EnCFG_BBType_MASK 0x00000003
  262. #define EnCFG_BBType_g 0x00000002
  263. #define EnCFG_BBType_b 0x00000001
  264. #define EnCFG_BBType_a 0x00000000
  265. /* Bits in the Page1Sel register */
  266. #define PAGE1_SEL 0x01
  267. /* Bits in the CFG register */
  268. #define CFG_TKIPOPT 0x80
  269. #define CFG_RXDMAOPT 0x40
  270. #define CFG_TMOT_SW 0x20
  271. #define CFG_TMOT_HWLONG 0x10
  272. #define CFG_TMOT_HW 0x00
  273. #define CFG_CFPENDOPT 0x08
  274. #define CFG_BCNSUSEN 0x04
  275. #define CFG_NOTXTIMEOUT 0x02
  276. #define CFG_NOBUFOPT 0x01
  277. /* Bits in the TEST register */
  278. #define TEST_LBEXT 0x80
  279. #define TEST_LBINT 0x40
  280. #define TEST_LBNONE 0x00
  281. #define TEST_SOFTINT 0x20
  282. #define TEST_CONTTX 0x10
  283. #define TEST_TXPE 0x08
  284. #define TEST_NAVDIS 0x04
  285. #define TEST_NOCTS 0x02
  286. #define TEST_NOACK 0x01
  287. /* Bits in the HOSTCR register */
  288. #define HOSTCR_TXONST 0x80
  289. #define HOSTCR_RXONST 0x40
  290. #define HOSTCR_ADHOC 0x20 /* Network Type 1 = Ad-hoc */
  291. #define HOSTCR_AP 0x10 /* Port Type 1 = AP */
  292. #define HOSTCR_TXON 0x08 /* 0000 1000 */
  293. #define HOSTCR_RXON 0x04 /* 0000 0100 */
  294. #define HOSTCR_MACEN 0x02 /* 0000 0010 */
  295. #define HOSTCR_SOFTRST 0x01 /* 0000 0001 */
  296. /* Bits in the MACCR register */
  297. #define MACCR_SYNCFLUSHOK 0x04
  298. #define MACCR_SYNCFLUSH 0x02
  299. #define MACCR_CLRNAV 0x01
  300. /* Bits in the MAC_REG_GPIOCTL0 register */
  301. #define LED_ACTSET 0x01
  302. #define LED_RFOFF 0x02
  303. #define LED_NOCONNECT 0x04
  304. /* Bits in the RCR register */
  305. #define RCR_SSID 0x80
  306. #define RCR_RXALLTYPE 0x40
  307. #define RCR_UNICAST 0x20
  308. #define RCR_BROADCAST 0x10
  309. #define RCR_MULTICAST 0x08
  310. #define RCR_WPAERR 0x04
  311. #define RCR_ERRCRC 0x02
  312. #define RCR_BSSID 0x01
  313. /* Bits in the TCR register */
  314. #define TCR_SYNCDCFOPT 0x02
  315. #define TCR_AUTOBCNTX 0x01 /* Beacon automatically transmit enable */
  316. /* Bits in the IMR register */
  317. #define IMR_MEASURESTART 0x80000000
  318. #define IMR_QUIETSTART 0x20000000
  319. #define IMR_RADARDETECT 0x10000000
  320. #define IMR_MEASUREEND 0x08000000
  321. #define IMR_SOFTTIMER1 0x00200000
  322. #define IMR_RXDMA1 0x00001000 /* 0000 0000 0001 0000 0000 0000 */
  323. #define IMR_RXNOBUF 0x00000800
  324. #define IMR_MIBNEARFULL 0x00000400
  325. #define IMR_SOFTINT 0x00000200
  326. #define IMR_FETALERR 0x00000100
  327. #define IMR_WATCHDOG 0x00000080
  328. #define IMR_SOFTTIMER 0x00000040
  329. #define IMR_GPIO 0x00000020
  330. #define IMR_TBTT 0x00000010
  331. #define IMR_RXDMA0 0x00000008
  332. #define IMR_BNTX 0x00000004
  333. #define IMR_AC0DMA 0x00000002
  334. #define IMR_TXDMA0 0x00000001
  335. /* Bits in the ISR register */
  336. #define ISR_MEASURESTART 0x80000000
  337. #define ISR_QUIETSTART 0x20000000
  338. #define ISR_RADARDETECT 0x10000000
  339. #define ISR_MEASUREEND 0x08000000
  340. #define ISR_SOFTTIMER1 0x00200000
  341. #define ISR_RXDMA1 0x00001000 /* 0000 0000 0001 0000 0000 0000 */
  342. #define ISR_RXNOBUF 0x00000800 /* 0000 0000 0000 1000 0000 0000 */
  343. #define ISR_MIBNEARFULL 0x00000400 /* 0000 0000 0000 0100 0000 0000 */
  344. #define ISR_SOFTINT 0x00000200
  345. #define ISR_FETALERR 0x00000100
  346. #define ISR_WATCHDOG 0x00000080
  347. #define ISR_SOFTTIMER 0x00000040
  348. #define ISR_GPIO 0x00000020
  349. #define ISR_TBTT 0x00000010
  350. #define ISR_RXDMA0 0x00000008
  351. #define ISR_BNTX 0x00000004
  352. #define ISR_AC0DMA 0x00000002
  353. #define ISR_TXDMA0 0x00000001
  354. /* Bits in the PSCFG register */
  355. #define PSCFG_PHILIPMD 0x40
  356. #define PSCFG_WAKECALEN 0x20
  357. #define PSCFG_WAKETMREN 0x10
  358. #define PSCFG_BBPSPROG 0x08
  359. #define PSCFG_WAKESYN 0x04
  360. #define PSCFG_SLEEPSYN 0x02
  361. #define PSCFG_AUTOSLEEP 0x01
  362. /* Bits in the PSCTL register */
  363. #define PSCTL_WAKEDONE 0x20
  364. #define PSCTL_PS 0x10
  365. #define PSCTL_GO2DOZE 0x08
  366. #define PSCTL_LNBCN 0x04
  367. #define PSCTL_ALBCN 0x02
  368. #define PSCTL_PSEN 0x01
  369. /* Bits in the PSPWSIG register */
  370. #define PSSIG_WPE3 0x80
  371. #define PSSIG_WPE2 0x40
  372. #define PSSIG_WPE1 0x20
  373. #define PSSIG_WRADIOPE 0x10
  374. #define PSSIG_SPE3 0x08
  375. #define PSSIG_SPE2 0x04
  376. #define PSSIG_SPE1 0x02
  377. #define PSSIG_SRADIOPE 0x01
  378. /* Bits in the BBREGCTL register */
  379. #define BBREGCTL_DONE 0x04
  380. #define BBREGCTL_REGR 0x02
  381. #define BBREGCTL_REGW 0x01
  382. /* Bits in the IFREGCTL register */
  383. #define IFREGCTL_DONE 0x04
  384. #define IFREGCTL_IFRF 0x02
  385. #define IFREGCTL_REGW 0x01
  386. /* Bits in the SOFTPWRCTL register */
  387. #define SOFTPWRCTL_RFLEOPT 0x0800
  388. #define SOFTPWRCTL_TXPEINV 0x0200
  389. #define SOFTPWRCTL_SWPECTI 0x0100
  390. #define SOFTPWRCTL_SWPAPE 0x0020
  391. #define SOFTPWRCTL_SWCALEN 0x0010
  392. #define SOFTPWRCTL_SWRADIO_PE 0x0008
  393. #define SOFTPWRCTL_SWPE2 0x0004
  394. #define SOFTPWRCTL_SWPE1 0x0002
  395. #define SOFTPWRCTL_SWPE3 0x0001
  396. /* Bits in the GPIOCTL1 register */
  397. #define GPIO1_DATA1 0x20
  398. #define GPIO1_MD1 0x10
  399. #define GPIO1_DATA0 0x02
  400. #define GPIO1_MD0 0x01
  401. /* Bits in the DMACTL register */
  402. #define DMACTL_CLRRUN 0x00080000
  403. #define DMACTL_RUN 0x00000008
  404. #define DMACTL_WAKE 0x00000004
  405. #define DMACTL_DEAD 0x00000002
  406. #define DMACTL_ACTIVE 0x00000001
  407. /* Bits in the RXDMACTL0 register */
  408. #define RX_PERPKT 0x00000100
  409. #define RX_PERPKTCLR 0x01000000
  410. /* Bits in the BCNDMACTL register */
  411. #define BEACON_READY 0x01
  412. /* Bits in the MISCFFCTL register */
  413. #define MISCFFCTL_WRITE 0x0001
  414. /* Bits in WAKEUPEN0 */
  415. #define WAKEUPEN0_DIRPKT 0x10
  416. #define WAKEUPEN0_LINKOFF 0x08
  417. #define WAKEUPEN0_ATIMEN 0x04
  418. #define WAKEUPEN0_TIMEN 0x02
  419. #define WAKEUPEN0_MAGICEN 0x01
  420. /* Bits in WAKEUPEN1 */
  421. #define WAKEUPEN1_128_3 0x08
  422. #define WAKEUPEN1_128_2 0x04
  423. #define WAKEUPEN1_128_1 0x02
  424. #define WAKEUPEN1_128_0 0x01
  425. /* Bits in WAKEUPSR0 */
  426. #define WAKEUPSR0_DIRPKT 0x10
  427. #define WAKEUPSR0_LINKOFF 0x08
  428. #define WAKEUPSR0_ATIMEN 0x04
  429. #define WAKEUPSR0_TIMEN 0x02
  430. #define WAKEUPSR0_MAGICEN 0x01
  431. /* Bits in WAKEUPSR1 */
  432. #define WAKEUPSR1_128_3 0x08
  433. #define WAKEUPSR1_128_2 0x04
  434. #define WAKEUPSR1_128_1 0x02
  435. #define WAKEUPSR1_128_0 0x01
  436. /* Bits in the MAC_REG_GPIOCTL register */
  437. #define GPIO0_MD 0x01
  438. #define GPIO0_DATA 0x02
  439. #define GPIO0_INTMD 0x04
  440. #define GPIO1_MD 0x10
  441. #define GPIO1_DATA 0x20
  442. /* Bits in the MSRCTL register */
  443. #define MSRCTL_FINISH 0x80
  444. #define MSRCTL_READY 0x40
  445. #define MSRCTL_RADARDETECT 0x20
  446. #define MSRCTL_EN 0x10
  447. #define MSRCTL_QUIETTXCHK 0x08
  448. #define MSRCTL_QUIETRPT 0x04
  449. #define MSRCTL_QUIETINT 0x02
  450. #define MSRCTL_QUIETEN 0x01
  451. /* Bits in the MSRCTL1 register */
  452. #define MSRCTL1_TXPWR 0x08
  453. #define MSRCTL1_CSAPAREN 0x04
  454. #define MSRCTL1_TXPAUSE 0x01
  455. /* Loopback mode */
  456. #define MAC_LB_EXT 0x02
  457. #define MAC_LB_INTERNAL 0x01
  458. #define MAC_LB_NONE 0x00
  459. #define Default_BI 0x200
  460. /* MiscFIFO Offset */
  461. #define MISCFIFO_KEYETRY0 32
  462. #define MISCFIFO_KEYENTRYSIZE 22
  463. #define MISCFIFO_SYNINFO_IDX 10
  464. #define MISCFIFO_SYNDATA_IDX 11
  465. #define MISCFIFO_SYNDATASIZE 21
  466. /* enabled mask value of irq */
  467. #define IMR_MASK_VALUE (IMR_SOFTTIMER1 | \
  468. IMR_RXDMA1 | \
  469. IMR_RXNOBUF | \
  470. IMR_MIBNEARFULL | \
  471. IMR_SOFTINT | \
  472. IMR_FETALERR | \
  473. IMR_WATCHDOG | \
  474. IMR_SOFTTIMER | \
  475. IMR_GPIO | \
  476. IMR_TBTT | \
  477. IMR_RXDMA0 | \
  478. IMR_BNTX | \
  479. IMR_AC0DMA | \
  480. IMR_TXDMA0)
  481. /* max time out delay time */
  482. #define W_MAX_TIMEOUT 0xFFF0U
  483. /* wait time within loop */
  484. #define CB_DELAY_LOOP_WAIT 10 /* 10ms */
  485. /* revision id */
  486. #define REV_ID_VT3253_A0 0x00
  487. #define REV_ID_VT3253_A1 0x01
  488. #define REV_ID_VT3253_B0 0x08
  489. #define REV_ID_VT3253_B1 0x09
  490. /*--------------------- Export Types ------------------------------*/
  491. /*--------------------- Export Macros ------------------------------*/
  492. #define MACvRegBitsOn(dwIoBase, byRegOfs, byBits) \
  493. do { \
  494. unsigned char byData; \
  495. VNSvInPortB(dwIoBase + byRegOfs, &byData); \
  496. VNSvOutPortB(dwIoBase + byRegOfs, byData | (byBits)); \
  497. } while (0)
  498. #define MACvWordRegBitsOn(dwIoBase, byRegOfs, wBits) \
  499. do { \
  500. unsigned short wData; \
  501. VNSvInPortW(dwIoBase + byRegOfs, &wData); \
  502. VNSvOutPortW(dwIoBase + byRegOfs, wData | (wBits)); \
  503. } while (0)
  504. #define MACvDWordRegBitsOn(dwIoBase, byRegOfs, dwBits) \
  505. do { \
  506. unsigned long dwData; \
  507. VNSvInPortD(dwIoBase + byRegOfs, &dwData); \
  508. VNSvOutPortD(dwIoBase + byRegOfs, dwData | (dwBits)); \
  509. } while (0)
  510. #define MACvRegBitsOnEx(dwIoBase, byRegOfs, byMask, byBits) \
  511. do { \
  512. unsigned char byData; \
  513. VNSvInPortB(dwIoBase + byRegOfs, &byData); \
  514. byData &= byMask; \
  515. VNSvOutPortB(dwIoBase + byRegOfs, byData | (byBits)); \
  516. } while (0)
  517. #define MACvRegBitsOff(dwIoBase, byRegOfs, byBits) \
  518. do { \
  519. unsigned char byData; \
  520. VNSvInPortB(dwIoBase + byRegOfs, &byData); \
  521. VNSvOutPortB(dwIoBase + byRegOfs, byData & ~(byBits)); \
  522. } while (0)
  523. #define MACvWordRegBitsOff(dwIoBase, byRegOfs, wBits) \
  524. do { \
  525. unsigned short wData; \
  526. VNSvInPortW(dwIoBase + byRegOfs, &wData); \
  527. VNSvOutPortW(dwIoBase + byRegOfs, wData & ~(wBits)); \
  528. } while (0)
  529. #define MACvDWordRegBitsOff(dwIoBase, byRegOfs, dwBits) \
  530. do { \
  531. unsigned long dwData; \
  532. VNSvInPortD(dwIoBase + byRegOfs, &dwData); \
  533. VNSvOutPortD(dwIoBase + byRegOfs, dwData & ~(dwBits)); \
  534. } while (0)
  535. #define MACvGetCurrRx0DescAddr(dwIoBase, pdwCurrDescAddr) \
  536. VNSvInPortD(dwIoBase + MAC_REG_RXDMAPTR0, \
  537. (unsigned long *)pdwCurrDescAddr)
  538. #define MACvGetCurrRx1DescAddr(dwIoBase, pdwCurrDescAddr) \
  539. VNSvInPortD(dwIoBase + MAC_REG_RXDMAPTR1, \
  540. (unsigned long *)pdwCurrDescAddr)
  541. #define MACvGetCurrTx0DescAddr(dwIoBase, pdwCurrDescAddr) \
  542. VNSvInPortD(dwIoBase + MAC_REG_TXDMAPTR0, \
  543. (unsigned long *)pdwCurrDescAddr)
  544. #define MACvGetCurrAC0DescAddr(dwIoBase, pdwCurrDescAddr) \
  545. VNSvInPortD(dwIoBase + MAC_REG_AC0DMAPTR, \
  546. (unsigned long *)pdwCurrDescAddr)
  547. #define MACvGetCurrSyncDescAddr(dwIoBase, pdwCurrDescAddr) \
  548. VNSvInPortD(dwIoBase + MAC_REG_SYNCDMAPTR, \
  549. (unsigned long *)pdwCurrDescAddr)
  550. #define MACvGetCurrATIMDescAddr(dwIoBase, pdwCurrDescAddr) \
  551. VNSvInPortD(dwIoBase + MAC_REG_ATIMDMAPTR, \
  552. (unsigned long *)pdwCurrDescAddr)
  553. /* set the chip with current BCN tx descriptor address */
  554. #define MACvSetCurrBCNTxDescAddr(dwIoBase, dwCurrDescAddr) \
  555. VNSvOutPortD(dwIoBase + MAC_REG_BCNDMAPTR, \
  556. dwCurrDescAddr)
  557. /* set the chip with current BCN length */
  558. #define MACvSetCurrBCNLength(dwIoBase, wCurrBCNLength) \
  559. VNSvOutPortW(dwIoBase + MAC_REG_BCNDMACTL+2, \
  560. wCurrBCNLength)
  561. #define MACvReadBSSIDAddress(dwIoBase, pbyEtherAddr) \
  562. do { \
  563. VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 1); \
  564. VNSvInPortB(dwIoBase + MAC_REG_BSSID0, \
  565. (unsigned char *)pbyEtherAddr); \
  566. VNSvInPortB(dwIoBase + MAC_REG_BSSID0 + 1, \
  567. pbyEtherAddr + 1); \
  568. VNSvInPortB(dwIoBase + MAC_REG_BSSID0 + 2, \
  569. pbyEtherAddr + 2); \
  570. VNSvInPortB(dwIoBase + MAC_REG_BSSID0 + 3, \
  571. pbyEtherAddr + 3); \
  572. VNSvInPortB(dwIoBase + MAC_REG_BSSID0 + 4, \
  573. pbyEtherAddr + 4); \
  574. VNSvInPortB(dwIoBase + MAC_REG_BSSID0 + 5, \
  575. pbyEtherAddr + 5); \
  576. VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 0); \
  577. } while (0)
  578. #define MACvWriteBSSIDAddress(dwIoBase, pbyEtherAddr) \
  579. do { \
  580. VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 1); \
  581. VNSvOutPortB(dwIoBase + MAC_REG_BSSID0, \
  582. *(pbyEtherAddr)); \
  583. VNSvOutPortB(dwIoBase + MAC_REG_BSSID0 + 1, \
  584. *(pbyEtherAddr + 1)); \
  585. VNSvOutPortB(dwIoBase + MAC_REG_BSSID0 + 2, \
  586. *(pbyEtherAddr + 2)); \
  587. VNSvOutPortB(dwIoBase + MAC_REG_BSSID0 + 3, \
  588. *(pbyEtherAddr + 3)); \
  589. VNSvOutPortB(dwIoBase + MAC_REG_BSSID0 + 4, \
  590. *(pbyEtherAddr + 4)); \
  591. VNSvOutPortB(dwIoBase + MAC_REG_BSSID0 + 5, \
  592. *(pbyEtherAddr + 5)); \
  593. VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 0); \
  594. } while (0)
  595. #define MACvReadEtherAddress(dwIoBase, pbyEtherAddr) \
  596. do { \
  597. VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 1); \
  598. VNSvInPortB(dwIoBase + MAC_REG_PAR0, \
  599. (unsigned char *)pbyEtherAddr); \
  600. VNSvInPortB(dwIoBase + MAC_REG_PAR0 + 1, \
  601. pbyEtherAddr + 1); \
  602. VNSvInPortB(dwIoBase + MAC_REG_PAR0 + 2, \
  603. pbyEtherAddr + 2); \
  604. VNSvInPortB(dwIoBase + MAC_REG_PAR0 + 3, \
  605. pbyEtherAddr + 3); \
  606. VNSvInPortB(dwIoBase + MAC_REG_PAR0 + 4, \
  607. pbyEtherAddr + 4); \
  608. VNSvInPortB(dwIoBase + MAC_REG_PAR0 + 5, \
  609. pbyEtherAddr + 5); \
  610. VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 0); \
  611. } while (0)
  612. #define MACvWriteEtherAddress(dwIoBase, pbyEtherAddr) \
  613. do { \
  614. VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 1); \
  615. VNSvOutPortB(dwIoBase + MAC_REG_PAR0, \
  616. *pbyEtherAddr); \
  617. VNSvOutPortB(dwIoBase + MAC_REG_PAR0 + 1, \
  618. *(pbyEtherAddr + 1)); \
  619. VNSvOutPortB(dwIoBase + MAC_REG_PAR0 + 2, \
  620. *(pbyEtherAddr + 2)); \
  621. VNSvOutPortB(dwIoBase + MAC_REG_PAR0 + 3, \
  622. *(pbyEtherAddr + 3)); \
  623. VNSvOutPortB(dwIoBase + MAC_REG_PAR0 + 4, \
  624. *(pbyEtherAddr + 4)); \
  625. VNSvOutPortB(dwIoBase + MAC_REG_PAR0 + 5, \
  626. *(pbyEtherAddr + 5)); \
  627. VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 0); \
  628. } while (0)
  629. #define MACvClearISR(dwIoBase) \
  630. VNSvOutPortD(dwIoBase + MAC_REG_ISR, IMR_MASK_VALUE)
  631. #define MACvStart(dwIoBase) \
  632. VNSvOutPortB(dwIoBase + MAC_REG_HOSTCR, \
  633. (HOSTCR_MACEN | HOSTCR_RXON | HOSTCR_TXON))
  634. #define MACvRx0PerPktMode(dwIoBase) \
  635. VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL0, RX_PERPKT)
  636. #define MACvRx0BufferFillMode(dwIoBase) \
  637. VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL0, RX_PERPKTCLR)
  638. #define MACvRx1PerPktMode(dwIoBase) \
  639. VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL1, RX_PERPKT)
  640. #define MACvRx1BufferFillMode(dwIoBase) \
  641. VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL1, RX_PERPKTCLR)
  642. #define MACvRxOn(dwIoBase) \
  643. MACvRegBitsOn(dwIoBase, MAC_REG_HOSTCR, HOSTCR_RXON)
  644. #define MACvReceive0(dwIoBase) \
  645. do { \
  646. unsigned long dwData; \
  647. VNSvInPortD(dwIoBase + MAC_REG_RXDMACTL0, &dwData); \
  648. if (dwData & DMACTL_RUN) \
  649. VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL0, DMACTL_WAKE); \
  650. else \
  651. VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL0, DMACTL_RUN); \
  652. } while (0)
  653. #define MACvReceive1(dwIoBase) \
  654. do { \
  655. unsigned long dwData; \
  656. VNSvInPortD(dwIoBase + MAC_REG_RXDMACTL1, &dwData); \
  657. if (dwData & DMACTL_RUN) \
  658. VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL1, DMACTL_WAKE); \
  659. else \
  660. VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL1, DMACTL_RUN); \
  661. } while (0)
  662. #define MACvTxOn(dwIoBase) \
  663. MACvRegBitsOn(dwIoBase, MAC_REG_HOSTCR, HOSTCR_TXON)
  664. #define MACvTransmit0(dwIoBase) \
  665. do { \
  666. unsigned long dwData; \
  667. VNSvInPortD(dwIoBase + MAC_REG_TXDMACTL0, &dwData); \
  668. if (dwData & DMACTL_RUN) \
  669. VNSvOutPortD(dwIoBase + MAC_REG_TXDMACTL0, DMACTL_WAKE); \
  670. else \
  671. VNSvOutPortD(dwIoBase + MAC_REG_TXDMACTL0, DMACTL_RUN); \
  672. } while (0)
  673. #define MACvTransmitAC0(dwIoBase) \
  674. do { \
  675. unsigned long dwData; \
  676. VNSvInPortD(dwIoBase + MAC_REG_AC0DMACTL, &dwData); \
  677. if (dwData & DMACTL_RUN) \
  678. VNSvOutPortD(dwIoBase + MAC_REG_AC0DMACTL, DMACTL_WAKE); \
  679. else \
  680. VNSvOutPortD(dwIoBase + MAC_REG_AC0DMACTL, DMACTL_RUN); \
  681. } while (0)
  682. #define MACvTransmitSYNC(dwIoBase) \
  683. do { \
  684. unsigned long dwData; \
  685. VNSvInPortD(dwIoBase + MAC_REG_SYNCDMACTL, &dwData); \
  686. if (dwData & DMACTL_RUN) \
  687. VNSvOutPortD(dwIoBase + MAC_REG_SYNCDMACTL, DMACTL_WAKE); \
  688. else \
  689. VNSvOutPortD(dwIoBase + MAC_REG_SYNCDMACTL, DMACTL_RUN); \
  690. } while (0)
  691. #define MACvTransmitATIM(dwIoBase) \
  692. do { \
  693. unsigned long dwData; \
  694. VNSvInPortD(dwIoBase + MAC_REG_ATIMDMACTL, &dwData); \
  695. if (dwData & DMACTL_RUN) \
  696. VNSvOutPortD(dwIoBase + MAC_REG_ATIMDMACTL, DMACTL_WAKE); \
  697. else \
  698. VNSvOutPortD(dwIoBase + MAC_REG_ATIMDMACTL, DMACTL_RUN); \
  699. } while (0)
  700. #define MACvTransmitBCN(dwIoBase) \
  701. VNSvOutPortB(dwIoBase + MAC_REG_BCNDMACTL, BEACON_READY)
  702. #define MACvClearStckDS(dwIoBase) \
  703. do { \
  704. unsigned char byOrgValue; \
  705. VNSvInPortB(dwIoBase + MAC_REG_STICKHW, &byOrgValue); \
  706. byOrgValue = byOrgValue & 0xFC; \
  707. VNSvOutPortB(dwIoBase + MAC_REG_STICKHW, byOrgValue); \
  708. } while (0)
  709. #define MACvReadISR(dwIoBase, pdwValue) \
  710. VNSvInPortD(dwIoBase + MAC_REG_ISR, pdwValue)
  711. #define MACvWriteISR(dwIoBase, dwValue) \
  712. VNSvOutPortD(dwIoBase + MAC_REG_ISR, dwValue)
  713. #define MACvIntEnable(dwIoBase, dwMask) \
  714. VNSvOutPortD(dwIoBase + MAC_REG_IMR, dwMask)
  715. #define MACvIntDisable(dwIoBase) \
  716. VNSvOutPortD(dwIoBase + MAC_REG_IMR, 0)
  717. #define MACvSelectPage0(dwIoBase) \
  718. VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 0)
  719. #define MACvSelectPage1(dwIoBase) \
  720. VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 1)
  721. #define MACvReadMIBCounter(dwIoBase, pdwCounter) \
  722. VNSvInPortD(dwIoBase + MAC_REG_MIBCNTR, pdwCounter)
  723. #define MACvPwrEvntDisable(dwIoBase) \
  724. VNSvOutPortW(dwIoBase + MAC_REG_WAKEUPEN0, 0x0000)
  725. #define MACvEnableProtectMD(dwIoBase) \
  726. do { \
  727. unsigned long dwOrgValue; \
  728. VNSvInPortD(dwIoBase + MAC_REG_ENCFG, &dwOrgValue); \
  729. dwOrgValue = dwOrgValue | EnCFG_ProtectMd; \
  730. VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \
  731. } while (0)
  732. #define MACvDisableProtectMD(dwIoBase) \
  733. do { \
  734. unsigned long dwOrgValue; \
  735. VNSvInPortD(dwIoBase + MAC_REG_ENCFG, &dwOrgValue); \
  736. dwOrgValue = dwOrgValue & ~EnCFG_ProtectMd; \
  737. VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \
  738. } while (0)
  739. #define MACvEnableBarkerPreambleMd(dwIoBase) \
  740. do { \
  741. unsigned long dwOrgValue; \
  742. VNSvInPortD(dwIoBase + MAC_REG_ENCFG, &dwOrgValue); \
  743. dwOrgValue = dwOrgValue | EnCFG_BarkerPream; \
  744. VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \
  745. } while (0)
  746. #define MACvDisableBarkerPreambleMd(dwIoBase) \
  747. do { \
  748. unsigned long dwOrgValue; \
  749. VNSvInPortD(dwIoBase + MAC_REG_ENCFG, &dwOrgValue); \
  750. dwOrgValue = dwOrgValue & ~EnCFG_BarkerPream; \
  751. VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \
  752. } while (0)
  753. #define MACvSetBBType(dwIoBase, byTyp) \
  754. do { \
  755. unsigned long dwOrgValue; \
  756. VNSvInPortD(dwIoBase + MAC_REG_ENCFG, &dwOrgValue); \
  757. dwOrgValue = dwOrgValue & ~EnCFG_BBType_MASK; \
  758. dwOrgValue = dwOrgValue | (unsigned long)byTyp; \
  759. VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \
  760. } while (0)
  761. #define MACvReadATIMW(dwIoBase, pwCounter) \
  762. VNSvInPortW(dwIoBase + MAC_REG_AIDATIM, pwCounter)
  763. #define MACvWriteATIMW(dwIoBase, wCounter) \
  764. VNSvOutPortW(dwIoBase + MAC_REG_AIDATIM, wCounter)
  765. #define MACvWriteCRC16_128(dwIoBase, byRegOfs, wCRC) \
  766. do { \
  767. VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 1); \
  768. VNSvOutPortW(dwIoBase + byRegOfs, wCRC); \
  769. VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 0); \
  770. } while (0)
  771. #define MACvGPIOIn(dwIoBase, pbyValue) \
  772. VNSvInPortB(dwIoBase + MAC_REG_GPIOCTL1, pbyValue)
  773. #define MACvSetRFLE_LatchBase(dwIoBase) \
  774. MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_RFLEOPT)
  775. bool MACbIsRegBitsOn(void __iomem *dwIoBase, unsigned char byRegOfs,
  776. unsigned char byTestBits);
  777. bool MACbIsRegBitsOff(void __iomem *dwIoBase, unsigned char byRegOfs,
  778. unsigned char byTestBits);
  779. bool MACbIsIntDisable(void __iomem *dwIoBase);
  780. void MACvSetShortRetryLimit(void __iomem *dwIoBase, unsigned char byRetryLimit);
  781. void MACvSetLongRetryLimit(void __iomem *dwIoBase, unsigned char byRetryLimit);
  782. void MACvGetLongRetryLimit(void __iomem *dwIoBase,
  783. unsigned char *pbyRetryLimit);
  784. void MACvSetLoopbackMode(void __iomem *dwIoBase, unsigned char byLoopbackMode);
  785. void MACvSaveContext(void __iomem *dwIoBase, unsigned char *pbyCxtBuf);
  786. void MACvRestoreContext(void __iomem *dwIoBase, unsigned char *pbyCxtBuf);
  787. bool MACbSoftwareReset(void __iomem *dwIoBase);
  788. bool MACbSafeSoftwareReset(void __iomem *dwIoBase);
  789. bool MACbSafeRxOff(void __iomem *dwIoBase);
  790. bool MACbSafeTxOff(void __iomem *dwIoBase);
  791. bool MACbSafeStop(void __iomem *dwIoBase);
  792. bool MACbShutdown(void __iomem *dwIoBase);
  793. void MACvInitialize(void __iomem *dwIoBase);
  794. void MACvSetCurrRx0DescAddr(void __iomem *dwIoBase,
  795. unsigned long dwCurrDescAddr);
  796. void MACvSetCurrRx1DescAddr(void __iomem *dwIoBase,
  797. unsigned long dwCurrDescAddr);
  798. void MACvSetCurrTXDescAddr(int iTxType, void __iomem *dwIoBase,
  799. unsigned long dwCurrDescAddr);
  800. void MACvSetCurrTx0DescAddrEx(void __iomem *dwIoBase,
  801. unsigned long dwCurrDescAddr);
  802. void MACvSetCurrAC0DescAddrEx(void __iomem *dwIoBase,
  803. unsigned long dwCurrDescAddr);
  804. void MACvSetCurrSyncDescAddrEx(void __iomem *dwIoBase,
  805. unsigned long dwCurrDescAddr);
  806. void MACvSetCurrATIMDescAddrEx(void __iomem *dwIoBase,
  807. unsigned long dwCurrDescAddr);
  808. void MACvTimer0MicroSDelay(void __iomem *dwIoBase, unsigned int uDelay);
  809. void MACvOneShotTimer1MicroSec(void __iomem *dwIoBase, unsigned int uDelayTime);
  810. void MACvSetMISCFifo(void __iomem *dwIoBase, unsigned short wOffset,
  811. unsigned long dwData);
  812. bool MACbPSWakeup(void __iomem *dwIoBase);
  813. void MACvSetKeyEntry(void __iomem *dwIoBase, unsigned short wKeyCtl,
  814. unsigned int uEntryIdx, unsigned int uKeyIdx,
  815. unsigned char *pbyAddr, u32 *pdwKey,
  816. unsigned char byLocalID);
  817. void MACvDisableKeyEntry(void __iomem *dwIoBase, unsigned int uEntryIdx);
  818. #endif /* __MAC_H__ */