Skip to content

Commit

Permalink
drivers: wifi: Introduce separate patch for Raw modes
Browse files Browse the repository at this point in the history
In order to save flash memory, move the support for Raw modes (TX
injection, monitor and promiscuous) to a separate image.

Implements SHEL-2580 which should fix SHEL-2579.

Signed-off-by: Chaitanya Tata <[email protected]>
Signed-off-by: Vivekananda Uppunda <[email protected]>
  • Loading branch information
krish2718 authored and rlubos committed Mar 19, 2024
1 parent 4d6dc31 commit 8e77d8e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
2 changes: 2 additions & 0 deletions drivers/wifi/nrf700x/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ elseif(CONFIG_NRF700X_RADIO_TEST)
set(NRF70_PATCH ${OS_AGNOSTIC_BASE}/fw_bins/radio_test/nrf70.bin)
elseif(CONFIG_NRF700X_SCAN_ONLY)
set(NRF70_PATCH ${OS_AGNOSTIC_BASE}/fw_bins/scan_only/nrf70.bin)
elseif (CONFIG_NRF700X_SYSTEM_WITH_RAW_MODES)
set(NRF70_PATCH ${OS_AGNOSTIC_BASE}/fw_bins/system_with_raw/nrf70.bin)
else()
# Error
message(FATAL_ERROR "Unsupported nRF70 patch configuration")
Expand Down
25 changes: 14 additions & 11 deletions drivers/wifi/nrf700x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ config WIFI_NRF700X_BUS_LOG_LEVEL

choice NRF700X_OPER_MODES
bool "nRF700x operating modes"
default NRF700X_SYSTEM_MODE if WPA_SUPP
default NRF700X_SYSTEM_MODE if WPA_SUPP && !(NRF700X_RAW_DATA_TX || NRF700X_RAW_DATA_RX || NRF700X_PROMISC_DATA_RX)
default NRF700X_SCAN_ONLY if !WPA_SUPP
default NRF700X_SYSTEM_WITH_RAW_MODES
help
Select the operating mode of the nRF700x driver

Expand All @@ -52,9 +53,15 @@ config NRF700X_SCAN_ONLY
config NRF700X_RADIO_TEST
bool "Radio test mode of the nRF700x driver"

config NRF700X_SYSTEM_WITH_RAW_MODES
bool "Enable nRF700X system mode with raw modes"
depends on WPA_SUPP
help
Select this option to enable system mode of the nRF700x driver with raw modes

endchoice

if NRF700X_SYSTEM_MODE
if NRF700X_SYSTEM_MODE || NRF700X_SYSTEM_WITH_RAW_MODES

config NRF700X_STA_MODE
bool "Enable nRF700X STA mode"
Expand All @@ -69,27 +76,23 @@ config NRF700X_AP_MODE

config NRF700X_P2P_MODE
bool "Enable P2P support in driver"

endif # NRF700X_SYSTEM_MODE

config NRF700X_DATA_TX
bool "Enable TX data path in the driver"
default y if NRF700X_SYSTEM_MODE
endif # NRF700X_SYSTEM_MODE || NRF700X_SYSTEM_WITH_RAW_MODES

config NRF700X_RAW_DATA_TX
bool "Enable RAW TX data path in the driver"
select EXPERIMENTAL
depends on NRF700X_SYSTEM_MODE

config NRF700X_RAW_DATA_RX
bool "Enable RAW RX sniffer operation in the driver"
select EXPERIMENTAL
depends on NRF700X_SYSTEM_MODE

config NRF700X_PROMISC_DATA_RX
bool "Enable promiscuous RX sniffer operation in the driver"
select EXPERIMENTAL
depends on NRF700X_SYSTEM_MODE

config NRF700X_DATA_TX
bool "Enable TX data path in the driver"
default y if NRF700X_SYSTEM_MODE || NRF700X_SYSTEM_WITH_RAW_MODES

config NRF_WIFI_IF_AUTO_START
bool "Enable Wi-Fi interface auto start on boot"
Expand Down
2 changes: 1 addition & 1 deletion drivers/wifi/nrf700x/inc/wifi_mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void nrf_wifi_event_proc_get_power_save_info(void *vif_ctx,
struct nrf_wifi_umac_event_power_save_info *ps_info,
unsigned int event_len);

#ifdef CONFIG_NRF700X_SYSTEM_MODE
#ifdef CONFIG_NRF700X_SYSTEM_WITH_RAW_MODES
int nrf_wifi_mode(const struct device *dev,
struct wifi_mode_info *mode);
#endif
Expand Down
2 changes: 1 addition & 1 deletion drivers/wifi/nrf700x/src/fmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ static struct wifi_mgmt_ops nrf_wifi_mgmt_ops = {
.reg_domain = nrf_wifi_reg_domain,
.get_power_save_config = nrf_wifi_get_power_save_config,
#endif /* CONFIG_NRF700X_STA_MODE */
#ifdef CONFIG_NRF700X_SYSTEM_MODE
#ifdef CONFIG_NRF700X_SYSTEM_WITH_RAW_MODES
.mode = nrf_wifi_mode,
#endif
#if defined(CONFIG_NRF700X_RAW_DATA_TX) || defined(CONFIG_NRF700X_RAW_DATA_RX)
Expand Down
4 changes: 2 additions & 2 deletions drivers/wifi/nrf700x/src/wifi_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ void nrf_wifi_event_proc_twt_sleep_zep(void *vif_ctx,
k_mutex_unlock(&vif_ctx_zep->vif_lock);
}

#ifdef CONFIG_NRF700X_SYSTEM_MODE
#ifdef CONFIG_NRF700X_SYSTEM_WITH_RAW_MODES
int nrf_wifi_mode(const struct device *dev,
struct wifi_mode_info *mode)
{
Expand Down Expand Up @@ -823,7 +823,7 @@ int nrf_wifi_mode(const struct device *dev,
k_mutex_unlock(&vif_ctx_zep->vif_lock);
return ret;
}
#endif /* CONFIG_NRF700X_SYSTEM_MODE */
#endif /* CONFIG_NRF700X_SYSTEM_WITH_RAW_MODES */

#if defined(CONFIG_NRF700X_RAW_DATA_TX) || defined(CONFIG_NRF700X_RAW_DATA_RX)
int nrf_wifi_channel(const struct device *dev,
Expand Down

0 comments on commit 8e77d8e

Please sign in to comment.