p2p->pd_retries--;
p2p_retry_pd(p2p);
} else {
+ if (p2p->cfg->prov_disc_fail)
+ p2p->cfg->prov_disc_fail(p2p->cfg->cb_ctx,
+ p2p->pending_pd_devaddr,
+ P2P_PROV_DISC_TIMEOUT);
p2p_reset_pending_pd(p2p);
}
}
struct wpabuf *wps_vendor_ext[P2P_MAX_WPS_VENDOR_EXT];
};
+enum p2p_prov_disc_status {
+ P2P_PROV_DISC_SUCCESS,
+ P2P_PROV_DISC_TIMEOUT,
+ P2P_PROV_DISC_REJECTED,
+};
+
/**
* struct p2p_config - P2P configuration
*
*/
void (*prov_disc_resp)(void *ctx, const u8 *peer, u16 config_methods);
+ /**
+ * prov_disc_fail - Callback on Provision Discovery failure
+ * @ctx: Callback context from cb_ctx
+ * @peer: Source address of the response
+ * @status: Cause of failure, will not be %P2P_PROV_DISC_SUCCESS
+ *
+ * This callback is used to indicate either a failure or no response
+ * to an earlier provision discovery request.
+ *
+ * This callback handler can be set to %NULL if provision discovery
+ * is not used or failures do not need to be indicated.
+ */
+ void (*prov_disc_fail)(void *ctx, const u8 *peer,
+ enum p2p_prov_disc_status status);
+
/**
* invitation_process - Optional callback for processing Invitations
* @ctx: Callback context from cb_ctx
if (msg.wps_config_methods != dev->req_config_methods) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Peer rejected "
"our Provisioning Discovery Request");
+ if (p2p->cfg->prov_disc_fail)
+ p2p->cfg->prov_disc_fail(p2p->cfg->cb_ctx, sa,
+ P2P_PROV_DISC_REJECTED);
p2p_parse_free(&msg);
goto out;
}