Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: vt6656: remove consecutive newlines

Several sed -i '/^$/{ N /^\n$/ D }' drivers/staging/vt6656/*.[ch]

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Andres More and committed by
Greg Kroah-Hartman
9fbafdd9 1cedfa31

-875
-4
drivers/staging/vt6656/80211hdr.h
··· 28 28 #ifndef __80211HDR_H__ 29 29 #define __80211HDR_H__ 30 30 31 - 32 31 /* bit type */ 33 32 #define BIT0 0x00000001 34 33 #define BIT1 0x00000002 ··· 320 321 WLAN_80211HDR_A4 sA4; 321 322 322 323 } UWLAN_80211HDR, *PUWLAN_80211HDR; 323 - 324 - 325 - 326 324 327 325 #endif /* __80211HDR_H__ */
-33
drivers/staging/vt6656/80211mgr.c
··· 56 56 #include "80211hdr.h" 57 57 #include "wpa.h" 58 58 59 - 60 - 61 - 62 - 63 - 64 59 static int msglevel = MSG_LEVEL_INFO; 65 60 /*static int msglevel =MSG_LEVEL_DEBUG;*/ 66 - 67 - 68 - 69 - 70 - 71 - 72 61 73 62 /*+ 74 63 * ··· 100 111 * None. 101 112 * 102 113 -*/ 103 - 104 114 105 115 void 106 116 vMgrDecodeBeacon( ··· 225 237 { 226 238 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; 227 239 228 - 229 240 /* Fixed Fields */ 230 241 pFrame->pwReason = (u16 *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) 231 242 + WLAN_DISASSOC_OFF_REASON); 232 243 pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_DISASSOC_OFF_REASON + sizeof(*(pFrame->pwReason)); 233 244 } 234 - 235 245 236 246 /*+ 237 247 * ··· 265 279 * 266 280 -*/ 267 281 268 - 269 282 void 270 283 vMgrEncodeAssocRequest( 271 284 PWLAN_FR_ASSOCREQ pFrame ··· 278 293 + WLAN_ASSOCREQ_OFF_LISTEN_INT); 279 294 pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_ASSOCREQ_OFF_LISTEN_INT + sizeof(*(pFrame->pwListenInterval)); 280 295 } 281 - 282 296 283 297 /*+ 284 298 * ··· 372 388 + sizeof(*(pFrame->pwAid)); 373 389 } 374 390 375 - 376 391 /*+ 377 392 * 378 393 * Routine Description: ··· 414 431 pFrame->pExtSuppRates = NULL; 415 432 } 416 433 417 - 418 434 /*+ 419 435 * 420 436 * Routine Description: ··· 442 460 pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_REASSOCREQ_OFF_CURR_AP + sizeof(*(pFrame->pAddrCurrAP)); 443 461 } 444 462 445 - 446 463 /*+ 447 464 * 448 465 * Routine Description: (AP) ··· 452 471 * None. 453 472 * 454 473 -*/ 455 - 456 474 457 475 void 458 476 vMgrDecodeReassocRequest( ··· 508 528 } 509 529 } 510 530 511 - 512 - 513 531 /*+ 514 532 * 515 533 * Routine Description: ··· 518 540 * None. 519 541 * 520 542 -*/ 521 - 522 543 523 544 void 524 545 vMgrEncodeProbeRequest( ··· 578 601 } 579 602 } 580 603 581 - 582 604 /*+ 583 605 * 584 606 * Routine Description: ··· 588 612 * None. 589 613 * 590 614 -*/ 591 - 592 615 593 616 void 594 617 vMgrEncodeProbeResponse( ··· 609 634 sizeof(*(pFrame->pwCapInfo)); 610 635 } 611 636 612 - 613 - 614 637 /*+ 615 638 * 616 639 * Routine Description: ··· 626 653 ) 627 654 { 628 655 PWLAN_IE pItem; 629 - 630 656 631 657 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; 632 658 ··· 720 748 } 721 749 } 722 750 723 - 724 751 /*+ 725 752 * 726 753 * Routine Description: ··· 747 776 + WLAN_AUTHEN_OFF_STATUS); 748 777 pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_AUTHEN_OFF_STATUS + sizeof(*(pFrame->pwStatus)); 749 778 } 750 - 751 779 752 780 /*+ 753 781 * ··· 784 814 pFrame->pChallenge = (PWLAN_IE_CHALLENGE)pItem; 785 815 } 786 816 787 - 788 817 /*+ 789 818 * 790 819 * Routine Description: ··· 808 839 pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_DEAUTHEN_OFF_REASON + sizeof(*(pFrame->pwReason)); 809 840 } 810 841 811 - 812 842 /*+ 813 843 * 814 844 * Routine Description: ··· 830 862 pFrame->pwReason = (u16 *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) 831 863 + WLAN_DEAUTHEN_OFF_REASON); 832 864 } 833 - 834 865 835 866 /*+ 836 867 *
-6
drivers/staging/vt6656/80211mgr.h
··· 33 33 34 34 #include "80211hdr.h" 35 35 36 - 37 36 #define WLAN_MIN_ARRAY 1 38 37 39 38 /* Information Element ID value */ ··· 209 210 #define MEASURE_MODE_LATE 0x01 210 211 #define MEASURE_MODE_INCAPABLE 0x02 211 212 #define MEASURE_MODE_REFUSED 0x04 212 - 213 - 214 - 215 213 216 214 /* Information Element types */ 217 215 ··· 473 477 u8 byLinkMargin; 474 478 } WLAN_IE_TPC_REP, *PWLAN_IE_TPC_REP; 475 479 476 - 477 480 typedef struct _WLAN_IE_IBSS_DFS { 478 481 u8 byElementID; 479 482 u8 len; ··· 709 714 /* info elements */ 710 715 711 716 } WLAN_FR_DEAUTHEN, *PWLAN_FR_DEAUTHEN; 712 - 713 717 714 718 void 715 719 vMgrEncodeBeacon(
-7
drivers/staging/vt6656/aes_ccmp.c
··· 33 33 #include "device.h" 34 34 #include "80211hdr.h" 35 35 36 - 37 - 38 - 39 36 /* 40 37 * SBOX Table 41 38 */ ··· 94 97 0x0b, 0x08, 0x0d, 0x0e, 0x07, 0x04, 0x01, 0x02, 0x13, 0x10, 0x15, 0x16, 0x1f, 0x1c, 0x19, 0x1a 95 98 }; 96 99 97 - 98 - 99 - 100 100 static void xor_128(u8 *a, u8 *b, u8 *out) 101 101 { 102 102 u32 * dwPtrA = (u32 *) a; ··· 105 111 (*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++); 106 112 (*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++); 107 113 } 108 - 109 114 110 115 static void xor_32(u8 *a, u8 *b, u8 *out) 111 116 {
-4
drivers/staging/vt6656/aes_ccmp.h
··· 30 30 #ifndef __AES_H__ 31 31 #define __AES_H__ 32 32 33 - 34 - 35 - 36 - 37 33 bool AESbGenCCMP(u8 * pbyRxKey, u8 * pbyFrame, u16 wFrameSize); 38 34 39 35 #endif /* __AES_CCMP_H__ */
-26
drivers/staging/vt6656/baseband.c
··· 48 48 static int msglevel =MSG_LEVEL_INFO; 49 49 //static int msglevel =MSG_LEVEL_DEBUG; 50 50 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 51 u8 abyVT3184_AGC[] = { 60 52 0x00, //0 61 53 0x00, //1 ··· 114 122 0x3E, //3E 115 123 0x3E //3F 116 124 }; 117 - 118 125 119 126 u8 abyVT3184_AL2230[] = { 120 127 0x31,//00 ··· 373 382 0x00, 374 383 0x00 375 384 }; 376 - 377 - 378 385 379 386 //{{RobertYu:20060515, new BB setting for VT3226D0 380 387 u8 abyVT3184_VT3226D0[] = { ··· 637 648 const u16 awcFrameTime[MAX_RATE] = 638 649 {10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216}; 639 650 640 - 641 651 /* 642 652 static 643 653 unsigned long ··· 678 690 unsigned int uTmp; 679 691 unsigned int uRateIdx = (unsigned int)wRate; 680 692 unsigned int uRate = 0; 681 - 682 693 683 694 if (uRateIdx > RATE_54M) { 684 695 ASSERT(0); ··· 883 896 } 884 897 } 885 898 886 - 887 899 /* 888 900 * Description: Set Antenna mode 889 901 * ··· 910 924 pDevice->byBBRxConf |= 0x02; 911 925 break; 912 926 } 913 - 914 927 915 928 CONTROLnsRequestOut(pDevice, 916 929 MESSAGE_TYPE_SET_ANTMD, ··· 951 966 if (ntStatus != STATUS_SUCCESS) { 952 967 return false; 953 968 } 954 - 955 969 956 970 // if ((pDevice->abyEEPROM[EEP_OFS_RADIOCTL]&0x06)==0x04) 957 971 // return false; ··· 1090 1106 abyArray 1091 1107 ); 1092 1108 1093 - 1094 1109 if ((pDevice->byRFType == RF_VT3226) || //RobertYu:20051116, 20060111 remove VT3226D0 1095 1110 (pDevice->byRFType == RF_VT3342A0) //RobertYu:20060609 1096 1111 ) { ··· 1101 1118 ControlvWriteByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_ITRTMSET,0x11); 1102 1119 MACvRegBitsOn(pDevice,MAC_REG_PAPEDELAY,0x01); 1103 1120 } 1104 - 1105 1121 1106 1122 ControlvWriteByte(pDevice,MESSAGE_REQUEST_BBREG,0x04,0x7F); 1107 1123 ControlvWriteByte(pDevice,MESSAGE_REQUEST_BBREG,0x0D,0x01); ··· 1136 1154 1137 1155 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0A, pDevice->byBBRxConf); 1138 1156 } 1139 - 1140 1157 1141 1158 void BBvSetVGAGainOffset(struct vnt_private *pDevice, u8 byData) 1142 1159 { ··· 1174 1193 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0C, 0x00);//CR12 1175 1194 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0D, 0x01);//CR13 1176 1195 } 1177 - 1178 1196 1179 1197 static unsigned long s_ulGetLowSQ3(struct vnt_private *pDevice) 1180 1198 { ··· 1221 1241 return ulRatio; 1222 1242 } 1223 1243 1224 - 1225 1244 static void s_vClearSQ3Value(struct vnt_private *pDevice) 1226 1245 { 1227 1246 int ii; ··· 1231 1252 pDevice->aulSQ3Val[ii] = 0; 1232 1253 } 1233 1254 } 1234 - 1235 1255 1236 1256 /* 1237 1257 * Description: Antenna Diversity ··· 1363 1385 } //byAntennaState 1364 1386 } 1365 1387 1366 - 1367 1388 /*+ 1368 1389 * 1369 1390 * Description: ··· 1395 1418 add_timer(&pDevice->TimerSQ3Tmax3); 1396 1419 add_timer(&pDevice->TimerSQ3Tmax2); 1397 1420 1398 - 1399 1421 spin_unlock_irq(&pDevice->lock); 1400 1422 } 1401 - 1402 1423 1403 1424 /*+ 1404 1425 * ··· 1445 1470 1446 1471 void BBvUpdatePreEDThreshold(struct vnt_private *pDevice, int bScanning) 1447 1472 { 1448 - 1449 1473 1450 1474 switch(pDevice->byRFType) 1451 1475 {
-7
drivers/staging/vt6656/baseband.h
··· 36 36 #include "tether.h" 37 37 #include "device.h" 38 38 39 - 40 39 #define PREAMBLE_LONG 0 41 40 #define PREAMBLE_SHORT 1 42 41 ··· 80 81 #define TOP_RATE_55M 0x00400000 81 82 #define TOP_RATE_2M 0x00200000 82 83 #define TOP_RATE_1M 0x00100000 83 - 84 - 85 - 86 - 87 - 88 - 89 84 90 85 unsigned int 91 86 BBuGetFrameTime(
-39
drivers/staging/vt6656/bssdb.c
··· 58 58 #include "rndis.h" 59 59 #include "iowpa.h" 60 60 61 - 62 - 63 - 64 - 65 - 66 61 static int msglevel =MSG_LEVEL_INFO; 67 62 //static int msglevel =MSG_LEVEL_DEBUG; 68 - 69 - 70 63 71 64 const u16 awHWRetry0[5][5] = { 72 65 {RATE_18M, RATE_18M, RATE_12M, RATE_12M, RATE_12M}, ··· 76 83 {RATE_54M, RATE_54M, RATE_36M, RATE_18M, RATE_18M} 77 84 }; 78 85 79 - 80 - 81 - 82 86 static void s_vCheckSensitivity(struct vnt_private *pDevice); 83 87 static void s_vCheckPreEDThreshold(struct vnt_private *pDevice); 84 88 static void s_uCalculateLinkQual(struct vnt_private *pDevice); 85 - 86 - 87 - 88 - 89 - 90 - 91 - 92 89 93 90 /*+ 94 91 * ··· 197 214 pCurrBSS->abyBSSID); 198 215 jj++; 199 216 200 - 201 217 if (pSelect == NULL) { 202 218 pSelect = pCurrBSS; 203 219 } else { ··· 224 242 225 243 } 226 244 227 - 228 245 /*+ 229 246 * 230 247 * Routine Description: ··· 233 252 * None. 234 253 * 235 254 -*/ 236 - 237 255 238 256 void BSSvClearBSSList(struct vnt_private *pDevice, int bKeepCurrBSSID) 239 257 { ··· 257 277 } 258 278 BSSvClearAnyBSSJoinRecord(pDevice); 259 279 } 260 - 261 - 262 280 263 281 /*+ 264 282 * ··· 290 312 291 313 return NULL; 292 314 }; 293 - 294 - 295 315 296 316 /*+ 297 317 * ··· 325 349 PKnownBSS pBSSList = NULL; 326 350 unsigned int ii; 327 351 bool bParsingQuiet = false; 328 - 329 352 330 353 pBSSList = (PKnownBSS)&(pMgmt->sBSSList[0]); 331 354 ··· 466 491 return true; 467 492 } 468 493 469 - 470 494 /*+ 471 495 * 472 496 * Routine Description: ··· 505 531 506 532 if (pBSSList == NULL) 507 533 return false; 508 - 509 534 510 535 pBSSList->qwBSSTimestamp = cpu_to_le64(qwTimestamp); 511 536 ··· 604 631 return true; 605 632 } 606 633 607 - 608 - 609 - 610 - 611 634 /*+ 612 635 * 613 636 * Routine Description: ··· 633 664 634 665 return false; 635 666 }; 636 - 637 - 638 667 639 668 /*+ 640 669 * ··· 691 724 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Create node index = %d\n", ii); 692 725 }; 693 726 694 - 695 - 696 727 /*+ 697 728 * 698 729 * Routine Description: ··· 707 742 struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; 708 743 u8 byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; 709 744 struct sk_buff *skb; 710 - 711 745 712 746 while ((skb = skb_dequeue(&pMgmt->sNodeDBTable[uNodeIndex].sTxPSQueue)) != NULL) 713 747 dev_kfree_skb(skb); ··· 905 941 if (pMgmt->sNodeDBTable[ii].bPSEnable) 906 942 uSleepySTACnt++; 907 943 908 - 909 944 } 910 945 911 946 // Rate fallback check ··· 936 973 } 937 974 938 975 } 939 - 940 976 941 977 if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) && (pDevice->byBBType == BB_TYPE_11G)) { 942 978 ··· 985 1023 } 986 1024 987 1025 } 988 - 989 1026 990 1027 // Check if any STA in PS mode, enable DTIM multicast deliver 991 1028 if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
-11
drivers/staging/vt6656/bssdb.h
··· 36 36 #include "card.h" 37 37 #include "mib.h" 38 38 39 - 40 39 #define MAX_NODE_NUM 64 41 40 #define MAX_BSS_NUM 42 42 41 #define LOST_BEACON_COUNT 10 /* 10 sec, XP defined */ ··· 64 65 65 66 #define MAX_WPA_IE_LEN 64 66 67 67 - 68 - 69 - 70 - 71 - 72 68 // 73 69 // IEEE 802.11 Structures and definitions 74 70 // ··· 72 78 bool bERPExist; 73 79 u8 byERP; 74 80 } ERPObject, *PERPObject; 75 - 76 81 77 82 typedef struct tagSRSNCapObject { 78 83 bool bRSNCapExist; ··· 142 149 } __attribute__ ((__packed__)) 143 150 KnownBSS , *PKnownBSS; 144 151 145 - 146 - 147 152 typedef enum tagNODE_STATE { 148 153 NODE_FREE, 149 154 NODE_AGED, ··· 149 158 NODE_AUTH, 150 159 NODE_ASSOC 151 160 } NODE_STATE, *PNODE_STATE; 152 - 153 161 154 162 // STA node info 155 163 typedef struct tagKnownNodeDB { ··· 208 218 unsigned int uTimeCount; 209 219 210 220 } KnownNodeDB, *PKnownNodeDB; 211 - 212 221 213 222 PKnownBSS BSSpSearchBSSList(struct vnt_private *, u8 *pbyDesireBSSID, 214 223 u8 *pbyDesireSSID, CARD_PHY_TYPE ePhyType);
-15
drivers/staging/vt6656/card.c
··· 60 60 #include "rndis.h" 61 61 #include "control.h" 62 62 63 - 64 63 //static int msglevel =MSG_LEVEL_DEBUG; 65 64 static int msglevel =MSG_LEVEL_INFO; 66 - 67 - 68 - 69 65 70 66 //const u16 cwRXBCNTSFOff[MAX_RATE] = 71 67 //{17, 34, 96, 192, 34, 23, 17, 11, 8, 5, 4, 3}; 72 68 73 69 const u16 cwRXBCNTSFOff[MAX_RATE] = 74 70 {192, 96, 34, 17, 34, 23, 17, 11, 8, 5, 4, 3}; 75 - 76 - 77 71 78 72 /* 79 73 * Description: Set NIC media channel ··· 624 630 } 625 631 } 626 632 627 - 628 633 /* 629 634 * Description: Calculate TSF offset of two TSF input 630 635 * Get TSF Offset from RxBCN's TSF and local TSF ··· 653 660 return qwTSFOffset; 654 661 } 655 662 656 - 657 - 658 663 /* 659 664 * Description: Sync. TSF counter to BSS 660 665 * Get TSF offset and write to HW ··· 673 682 { 674 683 u64 qwTSFOffset = 0; 675 684 u8 pbyData[8]; 676 - 677 685 678 686 qwTSFOffset = CARDqGetTSFOffset(byRxRate, qwBSSTimestamp, qwLocalTSF); 679 687 // adjust TSF ··· 716 726 717 727 return true; 718 728 } 719 - 720 729 721 730 /* 722 731 * Description: Clear NIC TSF counter ··· 778 789 return (qwTSF); 779 790 } 780 791 781 - 782 792 /* 783 793 * Description: Set NIC TSF counter for first Beacon time 784 794 * Get NEXTTBTT from adjusted TSF and Beacon Interval ··· 822 834 return; 823 835 } 824 836 825 - 826 837 /* 827 838 * Description: Sync NIC TSF counter for Beacon time 828 839 * Get NEXTTBTT and write to HW ··· 862 875 8, 863 876 pbyData 864 877 ); 865 - 866 878 867 879 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO 868 880 "Card:Update Next TBTT[%8lx]\n", (unsigned long)qwTSF); ··· 907 921 908 922 return bResult; 909 923 } 910 - 911 924 912 925 /* 913 926 * Description: Turn on Radio power
-3
drivers/staging/vt6656/card.h
··· 30 30 #define __CARD_H__ 31 31 #include "device.h" 32 32 33 - 34 - 35 33 /* init card type */ 36 34 37 35 typedef enum _CARD_PHY_TYPE { ··· 49 51 #define CB_MAX_CHANNEL_24G 14 50 52 #define CB_MAX_CHANNEL_5G 42 /* add channel9(5045MHz), 41==>42 */ 51 53 #define CB_MAX_CHANNEL (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G) 52 - 53 54 54 55 struct vnt_private; 55 56
-5
drivers/staging/vt6656/channel.c
··· 42 42 static int msglevel = MSG_LEVEL_INFO; 43 43 //static int msglevel =MSG_LEVEL_DEBUG; 44 44 45 - 46 - 47 - 48 45 static SChannelTblElement sChannelTbl[CB_MAX_CHANNEL+1] = 49 46 { 50 47 {0, 0, false}, ··· 102 105 {161, 5805, true}, //55 103 106 {165, 5825, true} //56 104 107 }; 105 - 106 - 107 108 108 109 /************************************************************************ 109 110 * The Radar regulation rules for each country
-4
drivers/staging/vt6656/channel.h
··· 32 32 33 33 #include "device.h" 34 34 35 - 36 - 37 35 typedef struct tagSChannelTblElement { 38 36 u8 byChannelNumber; 39 37 unsigned int uFrequency; 40 38 bool bValid; 41 39 } SChannelTblElement, *PSChannelTblElement; 42 - 43 - 44 40 45 41 bool ChannelValid(unsigned int CountryCode, unsigned int ChannelNum); 46 42 void CHvInitChannelTable(struct vnt_private *pDevice);
-4
drivers/staging/vt6656/control.c
··· 46 46 /* static int msglevel =MSG_LEVEL_INFO; */ 47 47 /* static int msglevel =MSG_LEVEL_DEBUG; */ 48 48 49 - 50 - 51 - 52 - 53 49 void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off, 54 50 u8 data) 55 51 {
-5
drivers/staging/vt6656/control.h
··· 33 33 #include "device.h" 34 34 #include "usbpipe.h" 35 35 36 - 37 36 #define CONTROLnsRequestOut(Device, Request, Value, Index, Length, Buffer) \ 38 37 PIPEnsControlOut(Device, Request, Value, Index, Length, Buffer) 39 38 ··· 42 43 #define CONTROLnsRequestIn(Device, Request, Value, Index, Length, Buffer) \ 43 44 PIPEnsControlIn(Device, Request, Value, Index, Length, Buffer) 44 45 45 - 46 - 47 - 48 46 void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off, 49 47 u8 data); 50 48 ··· 50 54 51 55 void ControlvMaskByte(struct vnt_private *pDevice, u8 reg_type, u8 reg_off, 52 56 u8 reg_mask, u8 data); 53 - 54 57 55 58 #endif /* __CONTROL_H__ */
-1
drivers/staging/vt6656/country.h
··· 156 156 CCODE_MAX 157 157 } COUNTRY_CODE; 158 158 159 - 160 159 /************************************************************************ 161 160 * Function prototype 162 161 ************************************************************************/
-16
drivers/staging/vt6656/datarate.c
··· 43 43 #include "srom.h" 44 44 #include "rf.h" 45 45 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 46 /* static int msglevel = MSG_LEVEL_DEBUG; */ 55 47 static int msglevel =MSG_LEVEL_INFO; 56 48 const u8 acbyIERate[MAX_RATE] = ··· 51 59 #define AUTORATE_TXOK_CNT 0x0400 52 60 #define AUTORATE_TXFAIL_CNT 0x0064 53 61 #define AUTORATE_TIMEOUT 10 54 - 55 62 56 63 void s_vResetCounter(PKnownNodeDB psNodeDBTable); 57 64 ··· 64 73 psNodeDBTable->uTxFail[ii] = 0; 65 74 } 66 75 } 67 - 68 - 69 - 70 76 71 77 /*+ 72 78 * ··· 82 94 -*/ 83 95 #define AUTORATE_TXCNT_THRESHOLD 20 84 96 #define AUTORATE_INC_THRESHOLD 30 85 - 86 - 87 - 88 97 89 98 /*+ 90 99 * ··· 225 240 226 241 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Exit ParseMaxRate\n"); 227 242 } 228 - 229 243 230 244 /*+ 231 245 *
-10
drivers/staging/vt6656/datarate.h
··· 29 29 #ifndef __DATARATE_H__ 30 30 #define __DATARATE_H__ 31 31 32 - 33 - 34 32 #define FALLBACK_PKT_COLLECT_TR_H 50 /* pkts */ 35 33 #define FALLBACK_PKT_COLLECT_TR_L 10 /* pkts */ 36 34 #define FALLBACK_POLL_SECOND 5 /* 5 sec */ ··· 53 55 #define RATE_54M 11 54 56 #define RATE_AUTO 12 55 57 #define MAX_RATE 12 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 58 65 59 void RATEvParseMaxRate(struct vnt_private *, PWLAN_IE_SUPP_RATES pItemRates, 66 60 PWLAN_IE_SUPP_RATES pItemExtRates, int bUpdateBasicRate,
-24
drivers/staging/vt6656/device.h
··· 45 45 #include <linux/timer.h> 46 46 #include <linux/usb.h> 47 47 48 - 49 48 #ifdef SIOCETHTOOL 50 49 #define DEVICE_ETHTOOL_IOCTL_SUPPORT 51 50 #include <linux/ethtool.h> ··· 119 120 #define ANT_RXA 2 120 121 #define ANT_RXB 3 121 122 122 - 123 123 #define MAXCHECKHANGCNT 4 124 124 125 125 /* Packet type */ ··· 137 139 #define RESERV_AC0DMA 4 138 140 139 141 #define PRIVATE_Message 0 140 - 141 142 142 143 #define DBG_PRT(l, p, args...) { if (l <= msglevel) printk(p, ##args); } 143 144 #define PRINT_K(p, args...) { if (PRIVATE_Message) printk(p, ##args); } ··· 245 248 /* PMKID Structures */ 246 249 typedef unsigned char NDIS_802_11_PMKID_VALUE[16]; 247 250 248 - 249 251 typedef enum _NDIS_802_11_WEP_STATUS 250 252 { 251 253 Ndis802_11WEPEnabled, ··· 262 266 } NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS, 263 267 NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS; 264 268 265 - 266 269 typedef enum _NDIS_802_11_STATUS_TYPE 267 270 { 268 271 Ndis802_11StatusType_Authentication, ··· 275 280 NDIS_802_11_MAC_ADDRESS BSSID; 276 281 unsigned long Flags; 277 282 } PMKID_CANDIDATE, *PPMKID_CANDIDATE; 278 - 279 283 280 284 typedef struct _BSSID_INFO 281 285 { ··· 362 368 /* for device_set_media_duplex */ 363 369 #define DEVICE_LINK_CHANGE 0x00000001UL 364 370 365 - 366 371 typedef struct __device_opt { 367 372 int nRxDescs0; /* number of RX descriptors 0 */ 368 373 int nTxDescs0; /* number of TX descriptors 0, 1, 2, 3 */ ··· 375 382 int bbp_type; 376 383 u32 flags; 377 384 } OPTIONS, *POPTIONS; 378 - 379 385 380 386 struct vnt_private { 381 387 /* netdev */ ··· 409 417 u32 cbFreeDFCB; 410 418 u32 uCurrentDFCBIdx; 411 419 412 - 413 420 /* USB */ 414 421 struct urb *pControlURB; 415 422 struct urb *pInterruptURB; ··· 441 450 /* default config from file by user setting */ 442 451 DEFAULT_CONFIG config_file; 443 452 444 - 445 453 /* Statistic for USB */ 446 454 unsigned long ulBulkInPosted; 447 455 unsigned long ulBulkInError; ··· 457 467 unsigned long ulIntInContCRCError; 458 468 unsigned long ulIntInBytesRead; 459 469 460 - 461 470 /* Version control */ 462 471 u16 wFirmwareVersion; 463 472 u8 byLocalID; 464 473 u8 byRFType; 465 474 u8 byBBRxConf; 466 - 467 475 468 476 u8 byZoneType; 469 477 int bZoneRegExist; ··· 555 567 u8 byACKRate; 556 568 u8 byTopOFDMBasicRate; 557 569 u8 byTopCCKBasicRate; 558 - 559 570 560 571 u32 dwAotoRateTxOkCnt; 561 572 u32 dwAotoRateTxFailCnt; ··· 668 681 SKeyManagement sKey; 669 682 u32 dwIVCounter; 670 683 671 - 672 684 RC4Ext SBox; 673 685 u8 abyPRNG[WLAN_WEPMAX_KEYLEN+3]; 674 686 u8 byKeyIndex; ··· 684 698 /* QoS */ 685 699 int bGrpAckPolicy; 686 700 687 - 688 701 u8 byAutoFBCtrl; 689 702 690 703 int bTxMICFail; 691 704 int bRxMICFail; 692 - 693 705 694 706 /* For Update BaseBand VGA Gain Offset */ 695 707 int bUpdateBBVGA; ··· 699 715 700 716 u8 byBBPreEDRSSI; 701 717 u8 byBBPreEDIndex; 702 - 703 718 704 719 int bRadioCmd; 705 720 u32 dwDiagRefCount; ··· 737 754 SPMKID gsPMKID; 738 755 SPMKIDCandidateEvent gsPMKIDCandidate; 739 756 740 - 741 757 /* for 802.11h */ 742 758 int b11hEnable; 743 759 ··· 767 785 768 786 }; 769 787 770 - 771 - 772 - 773 788 #define EnqueueRCB(_Head, _Tail, _RCB) \ 774 789 { \ 775 790 if (!_Head) { \ ··· 788 809 Head = RCB->Next; \ 789 810 } 790 811 791 - 792 812 #define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) { \ 793 813 if ((uVar) >= ((uModulo) - 1)) \ 794 814 (uVar) = 0; \ 795 815 else \ 796 816 (uVar)++; \ 797 817 } 798 - 799 818 800 819 #define fMP_RESET_IN_PROGRESS 0x00000001 801 820 #define fMP_DISCONNECTED 0x00000002 ··· 814 837 815 838 #define MP_IS_READY(_M) (((_M)->Flags & \ 816 839 (fMP_DISCONNECTED | fMP_RESET_IN_PROGRESS | fMP_HALT_IN_PROGRESS | fMP_INIT_IN_PROGRESS | fMP_SURPRISE_REMOVED)) == 0) 817 - 818 840 819 841 int device_alloc_frag_buf(struct vnt_private *, PSDeFragControlBlock pDeF); 820 842
-37
drivers/staging/vt6656/dpc.c
··· 56 56 #include "datarate.h" 57 57 #include "usbpipe.h" 58 58 59 - 60 - 61 59 //static int msglevel =MSG_LEVEL_DEBUG; 62 60 static int msglevel =MSG_LEVEL_INFO; 63 61 64 62 const u8 acbyRxRate[MAX_RATE] = 65 63 {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108}; 66 - 67 - 68 - 69 - 70 64 71 65 static u8 s_byGetRateIdx(u8 byRate); 72 66 ··· 90 96 u32 FrameSize, u8 *pbyRsr, int bOnFly, PSKeyItem pKey, u8 *pbyNewRsr, 91 97 s32 *pbExtIV, u16 *pwRxTSC15_0, u32 *pdwRxTSC47_16); 92 98 93 - 94 99 /*+ 95 100 * 96 101 * Description: ··· 117 124 u16 *pwType; 118 125 struct ieee80211_hdr *pMACHeader; 119 126 int ii; 120 - 121 127 122 128 pMACHeader = (struct ieee80211_hdr *) (pbyRxBufferAddr + cbHeaderSize); 123 129 ··· 182 190 *pcbHeadSize = cbHeaderSize; 183 191 } 184 192 185 - 186 - 187 - 188 193 static u8 s_byGetRateIdx(u8 byRate) 189 194 { 190 195 u8 byRateIdx; ··· 192 203 } 193 204 return 0; 194 205 } 195 - 196 206 197 207 static 198 208 void ··· 246 258 *pcbHeaderSize = cbHeaderSize; 247 259 } 248 260 249 - 250 261 int RXbBulkInProcessData(struct vnt_private *pDevice, PRCB pRCB, 251 262 unsigned long BytesToIndicate) 252 263 { ··· 279 292 u16 wPLCPwithPadding; 280 293 struct ieee80211_hdr *pMACHeader; 281 294 int bRxeapol_key = false; 282 - 283 295 284 296 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---------- RXbBulkInProcessData---\n"); 285 297 ··· 356 370 FrameSize 357 371 ); 358 372 359 - 360 373 pMACHeader = (struct ieee80211_hdr *) pbyFrame; 361 374 362 375 //mike add: to judge if current AP is activated? ··· 381 396 } 382 397 } 383 398 384 - 385 399 // Use for TKIP MIC 386 400 s_vGetDASA(pbyFrame, &cbHeaderSize, &pDevice->sRxEthHeader); 387 401 ··· 404 420 return false; 405 421 } 406 422 } 407 - 408 423 409 424 if (IS_FC_WEP(pbyFrame)) { 410 425 bool bRxDecryOK = false; ··· 472 489 else 473 490 FrameSize -= 4; // 4 is ICV 474 491 } 475 - 476 492 477 493 // 478 494 // RX OK ··· 628 646 } 629 647 } 630 648 631 - 632 649 // Data frame Handle 633 - 634 650 635 651 if (pDevice->bEnablePSMode) { 636 652 if (IS_FC_MOREDATA((pbyFrame))) { ··· 672 692 } 673 693 */ 674 694 675 - 676 695 // ----------------------------------------------- 677 696 678 697 if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) && (pDevice->bEnable8021x == true)){ ··· 711 732 return false; 712 733 } 713 734 714 - 715 735 if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_TKIP)) { 716 736 if (bIsWEP) { 717 737 FrameSize -= 8; //MIC ··· 727 749 u32 dwMICKey0 = 0, dwMICKey1 = 0; 728 750 u32 dwLocalMIC_L = 0; 729 751 u32 dwLocalMIC_R = 0; 730 - 731 752 732 753 if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { 733 754 dwMICKey0 = cpu_to_le32(*(u32 *)(&pKey->abyKey[24])); ··· 757 780 758 781 pdwMIC_L = (u32 *)(skb->data + 8 + FrameSize); 759 782 pdwMIC_R = (u32 *)(skb->data + 8 + FrameSize + 4); 760 - 761 783 762 784 if ((cpu_to_le32(*pdwMIC_L) != dwLocalMIC_L) || (cpu_to_le32(*pdwMIC_R) != dwLocalMIC_R) || 763 785 (pDevice->bRxMICFail == true)) { ··· 845 869 } 846 870 } // ----- End of Reply Counter Check -------------------------- 847 871 848 - 849 872 s_vProcessRxMACHeader(pDevice, (u8 *)(skb->data+8), FrameSize, bIsWEP, bExtIV, &cbHeaderOffset); 850 873 FrameSize -= cbHeaderOffset; 851 874 cbHeaderOffset += 8; // 8 is Rcv buffer header ··· 898 923 struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; 899 924 struct ieee80211_hdr *p802_11Header; 900 925 CMD_STATUS Status; 901 - 902 926 903 927 if (IS_CTL_PSPOLL(pbyFrame) || !IS_TYPE_CONTROL(pbyFrame)) { 904 928 ··· 1008 1034 u8 byKeyIdx; 1009 1035 PSKeyItem pKey = NULL; 1010 1036 u8 byDecMode = KEY_CTL_WEP; 1011 - 1012 1037 1013 1038 *pwRxTSC15_0 = 0; 1014 1039 *pdwRxTSC47_16 = 0; ··· 1158 1185 byKeyIdx >>= 6; 1159 1186 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\nKeyIdx: %d\n", byKeyIdx); 1160 1187 1161 - 1162 1188 if (pMgmt->byCSSGK == KEY_CTL_TKIP) 1163 1189 byDecMode = KEY_CTL_TKIP; 1164 1190 else if (pMgmt->byCSSGK == KEY_CTL_CCMP) ··· 1262 1290 u8 byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; 1263 1291 u16 wAID; 1264 1292 1265 - 1266 1293 if (FrameSize > CB_MAX_BUF_SIZE) 1267 1294 return false; 1268 1295 // check DA ··· 1334 1363 return true; 1335 1364 } 1336 1365 1337 - 1338 - 1339 - 1340 1366 void RXvWorkItem(struct vnt_private *pDevice) 1341 1367 { 1342 1368 int ntStatus; ··· 1356 1388 1357 1389 } 1358 1390 1359 - 1360 1391 void RXvFreeRCB(PRCB pRCB, int bReAllocSkb) 1361 1392 { 1362 1393 struct vnt_private *pDevice = pRCB->pDevice; 1363 - 1364 1394 1365 1395 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->RXvFreeRCB\n"); 1366 1396 ··· 1385 1419 EnqueueRCB(pDevice->FirstRecvFreeList, pDevice->LastRecvFreeList, pRCB); 1386 1420 pDevice->NumRecvFreeList++; 1387 1421 1388 - 1389 1422 if ((pDevice->Flags & fMP_POST_READS) && MP_IS_READY(pDevice) && 1390 1423 (pDevice->bIsRxWorkItemQueued == false) ) { 1391 1424 ··· 1393 1428 } 1394 1429 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"<----RXFreeRCB %d %d\n",pDevice->NumRecvFreeList, pDevice->NumRecvMngList); 1395 1430 } 1396 - 1397 1431 1398 1432 void RXvMngWorkItem(struct vnt_private *pDevice) 1399 1433 { ··· 1427 1463 spin_unlock_irq(&pDevice->lock); 1428 1464 1429 1465 } 1430 - 1431 1466
-4
drivers/staging/vt6656/dpc.h
··· 32 32 #include "device.h" 33 33 #include "wcmd.h" 34 34 35 - 36 - 37 - 38 - 39 35 void RXvWorkItem(void *Context); 40 36 41 37 void RXvMngWorkItem(void *Context);
-9
drivers/staging/vt6656/firmware.c
··· 35 35 #include "control.h" 36 36 #include "rndis.h" 37 37 38 - 39 38 static int msglevel =MSG_LEVEL_INFO; 40 39 //static int msglevel =MSG_LEVEL_DEBUG; 41 40 ··· 42 43 #define FIRMWARE_NAME "vntwusb.fw" 43 44 44 45 #define FIRMWARE_CHUNK_SIZE 0x400 45 - 46 - 47 - 48 - 49 - 50 - 51 46 52 47 int FIRMWAREbDownload(struct vnt_private *pDevice) 53 48 { ··· 52 59 bool result = false; 53 60 u16 wLength; 54 61 int ii, rc; 55 - 56 62 57 63 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Download firmware\n"); 58 64 spin_unlock_irq(&pDevice->lock); ··· 117 125 return (true); 118 126 } 119 127 } 120 - 121 128 122 129 int FIRMWAREbCheckVersion(struct vnt_private *pDevice) 123 130 {
-4
drivers/staging/vt6656/firmware.h
··· 32 32 33 33 #include "device.h" 34 34 35 - 36 - 37 - 38 - 39 35 int FIRMWAREbDownload(struct vnt_private *); 40 36 int FIRMWAREbBrach2Sram(struct vnt_private *); 41 37 int FIRMWAREbCheckVersion(struct vnt_private *);
-17
drivers/staging/vt6656/hostap.c
··· 142 142 return 0; 143 143 } 144 144 145 - 146 145 /* 147 146 * Description: 148 147 * Set enable/disable hostapd mode ··· 173 174 return hostap_disable_hostapd(pDevice, rtnl_locked); 174 175 } 175 176 176 - 177 177 /* 178 178 * Description: 179 179 * remove station function supported for hostap daemon ··· 190 192 struct viawget_hostapd_param *param) 191 193 { 192 194 unsigned int uNodeIndex; 193 - 194 195 195 196 if (BSSbIsSTAInNodeDB(pDevice, param->sta_addr, &uNodeIndex)) { 196 197 BSSvRemoveOneNode(pDevice, uNodeIndex); ··· 291 294 return 0; 292 295 } 293 296 294 - 295 297 /* 296 298 * Description: 297 299 * set station flag ··· 323 327 return 0; 324 328 } 325 329 326 - 327 - 328 330 /* 329 331 * Description: 330 332 * set generic element (wpa ie) ··· 340 346 struct viawget_hostapd_param *param) 341 347 { 342 348 struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; 343 - 344 - 345 349 346 350 memcpy( pMgmt->abyWPAIE, 347 351 param->u.generic_elem.data, ··· 417 425 int bKeyTableFull = false; 418 426 u16 wKeyCtl = 0; 419 427 420 - 421 428 param->u.crypt.err = 0; 422 429 423 430 if (param->u.crypt.alg > WPA_ALG_CCMP) 424 431 return -EINVAL; 425 - 426 432 427 433 if ((param->u.crypt.idx > 3) || (param->u.crypt.key_len > MAX_KEY_LEN)) { 428 434 param->u.crypt.err = HOSTAP_CRYPT_ERR_KEY_SET_FAILED; ··· 509 519 KEY_CTL_WEP 510 520 ) == true) { 511 521 512 - 513 522 pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true; 514 523 515 524 } else { ··· 553 564 pMgmt->byCSSPK = KEY_CTL_CCMP; 554 565 pMgmt->byCSSGK = KEY_CTL_CCMP; 555 566 } 556 - 557 567 558 568 if (iNodeIndex == 0) { 559 569 KeybSetDefaultKey( pDevice, ··· 619 631 return ret; 620 632 } 621 633 622 - 623 - 624 634 /* 625 635 * Description: 626 636 * get each stations encryption key ··· 641 655 int ii; 642 656 s32 iNodeIndex = 0; 643 657 644 - 645 658 param->u.crypt.err = 0; 646 659 647 660 if (is_broadcast_ether_addr(param->sta_addr)) { ··· 660 675 661 676 return ret; 662 677 } 663 - 664 678 665 679 /* 666 680 * Description: ··· 762 778 ret = -EOPNOTSUPP; 763 779 goto out; 764 780 } 765 - 766 781 767 782 if ((ret == 0) && ap_ioctl) { 768 783 if (copy_to_user(p->pointer, param, p->length)) {
-5
drivers/staging/vt6656/hostap.h
··· 31 31 32 32 #include "device.h" 33 33 34 - 35 34 #define WLAN_RATE_1M BIT0 36 35 #define WLAN_RATE_2M BIT1 37 36 #define WLAN_RATE_5M5 BIT2 ··· 43 44 #define WLAN_RATE_36M BIT9 44 45 #define WLAN_RATE_48M BIT10 45 46 #define WLAN_RATE_54M BIT11 46 - 47 - 48 - 49 - 50 47 51 48 #ifndef ETH_P_PAE 52 49 #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
-5
drivers/staging/vt6656/int.c
··· 42 42 43 43 static int msglevel = MSG_LEVEL_INFO; /* MSG_LEVEL_DEBUG */ 44 44 45 - 46 - 47 - 48 - 49 - 50 45 /*+ 51 46 * 52 47 * Function: InterruptPollingThread
-3
drivers/staging/vt6656/int.h
··· 56 56 } __attribute__ ((__packed__)) 57 57 SINTData, *PSINTData; 58 58 59 - 60 - 61 - 62 59 void INTvWorkItem(struct vnt_private *); 63 60 void INTnsProcessData(struct vnt_private *); 64 61
-11
drivers/staging/vt6656/iocmd.h
··· 29 29 #ifndef __IOCMD_H__ 30 30 #define __IOCMD_H__ 31 31 32 - 33 32 // ioctl Command code 34 33 #define MAGIC_CODE 0x3142 35 34 #define IOCTL_CMD_TEST (SIOCDEVPRIVATE + 0) ··· 177 178 178 179 } __packed SBSSIDItem; 179 180 180 - 181 181 typedef struct tagSBSSIDList { 182 182 183 183 u32 uItem; 184 184 SBSSIDItem sBSSIDList[0]; 185 185 } __packed SBSSIDList, *PSBSSIDList; 186 - 187 186 188 187 typedef struct tagSNodeItem { 189 188 // STA info ··· 203 206 204 207 } __packed SNodeItem; 205 208 206 - 207 209 typedef struct tagSNodeList { 208 210 209 211 u32 uItem; 210 212 SNodeItem sNodeList[0]; 211 213 212 214 } __packed SNodeList, *PSNodeList; 213 - 214 215 215 216 typedef struct tagSCmdLinkStatus { 216 217 ··· 239 244 u32 MulticastReceivedFrameCount; 240 245 u32 FCSErrorCount; 241 246 } __packed SDot11MIBCount, *PSDot11MIBCount; 242 - 243 - 244 247 245 248 // 246 249 // statistic counter ··· 421 428 } scan_req; 422 429 } u; 423 430 } __packed; 424 - 425 - 426 - 427 - 428 431 429 432 #endif /* __IOCMD_H__ */
-8
drivers/staging/vt6656/iowpa.h
··· 29 29 #ifndef __IOWPA_H__ 30 30 #define __IOWPA_H__ 31 31 32 - 33 32 #define WPA_IE_LEN 64 34 33 35 34 //WPA related ··· 53 54 VIAWGET_SET_DISASSOCIATE = 10 54 55 }; 55 56 56 - 57 57 enum { 58 58 VIAWGET_ASSOC_MSG = 1, 59 59 VIAWGET_DISASSOC_MSG = 2, ··· 61 63 VIAWGET_CCKM_ROAM_MSG = 5, 62 64 VIAWGET_DEVICECLOSE_MSG = 6 63 65 }; 64 - 65 - 66 66 67 67 typedef struct viawget_wpa_header { 68 68 u8 type; ··· 124 128 int level; 125 129 int maxrate; 126 130 } __packed; 127 - 128 - 129 - 130 - 131 131 132 132 #endif /* __IOWPA_H__ */
-3
drivers/staging/vt6656/iwctl.c
··· 42 42 #include "control.h" 43 43 #include "rndis.h" 44 44 45 - 46 45 static const long frequency_list[] = { 47 46 2412, 2417, 2422, 2427, 2432, 2437, 2442, 2447, 2452, 2457, 2462, 2467, 2472, 2484, 48 47 4915, 4920, 4925, 4935, 4940, 4945, 4960, 4980, ··· 356 357 if (pMgmt == NULL) 357 358 return -EFAULT; 358 359 359 - 360 360 #ifdef WEXT_USECHANNELS 361 361 wrq->m = (int)pMgmt->uCurrChannel; 362 362 wrq->e = 0; ··· 479 481 } 480 482 pDevice->bCommit = false; 481 483 } 482 - 483 484 484 485 return rc; 485 486 }
-4
drivers/staging/vt6656/iwctl.h
··· 31 31 32 32 #include "device.h" 33 33 34 - 35 - 36 - 37 - 38 34 struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev); 39 35 40 36 int iwctl_siwap(struct net_device *dev, struct iw_request_info *info,
-19
drivers/staging/vt6656/key.c
··· 42 42 #include "rndis.h" 43 43 #include "control.h" 44 44 45 - 46 - 47 45 static int msglevel =MSG_LEVEL_INFO; 48 46 //static int msglevel =MSG_LEVEL_DEBUG; 49 - 50 - 51 - 52 - 53 47 54 48 static void s_vCheckKeyTableValid(struct vnt_private *pDevice, 55 49 PSKeyManagement pTable) ··· 79 85 } 80 86 81 87 } 82 - 83 - 84 - 85 88 86 89 /* 87 90 * Description: Init Key management table ··· 126 135 127 136 return; 128 137 } 129 - 130 138 131 139 /* 132 140 * Description: Get Key from table ··· 176 186 } 177 187 return (false); 178 188 } 179 - 180 189 181 190 /* 182 191 * Description: Set Key to table ··· 349 360 return (false); 350 361 } 351 362 352 - 353 363 /* 354 364 * Description: Remove Key from table 355 365 * ··· 423 435 s_vCheckKeyTableValid(pDevice,pTable); 424 436 return bReturnValue; 425 437 426 - 427 438 } 428 - 429 439 430 440 /* 431 441 * Description: Remove Key from table ··· 493 507 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%x ", pTable->KeyTable[i].abyBSSID[ii]); 494 508 } 495 509 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); 496 - 497 510 498 511 return (true); 499 512 } ··· 621 636 else 622 637 pKey->KeyRSC = *KeyRSC; 623 638 624 - 625 639 pKey->dwTSC47_16 = 0; 626 640 pKey->wTSC15_0 = 0; 627 - 628 641 629 642 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"KeybSetKey(R): \n"); 630 643 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->bKeyValid: %d\n", pKey->bKeyValid); ··· 641 658 642 659 return (true); 643 660 } 644 - 645 661 646 662 /* 647 663 * Description: Set Key to table ··· 669 687 670 688 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetAllGroupKey: %X\n", 671 689 dwKeyIndex); 672 - 673 690 674 691 if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key 675 692 return (false);
-7
drivers/staging/vt6656/key.h
··· 38 38 #define MAX_KEY_LEN 32 39 39 #define AES_KEY_LEN 16 40 40 41 - 42 41 #define AUTHENTICATOR_KEY 0x10000000 43 42 #define USE_KEYRSC 0x20000000 44 43 #define PAIRWISE_KEY 0x40000000 ··· 50 51 #define KEY_CTL_TKIP 0x02 51 52 #define KEY_CTL_CCMP 0x03 52 53 #define KEY_CTL_INVALID 0xFF 53 - 54 54 55 55 typedef struct tagSKeyItem 56 56 { ··· 82 84 { 83 85 SKeyTable KeyTable[MAX_KEY_TABLE]; 84 86 } SKeyManagement, *PSKeyManagement; 85 - 86 - 87 - 88 - 89 - 90 87 91 88 void KeyvInitTable(struct vnt_private *, PSKeyManagement pTable); 92 89
-19
drivers/staging/vt6656/mac.c
··· 41 41 //static int msglevel =MSG_LEVEL_DEBUG; 42 42 static int msglevel =MSG_LEVEL_INFO; 43 43 44 - 45 - 46 - 47 - 48 44 /* 49 45 * Description: 50 46 * Write MAC Multicast Address Mask ··· 68 72 &byData1); 69 73 } 70 74 71 - 72 75 /* 73 76 * Description: 74 77 * Shut Down MAC ··· 93 98 void MACvSetBBType(struct vnt_private *pDevice, u8 byType) 94 99 { 95 100 u8 pbyData[2]; 96 - 97 101 98 102 pbyData[0] = byType; 99 103 pbyData[1] = EnCFG_BBType_MASK; ··· 125 131 u16 wOffset; 126 132 u8 byData; 127 133 128 - 129 134 byData = (u8) uEntryIdx; 130 135 131 136 wOffset = MISCFIFO_KEYETRY0; ··· 143 150 &byData 144 151 ); 145 152 } 146 - 147 153 148 154 /* 149 155 * Description: ··· 236 244 pbyData 237 245 ); 238 246 239 - 240 247 } 241 - 242 248 243 249 void MACvRegBitsOff(struct vnt_private *pDevice, u8 byRegOfs, u8 byBits) 244 250 { ··· 254 264 ); 255 265 } 256 266 257 - 258 267 void MACvRegBitsOn(struct vnt_private *pDevice, u8 byRegOfs, u8 byBits) 259 268 { 260 269 u8 pbyData[2]; 261 - 262 270 263 271 pbyData[0] = byBits; 264 272 pbyData[1] = byBits; ··· 274 286 { 275 287 u8 pbyData[2]; 276 288 277 - 278 289 pbyData[0] = (u8)(wData & 0xff); 279 290 pbyData[1] = (u8)(wData >> 8); 280 291 ··· 290 303 void MACvWriteBSSIDAddress(struct vnt_private *pDevice, u8 *pbyEtherAddr) 291 304 { 292 305 u8 pbyData[6]; 293 - 294 306 295 307 pbyData[0] = *((u8 *)pbyEtherAddr); 296 308 pbyData[1] = *((u8 *)pbyEtherAddr+1); ··· 311 325 { 312 326 u8 pbyData[2]; 313 327 314 - 315 328 pbyData[0] = EnCFG_ProtectMd; 316 329 pbyData[1] = EnCFG_ProtectMd; 317 330 ··· 326 341 void MACvDisableProtectMD(struct vnt_private *pDevice) 327 342 { 328 343 u8 pbyData[2]; 329 - 330 344 331 345 pbyData[0] = 0; 332 346 pbyData[1] = EnCFG_ProtectMd; ··· 343 359 { 344 360 u8 pbyData[2]; 345 361 346 - 347 362 pbyData[0] = EnCFG_BarkerPream; 348 363 pbyData[1] = EnCFG_BarkerPream; 349 364 ··· 359 376 { 360 377 u8 pbyData[2]; 361 378 362 - 363 379 pbyData[0] = 0; 364 380 pbyData[1] = EnCFG_BarkerPream; 365 381 ··· 370 388 pbyData 371 389 ); 372 390 } 373 - 374 391 375 392 void MACvWriteBeaconInterval(struct vnt_private *pDevice, u16 wInterval) 376 393 {
-10
drivers/staging/vt6656/mac.h
··· 37 37 #include "device.h" 38 38 #include "tmacro.h" 39 39 40 - 41 40 #define REV_ID_VT3253_A0 0x00 42 41 #define REV_ID_VT3253_A1 0x01 43 42 #define REV_ID_VT3253_B0 0x08 ··· 152 153 #define MAC_REG_RSPINF_A_48 0xF8 153 154 #define MAC_REG_RSPINF_A_54 0xFA 154 155 #define MAC_REG_RSPINF_A_72 0xFC 155 - 156 156 157 157 // 158 158 // Bits in the I2MCFG EEPROM register ··· 277 279 #define TCR_SYNCDCFOPT 0x02 // 278 280 #define TCR_AUTOBCNTX 0x01 // Beacon automatically transmit enable 279 281 280 - 281 282 //ISR1 282 283 #define ISR_GPIO3 0x40 283 284 #define ISR_RXNOBUF 0x08 ··· 372 375 // 373 376 #define MISCFFCTL_WRITE 0x0001 // 374 377 375 - 376 378 // Loopback mode 377 379 #define MAC_LB_EXT 0x02 // 378 380 #define MAC_LB_INTERNAL 0x01 // ··· 402 406 403 407 #define MAC_REVISION_A0 0x00 404 408 #define MAC_REVISION_A1 0x01 405 - 406 - 407 - 408 - 409 - 410 - 411 409 412 410 void MACvWriteMultiAddr(struct vnt_private *, u32, u8); 413 411 void MACbShutdown(struct vnt_private *);
-40
drivers/staging/vt6656/main_usb.c
··· 94 94 #define RX_DESC_DEF0 64 95 95 DEVICE_PARAM(RxDescriptors0,"Number of receive usb desc buffer"); 96 96 97 - 98 97 #define TX_DESC_DEF0 64 99 98 DEVICE_PARAM(TxDescriptors0,"Number of transmit usb desc buffer"); 100 99 101 100 #define CHANNEL_DEF 6 102 101 DEVICE_PARAM(Channel, "Channel number"); 103 - 104 102 105 103 /* PreambleType[] is the preamble length used for transmit. 106 104 0: indicate allows long preamble type ··· 114 116 115 117 #define FRAG_THRESH_DEF 2346 116 118 DEVICE_PARAM(FragThreshold, "Fragmentation threshold"); 117 - 118 119 119 120 #define DATA_RATE_DEF 13 120 121 /* datarate[] index ··· 144 147 2: indicate AP mode used 145 148 */ 146 149 147 - 148 150 /* PSMode[] 149 151 0: indicate disable power saving mode 150 152 1: indicate enable power saving mode ··· 151 155 152 156 #define PS_MODE_DEF 0 153 157 DEVICE_PARAM(PSMode, "Power saving mode"); 154 - 155 158 156 159 #define SHORT_RETRY_DEF 8 157 160 DEVICE_PARAM(ShortRetryLimit, "Short frame retry limits"); ··· 167 172 #define BBP_TYPE_DEF 2 168 173 DEVICE_PARAM(BasebandType, "baseband type"); 169 174 170 - 171 - 172 175 /* 80211hEnable[] 173 176 0: indicate disable 802.11h 174 177 1: indicate enable 802.11h ··· 175 182 #define X80211h_MODE_DEF 0 176 183 177 184 DEVICE_PARAM(b80211hEnable, "802.11h mode"); 178 - 179 185 180 186 /* 181 187 * Static vars definitions ··· 195 203 5700, 5745, 5765, 5785, 5805, 5825 196 204 }; 197 205 198 - 199 206 static const struct iw_handler_def iwctl_handler_def; 200 207 */ 201 - 202 208 203 209 static int vt6656_probe(struct usb_interface *intf, 204 210 const struct usb_device_id *id); ··· 233 243 unsigned char *dest, 234 244 unsigned char *source); 235 245 236 - 237 246 static void usb_device_reset(struct vnt_private *pDevice); 238 - 239 - 240 - 241 - 242 - 243 247 244 248 static void 245 249 device_set_options(struct vnt_private *pDevice) { ··· 273 289 pDevice->bDiversityRegCtlON = false; 274 290 } 275 291 276 - 277 292 static void device_init_diversity_timer(struct vnt_private *pDevice) 278 293 { 279 294 init_timer(&pDevice->TimerSQ3Tmax1); ··· 292 309 293 310 return; 294 311 } 295 - 296 312 297 313 /* 298 314 * initialization of MAC & BBP registers ··· 749 767 return; 750 768 } 751 769 752 - 753 770 static void device_free_rx_bufs(struct vnt_private *pDevice) 754 771 { 755 772 PRCB pRCB; ··· 786 805 return; 787 806 } 788 807 789 - 790 808 static bool device_alloc_bufs(struct vnt_private *pDevice) 791 809 { 792 810 793 811 PUSB_SEND_CONTEXT pTxContext; 794 812 PRCB pRCB; 795 813 int ii; 796 - 797 814 798 815 for (ii = 0; ii < pDevice->cbTD; ii++) { 799 816 ··· 817 838 DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "%s : alloc rx usb context failed\n", pDevice->dev->name); 818 839 goto free_tx; 819 840 } 820 - 821 841 822 842 pDevice->FirstRecvFreeList = NULL; 823 843 pDevice->LastRecvFreeList = NULL; ··· 847 869 pDevice->NumRecvFreeList++; 848 870 pRCB++; 849 871 } 850 - 851 872 852 873 pDevice->pControlURB = usb_alloc_urb(0, GFP_ATOMIC); 853 874 if (pDevice->pControlURB == NULL) { ··· 880 903 return false; 881 904 } 882 905 883 - 884 - 885 - 886 906 static bool device_init_defrag_cb(struct vnt_private *pDevice) 887 907 { 888 908 int i; ··· 903 929 return false; 904 930 } 905 931 906 - 907 - 908 932 static void device_free_frag_bufs(struct vnt_private *pDevice) 909 933 { 910 934 PSDeFragControlBlock pDeF; ··· 917 945 } 918 946 } 919 947 920 - 921 - 922 948 int device_alloc_frag_buf(struct vnt_private *pDevice, 923 949 PSDeFragControlBlock pDeF) 924 950 { ··· 930 960 return true; 931 961 } 932 962 933 - 934 - 935 963 static int device_open(struct net_device *dev) 936 964 { 937 965 struct vnt_private *pDevice = netdev_priv(dev); ··· 937 969 pDevice->fWPA_Authened = false; 938 970 939 971 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " device_open...\n"); 940 - 941 972 942 973 pDevice->rx_buf_sz = MAX_TOTAL_SIZE_WITH_ALL_HEADERS; 943 974 ··· 1023 1056 else 1024 1057 bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL); 1025 1058 1026 - 1027 1059 netif_stop_queue(pDevice->dev); 1028 1060 pDevice->flags |= DEVICE_FLAGS_OPENED; 1029 1061 ··· 1044 1078 return -ENOMEM; 1045 1079 } 1046 1080 1047 - 1048 - 1049 1081 static int device_close(struct net_device *dev) 1050 1082 { 1051 1083 struct vnt_private *pDevice = netdev_priv(dev); ··· 1058 1094 bScheduleCommand((void *) pDevice, WLAN_CMD_DISASSOCIATE, NULL); 1059 1095 mdelay(30); 1060 1096 } 1061 - 1062 1097 1063 1098 memset(pMgmt->abyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); 1064 1099 pMgmt->bShareKeyAlgorithm = false; ··· 1122 1159 1123 1160 if (!device) 1124 1161 return; 1125 - 1126 1162 1127 1163 usb_set_intfdata(intf, NULL); 1128 1164 usb_put_dev(interface_to_usbdev(intf)); ··· 1387 1425 u8 byTmpMode = 0; 1388 1426 int rc; 1389 1427 1390 - 1391 1428 spin_lock_irq(&pDevice->lock); 1392 1429 rc = CONTROLnsRequestIn(pDevice, 1393 1430 MESSAGE_TYPE_READ, ··· 1473 1512 1474 1513 return rc; 1475 1514 } 1476 - 1477 1515 1478 1516 static int ethtool_ioctl(struct net_device *dev, void *useraddr) 1479 1517 {
-10
drivers/staging/vt6656/mib.c
··· 43 43 44 44 static int msglevel =MSG_LEVEL_INFO; 45 45 46 - 47 - 48 - 49 - 50 46 /* 51 47 * Description: Update Isr Statistic Counter 52 48 * ··· 67 71 return; 68 72 } 69 73 70 - 71 74 if (byIsr0 & ISR_ACTX) // ISR, bit0 72 75 pStatistic->ISRStat.dwIsrTx0OK++; // TXDMA0 successful 73 76 ··· 85 90 if (byIsr0 & ISR_WATCHDOG) // ISR, bit7 86 91 pStatistic->ISRStat.dwIsrWatchDog++; 87 92 88 - 89 93 if (byIsr1 & ISR_FETALERR) // ISR, bit8 90 94 pStatistic->ISRStat.dwIsrUnrecoverableError++; 91 95 ··· 98 104 pStatistic->ISRStat.dwIsrRxNoBuf++; // Rx No Buff 99 105 100 106 } 101 - 102 107 103 108 /* 104 109 * Description: Update Rx Statistic Counter ··· 291 298 pStatistic->dwRsrRxPacket++; 292 299 pStatistic->dwRsrRxOctet += cbFrameLength; 293 300 294 - 295 301 if (IS_TYPE_DATA(pbyBuffer)) { 296 302 pStatistic->dwRsrRxData++; 297 303 } else if (IS_TYPE_MGMT(pbyBuffer)){ ··· 421 429 pStatistic->dwTsrDirected++; 422 430 } 423 431 } 424 - 425 - 426 432 427 433 /* 428 434 * Description: Update 802.11 mib counter
-17
drivers/staging/vt6656/mib.h
··· 32 32 #include "tether.h" 33 33 #include "desc.h" 34 34 35 - 36 - 37 35 // 38 36 // USB counter 39 37 // ··· 40 42 41 43 } SUSBCounter, *PSUSBCounter; 42 44 43 - 44 - 45 45 // 46 46 // 802.11 counter 47 47 // 48 - 49 48 50 49 typedef struct tagSDot11Counters { 51 50 /* unsigned long Length; // Length of structure */ ··· 73 78 * unsigned long long DecryptFailureCount; 74 79 */ 75 80 } SDot11Counters, *PSDot11Counters; 76 - 77 81 78 82 // 79 83 // MIB2 counter ··· 110 116 #define UP 1 // 111 117 #define DOWN 2 // 112 118 #define TESTING 3 // 113 - 114 119 115 120 // 116 121 // RMON counter ··· 176 183 177 184 } SCustomCounters, *PSCustomCounters; 178 185 179 - 180 186 // 181 187 // Custom counter 182 188 // ··· 206 214 ///////////////////////////////////// 207 215 } SISRCounters, *PSISRCounters; 208 216 209 - 210 217 // Value in the etherStatsStatus entry 211 218 #define VALID 1 // 212 219 #define CREATE_REQUEST 2 // 213 220 #define UNDER_CREATION 3 // 214 221 #define INVALID 4 // 215 - 216 222 217 223 // 218 224 // Tx packet information ··· 221 231 u16 wFIFOCtl; 222 232 u8 abyDestAddr[ETH_ALEN]; 223 233 } STxPktInfo, *PSTxPktInfo; 224 - 225 234 226 235 #define MAX_RATE 12 227 236 // ··· 308 319 u8 abyCntRxPattern[16]; 309 320 u8 abyCntTxPattern[16]; 310 321 311 - 312 - 313 322 // Software check.... 314 323 u32 dwCntRxDataErr; // rx buffer data software compare CRC err count 315 324 u32 dwCntDecryptErr; // rx buffer data software compare CRC err count 316 325 u32 dwCntRxICVErr; // rx buffer data software compare CRC err count 317 - 318 326 319 327 // 64-bit OID 320 328 unsigned long long ullTsrOK; ··· 350 364 unsigned long LinkQuality; 351 365 352 366 } SStatCounter, *PSStatCounter; 353 - 354 - 355 - 356 367 357 368 void STAvUpdateIsrStatCounter(PSStatCounter pStatistic, 358 369 u8 byIsr0,
-4
drivers/staging/vt6656/michael.c
··· 42 42 #include "tmacro.h" 43 43 #include "michael.h" 44 44 45 - 46 - 47 45 /* 48 46 * static u32 s_dwGetUINT32(u8 * p); Get u32 from 49 47 * 4 bytes LSByte first ··· 59 61 static u32 K0, K1; /* Key */ 60 62 static u32 M; /* Message accumulator (single word) */ 61 63 static unsigned int nBytesInM; /* # bytes in M */ 62 - 63 64 64 65 /* 65 66 static u32 s_dwGetUINT32 (u8 * p) ··· 127 130 /* Set the key */ 128 131 s_vSetKey(dwK0, dwK1); 129 132 } 130 - 131 133 132 134 void MIC_vUnInit(void) 133 135 {
-3
drivers/staging/vt6656/michael.h
··· 33 33 34 34 #include <linux/types.h> 35 35 36 - 37 - 38 36 void MIC_vInit(u32 dwK0, u32 dwK1); 39 37 40 38 void MIC_vUnInit(void); ··· 43 45 // Get the MIC result. Destination should accept 8 bytes of result. 44 46 // This also resets the message to empty. 45 47 void MIC_vGetMIC(u32 * pdwL, u32 * pdwR); 46 - 47 48 48 49 // Rotation functions on 32 bit values 49 50 #define ROL32(A, n) \
-4
drivers/staging/vt6656/power.c
··· 47 47 #include "control.h" 48 48 #include "rndis.h" 49 49 50 - 51 - 52 50 static int msglevel = MSG_LEVEL_INFO; 53 - 54 - 55 51 56 52 /* 57 53 *
-7
drivers/staging/vt6656/power.h
··· 29 29 #ifndef __POWER_H__ 30 30 #define __POWER_H__ 31 31 32 - 33 32 #define C_PWBT 1000 // micro sec. power up before TBTT 34 33 #define PS_FAST_INTERVAL 1 // Fast power saving listen interval 35 34 #define PS_MAX_INTERVAL 4 // MAX power saving listen interval 36 - 37 - 38 - 39 - 40 - 41 - 42 35 43 36 /* PSDevice pDevice */ 44 37 /* PSDevice hDeviceContext */
-18
drivers/staging/vt6656/rf.c
··· 61 61 #define VT3342_PWR_IDX_LEN 64 62 62 //}} 63 63 64 - 65 - 66 - 67 - 68 - 69 64 u8 abyAL2230InitTable[CB_AL2230_INIT_SEQ][3] = { 70 65 {0x03, 0xF7, 0x90}, 71 66 {0x03, 0x33, 0x31}, ··· 380 385 {0x02, 0x01, 0xAA} //RobertYu:20060523 381 386 }; 382 387 383 - 384 388 u8 abyVT3226_ChannelTable0[CB_MAX_CHANNEL_24G][3] = { 385 389 {0x01, 0x97, 0x83}, // channel = 1, Tf = 2412MHz 386 390 {0x01, 0x97, 0x83}, // channel = 2, Tf = 2417MHz ··· 415 421 }; 416 422 ///}}RobertYu 417 423 418 - 419 424 //{{RobertYu:20060502, TWIF 1.14, LO Current for 11b mode 420 425 u32 dwVT3226D0LoCurrentTable[CB_MAX_CHANNEL_24G] = { 421 426 0x0135C600+(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz ··· 433 440 0x0135C600+(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW // channel = 14, Tf = 2484MHz 434 441 }; 435 442 //}} 436 - 437 443 438 444 //{{RobertYu:20060609 439 445 u8 abyVT3342A0_InitTable[CB_VT3342_INIT_SEQ][3] = { /* 11b/g mode */ ··· 588 596 {0x03, 0x00, 0x04} // channel = 165, Tf = 5825MHz (56), TBD 589 597 }; 590 598 591 - 592 599 /*+ 593 600 * 594 601 * Power Table ··· 661 670 0x0407F900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW 662 671 }; 663 672 664 - 665 - 666 673 //{{ RobertYu:20050103, Channel 11a Number To Index 667 674 // 4.9G => Ch 183, 184, 185, 187, 188, 189, 192, 196 (Value:15 ~ 22) 668 675 // 5G => Ch 7, 8, 9, 11, 12, 16, 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64, ··· 692 703 }; 693 704 //}} RobertYu 694 705 695 - 696 706 /* 697 707 * Description: Write to IF/RF, by embedded programming 698 708 * ··· 716 728 CONTROLnsRequestOut(pDevice, 717 729 MESSAGE_TYPE_WRITE_IFRF, 0, 0, 4, pbyData); 718 730 719 - 720 731 return true; 721 732 } 722 - 723 733 724 734 /* 725 735 * Description: Set Tx power ··· 770 784 return bResult; 771 785 } 772 786 773 - 774 787 /* 775 788 * Description: Set Tx power 776 789 * ··· 817 832 bResult &= IFRFbWriteEmbedded(pDevice, 0x00099B00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW); 818 833 } 819 834 break; 820 - 821 835 822 836 case RF_AIROHA7230: 823 837 { ··· 953 969 954 970 *pldBm = -1 * (a + b * 2); 955 971 } 956 - 957 - 958 972 959 973 void RFbRFTableDownload(struct vnt_private *pDevice) 960 974 {
-3
drivers/staging/vt6656/rf.h
··· 53 53 #define RF_EMU 0x80 54 54 #define RF_MASK 0x7F 55 55 56 - 57 - 58 - 59 56 extern const u8 RFaby11aChannelIndex[200]; 60 57 61 58 int IFRFbWriteEmbedded(struct vnt_private *, u32 dwData);
-7
drivers/staging/vt6656/rndis.h
··· 27 27 * 28 28 */ 29 29 30 - 31 30 #ifndef __RNDIS_H__ 32 31 #define __RNDIS_H__ 33 32 ··· 64 65 #define MESSAGE_REQUEST_RF_CH1 0x0C 65 66 #define MESSAGE_REQUEST_RF_CH2 0x0D 66 67 67 - 68 68 #define VIAUSB20_PACKET_HEADER 0x04 69 - 70 - 71 69 72 70 typedef struct _CMD_MESSAGE 73 71 { ··· 144 148 u16 wRSPINF_a[9]; 145 149 } CMD_CHANGE_BBTYPE, *PCMD_CHANGE_BBTYPE; 146 150 147 - 148 151 #define EXCH_WORD(w) ((u16)((u16)(w)<<8) | (u16)((u16)(w)>>8)) 149 - 150 - 151 152 152 153 #endif /* _RNDIS_H_ */
-51
drivers/staging/vt6656/rxtx.c
··· 63 63 #include "usbpipe.h" 64 64 #include "iocmd.h" 65 65 66 - 67 - 68 66 static int msglevel = MSG_LEVEL_INFO; 69 - 70 - 71 67 72 68 const u16 wTimeStampOff[2][MAX_RATE] = { 73 69 {384, 288, 226, 209, 54, 43, 37, 31, 28, 25, 24, 23}, // Long Preamble ··· 78 82 {RATE_12M, RATE_18M, RATE_24M, RATE_24M, RATE_36M}, // fallback_rate0 79 83 {RATE_6M , RATE_6M, RATE_12M, RATE_12M, RATE_18M}, // fallback_rate1 80 84 }; 81 - 82 85 83 86 #define RTSDUR_BB 0 84 87 #define RTSDUR_BA 1 ··· 94 99 #define DATADUR_A_F0 12 95 100 #define DATADUR_A_F1 13 96 101 97 - 98 102 static void s_vSaveTxPktInfo(struct vnt_private *pDevice, u8 byPktNum, 99 103 u8 *pbyDestAddr, u16 wPktLength, u16 wFIFOCtl); 100 104 ··· 108 114 u8 byPktType, u16 wCurrentRate, void *pTxDataHead, u32 cbFrameLength, 109 115 u32 uDMAIdx, int bNeedAck, u32 uFragIdx, u32 cbLastFragmentSize, 110 116 u32 uMACfragNum, u8 byFBOption); 111 - 112 117 113 118 static void s_vGenerateMACHeader(struct vnt_private *pDevice, 114 119 u8 *pbyBufferAddr, u16 wDuration, struct ethhdr *psEthHeader, ··· 143 150 u8 byDurType, u32 cbFrameLength, u8 byPktType, u16 wRate, 144 151 int bNeedAck, u8 byFBOption); 145 152 146 - 147 - 148 153 static void *s_vGetFreeContext(struct vnt_private *pDevice) 149 154 { 150 155 PUSB_SEND_CONTEXT pContext = NULL; ··· 164 173 } 165 174 return (void *) pReturnContext; 166 175 } 167 - 168 176 169 177 static void s_vSaveTxPktInfo(struct vnt_private *pDevice, u8 byPktNum, 170 178 u8 *pbyDestAddr, u16 wPktLength, u16 wFIFOCtl) ··· 193 203 u16 wValue; 194 204 struct ieee80211_hdr *pMACHeader = (struct ieee80211_hdr *)pbyHdrBuf; 195 205 u32 dwRevIVCounter; 196 - 197 206 198 207 //Fill TXKEY 199 208 if (pTransmitKey == NULL) ··· 291 302 } 292 303 } 293 304 294 - 295 305 static void s_vSWencryption(struct vnt_private *pDevice, 296 306 PSKeyItem pTransmitKey, u8 *pbyPayloadHead, u16 wPayloadSize) 297 307 { ··· 326 338 } 327 339 } 328 340 329 - 330 - 331 - 332 341 /*byPktType : PK_TYPE_11A 0 333 342 PK_TYPE_11B 1 334 343 PK_TYPE_11GB 2 ··· 358 373 u32 uRrvTime, uRTSTime, uCTSTime, uAckTime, uDataTime; 359 374 360 375 uRrvTime = uRTSTime = uCTSTime = uAckTime = uDataTime = 0; 361 - 362 376 363 377 uDataTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, cbFrameLength, wCurrentRate); 364 378 if (byRTSRsvType == 0) { //RTSTxRrvTime_bb ··· 423 439 } 424 440 } 425 441 break; 426 - 427 442 428 443 case DATADUR_A: //DATADUR_A 429 444 if (((uMACfragNum==1)) || (bLastFrag==1)) {//Non Frag or Last Frag ··· 542 559 return 0; 543 560 } 544 561 545 - 546 562 //byFreqType: 0=>5GHZ 1=>2.4GHZ 547 563 static u32 s_uGetRTSCTSDuration(struct vnt_private *pDevice, u8 byDurType, 548 564 u32 cbFrameLength, u8 byPktType, u16 wRate, int bNeedAck, 549 565 u8 byFBOption) 550 566 { 551 567 u32 uCTSTime = 0, uDurTime = 0; 552 - 553 568 554 569 switch (byDurType) { 555 570 ··· 1300 1319 } 1301 1320 } 1302 1321 1303 - 1304 1322 if ((bNeedEncryption) && (pTransmitKey != NULL)) { 1305 1323 if (pTransmitKey->byCipherSuite == KEY_CTL_WEP) { 1306 1324 cbIVlen = 4; ··· 1414 1434 pbyIVHead = (u8 *)(pbyMacHdr + cbMACHdLen + uPadding); 1415 1435 pbyPayloadHead = (u8 *)(pbyMacHdr + cbMACHdLen + uPadding + cbIVlen); 1416 1436 1417 - 1418 1437 //========================= 1419 1438 // No Fragmentation 1420 1439 //========================= ··· 1421 1442 byFragType = FRAGCTL_NONFRAG; 1422 1443 //uDMAIdx = TYPE_AC0DMA; 1423 1444 //pTxBufHead = (PSTxBufHead) &(pTxBufHead->adwTxKey[0]); 1424 - 1425 1445 1426 1446 //Fill FIFO,RrvTime,RTS,and CTS 1427 1447 s_vGenerateTxParameter(pDevice, byPktType, wCurrentRate, ··· 1462 1484 } 1463 1485 1464 1486 } 1465 - 1466 1487 1467 1488 if (pPacket != NULL) { 1468 1489 // Copy the Packet into a tx Buffer ··· 1527 1550 //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC:%lX, %lX\n", *pdwMIC_L, *pdwMIC_R); 1528 1551 } 1529 1552 1530 - 1531 1553 if (bSoftWEP == true) { 1532 1554 1533 1555 s_vSWencryption(pDevice, pTransmitKey, (pbyPayloadHead), (u16)(cbFrameBodySize + cbMIClen)); ··· 1557 1581 *pcbHeaderLen = cbHeaderLength; 1558 1582 *pcbTotalLen = cbHeaderLength + cbFrameSize ; 1559 1583 1560 - 1561 1584 //Set FragCtl in TxBufferHead 1562 1585 pTxBufHead->wFragCtl |= (u16)byFragType; 1563 - 1564 1586 1565 1587 return true; 1566 1588 1567 1589 } 1568 - 1569 1590 1570 1591 /*+ 1571 1592 * ··· 1657 1684 } 1658 1685 } 1659 1686 1660 - 1661 - 1662 1687 /*+ 1663 1688 * 1664 1689 * Description: ··· 1694 1723 u32 cbMacHdLen; 1695 1724 u16 wCurrentRate = RATE_1M; 1696 1725 1697 - 1698 - 1699 1726 pContext = (PUSB_SEND_CONTEXT)s_vGetFreeContext(pDevice); 1700 1727 1701 1728 if (NULL == pContext) { ··· 1726 1757 RFbSetPower(pDevice, wCurrentRate, pMgmt->uCurrChannel); 1727 1758 } 1728 1759 pDevice->wCurrentRate = wCurrentRate; 1729 - 1730 1760 1731 1761 //Set packet type 1732 1762 if (byPktType == PK_TYPE_11A) {//0000 0000 0000 0000 ··· 1849 1881 //========================= 1850 1882 pTxBufHead->wFragCtl |= (u16)FRAGCTL_NONFRAG; 1851 1883 1852 - 1853 1884 //Fill FIFO,RrvTime,RTS,and CTS 1854 1885 s_vGenerateTxParameter(pDevice, byPktType, wCurrentRate, pbyTxBufferAddr, pvRrvTime, pvRTS, pCTS, 1855 1886 cbFrameSize, bNeedACK, TYPE_TXDMA0, &sEthHeader); ··· 1926 1959 } 1927 1960 } 1928 1961 1929 - 1930 1962 pTX_Buffer->wTxByteCount = cpu_to_le16((u16)(cbReqCount)); 1931 1963 pTX_Buffer->byPKTNO = (u8) (((wCurrentRate<<4) &0x00F0) | ((pDevice->wSeqCounter - 1) & 0x000F)); 1932 1964 pTX_Buffer->byType = 0x00; ··· 1945 1979 return CMD_STATUS_PENDING; 1946 1980 } 1947 1981 1948 - 1949 1982 CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice, 1950 1983 struct vnt_tx_mgmt *pPacket) 1951 1984 { ··· 1961 1996 u8 *pbyTxBufferAddr; 1962 1997 PUSB_SEND_CONTEXT pContext; 1963 1998 CMD_STATUS status; 1964 - 1965 1999 1966 2000 pContext = (PUSB_SEND_CONTEXT)s_vGetFreeContext(pDevice); 1967 2001 if (NULL == pContext) { ··· 2029 2065 2030 2066 } 2031 2067 2032 - 2033 2068 void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb) 2034 2069 { 2035 2070 struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; ··· 2061 2098 u32 cbExtSuppRate = 0; 2062 2099 PTX_BUFFER pTX_Buffer; 2063 2100 PUSB_SEND_CONTEXT pContext; 2064 - 2065 2101 2066 2102 pvRrvTime = pMICHDR = pvRTS = pvCTS = pvTxDataHd = NULL; 2067 2103 ··· 2178 2216 } 2179 2217 } 2180 2218 2181 - 2182 2219 //Set FRAGCTL_MACHDCNT 2183 2220 pTxBufHead->wFragCtl |= cpu_to_le16((u16)cbMacHdLen << 10); 2184 2221 ··· 2185 2224 // Although spec says MMPDU can be fragmented; In most case, 2186 2225 // no one will send a MMPDU under fragmentation. With RTS may occur. 2187 2226 pDevice->bAES = false; //Set FRAGCTL_WEPTYP 2188 - 2189 2227 2190 2228 if (WLAN_GET_FC_ISWEP(p80211Header->sA4.wFrameCtl) != 0) { 2191 2229 if (pDevice->eEncryptionStatus == Ndis802_11Encryption1Enabled) { ··· 2221 2261 } 2222 2262 //the rest of pTxBufHead->wFragCtl:FragTyp will be set later in s_vFillFragParameter() 2223 2263 2224 - 2225 2264 if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {//802.11g packet 2226 2265 2227 2266 pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize); ··· 2252 2293 // No Fragmentation 2253 2294 //========================= 2254 2295 pTxBufHead->wFragCtl |= (u16)FRAGCTL_NONFRAG; 2255 - 2256 2296 2257 2297 //Fill FIFO,RrvTime,RTS,and CTS 2258 2298 s_vGenerateTxParameter(pDevice, byPktType, wCurrentRate, pbyTxBufferAddr, pvRrvTime, pvRTS, pvCTS, ··· 2362 2404 if (pDevice->wSeqCounter > 0x0fff) 2363 2405 pDevice->wSeqCounter = 0; 2364 2406 2365 - 2366 2407 if (bIsPSPOLL) { 2367 2408 // The MAC will automatically replace the Duration-field of MAC header by Duration-field 2368 2409 // of FIFO control header. ··· 2394 2437 return ; 2395 2438 2396 2439 } 2397 - 2398 - 2399 - 2400 2440 2401 2441 //TYPE_AC0DMA data tx 2402 2442 /* ··· 2434 2480 u32 status; 2435 2481 u16 wKeepRate = pDevice->wCurrentRate; 2436 2482 int bTxeapol_key = false; 2437 - 2438 2483 2439 2484 if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { 2440 2485 ··· 2789 2836 2790 2837 } 2791 2838 2792 - 2793 - 2794 2839 /* 2795 2840 * Description: 2796 2841 * Relay packet send (AC1DMA) from rx dpc. ··· 2820 2869 PTX_BUFFER pTX_Buffer; 2821 2870 u32 status; 2822 2871 u16 wKeepRate = pDevice->wCurrentRate; 2823 - 2824 - 2825 2872 2826 2873 pContext = (PUSB_SEND_CONTEXT)s_vGetFreeContext(pDevice); 2827 2874
-32
drivers/staging/vt6656/rxtx.h
··· 32 32 #include "device.h" 33 33 #include "wcmd.h" 34 34 35 - 36 - 37 35 // 38 36 // RTS buffer header 39 37 // ··· 60 62 u32 adwHDR1[4]; 61 63 u32 adwHDR2[4]; 62 64 } SMICHDR, *PSMICHDR; 63 - 64 65 65 66 typedef struct tagSTX_NAF_G_RTS 66 67 { ··· 167 170 168 171 } TX_NAF_G_CTS, *PTX_NAF_G_CTS; 169 172 170 - 171 173 typedef struct tagSTX_NAF_G_CTS_MIC 172 174 { 173 175 //RsvTime ··· 174 178 u16 wReserved2; 175 179 u16 wTxRrvTime_b; 176 180 u16 wTxRrvTime_a; 177 - 178 181 179 182 SMICHDR sMICHDR; 180 183 ··· 199 204 200 205 } TX_NAF_G_CTS_MIC, *PTX_NAF_G_CTS_MIC; 201 206 202 - 203 207 typedef struct tagSTX_NAF_G_BEACON 204 208 { 205 209 u16 wFIFOCtl; ··· 219 225 u16 wDuration_a; 220 226 u16 wTimeStampOff_a; 221 227 222 - 223 228 } TX_NAF_G_BEACON, *PTX_NAF_G_BEACON; 224 - 225 229 226 230 typedef struct tagSTX_NAF_AB_RTS 227 231 { ··· 242 250 u16 wDuration_ab; 243 251 u16 wTimeStampOff_ab; 244 252 245 - 246 253 } TX_NAF_AB_RTS, *PTX_NAF_AB_RTS; 247 - 248 254 249 255 typedef struct tagSTX_NAF_AB_RTS_MIC 250 256 { ··· 267 277 u16 wDuration_ab; 268 278 u16 wTimeStampOff_ab; 269 279 270 - 271 280 } TX_NAF_AB_RTS_MIC, *PTX_NAF_AB_RTS_MIC; 272 - 273 - 274 281 275 282 typedef struct tagSTX_NAF_AB_CTS 276 283 { ··· 300 313 u16 wTimeStampOff_ab; 301 314 302 315 } TX_NAF_AB_CTS_MIC, *PTX_NAF_AB_CTS_MIC; 303 - 304 316 305 317 typedef struct tagSTX_NAF_AB_BEACON 306 318 { ··· 358 372 359 373 } TX_AF_G_RTS, *PTX_AF_G_RTS; 360 374 361 - 362 375 typedef struct tagSTX_AF_G_RTS_MIC 363 376 { 364 377 //RsvTime ··· 403 418 404 419 } TX_AF_G_RTS_MIC, *PTX_AF_G_RTS_MIC; 405 420 406 - 407 - 408 421 typedef struct tagSTX_AF_G_CTS 409 422 { 410 423 //RsvTime ··· 437 454 438 455 } TX_AF_G_CTS, *PTX_AF_G_CTS; 439 456 440 - 441 457 typedef struct tagSTX_AF_G_CTS_MIC 442 458 { 443 459 //RsvTime ··· 444 462 u16 wReserved2; 445 463 u16 wTxRrvTime_b; 446 464 u16 wTxRrvTime_a; 447 - 448 465 449 466 SMICHDR sMICHDR; 450 467 ··· 473 492 474 493 } TX_AF_G_CTS_MIC, *PTX_AF_G_CTS_MIC; 475 494 476 - 477 - 478 495 typedef struct tagSTX_AF_A_RTS 479 496 { 480 497 //RsvTime ··· 499 520 u16 wDuration_a_f1; 500 521 501 522 } TX_AF_A_RTS, *PTX_AF_A_RTS; 502 - 503 523 504 524 typedef struct tagSTX_AF_A_RTS_MIC 505 525 { ··· 529 551 530 552 } TX_AF_A_RTS_MIC, *PTX_AF_A_RTS_MIC; 531 553 532 - 533 - 534 554 typedef struct tagSTX_AF_A_CTS 535 555 { 536 556 //RsvTime ··· 545 569 u16 wDuration_a_f1; 546 570 547 571 } TX_AF_A_CTS, *PTX_AF_A_CTS; 548 - 549 572 550 573 typedef struct tagSTX_AF_A_CTS_MIC 551 574 { ··· 564 589 u16 wDuration_a_f1; 565 590 566 591 } TX_AF_A_CTS_MIC, *PTX_AF_A_CTS_MIC; 567 - 568 592 569 593 // 570 594 // union with all of the TX Buffer Type ··· 591 617 592 618 } TX_BUFFER_CONTAINER, *PTX_BUFFER_CONTAINER; 593 619 594 - 595 620 // 596 621 // Remote NDIS message format 597 622 // ··· 606 633 u16 wFragCtl; 607 634 u16 wReserved; 608 635 609 - 610 636 // Actual message 611 637 TX_BUFFER_CONTAINER BufferHeader; 612 638 613 639 } TX_BUFFER, *PTX_BUFFER; 614 - 615 640 616 641 // 617 642 // Remote NDIS message format ··· 627 656 TX_BUFFER_CONTAINER BufferHeader; 628 657 629 658 } BEACON_BUFFER, *PBEACON_BUFFER; 630 - 631 - 632 - 633 659 634 660 void vDMA0_tx_80211(struct vnt_private *, struct sk_buff *skb); 635 661 int nsDMA_tx_packet(struct vnt_private *, u32 uDMAIdx, struct sk_buff *skb);
-7
drivers/staging/vt6656/srom.h
··· 30 30 #ifndef __SROM_H__ 31 31 #define __SROM_H__ 32 32 33 - 34 33 #define EEP_MAX_CONTEXT_SIZE 256 35 34 36 35 #define CB_EEPROM_READBYTE_WAIT 900 //us ··· 51 52 #define EEP_OFS_PWR_CCK 0x20 52 53 #define EEP_OFS_SETPT_CCK 0x21 53 54 #define EEP_OFS_PWR_OFDMG 0x23 54 - 55 55 56 56 #define EEP_OFS_CALIB_TX_IQ 0x24 57 57 #define EEP_OFS_CALIB_TX_DC 0x25 ··· 74 76 // Bits in EEP_OFS_RADIOCTL 75 77 // 76 78 #define EEP_RADIOCTL_ENABLE 0x80 77 - 78 79 79 80 // AT24C02 eeprom contents 80 81 // 2048 bits = 256 bytes = 128 words ··· 108 111 u8 abyReserved0[96]; // 0x10 (u16) 109 112 u8 abyCIS[128]; // 0x80 (u16) 110 113 } SSromReg, *PSSromReg; 111 - 112 - 113 - 114 - 115 114 116 115 #endif /* __EEPROM_H__ */
-11
drivers/staging/vt6656/tcrc.c
··· 35 35 36 36 #include "tcrc.h" 37 37 38 - 39 - 40 - 41 38 /* 32-bit CRC table */ 42 39 static const u32 s_adwCrc32Table[256] = { 43 40 0x00000000L, 0x77073096L, 0xEE0E612CL, 0x990951BAL, ··· 103 106 0xB40BBE37L, 0xC30C8EA1L, 0x5A05DF1BL, 0x2D02EF8DL 104 107 }; 105 108 106 - 107 - 108 - 109 - 110 - 111 109 /*+ 112 110 * 113 111 * Description: ··· 133 141 return dwCrc; 134 142 } 135 143 136 - 137 144 /*+ 138 145 * 139 146 * Description: ··· 155 164 { 156 165 return ~CRCdwCrc32(pbyData, cbByte, 0xFFFFFFFFL); 157 166 } 158 - 159 167 160 168 /*+ 161 169 * ··· 180 190 { 181 191 return CRCdwCrc32(pbyData, cbByte, dwPreCRC); 182 192 } 183 - 184 193
-6
drivers/staging/vt6656/tcrc.h
··· 31 31 32 32 #include <linux/types.h> 33 33 34 - 35 - 36 - 37 - 38 - 39 - 40 34 u32 CRCdwCrc32(u8 * pbyData, unsigned int cbByte, u32 dwCrcSeed); 41 35 u32 CRCdwGetCrc32(u8 * pbyData, unsigned int cbByte); 42 36 u32 CRCdwGetCrc32Ex(u8 * pbyData, unsigned int cbByte, u32 dwPreCRC);
-5
drivers/staging/vt6656/tether.c
··· 36 36 #include "tcrc.h" 37 37 #include "tether.h" 38 38 39 - 40 - 41 - 42 - 43 - 44 39 /* 45 40 * Description: Check CRC value of the buffer if Ok or not 46 41 *
-8
drivers/staging/vt6656/tether.h
··· 64 64 #define TYPE_CTL_CTS 0xc400 65 65 #define TYPE_CTL_ACK 0xd400 66 66 67 - 68 - 69 67 #else //if LITTLE_ENDIAN 70 68 // 71 69 // wType field in the SEthernetHeader ··· 95 97 #define TYPE_CTL_CTS 0x00c4 96 98 #define TYPE_CTL_ACK 0x00d4 97 99 98 - 99 - 100 100 #endif //#ifdef __BIG_ENDIAN 101 101 102 102 #define WEP_IV_MASK 0x00FFFFFF ··· 108 112 u16 wLen; 109 113 } __attribute__ ((__packed__)) 110 114 S802_3Header, *PS802_3Header; 111 - 112 - 113 - 114 - 115 115 116 116 //u8 ETHbyGetHashIndexByCrc(u8 * pbyMultiAddr); 117 117 bool ETHbIsBufferCrc32Ok(u8 * pbyBuffer, unsigned int cbFrameLength);
-13
drivers/staging/vt6656/tkip.c
··· 35 35 #include "tmacro.h" 36 36 #include "tkip.h" 37 37 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 38 /* The Sbox is reduced to 2 16-bit wide tables, each with 256 entries. */ 47 39 /* The 2nd table is the same as the 1st but with the upper and lower */ 48 40 /* bytes swapped. To allow an endian tolerant implementation, the byte */ ··· 109 117 0x82,0x29,0x5A,0x1E,0x7B,0xA8,0x6D,0x2C 110 118 }; 111 119 112 - 113 120 //STKIPKeyManagement sTKIPKeyTable[MAX_TKIP_KEY]; 114 - 115 - 116 121 117 122 /************************************************************/ 118 123 /* tkip_sbox() */ ··· 131 142 return (left ^ right); 132 143 }; 133 144 134 - 135 145 static unsigned int rotr1(unsigned int a) 136 146 { 137 147 unsigned int b; ··· 143 155 b = b % 65536; 144 156 return b; 145 157 } 146 - 147 158 148 159 /* 149 160 * Description: Calculate RC4Key fom TK, TA, and TSC
-5
drivers/staging/vt6656/tkip.h
··· 34 34 35 35 #define TKIP_KEY_LEN 16 36 36 37 - 38 - 39 - 40 - 41 - 42 37 void TKIPvMixKey( 43 38 u8 * pbyTKey, 44 39 u8 * pbyTA,
-23
drivers/staging/vt6656/usbpipe.c
··· 54 54 //static int msglevel =MSG_LEVEL_DEBUG; 55 55 static int msglevel =MSG_LEVEL_INFO; 56 56 57 - 58 57 #define USB_CTL_WAIT 500 //ms 59 58 60 59 #ifndef URB_ASYNC_UNLINK 61 60 #define URB_ASYNC_UNLINK 0 62 61 #endif 63 62 64 - 65 - 66 63 static void s_nsInterruptUsbIoCompleteRead(struct urb *urb); 67 64 static void s_nsBulkInUsbIoCompleteRead(struct urb *urb); 68 65 static void s_nsBulkOutIoCompleteWrite(struct urb *urb); 69 66 static void s_nsControlInUsbIoCompleteRead(struct urb *urb); 70 67 static void s_nsControlInUsbIoCompleteWrite(struct urb *urb); 71 - 72 - 73 68 74 69 int PIPEnsControlOutAsyn(struct vnt_private *pDevice, u8 byRequest, 75 70 u16 wValue, u16 wIndex, u16 wLength, u8 *pbyBuffer) ··· 240 245 MP_CLEAR_FLAG(pDevice, fMP_CONTROL_WRITES); 241 246 } 242 247 243 - 244 - 245 248 /* 246 249 * Description: 247 250 * Complete function of usb Control callback ··· 274 281 275 282 MP_CLEAR_FLAG(pDevice, fMP_CONTROL_READS); 276 283 } 277 - 278 - 279 - 280 284 281 285 /* 282 286 * Description: ··· 324 334 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"<----s_nsStartInterruptUsbRead Return(%x)\n",ntStatus); 325 335 return ntStatus; 326 336 } 327 - 328 337 329 338 /* 330 339 * Description: ··· 386 397 387 398 STAvUpdateUSBCounter(&pDevice->scStatistic.USB_InterruptStat, ntStatus); 388 399 389 - 390 400 if (pDevice->fKillEventPollingThread != true) { 391 401 usb_fill_bulk_urb(pDevice->pInterruptURB, 392 402 pDevice->usb, ··· 426 438 int ntStatus = 0; 427 439 struct urb *pUrb; 428 440 429 - 430 441 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsStartBulkInUsbRead\n"); 431 442 432 443 if (pDevice->Flags & fMP_DISCONNECTED) 433 444 return STATUS_FAILURE; 434 445 435 446 pDevice->ulBulkInPosted++; 436 - 437 447 438 448 pUrb = pRCB->pUrb; 439 449 // ··· 461 475 462 476 return ntStatus; 463 477 } 464 - 465 - 466 - 467 478 468 479 /* 469 480 * Description: ··· 512 529 pDevice->scStatistic.RxOkCnt ++; 513 530 } 514 531 515 - 516 532 STAvUpdateUSBCounter(&pDevice->scStatistic.USB_BulkInStat, status); 517 533 518 534 if (bIndicateReceive) { ··· 528 546 RXvFreeRCB(pRCB, bReAllocSkb); 529 547 spin_unlock(&pDevice->lock); 530 548 } 531 - 532 549 533 550 return; 534 551 } ··· 550 569 { 551 570 int status; 552 571 struct urb *pUrb; 553 - 554 - 555 572 556 573 pDevice->bPWBitOn = false; 557 574 ··· 630 651 unsigned long ulBufLen; 631 652 PUSB_SEND_CONTEXT pContext; 632 653 633 - 634 654 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsBulkOutIoCompleteWrite\n"); 635 655 // 636 656 // The context given to IoSetCompletionRoutine is an USB_CONTEXT struct ··· 676 698 } 677 699 678 700 pDevice->dev->trans_start = jiffies; 679 - 680 701 681 702 if (status == STATUS_SUCCESS) { 682 703 pDevice->packetsSent++;
-4
drivers/staging/vt6656/usbpipe.h
··· 32 32 33 33 #include "device.h" 34 34 35 - 36 - 37 - 38 - 39 35 int PIPEnsControlOut(struct vnt_private *, u8 byRequest, u16 wValue, 40 36 u16 wIndex, u16 wLength, u8 *pbyBuffer); 41 37 int PIPEnsControlOutAsyn(struct vnt_private *, u8 byRequest,
-24
drivers/staging/vt6656/wcmd.c
··· 55 55 #include "channel.h" 56 56 #include "iowpa.h" 57 57 58 - 59 - 60 - 61 - 62 - 63 58 static int msglevel =MSG_LEVEL_INFO; 64 59 //static int msglevel =MSG_LEVEL_DEBUG; 65 60 ··· 64 69 struct vnt_manager *pMgmt, u8 *pScanBSSID, PWLAN_IE_SSID pSSID, 65 70 PWLAN_IE_SUPP_RATES pCurrRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates); 66 71 67 - 68 72 static int s_bCommandComplete(struct vnt_private *); 69 73 70 - 71 74 static int s_bClearBSSID_SCAN(struct vnt_private *); 72 - 73 - 74 75 75 76 /* 76 77 * Description: ··· 122 131 123 132 } /* vAdHocBeaconStop */ 124 133 125 - 126 134 /* 127 135 * Description: 128 136 * Restart AdHoc beacon after scan process complete ··· 154 164 155 165 } 156 166 157 - 158 167 /*+ 159 168 * 160 169 * Routine Description: ··· 181 192 4, 0x02, 0x04, 0x0B, 0x16}; 182 193 u8 *pbyRate; 183 194 int ii; 184 - 185 195 186 196 if (pDevice->byBBType == BB_TYPE_11A) { 187 197 pbyRate = &abyCurrSuppRatesA[0]; ··· 213 225 214 226 } 215 227 216 - 217 - 218 - 219 228 /*+ 220 229 * 221 230 * Routine Description: ··· 224 239 * 225 240 -*/ 226 241 227 - 228 242 struct vnt_tx_mgmt *s_MgrMakeProbeRequest(struct vnt_private *pDevice, 229 243 struct vnt_manager *pMgmt, u8 *pScanBSSID, PWLAN_IE_SSID pSSID, 230 244 PWLAN_IE_SUPP_RATES pCurrRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates) 231 245 { 232 246 struct vnt_tx_mgmt *pTxPacket = NULL; 233 247 WLAN_FR_PROBEREQ sFrame; 234 - 235 248 236 249 pTxPacket = (struct vnt_tx_mgmt *)pMgmt->pbyMgmtPacketPool; 237 250 memset(pTxPacket, 0, sizeof(struct vnt_tx_mgmt) ··· 291 308 int ii; 292 309 u8 byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; 293 310 u8 byData; 294 - 295 311 296 312 if (pDevice->dwDiagRefCount != 0) 297 313 return; ··· 477 495 CARDbRadioPowerOff(pDevice); 478 496 s_bCommandComplete(pDevice); 479 497 break; 480 - 481 498 482 499 case WLAN_CMD_SSID_START: 483 500 ··· 884 903 s_bCommandComplete(pDevice); 885 904 break; 886 905 887 - 888 906 case WLAN_CMD_CHANGE_BBSENSITIVITY_START: 889 907 890 908 pDevice->bStopDataPkt = true; ··· 934 954 s_bCommandComplete(pDevice); 935 955 break; 936 956 937 - 938 957 case WLAN_CMD_MAC_DISPOWERSAVING_START: 939 958 ControlvReadByte (pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PSCTL, &byData); 940 959 if ( (byData & PSCTL_PS) != 0 ) { ··· 966 987 return; 967 988 } 968 989 969 - 970 990 static int s_bCommandComplete(struct vnt_private *pDevice) 971 991 { 972 992 struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; 973 993 PWLAN_IE_SSID pSSID; 974 994 int bRadioCmd = false; 975 995 int bForceSCAN = true; 976 - 977 996 978 997 pDevice->eCommandState = WLAN_CMD_IDLE; 979 998 if (pDevice->cbFreeCmdQueue == CMD_Q_SIZE) { ··· 1152 1175 } 1153 1176 return true; 1154 1177 } 1155 - 1156 1178 1157 1179 //mike add:reset command timer 1158 1180 void vResetCommandTimer(struct vnt_private *pDevice)
-7
drivers/staging/vt6656/wcmd.h
··· 32 32 #include "80211hdr.h" 33 33 #include "80211mgr.h" 34 34 35 - 36 - 37 - 38 35 #define AUTHENTICATE_TIMEOUT 1000 //ms 39 36 #define ASSOCIATE_TIMEOUT 1000 //ms 40 - 41 37 42 38 // Command code 43 39 typedef enum tagCMD_CODE { ··· 98 102 WLAN_CMD_11H_CHSW_START, 99 103 WLAN_CMD_IDLE 100 104 } CMD_STATE, *PCMD_STATE; 101 - 102 - 103 - 104 105 105 106 struct vnt_private; 106 107
-8
drivers/staging/vt6656/wctl.c
··· 39 39 #include "card.h" 40 40 #include "tmacro.h" 41 41 42 - 43 - 44 42 // static int msglevel =MSG_LEVEL_INFO; 45 - 46 - 47 - 48 43 49 44 /* 50 45 * Description: ··· 155 160 return(pDevice->cbDFCB); 156 161 } 157 162 158 - 159 163 /* 160 164 * Description: 161 165 * Handle received fragment packet ··· 174 180 bool WCTLbHandleFragment(struct vnt_private *pDevice, struct ieee80211_hdr *pMACHeader, unsigned int cbFrameLength, bool bWEP, bool bExtIV) 175 181 { 176 182 unsigned int uHeaderSize; 177 - 178 183 179 184 if (bWEP == true) { 180 185 uHeaderSize = 28; ··· 242 249 return(false); 243 250 } 244 251 } 245 - 246 252
-5
drivers/staging/vt6656/wctl.h
··· 32 32 #include "tether.h" 33 33 #include "device.h" 34 34 35 - 36 35 #define IS_TYPE_DATA(pMACHeader) \ 37 36 ((((struct ieee80211_hdr *) pMACHeader)->frame_control & TYPE_802_11_MASK) == TYPE_802_11_DATA) 38 37 ··· 79 80 #define IS_CTL_PSPOLL(pMACHeader) \ 80 81 ((((struct ieee80211_hdr *) pMACHeader)->frame_control & TYPE_SUBTYPE_MASK) == TYPE_CTL_PSPOLL) 81 82 82 - 83 83 #define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) { \ 84 84 if ((uVar) >= ((uModulo) - 1)) \ 85 85 (uVar) = 0; \ 86 86 else \ 87 87 (uVar)++; \ 88 88 } 89 - 90 - 91 - 92 89 93 90 bool WCTLbIsDuplicate(PSCache pCache, struct ieee80211_hdr *pMACHeader); 94 91 bool WCTLbHandleFragment(struct vnt_private *, struct ieee80211_hdr *pMACHeader, unsigned int cbFrameLength, bool bWEP, bool bExtIV);
-104
drivers/staging/vt6656/wmgr.c
··· 81 81 #include "control.h" 82 82 #include "rndis.h" 83 83 84 - 85 - 86 - 87 - 88 84 static int msglevel =MSG_LEVEL_INFO; 89 85 //static int msglevel =MSG_LEVEL_DEBUG; 90 - 91 86 92 87 static int ChannelExceedZoneType(struct vnt_private *, u8 byCurrChannel); 93 88 ··· 149 154 u8 *pCurrBSSID, PWLAN_IE_SUPP_RATES pCurrSuppRates, 150 155 PWLAN_IE_SUPP_RATES pCurrExtSuppRates); 151 156 152 - 153 157 /* Association response */ 154 158 static struct vnt_tx_mgmt *s_MgrMakeAssocResponse(struct vnt_private *, 155 159 struct vnt_manager *pMgmt, u16 wCurrCapInfo, u16 wAssocStatus, ··· 172 178 /* received status */ 173 179 static void s_vMgrLogStatus(struct vnt_manager *pMgmt, u16 wStatus); 174 180 175 - 176 181 static void s_vMgrSynchBSS(struct vnt_private *, u32 uBSSMode, 177 182 PKnownBSS pCurr, PCMD_STATUS pStatus); 178 - 179 183 180 184 static bool 181 185 s_bCipherMatch ( ··· 184 192 ); 185 193 186 194 static void Encyption_Rebuild(struct vnt_private *, PKnownBSS pCurr); 187 - 188 - 189 195 190 196 /*+ 191 197 * ··· 199 209 { 200 210 struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; 201 211 int ii; 202 - 203 212 204 213 pMgmt->pbyPSPacketPool = &pMgmt->byPSPacketPool[0]; 205 214 pMgmt->pbyMgmtPacketPool = &pMgmt->byMgmtPacketPool[0]; ··· 257 268 { 258 269 struct vnt_tx_mgmt *pTxPacket; 259 270 260 - 261 271 pMgmt->wCurrCapInfo = 0; 262 272 pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_ESS(1); 263 273 if (pDevice->bEncryptionEnable) { ··· 311 323 return ; 312 324 } 313 325 314 - 315 326 /*+ 316 327 * 317 328 * Routine Description: ··· 340 353 if (pMgmt->wListenInterval == 0) 341 354 pMgmt->wListenInterval = 1; // at least one. 342 355 343 - 344 356 // ERP Phy (802.11g) should support short preamble. 345 357 if (pMgmt->eCurrentPHYMode == PHY_TYPE_11G) { 346 358 pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SHORTPREAMBLE(1); ··· 353 367 } 354 368 if (pMgmt->b11hEnable == true) 355 369 pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SPECTRUMMNG(1); 356 - 357 370 358 371 pTxPacket = s_MgrMakeReAssocRequest 359 372 ( ··· 376 391 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:Reassociation tx sending.\n"); 377 392 } 378 393 } 379 - 380 394 381 395 return ; 382 396 } ··· 436 452 return; 437 453 } 438 454 439 - 440 - 441 455 /*+ 442 456 * 443 457 * Routine Description:(AP function) ··· 458 476 u32 uRateLen = WLAN_RATES_MAXLEN; 459 477 u8 abyCurrSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; 460 478 u8 abyCurrExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; 461 - 462 479 463 480 if (pMgmt->eCurrMode != WMAC_MODE_ESS_AP) 464 481 return; ··· 497 516 } else { 498 517 abyCurrExtSuppRates[1] = 0; 499 518 } 500 - 501 519 502 520 RATEvParseMaxRate((void *)pDevice, 503 521 (PWLAN_IE_SUPP_RATES)abyCurrSuppRates, ··· 546 566 pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate); 547 567 } 548 568 549 - 550 569 // assoc response reply.. 551 570 pTxPacket = s_MgrMakeAssocResponse 552 571 ( ··· 576 597 577 598 return; 578 599 } 579 - 580 600 581 601 /*+ 582 602 * ··· 643 665 abyCurrExtSuppRates[1] = 0; 644 666 } 645 667 646 - 647 668 RATEvParseMaxRate((void *)pDevice, 648 669 (PWLAN_IE_SUPP_RATES)abyCurrSuppRates, 649 670 (PWLAN_IE_SUPP_RATES)abyCurrExtSuppRates, ··· 693 716 694 717 } 695 718 696 - 697 719 // assoc response reply.. 698 720 pTxPacket = s_MgrMakeReAssocResponse 699 721 ( ··· 722 746 return; 723 747 } 724 748 725 - 726 749 /*+ 727 750 * 728 751 * Routine Description: ··· 739 764 WLAN_FR_ASSOCRESP sFrame; 740 765 PWLAN_IE_SSID pItemSSID; 741 766 u8 *pbyIEs; 742 - 743 - 744 767 745 768 if (pMgmt->eCurrState == WMAC_STATE_ASSOCPENDING || 746 769 pMgmt->eCurrState == WMAC_STATE_ASSOC) { ··· 951 978 *pStatus = CMD_STATUS_SUCCESS; 952 979 } 953 980 954 - 955 981 return ; 956 982 } 957 - 958 983 959 984 /*+ 960 985 * ··· 1002 1031 return; 1003 1032 } 1004 1033 1005 - 1006 - 1007 1034 /*+ 1008 1035 * 1009 1036 * Routine Description: ··· 1013 1044 * None. 1014 1045 * 1015 1046 -*/ 1016 - 1017 1047 1018 1048 static void s_vMgrRxAuthenSequence_1(struct vnt_private *pDevice, 1019 1049 struct vnt_manager *pMgmt, PWLAN_FR_AUTHEN pFrame) ··· 1104 1136 return; 1105 1137 } 1106 1138 1107 - 1108 - 1109 1139 /*+ 1110 1140 * 1111 1141 * Routine Description: ··· 1121 1155 { 1122 1156 WLAN_FR_AUTHEN sFrame; 1123 1157 struct vnt_tx_mgmt *pTxPacket = NULL; 1124 - 1125 1158 1126 1159 switch (cpu_to_le16((*(pFrame->pwAuthAlgorithm)))) 1127 1160 { ··· 1199 1234 } 1200 1235 return; 1201 1236 } 1202 - 1203 - 1204 1237 1205 1238 /*+ 1206 1239 * ··· 1285 1322 return; 1286 1323 1287 1324 } 1288 - 1289 - 1290 1325 1291 1326 /*+ 1292 1327 * ··· 1385 1424 return; 1386 1425 } 1387 1426 1388 - 1389 1427 /*+ 1390 1428 * 1391 1429 * Routine Description: ··· 1401 1441 { 1402 1442 WLAN_FR_DEAUTHEN sFrame; 1403 1443 u32 uNodeIndex = 0; 1404 - 1405 1444 1406 1445 if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP ){ 1407 1446 //Todo: ··· 1521 1562 u32 uRateLen = WLAN_RATES_MAXLEN; 1522 1563 int bChannelHit = false; 1523 1564 u8 byOldPreambleType; 1524 - 1525 - 1526 1565 1527 1566 if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) 1528 1567 return; ··· 1790 1833 if (qwTSFOffset > TRIVIAL_SYNC_DIFFERENCE) 1791 1834 bTSFLargeDiff = true; 1792 1835 1793 - 1794 1836 // if infra mode 1795 1837 if (bIsAPBeacon == true) { 1796 1838 ··· 1961 2005 if (pDevice->byPreambleType != byOldPreambleType) 1962 2006 CARDvSetRSPINF(pDevice, (u8)pDevice->byBBType); 1963 2007 1964 - 1965 2008 // MACvRegBitsOff(pDevice->PortOffset, MAC_REG_RCR, RCR_BSSID); 1966 2009 // set highest basic rate 1967 2010 // s_vSetHighestBasicRate(pDevice, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates); ··· 2010 2055 u8 abyOFDM_RATE[] = {0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; 2011 2056 u16 wSuppRate; 2012 2057 2013 - 2014 - 2015 2058 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Create Basic Service Set .......\n"); 2016 2059 2017 2060 if (pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) { ··· 2048 2095 pMgmt->abyCurrSuppRates[2+ii] = abyRATE[ii]; 2049 2096 } 2050 2097 2051 - 2052 2098 if (pMgmt->eCurrentPHYMode == PHY_TYPE_11G) { 2053 2099 pMgmt->abyCurrSuppRates[1] = 8; 2054 2100 pMgmt->abyCurrExtSuppRates[1] = 4; ··· 2058 2106 for (ii = 0; ii < 4; ii++) 2059 2107 pMgmt->abyCurrExtSuppRates[2+ii] = abyOFDM_RATE[ii+4]; 2060 2108 } 2061 - 2062 2109 2063 2110 // Disable Protect Mode 2064 2111 pDevice->bProtectMode = 0; ··· 2100 2149 (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrExtSuppRates, true, 2101 2150 &wMaxBasicRate, &wMaxSuppRate, &wSuppRate, 2102 2151 &byTopCCKBasicRate, &byTopOFDMBasicRate); 2103 - 2104 - 2105 2152 2106 2153 if (pDevice->byBBType == BB_TYPE_11A) { 2107 2154 pDevice->bShortSlotTime = true; ··· 2163 2214 pMgmt->abyCurrBSSID[0] ^= pMgmt->abyMACAddr[5]; 2164 2215 pMgmt->abyCurrBSSID[0] &= ~IEEE_ADDR_GROUP; 2165 2216 pMgmt->abyCurrBSSID[0] |= IEEE_ADDR_UNIVERSAL; 2166 - 2167 2217 2168 2218 DBG_PRT(MSG_LEVEL_INFO, KERN_INFO"Adhoc beacon created bssid:" 2169 2219 "%pM\n", pMgmt->abyCurrBSSID); ··· 2254 2306 u8 byTopCCKBasicRate = RATE_1M; 2255 2307 u8 byTopOFDMBasicRate = RATE_1M; 2256 2308 u8 bShortSlotTime = false; 2257 - 2258 2309 2259 2310 for (ii = 0; ii < MAX_BSS_NUM; ii++) { 2260 2311 if (pMgmt->sBSSList[ii].bActive == true) ··· 2460 2513 pMgmt->eCurrState = WMAC_STATE_IDLE; 2461 2514 }; 2462 2515 2463 - 2464 2516 } 2465 2517 else { 2466 2518 // ad-hoc mode BSS ··· 2498 2552 // Adopt this BSS state vars in Mgmt Object 2499 2553 // TODO: check if CapInfo privacy on, but we don't.. 2500 2554 pMgmt->uCurrChannel = pCurr->uChannel; 2501 - 2502 2555 2503 2556 // Parse Support Rate IE 2504 2557 pMgmt->abyCurrSuppRates[0] = WLAN_EID_SUPP_RATES; ··· 2547 2602 }; 2548 2603 return; 2549 2604 } 2550 - 2551 - 2552 2605 2553 2606 /*+ 2554 2607 * ··· 2743 2800 return; 2744 2801 } 2745 2802 2746 - 2747 2803 /*+ 2748 2804 * 2749 2805 * Routine Description: ··· 2764 2822 u16 wStartIndex = 0; 2765 2823 u16 wEndIndex = 0; 2766 2824 2767 - 2768 2825 // Find size of partial virtual bitmap 2769 2826 for (ii = 0; ii < (MAX_NODE_NUM + 1); ii++) { 2770 2827 byMap = pMgmt->abyPSTxMap[ii]; ··· 2783 2842 wEndIndex = (u16)ii; 2784 2843 } 2785 2844 } 2786 - 2787 2845 2788 2846 // Round start index down to nearest even number 2789 2847 wStartIndex &= ~BIT0; ··· 2810 2870 pTIM->byVirtBitMap[0] &= ~BIT0; 2811 2871 } 2812 2872 2813 - 2814 2873 /*+ 2815 2874 * 2816 2875 * Routine Description: ··· 2830 2891 struct vnt_tx_mgmt *pTxPacket = NULL; 2831 2892 WLAN_FR_BEACON sFrame; 2832 2893 u8 abyBroadcastAddr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 2833 - 2834 2894 2835 2895 /* prepare beacon frame */ 2836 2896 pTxPacket = (struct vnt_tx_mgmt *)pMgmt->pbyMgmtPacketPool; ··· 2930 2992 } 2931 2993 } 2932 2994 2933 - 2934 2995 if (pMgmt->eCurrentPHYMode == PHY_TYPE_11G) { 2935 2996 sFrame.pERP = (PWLAN_IE_ERP)(sFrame.pBuf + sFrame.len); 2936 2997 sFrame.len += 1 + WLAN_IEHDR_LEN; ··· 2969 3032 return pTxPacket; 2970 3033 } 2971 3034 2972 - 2973 - 2974 - 2975 - 2976 3035 /*+ 2977 3036 * 2978 3037 * Routine Description: ··· 2980 3047 * 2981 3048 -*/ 2982 3049 2983 - 2984 - 2985 - 2986 3050 struct vnt_tx_mgmt *s_MgrMakeProbeResponse(struct vnt_private *pDevice, 2987 3051 struct vnt_manager *pMgmt, u16 wCurrCapInfo, u16 wCurrBeaconPeriod, 2988 3052 u32 uCurrChannel, u16 wCurrATIMWinodw, u8 *pDstAddr, ··· 2989 3059 { 2990 3060 struct vnt_tx_mgmt *pTxPacket = NULL; 2991 3061 WLAN_FR_PROBERESP sFrame; 2992 - 2993 3062 2994 3063 pTxPacket = (struct vnt_tx_mgmt *)pMgmt->pbyMgmtPacketPool; 2995 3064 memset(pTxPacket, 0, sizeof(struct vnt_tx_mgmt) ··· 3089 3160 return pTxPacket; 3090 3161 } 3091 3162 3092 - 3093 - 3094 3163 /*+ 3095 3164 * 3096 3165 * Routine Description: ··· 3099 3172 * A ptr to frame or NULL on allocation failue 3100 3173 * 3101 3174 -*/ 3102 - 3103 3175 3104 3176 struct vnt_tx_mgmt *s_MgrMakeAssocRequest(struct vnt_private *pDevice, 3105 3177 struct vnt_manager *pMgmt, u8 *pDAddr, u16 wCurrCapInfo, ··· 3111 3185 WLAN_FR_ASSOCREQ sFrame; 3112 3186 u8 *pbyIEs; 3113 3187 u8 *pbyRSN; 3114 - 3115 3188 3116 3189 pTxPacket = (struct vnt_tx_mgmt *)pMgmt->pbyMgmtPacketPool; 3117 3190 memset(pTxPacket, 0, sizeof(struct vnt_tx_mgmt) ··· 3165 3240 pMgmt->sAssocInfo.AssocInfo.RequestIELength += pCurrRates->len + WLAN_IEHDR_LEN; 3166 3241 memcpy(pbyIEs, pCurrRates, pCurrRates->len + WLAN_IEHDR_LEN); 3167 3242 pbyIEs += pCurrRates->len + WLAN_IEHDR_LEN; 3168 - 3169 3243 3170 3244 if (((pMgmt->eAuthenMode == WMAC_AUTH_WPA) || 3171 3245 (pMgmt->eAuthenMode == WMAC_AUTH_WPAPSK) || ··· 3331 3407 pbyIEs += sFrame.pRSN->len + WLAN_IEHDR_LEN; 3332 3408 } 3333 3409 3334 - 3335 3410 // Adjust the length fields 3336 3411 pTxPacket->cbMPDULen = sFrame.len; 3337 3412 pTxPacket->cbPayloadLen = sFrame.len - WLAN_HDR_ADDR3_LEN; 3338 3413 return pTxPacket; 3339 3414 } 3340 - 3341 - 3342 - 3343 - 3344 - 3345 - 3346 - 3347 3415 3348 3416 /*+ 3349 3417 * ··· 3348 3432 * 3349 3433 -*/ 3350 3434 3351 - 3352 3435 struct vnt_tx_mgmt *s_MgrMakeReAssocRequest(struct vnt_private *pDevice, 3353 3436 struct vnt_manager *pMgmt, u8 *pDAddr, u16 wCurrCapInfo, 3354 3437 u16 wListenInterval, PWLAN_IE_SSID pCurrSSID, ··· 3358 3443 WLAN_FR_REASSOCREQ sFrame; 3359 3444 u8 *pbyIEs; 3360 3445 u8 *pbyRSN; 3361 - 3362 3446 3363 3447 pTxPacket = (struct vnt_tx_mgmt *)pMgmt->pbyMgmtPacketPool; 3364 3448 memset(pTxPacket, 0, sizeof(struct vnt_tx_mgmt) ··· 3577 3663 pbyIEs += sFrame.pRSN->len + WLAN_IEHDR_LEN; 3578 3664 } 3579 3665 3580 - 3581 - 3582 3666 /* Adjust the length fields */ 3583 3667 pTxPacket->cbMPDULen = sFrame.len; 3584 3668 pTxPacket->cbPayloadLen = sFrame.len - WLAN_HDR_ADDR3_LEN; ··· 3602 3690 { 3603 3691 struct vnt_tx_mgmt *pTxPacket = NULL; 3604 3692 WLAN_FR_ASSOCRESP sFrame; 3605 - 3606 3693 3607 3694 pTxPacket = (struct vnt_tx_mgmt *)pMgmt->pbyMgmtPacketPool; 3608 3695 memset(pTxPacket, 0, sizeof(struct vnt_tx_mgmt) ··· 3650 3739 return pTxPacket; 3651 3740 } 3652 3741 3653 - 3654 3742 /*+ 3655 3743 * 3656 3744 * Routine Description: ··· 3661 3751 * 3662 3752 -*/ 3663 3753 3664 - 3665 3754 struct vnt_tx_mgmt *s_MgrMakeReAssocResponse(struct vnt_private *pDevice, 3666 3755 struct vnt_manager *pMgmt, u16 wCurrCapInfo, u16 wAssocStatus, 3667 3756 u16 wAssocAID, u8 *pDstAddr, PWLAN_IE_SUPP_RATES pCurrSuppRates, ··· 3668 3759 { 3669 3760 struct vnt_tx_mgmt *pTxPacket = NULL; 3670 3761 WLAN_FR_REASSOCRESP sFrame; 3671 - 3672 3762 3673 3763 pTxPacket = (struct vnt_tx_mgmt *)pMgmt->pbyMgmtPacketPool; 3674 3764 memset(pTxPacket, 0, sizeof(struct vnt_tx_mgmt) ··· 3716 3808 return pTxPacket; 3717 3809 } 3718 3810 3719 - 3720 3811 /*+ 3721 3812 * 3722 3813 * Routine Description: ··· 3735 3828 u8 byCurrChannel = pRxPacket->byRxChannel; 3736 3829 ERPObject sERP; 3737 3830 int bChannelHit = true; 3738 - 3739 3831 3740 3832 memset(&sFrame, 0, sizeof(WLAN_FR_PROBERESP)); 3741 3833 // decode the frame ··· 3756 3850 3757 3851 if(sFrame.pSSID->len == 0) 3758 3852 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Rx Probe resp: SSID len = 0 \n"); 3759 - 3760 3853 3761 3854 //{{ RobertYu:20050201, 11a byCurrChannel != sFrame.pDSParms->byCurrChannel mapping 3762 3855 if( byCurrChannel > CB_MAX_CHANNEL_24G ) ··· 3790 3885 sERP.bERPExist = false; 3791 3886 sERP.byERP = 0; 3792 3887 } 3793 - 3794 3888 3795 3889 // update or insert the bss 3796 3890 pBSSList = BSSpAddrIsInBSSList((void *) pDevice, ··· 3849 3945 * none. 3850 3946 * 3851 3947 -*/ 3852 - 3853 3948 3854 3949 static void s_vMgrRxProbeRequest(struct vnt_private *pDevice, 3855 3950 struct vnt_manager *pMgmt, struct vnt_rx_mgmt *pRxPacket) ··· 3938 4035 u32 uNodeIndex = 0; 3939 4036 NODE_STATE eNodeState = 0; 3940 4037 CMD_STATUS Status; 3941 - 3942 4038 3943 4039 if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { 3944 4040 if (BSSbIsSTAInNodeDB(pDevice, pRxPacket->p80211Header->sA3.abyAddr2, &uNodeIndex)) ··· 4110 4208 return true; 4111 4209 } 4112 4210 4113 - 4114 - 4115 - 4116 4211 /*+ 4117 4212 * 4118 4213 * Routine Description: ··· 4200 4301 4201 4302 if (pDevice->gsPMKIDCandidate.NumCandidates >= MAX_PMKIDLIST) 4202 4303 return false; 4203 - 4204 - 4205 4304 4206 4305 // Update Old Candidate 4207 4306 for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) { ··· 4405 4508 } 4406 4509 return true; 4407 4510 } 4408 - 4409 4511
-28
drivers/staging/vt6656/wmgr.h
··· 41 41 #include "wpa2.h" 42 42 #include "card.h" 43 43 44 - 45 - 46 - 47 44 // Scan time 48 45 #define PROBE_DELAY 100 // (us) 49 46 #define SWITCH_CHANNEL_DELAY 200 // (us) ··· 52 55 #define WCMD_ACTIVE_SCAN_TIME 20 //(ms) 53 56 #define WCMD_PASSIVE_SCAN_TIME 100 //(ms) 54 57 55 - 56 58 #define DEFAULT_MSDU_LIFETIME 512 // ms 57 59 #define DEFAULT_MSDU_LIFETIME_RES_64us 8000 // 64us 58 60 ··· 59 63 #define DEFAULT_MGN_LIFETIME_RES_64us 125 // 64us 60 64 61 65 #define MAKE_BEACON_RESERVED 10 //(us) 62 - 63 66 64 67 #define TIM_MULTICAST_MASK 0x01 65 68 #define TIM_BITMAPOFFSET_MASK 0xFE ··· 68 73 69 74 #define DEFAULT_IBSS_CHANNEL 6 //2.4G 70 75 71 - 72 - 73 - 74 76 //mike define: make timer to expire after desired times 75 77 #define timer_expire(timer, next_tick) mod_timer(&timer, RUN_AT(next_tick)) 76 78 77 79 typedef void (*TimerFunction)(unsigned long); 78 - 79 80 80 81 //+++ NDIS related 81 82 ··· 103 112 u32 OffsetResponseIEs; 104 113 } NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION; 105 114 106 - 107 - 108 115 typedef struct tagSAssocInfo { 109 116 NDIS_802_11_ASSOCIATION_INFORMATION AssocInfo; 110 117 u8 abyIEs[WLAN_BEACON_FR_MAXLEN+WLAN_BEACON_FR_MAXLEN]; ··· 110 121 u32 RequestIELength; 111 122 u8 abyReqIEs[WLAN_BEACON_FR_MAXLEN]; 112 123 } SAssocInfo, *PSAssocInfo; 113 - 114 - 115 - 116 124 117 125 typedef enum tagWMAC_AUTHENTICATION_MODE { 118 126 ··· 124 138 WMAC_AUTH_MAX // Not a real mode, defined as upper bound 125 139 } WMAC_AUTHENTICATION_MODE, *PWMAC_AUTHENTICATION_MODE; 126 140 127 - 128 - 129 141 // Pre-configured Mode (from XP) 130 142 131 143 typedef enum tagWMAC_CONFIG_MODE { ··· 134 150 135 151 } WMAC_CONFIG_MODE, *PWMAC_CONFIG_MODE; 136 152 137 - 138 153 typedef enum tagWMAC_SCAN_TYPE { 139 154 140 155 WMAC_SCAN_ACTIVE, ··· 142 159 143 160 } WMAC_SCAN_TYPE, *PWMAC_SCAN_TYPE; 144 161 145 - 146 162 typedef enum tagWMAC_SCAN_STATE { 147 163 148 164 WMAC_NO_SCANNING, ··· 149 167 WMAC_IS_PROBEPENDING 150 168 151 169 } WMAC_SCAN_STATE, *PWMAC_SCAN_STATE; 152 - 153 - 154 170 155 171 // Notes: 156 172 // Basic Service Set state explained as following: ··· 182 202 183 203 } WMAC_CURRENT_MODE, *PWMAC_CURRENT_MODE; 184 204 185 - 186 205 typedef enum tagWMAC_POWER_MODE { 187 206 188 207 WMAC_POWER_CAM, ··· 190 211 191 212 } WMAC_POWER_MODE, *PWMAC_POWER_MODE; 192 213 193 - 194 - 195 214 /* Tx Management Packet descriptor */ 196 215 struct vnt_tx_mgmt { 197 216 PUWLAN_80211HDR p80211Header; 198 217 u32 cbMPDULen; 199 218 u32 cbPayloadLen; 200 219 }; 201 - 202 220 203 221 /* Rx Management Packet descriptor */ 204 222 struct vnt_rx_mgmt { ··· 208 232 u8 byRxRate; 209 233 u8 byRxChannel; 210 234 }; 211 - 212 235 213 236 struct vnt_manager { 214 237 void *pAdapter; ··· 310 335 u8 byMgmtPacketPool[sizeof(struct vnt_tx_mgmt) 311 336 + WLAN_A3FR_MAXLEN]; 312 337 313 - 314 338 /* One second callback timer */ 315 339 struct timer_list sTimerSecondCallback; 316 340 ··· 352 378 struct sk_buff skb; 353 379 354 380 }; 355 - 356 - 357 381 358 382 void vMgrObjectInit(struct vnt_private *pDevice); 359 383
-2
drivers/staging/vt6656/wpa.c
··· 50 50 const u8 abyOUI04[4] = { 0x00, 0x50, 0xf2, 0x04 }; 51 51 const u8 abyOUI05[4] = { 0x00, 0x50, 0xf2, 0x05 }; 52 52 53 - 54 53 /*+ 55 54 * 56 55 * Description: ··· 84 85 pBSSList->sRSNCapObj.wRSNCap = 0; 85 86 pBSSList->bWPAValid = false; 86 87 } 87 - 88 88 89 89 /*+ 90 90 *
-6
drivers/staging/vt6656/wpa.h
··· 33 33 34 34 #include "80211hdr.h" 35 35 36 - 37 36 #define WPA_NONE 0 38 37 #define WPA_WEP40 1 39 38 #define WPA_TKIP 2 ··· 45 46 #define WPA_GROUPFLAG 0x02 46 47 #define WPA_REPLAYBITSSHIFT 2 47 48 #define WPA_REPLAYBITS 0x03 48 - 49 - 50 - 51 - 52 - 53 49 54 50 void 55 51 WPA_ClearRSN(
-5
drivers/staging/vt6656/wpa2.c
··· 37 37 static int msglevel =MSG_LEVEL_INFO; 38 38 //static int msglevel =MSG_LEVEL_DEBUG; 39 39 40 - 41 40 const u8 abyOUIGK[4] = { 0x00, 0x0F, 0xAC, 0x00 }; 42 41 const u8 abyOUIWEP40[4] = { 0x00, 0x0F, 0xAC, 0x01 }; 43 42 const u8 abyOUIWEP104[4] = { 0x00, 0x0F, 0xAC, 0x05 }; ··· 45 46 46 47 const u8 abyOUI8021X[4] = { 0x00, 0x0F, 0xAC, 0x01 }; 47 48 const u8 abyOUIPSK[4] = { 0x00, 0x0F, 0xAC, 0x02 }; 48 - 49 - 50 - 51 - 52 49 53 50 /*+ 54 51 *
-5
drivers/staging/vt6656/wpa2.h
··· 47 47 PMKIDInfo BSSIDInfo[MAX_PMKID_CACHE]; 48 48 } SPMKIDCache, *PSPMKIDCache; 49 49 50 - 51 - 52 - 53 - 54 - 55 50 void WPA2_ClearRSN(PKnownBSS pBSSNode); 56 51 void WPA2vParseRSN(PKnownBSS pBSSNode, PWLAN_IE_RSN pRSN); 57 52
-8
drivers/staging/vt6656/wpactl.c
··· 42 42 #include "rndis.h" 43 43 #include "rf.h" 44 44 45 - 46 - 47 45 static int msglevel = MSG_LEVEL_INFO; 48 - 49 - 50 - 51 46 52 47 /* 53 48 * Description: ··· 117 122 return ret; 118 123 } 119 124 120 - 121 125 if (param->u.wpa_key.seq && param->u.wpa_key.seq_len > sizeof(abySeq)) 122 126 return -EINVAL; 123 127 ··· 147 153 148 154 if (param->u.wpa_key.set_tx) 149 155 dwKeyIndex |= (1 << 31); 150 - 151 156 152 157 if (pDevice->eEncryptionStatus == Ndis802_11Encryption3Enabled) 153 158 byKeyDecMode = KEY_CTL_CCMP; ··· 245 252 246 253 return ret; 247 254 } 248 - 249 255
-6
drivers/staging/vt6656/wpactl.h
··· 32 32 #include "device.h" 33 33 #include "iowpa.h" 34 34 35 - 36 - 37 35 //WPA related 38 36 39 37 typedef enum { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP } wpa_alg; ··· 40 42 #define AUTH_ALG_SHARED_KEY 0x02 41 43 #define AUTH_ALG_LEAP 0x04 42 44 43 - 44 45 typedef unsigned long long NDIS_802_11_KEY_RSC; 45 - 46 - 47 - 48 46 49 47 int wpa_set_keys(struct vnt_private *, void *ctx); 50 48