mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-06 07:33:01 +02:00
yanger: Wi-Fi: Add missing radio component in operational
This commit is contained in:
@@ -290,6 +290,14 @@ def parse_interface_info(ifname):
|
||||
if power_match:
|
||||
result['txpower'] = float(power_match.group(1))
|
||||
|
||||
# wiphy index -> phy/radio name
|
||||
elif stripped.startswith('wiphy '):
|
||||
try:
|
||||
wiphy_idx = int(stripped.split()[1])
|
||||
result['phy'] = normalize_phy_name(f'phy{wiphy_idx}')
|
||||
except (ValueError, IndexError):
|
||||
pass
|
||||
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@@ -93,10 +93,17 @@ def wifi(ifname):
|
||||
info = get_iw_info(ifname)
|
||||
mode = info.get('iftype', '').lower()
|
||||
|
||||
result = {}
|
||||
|
||||
if info.get('phy'):
|
||||
result['radio'] = info['phy']
|
||||
|
||||
if mode == 'ap':
|
||||
return wifi_ap(ifname)
|
||||
result.update(wifi_ap(ifname))
|
||||
else:
|
||||
return wifi_station(ifname)
|
||||
result.update(wifi_station(ifname))
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def parse_wpa_scan_result(scan_output):
|
||||
|
||||
Reference in New Issue
Block a user