X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=package%2Fwlcompat%2Fsrc%2Fwlcompat.c;h=625da6a3a4cf2e7541c800361ca3b3b4fc128b21;hb=0489c0a2dee36935829067f00c36e3930a1cb528;hp=a79affb9e0db11f89ee45debf099f0f4308e1847;hpb=8fd66eb00b493182fde37b55110bfa98a77ee365;p=openwrt%2Fsvn-archive%2Farchive.git diff --git a/package/wlcompat/src/wlcompat.c b/package/wlcompat/src/wlcompat.c index a79affb9e0..625da6a3a4 100644 --- a/package/wlcompat/src/wlcompat.c +++ b/package/wlcompat/src/wlcompat.c @@ -33,6 +33,7 @@ #include #include +#include static struct net_device *dev; static unsigned short bss_force; @@ -47,7 +48,7 @@ const long channel_frequency[] = { }; #define NUM_CHANNELS ( sizeof(channel_frequency) / sizeof(channel_frequency[0]) ) -#define RNG_POLL_FREQ 20 +#define RNG_POLL_FREQ 2 typedef struct internal_wsec_key { uint8 index; // 0x00 @@ -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;