00001
00017 #ifndef _RWNX_CONFIG_H_
00018 #define _RWNX_CONFIG_H_
00019
00029
00030
00031
00032
00033 #include "mac.h"
00034
00036 #ifdef CFG_FHOST
00037 #define NX_FULLY_HOSTED 1
00038
00039 #undef CFG_AMSDU
00040
00041 #define CFG_DEAGG
00042 #else // !CFG_FHOST
00043 #define NX_FULLY_HOSTED 0
00044 #endif // CFG_FHOST
00045
00046
00047 #ifdef CFG_MESH
00048 #undef CFG_MROLE
00049 #define CFG_MROLE
00050 #undef CFG_BCN
00051 #define CFG_BCN
00052 #undef CFG_AUTOBCN
00053 #define CFG_AUTOBCN
00054 #undef CFG_MFP
00055 #define CFG_MFP
00056 #undef CFG_PS
00057 #define CFG_PS
00058 #endif //defined CFG_MESH
00059
00060
00061 #ifdef CFG_UMAC
00063 #define NX_UMAC_PRESENT 1
00064 #undef CFG_CMON
00065 #define CFG_CMON
00066 #undef CFG_HWSCAN
00067 #define CFG_HWSCAN
00068 #undef CFG_MROLE
00069 #define CFG_MROLE
00070 #undef CFG_AUTOBCN
00071 #ifdef CFG_BCN
00072 #define CFG_AUTOBCN
00073 #endif
00074 #else // !CFG_UMAC
00076 #define NX_UMAC_PRESENT 0
00077 #endif // CFG_UMAC
00078
00079
00085
00086 #ifdef CFG_MAC_VER_V10
00087 #define NX_MAC_VER 10
00088 #elif defined CFG_MAC_VER_V20
00089 #define NX_MAC_VER 20
00090 #elif defined CFG_MAC_VER_V21
00091 #define NX_MAC_VER 21
00092 #endif
00093 #if (NX_MAC_VER == 20)
00094 #error "MAC version 20 is deprecated"
00095 #endif
00097 #define NX_MAC_HE (NX_MAC_VER >= 20)
00099 #define NX_RX_RING (NX_MAC_VER >= 21)
00100 #if NX_MAC_HE
00101
00102 #undef CFG_AGG
00103 #define CFG_AGG
00104 #endif
00105
00113
00114 #ifdef CFG_MDM_VER_V10
00115 #define NX_MDM_VER 10
00116 #elif defined CFG_MDM_VER_V11
00117 #define NX_MDM_VER 11
00118 #elif defined CFG_MDM_VER_V20
00119 #define NX_MDM_VER 20
00120 #elif defined CFG_MDM_VER_V21
00121 #define NX_MDM_VER 21
00122 #elif defined CFG_MDM_VER_V22
00123 #define NX_MDM_VER 22
00124 #elif defined CFG_MDM_VER_V30
00125 #define NX_MDM_VER 30
00126 #endif
00127
00134
00135 #ifdef CFG_PLF_VER_V10
00136 #define NX_PLF_VER 10
00137 #elif defined CFG_PLF_VER_V20
00138 #define NX_PLF_VER 20
00139 #elif defined CFG_PLF_VER_V30
00140 #define NX_PLF_VER 30
00141 #endif
00142
00149
00150
00151 #define NX_VIRT_DEV_MAX CFG_VIF_MAX
00152 #if (NX_VIRT_DEV_MAX & (NX_VIRT_DEV_MAX - 1))
00153 #error "Not a power of 2"
00154 #endif
00155 #if (NX_VIRT_DEV_MAX > 4)
00156 #error "Max number of VIF shall be 4"
00157 #endif
00158
00160 #define NX_REMOTE_STA_MAX CFG_STA_MAX
00161
00163 #define NX_HEAP_SIZE (2048 + 2048 * NX_UMAC_PRESENT + 256 * NX_VIRT_DEV_MAX + 64 * NX_REMOTE_STA_MAX)
00164
00165 #ifdef CFG_EMB
00167 #define NX_EMB 1
00168 #else
00170 #define NX_EMB 0
00171 #endif
00172
00179
00180 #ifdef CFG_BCN
00181 #define NX_BEACONING 1
00182 #else
00183 #define NX_BEACONING 0
00184 #endif
00185
00187 #ifdef CFG_AUTOBCN
00188 #define NX_BCN_AUTONOMOUS_TX 1
00189 #else
00190 #define NX_BCN_AUTONOMOUS_TX 0
00191 #endif
00192
00194 #define NX_BCNFRAME_LEN 512
00195
00202
00203 #ifdef CFG_UAPSD
00204 #define NX_UAPSD 1
00205
00206 #undef CFG_PS
00207 #define CFG_PS
00208 #else
00209 #define NX_UAPSD 0
00210 #endif
00211
00213 #ifdef CFG_DPSM
00214 #define NX_DPSM 1
00215
00216 #undef CFG_PS
00217 #define CFG_PS
00218 #else
00219 #define NX_DPSM 0
00220 #endif
00221
00223 #ifdef CFG_PS
00224 #define NX_POWERSAVE 1
00225 #else
00226 #define NX_POWERSAVE 0
00227 #endif
00228
00235 #if NX_UMAC_PRESENT
00236
00237 #if NX_MDM_VER<30 || NX_MAC_VER<20
00238 #undef CFG_HE
00239 #endif
00240
00242 #ifdef CFG_HE
00243 #define NX_HE 1
00244
00245 #undef CFG_VHT
00246 #define CFG_VHT
00247
00248 #undef CFG_MFP
00249 #define CFG_MFP
00250 #else // !CFG_HE
00251 #define NX_HE 0
00252 #endif // CFG_HE
00253 #endif // NX_UMAC_PRESENT
00254
00261 #if NX_UMAC_PRESENT
00263 #ifdef CFG_VHT
00264 #define NX_VHT 1
00265
00266 #undef CFG_MFP
00267 #define CFG_MFP
00268 #else // !CFG_VHT
00269 #define NX_VHT 0
00270 #endif // CFG_VHT
00271 #endif // NX_UMAC_PRESENT
00272
00279
00280 #ifdef CFG_AMSDU
00281 #define NX_AMSDU_TX 1
00282
00283 #undef CFG_AGG
00284 #define CFG_AGG
00286 #define NX_TX_PAYLOAD_MAX 6
00287 #else
00288 #define NX_AMSDU_TX 0
00289 #endif
00290
00292 #ifdef CFG_AMSDU_4K
00293 #define RWNX_MAX_AMSDU_RX 4096
00294 #elif defined CFG_AMSDU_8K
00295 #define RWNX_MAX_AMSDU_RX 8192
00296 #elif defined CFG_AMSDU_12K
00297 #define RWNX_MAX_AMSDU_RX 12288
00298 #endif
00299
00306 #ifdef CFG_AGG
00308 #define NX_AMPDU_TX 1
00309 #if NX_UMAC_PRESENT
00311 #define NX_MAX_BA_TX CFG_BATX
00312 #if (NX_MAX_BA_TX == 0)
00313 #error "At least one BA TX agreement shall be allowed"
00314 #endif
00315 #else // !NX_UMAC_PRESENT
00316 #define NX_MAX_BA_TX 0
00317 #endif // NX_UMAC_PRESENT
00318 #else // !CFG_AGG
00319 #define NX_AMPDU_TX 0
00320 #define NX_MAX_BA_TX 0
00321 #undef CFG_BWLEN
00322 #undef CFG_MU_CNT
00323 #define CFG_MU_CNT 1
00324 #endif // CFG_AGG
00325
00326 #if NX_UMAC_PRESENT
00328 #define NX_REORD CFG_BARX
00330 #define NX_REORD_BUF_SIZE CFG_REORD_BUF
00331 #if (NX_REORD && ((NX_REORD_BUF_SIZE < 4) || (NX_REORD_BUF_SIZE > 64)))
00332 #error "Incorrect reordering buffer size"
00333 #endif
00335 #ifdef CFG_DEAGG
00336 #define NX_AMSDU_DEAGG 1
00337 #else
00338 #define NX_AMSDU_DEAGG 0
00339 #endif
00340 #else // !NX_UMAC_PRESENT
00342 #define NX_REORD 0
00344 #define NX_AMSDU_DEAGG 0
00345 #endif // NX_UMAC_PRESENT
00346
00353
00354
00355
00356 #if NX_UMAC_PRESENT && !NX_HE && !NX_VHT
00357 #undef CFG_BFMER
00358 #endif // NX_UMAC_PRESENT && !NX_HE && !NX_VHT
00359
00361 #ifdef CFG_BFMEE
00362 #define RW_BFMEE_EN 1
00363 #else
00364 #define RW_BFMEE_EN 0
00365
00366 #undef CFG_MU_RX
00367 #endif
00368
00369 #ifdef CFG_BFMER
00371 #define RW_BFMER_EN 1
00373 #define RW_BFR_TXFRAME_CNT CFG_MU_CNT
00374 #else // !CFG_BFMER
00375 #define RW_BFMER_EN 0
00376 #define RW_BFR_TXFRAME_CNT 0
00377
00378 #undef CFG_MU_CNT
00379 #define CFG_MU_CNT 1
00380 #endif // CFG_BFMER
00381
00383 #define RW_USER_MAX CFG_MU_CNT
00385 #define RW_MUMIMO_TX_EN (RW_USER_MAX > 1)
00387 #define RW_MUMIMO_SEC_USER1_EN (RW_USER_MAX > 1)
00389 #define RW_MUMIMO_SEC_USER2_EN (RW_USER_MAX > 2)
00391 #define RW_MUMIMO_SEC_USER3_EN (RW_USER_MAX > 3)
00392
00394 #ifdef CFG_MU_RX
00395 #define RW_MUMIMO_RX_EN 1
00396 #else
00397 #define RW_MUMIMO_RX_EN 0
00398 #endif
00399
00406 #if CFG_P2P
00408 #define NX_P2P 1
00410 #define NX_P2P_VIF_MAX CFG_P2P
00411
00413 #ifdef CFG_P2P_GO
00414
00415 #if !(defined CFG_AUTOBCN)
00416 #error 'Autonomous Beacon TX feature (AUTOBCN) must be enabled'
00417 #endif
00418 #define NX_P2P_GO 1
00419 #else
00420 #define NX_P2P_GO 0
00421 #endif //(GFG_P2P_GO)
00422 #else
00423 #define NX_P2P 0
00424 #define NX_P2P_VIF_MAX 0
00425 #define NX_P2P_GO 0
00426 #endif //(CFG_P2P)
00427
00434 #ifdef CFG_MESH
00436 #define RW_MESH_EN (1)
00438 #define RW_UMESH_EN (NX_UMAC_PRESENT)
00440 #define RW_MESH_VIF_NB (CFG_MESH_VIF)
00442 #define RW_MESH_LINK_NB (CFG_MESH_LINK)
00444 #define RW_MESH_PATH_NB (CFG_MESH_PATH)
00446 #define RW_MESH_PROXY_NB (CFG_MESH_PROXY)
00447 #else
00448 #define RW_MESH_EN (0)
00449 #define RW_UMESH_EN (0)
00450 #define RW_MESH_VIF_NB (0)
00451 #define RW_MESH_LINK_NB (0)
00452 #define RW_MESH_PATH_NB (0)
00453 #define RW_MESH_PROXY_NB (0)
00454 #endif //defined CFG_MESH
00455
00462
00463 #define NX_TX_MPDU_SPACING CFG_SPC
00464
00466 #define NX_TXQ_CNT (AC_MAX + NX_BEACONING)
00467
00469 #define NX_TXDESC_CNT0 CFG_TXDESC0
00470 #if (NX_TXDESC_CNT0 & (NX_TXDESC_CNT0 - 1))
00471 #error "Not a power of 2"
00472 #endif
00474 #define NX_TXDESC_CNT1 CFG_TXDESC1
00475 #if (NX_TXDESC_CNT1 & (NX_TXDESC_CNT1 - 1))
00476 #error "Not a power of 2"
00477 #endif
00479 #define NX_TXDESC_CNT2 CFG_TXDESC2
00480 #if (NX_TXDESC_CNT2 & (NX_TXDESC_CNT2 - 1))
00481 #error "Not a power of 2"
00482 #endif
00484 #define NX_TXDESC_CNT3 CFG_TXDESC3
00485 #if (NX_TXDESC_CNT3 & (NX_TXDESC_CNT3 - 1))
00486 #error "Not a power of 2"
00487 #endif
00488 #if (NX_BEACONING)
00490 #define NX_TXDESC_CNT4 CFG_TXDESC4
00491 #if (NX_TXDESC_CNT4 & (NX_TXDESC_CNT4 - 1))
00492 #error "Not a power of 2"
00493 #endif
00494 #endif
00495
00497 #define NX_TXFRAME_CNT (NX_VIRT_DEV_MAX + RW_BFR_TXFRAME_CNT)
00498 #if NX_TXFRAME_CNT < 2
00499 #undef NX_TXFRAME_CNT
00500 #define NX_TXFRAME_CNT 2
00501 #endif
00502
00503
00505 #if NX_UMAC_PRESENT
00506 #if (NX_P2P)
00507 #define NX_TXFRAME_LEN 384
00508 #else
00509 #define NX_TXFRAME_LEN 256
00510 #endif //(NX_P2P)
00511 #else
00512 #define NX_TXFRAME_LEN 128
00513 #endif
00514
00516 #define NX_DEFAULT_TX_CREDIT_CNT 4
00517
00524
00525 #define NX_RX_PAYLOAD_LEN 512
00526
00528 #if NX_UMAC_PRESENT && NX_VHT
00529 #define NX_RX_LONG_MPDU_CNT 3
00530 #else
00531 #define NX_RX_LONG_MPDU_CNT 2
00532 #endif
00533
00536 #define NX_RX_PAYLOAD_DESC_CNT ((RWNX_MAX_AMSDU_RX / NX_RX_PAYLOAD_LEN) * NX_RX_LONG_MPDU_CNT + 1)
00537
00539 #define NX_RXDESC_CNT NX_RX_PAYLOAD_DESC_CNT
00540
00541 #if NX_AMSDU_DEAGG
00543 #define NX_MAX_MSDU_PER_RX_AMSDU 8
00544 #endif
00545
00547 #if NX_AMSDU_DEAGG
00548 #define NX_DMADESC_PER_RX_PDB_CNT NX_MAX_MSDU_PER_RX_AMSDU
00549 #else
00550 #define NX_DMADESC_PER_RX_PDB_CNT 1
00551 #endif
00552
00560 #ifdef CFG_RADAR
00562 #define NX_RADAR_DETECT 1
00564 #define RW_RADAR_EN 1
00565 #else
00566 #define NX_RADAR_DETECT 0
00567 #define RW_RADAR_EN 0
00568 #endif
00569
00576 #ifdef CFG_UF
00577 #if (NX_MDM_VER >= 20) && (NX_MDM_VER < 30)
00579 #define NX_UF_EN 1
00580 #else
00581 #define NX_UF_EN 0
00582 #endif
00583 #else
00584 #define NX_UF_EN 0
00585 #endif
00586
00593 #if NX_UMAC_PRESENT && defined CFG_MON_DATA
00594 #define NX_MON_DATA 1
00595 #else
00596 #define NX_MON_DATA 0
00597 #endif
00598
00605
00606 #ifdef CFG_DBGDUMP
00607 #define NX_DEBUG_DUMP 1
00608 #else
00609 #define NX_DEBUG_DUMP 0
00610 #endif
00611
00613 #ifdef CFG_DBGDUMPKEY
00614 #define NX_DEBUG_DUMP_KEY 1
00615 #else
00616 #define NX_DEBUG_DUMP_KEY 0
00617 #endif
00618
00620 #define NX_DEBUG CFG_DBG
00621
00623 #if NX_DEBUG
00624 #define NX_PRINT NX_PRINT_IPC
00625 #else
00626 #define NX_PRINT NX_PRINT_NONE
00627 #endif
00628
00630 #ifdef CFG_TRACE
00631 #define NX_TRACE 1
00632 #else
00633 #define NX_TRACE 0
00634 #endif
00635
00637 #ifdef CFG_PROF
00638 #define NX_PROFILING_ON 1
00639 #else
00640 #define NX_PROFILING_ON 0
00641 #endif
00642
00644 #ifdef CFG_STATS
00645 #define NX_SYS_STAT 1
00646 #else
00647 #define NX_SYS_STAT 0
00648 #endif
00649
00656
00657 #ifdef CFG_REC
00658 #define NX_RECOVERY 1
00659 #else
00660 #define NX_RECOVERY 0
00661 #endif
00662
00664 #ifdef CFG_CMON
00665 #define NX_CONNECTION_MONITOR 1
00666 #else
00667 #define NX_CONNECTION_MONITOR 0
00668 #endif
00669
00671 #ifdef CFG_MROLE
00672 #define NX_MULTI_ROLE 1
00673 #else
00674 #define NX_MULTI_ROLE 0
00675 #endif
00676
00678 #ifdef CFG_HWSCAN
00679 #define NX_HW_SCAN 1
00680 #else
00681 #define NX_HW_SCAN 0
00682 #endif
00683
00685 #if NX_UMAC_PRESENT && defined CFG_MFP
00686 #define NX_MFP 1
00687 #else
00688 #define NX_MFP 0
00689 #endif
00690
00692 #ifdef CFG_WAPI
00693 #define RW_WAPI_EN 1
00694 #else
00695 #define RW_WAPI_EN 0
00696 #endif
00697
00699 #ifdef CFG_COEX
00700 #define RW_WLAN_COEX_EN 1
00701 #else
00702 #define RW_WLAN_COEX_EN 0
00703 #endif
00704
00706 #ifdef CFG_KEYCFG
00707 #define NX_KEY_RAM_CONFIG 1
00708 #else
00709 #define NX_KEY_RAM_CONFIG 0
00710 #endif
00711
00713 #ifdef CFG_TDLS
00714 #define NX_TDLS 1
00715 #else
00716 #define NX_TDLS 0
00717 #endif
00718
00719 #ifdef CFG_BWLEN
00721 #define NX_BW_LEN_ADAPT 1
00723 #define NX_BW_LEN_STEPS 4
00724 #else
00725 #define NX_BW_LEN_ADAPT 0
00726 #define NX_BW_LEN_STEPS 1
00727 #endif
00728
00733 #ifdef CFG_HSU
00734 #define NX_HSU (CFG_HSU)
00735 #define RW_HSU_SHA_EN 1
00736 #else
00737 #define NX_HSU 0
00738 #endif
00739
00741 #if NX_UMAC_PRESENT && defined CFG_ANT_DIV && (NX_MDM_VER < 30)
00742 #define NX_ANT_DIV 1
00743 #else
00744 #define NX_ANT_DIV 0
00745 #endif
00746
00748 #ifdef CFG_TG
00749 #define NX_TG 1
00750 #else
00751 #define NX_TG 0
00752 #endif
00753
00755 #ifdef CFG_FHOST_MONITOR
00756 #define NX_FHOST_MONITOR 1
00757 #else
00758 #define NX_FHOST_MONITOR 0
00759 #endif
00760
00762 #ifdef CFG_SMARTCONFIG
00763 #undef NX_FHOST_MONITOR
00764 #define NX_FHOST_MONITOR 1
00765 #define NX_SMARTCONFIG 1
00766 #else
00767 #define NX_SMARTCONFIG 0
00768 #endif
00769
00771 #ifdef CFG_CRYPTO
00772 #define NX_CRYPTOLIB 1
00773 #else
00774 #define NX_CRYPTOLIB 0
00775 #endif
00776
00785
00786 #define NX_CHNL_CTXT (NX_HW_SCAN || NX_P2P)
00788 #define NX_CHAN_CTXT_CNT 3
00789
00791 #define NX_GP_DMA (NX_CHNL_CTXT || NX_BCN_AUTONOMOUS_TX || NX_RADAR_DETECT || RW_BFMER_EN)
00792
00794 #define NX_RX_FRAME_HANDLING (NX_POWERSAVE || NX_CONNECTION_MONITOR || NX_UMAC_PRESENT || RW_BFMER_EN)
00795
00797 #define NX_TX_FRAME (NX_POWERSAVE || NX_CONNECTION_MONITOR || NX_CHNL_CTXT || NX_BCN_AUTONOMOUS_TX || RW_BFMER_EN)
00798
00800 #define NX_TD_STA (RW_BFMER_EN || NX_TDLS || NX_MAC_HE)
00801
00803 #define NX_TD (NX_DPSM || NX_CHNL_CTXT || NX_P2P_GO || NX_TD_STA)
00804
00806 #define NX_MM_TIMER (NX_MULTI_ROLE || NX_CHNL_CTXT || NX_DPSM || NX_P2P || NX_UAPSD || RW_BFMER_EN | NX_BEACONING)
00807
00815
00816 #define NX_11AX_DRAFT_2_0 0
00817
00819 #define RW_NX_LDPC_DEC 1
00820
00822 #define RW_NX_AGC_SNR_EN 1
00823
00825 #define RW_NX_IQ_COMP_EN 1
00826
00828 #define RW_NX_FIQ_COMP_EN 1
00829
00831 #define RW_NX_DERIV_80211B 1
00832
00834 #define RW_KEY_EXTENDED 1
00836
00837 #endif // _RWNX_CONFIG_H_
00839
00840