
The TX event for the next frame in the sequence might be received before the TX status for the final GAS response frame is processed. This used to result in the Config Result getting discarded and the negotiation not completing successfully on the Configurator side. Accept the Config Result message as an indication of the final GAS response frame having went through fine even if the TX status has not yet been processed to avoid this issue from a potential race condition on kernel events. Signed-off-by: Jouni Malinen <j@w1.fi>
49 lines
1.4 KiB
C
49 lines
1.4 KiB
C
/*
|
|
* Generic advertisement service (GAS) server
|
|
* Copyright (c) 2017, Qualcomm Atheros, Inc.
|
|
* Copyright (c) 2020, The Linux Foundation
|
|
*
|
|
* This software may be distributed under the terms of the BSD license.
|
|
* See README for more details.
|
|
*/
|
|
|
|
#ifndef GAS_SERVER_H
|
|
#define GAS_SERVER_H
|
|
|
|
#ifdef CONFIG_GAS_SERVER
|
|
|
|
struct gas_server;
|
|
|
|
struct gas_server * gas_server_init(void *ctx,
|
|
void (*tx)(void *ctx, int freq,
|
|
const u8 *da,
|
|
struct wpabuf *buf,
|
|
unsigned int wait_time));
|
|
void gas_server_deinit(struct gas_server *gas);
|
|
int gas_server_register(struct gas_server *gas,
|
|
const u8 *adv_proto_id, u8 adv_proto_id_len,
|
|
struct wpabuf *
|
|
(*req_cb)(void *ctx, void *resp_ctx, const u8 *sa,
|
|
const u8 *query, size_t query_len,
|
|
u16 *comeback_delay),
|
|
void (*status_cb)(void *ctx, struct wpabuf *resp,
|
|
int ok),
|
|
void *ctx);
|
|
int gas_server_rx(struct gas_server *gas, const u8 *da, const u8 *sa,
|
|
const u8 *bssid, u8 categ, const u8 *data, size_t len,
|
|
int freq);
|
|
void gas_server_tx_status(struct gas_server *gas, const u8 *dst, const u8 *data,
|
|
size_t data_len, int ack);
|
|
int gas_server_set_resp(struct gas_server *gas, void *resp_ctx,
|
|
struct wpabuf *resp);
|
|
bool gas_server_response_sent(struct gas_server *gas, void *resp_ctx);
|
|
|
|
#else /* CONFIG_GAS_SERVER */
|
|
|
|
static inline void gas_server_deinit(struct gas_server *gas)
|
|
{
|
|
}
|
|
|
|
#endif /* CONFIG_GAS_SERVER */
|
|
|
|
#endif /* GAS_SERVER_H */
|