Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register as a Native Wi-Fi driver #11534

Merged
merged 5 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion drivers/wifi/nrf700x/zephyr/inc/zephyr_wifi_mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ struct twt_interval_float {
unsigned char exponent;
};

int wifi_nrf_disp_scan_zep(const struct device *dev, scan_result_cb_t cb);
int wifi_nrf_disp_scan_zep(const struct device *dev, struct wifi_scan_params *params,
scan_result_cb_t cb);

enum wifi_nrf_status wifi_nrf_disp_scan_res_get_zep(struct wifi_nrf_vif_ctx_zep *vif_ctx_zep);

Expand Down
22 changes: 14 additions & 8 deletions drivers/wifi/nrf700x/zephyr/src/zephyr_fmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,19 @@ static int wifi_nrf_drv_main_zep(const struct device *dev)
}

#ifndef CONFIG_NRF700X_RADIO_TEST

static struct wifi_mgmt_ops wifi_nrf_mgmt_ops = {
.scan = wifi_nrf_disp_scan_zep,
#ifdef CONFIG_NET_STATISTICS_WIFI
.get_stats = wifi_nrf_stats_get,
#endif /* CONFIG_NET_STATISTICS_WIFI */
.set_power_save = wifi_nrf_set_power_save,
.set_twt = wifi_nrf_set_twt,
.reg_domain = wifi_nrf_reg_domain,
.get_power_save_config = wifi_nrf_get_power_save_config,
krish2718 marked this conversation as resolved.
Show resolved Hide resolved
};


static const struct net_wifi_mgmt_offload wifi_offload_ops = {
.wifi_iface.iface_api.init = wifi_nrf_if_init_zep,
.wifi_iface.start = wifi_nrf_if_start_zep,
Expand All @@ -518,14 +531,7 @@ static const struct net_wifi_mgmt_offload wifi_offload_ops = {
#ifdef CONFIG_NET_STATISTICS_ETHERNET
.wifi_iface.get_stats = wifi_nrf_eth_stats_get,
#endif /* CONFIG_NET_STATISTICS_ETHERNET */
.scan = wifi_nrf_disp_scan_zep,
#ifdef CONFIG_NET_STATISTICS_WIFI
.get_stats = wifi_nrf_stats_get,
#endif /* CONFIG_NET_STATISTICS_WIFI */
.set_power_save = wifi_nrf_set_power_save,
.set_twt = wifi_nrf_set_twt,
.reg_domain = wifi_nrf_reg_domain,
.get_power_save_config = wifi_nrf_get_power_save_config,
.wifi_mgmt_api = &wifi_nrf_mgmt_ops,
};

#ifdef CONFIG_WPA_SUPP
Expand Down
2 changes: 2 additions & 0 deletions drivers/wifi/nrf700x/zephyr/src/zephyr_net_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ void wifi_nrf_if_init_zep(struct net_if *iface)
struct wifi_nrf_ctx_zep *rpu_ctx_zep = NULL;
struct wifi_nrf_fmac_dev_ctx *fmac_dev_ctx = NULL;
bool fmac_dev_added = false;
struct ethernet_context *eth_ctx = net_if_l2_data(iface);

if (!iface) {
LOG_ERR("%s: Invalid parameters\n",
Expand Down Expand Up @@ -369,6 +370,7 @@ void wifi_nrf_if_init_zep(struct net_if *iface)
}
}

eth_ctx->eth_if_type = L2_ETH_IF_TYPE_WIFI;
ethernet_init(iface);
net_eth_carrier_on(iface);
net_if_dormant_on(iface);
Expand Down
2 changes: 1 addition & 1 deletion drivers/wifi/nrf700x/zephyr/src/zephyr_wifi_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void wifi_nrf_scan_timeout_work(struct k_work *work)
vif_ctx_zep->scan_in_progress = false;
}

int wifi_nrf_disp_scan_zep(const struct device *dev,
int wifi_nrf_disp_scan_zep(const struct device *dev, struct wifi_scan_params *params,
scan_result_cb_t cb)
{
enum wifi_nrf_status status = WIFI_NRF_STATUS_FAIL;
Expand Down
4 changes: 2 additions & 2 deletions west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ manifest:
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html
- name: zephyr
repo-path: sdk-zephyr
revision: 743f99947369088ecba6820a720ede8054893866
revision: 52222dc79450304fe4a32e5e0e77b9a460a93a86
import:
# In addition to the zephyr repository itself, NCS also
# imports the contents of zephyr/west.yml at the above
Expand Down Expand Up @@ -110,7 +110,7 @@ manifest:
- name: hostap
repo-path: sdk-hostap
path: modules/lib/hostap
revision: 2040db89deb39ab164827799a2090caf2bd9c4ec
revision: 8e2e758b0296e0f6e8a2261884dca15da37d96a8
userdata:
ncs:
upstream-url: https://w1.fi/cgit/hostap/
Expand Down