1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
|
#ifndef __HALDEF_H__
#define __HALDEF_H__
/*++
Copyright (c) Realtek Semiconductor Corp. All rights reserved.
Module Name:
HalComDef.h
Abstract:
Defined HAL common data structure & Define
Major Change History:
When Who What
---------- --------------- -------------------------------
2012-03-23 Filen Create.
--*/
typedef enum _HW_VARIABLES{
HW_VAR_ETHER_ADDR,
HW_VAR_MULTICAST_REG,
HW_VAR_BSSID,
HW_VAR_MAC_IO_ENABLE, //Set Only
HW_VAR_MACREGFILE_START, //Get Only
HW_VAR_MACREGFILE_SIZE, //Get Only
HW_VAR_PHYREGFILE_START, //Get Only
HW_VAR_PHYREGFILE_SIZE, //Get Only
HW_VAR_PHYREGFILE_HP_START, //Get Only
HW_VAR_PHYREGFILE_HP_SIZE, //Get Only
HW_VAR_PHYREGFILE_1T_START, //Get Only
HW_VAR_PHYREGFILE_1T_SIZE, //Get Only
HW_VAR_PHYREGFILE_MP_START, //Get Only
HW_VAR_PHYREGFILE_MP_SIZE, //Get Only
HW_VAR_PHYREGFILE_PG_START, //Get Only
HW_VAR_PHYREGFILE_PG_SIZE, //Get Only
HW_VAR_PHYREGFILE_AGC_START, //Get Only
HW_VAR_PHYREGFILE_AGC_SIZE, //Get Only
HW_VAR_PHYREGFILE_AGC_HP_START, //Get Only
HW_VAR_PHYREGFILE_AGC_HP_SIZE, //Get Only
HW_VAR_RFREGFILE_RADIO_A_START, //Get Only
HW_VAR_RFREGFILE_RADIO_A_SIZE, //Get Only
HW_VAR_RFREGFILE_RADIO_A_HP_START, //Get Only
HW_VAR_RFREGFILE_RADIO_A_HP_SIZE, //Get Only
HW_VAR_RFREGFILE_RADIO_B_START, //Get Only
HW_VAR_RFREGFILE_RADIO_B_SIZE, //Get Only
HW_VAR_RFREGFILE_RADIO_B_HP_START, //Get Only
HW_VAR_RFREGFILE_RADIO_B_HP_SIZE, //Get Only
HW_VAR_FWFILE_START, //Get Only
HW_VAR_FWFILE_SIZE, //Get Only
HW_VAR_TXPKTFWFILE_START, //Get Only
HW_VAR_TXPKTFWFILE_SIZE, //Get Only
HW_VAR_POWERTRACKINGFILE_START, //Get Only
HW_VAR_POWERTRACKINGFILE_SIZE, //Get Only
HW_VAR_MEDIA_STATUS,
HW_VAR_MAC_LOOPBACK_ENABLE, //Set Only
HW_VAR_MAC_CONFIG, //Set Only
HW_VAR_EDCA, //Set Only
HW_VAR_CAM_RESET_ALL_ENTRY, //Set Only
HW_VAR_SECURITY_CONFIG,
HW_VAR_BEACON_INTERVAL,
HW_VAR_ENABLE_BEACON_DMA,
HW_VAR_TXPAUSE,
HW_VAR_HIQ_NO_LMT_EN,
HW_VAR_DRV_DBG,
HW_VAR_NUM_TOTAL_RF_PATH, //Get Only
HW_VAR_NUM_RXDMA_STATUS,
HW_VAR_NUM_TXDMA_STATUS,
HW_VAR_BEACON_ENABLE_DOWNLOAD,
HW_VAR_BEACON_DISABLE_DOWNLOAD
}HW_VARIABLES;
// The type used to query whether the interrupt in HAL is toggled.
typedef enum _HAL_INT_TYPE
{
HAL_INT_TYPE_ANY, // Any interrupt
HAL_INT_TYPE_TBDOK, // Tx Beacon OK
HAL_INT_TYPE_TBDER, // Tx Beacon error
HAL_INT_TYPE_BcnInt, // For 92C or later, it should be early beacon interrupt.
HAL_INT_TYPE_PSTIMEOUT, // PS timer interrupt by TSF
HAL_INT_TYPE_PSTIMEOUT1, // PS timer 1 interrupt by TSF
HAL_INT_TYPE_PSTIMEOUT2, // PS timer 2 interrupt by TSF
HAL_INT_TYPE_C2HCMD, // CPU to Host Command INT Status interrupt
HAL_INT_TYPE_RXFOVW, // Rx FIFO over flow
HAL_INT_TYPE_VIDOK, // VI queue DMA OK
HAL_INT_TYPE_VODOK, // VO queue DMA OK
HAL_INT_TYPE_BEDOK, // BE queue DMA OK
HAL_INT_TYPE_BKDOK, // BK queue DMA OK
HAL_INT_TYPE_MGNTDOK, // Mgnt queue DMA OK
HAL_INT_TYPE_HIGHDOK, // High queue DMA OK
HAL_INT_TYPE_BDOK, // Beacon queue DMA OK , Note: Filen, this interrupt has removed in 8812 & later chip
HAL_INT_TYPE_CPWM, // CPU power Mode exchange INT Status
HAL_INT_TYPE_TSF_BIT32_TOGGLE, // TSF Timer BIT32 toggle indication interrupt
HAL_INT_TYPE_RX_OK, // Receive DMA OK
HAL_INT_TYPE_RDU,
HAL_INT_TYPE_BcnInt_MBSSID, // For 92C or later, it should be early beacon interrupt.
HAL_INT_TYPE_BcnInt1,
HAL_INT_TYPE_BcnInt2,
HAL_INT_TYPE_BcnInt3,
HAL_INT_TYPE_BcnInt4,
HAL_INT_TYPE_BcnInt5,
HAL_INT_TYPE_BcnInt6,
HAL_INT_TYPE_BcnInt7,
HAL_INT_TYPE_CTWEND,
HAL_INT_TYPE_BCNDERR0,
HAL_INT_TYPE_TXFOVW, // Transmit packet buffer Overflow.
HAL_INT_TYPE_RXERR, // Rx Error Flag INT Status
HAL_INT_TYPE_TXERR, // Tx Error Flag INT Status
#if 0 //Filen: Not used to AP Platform
//==== SDIO Specified Interrupt=====//
HAL_INT_TYPE_SDIO_ISR_IND,
HAL_INT_TYPE_SDIO_GPIO12_0_INT,
HAL_INT_TYPE_SDIO_SPS_OCP_INT,
HAL_INT_TYPE_SDIO_RON_INT_EN,
HAL_INT_TYPE_SDIO_PDNINT,
HAL_INT_TYPE_SDIO_GPIO9_INT,
#endif
}HAL_INT_TYPE, *PHAL_INT_TYPE;
enum _XTAL_CLK_SEL_ {
XTAL_CLK_SEL_40M = 0,
XTAL_CLK_SEL_25M = 1
};
typedef struct _MACCONFIG_PARA_ {
u4Byte AckTO;
u4Byte vap_enable;
u4Byte OP_Mode;
u2Byte dot11DTIMPeriod;
// TODO:
} MACCONFIG_PARA, *PMACCONFIG_PARA;
typedef struct _EDCA_PARA_ {
u4Byte slot_time;
u4Byte sifs_time;
struct ParaRecord Para[AC_PARAM_SIZE];
}EDCA_PARA, *PEDCA_PARA;
typedef struct _CAM_ENTRY_CFG_ {
BOOLEAN bValid;
u1Byte KeyID;
DOT11_ENC_ALGO EncAlgo;
}CAM_ENTRY_CFG, *PCAM_ENTRY_CFG;
//-----------------------------------------------------------
//
// Queue mapping
//
//-----------------------------------------------------------
//1.) used to TXPOLL
#define TXPOLL_BK_QUEUE 0
#define TXPOLL_BE_QUEUE 1
#define TXPOLL_VI_QUEUE 2
#define TXPOLL_VO_QUEUE 3
#define TXPOLL_BEACON_QUEUE 4
//#define TXPOLL_TXCMD_QUEUE 5
#define TXPOLL_MGNT_QUEUE 6
#define TXPOLL_HIGH_QUEUE 7
#define TXPOLL_HCCA_QUEUE 8
//2.) used to TXPAUSE
#define TXPAUSE_BK_QUEUE_BIT BIT0
#define TXPAUSE_BE_QUEUE_BIT BIT1
#define TXPAUSE_VI_QUEUE_BIT BIT2
#define TXPAUSE_VO_QUEUE_BIT BIT3
#define TXPAUSE_MGNT_QUEUE_BIT BIT4
#define TXPAUSE_HIGH_QUEUE_BIT BIT5
#define TXPAUSE_BCN_QUEUE_BIT BIT6
#define TXPAUSE_BCN_HI_MGNT_QUEUE_BIT BIT7
#define TXPAUSE_ALL_QUEUE_BIT 0xFF
//3 Initialization Related
typedef RT_STATUS
(*NicInitPONHandler)(
INPUT HAL_PADAPTER Adapter,
INPUT u4Byte ClkSel
);
typedef RT_STATUS
(*NicInitMACHandler)(
INPUT HAL_PADAPTER Adapter
);
typedef VOID
(*NicInitIMRHandler)(
INPUT HAL_PADAPTER Adapter,
INPUT RT_OP_MODE OPMode
);
typedef RT_STATUS
(*NicInitFirmwareHandler)(
INPUT HAL_PADAPTER Adapter
);
typedef RT_STATUS
(*NicInitHCIDMAMemHandler)(
INPUT HAL_PADAPTER Adapter
);
typedef RT_STATUS
(*NicInitHCIDMARegHandler)(
INPUT HAL_PADAPTER Adapter
);
typedef VOID
(*NicInitMBSSIDHandler)(
INPUT HAL_PADAPTER Adapter
);
typedef VOID
(*NicStopMBSSIDHandler)(
INPUT HAL_PADAPTER Adapter
);
typedef VOID
(*NicInitVAPIMRHandler)(
IN HAL_PADAPTER Adapter,
IN u4Byte VapSeq
);
//3 Stop Related
typedef VOID
(*NicDisableVXDAPHandler)(
INPUT HAL_PADAPTER Adapter
);
//3 ISR Related
typedef VOID
(*NicEnableIMRHandler)(
INPUT HAL_PADAPTER Adapter
);
typedef BOOLEAN
(*NicInterruptRecognizedHandler)(
INPUT HAL_PADAPTER Adapter,
INPUT PVOID pContent,
INPUT u4Byte ContentLen
);
typedef BOOLEAN
(*NicGetInterruptHandler)(
IN HAL_PADAPTER Adapter,
IN HAL_INT_TYPE intType
);
typedef VOID
(*NicAddInterruptMaskHandler)(
IN HAL_PADAPTER Adapter,
IN HAL_INT_TYPE intType
);
typedef VOID
(*NicRemoveInterruptMaskHandler)(
IN HAL_PADAPTER Adapter,
IN HAL_INT_TYPE intType
);
typedef VOID
(*NicDisableRxRelatedInterruptHandler)(
IN HAL_PADAPTER Adapter
);
typedef VOID
(*NicEnableRxRelatedInterruptHandler)(
IN HAL_PADAPTER Adapter
);
//3 Tx Related
typedef RT_STATUS
(*NicPrepareTxBufferDescriptorHandler)(
INPUT HAL_PADAPTER Adapter
);
typedef VOID
(*NicTxPollingHandler)(
INPUT HAL_PADAPTER Adapter,
INPUT u1Byte QueueIndex
);
typedef VOID
(*NicFillBeaconDescHandler)
(
INPUT HAL_PADAPTER Adapter,
INPUT PVOID pdesc,
INPUT PVOID dat_content,
INPUT u2Byte txLength,
INPUT BOOLEAN bForceUpdate
);
typedef VOID
(*NicSigninBeaconTXBDHandler)(
INPUT HAL_PADAPTER Adapter,
INPUT pu4Byte beaconbuf,
INPUT u2Byte frlen
);
typedef VOID
(*NicSetBeaconDownloadHandler) (
INPUT HAL_PADAPTER Adapter,
INPUT u4Byte Value
);
typedef u2Byte
(*NicGetTxQueueHWIdxHandler)(
IN HAL_PADAPTER Adapter,
IN u4Byte q_num //enum _TX_QUEUE_
);
typedef u4Byte
(*NicMappingTxQueueHandler)(
IN HAL_PADAPTER Adapter,
IN u4Byte TxQNum //enum _TX_QUEUE_
);
typedef BOOLEAN
(*NicQueryTxConditionMatchHandler)(
IN HAL_PADAPTER Adapter
);
typedef BOOLEAN
(*NicFillTxHwCtrlHandler)(
IN HAL_PADAPTER Adapter,
IN u4Byte queueIndex, //HCI_TX_DMA_QUEUE_88XX
IN PVOID pDescData
);
typedef RT_STATUS
(*NicSyncSWTXBDHostIdxToHWHandler) (
IN HAL_PADAPTER Adapter,
IN u4Byte queueIndex //HCI_TX_DMA_QUEUE_88XX
);
typedef PVOID
(*NicGetShortCutTxDescriptorHandler) (
IN HAL_PADAPTER Adapter
);
typedef VOID
(*NicReleaseShortCutTxDescriptorHandler)(
IN HAL_PADAPTER Adapter,
IN PVOID pTxDesc
);
typedef VOID
(*NicSetShortCutTxBuffSizeHandler) (
IN HAL_PADAPTER Adapter,
IN PVOID pTxDesc,
IN u2Byte txPktSize
);
typedef u2Byte
(*NicGetShortCutTxBuffSizeHandler)(
IN HAL_PADAPTER Adapter,
IN PVOID pTxDesc
);
typedef PVOID
(*NicCopyShortCutTxDescriptorHandler)(
IN HAL_PADAPTER Adapter,
IN u4Byte queueIndex, //HCI_TX_DMA_QUEUE_88XX
IN PVOID pTxDesc,
IN u4Byte direction
);
typedef BOOLEAN
(*NicFillShortCutTxHwCtrlHandler)(
IN HAL_PADAPTER Adapter,
IN u4Byte queueIndex, //HCI_TX_DMA_QUEUE_88XX
IN PVOID pDescData,
IN PVOID pTxDesc,
IN u4Byte direction
);
//3 Rx Related
typedef RT_STATUS
(*NicPrepareRXBDHandler)(
INPUT HAL_PADAPTER Adapter,
INPUT u2Byte bufferLen,
INPUT PVOID Callback
);
typedef RT_STATUS
(*NicQueryRxDescHandler) (
INPUT HAL_PADAPTER Adapter,
INPUT u4Byte queueIndex,
INPUT pu1Byte pBufAddr,
OUTPUT PVOID pRxDescStatus
);
typedef RT_STATUS
(*NicUpdateRXBDInfoHandler)(
IN HAL_PADAPTER Adapter,
IN u4Byte queueIndex, //HCI_RX_DMA_QUEUE_88XX
IN u2Byte rxbd_idx,
IN pu1Byte pBuf,
IN PVOID Callback, // callback function
IN BOOLEAN bInit
);
typedef u4Byte
(*NicReadableRxBufferDescCountHandler)(
INPUT HAL_PADAPTER Adapter,
INPUT u4Byte queueIndex
);
typedef VOID
(*NicUpdateRXBDHostIdxHandler)(
IN HAL_PADAPTER Adapter,
IN u4Byte queueIndex, //HCI_TX_DMA_QUEUE_88XX
IN u4Byte Count
);
typedef u2Byte
(*NicUpdateRXBDHWIdxHandler)(
IN HAL_PADAPTER Adapter,
IN u4Byte queueIndex //HCI_TX_DMA_QUEUE_88XX
);
//3 General operation
typedef MIMO_TR_STATUS
(*NicGetChipIDMIMOHandler)(
INPUT HAL_PADAPTER Adapter
);
typedef VOID
(*NicSetHwRegHandler)(
INPUT HAL_PADAPTER Adapter,
INPUT u1Byte RegName,
INPUT pu1Byte val
);
typedef VOID
(*NicGetHwRegHandler)(
INPUT HAL_PADAPTER Adapter,
INPUT u1Byte RegName,
OUTPUT pu1Byte val
);
typedef RT_STATUS
(*NicSetMACIDSleepHandler)(
INPUT HAL_PADAPTER Adapter,
INPUT BOOLEAN bSleep,
INPUT u4Byte aid
);
typedef VOID
(*NicCAMReadMACConfigHandler)(
INPUT HAL_PADAPTER Adapter,
INPUT u1Byte index,
OUTPUT pu1Byte pMacad,
OUTPUT PCAM_ENTRY_CFG pCfg
);
//3 Security Related
typedef VOID
(*NicCAMEmptyEntryHandler)(
INPUT HAL_PADAPTER Adapter,
INPUT u1Byte index
);
typedef u4Byte
(*NicCAMFindUsableHandler)(
INPUT HAL_PADAPTER Adapter,
INPUT u4Byte for_begin
);
typedef VOID
(*NicCAMProgramEntryHandler)(
INPUT HAL_PADAPTER Adapter,
INPUT u1Byte index,
INPUT pu1Byte macad,
INPUT pu1Byte key128,
INPUT u2Byte config
);
typedef RT_STATUS
(*NicStopHWHandler)(
INPUT HAL_PADAPTER Adapter
);
typedef RT_STATUS
(*NicStopSWHandler)(
INPUT HAL_PADAPTER Adapter
);
//3 Firmware CMD IO related
typedef RT_STATUS
(*NicFillH2CCmdHandler)(
IN HAL_PADAPTER Adapter,
IN u1Byte ElementID,
IN u4Byte CmdLen,
IN pu1Byte pCmdBuffer
);
typedef VOID
(*NicUpdateHalRAMaskHandler)(
IN HAL_PADAPTER Adapter,
HAL_PSTAINFO pEntry,
u1Byte rssi_level
);
typedef VOID
(*NicUpdateHalMSRRPTHandler)(
IN HAL_PADAPTER Adapter,
u2Byte aid,
u1Byte opmode
);
typedef VOID
(*NicSetAPOffloadHandler)(
IN HAL_PADAPTER Adapter,
u1Byte bEn,
u1Byte numOfAP,
u1Byte bHidden,
u1Byte bDenyAny,
pu1Byte loc_bcn,
pu1Byte loc_probe
);
typedef VOID
(*NicSetRsvdPageHandler) (
IN IN HAL_PADAPTER Adapter,
IN pu1Byte prsp,
IN pu1Byte beaconbuf,
IN u4Byte pktLen,
IN u4Byte bigPktLen
);
typedef u4Byte
(*NicGetRsvdPageLocHandler)(
IN IN HAL_PADAPTER Adapter,
IN u4Byte frlen,
OUT pu1Byte loc_page
);
typedef u1Byte
(*NicDownloadRsvdPageHandler)(
IN HAL_PADAPTER Adapter,
IN pu1Byte beaconbuf,
IN u4Byte beaconPktLen
);
typedef void
(*NicC2HHandler)(
IN HAL_PADAPTER Adapter
);
typedef VOID
(*DumpRxBDescHandler)(
IN HAL_PADAPTER Adapter,
u4Byte q_num
);
typedef VOID
(*DumpTxBDescHandler)(
IN HAL_PADAPTER Adapter,
u4Byte q_num
);
// 4. RF setting related
typedef RT_STATUS
(*NicPHYSetCCKTxPowerHandler)(
IN HAL_PADAPTER Adapter,
IN u1Byte channel
);
typedef RT_STATUS
(*NicPHYSetOFDMTxPowerHandler)(
IN HAL_PADAPTER Adapter,
IN u1Byte channel
);
typedef VOID
(*NicPHYUpdateBBRFValHandler)(
IN HAL_PADAPTER Adapter,
IN u1Byte channel,
IN s4Byte offset
);
typedef VOID
(*NicPHYSwBWModeHandler)(
IN HAL_PADAPTER Adapter,
IN u4Byte bandwidth,
IN s4Byte offset
);
typedef VOID
(*NicTXPowerTrackingHandler)(
IN HAL_PADAPTER Adapter
);
typedef struct _HAL_INTERFACE_COMMON_{
//
// WLAN Device operations.
//
//3 Initialization Related
NicInitPONHandler InitPONHandler;
NicInitMACHandler InitMACHandler;
NicInitIMRHandler InitIMRHandler;
NicInitFirmwareHandler InitFirmwareHandler;
NicInitHCIDMAMemHandler InitHCIDMAMemHandler;
NicInitHCIDMARegHandler InitHCIDMARegHandler;
NicInitMBSSIDHandler InitMBSSIDHandler;
NicInitVAPIMRHandler InitVAPIMRHandler;
//3 Stop Related
NicStopMBSSIDHandler StopMBSSIDHandler;
NicStopHWHandler StopHWHandler;
NicStopSWHandler StopSWHandler;
NicDisableVXDAPHandler DisableVXDAPHandler;
//3 ISR Related
NicEnableIMRHandler EnableIMRHandler;
NicInterruptRecognizedHandler InterruptRecognizedHandler;
NicGetInterruptHandler GetInterruptHandler;
NicAddInterruptMaskHandler AddInterruptMaskHandler;
NicRemoveInterruptMaskHandler RemoveInterruptMaskHandler;
NicDisableRxRelatedInterruptHandler DisableRxRelatedInterruptHandler;
NicEnableRxRelatedInterruptHandler EnableRxRelatedInterruptHandler;
//3 General operation
NicGetChipIDMIMOHandler GetChipIDMIMOHandler;
NicSetHwRegHandler SetHwRegHandler;
NicGetHwRegHandler GetHwRegHandler;
NicSetMACIDSleepHandler SetMACIDSleepHandler;
//3 Security Related
//CAM
NicCAMReadMACConfigHandler CAMReadMACConfigHandler;
NicCAMEmptyEntryHandler CAMEmptyEntryHandler;
NicCAMFindUsableHandler CAMFindUsableHandler;
NicCAMProgramEntryHandler CAMProgramEntryHandler;
//3 PHY/RF Related
//3 Firmware CMD IO related
//
// Special Operation for each Chip type
//
#if IS_RTL88XX_GENERATION
#if (HAL_DEV_BUS_TYPE & (HAL_RT_EMBEDDED_INTERFACE | HAL_RT_PCI_INTERFACE))
//3 Tx Related
NicTxPollingHandler TxPollingHandler;
NicSigninBeaconTXBDHandler SigninBeaconTXBDHandler;
NicSetBeaconDownloadHandler SetBeaconDownloadHandler;
NicFillBeaconDescHandler FillBeaconDescHandler;
NicGetTxQueueHWIdxHandler GetTxQueueHWIdxHandler;
NicMappingTxQueueHandler MappingTxQueueHandler;
NicQueryTxConditionMatchHandler QueryTxConditionMatchHandler;
NicPrepareTxBufferDescriptorHandler PrepareTXBDHandler;
NicFillTxHwCtrlHandler FillTxHwCtrlHandler;
NicSyncSWTXBDHostIdxToHWHandler SyncSWTXBDHostIdxToHWHandler;
// NicGetShortCutTxDescriptorHandler GetShortCutTxDescHandler;
NicReleaseShortCutTxDescriptorHandler ReleaseShortCutTxDescHandler;
NicGetShortCutTxBuffSizeHandler GetShortCutTxBuffSizeHandler;
NicSetShortCutTxBuffSizeHandler SetShortCutTxBuffSizeHandler;
NicCopyShortCutTxDescriptorHandler CopyShortCutTxDescHandler;
NicFillShortCutTxHwCtrlHandler FillShortCutTxHwCtrlHandler;
//3 Rx Related
NicPrepareRXBDHandler PrepareRXBDHandler;
NicQueryRxDescHandler QueryRxDescHandler;
NicUpdateRXBDInfoHandler UpdateRXBDInfoHandler;
NicReadableRxBufferDescCountHandler ReadableRxBufferDescCountHandler;
NicUpdateRXBDHWIdxHandler UpdateRXBDHWIdxHandler;
NicUpdateRXBDHostIdxHandler UpdateRXBDHostIdxHandler;
//3 Firmware CMD IO related
NicFillH2CCmdHandler FillH2CCmdHandler;
NicUpdateHalRAMaskHandler UpdateHalRAMaskHandler;
NicUpdateHalMSRRPTHandler UpdateHalMSRRPTHandler;
NicSetAPOffloadHandler SetAPOffloadHandler;
NicSetRsvdPageHandler SetRsvdPageHandler;
NicGetRsvdPageLocHandler GetRsvdPageLocHandler;
NicDownloadRsvdPageHandler DownloadRsvdPageHandler;
NicC2HHandler C2HHandler;
//4 SetPhy BB parameter related
NicPHYSetCCKTxPowerHandler PHYSetCCKTxPowerHandler;
NicPHYSetOFDMTxPowerHandler PHYSetOFDMTxPowerHandler;
NicPHYUpdateBBRFValHandler PHYUpdateBBRFValHandler;
NicPHYSwBWModeHandler PHYSwBWModeHandler;
NicTXPowerTrackingHandler TXPowerTrackingHandler;
#endif
#if IS_RTL8192E_SERIES
PVOID PHalFunc8192E;
#endif
#if IS_RTL8881A_SERIES
PVOID PHalFunc8881A;
#endif
#endif //IS_RTL88XX_GENERATION
DumpRxBDescHandler DumpRxBDescTestHandler;
DumpTxBDescHandler DumpTxBDescTestHandler;
} HAL_INTERFACE_COMMON, *PHAL_INTERFACE_COMMON;
#define HAL_INTERFACE HAL_INTERFACE_COMMON
#define PHAL_INTERFACE PHAL_INTERFACE_COMMON
#define GET_HAL_INTERFACE(__pAdapter) ((HAL_INTERFACE_COMMON *)((__pAdapter)->HalFunc))
typedef struct _HAL_DATA_MV_
{
u1Byte test;
}HAL_DATA_MV, *PHAL_DATA_PMV;
typedef u4Byte RT_INT_REG, *PRT_INT_REG;
// Variable: AccessSwapCtrl
#define HAL_ACCESS_SWAP_IO BIT0 /* Do bye-swap in access IO register */
#define HAL_ACCESS_SWAP_MEM BIT1 /* Do byte-swap in access memory space */
typedef struct _HAL_DATA_COMMON_
{
u2Byte HardwareType;
BOOLEAN bTestChip; // 1: TestChip, 0:MP
u1Byte cutVersion;
u1Byte devIdx;
//IO/MEM Swap
u4Byte AccessSwapCtrl;
//Mapping driver variable
HAL_DATA_MV MappingVariable;
//ISR
//u4Byte InterruptMask;
//u4Byte InterruptMaskExt;
RT_INT_REG IntArray[2];
RT_INT_REG IntMask[2];
RT_INT_REG IntMask_RxINTBackup[2]; //Backup for Rx IMR Control
#if IS_RTL88XX_GENERATION
//Firmware
u1Byte H2CBufPtr88XX; //88XX range: 0~3
BOOLEAN bFWReady;
PVOID PFWHeader;
//TRX DESC
PVOID PRxDescData88XX;
PVOID PRxDescStatus88XX;
#if (HAL_DEV_BUS_TYPE & (HAL_RT_EMBEDDED_INTERFACE | HAL_RT_PCI_INTERFACE))
PVOID PTxDMA88XX;
PVOID PRxDMA88XX;
u4Byte ring_dma_addr; //rx_dma_addr_start.
u4Byte ring_buf_len;
u4Byte ring_virt_addr;
u4Byte alloc_dma_buf;
u4Byte txBD_dma_ring_addr[14]; //there are 14 queues in system, including BCN queue
u4Byte txDesc_dma_ring_addr[14]; //there are 14 queues in system, including BCN queue
#endif
#if IS_RTL8881A_SERIES
PVOID PHalData8881A;
#endif //IS_RTL8881A_SERIES
#if IS_RTL8192E_SERIES
PVOID PHalData8192E;
#endif //IS_RTL8192E_SERIES
#endif //IS_RTL88XX_GENERATION
}HAL_DATA_COMMON, *PHAL_DATA_COMMON;
#define HAL_DATA_TYPE HAL_DATA_COMMON
#define PHAL_DATA_TYPE PHAL_DATA_COMMON
#define _GET_HAL_DATA(__pAdapter) ((HAL_DATA_TYPE *)((__pAdapter)->HalData))
#define HAL_HW_TYPE_ID_8723A 0x01
#define HAL_HW_TYPE_ID_8188E 0x02
#define HAL_HW_TYPE_ID_8881A 0x03
#define HAL_HW_TYPE_ID_8812A 0x04
#define HAL_HW_TYPE_ID_8723B 0x05
#define HAL_HW_TYPE_ID_8821A 0x06
#define HAL_HW_TYPE_ID_8192E 0x07
typedef enum _HARDWARE_TYPE{
HARDWARE_TYPE_RTL8192SE,
HARDWARE_TYPE_RTL8192SU,
HARDWARE_TYPE_RTL8192CE,
HARDWARE_TYPE_RTL8192CU,
HARDWARE_TYPE_RTL8192DE,
HARDWARE_TYPE_RTL8192DU,
HARDWARE_TYPE_RTL8723AE,
HARDWARE_TYPE_RTL8723AU,
HARDWARE_TYPE_RTL8723AS,
HARDWARE_TYPE_RTL8188EE,
HARDWARE_TYPE_RTL8188EU,
HARDWARE_TYPE_RTL8188ES,
HARDWARE_TYPE_RTL8812E,
HARDWARE_TYPE_RTL8821E,
HARDWARE_TYPE_RTL8812AU,
HARDWARE_TYPE_RTL8821U,
HARDWARE_TYPE_RTL8881AEM,
HARDWARE_TYPE_RTL8192EE,
HARDWARE_TYPE_RTL8192EU,
HARDWARE_TYPE_MAX,
}HARDWARE_TYPE;
#define IS_HAL_TEST_CHIP(_Adapter) (_GET_HAL_DATA(_Adapter)->bTestChip==_TRUE)
//
// RTL8192E Series
//
#define IS_HARDWARE_TYPE_8192EE(_Adapter) (_GET_HAL_DATA(_Adapter)->HardwareType==HARDWARE_TYPE_RTL8192EE)
#define IS_HARDWARE_TYPE_8192EU(_Adapter) (_GET_HAL_DATA(_Adapter)->HardwareType==HARDWARE_TYPE_RTL8192EU)
#define IS_HARDWARE_TYPE_8192E(_Adapter) \
(IS_HARDWARE_TYPE_8192EE(_Adapter) || IS_HARDWARE_TYPE_8192EU(_Adapter) )
//
// RTL8881A Series
//
#define IS_HARDWARE_TYPE_8881A(_Adapter) (_GET_HAL_DATA(_Adapter)->HardwareType==HARDWARE_TYPE_RTL8881AEM)
#endif //__HALDEF_H__
|