aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-10-15 23:13:59 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-10-15 23:13:59 +0000
commit7648faea5484d511aff3a8730c9cfec1917c7b3c (patch)
tree9c8d9e3ed1e79062caab74642f49d92004270837
parent24591d8f63e1bb9f930b429d429e29c51dfbf492 (diff)
downloadupstream-7648faea5484d511aff3a8730c9cfec1917c7b3c.tar.gz
upstream-7648faea5484d511aff3a8730c9cfec1917c7b3c.tar.bz2
upstream-7648faea5484d511aff3a8730c9cfec1917c7b3c.zip
add patch from #849
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5137 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/wlcompat/src/wlcompat.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/package/wlcompat/src/wlcompat.c b/package/wlcompat/src/wlcompat.c
index a79affb9e0..d69ad6753d 100644
--- a/package/wlcompat/src/wlcompat.c
+++ b/package/wlcompat/src/wlcompat.c
@@ -33,6 +33,7 @@
#include <net/iw_handler.h>
#include <wlioctl.h>
+#include <proto/802.11.h>
static struct net_device *dev;
static unsigned short bss_force;
@@ -305,6 +306,16 @@ static int wlcompat_get_scan(struct net_device *dev,
iwe.u.data.flags = 1;
current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, bss_info->SSID);
+ /* send mode */
+ if (bss_info->capability & (DOT11_CAP_ESS | DOT11_CAP_IBSS)) {
+ iwe.cmd = SIOCGIWMODE;
+ if (bss_info->capability & DOT11_CAP_ESS)
+ iwe.u.mode = IW_MODE_MASTER;
+ else if (bss_info->capability & DOT11_CAP_IBSS)
+ iwe.u.mode = IW_MODE_ADHOC;
+ current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_UINT_LEN);
+ }
+
/* send frequency/channel info */
iwe.cmd = SIOCGIWFREQ;
iwe.u.freq.e = 0;
@@ -318,6 +329,16 @@ static int wlcompat_get_scan(struct net_device *dev,
iwe.u.qual.noise = bss_info->phy_noise;
current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_QUAL_LEN);
+ /* send encryption capability */
+ iwe.cmd = SIOCGIWENCODE;
+ iwe.u.data.pointer = NULL;
+ iwe.u.data.length = 0;
+ if (bss_info->capability & DOT11_CAP_PRIVACY)
+ iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
+ else
+ iwe.u.data.flags = IW_ENCODE_DISABLED;
+ current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, NULL);
+
/* send rate information */
iwe.cmd = SIOCGIWRATE;
current_val = current_ev + IW_EV_LCP_LEN;