/bin/wifi:  Update provisioning vendor IE feature IDs.

We don't need to separate these by band if the provisioning network AP
includes the IE in its management frames, rather than the same
device's WLAN AP doing so.  We also don't need separate flags for them
at all this way, since we already have the ssid from --ssid, and can
enable the IE whenever --hidden_mode is enabled.

Also, Jetstream got ID 2 while the initial implementation of this was
in flight; we reserve 3 in cl/120365499.

Change-Id: I22794ecde9c3a8ee4d8cfb2a2b8da3b1a5bea5e6
diff --git a/wifi/configs.py b/wifi/configs.py
index 0d4c642..676182a 100644
--- a/wifi/configs.py
+++ b/wifi/configs.py
@@ -28,8 +28,7 @@
 # pylint: disable=invalid-name
 class VENDOR_IE_FEATURE_ID(object):
   SUPPORTS_PROVISIONING = '01'
-  PROVISION_VIA_2G = '02'
-  PROVISION_VIA_5G = '03'
+  PROVISIONING_SSID = '03'
 
 
 # Recommended HT40/VHT80 settings for given primary channels.
@@ -389,15 +388,9 @@
     vendor_ies.append(
         create_vendor_ie(VENDOR_IE_FEATURE_ID.SUPPORTS_PROVISIONING))
 
-  if opt.provision_via_2g:
+  if opt.hidden_mode:
     vendor_ies.append(
-        create_vendor_ie(VENDOR_IE_FEATURE_ID.PROVISION_VIA_2G,
-                         opt.provision_via_2g))
-
-  if opt.provision_via_5g:
-    vendor_ies.append(
-        create_vendor_ie(VENDOR_IE_FEATURE_ID.PROVISION_VIA_5G,
-                         opt.provision_via_5g))
+        create_vendor_ie(VENDOR_IE_FEATURE_ID.PROVISIONING_SSID, opt.ssid))
 
   if vendor_ies:
     return 'vendor_elements=%s' % ''.join(vendor_ies)
diff --git a/wifi/configs_test.py b/wifi/configs_test.py
index 21a824e..ece4ca9 100755
--- a/wifi/configs_test.py
+++ b/wifi/configs_test.py
@@ -339,30 +339,6 @@
 
 """
 
-_HOSTAPD_CONFIG_SUPPORTS_PROVISIONING = """ctrl_interface=/var/run/hostapd
-interface=wlan0
-
-ssid=TEST_SSID
-utf8_ssid=1
-auth_algs=1
-hw_mode=g
-channel=1
-country_code=US
-ieee80211d=1
-ieee80211h=1
-ieee80211n=1
-
-
-
-
-
-
-vendor_elements=dd04f4f5e801
-
-ht_capab=[HT20][RX-STBC1]
-
-"""
-
 _HOSTAPD_CONFIG_PROVISION_VIA = """ctrl_interface=/var/run/hostapd
 interface=wlan0
 
@@ -379,9 +355,9 @@
 
 
 
+ignore_broadcast_ssid=1
 
-
-vendor_elements=dd19f4f5e80247466962657253657475704175746f6d6174696f6edd1af4f5e80347466962657253657475704175746f6d6174696f6e35
+vendor_elements=dd04f4f5e801dd0df4f5e803544553545f53534944
 
 ht_capab=[HT20][RX-STBC1]
 
@@ -417,8 +393,6 @@
     self.interface_suffix = ''
     self.client_isolation = False
     self.supports_provisioning = False
-    self.provision_via_2g = ''
-    self.provision_via_5g = ''
 
 
 # pylint: disable=protected-access
@@ -446,20 +420,10 @@
                   config)
   opt.bridge = default_bridge
 
-  # Test provisioning IE.
-  opt.supports_provisioning = True
-  config = configs.generate_hostapd_config(
-      _PHY_INFO, 'wlan0', '2.4', '1', '20', set(('a', 'b', 'g', 'n', 'ac')),
-      'asdfqwer', opt)
-  wvtest.WVPASSEQ('\n'.join((_HOSTAPD_CONFIG_SUPPORTS_PROVISIONING,
-                             _HOSTAPD_CONFIG_WPA,
-                             '# Experiments: ()\n')),
-                  config)
-  opt.supports_provisioning = False
-
-  # Test provision via IEs.
-  opt.provision_via_2g = 'GFiberSetupAutomation'
-  opt.provision_via_5g = 'GFiberSetupAutomation5'
+  # Test provisioning IEs.
+  default_hidden_mode, opt.hidden_mode = opt.hidden_mode, True
+  default_supports_provisioning, opt.supports_provisioning = (
+      opt.supports_provisioning, True)
   config = configs.generate_hostapd_config(
       _PHY_INFO, 'wlan0', '2.4', '1', '20', set(('a', 'b', 'g', 'n', 'ac')),
       'asdfqwer', opt)
@@ -467,8 +431,8 @@
                              _HOSTAPD_CONFIG_WPA,
                              '# Experiments: ()\n')),
                   config)
-  opt.provision_via_2g = ''
-  opt.provision_via_5g = ''
+  opt.hidden_mode = default_hidden_mode
+  opt.supports_provisioning = default_supports_provisioning
 
   # Test with no encryption.
   default_encryption, opt.encryption = opt.encryption, 'NONE'
@@ -524,8 +488,8 @@
 @wvtest.wvtest
 def create_vendor_ie_test():
   wvtest.WVPASSEQ(configs.create_vendor_ie('01'), 'dd04f4f5e801')
-  wvtest.WVPASSEQ(configs.create_vendor_ie('02', 'GFiberSetupAutomation'),
-                  'dd19f4f5e80247466962657253657475704175746f6d6174696f6e')
+  wvtest.WVPASSEQ(configs.create_vendor_ie('03', 'GFiberSetupAutomation'),
+                  'dd19f4f5e80347466962657253657475704175746f6d6174696f6e')
 
 
 if __name__ == '__main__':
diff --git a/wifi/wifi.py b/wifi/wifi.py
index 1ba7cf9..0000146 100755
--- a/wifi/wifi.py
+++ b/wifi/wifi.py
@@ -56,8 +56,6 @@
 scan-passive                      (Scan only) do not probe, scan passively
 scan-freq=                        (Scan only) limit scan to specific frequencies.
 supports-provisioning             Indicate via vendor IE that this AP supports provisioning.  Corresponds to feature ID 01 of OUI f4f5e8 at go/alphabet-ie-registry.
-provision-via-2g=                 The SSID of the 2.4 GHz open provisioning network supporting the user's wireless devices, to be exposed as a vendor IE.  Corresponds to feature ID 02 of OUI f4f5e8 at go/alphabet-ie-registry. []
-provision-via-5g=                 The SSID of the 5 GHz open provisioning network supporting the user's wireless devices, to be exposed as a vendor IE.  Corresponds to feature ID 03 of OUI f4f5e8 at go/alphabet-ie-registry. []
 """
 
 _FINGERPRINTS_DIRECTORY = '/tmp/wifi/fingerprints'