Make channel_info available to the supplicant state machine

This adds the necessary functions and callbacks to make the channel_info
driver API available to the supplicant state machine that implements the
4-way and group key handshake. This is needed for OCV.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
This commit is contained in:
Mathy Vanhoef 2018-08-06 15:46:20 -04:00 committed by Jouni Malinen
parent 7f00dc6e15
commit 4b62b52e5e
3 changed files with 20 additions and 0 deletions

View file

@ -18,6 +18,7 @@ struct wpa_sm;
struct eapol_sm;
struct wpa_config_blob;
struct hostapd_freq_params;
struct wpa_channel_info;
struct wpa_sm_ctx {
void *ctx; /* pointer to arbitrary upper level context */
@ -82,6 +83,7 @@ struct wpa_sm_ctx {
int (*key_mgmt_set_pmk)(void *ctx, const u8 *pmk, size_t pmk_len);
void (*fils_hlp_rx)(void *ctx, const u8 *dst, const u8 *src,
const u8 *pkt, size_t pkt_len);
int (*channel_info)(void *ctx, struct wpa_channel_info *ci);
};

View file

@ -395,6 +395,14 @@ static inline void wpa_sm_fils_hlp_rx(struct wpa_sm *sm,
sm->ctx->fils_hlp_rx(sm->ctx->ctx, dst, src, pkt, pkt_len);
}
static inline int wpa_sm_channel_info(struct wpa_sm *sm,
struct wpa_channel_info *ci)
{
if (!sm->ctx->channel_info)
return -1;
return sm->ctx->channel_info(sm->ctx->ctx, ci);
}
int wpa_eapol_key_send(struct wpa_sm *sm, struct wpa_ptk *ptk,
int ver, const u8 *dest, u16 proto,