From: Jo-Philipp Wich Date: Mon, 4 Jul 2016 14:07:09 +0000 (+0200) Subject: nl80211: retry phy lookup with platform/ prefix X-Git-Url: http://git.archive.openwrt.org/?a=commitdiff_plain;h=96d322d5941c57be58f8e8d5c6e2b28e90ed3598;hp=e4aca3910dff532ed878d0ceaf1ab6e8ad7719bf;p=project%2Fiwinfo.git 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 --- 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)