P2P: Skip duplicated provision discovery on join
If p2p_prov_disc join command is used prior to p2p_connect join, skip the duplicated provision discovery exchange. Signed-hostap: Jithu Jance <jithu@broadcom.com>
This commit is contained in:
parent
8c5f730983
commit
ec437d9e74
5 changed files with 98 additions and 0 deletions
|
@ -114,6 +114,34 @@ static const char * p2p_state_txt(int state)
|
|||
}
|
||||
|
||||
|
||||
u16 p2p_get_provisioning_info(struct p2p_data *p2p, const u8 *addr)
|
||||
{
|
||||
struct p2p_device *dev = NULL;
|
||||
|
||||
if (!addr || !p2p)
|
||||
return 0;
|
||||
|
||||
dev = p2p_get_device(p2p, addr);
|
||||
if (dev)
|
||||
return dev->wps_prov_info;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void p2p_clear_provisioning_info(struct p2p_data *p2p, const u8 *iface_addr)
|
||||
{
|
||||
struct p2p_device *dev = NULL;
|
||||
|
||||
if (!iface_addr || !p2p)
|
||||
return;
|
||||
|
||||
dev = p2p_get_device_interface(p2p, iface_addr);
|
||||
if (dev)
|
||||
dev->wps_prov_info = 0;
|
||||
}
|
||||
|
||||
|
||||
void p2p_set_state(struct p2p_data *p2p, int new_state)
|
||||
{
|
||||
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: State %s -> %s",
|
||||
|
|
|
@ -1035,6 +1035,28 @@ void p2p_wps_success_cb(struct p2p_data *p2p, const u8 *mac_addr);
|
|||
*/
|
||||
void p2p_group_formation_failed(struct p2p_data *p2p);
|
||||
|
||||
/**
|
||||
* p2p_get_provisioning_info - Get any stored provisioning info
|
||||
* @p2p: P2P module context from p2p_init()
|
||||
* @addr: Peer P2P Device Address
|
||||
* Returns: WPS provisioning information (WPS config method) or 0 if no
|
||||
* information is available
|
||||
*
|
||||
* This function is used to retrieve stored WPS provisioning info for the given
|
||||
* peer.
|
||||
*/
|
||||
u16 p2p_get_provisioning_info(struct p2p_data *p2p, const u8 *addr);
|
||||
|
||||
/**
|
||||
* p2p_clear_provisioning_info - Clear any stored provisioning info
|
||||
* @p2p: P2P module context from p2p_init()
|
||||
* @iface_addr: Peer P2P Interface Address
|
||||
*
|
||||
* This function is used to clear stored WPS provisioning info for the given
|
||||
* peer.
|
||||
*/
|
||||
void p2p_clear_provisioning_info(struct p2p_data *p2p, const u8 *iface_addr);
|
||||
|
||||
|
||||
/* Event notifications from lower layer driver operations */
|
||||
|
||||
|
|
|
@ -73,6 +73,14 @@ struct p2p_device {
|
|||
*/
|
||||
u16 req_config_methods;
|
||||
|
||||
/**
|
||||
* wps_prov_info - Stored provisioning WPS config method
|
||||
*
|
||||
* This is used to store pending WPS config method between Provisioning
|
||||
* Discovery and connection to a running group.
|
||||
*/
|
||||
u16 wps_prov_info;
|
||||
|
||||
#define P2P_DEV_PROBE_REQ_ONLY BIT(0)
|
||||
#define P2P_DEV_REPORTED BIT(1)
|
||||
#define P2P_DEV_NOT_YET_READY BIT(2)
|
||||
|
|
|
@ -267,6 +267,10 @@ void p2p_process_prov_disc_resp(struct p2p_data *p2p, const u8 *sa,
|
|||
MAC2STR(sa));
|
||||
dev->flags |= P2P_DEV_PD_PEER_KEYPAD;
|
||||
}
|
||||
|
||||
/* Store the provisioning info */
|
||||
dev->wps_prov_info = msg.wps_config_methods;
|
||||
|
||||
p2p_parse_free(&msg);
|
||||
|
||||
out:
|
||||
|
@ -352,6 +356,9 @@ int p2p_prov_disc_req(struct p2p_data *p2p, const u8 *peer_addr,
|
|||
if (config_methods == 0)
|
||||
return -1;
|
||||
|
||||
/* Reset provisioning info */
|
||||
dev->wps_prov_info = 0;
|
||||
|
||||
dev->req_config_methods = config_methods;
|
||||
if (join)
|
||||
dev->flags |= P2P_DEV_PD_FOR_JOIN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue