summaryrefslogtreecommitdiff
path: root/openwrt
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2005-04-08 12:55:23 +0000
committerFelix Fietkau <nbd@openwrt.org>2005-04-08 12:55:23 +0000
commit70938abbed1ac861fc8c29fc80deb41429cc3940 (patch)
treea83c5d70da61ca49b7ea44bd5e0a9065af99c7fc /openwrt
parent66522251661263625e8e8ad22f46187b872a7666 (diff)
downloadmtk-20170518-70938abbed1ac861fc8c29fc80deb41429cc3940.zip
mtk-20170518-70938abbed1ac861fc8c29fc80deb41429cc3940.tar.gz
mtk-20170518-70938abbed1ac861fc8c29fc80deb41429cc3940.tar.bz2
add SIOCSIWFREQ
SVN-Revision: 580
Diffstat (limited to 'openwrt')
-rw-r--r--openwrt/package/openwrt/wlcompat.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/openwrt/package/openwrt/wlcompat.c b/openwrt/package/openwrt/wlcompat.c
index ac85da0..e120ee1 100644
--- a/openwrt/package/openwrt/wlcompat.c
+++ b/openwrt/package/openwrt/wlcompat.c
@@ -104,6 +104,27 @@ static int wlcompat_ioctl(struct net_device *dev,
wrqu->freq.e = 0;
break;
}
+ case SIOCSIWFREQ:
+ {
+ if (wrqu->freq.e == 1) {
+ int channel = 0;
+ int f = wrqu->freq.m / 100000;
+ while ((channel < NUM_CHANNELS + 1) && (f != channel_frequency[channel]))
+ channel++;
+
+ if (channel == NUM_CHANNELS) { // channel not found
+ err = -EINVAL;
+ } else {
+ wrqu->freq.e = 0;
+ wrqu->freq.m = channel + 1;
+ }
+ }
+ if ((wrqu->freq.e == 0) && (wrqu->freq.m < 1000)) {
+ wl_ioctl(dev, WLC_SET_CHANNEL, &wrqu->freq.m, sizeof(int));
+ } else {
+ err = -EINVAL;
+ }
+ }
case SIOCGIWAP:
{
wrqu->ap_addr.sa_family = ARPHRD_ETHER;
@@ -174,7 +195,7 @@ static const iw_handler wlcompat_handler[] = {
wlcompat_ioctl, /* SIOCGIWNAME */
NULL, /* SIOCSIWNWID */
NULL, /* SIOCGIWNWID */
- NULL, /* SIOCSIWFREQ */
+ wlcompat_ioctl, /* SIOCSIWFREQ */
wlcompat_ioctl, /* SIOCGIWFREQ */
NULL, /* SIOCSIWMODE */
NULL, /* SIOCGIWMODE */