wpa_supplicant.conf: freq_list should be included in the network block.

Setting frequency list outside the network block limits scanning, and
inside the network block limits connections. Add it to the network
block so that the --band option has the desired behavior.

See b/33164571

Change-Id: I7920b1a3268eed6aaa3cb70ce4f1164288edb87d
diff --git a/wifi/configs.py b/wifi/configs.py
index a4f20b8..572b1c9 100644
--- a/wifi/configs.py
+++ b/wifi/configs.py
@@ -370,14 +370,15 @@
   else:
     network_block_lines = wpa_network_lines(ssid, passphrase)
 
+  freq_list = ' '.join(autochannel.get_all_frequencies(opt.band))
+
   network_block_lines.append('\tscan_ssid=1')
   if opt.bssid:
     network_block_lines.append('\tbssid=%s' %
                                utils.validate_and_sanitize_bssid(opt.bssid))
+  network_block_lines.append('\tfreq_list=' + freq_list)
   network_block = make_network_block(network_block_lines)
 
-  freq_list = ' '.join(autochannel.get_all_frequencies(opt.band))
-
   lines = [
       'ctrl_interface=/var/run/wpa_supplicant',
       'ap_scan=1',
diff --git a/wifi/configs_test.py b/wifi/configs_test.py
index 016fc27..bd28626 100755
--- a/wifi/configs_test.py
+++ b/wifi/configs_test.py
@@ -26,6 +26,7 @@
 \t#psk="some passphrase"
 \tpsk=41821f7ca3ea5d85beea7644ed7e0fefebd654177fa06c26fbdfdc3c599a317f
 \tscan_ssid=1
+\tfreq_list={freq_list}
 }}
 """
 
@@ -39,6 +40,7 @@
 \tpsk=41821f7ca3ea5d85beea7644ed7e0fefebd654177fa06c26fbdfdc3c599a317f
 \tscan_ssid=1
 \tbssid=12:34:56:78:90:ab
+\tfreq_list={freq_list}
 }}
 """
 
@@ -53,6 +55,7 @@
 \tkey_mgmt=NONE
 \tscan_ssid=1
 \tbssid=12:34:56:78:90:ab
+\tfreq_list={freq_list}
 }}
 """