Accumulative patch from commit 6d28fb9627155929012cda944aacd5a52ce7051a

nl80211: Fetch assoc_freq from scan table for connect event
nl80211: Filter out duplicated BSS table entries from scan results
Update BSS table entry if roaming event indicates frequency change
WPS: Remove obsolete note about lack for WPS ER support
P2P: Include operating class 124 (channels 149,153,157,161)
Include nl80211 driver wrapper in default configuration for hostapd
Better messages when channel cannot be used in AP mode
WPS: Add a workaround for Windows 7 capability discovery for PBC
WPS UPnP: Fix UPnP initialization for non-bridge case with some drivers
Fix regression in RSN pre-authentication candidate list generation
  commit 6d28fb9627155929012cda944aacd5a52ce7051a

Change-Id: I3c68dad5fe323b1d86aa585c564a75e4fc1a2ea1
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 11c8bf0..835f050 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2021,6 +2021,8 @@
 		} else if (os_strcmp(buf, "upc") == 0) {
 			os_free(bss->upc);
 			bss->upc = os_strdup(pos);
+		} else if (os_strcmp(buf, "pbc_in_m1") == 0) {
+			bss->pbc_in_m1 = atoi(pos);
 #endif /* CONFIG_WPS */
 #ifdef CONFIG_P2P_MANAGER
 		} else if (os_strcmp(buf, "manage_p2p") == 0) {
diff --git a/hostapd/defconfig b/hostapd/defconfig
index b52e510..38d3284 100644
--- a/hostapd/defconfig
+++ b/hostapd/defconfig
@@ -20,7 +20,7 @@
 #CFLAGS += -I../../madwifi # change to the madwifi source directory
 
 # Driver interface for drivers using the nl80211 kernel interface
-#CONFIG_DRIVER_NL80211=y
+CONFIG_DRIVER_NL80211=y
 
 # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
 #CONFIG_DRIVER_BSD=y
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index 6d7263a..e0525e4 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -921,6 +921,18 @@
 #	virtual_push_button physical_push_button
 #config_methods=label virtual_display virtual_push_button keypad
 
+# WPS capability discovery workaround for PBC with Windows 7
+# Windows 7 uses incorrect way of figuring out AP's WPS capabilities by acting
+# as a Registrar and using M1 from the AP. The config methods attribute in that
+# message is supposed to indicate only the configuration method supported by
+# the AP in Enrollee role, i.e., to add an external Registrar. For that case,
+# PBC shall not be used and as such, the PushButton config method is removed
+# from M1 by default. If pbc_in_m1=1 is included in the configuration file,
+# the PushButton config method is left in M1 (if included in config_methods
+# parameter) to allow Windows 7 to use PBC instead of PIN (e.g., from a label
+# in the AP).
+#pbc_in_m1=1
+
 # Static access point PIN for initial configuration and adding Registrars
 # If not set, hostapd will not allow external WPS Registrars to control the
 # access point. The AP PIN can also be set at runtime with hostapd_cli