diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-05-21 12:33:15 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-05-21 12:33:15 +0000 |
commit | 89c0b1328b92bedb150d10e7cfbe7fb68cb8fb35 (patch) | |
tree | 1606f6a7ee3aed124d9b57b8cbeab7c6b99d1734 /package/network/utils/iwinfo/src/iwinfo_wext.c | |
parent | 4ab2ccf6301ca29615150bb64291fe4f8f10abf4 (diff) | |
download | upstream-89c0b1328b92bedb150d10e7cfbe7fb68cb8fb35.tar.gz upstream-89c0b1328b92bedb150d10e7cfbe7fb68cb8fb35.tar.bz2 upstream-89c0b1328b92bedb150d10e7cfbe7fb68cb8fb35.zip |
iwinfo: move wext_ops to iwinfo_wext.c, make functions static
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40810 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/utils/iwinfo/src/iwinfo_wext.c')
-rw-r--r-- | package/network/utils/iwinfo/src/iwinfo_wext.c | 85 |
1 files changed, 58 insertions, 27 deletions
diff --git a/package/network/utils/iwinfo/src/iwinfo_wext.c b/package/network/utils/iwinfo/src/iwinfo_wext.c index 890a36d2f0..a6cc516823 100644 --- a/package/network/utils/iwinfo/src/iwinfo_wext.c +++ b/package/network/utils/iwinfo/src/iwinfo_wext.c @@ -20,7 +20,7 @@ */ #include "iwinfo.h" -#include "iwinfo/wext.h" +#include "iwinfo_wext.h" static double wext_freq2float(const struct iw_freq *in) { @@ -55,7 +55,7 @@ static inline int wext_ioctl(const char *ifname, int cmd, struct iwreq *wrq) } -int wext_probe(const char *ifname) +static int wext_probe(const char *ifname) { struct iwreq wrq; @@ -65,12 +65,12 @@ int wext_probe(const char *ifname) return 0; } -void wext_close(void) +static void wext_close(void) { /* Nop */ } -int wext_get_mode(const char *ifname, int *buf) +static int wext_get_mode(const char *ifname, int *buf) { struct iwreq wrq; @@ -105,7 +105,7 @@ int wext_get_mode(const char *ifname, int *buf) return -1; } -int wext_get_ssid(const char *ifname, char *buf) +static int wext_get_ssid(const char *ifname, char *buf) { struct iwreq wrq; @@ -119,7 +119,7 @@ int wext_get_ssid(const char *ifname, char *buf) return -1; } -int wext_get_bssid(const char *ifname, char *buf) +static int wext_get_bssid(const char *ifname, char *buf) { struct iwreq wrq; @@ -136,7 +136,7 @@ int wext_get_bssid(const char *ifname, char *buf) return -1; } -int wext_get_bitrate(const char *ifname, int *buf) +static int wext_get_bitrate(const char *ifname, int *buf) { struct iwreq wrq; @@ -149,7 +149,7 @@ int wext_get_bitrate(const char *ifname, int *buf) return -1; } -int wext_get_channel(const char *ifname, int *buf) +static int wext_get_channel(const char *ifname, int *buf) { struct iwreq wrq; struct iw_range range; @@ -187,7 +187,7 @@ int wext_get_channel(const char *ifname, int *buf) return -1; } -int wext_get_frequency(const char *ifname, int *buf) +static int wext_get_frequency(const char *ifname, int *buf) { struct iwreq wrq; struct iw_range range; @@ -225,7 +225,7 @@ int wext_get_frequency(const char *ifname, int *buf) return -1; } -int wext_get_txpower(const char *ifname, int *buf) +static int wext_get_txpower(const char *ifname, int *buf) { struct iwreq wrq; @@ -244,7 +244,7 @@ int wext_get_txpower(const char *ifname, int *buf) return -1; } -int wext_get_signal(const char *ifname, int *buf) +static int wext_get_signal(const char *ifname, int *buf) { struct iwreq wrq; struct iw_statistics stats; @@ -264,7 +264,7 @@ int wext_get_signal(const char *ifname, int *buf) return -1; } -int wext_get_noise(const char *ifname, int *buf) +static int wext_get_noise(const char *ifname, int *buf) { struct iwreq wrq; struct iw_statistics stats; @@ -284,7 +284,7 @@ int wext_get_noise(const char *ifname, int *buf) return -1; } -int wext_get_quality(const char *ifname, int *buf) +static int wext_get_quality(const char *ifname, int *buf) { struct iwreq wrq; struct iw_statistics stats; @@ -302,7 +302,7 @@ int wext_get_quality(const char *ifname, int *buf) return -1; } -int wext_get_quality_max(const char *ifname, int *buf) +static int wext_get_quality_max(const char *ifname, int *buf) { struct iwreq wrq; struct iw_range range; @@ -320,13 +320,13 @@ int wext_get_quality_max(const char *ifname, int *buf) return -1; } -int wext_get_assoclist(const char *ifname, char *buf, int *len) +static int wext_get_assoclist(const char *ifname, char *buf, int *len) { /* Stub */ return -1; } -int wext_get_txpwrlist(const char *ifname, char *buf, int *len) +static int wext_get_txpwrlist(const char *ifname, char *buf, int *len) { struct iwreq wrq; struct iw_range range; @@ -367,7 +367,7 @@ int wext_get_txpwrlist(const char *ifname, char *buf, int *len) return -1; } -int wext_get_freqlist(const char *ifname, char *buf, int *len) +static int wext_get_freqlist(const char *ifname, char *buf, int *len) { struct iwreq wrq; struct iw_range range; @@ -399,19 +399,19 @@ int wext_get_freqlist(const char *ifname, char *buf, int *len) return -1; } -int wext_get_country(const char *ifname, char *buf) +static int wext_get_country(const char *ifname, char *buf) { sprintf(buf, "00"); return 0; } -int wext_get_countrylist(const char *ifname, char *buf, int *len) +static int wext_get_countrylist(const char *ifname, char *buf, int *len) { /* Stub */ return -1; } -int wext_get_hwmodelist(const char *ifname, int *buf) +static int wext_get_hwmodelist(const char *ifname, int *buf) { char chans[IWINFO_BUFSIZE] = { 0 }; struct iwinfo_freqlist_entry *e = NULL; @@ -440,20 +440,20 @@ int wext_get_hwmodelist(const char *ifname, int *buf) return -1; } -int wext_get_encryption(const char *ifname, char *buf) +static int wext_get_encryption(const char *ifname, char *buf) { /* No reliable crypto info in wext */ return -1; } -int wext_get_phyname(const char *ifname, char *buf) +static int wext_get_phyname(const char *ifname, char *buf) { /* No suitable api in wext */ strcpy(buf, ifname); return 0; } -int wext_get_mbssid_support(const char *ifname, int *buf) +static int wext_get_mbssid_support(const char *ifname, int *buf) { /* No multi bssid support atm */ return -1; @@ -480,7 +480,7 @@ static char * wext_sysfs_ifname_file(const char *ifname, const char *path) return rv; } -int wext_get_hardware_id(const char *ifname, char *buf) +static int wext_get_hardware_id(const char *ifname, char *buf) { char *data; struct iwinfo_hardware_id *id = (struct iwinfo_hardware_id *)buf; @@ -506,22 +506,53 @@ int wext_get_hardware_id(const char *ifname, char *buf) return (id->vendor_id > 0 && id->device_id > 0) ? 0 : -1; } -int wext_get_hardware_name(const char *ifname, char *buf) +static int wext_get_hardware_name(const char *ifname, char *buf) { sprintf(buf, "Generic WEXT"); return 0; } -int wext_get_txpower_offset(const char *ifname, int *buf) +static int wext_get_txpower_offset(const char *ifname, int *buf) { /* Stub */ *buf = 0; return -1; } -int wext_get_frequency_offset(const char *ifname, int *buf) +static int wext_get_frequency_offset(const char *ifname, int *buf) { /* Stub */ *buf = 0; return -1; } + +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, + .txpower = wext_get_txpower, + .txpower_offset = wext_get_txpower_offset, + .bitrate = wext_get_bitrate, + .signal = wext_get_signal, + .noise = wext_get_noise, + .quality = wext_get_quality, + .quality_max = wext_get_quality_max, + .mbssid_support = wext_get_mbssid_support, + .hwmodelist = wext_get_hwmodelist, + .mode = wext_get_mode, + .ssid = wext_get_ssid, + .bssid = wext_get_bssid, + .country = wext_get_country, + .hardware_id = wext_get_hardware_id, + .hardware_name = wext_get_hardware_name, + .encryption = wext_get_encryption, + .phyname = wext_get_phyname, + .assoclist = wext_get_assoclist, + .txpwrlist = wext_get_txpwrlist, + .scanlist = wext_get_scanlist, + .freqlist = wext_get_freqlist, + .countrylist = wext_get_countrylist, + .close = wext_close +}; |