diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-05-21 12:33:10 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-05-21 12:33:10 +0000 |
commit | 4ab2ccf6301ca29615150bb64291fe4f8f10abf4 (patch) | |
tree | d22dd68a3b7bd0838915e90154b1dfd7e266ef38 /package/network/utils/iwinfo/src/include | |
parent | 4f7c05be73fcee121f307f20ba114fec23a2fc10 (diff) | |
download | upstream-4ab2ccf6301ca29615150bb64291fe4f8f10abf4.tar.gz upstream-4ab2ccf6301ca29615150bb64291fe4f8f10abf4.tar.bz2 upstream-4ab2ccf6301ca29615150bb64291fe4f8f10abf4.zip |
iwinfo: keep an array of backends, reduce the number of ifdefs and hardcoded strcmp calls
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40809 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/utils/iwinfo/src/include')
5 files changed, 11 insertions, 0 deletions
diff --git a/package/network/utils/iwinfo/src/include/iwinfo.h b/package/network/utils/iwinfo/src/include/iwinfo.h index ebea319d10..1302d159b9 100644 --- a/package/network/utils/iwinfo/src/include/iwinfo.h +++ b/package/network/utils/iwinfo/src/include/iwinfo.h @@ -148,6 +148,9 @@ extern const struct iwinfo_iso3166_label IWINFO_ISO3166_NAMES[]; struct iwinfo_ops { + const char *name; + + int (*probe)(const char *ifname); int (*mode)(const char *, int *); int (*channel)(const char *, int *); int (*frequency)(const char *, int *); diff --git a/package/network/utils/iwinfo/src/include/iwinfo/madwifi.h b/package/network/utils/iwinfo/src/include/iwinfo/madwifi.h index 3662d9f95f..0de9fea6e3 100644 --- a/package/network/utils/iwinfo/src/include/iwinfo/madwifi.h +++ b/package/network/utils/iwinfo/src/include/iwinfo/madwifi.h @@ -54,6 +54,8 @@ int madwifi_get_hardware_name(const char *ifname, char *buf); void madwifi_close(void); static const struct iwinfo_ops madwifi_ops = { + .name = "madwifi", + .probe = madwifi_probe, .channel = madwifi_get_channel, .frequency = madwifi_get_frequency, .frequency_offset = madwifi_get_frequency_offset, diff --git a/package/network/utils/iwinfo/src/include/iwinfo/nl80211.h b/package/network/utils/iwinfo/src/include/iwinfo/nl80211.h index 0611feed3c..97f8c7de63 100644 --- a/package/network/utils/iwinfo/src/include/iwinfo/nl80211.h +++ b/package/network/utils/iwinfo/src/include/iwinfo/nl80211.h @@ -96,6 +96,8 @@ int nl80211_get_hardware_name(const char *ifname, char *buf); void nl80211_close(void); static const struct iwinfo_ops nl80211_ops = { + .name = "nl80211", + .probe = nl80211_probe, .channel = nl80211_get_channel, .frequency = nl80211_get_frequency, .frequency_offset = nl80211_get_frequency_offset, diff --git a/package/network/utils/iwinfo/src/include/iwinfo/wext.h b/package/network/utils/iwinfo/src/include/iwinfo/wext.h index e84f6a6f92..22016c69ac 100644 --- a/package/network/utils/iwinfo/src/include/iwinfo/wext.h +++ b/package/network/utils/iwinfo/src/include/iwinfo/wext.h @@ -55,6 +55,8 @@ int wext_get_hardware_name(const char *ifname, char *buf); void wext_close(void); static const struct iwinfo_ops wext_ops = { + .name = "wext", + .probe = wext_probe, .channel = wext_get_channel, .frequency = wext_get_frequency, .frequency_offset = wext_get_frequency_offset, diff --git a/package/network/utils/iwinfo/src/include/iwinfo/wl.h b/package/network/utils/iwinfo/src/include/iwinfo/wl.h index 077a51bbd4..535a43dc37 100644 --- a/package/network/utils/iwinfo/src/include/iwinfo/wl.h +++ b/package/network/utils/iwinfo/src/include/iwinfo/wl.h @@ -55,6 +55,8 @@ int wl_get_hardware_name(const char *ifname, char *buf); void wl_close(void); static const struct iwinfo_ops wl_ops = { + .name = "wl", + .probe = wl_probe, .channel = wl_get_channel, .frequency = wl_get_frequency, .frequency_offset = wl_get_frequency_offset, |