42 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
53 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
54 #define SUPPORTED_WIRELESS_EXT 18
56 #define SUPPORTED_WIRELESS_EXT 17
59 static const long frequency_list[] = {
60 2412, 2417, 2422, 2427, 2432, 2437, 2442, 2447, 2452, 2457, 2462, 2467, 2472, 2484,
61 4915, 4920, 4925, 4935, 4940, 4945, 4960, 4980,
62 5035, 5040, 5045, 5055, 5060, 5080, 5170, 5180, 5190, 5200, 5210, 5220, 5230, 5240,
63 5260, 5280, 5300, 5320, 5500, 5520, 5540, 5560, 5580, 5600, 5620, 5640, 5660, 5680,
64 5700, 5745, 5765, 5785, 5805, 5825
94 pDevice->
wstats.qual.level = ldBm;
96 pDevice->
wstats.qual.noise = 0;
97 pDevice->
wstats.qual.updated = 1;
98 pDevice->
wstats.discard.nwid = 0;
99 pDevice->
wstats.discard.code = 0;
100 pDevice->
wstats.discard.fragment = 0;
102 pDevice->
wstats.discard.misc = 0;
103 pDevice->
wstats.miss.beacon = 0;
132 strcpy(wrq,
"802.11-a/b/g");
156 PRINT_K(
"wireless_send_event--->SIOCGIWSCAN(scan done)\n");
157 memset(&wrqu, 0,
sizeof(wrqu));
162 spin_lock_irq(&pDevice->
lock);
172 if (pItemSSID->abySSID[req->
essid_len - 1] ==
'\0') {
182 spin_unlock_irq(&pDevice->
lock);
197 spin_unlock_irq(&pDevice->
lock);
218 char *current_ev =
extra;
220 char *current_val =
NULL;
234 if (current_ev >= end_buf)
239 memset(&iwe, 0,
sizeof(iwe));
243 current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe,
IW_EV_ADDR_LEN);
245 memset(&iwe, 0,
sizeof(iwe));
248 iwe.
u.
data.length = pItemSSID->len;
249 iwe.
u.
data.flags = 1;
250 current_ev = iwe_stream_add_point(info,current_ev,end_buf, &iwe, pItemSSID->abySSID);
252 memset(&iwe, 0,
sizeof(iwe));
261 current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe,
IW_EV_UINT_LEN);
265 memset(&iwe, 0,
sizeof(iwe));
267 iwe.
u.
freq.m = pBSS->uChannel;
270 current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe,
IW_EV_FREQ_LEN);
273 int f = (
int)pBSS->uChannel - 1;
275 iwe.
u.
freq.m = frequency_list[
f] * 100000;
278 current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe,
IW_EV_FREQ_LEN);
280 memset(&iwe, 0,
sizeof(iwe));
282 RFvRSSITodBm(pDevice, (
unsigned char)(pBSS->uRSSI), &ldBm);
283 iwe.
u.
qual.level = ldBm;
284 iwe.
u.
qual.noise = 0;
287 iwe.
u.
qual.qual = 100;
288 }
else if(-ldBm > 90) {
291 iwe.
u.
qual.qual=(40-(-ldBm-50))*100/40;
293 iwe.
u.
qual.updated=7;
296 current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe,
IW_EV_QUAL_LEN);
298 memset(&iwe, 0,
sizeof(iwe));
300 iwe.
u.
data.length = 0;
306 current_ev = iwe_stream_add_point(info,current_ev,end_buf, &iwe, pItemSSID->abySSID);
308 memset(&iwe, 0,
sizeof(iwe));
313 for (kk = 0 ; kk < 12 ; kk++) {
314 if (pSuppRates->abyRates[kk] == 0)
317 iwe.
u.
bitrate.value = ((pSuppRates->abyRates[kk] & 0x7f) * 500000);
318 current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe,
IW_EV_PARAM_LEN);
320 for (kk = 0 ; kk < 8 ; kk++) {
321 if (pExtSuppRates->abyRates[kk] == 0)
324 iwe.
u.
bitrate.value = ((pExtSuppRates->abyRates[kk] & 0x7f) * 500000);
325 current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe,
IW_EV_PARAM_LEN);
328 if((current_val - current_ev) > IW_EV_LCP_LEN)
329 current_ev = current_val;
331 memset(&iwe, 0,
sizeof(iwe));
333 sprintf(buf,
"bcn_int=%d", pBSS->wBeaconInterval);
335 current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
338 memset(&iwe, 0,
sizeof(iwe));
340 iwe.
u.
data.length = pBSS->wWPALen;
341 current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, pBSS->byWPAIE);
345 memset(&iwe, 0,
sizeof(iwe));
347 iwe.
u.
data.length = pBSS->wRSNLen;
348 current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, pBSS->byRSNIE);
376 (wrq->
m >= (
int) 2.412e8) &&
377 (wrq->
m <= (
int) 2.487e8)) {
378 int f = wrq->
m / 100000;
380 while((c < 14) && (f != frequency_list[c]))
386 if((wrq->
m > 14) || (wrq->
e > 0))
390 if((channel < 1) || (channel > 14)) {
420 #ifdef WEXT_USECHANNELS
428 wrq->
m = frequency_list[
f] * 100000;
550 unsigned char abySupportedRates[13]= {0x02, 0x04, 0x0B, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C, 0x90};
563 for(i = 0; i < 14; i++) {
564 range->
freq[
k].i = i + 1;
565 range->
freq[
k].m = frequency_list[
i] * 100000;
566 range->
freq[k++].e = 1;
570 #ifdef Calcu_LinkQual
579 for(i = 0 ; i < 13 ; i++) {
580 range->
bitrate[
i] = abySupportedRates[
i] * 500000;
661 unsigned char ZeroBSSID[
WLAN_BSSID_LEN]={0x00,0x00,0x00,0x00,0x00,0x00};
666 printk(
"SIOCSIWAP(??)-->In scanning...\n");
681 PRINT_K(
"SIOCSIWAP:invalid desired BSSID return!\n");
687 unsigned int ii , uSameBssidNum=0;
694 if(uSameBssidNum >= 2) {
695 PRINT_K(
"SIOCSIWAP:ignore for desired AP in hidden mode\n");
770 if ( jj >= IW_MAX_AP)
772 memcpy(sock[jj].sa_data, pBSS->abyBSSID, 6);
774 qual[jj].
level = pBSS->uRSSI;
810 printk(
"SIOCSIWESSID(??)-->In scanning...\n");
814 if(wrq->
flags == 0) {
818 PRINT_K(
"set essid to 'any' \n");
819 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
832 if (pItemSSID->abySSID[wrq->
length - 1] ==
'\0') {
834 pItemSSID->len = wrq->
length - 1;
837 pItemSSID->len = wrq->
length;
838 printk(
"set essid to %s \n",pItemSSID->abySSID);
846 if(pItemSSID->len==0) {
851 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
859 unsigned int ii , uSameBssidNum=0;
869 PRINT_K(
"SIOCSIWESSID:hidden ssid site survey before associate.......\n");
879 !compare_ether_addr(pMgmt->
sBSSList[ii].abyBSSID, pCurr->abyBSSID)) {
883 if(uSameBssidNum >= 2) {
884 printk(
"SIOCSIWESSID:hidden ssid directly associate.......\n");
930 memcpy(extra, pItemSSID->abySSID , pItemSSID->len);
931 extra[pItemSSID->len] =
'\0';
932 wrq->
length = pItemSSID->len + 1;
934 wrq->
length = pItemSSID->len;
954 unsigned char abySupportedRates[13]= {0x02, 0x04, 0x0B, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C, 0x90};
966 if((wrq->
value < 13) &&
976 for(i = 0 ; i < 13 ; i++) {
977 if(normvalue == abySupportedRates[i]) {
984 if(wrq->
value == -1) {
986 for(i = 0 ; i < 13 ; i++) {
987 if(abySupportedRates[i] == 0)
1002 if(wrq->
fixed != 0) {
1019 printk(
"auto rate:connection_rate is 13\n");
1041 unsigned char abySupportedRates[13]= {0x02, 0x04, 0x0B, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C, 0x90};
1079 wrq->
value = brate * 500000;
1106 int rthr = wrq->
value;
1109 if((rthr < 0) || (rthr > 2312)) {
1149 int fthr = wrq->
value;
1157 if((fthr < 256) || (fthr > 2312)) {
1324 for (ii = 0; ii < wrq->
length; ii++) {
1329 spin_lock_irq(&pDevice->
lock);
1331 (
unsigned long)(dwKeyIndex | (1 << 31)),
1339 spin_unlock_irq(&pDevice->
lock);
1364 pkeytab->
GroupKey[(
unsigned char)dwKeyIndex].dwKeyIndex=dwKeyIndex | (1 << 31);
1375 spin_lock_irq(&pDevice->
lock);
1378 spin_unlock_irq(&pDevice->
lock);
1601 wrq->
flags |= index+1;
1717 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
1727 static int wpa_version=0;
1728 static int pairwise=0;
1733 wpa_version = wrq->
value;
1735 PRINT_K(
"iwctl_siwauth:set WPADEV to disable at 1??????\n");
1739 PRINT_K(
"iwctl_siwauth:set WPADEV to WPA1******\n");
1742 PRINT_K(
"iwctl_siwauth:set WPADEV to WPA2******\n");
1747 pairwise = wrq->
value;
1777 if(wrq->
value == 0){
1853 if ((wrq->
length < 2) || (extra[1]+2 != wrq->
length)) {
1923 PRINT_K(
"SIOCSIWENCODEEXT...... \n");
1925 blen =
sizeof(*param);
1969 memset(key_array, 0, 64);
1974 memcpy(&key_array[16], &key[24], 8);
1975 memcpy(&key_array[24], &key[16], 8);
1983 param->
u.
wpa_key.key_index = key_idx;
1992 if(param->
u.
wpa_key.key_index ==0) {
2006 printk(
"SIOCSIWENCODEEXT:Enable WPA WEXT SUPPORT!!!!!\n");
2012 spin_lock_irq(&pDevice->
lock);
2014 spin_unlock_irq(&pDevice->
lock);
2053 printk(
"iwctl_siwmlme--->send DISASSOCIATE\n");
2220 .num_standard =
sizeof(iwctl_handler)/
sizeof(
iw_handler),
2224 .num_private_args = 0,
2229 .private_args =
NULL,