91 #define HCF_MAGIC 0x7D37 // "}7" Handle validation
93 #define PLUG_DATA_OFFSET 0x00000800 //needed by some test tool on top of H-II NDIS driver
95 #define INI_TICK_INI 0x00040000L
97 #define IO_IN 0 //hcfio_in_string
98 #define IO_OUT 1 //hcfio_out_string
101 #define DO_ASSERT ( assert_ifbp->IFB_Magic != HCF_MAGIC && assert_ifbp->IFB_Magic == HCF_MAGIC )
102 #define NT_ASSERT 0x0000 //, NEVER_TESTED
103 #define NEVER_TESTED MERGE_2( 0xEFFE, 0xFEEF )
104 #define SE_ASSERT 0x5EFF
106 #define DHF_FILE_NAME_OFFSET 10000 //to distinguish DHF from HCF asserts by means of line number
107 #define MMD_FILE_NAME_OFFSET 20000 //to distinguish MMD from HCF asserts by means of line number
115 #define HCF_TRACE_ACTION 0x0000 // 0x0001
116 #define HCF_TRACE_CNTL 0x0001 // 0x0002
117 #define HCF_TRACE_DMA_RX_GET 0x0002 // 0x0004
118 #define HCF_TRACE_DMA_RX_PUT 0x0003 // 0x0008
119 #define HCF_TRACE_DMA_TX_GET 0x0004 // 0x0010
120 #define HCF_TRACE_DMA_TX_PUT 0x0005 // 0x0020
121 #define HCF_TRACE_GET_INFO 0x0006 // 0x0040
122 #define HCF_TRACE_PUT_INFO 0x0007 // 0x0080
123 #define HCF_TRACE_RCV_MSG 0x0008 // 0x0100
124 #define HCF_TRACE_SEND_MSG 0x0009 // 0x0200
125 #define HCF_TRACE_SERVICE_NIC 0x000A // 0x0400
131 #define HCF_TRACE_ACTION_KLUDGE 0x0010
135 #define HCF_TRACE_STRIO 0x0020
136 #define HCF_TRACE_ALLOC 0X0021
137 #define HCF_TRACE_DL 0X0023
138 #define HCF_TRACE_ISR_INFO 0X0024
139 #define HCF_TRACE_CALIBRATE 0x0026
141 #define HCF_TRACE_CMD_CPL 0x0040
142 #define HCF_TRACE_CMD_EXE 0x0041
143 #define HCF_TRACE_GET_FID 0x0042
144 #define HCF_TRACE_GET_FRAG 0x0043
145 #define HCF_TRACE_INIT 0x0044
146 #define HCF_TRACE_PUT_FRAG 0x0045
147 #define HCF_TRACE_SETUP_BAP 0x0046
149 #define HCF_TRACE_EXIT 0x8000 // Keil C warns "long constant truncated to int"
152 #define BAP_1 HREG_DATA_1 //Used by HCF to access NIC RAM
158 #define HFS_STAT_MSG_TYPE 0xE000 //Hermes reported Message Type
159 #define HFS_STAT_MIC_KEY_ID 0x1800 //MIC key used (if any)
160 #define HFS_STAT_1042 0x2000 //RFC1042 Encoded
161 #define HFS_STAT_TUNNEL 0x4000 //Bridge-Tunnel Encoded
162 #define HFS_STAT_WMP_MSG 0x6000 //WaveLAN-II Management Protocol Frame
163 #if (HCF_TYPE) & HCF_TYPE_WPA
164 #define HFS_STAT_MIC 0x0010 //Frame contains MIC //;? re-instate when F/W ready
168 #define HREG_IO_RANGE 0x80 //I/O Range used by Hermes
172 #define HREG_CMD 0x00 //
173 #define HCMD_CMD_CODE 0x3F
174 #define HREG_PARAM_0 0x02 //
175 #define HREG_PARAM_1 0x04 //
176 #define HREG_PARAM_2 0x06 //
177 #define HREG_STAT 0x08 //
178 #define HREG_STAT_CMD_CODE 0x003F //
179 #define HREG_STAT_DIAG_ERR 0x0100
180 #define HREG_STAT_INQUIRE_ERR 0x0500
181 #define HREG_STAT_CMD_RESULT 0x7F00 //
182 #define HREG_RESP_0 0x0A //
183 #define HREG_RESP_1 0x0C //
184 #define HREG_RESP_2 0x0E //
188 #define HREG_INFO_FID 0x10 //
189 #define HREG_RX_FID 0x20 //
190 #define HREG_ALLOC_FID 0x22 //
191 #define HREG_TX_COMPL_FID 0x24 //
201 #define HREG_OFFSET_ERR 0x4000 //
204 #define HREG_SELECT_1 0x1A //
205 #define HREG_OFFSET_1 0x1E //
206 #define HREG_DATA_1 0x38 //
210 #define HREG_EV_STAT 0x30 //
211 #define HREG_INT_EN 0x32 //
212 #define HREG_EV_ACK 0x34 //
214 #define HREG_EV_TICK 0x8000 //Auxiliary Timer Tick
216 #define HREG_EV_INFO_DROP 0x2000 //WMAC did not have sufficient RAM to build Unsollicited Frame
217 #if (HCF_TYPE) & HCF_TYPE_HII5
218 #define HREG_EV_ACK_REG_READY 0x0000
220 #define HREG_EV_ACK_REG_READY 0x1000 //Workaround Kludge bit for H-II (not H-II.5)
221 #endif // HCF_TYPE_HII5
222 #if (HCF_SLEEP) & ( HCF_CDS | HCF_DDS )
223 #define HREG_EV_SLEEP_REQ 0x0800
225 #define HREG_EV_SLEEP_REQ 0x0000
226 #endif // HCF_CDS / HCF_DDS
229 #define HREG_EV_RDMAD 0x0200 // rx frame in host memory
230 #define HREG_EV_TDMAD 0x0100 // tx frame in host memory processed
233 #define HREG_EV_FW_DMA 0x0460 // firmware / DMA engine I/F (bits are not for host usage)
235 #define HREG_EV_FW_DMA 0x0000
237 #define HREG_EV_INFO 0x0080 // Asynchronous Information Frame
238 #define HREG_EV_CMD 0x0010 // Command completed, Status and Response available
239 #define HREG_EV_ALLOC 0x0008 // Asynchronous part of Allocation/Reclaim completed
240 #define HREG_EV_TX_EXC 0x0004 // Asynchronous Transmission unsuccessful completed
241 #define HREG_EV_TX 0x0002 // Asynchronous Transmission successful completed
242 #define HREG_EV_RX 0x0001 // Asynchronous Receive Frame
244 #define HREG_EV_TX_EXT ( (HCF_EXT) & (HCF_EXT_INT_TX_EX | HCF_EXT_INT_TICK ) )
247 #if HCF_EXT_INT_TX_EX != HREG_EV_TX_EXC
249 #endif // HCF_EXT_INT_TX_EX / HREG_EV_TX_EXC
251 #if HCF_EXT_INT_TICK != HREG_EV_TICK
253 #endif // HCF_EXT_INT_TICK / HREG_EV_TICK
256 #define HREG_SW_0 0x28 //
257 #define HREG_SW_1 0x2A //
258 #define HREG_SW_2 0x2C //
263 #define HREG_IO_SRESET 0x0001
264 #define HREG_IO_WAKEUP_ASYNC 0x0002
265 #define HREG_IO_WOKEN_UP 0x0004
266 #define HREG_CNTL 0x14 //
268 #define HREG_CNTL_AUX_ENA_STAT 0xC000
269 #define HREG_CNTL_AUX_DIS_STAT 0x0000
270 #define HREG_CNTL_AUX_ENA_CNTL 0x8000
271 #define HREG_CNTL_AUX_DIS_CNTL 0x4000
272 #define HREG_CNTL_AUX_DSD 0x2000
273 #define HREG_CNTL_AUX_ENA (HREG_CNTL_AUX_ENA_CNTL | HREG_CNTL_AUX_DIS_CNTL )
274 #define HREG_SPARE 0x16 //
275 #define HREG_AUX_PAGE 0x3A //
276 #define HREG_AUX_OFFSET 0x3C //
277 #define HREG_AUX_DATA 0x3E //
284 #define HREG_DMA_CTRL 0x0040
285 #define HREG_TXDMA_PTR32 0x0044
286 #define HREG_TXDMA_PRIO_PTR32 0x0048
287 #define HREG_TXDMA_HIPRIO_PTR32 0x004C
288 #define HREG_RXDMA_PTR32 0x0050
289 #define HREG_CARDDETECT_1 0x007C // contains 7D37
290 #define HREG_CARDDETECT_2 0x007E // contains 7DE7
291 #define HREG_FREETIMER 0x0058
292 #define HREG_DMA_RX_CNT 0x0026
297 #define HREG_DMA_CTRL_RXHWEN 0x80000000 // high word enable bit
298 #define HREG_DMA_CTRL_RXRESET 0x40000000 // tx dma init bit
299 #define HREG_DMA_CTRL_RXBAP1 BIT29
300 #define HREG_DMA_CTRL_RX_STALLED BIT28
301 #define HREG_DMA_CTRL_RXAUTOACK_DMADONE BIT27 // no host involvement req. for TDMADONE event
302 #define HREG_DMA_CTRL_RXAUTOACK_INFO BIT26 // no host involvement req. for alloc event
303 #define HREG_DMA_CTRL_RXAUTOACK_DMAEN 0x02000000 // no host involvement req. for TxDMAen event
304 #define HREG_DMA_CTRL_RXAUTOACK_RX 0x01000000 // no host involvement req. for tx event
305 #define HREG_DMA_CTRL_RX_BUSY BIT23 // read only bit
308 #define HREG_DMA_CTRL_RX_MODE_SINGLE_PACKET 0x00010000 // mode 1
309 #define HREG_DMA_CTRL_RX_MODE_MULTI_PACKET 0x00020000 // mode 2
311 #define HREG_DMA_CTRL_TXHWEN 0x8000 // low word enable bit
312 #define HREG_DMA_CTRL_TXRESET 0x4000 // rx dma init bit
313 #define HREG_DMA_CTRL_TXBAP1 BIT13
314 #define HREG_DMA_CTRL_TXAUTOACK_DMADONE BIT11 // no host involvement req. for RxDMADONE event
315 #define HREG_DMA_CTRL_TXAUTOACK_DMAEN 0x00000400 // no host involvement req. for RxDMAen event
316 #define HREG_DMA_CTRL_TXAUTOACK_DMAALLOC 0x00000200 // no host involvement req. for info event
317 #define HREG_DMA_CTRL_TXAUTOACK_TX 0x00000100 // no host involvement req. for rx event
318 #define HREG_DMA_CTRL_TX_BUSY BIT7 // read only bit
321 #define HREG_DMA_CTRL_TX_MODE_SINGLE_PACKET BIT0 // mode 1
322 #define HREG_DMA_CTRL_TX_MODE_MULTI_PACKET 0x00000002 // mode 2
326 #define DMA_CTRLSTAT_GO (HREG_DMA_CTRL_RXHWEN | HREG_DMA_CTRL_RX_MODE_MULTI_PACKET | \
327 HREG_DMA_CTRL_RXAUTOACK_DMAEN | HREG_DMA_CTRL_RXAUTOACK_RX | \
328 HREG_DMA_CTRL_TXHWEN | \
329 HREG_DMA_CTRL_TX_MODE_MULTI_PACKET | HREG_DMA_CTRL_TXAUTOACK_DMAEN | \
330 HREG_DMA_CTRL_TXAUTOACK_DMAALLOC)
333 #define DMA_CTRLSTAT_RESET (HREG_DMA_CTRL_RXHWEN | HREG_DMA_CTRL_RXRESET | HREG_DMA_CTRL_TXHWEN | HREG_DMA_CTRL_TXRESET)
336 #define DESC_DMA_OWNED 0x8000 // BIT31
337 #define DESC_SOP 0x8000 // BIT15
338 #define DESC_EOP 0x4000 // BIT14
356 #define HCMD_BUSY 0x8000 // Busy bit, applicable for all commands
357 #define HCMD_INI 0x0000 //
358 #define HCMD_ENABLE HCF_CNTL_ENABLE // 0x0001
359 #define HCMD_DISABLE HCF_CNTL_DISABLE // 0x0002
360 #define HCMD_CONNECT HCF_CNTL_CONNECT // 0x0003
361 #define HCMD_EXECUTE 0x0004 //
362 #define HCMD_DISCONNECT HCF_CNTL_DISCONNECT // 0x0005
363 #define HCMD_SLEEP 0x0006 //
364 #define HCMD_CONTINUE HCF_CNTL_CONTINUE // 0x0007
365 #define HCMD_RETRY 0x0100 // Retry bit
366 #define HCMD_ALLOC 0x000A //
367 #define HCMD_TX 0x000B //
368 #define HCMD_RECL 0x0100 // Reclaim bit, applicable for Tx and Inquire
369 #define HCMD_INQUIRE 0x0011 //
370 #define HCMD_ACCESS 0x0021 //
371 #define HCMD_ACCESS_WRITE 0x0100 // Write bit
372 #define HCMD_PROGRAM 0x0022 //
373 #define HCMD_READ_MIF 0x0030
374 #define HCMD_WRITE_MIF 0x0031
375 #define HCMD_THESEUS 0x0038
376 #define HCMD_STARTPREAMBLE 0x0E00 // Start continuous preamble Tx
377 #define HCMD_STOP 0x0F00 // Stop Theseus test mode
383 #define CFG_DRV_ACT_RANGES_PRI_3_BOTTOM 1 // Default Bottom Compatibility for Primary Firmware - driver I/F
384 #define CFG_DRV_ACT_RANGES_PRI_3_TOP 1 // Default Top Compatibility for Primary Firmware - driver I/F
386 #define CFG_DRV_ACT_RANGES_HSI_4_BOTTOM 1 // Default Bottom Compatibility for H/W - driver I/F
387 #define CFG_DRV_ACT_RANGES_HSI_4_TOP 1 // Default Top Compatibility for H/W - driver I/F
389 #define CFG_DRV_ACT_RANGES_HSI_5_BOTTOM 1 // Default Bottom Compatibility for H/W - driver I/F
390 #define CFG_DRV_ACT_RANGES_HSI_5_TOP 1 // Default Top Compatibility for H/W - driver I/F
392 #if (HCF_TYPE) & HCF_TYPE_WPA
393 #define CFG_DRV_ACT_RANGES_APF_1_BOTTOM 16 // Default Bottom Compatibility for AP Firmware - driver I/F
394 #define CFG_DRV_ACT_RANGES_APF_1_TOP 16 // Default Top Compatibility for AP Firmware - driver I/F
395 #else //;? is this REALLY O.K.
396 #define CFG_DRV_ACT_RANGES_APF_1_BOTTOM 1 // Default Bottom Compatibility for AP Firmware - driver I/F
397 #define CFG_DRV_ACT_RANGES_APF_1_TOP 1 // Default Top Compatibility for AP Firmware - driver I/F
398 #endif // HCF_TYPE_WPA
400 #define CFG_DRV_ACT_RANGES_APF_2_BOTTOM 2 // Default Bottom Compatibility for AP Firmware - driver I/F
401 #define CFG_DRV_ACT_RANGES_APF_2_TOP 2 // Default Top Compatibility for AP Firmware - driver I/F
403 #define CFG_DRV_ACT_RANGES_APF_3_BOTTOM 1 // Default Bottom Compatibility for AP Firmware - driver I/F
404 #define CFG_DRV_ACT_RANGES_APF_3_TOP 1 // Default Top Compatibility for AP Firmware - driver I/F
406 #define CFG_DRV_ACT_RANGES_APF_4_BOTTOM 1 // Default Bottom Compatibility for AP Firmware - driver I/F
407 #define CFG_DRV_ACT_RANGES_APF_4_TOP 1 // Default Top Compatibility for AP Firmware - driver I/F
409 #if (HCF_TYPE) & HCF_TYPE_HII5
410 #define CFG_DRV_ACT_RANGES_STA_2_BOTTOM 6 // Default Bottom Compatibility for Station Firmware - driver I/F
411 #define CFG_DRV_ACT_RANGES_STA_2_TOP 6 // Default Top Compatibility for Station Firmware - driver I/F
412 #else // (HCF_TYPE) & HCF_TYPE_HII5
413 #define CFG_DRV_ACT_RANGES_STA_2_BOTTOM 1 // Default Bottom Compatibility for Station Firmware - driver I/F
414 #define CFG_DRV_ACT_RANGES_STA_2_TOP 2 // Default Top Compatibility for Station Firmware - driver I/F
415 #endif // (HCF_TYPE) & HCF_TYPE_HII5
417 #define CFG_DRV_ACT_RANGES_STA_3_BOTTOM 1 // Default Bottom Compatibility for Station Firmware - driver I/F
418 #define CFG_DRV_ACT_RANGES_STA_3_TOP 1 // Default Top Compatibility for Station Firmware - driver I/F
420 #define CFG_DRV_ACT_RANGES_STA_4_BOTTOM 1 // Default Bottom Compatibility for Station Firmware - driver I/F
421 #define CFG_DRV_ACT_RANGES_STA_4_TOP 1 // Default Top Compatibility for Station Firmware - driver I/F
424 #if defined HCF_CFG_PRI_1_TOP || defined HCF_CFG_PRI_1_BOTTOM
425 err: PRI_1 not supported
for H-
I;
426 #endif // HCF_CFG_PRI_1_TOP / HCF_CFG_PRI_1_BOTTOM
428 #if defined HCF_CFG_PRI_2_TOP || defined HCF_CFG_PRI_2_BOTTOM
429 err: PRI_2 not supported
for H-
I;
430 #endif // HCF_CFG_PRI_2_TOP / HCF_CFG_PRI_2_BOTTOM
432 #ifdef HCF_CFG_PRI_3_TOP // Top Compatibility for Primary Firmware - driver I/F
433 #if HCF_CFG_PRI_3_TOP == 0 || \
434 CFG_DRV_ACT_RANGES_PRI_3_BOTTOM <= HCF_CFG_PRI_3_TOP && HCF_CFG_PRI_3_TOP <= CFG_DRV_ACT_RANGES_PRI_3_TOP
435 #undef CFG_DRV_ACT_RANGES_PRI_3_TOP
436 #define CFG_DRV_ACT_RANGES_PRI_3_TOP HCF_CFG_PRI_3_TOP
440 #endif // HCF_CFG_PRI_3_TOP
442 #ifdef HCF_CFG_PRI_3_BOTTOM // Bottom Compatibility for Primary Firmware - driver I/F
443 #if CFG_DRV_ACT_RANGES_PRI_3_BOTTOM <= HCF_CFG_PRI_3_BOTTOM && HCF_CFG_PRI_3_BOTTOM <= CFG_DRV_ACT_RANGES_PRI_3_TOP
444 #undef CFG_DRV_ACT_RANGES_PRI_3_BOTTOM
445 #define CFG_DRV_ACT_RANGES_PRI_3_BOTTOM HCF_CFG_PRI_3_BOTTOM
449 #endif // HCF_CFG_PRI_3_BOTTOM
453 #if defined HCF_CFG_HSI_0_TOP || defined HCF_CFG_HSI_0_BOTTOM
454 err: HSI_0 not supported
for H-
I;
455 #endif // HCF_CFG_HSI_0_TOP / HCF_CFG_HSI_0_BOTTOM
457 #if defined HCF_CFG_HSI_1_TOP || defined HCF_CFG_HSI_1_BOTTOM
458 err: HSI_1 not supported
for H-
I;
459 #endif // HCF_CFG_HSI_1_TOP / HCF_CFG_HSI_1_BOTTOM
461 #if defined HCF_CFG_HSI_2_TOP || defined HCF_CFG_HSI_2_BOTTOM
462 err: HSI_2 not supported
for H-
I;
463 #endif // HCF_CFG_HSI_2_TOP / HCF_CFG_HSI_2_BOTTOM
465 #if defined HCF_CFG_HSI_3_TOP || defined HCF_CFG_HSI_3_BOTTOM
466 err: HSI_3 not supported
for H-
I;
467 #endif // HCF_CFG_HSI_3_TOP / HCF_CFG_HSI_3_BOTTOM
469 #ifdef HCF_CFG_HSI_4_TOP // Top Compatibility for HSI I/F
470 #if HCF_CFG_HSI_4_TOP == 0 || \
471 CFG_DRV_ACT_RANGES_HSI_4_BOTTOM <= CF_CFG_HSI_4_TOP && HCF_CFG_HSI_4_TOP <= CFG_DRV_ACT_RANGES_HSI_4_TOP
472 #undef CFG_DRV_ACT_RANGES_HSI_4_TOP
473 #define CFG_DRV_ACT_RANGES_HSI_4_TOP HCF_CFG_HSI_4_TOP
477 #endif // HCF_CFG_HSI_4_TOP
479 #ifdef HCF_CFG_HSI_4_BOTTOM // Bottom Compatibility for HSI I/F
480 #if CFG_DRV_ACT_RANGES_HSI_4_BOTTOM <= HCF_CFG_HSI_4_BOTTOM && HCF_CFG_HSI_4_BOTTOM <= CFG_DRV_ACT_RANGES_HSI_4_TOP
481 #undef CFG_DRV_ACT_RANGES_HSI_4_BOTTOM
482 #define CFG_DRV_ACT_RANGES_HSI_4_BOTTOM HCF_CFG_HSI_4_BOTTOM
486 #endif // HCF_CFG_HSI_4_BOTTOM
488 #ifdef HCF_CFG_HSI_5_TOP // Top Compatibility for HSI I/F
489 #if HCF_CFG_HSI_5_TOP == 0 || \
490 CFG_DRV_ACT_RANGES_HSI_5_BOTTOM <= CF_CFG_HSI_5_TOP && HCF_CFG_HSI_5_TOP <= CFG_DRV_ACT_RANGES_HSI_5_TOP
491 #undef CFG_DRV_ACT_RANGES_HSI_5_TOP
492 #define CFG_DRV_ACT_RANGES_HSI_5_TOP HCF_CFG_HSI_5_TOP
496 #endif // HCF_CFG_HSI_5_TOP
498 #ifdef HCF_CFG_HSI_5_BOTTOM // Bottom Compatibility for HSI I/F
499 #if CFG_DRV_ACT_RANGES_HSI_5_BOTTOM <= HCF_CFG_HSI_5_BOTTOM && HCF_CFG_HSI_5_BOTTOM <= CFG_DRV_ACT_RANGES_HSI_5_TOP
500 #undef CFG_DRV_ACT_RANGES_HSI_5_BOTTOM
501 #define CFG_DRV_ACT_RANGES_HSI_5_BOTTOM HCF_CFG_HSI_5_BOTTOM
505 #endif // HCF_CFG_HSI_5_BOTTOM
507 #if defined HCF_CFG_APF_1_TOP || defined HCF_CFG_APF_1_BOTTOM
508 err: APF_1 not supported
for H-
I;
509 #endif // HCF_CFG_APF_1_TOP / HCF_CFG_APF_1_BOTTOM
511 #ifdef HCF_CFG_APF_2_TOP // Top Compatibility for AP Firmware - driver I/F
512 #if HCF_CFG_APF_2_TOP == 0 || \
513 CFG_DRV_ACT_RANGES_APF_2_BOTTOM <= HCF_CFG_APF_2_TOP && HCF_CFG_APF_2_TOP <= CFG_DRV_ACT_RANGES_APF_2_TOP
514 #undef CFG_DRV_ACT_RANGES_APF_2_TOP
515 #define CFG_DRV_ACT_RANGES_APF_2_TOP HCF_CFG_APF_2_TOP
519 #endif // HCF_CFG_APF_TOP
521 #ifdef HCF_CFG_APF_2_BOTTOM // Bottom Compatibility for AP Firmware - driver I/F
522 #if CFG_DRV_ACT_RANGES_APF_2_BOTTOM <= HCF_CFG_APF_2_BOTTOM && HCF_CFG_APF_2_BOTTOM <= CFG_DRV_ACT_RANGES_APF_2_TOP
523 #undef CFG_DRV_ACT_RANGES_APF_2_BOTTOM
524 #define CFG_DRV_ACT_RANGES_APF_2_BOTTOM HCF_CFG_APF_2_BOTTOM
528 #endif // HCF_CFG_APF_BOTTOM
531 #if defined HCF_CFG_STA_1_TOP || defined HCF_CFG_STA_1_BOTTOM
532 err: STA_1 not supported
for H-
I;
533 #endif // HCF_CFG_STA_1_TOP / HCF_CFG_STA_1_BOTTOM
535 #ifdef HCF_CFG_STA_2_TOP // Top Compatibility for Station Firmware - driver I/F
536 #if HCF_CFG_STA_2_TOP == 0 || \
537 CFG_DRV_ACT_RANGES_STA_2_BOTTOM <= HCF_CFG_STA_2_TOP && HCF_CFG_STA_2_TOP <= CFG_DRV_ACT_RANGES_STA_2_TOP
538 #undef CFG_DRV_ACT_RANGES_STA_2_TOP
539 #define CFG_DRV_ACT_RANGES_STA_2_TOP HCF_CFG_STA_2_TOP
543 #endif // HCF_CFG_STA_TOP
545 #ifdef HCF_CFG_STA_2_BOTTOM // Bottom Compatibility for Station Firmware - driver I/F
546 #if CFG_DRV_ACT_RANGES_STA_2_BOTTOM <= HCF_CFG_STA_2_BOTTOM && HCF_CFG_STA_2_BOTTOM <= CFG_DRV_ACT_RANGES_STA_2_TOP
547 #undef CFG_DRV_ACT_RANGES_STA_2_BOTTOM
548 #define CFG_DRV_ACT_RANGES_STA_2_BOTTOM HCF_CFG_STA_2_BOTTOM
552 #endif // HCF_CFG_STA_BOTTOM
560 #define MSF_WAIT(x) do { \
562 HCF_WAIT_WHILE((IPW(HREG_IO) & HREG_IO_WOKEN_UP) == 0); \
563 HCFASSERT( prot_cnt, IPW( HREG_IO ) ); \
566 #define MSF_WAIT(x) do { } while (0)
569 #define LOF(x) (sizeof(x)/sizeof(hcf_16)-1)
572 #define MERGE_2( hw, lw ) ( ( ((hcf_32)(hw)) << 16 ) | ((hcf_16)(lw)) )
574 #if ! defined HCF_STATIC
575 #define HCF_STATIC static
578 #if ( (HCF_TYPE) & HCF_TYPE_HII5 ) == 0
579 #define DAWA_ACK( mask) do { \
580 OPW( HREG_EV_ACK, mask | HREG_EV_ACK_REG_READY ); \
581 OPW( HREG_EV_ACK, (mask & ~HREG_EV_ALLOC) | HREG_EV_ACK_REG_READY ); \
583 #define DAWA_ZERO_FID(reg) OPW( reg, 0 )
585 #define DAWA_ACK( mask) OPW( HREG_EV_ACK, mask )
586 #define DAWA_ZERO_FID(reg) do { } while (0)
587 #endif // HCF_TYPE_HII5
589 #if (HCF_TYPE) & HCF_TYPE_WPA
590 #define CALC_RX_MIC( p, len ) calc_mic_rx_frag( ifbp, p, len )
591 #define CALC_TX_MIC( p, len ) calc_mic_tx_frag( ifbp, p, len )
593 #define CALC_RX_MIC( p, len )
594 #define CALC_TX_MIC( p, len )
595 #define MIC_RX_RTN( mic, dw )
596 #define MIC_TX_RTN( mic, dw )
597 #endif // HCF_TYPE_WPA
599 #if HCF_TALLIES & HCF_TALLIES_HCF //HCF tally support
600 #define IF_TALLY(x) do { x; } while (0)
602 #define IF_TALLY(x) do { } while (0)
603 #endif // HCF_TALLIES_HCF
607 #define IF_DMA(x) do { x; } while(0)
608 #define IF_NOT_DMA(x) do { } while(0)
609 #define IF_USE_DMA(x) if ( ifbp->IFB_CntlOpt & USE_DMA ) { x; }
610 #define IF_NOT_USE_DMA(x) if ( !(ifbp->IFB_CntlOpt & USE_DMA) ) { x; }
612 #define IF_DMA(x) do { } while(0)
613 #define IF_NOT_DMA(x) do { x; } while(0)
614 #define IF_USE_DMA(x) do { } while(0)
615 #define IF_NOT_USE_DMA(x) do { x; } while(0)
619 #define IPW(x) ((hcf_16)IN_PORT_WORD( ifbp->IFB_IOBase + (x) ) )
620 #define OPW(x, y) OUT_PORT_WORD( ifbp->IFB_IOBase + (x), y )
624 #if HCF_PROT_TIME == 0
625 #define PROT_CNT_INI do { } while(0)
626 #define IF_PROT_TIME(x) do { } while(0)
627 #if defined HCF_YIELD
628 #define HCF_WAIT_WHILE( x ) do { } while( (x) && (HCF_YIELD) )
630 #define HCF_WAIT_WHILE( x ) do { } while ( x )
633 #define PROT_CNT_INI hcf_32 prot_cnt = ifbp->IFB_TickIni
634 #define IF_PROT_TIME(x) do { x; } while(0)
635 #if defined HCF_YIELD
636 #define HCF_WAIT_WHILE( x ) while ( prot_cnt && (x) && (HCF_YIELD) ) prot_cnt--;
639 #define HCF_WAIT_WHILE( x ) while ( prot_cnt && (x) ) { udelay(2); prot_cnt--; }
641 #endif // HCF_PROT_TIME
643 #if defined HCF_EX_INT
645 ;?
out dated checking
652 #if 0 //get compiler going
653 #if HCF_EX_INT_TICK != HREG_EV_TICK
654 ;?
out dated checking
655 err: someone redefined these macros
while the implementation assumes they are
equal;
657 #if HCF_EX_INT_TX_OK != HFS_TX_CNTL_TX_OK || HFS_TX_CNTL_TX_OK != HREG_EV_TX_OK
658 ;?
out dated checking
659 err: someone redefined these macros
while the implementation assumes they are
equal;
661 #if HCF_EX_INT_TX_EX != HFS_TX_CNTL_TX_EX || HFS_TX_CNTL_TX_EX != HREG_EV_TX_EX
662 ;?
out dated checking
663 err: someone redefined these macros
while the implementation assumes they are
equal;
665 #endif // 0 get compiler going
677 #define HCFASSERT(x,q) do { if (!(x)) {mdd_assert(ifbp, __LINE__, q );} } while(0)
678 #define MMDASSERT(x,q) {if (!(x)) {mdd_assert( assert_ifbp, __LINE__ + FILE_NAME_OFFSET, q );}}
680 #define HCFLOGENTRY( where, what ) do { \
681 if ( (ifbp->IFB_AssertWhere = where) <= 15 ) { \
682 HCFASSERT( (ifbp->IFB_AssertTrace & 1<<((where)&0xF)) == 0, ifbp->IFB_AssertTrace ); \
683 ifbp->IFB_AssertTrace |= 1<<((where)&0xF); \
685 HCFTRACE(ifbp, where ); \
686 HCFTRACEVALUE(ifbp, what ); \
689 #define HCFLOGEXIT( where ) do { \
690 if ( (ifbp->IFB_AssertWhere = where) <= 15 ) { \
691 ifbp->IFB_AssertTrace &= ~(1<<((where)&0xF)); \
693 HCFTRACE(ifbp, (where)|HCF_TRACE_EXIT ); \
697 #define HCFASSERT( x, q ) do { } while(0)
698 #define MMDASSERT( x, q )
699 #define HCFLOGENTRY( where, what ) do { } while(0)
700 #define HCFLOGEXIT( where ) do { } while(0)
710 #define HCFASSERT_INT HCFASSERT( ifbp->IFB_IntOffCnt != 0xFFFF, ifbp->IFB_IntOffCnt )
713 #define HCFASSERT_INT
717 #if defined HCF_TRACE
718 #define HCFTRACE(ifbp, where ) do {OPW( HREG_SW_1, where );} while(0)
720 #define HCFTRACEVALUE(ifbp, what ) do {OPW( HREG_SW_2, what );} while (0)
723 #define HCFTRACE(ifbp, where ) do { } while(0)
724 #define HCFTRACEVALUE(ifbp, what ) do { } while(0)
732 #endif // HCF_BIG_ENDIAN
747 #if ! ( (HCF_IO) & HCF_IO_32BITS ) // defined 16 bits only
748 #undef OUT_PORT_STRING_32
749 #undef IN_PORT_STRING_32