yanger: Wi-Fi: Add missing radio component in operational

This commit is contained in:
Mattias Walström
2026-02-24 06:59:27 +01:00
committed by Joachim Wiberg
parent 8c9e36ba5d
commit 845e7c13fe
2 changed files with 17 additions and 2 deletions
@@ -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):