19 #include <linux/kernel.h>
20 #include <linux/slab.h>
30 static const int frequency_list_bg[] = { 2412, 2417, 2422, 2427, 2432,
31 2437, 2442, 2447, 2452, 2457, 2462, 2467, 2472, 2484
39 if ((f >= 2412) && (f <= 2484)) {
40 while ((c < 14) && (f != frequency_list_bg[c]))
42 return (c >= 14) ? 0 : ++
c;
43 }
else if ((f >= (
int) 5000) && (f <= (
int) 6000)) {
44 return ( (f - 5000) / 5 );
49 #define OID_STRUCT(name,oid,s,t) [name] = {oid, 0, sizeof(s), t}
50 #define OID_STRUCT_C(name,oid,s,t) OID_STRUCT(name,oid,s,t | OID_FLAG_CACHED)
51 #define OID_U32(name,oid) OID_STRUCT(name,oid,u32,OID_TYPE_U32)
52 #define OID_U32_C(name,oid) OID_STRUCT_C(name,oid,u32,OID_TYPE_U32)
53 #define OID_STRUCT_MLME(name,oid) OID_STRUCT(name,oid,struct obj_mlme,OID_TYPE_MLME)
54 #define OID_STRUCT_MLMEEX(name,oid) OID_STRUCT(name,oid,struct obj_mlmeex,OID_TYPE_MLMEEX)
56 #define OID_UNKNOWN(name,oid) OID_STRUCT(name,oid,0,0)
90 OID_FLAG_CACHED | OID_TYPE_KEY},
91 OID_UNKNOWN(DOT11_OID_STAKEY, 0x12000008),
92 OID_U32(DOT11_OID_REKEYTHRESHOLD, 0x12000009),
93 OID_UNKNOWN(DOT11_OID_STASC, 0x1200000a),
95 OID_U32(DOT11_OID_PRIVTXREJECTED, 0x1a000000),
96 OID_U32(DOT11_OID_PRIVRXPLAIN, 0x1a000001),
97 OID_U32(DOT11_OID_PRIVRXFAILED, 0x1a000002),
98 OID_U32(DOT11_OID_PRIVRXNOKEY, 0x1a000003),
100 OID_U32_C(DOT11_OID_RTSTHRESH, 0x13000000),
101 OID_U32_C(DOT11_OID_FRAGTHRESH, 0x13000001),
102 OID_U32_C(DOT11_OID_SHORTRETRIES, 0x13000002),
103 OID_U32_C(DOT11_OID_LONGRETRIES, 0x13000003),
104 OID_U32_C(DOT11_OID_MAXTXLIFETIME, 0x13000004),
105 OID_U32(DOT11_OID_MAXRXLIFETIME, 0x13000005),
106 OID_U32(DOT11_OID_AUTHRESPTIMEOUT, 0x13000006),
107 OID_U32(DOT11_OID_ASSOCRESPTIMEOUT, 0x13000007),
109 OID_UNKNOWN(DOT11_OID_ALOFT_TABLE, 0x1d000000),
110 OID_UNKNOWN(DOT11_OID_ALOFT_CTRL_TABLE, 0x1d000001),
111 OID_UNKNOWN(DOT11_OID_ALOFT_RETREAT, 0x1d000002),
112 OID_UNKNOWN(DOT11_OID_ALOFT_PROGRESS, 0x1d000003),
113 OID_U32(DOT11_OID_ALOFT_FIXEDRATE, 0x1d000004),
114 OID_UNKNOWN(DOT11_OID_ALOFT_RSSIGRAPH, 0x1d000005),
115 OID_UNKNOWN(DOT11_OID_ALOFT_CONFIG, 0x1d000006),
117 [DOT11_OID_VDCFX] = {0x1b000000, 7, 0, 0},
209 OID_STRUCT_C(DOT11_OID_PSMBUFFER, 0x19000004, struct obj_buffer,
212 OID_U32(DOT11_OID_BSSS, 0x1C000000),
213 [DOT11_OID_BSSX] = {0x1C000001, 63,
sizeof (
struct obj_bss),
215 OID_STRUCT(DOT11_OID_BSSFIND, 0x1C000042, struct obj_bss, OID_TYPE_BSS),
216 [DOT11_OID_BSSLIST] = {0x1C000043, 0,
sizeof (
struct
247 if (isl_oid[i].
flags & OID_FLAG_CACHED) {
248 priv->
mib[
i] = kzalloc(isl_oid[i].
size *
249 (isl_oid[i].
range + 1),
285 case OID_TYPE_BUFFER:{
286 struct obj_buffer *buff =
data;
304 for (i = 0; i < list->
nr; i++)
312 for (i = 0; i < freq->
nr; i++)
331 case OID_TYPE_ATTACH:{
354 case OID_TYPE_BUFFER:{
355 struct obj_buffer *buff =
data;
373 for (i = 0; i < list->
nr; i++)
381 for (i = 0; i < freq->
nr; i++)
400 case OID_TYPE_ATTACH:{
435 dlen = isl_oid[
n].
size;
436 cache = priv->
mib[
n];
437 cache += (cache ? extra * dlen : 0);
456 _data, dlen, &response);
458 response_op = response->
header->operation;
459 islpci_mgt_release(response);
468 memcpy(cache, _data, dlen);
491 dlen = isl_oid[
n].
size;
492 oid = isl_oid[
n].
oid;
498 data, dlen + extra_len, &response);
500 response_op = response->
header->operation;
501 islpci_mgt_release(response);
537 dlen = isl_oid[
n].
size;
538 cache = priv->
mib[
n];
539 cache += cache ? extra * dlen : 0;
548 oid, data, dlen, &response);
549 if (ret || !response ||
552 islpci_mgt_release(response);
556 _res = response->
data;
557 reslen = response->
header->length;
579 if (response && !ret)
580 islpci_mgt_release(response);
582 if (reslen > isl_oid[n].
size)
584 "mgt_get_request(0x%x): received data length was bigger "
585 "than expected (%d > %d). Memory is probably corrupted...",
586 oid, reslen, isl_oid[n].size);
598 for (i = 0; i <
n; i++) {
599 struct oid_t *
t = &(isl_oid[l[
i]]);
600 void *data = priv->
mib[l[
i]];
604 while (j <= t->
range) {
610 islpci_mgt_release(response);
615 priv->
ndev->name, oid, r);
682 isl_oid[GEN_OID_MACADDRESS].
size, &res);
689 islpci_mgt_release(res);
712 rvalue |= mgt_update_addr(priv);
783 if (isl_oid[i].oid == oid)
798 case OID_TYPE_BUFFER:{
799 struct obj_buffer *buff = r->
ptr;
801 "size=%u\naddr=0x%X\n", buff->
size,
808 "age=%u\nchannel=%u\n"
809 "capinfo=0x%X\nrates=0x%X\n"
810 "basic_rates=0x%X\n", bss->
age,
819 for (i = 0; i < list->
nr; i++)
821 "bss[%u] :\nage=%u\nchannel=%u\n"
822 "capinfo=0x%X\nrates=0x%X\n"
823 "basic_rates=0x%X\n",
837 for (i = 0; i < freq->
nr; i++)
839 "mhz[%u]=%u\n", i, freq->
mhz[i]);
846 "id=0x%X\nstate=0x%X\ncode=0x%X\n",
853 "id=0x%X\nstate=0x%X\n"
854 "code=0x%X\nsize=0x%X\n", mlme->
id,
858 case OID_TYPE_ATTACH:{
869 "length=%u\noctets=%.*s\n",
878 "type=0x%X\nlength=0x%X\nkey=0x",
880 for (i = 0; i < key->
length; i++)
882 "%02X:", key->
key[i]);
889 unsigned char *buff = r->
ptr;
892 for (i = 0; i < isl_oid[
n].
size; i++)