VSF Documented
vsf_wifi_cfg.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18/*============================ INCLUDES ======================================*/
21
22#ifndef __VSF_WIFI_CFG_H__
23#define __VSF_WIFI_CFG_H__
24
25/*============================ MACROS ========================================*/
26
27#ifndef VSF_USE_WIFI
28# define VSF_USE_WIFI DISABLED
29#endif
30
31#ifndef VSF_WIFI_ASSERT
32# define VSF_WIFI_ASSERT VSF_ASSERT
33#endif
34
35/*
36 * Chip driver enable switches.
37 *
38 * Each chip family has its own ENABLE switch so applications can choose
39 * which chip drivers to compile in. The switches are bus-agnostic; the
40 * same chip driver object can be used by USB / SDIO / SPI shims.
41 *
42 * A bus shim (e.g. vsf_usbh_wifi_rt2x00) MUST require at least one chip driver
43 * to be enabled when the bus class itself is enabled.
44 */
45#ifndef VSF_WIFI_USE_RT28XX
46# define VSF_WIFI_USE_RT28XX ENABLED
47#endif
48
49#ifndef VSF_WIFI_USE_MT76
50# define VSF_WIFI_USE_MT76 ENABLED
51#endif
52
53#ifndef VSF_WIFI_USE_AIC8800D
54# define VSF_WIFI_USE_AIC8800D DISABLED
55#endif
56
57/*
58 * Per-module log level.
59 *
60 * 0 = silent : no trace output (assertions still fire)
61 * 1 = error : runtime errors only
62 * 2 = info : key life-cycle events (ready, link up/down, scan done,
63 * connect success/fail, DHCP bound)
64 * 3 = verbose : normal runtime logs (TX build, reg script steps,
65 * single URB completion)
66 * 4 = debug : per-frame/beacon/RX delivery counters
67 *
68 * Sub-module macros fall back to VSF_WIFI_CFG_LOG_LEVEL when not defined.
69 */
70#ifndef VSF_WIFI_CFG_LOG_LEVEL
71# define VSF_WIFI_CFG_LOG_LEVEL 2
72#endif
73#ifndef VSF_WIFI_CFG_CHIP_RT28XX_LOG_LEVEL
74# define VSF_WIFI_CFG_CHIP_RT28XX_LOG_LEVEL VSF_WIFI_CFG_LOG_LEVEL
75#endif
76#ifndef VSF_WIFI_CFG_CHIP_MT76_LOG_LEVEL
77# define VSF_WIFI_CFG_CHIP_MT76_LOG_LEVEL VSF_WIFI_CFG_LOG_LEVEL
78#endif
79#ifndef VSF_WIFI_CFG_CHIP_AIC8800D_LOG_LEVEL
80# define VSF_WIFI_CFG_CHIP_AIC8800D_LOG_LEVEL VSF_WIFI_CFG_LOG_LEVEL
81#endif
82#ifndef VSF_WIFI_CFG_BUS_RT2X00_LOG_LEVEL
83# define VSF_WIFI_CFG_BUS_RT2X00_LOG_LEVEL VSF_WIFI_CFG_LOG_LEVEL
84#endif
85#ifndef VSF_WIFI_CFG_BUS_AIC8800D_LOG_LEVEL
86# define VSF_WIFI_CFG_BUS_AIC8800D_LOG_LEVEL VSF_WIFI_CFG_LOG_LEVEL
87#endif
88#ifndef VSF_WIFI_CFG_NETDRV_LOG_LEVEL
89# define VSF_WIFI_CFG_NETDRV_LOG_LEVEL VSF_WIFI_CFG_LOG_LEVEL
90#endif
91
92/*
93 * WPA2-PSK (CCMP) support switch.
94 *
95 * The WPA software stack (PBKDF2 / PRF / EAPOL MIC / AES key-unwrap / CCMP)
96 * is implemented on top of mbedtls, so it can only be enabled when mbedtls is
97 * compiled in. Defaults to follow VSF_USE_MBEDTLS.
98 */
99#ifndef VSF_WIFI_USE_WPA
100# if defined(VSF_USE_MBEDTLS) && (VSF_USE_MBEDTLS == ENABLED)
101# define VSF_WIFI_USE_WPA ENABLED
102# else
103# define VSF_WIFI_USE_WPA DISABLED
104# endif
105#endif
106
107/*
108 * WPA debug logging: PMK / PTK / SNonce / PRF input/output dumps.
109 * These traces are verbose and, when combined with synchronous log flushing,
110 * can delay the M2 response enough to cause 4-way handshake timeouts.
111 * Keep DISABLED for normal operation; enable only when debugging key derivation.
112 */
113#ifndef VSF_WIFI_CFG_WPA_DEBUG_LOG
114# define VSF_WIFI_CFG_WPA_DEBUG_LOG DISABLED
115#endif
116
117/*
118 * CCMP TX self-verify: after software-encrypting a data frame, decrypt it again
119 * to confirm round-trip correctness. Useful when bringing up a new chip driver
120 * or debugging software CCMP, but it costs one 1600-byte working buffer per
121 * wifi instance. Keep DISABLED for normal operation.
122 */
123#ifndef VSF_WIFI_CFG_CCMP_TX_SELF_VERIFY
124# define VSF_WIFI_CFG_CCMP_TX_SELF_VERIFY DISABLED
125#endif
126
127/*
128 * RT28xx (RT2870/RT3070/RT3572/RT5370/RT5572) hardware CCMP offloading.
129 * When ENABLED the RT28xx chip driver registers crypto_ops and the wifi layer
130 * skips software CCMP encap/decap. When DISABLED the existing software CCMP
131 * path is used.
132 */
133#ifndef VSF_WIFI_CFG_RT28XX_HW_CRYPTO
134# define VSF_WIFI_CFG_RT28XX_HW_CRYPTO ENABLED
135#endif
136
137/*
138 * 802.11 keepalive: send a null data frame at regular intervals to prevent
139 * the AP from deauthenticating an idle STA. The interval is derived from
140 * the BSS Max Idle Period IE advertised by the AP when available, otherwise
141 * the default below is used. Set to 0 to disable.
142 */
143#ifndef VSF_WIFI_CFG_KEEPALIVE_PERIOD_MS
144# define VSF_WIFI_CFG_KEEPALIVE_PERIOD_MS 10000
145#endif
146
147/* Hard lower bound for the dynamic keepalive period (avoid excessive airtime). */
148#ifndef VSF_WIFI_CFG_KEEPALIVE_MIN_PERIOD_MS
149# define VSF_WIFI_CFG_KEEPALIVE_MIN_PERIOD_MS 2000
150#endif
151
152/*============================ MACROFIED FUNCTIONS ===========================*/
153/*============================ TYPES =========================================*/
154/*============================ GLOBAL VARIABLES ==============================*/
155/*============================ LOCAL VARIABLES ===============================*/
156/*============================ PROTOTYPES ====================================*/
157
158
159#endif
160/* EOF */
Generated from commit: vsfteam/vsf@5de27dd