Skip to content
Open
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
53 changes: 53 additions & 0 deletions src/drivers/driver_zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,15 @@ static int wpa_drv_mgmt_subscribe_non_ap(struct zep_drv_if_ctx *if_ctx)
if (wpa_drv_register_action_frame(if_ctx, (u8 *)"\x05\x00", 2) < 0)
ret = -1;

#ifdef CONFIG_P2P
/* P2P Public Action */
if (wpa_drv_register_action_frame(if_ctx, (u8 *) "\x04\x09\x50\x6f\x9a\x09", 6) < 0)
ret = -1;
/* P2P Action */
if (wpa_drv_register_action_frame(if_ctx, (u8 *) "\x7f\x50\x6f\x9a\x09", 5) < 0)
ret = -1;
#endif /* CONFIG_P2P */

return ret;
}

Expand Down Expand Up @@ -1014,6 +1023,25 @@ static void wpa_drv_zep_event_signal_change(struct zep_drv_if_ctx *if_ctx,
wpa_supplicant_event_wrapper(if_ctx->supp_if_ctx, EVENT_SIGNAL_CHANGE, event);
}

static void wpa_drv_zep_event_roc_complete(struct zep_drv_if_ctx *if_ctx,
int freq, unsigned int duration)
{
union wpa_event_data event;
os_memset(&event, 0, sizeof(event));
event.remain_on_channel.freq = freq;
event.remain_on_channel.duration = duration;
wpa_supplicant_event_wrapper(if_ctx->supp_if_ctx, EVENT_REMAIN_ON_CHANNEL, &event);
}

static void wpa_drv_zep_event_roc_cancel_complete(struct zep_drv_if_ctx *if_ctx,
int freq)
{
union wpa_event_data event;
os_memset(&event, 0, sizeof(event));
event.remain_on_channel.freq = freq;
wpa_supplicant_event_wrapper(if_ctx->supp_if_ctx, EVENT_CANCEL_REMAIN_ON_CHANNEL, &event);
}

static struct hostapd_hw_modes *
wpa_driver_wpa_supp_postprocess_modes(struct hostapd_hw_modes *modes,
u16 *num_modes)
Expand Down Expand Up @@ -1247,6 +1275,8 @@ static void *wpa_drv_zep_init(void *ctx,
callbk_fns.mac_changed = wpa_drv_zep_event_mac_changed;
callbk_fns.ecsa_complete = wpa_drv_zep_event_ecsa_complete;
callbk_fns.signal_change = wpa_drv_zep_event_signal_change;
callbk_fns.roc_complete = wpa_drv_zep_event_roc_complete;
callbk_fns.roc_cancel_complete = wpa_drv_zep_event_roc_cancel_complete;

if_ctx->dev_priv = dev_ops->init(if_ctx,
ifname,
Expand Down Expand Up @@ -2735,6 +2765,28 @@ int wpa_drv_zep_cancel_remain_on_channel(void *priv)
return ret;
}

int wpa_drv_zep_probe_req_report(void *priv, int report)
{
struct zep_drv_if_ctx *if_ctx = NULL;
int ret = -1;

if (!priv) {
wpa_printf(MSG_ERROR, "%s: Invalid handle", __func__);
goto out;
}

if_ctx = priv;
ret = wpa_drv_register_frame(priv, WLAN_FC_STYPE_PROBE_REQ << 4,
NULL, 0, 0);
if (ret) {
wpa_printf(MSG_ERROR, "%s: register probe req report failed", __func__);
goto out;
}

out:
return ret;
}

void wpa_drv_zep_send_action_cancel_wait(void *priv)
{
struct zep_drv_if_ctx *if_ctx = NULL;
Expand Down Expand Up @@ -2807,5 +2859,6 @@ const struct wpa_driver_ops wpa_driver_zep_ops = {
.dpp_listen = wpa_drv_zep_dpp_listen,
.remain_on_channel = wpa_drv_zep_remain_on_channel,
.cancel_remain_on_channel = wpa_drv_zep_cancel_remain_on_channel,
.probe_req_report = wpa_drv_zep_probe_req_report,
.send_action_cancel_wait = wpa_drv_zep_send_action_cancel_wait,
};
6 changes: 6 additions & 0 deletions src/drivers/driver_zephyr.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ struct zep_wpa_supp_dev_callbk_fns {

void (*signal_change)(struct zep_drv_if_ctx *if_ctx,
union wpa_event_data *event);

void (*roc_complete)(struct zep_drv_if_ctx *if_ctx,
int freq, unsigned int duration);

void (*roc_cancel_complete)(struct zep_drv_if_ctx *if_ctx,
int freq);
};

struct zep_hostapd_dev_callbk_fns
Expand Down
14 changes: 7 additions & 7 deletions src/utils/includes.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@

#if defined(__ZEPHYR__)
#include <strings.h>
#if defined(CONFIG_POSIX_SYSTEM_INTERFACES)
#include <arpa/inet.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <unistd.h>
#else /* defined(CONFIG_POSIX_SYSTEM_INTERFACES) */
#if defined(CONFIG_POSIX_API)
#include <zephyr/posix/arpa/inet.h>
#include <zephyr/posix/sys/select.h>
#include <zephyr/posix/sys/socket.h>
#include <zephyr/posix/unistd.h>
#else /* defined(CONFIG_POSIX_API) */
#include <zephyr/net/socket.h>
#include <zephyr/net/socket_select.h>
#include <zephyr/net/net_ip.h>
#endif /* defined(CONFIG_POSIX_SYSTEM_INTERFACES) */
#endif /* defined(CONFIG_POSIX_API) */
#include <zephyr/shell/shell.h>

#define signal(a, b) (void)(b)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/os_zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

#include <time.h>
#include <sys/time.h>

#include <zephyr/posix/sys/time.h>
#include <zephyr/random/random.h>

#include "includes.h"
Expand Down