78 {384, 288, 226, 209, 54, 43, 37, 31, 28, 25, 24, 23},
79 {384, 192, 130, 113, 54, 43, 37, 31, 28, 25, 24, 23},
96 #define RTSDUR_BA_F0 4
97 #define RTSDUR_AA_F0 5
98 #define RTSDUR_BA_F1 6
99 #define RTSDUR_AA_F1 7
100 #define CTSDUR_BA_F0 8
101 #define CTSDUR_BA_F1 9
104 #define DATADUR_A_F0 12
105 #define DATADUR_A_F1 13
128 s_vGenerateTxParameter(
136 unsigned int cbFrameSize,
138 unsigned int uDMAIdx,
143 static unsigned int s_uFillDataHead(
148 unsigned int cbFrameLength,
149 unsigned int uDMAIdx,
151 unsigned int uFragIdx,
152 unsigned int cbLastFragmentSize,
153 unsigned int uMACfragNum,
162 s_vGenerateMACHeader (
169 unsigned int uDMAIdx,
170 unsigned int uFragIdx
190 PBYTE pbyPayloadHead,
194 static unsigned int s_uGetTxRsvTime(
197 unsigned int cbFrameLength,
203 static unsigned int s_uGetRTSCTSRsvTime(
207 unsigned int cbFrameLength,
215 unsigned int uDMAIdx,
218 unsigned int cbFrameLength,
231 unsigned int cbFrameLength,
239 static unsigned int s_uGetDataDuration(
242 unsigned int cbFrameLength,
246 unsigned int uFragIdx,
247 unsigned int cbLastFragmentSize,
248 unsigned int uMACfragNum,
255 s_uGetRTSCTSDuration (
258 unsigned int cbFrameLength,
280 for (ii = 0; ii < pDevice->
cbTD; ii++) {
281 pContext = pDevice->
apTD[ii];
284 pReturnContext = pContext;
288 if ( ii == pDevice->
cbTD ) {
291 return (
void *) pReturnContext;
301 if (is_broadcast_ether_addr(pbyDestAddr))
303 else if (is_multicast_ether_addr(pbyDestAddr))
331 DWORD dwRevIVCounter;
336 if (pTransmitKey ==
NULL)
375 *(pbyIVHead+3) = (
BYTE)(((pDevice->
byKeyIndex << 6) & 0xc0) | 0x20);
389 *(pbyIVHead+3) = (
BYTE)(((pDevice->
byKeyIndex << 6) & 0xc0) | 0x20);
396 *((
PBYTE)(pMICHDR+1)) = 0;
397 memcpy(pMICHDR+2, &(pMACHeader->abyAddr2[0]), 6);
408 *((
PBYTE)(pMICHDR+16)) = 0;
410 *((
PBYTE)(pMICHDR+17)) = 28;
412 *((
PBYTE)(pMICHDR+17)) = 22;
414 wValue =
cpu_to_le16(pMACHeader->wFrameCtl & 0xC78F);
416 memcpy(pMICHDR+20, &(pMACHeader->abyAddr1[0]), 6);
417 memcpy(pMICHDR+26, &(pMACHeader->abyAddr2[0]), 6);
420 memcpy(pMICHDR+32, &(pMACHeader->abyAddr3[0]), 6);
421 wValue = pMACHeader->wSeqCtl;
426 memcpy(pMICHDR+40, &(pMACHeader->abyAddr4[0]), 6);
437 PBYTE pbyPayloadHead,
441 unsigned int cbICVlen = 4;
442 DWORD dwICV = 0xFFFFFFFF
L;
445 if (pTransmitKey ==
NULL)
452 pdwICV = (
PDWORD)(pbyPayloadHead + wPayloadSize);
457 rc4_encrypt(&pDevice->
SBox, pbyPayloadHead, pbyPayloadHead, wPayloadSize+cbICVlen);
463 pdwICV = (
PDWORD)(pbyPayloadHead + wPayloadSize);
468 rc4_encrypt(&pDevice->
SBox, pbyPayloadHead, pbyPayloadHead, wPayloadSize+cbICVlen);
486 unsigned int cbFrameLength,
491 unsigned int uDataTime, uAckTime;
501 return (uDataTime + pDevice->
uSIFS + uAckTime);
511 s_uGetRTSCTSRsvTime (
515 unsigned int cbFrameLength,
519 unsigned int uRrvTime , uRTSTime, uCTSTime, uAckTime, uDataTime;
521 uRrvTime = uRTSTime = uCTSTime = uAckTime = uDataTime = 0;
525 if (byRTSRsvType == 0) {
529 else if (byRTSRsvType == 1){
534 else if (byRTSRsvType == 2) {
538 else if (byRTSRsvType == 3) {
541 uRrvTime = uCTSTime + uAckTime + uDataTime + 2*pDevice->
uSIFS;
546 uRrvTime = uRTSTime + uCTSTime + uAckTime + uDataTime + 3*pDevice->
uSIFS;
556 unsigned int cbFrameLength,
560 unsigned int uFragIdx,
561 unsigned int cbLastFragmentSize,
562 unsigned int uMACfragNum,
567 unsigned int uAckTime = 0, uNextPktTime = 0;
569 if (uFragIdx == (uMACfragNum-1)) {
576 if (((uMACfragNum == 1)) || (bLastFrag == 1)) {
579 return (pDevice->
uSIFS + uAckTime);
585 if (uFragIdx == (uMACfragNum-2)) {
586 uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wRate, bNeedAck);
588 uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
592 return (pDevice->
uSIFS + uAckTime + uNextPktTime);
594 return (pDevice->
uSIFS + uNextPktTime);
601 if (((uMACfragNum==1)) || (bLastFrag==1)) {
604 return (pDevice->
uSIFS + uAckTime);
610 if(uFragIdx == (uMACfragNum-2)){
611 uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wRate, bNeedAck);
613 uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
617 return (pDevice->
uSIFS + uAckTime + uNextPktTime);
619 return (pDevice->
uSIFS + uNextPktTime);
625 if (((uMACfragNum==1)) || (bLastFrag==1)) {
628 return (pDevice->
uSIFS + uAckTime);
640 if(uFragIdx == (uMACfragNum-2)){
641 uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize,
wFB_Opt0[
FB_RATE0][wRate-
RATE_18M], bNeedAck);
651 if(uFragIdx == (uMACfragNum-2)){
652 uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize,
wFB_Opt1[
FB_RATE0][wRate-
RATE_18M], bNeedAck);
660 return (pDevice->
uSIFS + uAckTime + uNextPktTime);
662 return (pDevice->
uSIFS + uNextPktTime);
668 if (((uMACfragNum==1)) || (bLastFrag==1)) {
671 return (pDevice->
uSIFS + uAckTime);
683 if(uFragIdx == (uMACfragNum-2)){
684 uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize,
wFB_Opt0[
FB_RATE1][wRate-
RATE_18M], bNeedAck);
695 if(uFragIdx == (uMACfragNum-2)){
696 uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize,
wFB_Opt1[
FB_RATE1][wRate-
RATE_18M], bNeedAck);
703 return (pDevice->
uSIFS + uAckTime + uNextPktTime);
705 return (pDevice->
uSIFS + uNextPktTime);
722 s_uGetRTSCTSDuration (
725 unsigned int cbFrameLength,
732 unsigned int uCTSTime = 0, uDurTime = 0;
739 uDurTime = uCTSTime + 2*pDevice->
uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
744 uDurTime = uCTSTime + 2*pDevice->
uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
749 uDurTime = uCTSTime + 2*pDevice->
uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
753 uDurTime = pDevice->
uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
826 unsigned int cbFrameLength,
827 unsigned int uDMAIdx,
829 unsigned int uFragIdx,
830 unsigned int cbLastFragmentSize,
831 unsigned int uMACfragNum,
836 if (pTxDataHead ==
NULL) {
845 (
PWORD)&(pBuf->wTransmitLength), (
PBYTE)&(pBuf->byServiceField), (
PBYTE)&(pBuf->bySignalField)
848 pBuf->wDuration = (
WORD)s_uGetDataDuration(pDevice,
DATADUR_A, cbFrameLength, byPktType,
849 wCurrentRate, bNeedAck, uFragIdx,
850 cbLastFragmentSize, uMACfragNum,
855 return (pBuf->wDuration);
862 (
PWORD)&(pBuf->wTransmitLength_a), (
PBYTE)&(pBuf->byServiceField_a), (
PBYTE)&(pBuf->bySignalField_a)
865 (
PWORD)&(pBuf->wTransmitLength_b), (
PBYTE)&(pBuf->byServiceField_b), (
PBYTE)&(pBuf->bySignalField_b)
868 pBuf->wDuration_a = (
WORD)s_uGetDataDuration(pDevice,
DATADUR_A, cbFrameLength,
869 byPktType, wCurrentRate, bNeedAck, uFragIdx,
870 cbLastFragmentSize, uMACfragNum,
872 pBuf->wDuration_b = (
WORD)s_uGetDataDuration(pDevice,
DATADUR_B, cbFrameLength,
874 bNeedAck, uFragIdx, cbLastFragmentSize,
875 uMACfragNum, byFBOption);
879 return (pBuf->wDuration_a);
885 (
PWORD)&(pBuf->wTransmitLength_a), (
PBYTE)&(pBuf->byServiceField_a), (
PBYTE)&(pBuf->bySignalField_a)
888 (
PWORD)&(pBuf->wTransmitLength_b), (
PBYTE)&(pBuf->byServiceField_b), (
PBYTE)&(pBuf->bySignalField_b)
891 pBuf->wDuration_a = (
WORD)s_uGetDataDuration(pDevice,
DATADUR_A, cbFrameLength, byPktType,
892 wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption);
894 pDevice->
byTopCCKBasicRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption);
895 pBuf->wDuration_a_f0 = (
WORD)s_uGetDataDuration(pDevice,
DATADUR_A_F0, cbFrameLength, byPktType,
896 wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption);
897 pBuf->wDuration_a_f1 = (
WORD)s_uGetDataDuration(pDevice,
DATADUR_A_F1, cbFrameLength, byPktType,
898 wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption);
901 return (pBuf->wDuration_a);
911 (
PWORD)&(pBuf->wTransmitLength), (
PBYTE)&(pBuf->byServiceField), (
PBYTE)&(pBuf->bySignalField)
914 pBuf->wDuration = (
WORD)s_uGetDataDuration(pDevice,
DATADUR_A, cbFrameLength, byPktType,
915 wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption);
916 pBuf->wDuration_f0 = (
WORD)s_uGetDataDuration(pDevice,
DATADUR_A_F0, cbFrameLength, byPktType,
917 wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption);
918 pBuf->wDuration_f1 = (
WORD)s_uGetDataDuration(pDevice,
DATADUR_A_F1, cbFrameLength, byPktType,
919 wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption);
923 return (pBuf->wDuration);
928 (
PWORD)&(pBuf->wTransmitLength), (
PBYTE)&(pBuf->byServiceField), (
PBYTE)&(pBuf->bySignalField)
931 pBuf->wDuration = (
WORD)s_uGetDataDuration(pDevice,
DATADUR_A, cbFrameLength, byPktType,
932 wCurrentRate, bNeedAck, uFragIdx,
933 cbLastFragmentSize, uMACfragNum,
939 return (pBuf->wDuration);
946 (
PWORD)&(pBuf->wTransmitLength), (
PBYTE)&(pBuf->byServiceField), (
PBYTE)&(pBuf->bySignalField)
949 pBuf->wDuration = (
WORD)s_uGetDataDuration(pDevice,
DATADUR_B, cbFrameLength, byPktType,
950 wCurrentRate, bNeedAck, uFragIdx,
951 cbLastFragmentSize, uMACfragNum,
956 return (pBuf->wDuration);
970 unsigned int cbFrameLength,
978 unsigned int uRTSFrameLen = 20;
997 (
PWORD)&(wLen), (
PBYTE)&(pBuf->byServiceField_b), (
PBYTE)&(pBuf->bySignalField_b)
1001 (
PWORD)&(wLen), (
PBYTE)&(pBuf->byServiceField_a), (
PBYTE)&(pBuf->bySignalField_a)
1006 pBuf->wDuration_aa =
cpu_to_le16((
WORD)s_uGetRTSCTSDuration(pDevice,
RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption));
1007 pBuf->wDuration_ba =
cpu_to_le16((
WORD)s_uGetRTSCTSDuration(pDevice,
RTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption));
1009 pBuf->Data.wDurationID = pBuf->wDuration_aa;
1015 memcpy(&(pBuf->Data.abyRA[0]),
1016 &(psEthHeader->abyDstAddr[0]),
1020 memcpy(&(pBuf->Data.abyRA[0]),
1025 memcpy(&(pBuf->Data.abyTA[0]),
1030 memcpy(&(pBuf->Data.abyTA[0]),
1031 &(psEthHeader->abySrcAddr[0]),
1039 (
PWORD)&(wLen), (
PBYTE)&(pBuf->byServiceField_b), (
PBYTE)&(pBuf->bySignalField_b)
1043 (
PWORD)&(wLen), (
PBYTE)&(pBuf->byServiceField_a), (
PBYTE)&(pBuf->bySignalField_a)
1048 pBuf->wDuration_aa =
cpu_to_le16((
WORD)s_uGetRTSCTSDuration(pDevice,
RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption));
1049 pBuf->wDuration_ba =
cpu_to_le16((
WORD)s_uGetRTSCTSDuration(pDevice,
RTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption));
1050 pBuf->wRTSDuration_ba_f0 =
cpu_to_le16((
WORD)s_uGetRTSCTSDuration(pDevice,
RTSDUR_BA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption));
1051 pBuf->wRTSDuration_aa_f0 =
cpu_to_le16((
WORD)s_uGetRTSCTSDuration(pDevice,
RTSDUR_AA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption));
1052 pBuf->wRTSDuration_ba_f1 =
cpu_to_le16((
WORD)s_uGetRTSCTSDuration(pDevice,
RTSDUR_BA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption));
1053 pBuf->wRTSDuration_aa_f1 =
cpu_to_le16((
WORD)s_uGetRTSCTSDuration(pDevice,
RTSDUR_AA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption));
1054 pBuf->Data.wDurationID = pBuf->wDuration_aa;
1060 memcpy(&(pBuf->Data.abyRA[0]),
1061 &(psEthHeader->abyDstAddr[0]),
1065 memcpy(&(pBuf->Data.abyRA[0]),
1071 memcpy(&(pBuf->Data.abyTA[0]),
1076 memcpy(&(pBuf->Data.abyTA[0]),
1077 &(psEthHeader->abySrcAddr[0]),
1088 (
PWORD)&(wLen), (
PBYTE)&(pBuf->byServiceField), (
PBYTE)&(pBuf->bySignalField)
1092 pBuf->wDuration =
cpu_to_le16((
WORD)s_uGetRTSCTSDuration(pDevice,
RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption));
1093 pBuf->Data.wDurationID = pBuf->wDuration;
1099 memcpy(&(pBuf->Data.abyRA[0]),
1100 &(psEthHeader->abyDstAddr[0]),
1103 memcpy(&(pBuf->Data.abyRA[0]),
1109 memcpy(&(pBuf->Data.abyTA[0]),
1113 memcpy(&(pBuf->Data.abyTA[0]),
1114 &(psEthHeader->abySrcAddr[0]),
1123 (
PWORD)&(wLen), (
PBYTE)&(pBuf->byServiceField), (
PBYTE)&(pBuf->bySignalField)
1127 pBuf->wDuration =
cpu_to_le16((
WORD)s_uGetRTSCTSDuration(pDevice,
RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption));
1128 pBuf->wRTSDuration_f0 =
cpu_to_le16((
WORD)s_uGetRTSCTSDuration(pDevice,
RTSDUR_AA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption));
1129 pBuf->wRTSDuration_f1 =
cpu_to_le16((
WORD)s_uGetRTSCTSDuration(pDevice,
RTSDUR_AA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption));
1130 pBuf->Data.wDurationID = pBuf->wDuration;
1136 memcpy(&(pBuf->Data.abyRA[0]),
1137 &(psEthHeader->abyDstAddr[0]),
1140 memcpy(&(pBuf->Data.abyRA[0]),
1145 memcpy(&(pBuf->Data.abyTA[0]),
1149 memcpy(&(pBuf->Data.abyTA[0]),
1150 &(psEthHeader->abySrcAddr[0]),
1159 (
PWORD)&(wLen), (
PBYTE)&(pBuf->byServiceField), (
PBYTE)&(pBuf->bySignalField)
1163 pBuf->wDuration =
cpu_to_le16((
WORD)s_uGetRTSCTSDuration(pDevice,
RTSDUR_BB, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption));
1164 pBuf->Data.wDurationID = pBuf->wDuration;
1170 memcpy(&(pBuf->Data.abyRA[0]),
1171 &(psEthHeader->abyDstAddr[0]),
1175 memcpy(&(pBuf->Data.abyRA[0]),
1181 memcpy(&(pBuf->Data.abyTA[0]),
1185 memcpy(&(pBuf->Data.abyTA[0]),
1186 &(psEthHeader->abySrcAddr[0]),
1196 unsigned int uDMAIdx,
1199 unsigned int cbFrameLength,
1206 unsigned int uCTSFrameLen = 14;
1209 if (pvCTS ==
NULL) {
1225 (
PWORD)&(wLen), (
PBYTE)&(pBuf->byServiceField_b), (
PBYTE)&(pBuf->bySignalField_b)
1228 pBuf->wDuration_ba = (
WORD)s_uGetRTSCTSDuration(pDevice,
CTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption);
1230 pBuf->wDuration_ba =
cpu_to_le16(pBuf->wDuration_ba);
1232 pBuf->wCTSDuration_ba_f0 = (
WORD)s_uGetRTSCTSDuration(pDevice,
CTSDUR_BA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption);
1234 pBuf->wCTSDuration_ba_f0 =
cpu_to_le16(pBuf->wCTSDuration_ba_f0);
1236 pBuf->wCTSDuration_ba_f1 = (
WORD)s_uGetRTSCTSDuration(pDevice,
CTSDUR_BA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption);
1238 pBuf->wCTSDuration_ba_f1 =
cpu_to_le16(pBuf->wCTSDuration_ba_f1);
1240 pBuf->Data.wDurationID = pBuf->wDuration_ba;
1242 pBuf->Data.wReserved = 0x0000;
1243 memcpy(&(pBuf->Data.abyRA[0]),
1250 (
PWORD)&(wLen), (
PBYTE)&(pBuf->byServiceField_b), (
PBYTE)&(pBuf->bySignalField_b)
1254 pBuf->wDuration_ba =
cpu_to_le16((
WORD)s_uGetRTSCTSDuration(pDevice,
CTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption));
1256 pBuf->wDuration_ba =
cpu_to_le16(pBuf->wDuration_ba);
1259 pBuf->Data.wDurationID = pBuf->wDuration_ba;
1261 pBuf->Data.wReserved = 0x0000;
1262 memcpy(&(pBuf->Data.abyRA[0]),
1294 s_vGenerateTxParameter (
1302 unsigned int cbFrameSize,
1304 unsigned int uDMAIdx,
1316 pFifoHead->wReserved = wCurrentRate;
1317 wFifoCtl = pFifoHead->wFIFOCtl;
1335 if (pvRTS !=
NULL) {
1339 pBuf->wRTSTxRrvTime_aa =
cpu_to_le16((
WORD)s_uGetRTSCTSRsvTime(pDevice, 2, byPktType, cbFrameSize, wCurrentRate));
1340 pBuf->wRTSTxRrvTime_ba =
cpu_to_le16((
WORD)s_uGetRTSCTSRsvTime(pDevice, 1, byPktType, cbFrameSize, wCurrentRate));
1341 pBuf->wRTSTxRrvTime_bb =
cpu_to_le16((
WORD)s_uGetRTSCTSRsvTime(pDevice, 0, byPktType, cbFrameSize, wCurrentRate));
1342 pBuf->wTxRrvTime_a =
cpu_to_le16((
WORD) s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));
1346 s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
1353 pBuf->wTxRrvTime_a =
cpu_to_le16((
WORD)s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));
1355 pBuf->wCTSTxRrvTime_ba =
cpu_to_le16((
WORD)s_uGetRTSCTSRsvTime(pDevice, 3, byPktType, cbFrameSize, wCurrentRate));
1358 s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK, bDisCRC, wCurrentRate, byFBOption);
1363 if (pvRTS !=
NULL) {
1367 pBuf->wRTSTxRrvTime =
cpu_to_le16((
WORD)s_uGetRTSCTSRsvTime(pDevice, 2, byPktType, cbFrameSize, wCurrentRate));
1368 pBuf->wTxRrvTime =
cpu_to_le16((
WORD)s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));
1371 s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
1373 else if (pvRTS ==
NULL) {
1383 if ((pvRTS !=
NULL)) {
1387 pBuf->wRTSTxRrvTime =
cpu_to_le16((
WORD)s_uGetRTSCTSRsvTime(pDevice, 0, byPktType, cbFrameSize, wCurrentRate));
1391 s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
1415 BOOL bNeedEncryption,
1416 unsigned int uSkbPacketLen,
1417 unsigned int uDMAIdx,
1421 unsigned int uNodeIndex,
1423 unsigned int *pcbHeaderLen,
1424 unsigned int *pcbTotalLen
1428 unsigned int cbFrameSize, cbFrameBodySize;
1430 unsigned int cb802_1_H_len;
1431 unsigned int cbIVlen = 0, cbICVlen = 0, cbMIClen = 0,
1432 cbMACHdLen = 0, cbFCSlen = 4;
1433 unsigned int cbMICHDR = 0;
1435 PBYTE pbyType,pbyMacHdr,pbyIVHead,pbyPayloadHead,pbyTxBufferAddr;
1436 BYTE abySNAP_RFC1042[
ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00};
1437 BYTE abySNAP_Bridgetunnel[
ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0xF8};
1438 unsigned int uDuration;
1439 unsigned int cbHeaderLength = 0, uPadding = 0;
1447 DWORD dwMICKey0,dwMICKey1,dwMIC_Priority,dwCRC;
1448 PDWORD pdwMIC_L,pdwMIC_R;
1454 pvRrvTime = pMICHDR = pvRTS = pvCTS = pvTxDataHd =
NULL;
1455 if ((bNeedEncryption) && (pTransmitKey !=
NULL)) {
1476 cbFrameBodySize = uSkbPacketLen -
ETH_HLEN + cb802_1_H_len;
1487 if (is_multicast_ether_addr(psEthHeader->abyDstAddr)) {
1537 if (bSoftWEP !=
TRUE) {
1538 if ((bNeedEncryption) && (pTransmitKey !=
NULL)) {
1553 if ((bNeedEncryption) && (pTransmitKey !=
NULL)) {
1566 cbMICHDR =
sizeof(SMICHDRHead);
1568 if (bSoftWEP ==
FALSE) {
1570 uPadding = 4 - (cbMACHdLen%4);
1575 cbFrameSize = cbMACHdLen + cbIVlen + (cbFrameBodySize + cbMIClen) + cbICVlen + cbFCSlen;
1585 wTxBufSize =
sizeof(STxBufHead);
1590 pMICHDR = (
PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gRTS));
1591 pvRTS = (
PSRTS_g) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gRTS) + cbMICHDR);
1593 pvTxDataHd = (
PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gRTS) + cbMICHDR +
sizeof(SRTS_g));
1594 cbHeaderLength = wTxBufSize +
sizeof(SRrvTime_gRTS) + cbMICHDR +
sizeof(SRTS_g) +
sizeof(STxDataHead_g);
1598 pMICHDR = (
PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gCTS));
1600 pvCTS = (
PSCTS) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gCTS) + cbMICHDR);
1601 pvTxDataHd = (
PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gCTS) + cbMICHDR +
sizeof(
SCTS));
1602 cbHeaderLength = wTxBufSize +
sizeof(SRrvTime_gCTS) + cbMICHDR +
sizeof(
SCTS) +
sizeof(STxDataHead_g);
1608 pMICHDR = (
PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gRTS));
1609 pvRTS = (
PSRTS_g_FB) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gRTS) + cbMICHDR);
1611 pvTxDataHd = (
PSTxDataHead_g_FB) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gRTS) + cbMICHDR +
sizeof(SRTS_g_FB));
1612 cbHeaderLength = wTxBufSize +
sizeof(SRrvTime_gRTS) + cbMICHDR +
sizeof(SRTS_g_FB) +
sizeof(STxDataHead_g_FB);
1614 else if (bRTS ==
FALSE) {
1616 pMICHDR = (
PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gCTS));
1618 pvCTS = (
PSCTS_FB) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gCTS) + cbMICHDR);
1619 pvTxDataHd = (
PSTxDataHead_g_FB) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gCTS) + cbMICHDR +
sizeof(SCTS_FB));
1620 cbHeaderLength = wTxBufSize +
sizeof(SRrvTime_gCTS) + cbMICHDR +
sizeof(SCTS_FB) +
sizeof(STxDataHead_g_FB);
1627 pvRrvTime = (
PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
1628 pMICHDR = (
PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_ab));
1629 pvRTS = (
PSRTS_ab) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_ab) + cbMICHDR);
1631 pvTxDataHd = (
PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_ab) + cbMICHDR +
sizeof(SRTS_ab));
1632 cbHeaderLength = wTxBufSize +
sizeof(
PSRrvTime_ab) + cbMICHDR +
sizeof(SRTS_ab) +
sizeof(STxDataHead_ab);
1634 else if (bRTS ==
FALSE) {
1635 pvRrvTime = (
PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
1636 pMICHDR = (
PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_ab));
1639 pvTxDataHd = (
PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_ab) + cbMICHDR);
1640 cbHeaderLength = wTxBufSize +
sizeof(SRrvTime_ab) + cbMICHDR +
sizeof(STxDataHead_ab);
1645 pvRrvTime = (
PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
1646 pMICHDR = (
PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_ab));
1647 pvRTS = (
PSRTS_a_FB) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_ab) + cbMICHDR);
1649 pvTxDataHd = (
PSTxDataHead_a_FB) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_ab) + cbMICHDR +
sizeof(SRTS_a_FB));
1650 cbHeaderLength = wTxBufSize +
sizeof(
PSRrvTime_ab) + cbMICHDR +
sizeof(SRTS_a_FB) +
sizeof(STxDataHead_a_FB);
1652 else if (bRTS ==
FALSE) {
1653 pvRrvTime = (
PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
1654 pMICHDR = (
PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_ab));
1657 pvTxDataHd = (
PSTxDataHead_a_FB) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_ab) + cbMICHDR);
1658 cbHeaderLength = wTxBufSize +
sizeof(SRrvTime_ab) + cbMICHDR +
sizeof(STxDataHead_a_FB);
1663 pbyMacHdr = (
PBYTE)(pbyTxBufferAddr + cbHeaderLength);
1664 pbyIVHead = (
PBYTE)(pbyMacHdr + cbMACHdLen + uPadding);
1665 pbyPayloadHead = (
PBYTE)(pbyMacHdr + cbMACHdLen + uPadding + cbIVlen);
1678 s_vGenerateTxParameter(pDevice, byPktType, wCurrentRate,
1679 (
void *)pbyTxBufferAddr, pvRrvTime, pvRTS, pvCTS,
1680 cbFrameSize, bNeedACK, uDMAIdx, psEthHeader);
1682 uDuration = s_uFillDataHead(pDevice, byPktType, wCurrentRate, pvTxDataHd, cbFrameSize, uDMAIdx, bNeedACK,
1683 0, 0, 1, byFBOption);
1685 s_vGenerateMACHeader(pDevice, pbyMacHdr, (
WORD)uDuration, psEthHeader, bNeedEncryption,
1686 byFragType, uDMAIdx, 0);
1688 if (bNeedEncryption ==
TRUE) {
1690 s_vFillTxKey(pDevice, (
PBYTE)(pTxBufHead->
adwTxKey), pbyIVHead, pTransmitKey,
1691 pbyMacHdr, (
WORD)cbFrameBodySize, (
PBYTE)pMICHDR);
1693 if (pDevice->bEnableHostWEP) {
1705 abySNAP_Bridgetunnel, 6);
1707 memcpy((
PBYTE) (pbyPayloadHead), &abySNAP_RFC1042[0], 6);
1709 pbyType = (
PBYTE) (pbyPayloadHead + 6);
1710 memcpy(pbyType, &(psEthHeader->wType),
sizeof(
WORD));
1712 memcpy((
PBYTE) (pbyPayloadHead), &(psEthHeader->wType),
sizeof(
WORD));
1719 if (pPacket !=
NULL) {
1721 memcpy((pbyPayloadHead + cb802_1_H_len),
1731 ASSERT(uLength == cbNdisBodySize);
1766 pdwMIC_L = (
PDWORD)(pbyPayloadHead + cbFrameBodySize);
1767 pdwMIC_R = (
PDWORD)(pbyPayloadHead + cbFrameBodySize + 4);
1783 if (bSoftWEP ==
TRUE) {
1785 s_vSWencryption(pDevice, pTransmitKey, (pbyPayloadHead), (
WORD)(cbFrameBodySize + cbMIClen));
1790 cbFrameSize -= cbICVlen;
1797 dwCRC = 0xFFFFFFFF
L;
1798 cbLen = cbFrameSize - cbFCSlen;
1801 pdwCRC = (
PDWORD)(pbyMacHdr + cbLen);
1807 cbFrameSize -= cbFCSlen;
1810 *pcbHeaderLen = cbHeaderLength;
1811 *pcbTotalLen = cbHeaderLength + cbFrameSize ;
1843 s_vGenerateMACHeader (
1845 PBYTE pbyBufferAddr,
1850 unsigned int uDMAIdx,
1851 unsigned int uFragIdx
1856 memset(pMACHeader, 0, (
sizeof(S802_11Header)));
1865 memcpy(&(pMACHeader->abyAddr1[0]),
1866 &(psEthHeader->abyDstAddr[0]),
1869 memcpy(&(pMACHeader->abyAddr3[0]),
1870 &(psEthHeader->abySrcAddr[0]),
1875 memcpy(&(pMACHeader->abyAddr1[0]),
1876 &(psEthHeader->abyDstAddr[0]),
1878 memcpy(&(pMACHeader->abyAddr2[0]),
1879 &(psEthHeader->abySrcAddr[0]),
1881 memcpy(&(pMACHeader->abyAddr3[0]),
1885 memcpy(&(pMACHeader->abyAddr3[0]),
1886 &(psEthHeader->abyDstAddr[0]),
1888 memcpy(&(pMACHeader->abyAddr2[0]),
1889 &(psEthHeader->abySrcAddr[0]),
1891 memcpy(&(pMACHeader->abyAddr1[0]),
1894 pMACHeader->wFrameCtl |=
FC_TODS;
1949 PBYTE pbyTxBufferAddr;
1953 unsigned int uDuration;
1954 unsigned int cbReqCount;
1956 unsigned int cbHeaderSize;
1957 unsigned int cbFrameBodySize;
1961 unsigned int cbFrameSize;
1962 unsigned int cbIVlen = 0;
1963 unsigned int cbICVlen = 0;
1964 unsigned int cbMIClen = 0;
1965 unsigned int cbFCSlen = 4;
1966 unsigned int uPadding = 0;
1968 unsigned int cbMacHdLen;
1969 SEthernetHeader sEthHeader;
1981 if (
NULL == pContext) {
1990 wTxBufSize =
sizeof(STxBufHead);
1991 memset(pTxBufHead, 0, wTxBufSize);
2015 pTxBufHead->wFIFOCtl = 0;
2090 uPadding = 4 - (cbMacHdLen%4);
2094 cbFrameSize = cbMacHdLen + cbFrameBodySize + cbIVlen + cbMIClen + cbICVlen + cbFCSlen;
2108 pCTS = (
PSCTS) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gCTS));
2109 pvTxDataHd = (
PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gCTS) +
sizeof(
SCTS));
2110 cbHeaderSize = wTxBufSize +
sizeof(SRrvTime_gCTS) +
sizeof(
SCTS) +
sizeof(STxDataHead_g);
2113 pvRrvTime = (
PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
2117 pvTxDataHd = (
PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_ab));
2118 cbHeaderSize = wTxBufSize +
sizeof(SRrvTime_ab) +
sizeof(STxDataHead_ab);
2121 memset((
void *)(pbyTxBufferAddr + wTxBufSize), 0,
2122 (cbHeaderSize - wTxBufSize));
2124 memcpy(&(sEthHeader.abyDstAddr[0]),
2127 memcpy(&(sEthHeader.abySrcAddr[0]),
2137 s_vGenerateTxParameter(pDevice, byPktType, wCurrentRate, pbyTxBufferAddr, pvRrvTime, pvRTS, pCTS,
2141 uDuration = s_uFillDataHead(pDevice, byPktType, wCurrentRate, pvTxDataHd, cbFrameSize,
TYPE_TXDMA0, bNeedACK,
2146 cbReqCount = cbHeaderSize + cbMacHdLen + uPadding + cbIVlen + cbFrameBodySize;
2150 PBYTE pbyPayloadHead;
2154 pbyIVHead = (
PBYTE)(pbyTxBufferAddr + cbHeaderSize + cbMacHdLen + uPadding);
2155 pbyPayloadHead = (
PBYTE)(pbyTxBufferAddr + cbHeaderSize + cbMacHdLen + uPadding + cbIVlen);
2175 pTransmitKey =
NULL;
2182 s_vFillTxKey(pDevice, (
PBYTE)(pTxBufHead->adwTxKey), pbyIVHead, pTransmitKey,
2216 pTX_Buffer->
byType = 0x00;
2223 s_vSaveTxPktInfo(pDevice, (
BYTE) (pTX_Buffer->
byPKTNO & 0x0F), &(pMACHeader->abyAddr1[0]),(
WORD)cbFrameSize,pTX_Buffer->
wFIFOCtl);
2226 s_vSaveTxPktInfo(pDevice, (
BYTE) (pTX_Buffer->
byPKTNO & 0x0F), &(pMACHeader->abyAddr3[0]),(
WORD)cbFrameSize,pTX_Buffer->
wFIFOCtl);
2242 unsigned int cbHeaderSize = 0;
2243 WORD wTxBufSize =
sizeof(STxShortBufHead);
2248 unsigned int cbFrameBodySize;
2249 unsigned int cbReqCount;
2251 PBYTE pbyTxBufferAddr;
2257 if (
NULL == pContext) {
2268 wTxBufSize =
sizeof(STxShortBufHead);
2269 memset(pTxBufHead, 0, wTxBufSize);
2276 (
PWORD)&(pTxDataHead->wTransmitLength), (
PBYTE)&(pTxDataHead->byServiceField), (
PBYTE)&(pTxDataHead->bySignalField)
2282 cbHeaderSize = wTxBufSize +
sizeof(STxDataHead_ab);
2289 (
PWORD)&(pTxDataHead->wTransmitLength), (
PBYTE)&(pTxDataHead->byServiceField), (
PBYTE)&(pTxDataHead->bySignalField)
2295 cbHeaderSize = wTxBufSize +
sizeof(STxDataHead_ab);
2302 pMACHeader->wDurationID = 0;
2312 pTX_Buffer->
byType = 0x01;
2332 PBYTE pbyTxBufferAddr;
2336 unsigned int uDuration;
2337 unsigned int cbReqCount;
2339 unsigned int cbHeaderSize;
2340 unsigned int cbFrameBodySize;
2344 unsigned int cbFrameSize;
2345 unsigned int cbIVlen = 0;
2346 unsigned int cbICVlen = 0;
2347 unsigned int cbMIClen = 0;
2348 unsigned int cbFCSlen = 4;
2349 unsigned int uPadding = 0;
2350 unsigned int cbMICHDR = 0;
2351 unsigned int uLength = 0;
2352 DWORD dwMICKey0, dwMICKey1;
2353 DWORD dwMIC_Priority;
2357 unsigned int cbMacHdLen;
2358 SEthernetHeader sEthHeader;
2363 unsigned int uNodeIndex = 0;
2368 PBYTE pbyPayloadHead;
2370 unsigned int cbExtSuppRate = 0;
2376 pvRrvTime = pMICHDR = pvRTS = pvCTS = pvTxDataHd =
NULL;
2379 cbFrameBodySize = 0;
2388 if (
NULL == pContext) {
2397 wTxBufSize =
sizeof(STxBufHead);
2398 memset(pTxBufHead, 0, wTxBufSize);
2422 pTxBufHead->wFIFOCtl = 0;
2437 if (is_multicast_ether_addr(p80211Header->
sA3.abyAddr1)) {
2439 if (pDevice->bEnableHostWEP) {
2445 if (pDevice->bEnableHostWEP) {
2487 if (cbExtSuppRate >0) {
2520 cbMICHDR =
sizeof(SMICHDRHead);
2525 uPadding = 4 - (cbMacHdLen%4);
2529 cbFrameSize = cbMacHdLen + cbFrameBodySize + cbIVlen + cbMIClen + cbICVlen + cbFCSlen + cbExtSuppRate;
2541 pMICHDR = (
PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gCTS));
2543 pvCTS = (
PSCTS) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gCTS) + cbMICHDR);
2544 pvTxDataHd = (
PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_gCTS) + cbMICHDR +
sizeof(
SCTS));
2545 cbHeaderSize = wTxBufSize +
sizeof(SRrvTime_gCTS) + cbMICHDR +
sizeof(
SCTS) +
sizeof(STxDataHead_g);
2550 pvRrvTime = (
PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
2551 pMICHDR = (
PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_ab));
2554 pvTxDataHd = (
PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize +
sizeof(SRrvTime_ab) + cbMICHDR);
2555 cbHeaderSize = wTxBufSize +
sizeof(SRrvTime_ab) + cbMICHDR +
sizeof(STxDataHead_ab);
2557 memset((
void *)(pbyTxBufferAddr + wTxBufSize), 0,
2558 (cbHeaderSize - wTxBufSize));
2559 memcpy(&(sEthHeader.abyDstAddr[0]),
2560 &(p80211Header->
sA3.abyAddr1[0]),
2562 memcpy(&(sEthHeader.abySrcAddr[0]),
2563 &(p80211Header->
sA3.abyAddr2[0]),
2572 s_vGenerateTxParameter(pDevice, byPktType, wCurrentRate, pbyTxBufferAddr, pvRrvTime, pvRTS, pvCTS,
2576 uDuration = s_uFillDataHead(pDevice, byPktType, wCurrentRate, pvTxDataHd, cbFrameSize,
TYPE_TXDMA0, bNeedACK,
2581 cbReqCount = cbHeaderSize + cbMacHdLen + uPadding + cbIVlen + (cbFrameBodySize + cbMIClen) + cbExtSuppRate;
2583 pbyMacHdr = (
PBYTE)(pbyTxBufferAddr + cbHeaderSize);
2584 pbyPayloadHead = (
PBYTE)(pbyMacHdr + cbMacHdLen + uPadding + cbIVlen);
2585 pbyIVHead = (
PBYTE)(pbyMacHdr + cbMacHdLen + uPadding);
2592 memcpy(pbyPayloadHead, (skb->
data + cbMacHdLen), cbFrameBodySize);
2596 if (cbExtSuppRate != 0) {
2598 memcpy((pbyPayloadHead + cbFrameBodySize),
2613 if (pDevice->bEnableHostWEP) {
2614 pTransmitKey = &STempKey;
2638 uLength = cbHeaderSize + cbMacHdLen + uPadding + cbIVlen;
2640 MIC_vAppend((pbyTxBufferAddr + uLength), cbFrameBodySize);
2642 pdwMIC_L = (
PDWORD)(pbyTxBufferAddr + uLength + cbFrameBodySize);
2643 pdwMIC_R = (
PDWORD)(pbyTxBufferAddr + uLength + cbFrameBodySize + 4);
2660 s_vFillTxKey(pDevice, (
PBYTE)(pTxBufHead->adwTxKey), pbyIVHead, pTransmitKey,
2661 pbyMacHdr, (
WORD)cbFrameBodySize, (
PBYTE)pMICHDR);
2663 if (pDevice->bEnableHostWEP) {
2669 s_vSWencryption(pDevice, pTransmitKey, pbyPayloadHead, (
WORD)(cbFrameBodySize + cbMIClen));
2695 pTX_Buffer->
byType = 0x00;
2702 s_vSaveTxPktInfo(pDevice, (
BYTE) (pTX_Buffer->
byPKTNO & 0x0F), &(pMACHeader->abyAddr1[0]),(
WORD)cbFrameSize,pTX_Buffer->
wFIFOCtl);
2705 s_vSaveTxPktInfo(pDevice, (
BYTE) (pTX_Buffer->
byPKTNO & 0x0F), &(pMACHeader->abyAddr3[0]),(
WORD)cbFrameSize,pTX_Buffer->
wFIFOCtl);
2733 unsigned int BytesToWrite = 0, uHeaderLen = 0;
2734 unsigned int uNodeIndex = 0;
2735 BYTE byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80};
2747 BOOL fConvertedPacket;
2762 if (is_multicast_ether_addr((
PBYTE)(skb->
data))) {
2793 pMgmt->
abyPSTxMap[wAID >> 3] |= byMask[wAID & 7];
2813 if (bNodeExist ==
FALSE) {
2822 if (pContext ==
NULL) {
2832 BYTE Protocol_Version;
2834 BYTE Descriptor_type;
2843 if (((Protocol_Version == 1) || (Protocol_Version == 2)) &&
2844 (Packet_Type == 3)) {
2845 bTxeapol_key =
TRUE;
2846 if(!(Key_info &
BIT3) &&
2847 (Key_info &
BIT8) && (Key_info &
BIT9)) {
2848 if(Descriptor_type==254) {
2856 PRINT_K(
"Authentication completed!!\n");
2858 else if((Key_info & BIT3) && (Descriptor_type==2) &&
2859 (Key_info &
BIT8) && (Key_info & BIT9)) {
2861 PRINT_K(
"WPA2 Authentication completed!!\n");
2869 bNeedEncryption =
TRUE;
2879 bTKIP_UseGTK =
TRUE;
2891 for (ii = 0; ii< 6; ii++)
2902 pTransmitKey =
NULL;
2909 bTKIP_UseGTK =
TRUE;
2915 if (pDevice->bEnableHostWEP) {
2918 pTransmitKey = &STempKey;
2955 if (is_multicast_ether_addr(pDevice->
sTxEthHeader.abyDstAddr)) {
3005 KERN_INFO "dma_tx: pDevice->wCurrentRate = %d\n",
3016 if (bNeedEncryption ==
TRUE) {
3019 bNeedEncryption =
FALSE;
3022 if (pTransmitKey ==
NULL) {
3026 if (bTKIP_UseGTK ==
TRUE) {
3031 bNeedEncryption =
TRUE;
3041 if (pDevice->bEnableHostWEP) {
3042 if ((uNodeIndex != 0) &&
3045 bNeedEncryption =
TRUE;
3051 if (pTransmitKey ==
NULL) {
3061 (
PBYTE)(&pContext->
Data[0]), bNeedEncryption,
3063 (
PBYTE)skb->
data, pTransmitKey, uNodeIndex,
3065 &uHeaderLen, &BytesToWrite
3068 if (fConvertedPacket ==
FALSE) {
3095 if (bNeedDeAuth ==
TRUE) {
3133 unsigned int uDataLen,
3134 unsigned int uNodeIndex
3138 unsigned int BytesToWrite = 0, uHeaderLen = 0;
3146 BOOL fConvertedPacket;
3155 if (
NULL == pContext) {
3162 bNeedEncryption =
TRUE;
3166 pTransmitKey =
NULL;
3173 if (pDevice->bEnableHostWEP) {
3175 pTransmitKey = &STempKey;
3188 if ( bNeedEncryption && (pTransmitKey ==
NULL) ) {
3231 (
PBYTE)(&pContext->
Data[0]), bNeedEncryption,
3233 pbySkbData, pTransmitKey, uNodeIndex,
3235 &uHeaderLen, &BytesToWrite
3238 if (fConvertedPacket ==
FALSE) {