summaryrefslogtreecommitdiff
path: root/iwinfo_nl80211.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2016-07-04 16:07:09 +0200
committerJo-Philipp Wich <jo@mein.io>2016-07-04 16:07:12 +0200
commit96d322d5941c57be58f8e8d5c6e2b28e90ed3598 (patch)
tree6e21b66ade08165fad36ca5edb893a8ee71b89bd /iwinfo_nl80211.c
parente4aca3910dff532ed878d0ceaf1ab6e8ad7719bf (diff)
downloadiwinfo-96d322d5941c57be58f8e8d5c6e2b28e90ed3598.tar.gz
nl80211: retry phy lookup with platform/ prefix
If the first attempt to lookup the phy index by the path value fails, retry to find the index within the platform/ subdirectory to follow the logic used by the mac80211 package. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'iwinfo_nl80211.c')
-rw-r--r--iwinfo_nl80211.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
index b913b9d..63b70d5 100644
--- a/iwinfo_nl80211.c
+++ b/iwinfo_nl80211.c
@@ -245,6 +245,9 @@ static int nl80211_phy_idx_from_uci_path(struct uci_section *s)
snprintf(buf, sizeof(buf), "/sys/devices/%s/ieee80211/*/index", opt); /**/
if (glob(buf, 0, NULL, &gl))
+ snprintf(buf, sizeof(buf), "/sys/devices/platform/%s/ieee80211/*/index", opt); /**/
+
+ if (glob(buf, 0, NULL, &gl))
return -1;
if (gl.gl_pathc > 0)