| 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, time | 5 import logging, re, time |
| 6 from autotest_lib.client.common_lib import error | 6 from autotest_lib.client.common_lib import error |
| 7 | 7 |
| 8 def isLinuxRouter(router): | 8 def isLinuxRouter(router): |
| 9 router_uname = router.run('uname').stdout | 9 router_uname = router.run('uname').stdout |
| 10 return re.search('Linux', router_uname) | 10 return re.search('Linux', router_uname) |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 conf['wmm_enabled'] = 0 | 248 conf['wmm_enabled'] = 0 |
| 249 elif k == 'deftxkey': | 249 elif k == 'deftxkey': |
| 250 conf['wep_default_key'] = v | 250 conf['wep_default_key'] = v |
| 251 elif k == 'ht20': | 251 elif k == 'ht20': |
| 252 htcaps.add('') # NB: ensure 802.11n setup below | 252 htcaps.add('') # NB: ensure 802.11n setup below |
| 253 conf['wmm_enabled'] = 1 | 253 conf['wmm_enabled'] = 1 |
| 254 elif k == 'ht40': | 254 elif k == 'ht40': |
| 255 htcaps.add('[HT40-]') | 255 htcaps.add('[HT40-]') |
| 256 htcaps.add('[HT40+]') | 256 htcaps.add('[HT40+]') |
| 257 conf['wmm_enabled'] = 1 | 257 conf['wmm_enabled'] = 1 |
| 258 elif k in ('ht40+', 'ht40-'): |
| 259 htcaps.add('[%s]' % k.upper()) |
| 260 conf['wmm_enabled'] = 1 |
| 258 elif k == 'shortgi': | 261 elif k == 'shortgi': |
| 259 htcaps.add('[SHORT-GI-20]') | 262 htcaps.add('[SHORT-GI-20]') |
| 260 htcaps.add('[SHORT-GI-40]') | 263 htcaps.add('[SHORT-GI-40]') |
| 261 elif k == 'pureg': | 264 elif k == 'pureg': |
| 262 pass # TODO(sleffler) need hostapd support | 265 pass # TODO(sleffler) need hostapd support |
| 263 elif k == 'puren': | 266 elif k == 'puren': |
| 264 pass # TODO(sleffler) need hostapd support | 267 pass # TODO(sleffler) need hostapd support |
| 265 elif k == 'protmode': | 268 elif k == 'protmode': |
| 266 pass # TODO(sleffler) need hostapd support | 269 pass # TODO(sleffler) need hostapd support |
| 267 elif k == 'ht': | 270 elif k == 'ht': |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 | 504 |
| 502 def get_ssid(self): | 505 def get_ssid(self): |
| 503 return self.hostapd['conf']['ssid'] | 506 return self.hostapd['conf']['ssid'] |
| 504 | 507 |
| 505 | 508 |
| 506 def set_txpower(self, params): | 509 def set_txpower(self, params): |
| 507 self.router.run("%s dev %s set txpower %s" % | 510 self.router.run("%s dev %s set txpower %s" % |
| 508 (self.cmd_iw, params.get('interface', | 511 (self.cmd_iw, params.get('interface', |
| 509 self.hostapd['interface']), | 512 self.hostapd['interface']), |
| 510 params.get('power', 'auto'))) | 513 params.get('power', 'auto'))) |
| OLD | NEW |