Parcourir la source

Fix build without CONFIG_P2P=y

Jouni Malinen il y a 14 ans
Parent
commit
812bf56ab1
3 fichiers modifiés avec 8 ajouts et 2 suppressions
  1. 3 2
      src/ap/p2p_hostapd.h
  2. 1 0
      wpa_supplicant/p2p_supplicant.h
  3. 4 0
      wpa_supplicant/wps_supplicant.c

+ 3 - 2
src/ap/p2p_hostapd.h

@@ -27,8 +27,9 @@ void hostapd_p2p_non_p2p_sta_disconnected(struct hostapd_data *hapd);
 
 #else /* CONFIG_P2P */
 
-int hostapd_p2p_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
-			    char *buf, size_t buflen)
+static inline int hostapd_p2p_get_mib_sta(struct hostapd_data *hapd,
+					  struct sta_info *sta,
+					  char *buf, size_t buflen)
 {
 	return 0;
 }

+ 1 - 0
wpa_supplicant/p2p_supplicant.h

@@ -16,6 +16,7 @@
 #define P2P_SUPPLICANT_H
 
 enum p2p_wps_method;
+struct p2p_go_neg_results;
 
 int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s);
 void wpas_p2p_deinit(struct wpa_supplicant *wpa_s);

+ 4 - 0
wpa_supplicant/wps_supplicant.c

@@ -692,6 +692,7 @@ int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid,
 		return -1;
 	ssid->temporary = 1;
 	ssid->p2p_group = p2p_group;
+#ifdef CONFIG_P2P
 	if (p2p_group && wpa_s->go_params && wpa_s->go_params->ssid_len) {
 		ssid->ssid = os_zalloc(wpa_s->go_params->ssid_len + 1);
 		if (ssid->ssid) {
@@ -702,6 +703,7 @@ int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid,
 					  "SSID", ssid->ssid, ssid->ssid_len);
 		}
 	}
+#endif /* CONFIG_P2P */
 	wpa_config_set(ssid, "phase1", "\"pbc=1\"", 0);
 	if (wpa_s->wps_fragment_size)
 		ssid->eap.fragment_size = wpa_s->wps_fragment_size;
@@ -725,6 +727,7 @@ int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
 		return -1;
 	ssid->temporary = 1;
 	ssid->p2p_group = p2p_group;
+#ifdef CONFIG_P2P
 	if (p2p_group && wpa_s->go_params && wpa_s->go_params->ssid_len) {
 		ssid->ssid = os_zalloc(wpa_s->go_params->ssid_len + 1);
 		if (ssid->ssid) {
@@ -735,6 +738,7 @@ int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
 					  "SSID", ssid->ssid, ssid->ssid_len);
 		}
 	}
+#endif /* CONFIG_P2P */
 	if (pin)
 		os_snprintf(val, sizeof(val), "\"pin=%s dev_pw_id=%u\"",
 			    pin, dev_pw_id);