OpenWrt/Atheros: Fix fetching main interface name

If multiple drivers are present in an OpenWrt based distribution (e.g.,
OpenWrt + Atheros / Atheros and mac80211 based drivers like 11ad), first
check for Atheros based drivers, because mac80211 based drivers do not
seem to delete the interface (eventhough the interface is not up and
running), so it passes the if_nametoindex() check. Fix this by giving
preference to Atheros based drivers (the interface is not present when
wifi is down) and this change will not impact other drivers as well.

Signed-off-by: Rajesh Babu Sarvepalli <c_rsarve@qti.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
1 file changed