32 #include <linux/wireless.h>
34 #include <linux/slab.h>
35 #include <linux/module.h>
39 "?",
"a",
"b",
"ab",
"g",
"ag",
"bg",
"abg"
42 #define MAX_CUSTOM_LEN 64
58 start = iwe_stream_add_event(info, start, stop, &iwe,
IW_EV_ADDR_LEN);
69 iwe.
u.
data.length =
sizeof(
"<hidden>");
70 start = iwe_stream_add_point(info, start, stop, &iwe,
"<hidden>");
73 start = iwe_stream_add_point(info, start, stop, &iwe, network->
ssid);
79 start = iwe_stream_add_event(info, start, stop, &iwe,
IW_EV_CHAR_LEN);
90 start = iwe_stream_add_event(info, start, stop, &iwe,
IW_EV_UINT_LEN);
100 start = iwe_stream_add_event(info, start, stop, &iwe,
IW_EV_FREQ_LEN);
108 iwe.
u.
data.length = 0;
109 start = iwe_stream_add_point(info, start, stop, &iwe, network->
ssid);
115 for (i = 0, j = 0; i < network->
rates_len; ) {
116 if (j < network->rates_ex_len &&
118 (network->
rates[i] & 0x7F)))
119 rate = network->
rates_ex[j++] & 0x7F;
121 rate = network->
rates[i++] & 0x7F;
125 "%d%s ", rate >> 1, (rate & 1) ?
".5" :
"");
130 "%d%s ", rate >> 1, (rate & 1) ?
".5" :
"");
137 iwe.
u.
bitrate.value = max_rate * 500000;
138 start = iwe_stream_add_event(info, start, stop, &iwe,
IW_EV_PARAM_LEN);
142 if (iwe.
u.
data.length)
143 start = iwe_stream_add_point(info, start, stop, &iwe, custom);
147 if (network->
stats.signal == 0 || network->
stats.rssi == 0)
148 printk(
"========>signal:%d, rssi:%d\n", network->
stats.signal, network->
stats.rssi);
151 iwe.
u.
qual.qual = network->
stats.signalstrength;
161 iwe.
u.
qual.updated = 7;
162 start = iwe_stream_add_event(info, start, stop, &iwe,
IW_EV_QUAL_LEN);
168 if (iwe.
u.
data.length)
169 start = iwe_stream_add_point(info, start, stop, &iwe, custom);
171 memset(&iwe, 0,
sizeof(iwe));
178 start = iwe_stream_add_point(info, start, stop, &iwe, buf);
181 memset(&iwe, 0,
sizeof(iwe));
188 start = iwe_stream_add_point(info, start, stop, &iwe, buf);
198 if (iwe.
u.
data.length)
199 start = iwe_stream_add_point(info, start, stop, &iwe, custom);
212 char *
stop = ev + wrqu->
data.length;
233 ev = rtl818x_translate_scan(ieee, ev, stop, network, info);
237 "Not showing network '%s ("
238 "%pM)' due to age (%lums).\n",
239 escape_essid(network->
ssid,
245 spin_unlock_irqrestore(&ieee->
lock, flags);
248 wrqu->
data.flags = 0;
280 "provided" :
"default");
285 if (key_provided && *crypt) {
299 ieee, &ieee->
crypt[i]);
317 if (*crypt !=
NULL && (*crypt)->ops !=
NULL &&
318 strcmp((*crypt)->ops->name,
"WEP") != 0) {
324 if (*crypt ==
NULL) {
330 if (new_crypt ==
NULL)
337 new_crypt->
priv = new_crypt->
ops->init(key);
339 if (!new_crypt->
ops || !new_crypt->
priv) {
344 "load module ieee80211_crypt_wep\n",
353 len = erq->
length <= 5 ? 5 : 13;
359 key, escape_essid(sec.
keys[key], len),
362 (*crypt)->ops->set_key(sec.
keys[key], len,
NULL,
372 NULL, (*crypt)->priv);
378 (*crypt)->ops->set_key(sec.
keys[key], 13,
NULL,
387 "Setting key %d to default Tx key.\n", key);
399 "OPEN" :
"SHARED KEY");
445 erq->
flags = key + 1;
453 if (
strcmp(crypt->
ops->name,
"WEP") != 0) {
462 erq->
length = (len >= 0 ? len : 0);
560 printk(
"========>unknown crypto alg %d\n", ext->
alg);
565 if (*crypt ==
NULL || (*crypt)->ops != ops) {
570 new_crypt = kzalloc(
sizeof(*new_crypt),
GFP_KERNEL);
571 if (new_crypt ==
NULL) {
577 new_crypt->
priv = new_crypt->
ops->init(idx);
587 if (ext->
key_len > 0 && (*crypt)->ops->set_key &&
589 (*crypt)->priv) < 0) {
591 printk(
"key setting failed\n");
720 printk(
"return error out, len:%zu\n", len);
727 printk(
"len:%zu, ie:%d\n", len, ie[1]);