wpa_supplicant: P2P-related fixes

- Remove unused function warning in WPS-NFC case
- P2P: Fix p2p_ctrl_invite_persistent to parse peer parameter
- hostapd: Fix CONFIG_INTERWORKING=y build without CONFIG_HS20=y
- hostapd: Fix WDS VLAN bridge handling
- hostapd: Send EAPOL frames from the VO queue if WMM is active
- P2P: Remove channel 14 from supported P2P channels
- hostapd: Clear WLAN_STA_ASSOC_REQ_OK if sending the assoc response failed
- hostapd: Add check for the wds sta flag before creating 4addr VLANs
- nl80211: Use the monitor interface if socket tx status is not supported
- wpa_supplicant: Set state to DISCONNECTED on AP creation errors
- P2P: Fix p2p_group_idle in no-group-interface P2P client case
- P2P: Fix PSK configuration for GO network
- Print control interface commands in easier format
- Add debug print for no enabled networks case
- P2P: Add more debug prints for GO start routines
- P2P: Fix pending sta scan processing for concurrent operation cases

BUG: 6940646
Change-Id: I1b1c54a08c61ec4af2bfd2274afc93501004eea2

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/src/ap/gas_serv.c b/src/ap/gas_serv.c
index 53e6cbb..851c183 100644
--- a/src/ap/gas_serv.c
+++ b/src/ap/gas_serv.c
@@ -128,6 +128,7 @@
 }
 
 
+#ifdef CONFIG_HS20
 static void anqp_add_hs_capab_list(struct hostapd_data *hapd,
 				   struct wpabuf *buf)
 {
@@ -151,6 +152,7 @@
 		wpabuf_put_u8(buf, HS20_STYPE_OPERATING_CLASS);
 	gas_anqp_set_element_len(buf, len);
 }
+#endif /* CONFIG_HS20 */
 
 
 static void anqp_add_capab_list(struct hostapd_data *hapd,
@@ -174,7 +176,9 @@
 		wpabuf_put_le16(buf, ANQP_3GPP_CELLULAR_NETWORK);
 	if (hapd->conf->domain_name)
 		wpabuf_put_le16(buf, ANQP_DOMAIN_NAME);
+#ifdef CONFIG_HS20
 	anqp_add_hs_capab_list(hapd, buf);
+#endif /* CONFIG_HS20 */
 	gas_anqp_set_element_len(buf, len);
 }
 
@@ -429,6 +433,8 @@
 }
 
 
+#ifdef CONFIG_HS20
+
 static void anqp_add_operator_friendly_name(struct hostapd_data *hapd,
 					    struct wpabuf *buf)
 {
@@ -499,6 +505,8 @@
 	}
 }
 
+#endif /* CONFIG_HS20 */
+
 
 static struct wpabuf *
 gas_serv_build_gas_resp_payload(struct hostapd_data *hapd,
@@ -531,6 +539,7 @@
 	if (request & ANQP_REQ_DOMAIN_NAME)
 		anqp_add_domain_name(hapd, buf);
 
+#ifdef CONFIG_HS20
 	if (request & ANQP_REQ_HS_CAPABILITY_LIST)
 		anqp_add_hs_capab_list(hapd, buf);
 	if (request & ANQP_REQ_OPERATOR_FRIENDLY_NAME)
@@ -541,6 +550,7 @@
 		anqp_add_connection_capability(hapd, buf);
 	if (request & ANQP_REQ_OPERATING_CLASS)
 		anqp_add_operating_class(hapd, buf);
+#endif /* CONFIG_HS20 */
 
 	return buf;
 }
@@ -649,6 +659,8 @@
 }
 
 
+#ifdef CONFIG_HS20
+
 static void rx_anqp_hs_query_list(struct hostapd_data *hapd, u8 subtype,
 				  struct anqp_query_info *qi)
 {
@@ -755,6 +767,8 @@
 	}
 }
 
+#endif /* CONFIG_HS20 */
+
 
 static void gas_serv_req_local_processing(struct hostapd_data *hapd,
 					  const u8 *sa, u8 dialog_token,
@@ -899,9 +913,11 @@
 		case ANQP_QUERY_LIST:
 			rx_anqp_query_list(hapd, pos, pos + elen, &qi);
 			break;
+#ifdef CONFIG_HS20
 		case ANQP_VENDOR_SPECIFIC:
 			rx_anqp_vendor_specific(hapd, pos, pos + elen, &qi);
 			break;
+#endif /* CONFIG_HS20 */
 		default:
 			wpa_printf(MSG_DEBUG, "ANQP: Unsupported Query "
 				   "Request element %u", info_id);
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 211ee1b..ce20e5f 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -1506,13 +1506,6 @@
 	int new_assoc = 1;
 	struct ieee80211_ht_capabilities ht_cap;
 
-	if (!ok) {
-		hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
-			       HOSTAPD_LEVEL_DEBUG,
-			       "did not acknowledge association response");
-		return;
-	}
-
 	if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_resp) :
 				      sizeof(mgmt->u.assoc_resp))) {
 		printf("handle_assoc_cb(reassoc=%d) - too short payload "
@@ -1520,11 +1513,6 @@
 		return;
 	}
 
-	if (reassoc)
-		status = le_to_host16(mgmt->u.reassoc_resp.status_code);
-	else
-		status = le_to_host16(mgmt->u.assoc_resp.status_code);
-
 	sta = ap_get_sta(hapd, mgmt->da);
 	if (!sta) {
 		printf("handle_assoc_cb: STA " MACSTR " not found\n",
@@ -1532,6 +1520,19 @@
 		return;
 	}
 
+	if (!ok) {
+		hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
+			       HOSTAPD_LEVEL_DEBUG,
+			       "did not acknowledge association response");
+		sta->flags &= ~WLAN_STA_ASSOC_REQ_OK;
+		return;
+	}
+
+	if (reassoc)
+		status = le_to_host16(mgmt->u.reassoc_resp.status_code);
+	else
+		status = le_to_host16(mgmt->u.assoc_resp.status_code);
+
 	if (status != WLAN_STATUS_SUCCESS)
 		goto fail;
 
@@ -1830,6 +1831,9 @@
 
 	sta = ap_get_sta(hapd, src);
 	if (sta && (sta->flags & WLAN_STA_ASSOC)) {
+		if (!hapd->conf->wds_sta)
+			return;
+
 		if (wds && !(sta->flags & WLAN_STA_WDS)) {
 			wpa_printf(MSG_DEBUG, "Enable 4-address WDS mode for "
 				   "STA " MACSTR " (aid %u)",