Add no_cck parameter for send_action() driver_ops
This can be used to apply the no-CCK rule conditionally depending on which frame is being sent. The no-CCK rule applies only for P2P management frames while SA Query and FT use cases do not have similar restrictions. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
970fa12ea2
commit
b106173a82
10 changed files with 42 additions and 26 deletions
|
@ -352,12 +352,13 @@ static inline int wpa_drv_send_action(struct wpa_supplicant *wpa_s,
|
|||
unsigned int wait,
|
||||
const u8 *dst, const u8 *src,
|
||||
const u8 *bssid,
|
||||
const u8 *data, size_t data_len)
|
||||
const u8 *data, size_t data_len,
|
||||
int no_cck)
|
||||
{
|
||||
if (wpa_s->driver->send_action)
|
||||
return wpa_s->driver->send_action(wpa_s->drv_priv, freq,
|
||||
wait, dst, src, bssid,
|
||||
data, data_len);
|
||||
data, data_len, no_cck);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ static int gas_query_tx(struct gas_query *gas, struct gas_query_pending *query,
|
|||
res = offchannel_send_action(gas->wpa_s, query->freq, query->addr,
|
||||
gas->wpa_s->own_addr, query->addr,
|
||||
wpabuf_head(req), wpabuf_len(req), 1000,
|
||||
NULL);
|
||||
NULL, 0);
|
||||
if (res == 0)
|
||||
query->offchannel_tx_started = 1;
|
||||
return res;
|
||||
|
|
|
@ -120,7 +120,8 @@ static void wpas_send_action_cb(void *eloop_ctx, void *timeout_ctx)
|
|||
wpa_s->pending_action_src,
|
||||
wpa_s->pending_action_bssid,
|
||||
wpabuf_head(wpa_s->pending_action_tx),
|
||||
wpabuf_len(wpa_s->pending_action_tx));
|
||||
wpabuf_len(wpa_s->pending_action_tx),
|
||||
wpa_s->pending_action_no_cck);
|
||||
if (res) {
|
||||
wpa_printf(MSG_DEBUG, "Off-channel: Failed to send the "
|
||||
"pending Action frame");
|
||||
|
@ -177,7 +178,8 @@ int offchannel_send_action(struct wpa_supplicant *wpa_s, unsigned int freq,
|
|||
const u8 *src, const u8 *bssid,
|
||||
const u8 *data, size_t data_len,
|
||||
enum offchannel_send_action_result
|
||||
result))
|
||||
result),
|
||||
int no_cck)
|
||||
{
|
||||
wpa_printf(MSG_DEBUG, "Off-channel: Send action frame: freq=%d dst="
|
||||
MACSTR " src=" MACSTR " bssid=" MACSTR " len=%d",
|
||||
|
@ -204,6 +206,7 @@ int offchannel_send_action(struct wpa_supplicant *wpa_s, unsigned int freq,
|
|||
os_memcpy(wpa_s->pending_action_dst, dst, ETH_ALEN);
|
||||
os_memcpy(wpa_s->pending_action_bssid, bssid, ETH_ALEN);
|
||||
wpa_s->pending_action_freq = freq;
|
||||
wpa_s->pending_action_no_cck = no_cck;
|
||||
|
||||
if (freq != 0 && wpa_s->drv_flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) {
|
||||
struct wpa_supplicant *iface;
|
||||
|
@ -212,12 +215,13 @@ int offchannel_send_action(struct wpa_supplicant *wpa_s, unsigned int freq,
|
|||
wpa_s->pending_action_src);
|
||||
wpa_s->action_tx_wait_time = wait_time;
|
||||
|
||||
return wpa_drv_send_action(iface, wpa_s->pending_action_freq,
|
||||
wait_time, wpa_s->pending_action_dst,
|
||||
wpa_s->pending_action_src,
|
||||
wpa_s->pending_action_bssid,
|
||||
wpabuf_head(wpa_s->pending_action_tx),
|
||||
wpabuf_len(wpa_s->pending_action_tx));
|
||||
return wpa_drv_send_action(
|
||||
iface, wpa_s->pending_action_freq,
|
||||
wait_time, wpa_s->pending_action_dst,
|
||||
wpa_s->pending_action_src, wpa_s->pending_action_bssid,
|
||||
wpabuf_head(wpa_s->pending_action_tx),
|
||||
wpabuf_len(wpa_s->pending_action_tx),
|
||||
wpa_s->pending_action_no_cck);
|
||||
}
|
||||
|
||||
if (freq) {
|
||||
|
|
|
@ -24,7 +24,8 @@ int offchannel_send_action(struct wpa_supplicant *wpa_s, unsigned int freq,
|
|||
const u8 *src, const u8 *bssid,
|
||||
const u8 *data, size_t data_len,
|
||||
enum offchannel_send_action_result
|
||||
result));
|
||||
result),
|
||||
int no_cck);
|
||||
void offchannel_send_action_done(struct wpa_supplicant *wpa_s);
|
||||
void offchannel_remain_on_channel_cb(struct wpa_supplicant *wpa_s,
|
||||
unsigned int freq, unsigned int duration);
|
||||
|
|
|
@ -593,7 +593,7 @@ static int wpas_send_action(void *ctx, unsigned int freq, const u8 *dst,
|
|||
struct wpa_supplicant *wpa_s = ctx;
|
||||
return offchannel_send_action(wpa_s, freq, dst, src, bssid, buf, len,
|
||||
wait_time,
|
||||
wpas_p2p_send_action_tx_status);
|
||||
wpas_p2p_send_action_tx_status, 1);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -647,7 +647,7 @@ static void sme_send_sa_query_req(struct wpa_supplicant *wpa_s,
|
|||
os_memcpy(req + 2, trans_id, WLAN_SA_QUERY_TR_ID_LEN);
|
||||
if (wpa_drv_send_action(wpa_s, wpa_s->assoc_freq, 0, wpa_s->bssid,
|
||||
wpa_s->own_addr, wpa_s->bssid,
|
||||
req, sizeof(req)) < 0)
|
||||
req, sizeof(req), 0) < 0)
|
||||
wpa_msg(wpa_s, MSG_INFO, "SME: Failed to send SA Query "
|
||||
"Request");
|
||||
}
|
||||
|
|
|
@ -406,6 +406,7 @@ struct wpa_supplicant {
|
|||
u8 pending_action_dst[ETH_ALEN];
|
||||
u8 pending_action_bssid[ETH_ALEN];
|
||||
unsigned int pending_action_freq;
|
||||
int pending_action_no_cck;
|
||||
int pending_action_without_roc;
|
||||
void (*pending_action_tx_status_cb)(struct wpa_supplicant *wpa_s,
|
||||
unsigned int freq, const u8 *dst,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue