OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import logging, re | 5 import logging, re |
6 from autotest_lib.client.common_lib import error | 6 from autotest_lib.client.common_lib import error |
7 from autotest_lib.server import site_eap_tls | 7 from autotest_lib.server import site_eap_tls |
8 | 8 |
9 def isLinuxRouter(router): | 9 def isLinuxRouter(router): |
10 router_uname = router.run('uname').stdout | 10 router_uname = router.run('uname').stdout |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 elif k == 'ssid_suffix': | 167 elif k == 'ssid_suffix': |
168 conf['ssid'] = self.defssid + v | 168 conf['ssid'] = self.defssid + v |
169 elif k == 'channel': | 169 elif k == 'channel': |
170 freq = int(v) | 170 freq = int(v) |
171 | 171 |
172 # 2.4GHz | 172 # 2.4GHz |
173 if freq <= 2484: | 173 if freq <= 2484: |
174 # Make sure hw_mode is set | 174 # Make sure hw_mode is set |
175 if conf.get('hw_mode') == 'a': | 175 if conf.get('hw_mode') == 'a': |
176 conf['hw_mode'] = 'g' | 176 conf['hw_mode'] = 'g' |
177 | 177 |
178 # Freq = 5 * chan + 2407, except channel 14 | 178 # Freq = 5 * chan + 2407, except channel 14 |
179 if freq == 2484: | 179 if freq == 2484: |
180 conf['channel'] = 14 | 180 conf['channel'] = 14 |
181 else: | 181 else: |
182 conf['channel'] = (freq - 2407) / 5 | 182 conf['channel'] = (freq - 2407) / 5 |
183 # 5GHz | 183 # 5GHz |
184 else: | 184 else: |
185 # Make sure hw_mode is set | 185 # Make sure hw_mode is set |
186 conf['hw_mode'] = 'a' | 186 conf['hw_mode'] = 'a' |
187 # Freq = 5 * chan + 4000 | 187 # Freq = 5 * chan + 4000 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 self.router.run("%s link set %s down" % (self.cmd_ip, self.bridgeif), | 315 self.router.run("%s link set %s down" % (self.cmd_ip, self.bridgeif), |
316 ignore_status=True) | 316 ignore_status=True) |
317 self.router.run("%s delbr %s" % (self.cmd_brctl, self.bridgeif), | 317 self.router.run("%s delbr %s" % (self.cmd_brctl, self.bridgeif), |
318 ignore_status=True) | 318 ignore_status=True) |
319 | 319 |
320 self.hostapd['configured'] = False | 320 self.hostapd['configured'] = False |
321 | 321 |
322 | 322 |
323 def get_ssid(self): | 323 def get_ssid(self): |
324 return self.hostapd['conf']['ssid'] | 324 return self.hostapd['conf']['ssid'] |
OLD | NEW |