1 #define MAX_KEY_SIZE 16
6 char key_table[MAX_KEYS][MAX_KEY_SIZE];
7 int key_size[MAX_KEYS];
11 /* Basic checking... */
12 if(wrq->u.encoding.pointer != (caddr_t) 0)
14 int index = (wrq->u.encoding.flags & IW_ENCODE_INDEX) - 1;
16 /* Check the size of the key */
17 if(wrq->u.encoding.length > MAX_KEY_SIZE)
24 if((index < 0) || (index >= MAX_KEYS))
27 /* Copy the key in the driver */
28 if(copy_from_user(key_table[index], wrq->u.encoding.pointer,
29 wrq->u.encoding.length))
35 key_size[index] = wrq->u.encoding.length;
40 int index = (wrq->u.encoding.flags & IW_ENCODE_INDEX) - 1;
41 /* Do we want to just set the current key ? */
42 if((index >= 0) && (index < MAX_KEYS))
44 if(key_size[index] > 0)
55 if(wrq->u.encoding.flags & IW_ENCODE_DISABLED)
56 key_on = 0; /* disable encryption */
57 if(wrq->u.encoding.flags & IW_ENCODE_RESTRICTED)
58 key_open = 0; /* disable open mode */
59 if(wrq->u.encoding.flags & IW_ENCODE_OPEN)
60 key_open = 1; /* enable open mode */
65 /* only super-user can see encryption key */
72 /* Basic checking... */
73 if(wrq->u.encoding.pointer != (caddr_t) 0)
75 int index = (wrq->u.encoding.flags & IW_ENCODE_INDEX) - 1;
78 wrq->u.encoding.flags = 0;
80 wrq->u.encoding.flags |= IW_ENCODE_DISABLED;
82 wrq->u.encoding.flags |= IW_ENCODE_RESTRICTED;
84 wrq->u.encoding.flags |= IW_ENCODE_OPEN;
86 /* Which key do we want */
87 if((index < 0) || (index >= MAX_KEYS))
89 wrq->u.encoding.flags |= index + 1;
91 /* Copy the key to the user buffer */
92 wrq->u.encoding.length = key_size[index];
93 if(copy_to_user(wrq->u.encoding.pointer, key_table[index],
98 #endif /* WIRELESS_EXT > 8 */
101 range.encoding_size[0] = 8; /* DES = 64 bits key */
102 range.encoding_size[1] = 16;
103 range.num_encoding_sizes = 2;
104 range.max_encoding_tokens = 8;
105 #endif /* WIRELESS_EXT > 8 */