* Returns: 0 on success, -1 on failure
*
* If the scan result is for a GO, the clients in the group will also be added
- * to the peer table.
+ * to the peer table. This function can also be used with some other frames
+ * like Provision Discovery Request that contains P2P Capability and P2P Device
+ * Info attributes.
*/
-static int p2p_add_device(struct p2p_data *p2p, const u8 *addr, int freq,
- int level, const u8 *ies, size_t ies_len)
+int p2p_add_device(struct p2p_data *p2p, const u8 *addr, int freq, int level,
+ const u8 *ies, size_t ies_len)
{
struct p2p_device *dev;
struct p2p_message msg;
int p2p_get_oper_freq(struct p2p_data *p2p, const u8 *iface_addr);
+int p2p_add_device(struct p2p_data *p2p, const u8 *addr, int freq, int level,
+ const u8 *ies, size_t ies_len);
+
#endif /* P2P_H */
MAC2STR(sa), msg.wps_config_methods, rx_freq);
dev = p2p_get_device(p2p, sa);
- if (dev == NULL) {
+ if (dev == NULL || !(dev->flags & P2P_DEV_PROBE_REQ_ONLY)) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
"P2P: Provision Discovery Request from "
"unknown peer " MACSTR, MAC2STR(sa));
+ if (p2p_add_device(p2p, sa, rx_freq, 0, data + 1, len - 1)) {
+ wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
+ "P2P: Provision Discovery Request add device "
+ "failed " MACSTR, MAC2STR(sa));
+ }
}
if (!(msg.wps_config_methods &