2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 * Purpose: Implement functions to access baseband
29 * BBuGetFrameTime - Calculate data frame transmitting time
30 * BBvCaculateParameter - Caculate PhyLength, PhyService and Phy Signal parameter for baseband Tx
31 * BBbVT3184Init - VIA VT3184 baseband chip init code
32 * BBvLoopbackOn - Turn on BaseBand Loopback mode
33 * BBvLoopbackOff - Turn off BaseBand Loopback mode
51 /*--------------------- Static Definitions -------------------------*/
52 static int msglevel
=MSG_LEVEL_INFO
;
53 //static int msglevel =MSG_LEVEL_DEBUG;
55 /*--------------------- Static Classes ----------------------------*/
57 /*--------------------- Static Variables --------------------------*/
59 /*--------------------- Static Functions --------------------------*/
61 /*--------------------- Export Variables --------------------------*/
63 /*--------------------- Static Definitions -------------------------*/
65 /*--------------------- Static Classes ----------------------------*/
67 /*--------------------- Static Variables --------------------------*/
70 BYTE abyVT3184_AGC
[] = {
74 0x02, //3 //RobertYu:20060505, 0x04, //3
76 0x04, //5 //RobertYu:20060505, 0x06, //5
138 BYTE abyVT3184_AL2230
[] = {
148 0x45,//tx //0x64 for FPGA
166 0x8e, //RobertYu:20060522, //0x8d,
167 0x0a, //RobertYu:20060515, //0x09,
186 0x0c, //RobertYu:20060522, //0x10,
219 0x00,//50 //RobertYu:20060505, //0x15,//50
228 0xd0, //RobertYu:20060505, //0xb0,
247 0x00, //0x80 for FPGA
277 0x1f, //RobertYu:20060516, //0x0f,
282 0x00, //RobertYu:20060505, //0x02,
283 0x20,//90 //RobertYu:20060505, //0x22,//90
312 0x15, //RobertYu:20060516, //0x00,
336 0xff, //RobertYu:20060509, //0x2c,
337 0x0e, //RobertYu:20060530, //0x0c,
340 0x00, //RobertYu:20060505, //0x01,
341 0x82, //RobertYu:20060516, //0x8f,
345 0x30, //RobertYu:20060627, //0x0b,
346 0x05, //RobertYu:20060516, //0x25,
364 0xf3, //RobertYu:20060516, //0xd3,
370 0x12, //RobertYu:20060627, //0x10,
378 0x05, //RobertYu:20060516, //0x0c,
399 //{{RobertYu:20060515, new BB setting for VT3226D0
400 BYTE abyVT3184_VT3226D0
[] = {
410 0x45,//tx //0x64 for FPGA
428 0x8e, //RobertYu:20060525, //0x8d,
429 0x0a, //RobertYu:20060515, //0x09,
448 0x0c, //RobertYu:20060525, //0x10,
481 0x00,//50 //RobertYu:20060505, //0x15,//50
490 0xd0, //RobertYu:20060505, //0xb0,
509 0x00, //0x80 for FPGA
539 0x1f, //RobertYu:20060515, //0x0f,
544 0x00, //RobertYu:20060505, //0x02,
545 0x20,//90 //RobertYu:20060505, //0x22,//90
598 0xff, //RobertYu:20060509, //0x2c,
599 0x10, //RobertYu:20060525, //0x0c,
602 0x00, //RobertYu:20060505, //0x01,
603 0x84, //RobertYu:20060525, //0x8f,
607 0x24, //RobertYu:20060627, //0x18,
608 0x05, //RobertYu:20060515, //0x25,
626 0xf3, //RobertYu:20060515, //0xd3,
632 0x10, //RobertYu:20060627, //0x0e,
640 0x08, //RobertYu:20060515, //0x0c,
659 const WORD awcFrameTime
[MAX_RATE
] =
660 {10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216};
662 /*--------------------- Static Functions --------------------------*/
667 s_ulGetLowSQ3(PSDevice pDevice);
671 s_ulGetRatio(PSDevice pDevice);
675 s_vClearSQ3Value(PSDevice pDevice);
678 /*--------------------- Export Variables --------------------------*/
680 * Description: Calculate data frame transmitting time
684 * byPreambleType - Preamble Type
685 * byPktType - PK_TYPE_11A, PK_TYPE_11B, PK_TYPE_11GB, PK_TYPE_11GA
686 * cbFrameLength - Baseband Type
690 * Return Value: FrameTime
695 IN BYTE byPreambleType
,
697 IN UINT cbFrameLength
,
704 UINT uRateIdx
= (UINT
)wRate
;
708 if (uRateIdx
> RATE_54M
) {
713 uRate
= (UINT
)awcFrameTime
[uRateIdx
];
715 if (uRateIdx
<= 3) { //CCK mode
717 if (byPreambleType
== 1) {//Short
722 uFrameTime
= (cbFrameLength
* 80) / uRate
; //?????
723 uTmp
= (uFrameTime
* uRate
) / 80;
724 if (cbFrameLength
!= uTmp
) {
728 return (uPreamble
+ uFrameTime
);
731 uFrameTime
= (cbFrameLength
* 8 + 22) / uRate
; //????????
732 uTmp
= ((uFrameTime
* uRate
) - 22) / 8;
733 if(cbFrameLength
!= uTmp
) {
736 uFrameTime
= uFrameTime
* 4; //???????
737 if(byPktType
!= PK_TYPE_11A
) {
740 return (20 + uFrameTime
); //??????
745 * Description: Caculate Length, Service, and Signal fields of Phy for Tx
749 * pDevice - Device Structure
750 * cbFrameLength - Tx Frame Length
753 * pwPhyLen - pointer to Phy Length field
754 * pbyPhySrv - pointer to Phy Service field
755 * pbyPhySgn - pointer to Phy Signal field
761 BBvCaculateParameter (
763 IN UINT cbFrameLength
,
765 IN BYTE byPacketType
,
775 BYTE byPreambleType
= pDevice
->byPreambleType
;
776 BOOL bCCK
= pDevice
->bCCK
;
778 cbBitCount
= cbFrameLength
* 8;
783 cbUsCount
= cbBitCount
;
788 cbUsCount
= cbBitCount
/ 2;
789 if (byPreambleType
== 1)
791 else // long preamble
798 cbUsCount
= (cbBitCount
* 10) / 55;
799 cbTmp
= (cbUsCount
* 55) / 10;
800 if (cbTmp
!= cbBitCount
)
802 if (byPreambleType
== 1)
804 else // long preamble
812 cbUsCount
= cbBitCount
/ 11;
813 cbTmp
= cbUsCount
* 11;
814 if (cbTmp
!= cbBitCount
) {
816 if ((cbBitCount
- cbTmp
) <= 3)
819 if (byPreambleType
== 1)
821 else // long preamble
826 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
827 *pbyPhySgn
= 0x9B; //1001 1011
830 *pbyPhySgn
= 0x8B; //1000 1011
835 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
836 *pbyPhySgn
= 0x9F; //1001 1111
839 *pbyPhySgn
= 0x8F; //1000 1111
844 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
845 *pbyPhySgn
= 0x9A; //1001 1010
848 *pbyPhySgn
= 0x8A; //1000 1010
853 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
854 *pbyPhySgn
= 0x9E; //1001 1110
857 *pbyPhySgn
= 0x8E; //1000 1110
862 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
863 *pbyPhySgn
= 0x99; //1001 1001
866 *pbyPhySgn
= 0x89; //1000 1001
871 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
872 *pbyPhySgn
= 0x9D; //1001 1101
875 *pbyPhySgn
= 0x8D; //1000 1101
880 if(byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
881 *pbyPhySgn
= 0x98; //1001 1000
884 *pbyPhySgn
= 0x88; //1000 1000
889 if (byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
890 *pbyPhySgn
= 0x9C; //1001 1100
893 *pbyPhySgn
= 0x8C; //1000 1100
898 if (byPacketType
== PK_TYPE_11A
) {//11a, 5GHZ
899 *pbyPhySgn
= 0x9C; //1001 1100
902 *pbyPhySgn
= 0x8C; //1000 1100
907 if (byPacketType
== PK_TYPE_11B
) {
910 *pbyPhySrv
= *pbyPhySrv
| 0x80;
911 *pwPhyLen
= (WORD
) cbUsCount
;
915 *pwPhyLen
= (WORD
)cbFrameLength
;
921 * Description: Set Antenna mode
925 * pDevice - Device Structure
926 * byAntennaMode - Antenna Mode
934 BBvSetAntennaMode (PSDevice pDevice
, BYTE byAntennaMode
)
936 //{{ RobertYu: 20041124, ABG Mode, VC1/VC2 define, make the ANT_A, ANT_B inverted
937 /*if ( (pDevice->byRFType == RF_MAXIM2829) ||
938 (pDevice->byRFType == RF_UW2452) ||
939 (pDevice->byRFType == RF_AIROHA7230) ) { // RobertYu: 20041210, 20050104
941 switch (byAntennaMode) {
943 byAntennaMode = ANT_TXB;
946 byAntennaMode = ANT_TXA;
949 byAntennaMode = ANT_RXB;
952 byAntennaMode = ANT_RXA;
957 switch (byAntennaMode
) {
963 pDevice
->byBBRxConf
&= 0xFC;
966 pDevice
->byBBRxConf
&= 0xFE;
967 pDevice
->byBBRxConf
|= 0x02;;
972 CONTROLnsRequestOut(pDevice
,
973 MESSAGE_TYPE_SET_ANTMD
,
974 (WORD
) byAntennaMode
,
981 * Description: Set Antenna mode
985 * pDevice - Device Structure
986 * byAntennaMode - Antenna Mode
994 BBbVT3184Init (PSDevice pDevice
)
1003 ntStatus
= CONTROLnsRequestIn(pDevice
,
1006 MESSAGE_REQUEST_EEPROM
,
1007 EEP_MAX_CONTEXT_SIZE
,
1008 pDevice
->abyEEPROM
);
1009 if (ntStatus
!= STATUS_SUCCESS
) {
1014 //20080215-01,<Add> by Mike Liu
1015 // if ((pDevice->abyEEPROM[EEP_OFS_RADIOCTL]&0x06)==0x04)
1018 //20080804-01,<Add> by Mike Liu
1020 pDevice
->byOriginalZonetype
= pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
];
1021 if(pDevice
->config_file
.ZoneType
>= 0) { //read zonetype file ok!
1022 if ((pDevice
->config_file
.ZoneType
== 0)&&
1023 (pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
] !=0x00)){ //for USA
1024 pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
] = 0;
1025 pDevice
->abyEEPROM
[EEP_OFS_MAXCHANNEL
] = 0x0B;
1026 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Init Zone Type :USA\n");
1028 else if((pDevice
->config_file
.ZoneType
== 1)&&
1029 (pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
]!=0x01)){ //for Japan
1030 pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
] = 0x01;
1031 pDevice
->abyEEPROM
[EEP_OFS_MAXCHANNEL
] = 0x0D;
1032 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Init Zone Type :Japan\n");
1034 else if((pDevice
->config_file
.ZoneType
== 2)&&
1035 (pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
]!=0x02)){ //for Europe
1036 pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
] = 0x02;
1037 pDevice
->abyEEPROM
[EEP_OFS_MAXCHANNEL
] = 0x0D;
1038 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Init Zone Type :Europe\n");
1041 if(pDevice
->config_file
.ZoneType
!=pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
])
1042 printk("zonetype in file[%02x] mismatch with in EEPROM[%02x]\n",pDevice
->config_file
.ZoneType
,pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
]);
1044 printk("Read Zonetype file sucess,use default zonetype setting[%02x]\n",pDevice
->config_file
.ZoneType
);
1048 if ( !pDevice
->bZoneRegExist
) {
1049 pDevice
->byZoneType
= pDevice
->abyEEPROM
[EEP_OFS_ZONETYPE
];
1051 pDevice
->byRFType
= pDevice
->abyEEPROM
[EEP_OFS_RFTYPE
];
1053 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"Zone Type %x\n", pDevice
->byZoneType
);
1054 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"RF Type %d\n", pDevice
->byRFType
);
1056 if ((pDevice
->byRFType
== RF_AL2230
) || (pDevice
->byRFType
== RF_AL2230S
)) {
1057 pDevice
->byBBRxConf
= abyVT3184_AL2230
[10];
1058 wLength
= sizeof(abyVT3184_AL2230
);
1059 pbyAddr
= abyVT3184_AL2230
;
1060 pbyAgc
= abyVT3184_AGC
;
1061 wLengthAgc
= sizeof(abyVT3184_AGC
);
1063 pDevice
->abyBBVGA
[0] = 0x1C;
1064 pDevice
->abyBBVGA
[1] = 0x10;
1065 pDevice
->abyBBVGA
[2] = 0x0;
1066 pDevice
->abyBBVGA
[3] = 0x0;
1067 pDevice
->ldBmThreshold
[0] = -70;
1068 pDevice
->ldBmThreshold
[1] = -48;
1069 pDevice
->ldBmThreshold
[2] = 0;
1070 pDevice
->ldBmThreshold
[3] = 0;
1072 else if (pDevice
->byRFType
== RF_AIROHA7230
) {
1073 pDevice
->byBBRxConf
= abyVT3184_AL2230
[10];
1074 wLength
= sizeof(abyVT3184_AL2230
);
1075 pbyAddr
= abyVT3184_AL2230
;
1076 pbyAgc
= abyVT3184_AGC
;
1077 wLengthAgc
= sizeof(abyVT3184_AGC
);
1079 // Init ANT B select,TX Config CR09 = 0x61->0x45, 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted)
1080 //pbyAddr[0x09] = 0x41;
1081 // Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted)
1082 //pbyAddr[0x0a] = 0x28;
1083 // Select VC1/VC2, CR215 = 0x02->0x06
1084 pbyAddr
[0xd7] = 0x06;
1086 pDevice
->abyBBVGA
[0] = 0x1C;
1087 pDevice
->abyBBVGA
[1] = 0x10;
1088 pDevice
->abyBBVGA
[2] = 0x0;
1089 pDevice
->abyBBVGA
[3] = 0x0;
1090 pDevice
->ldBmThreshold
[0] = -70;
1091 pDevice
->ldBmThreshold
[1] = -48;
1092 pDevice
->ldBmThreshold
[2] = 0;
1093 pDevice
->ldBmThreshold
[3] = 0;
1095 else if ( (pDevice
->byRFType
== RF_VT3226
) || (pDevice
->byRFType
== RF_VT3226D0
) ) {
1096 pDevice
->byBBRxConf
= abyVT3184_VT3226D0
[10]; //RobertYu:20060515
1097 wLength
= sizeof(abyVT3184_VT3226D0
); //RobertYu:20060515
1098 pbyAddr
= abyVT3184_VT3226D0
; //RobertYu:20060515
1099 pbyAgc
= abyVT3184_AGC
;
1100 wLengthAgc
= sizeof(abyVT3184_AGC
);
1102 pDevice
->abyBBVGA
[0] = 0x20; //RobertYu:20060104, reguest by Jack
1103 pDevice
->abyBBVGA
[1] = 0x10;
1104 pDevice
->abyBBVGA
[2] = 0x0;
1105 pDevice
->abyBBVGA
[3] = 0x0;
1106 pDevice
->ldBmThreshold
[0] = -70;
1107 pDevice
->ldBmThreshold
[1] = -48;
1108 pDevice
->ldBmThreshold
[2] = 0;
1109 pDevice
->ldBmThreshold
[3] = 0;
1110 // Fix VT3226 DFC system timing issue
1111 MACvRegBitsOn(pDevice
, MAC_REG_SOFTPWRCTL2
, SOFTPWRCTL_RFLEOPT
);
1113 //{{RobertYu:20060609
1114 } else if ( (pDevice
->byRFType
== RF_VT3342A0
) ) {
1115 pDevice
->byBBRxConf
= abyVT3184_VT3226D0
[10];
1116 wLength
= sizeof(abyVT3184_VT3226D0
);
1117 pbyAddr
= abyVT3184_VT3226D0
;
1118 pbyAgc
= abyVT3184_AGC
;
1119 wLengthAgc
= sizeof(abyVT3184_AGC
);
1121 pDevice
->abyBBVGA
[0] = 0x20;
1122 pDevice
->abyBBVGA
[1] = 0x10;
1123 pDevice
->abyBBVGA
[2] = 0x0;
1124 pDevice
->abyBBVGA
[3] = 0x0;
1125 pDevice
->ldBmThreshold
[0] = -70;
1126 pDevice
->ldBmThreshold
[1] = -48;
1127 pDevice
->ldBmThreshold
[2] = 0;
1128 pDevice
->ldBmThreshold
[3] = 0;
1129 // Fix VT3226 DFC system timing issue
1130 MACvRegBitsOn(pDevice
, MAC_REG_SOFTPWRCTL2
, SOFTPWRCTL_RFLEOPT
);
1136 memcpy(abyArray
, pbyAddr
, wLength
);
1137 CONTROLnsRequestOut(pDevice
,
1140 MESSAGE_REQUEST_BBREG
,
1145 memcpy(abyArray
, pbyAgc
, wLengthAgc
);
1146 CONTROLnsRequestOut(pDevice
,
1149 MESSAGE_REQUEST_BBAGC
,
1155 if ((pDevice
->byRFType
== RF_VT3226
) || //RobertYu:20051116, 20060111 remove VT3226D0
1156 (pDevice
->byRFType
== RF_VT3342A0
) //RobertYu:20060609
1158 ControlvWriteByte(pDevice
,MESSAGE_REQUEST_MACREG
,MAC_REG_ITRTMSET
,0x23);
1159 MACvRegBitsOn(pDevice
,MAC_REG_PAPEDELAY
,0x01);
1161 else if (pDevice
->byRFType
== RF_VT3226D0
)
1163 ControlvWriteByte(pDevice
,MESSAGE_REQUEST_MACREG
,MAC_REG_ITRTMSET
,0x11);
1164 MACvRegBitsOn(pDevice
,MAC_REG_PAPEDELAY
,0x01);
1168 ControlvWriteByte(pDevice
,MESSAGE_REQUEST_BBREG
,0x04,0x7F);
1169 ControlvWriteByte(pDevice
,MESSAGE_REQUEST_BBREG
,0x0D,0x01);
1171 RFbRFTableDownload(pDevice
);
1172 return TRUE
;//ntStatus;
1177 * Description: Turn on BaseBand Loopback mode
1181 * pDevice - Device Structure
1186 * Return Value: none
1189 void BBvLoopbackOn (PSDevice pDevice
)
1194 ControlvReadByte (pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, &pDevice
->byBBCRc9
);//CR201
1195 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0);
1196 ControlvReadByte (pDevice
, MESSAGE_REQUEST_BBREG
, 0x4D, &pDevice
->byBBCR4d
);//CR77
1197 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x4D, 0x90);
1199 //CR 88 = 0x02(CCK), 0x03(OFDM)
1200 ControlvReadByte (pDevice
, MESSAGE_REQUEST_BBREG
, 0x88, &pDevice
->byBBCR88
);//CR136
1202 if (pDevice
->wCurrentRate
<= RATE_11M
) { //CCK
1203 // Enable internal digital loopback: CR33 |= 0000 0001
1204 ControlvReadByte (pDevice
, MESSAGE_REQUEST_BBREG
, 0x21, &byData
);//CR33
1205 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x21, (BYTE
)(byData
| 0x01));//CR33
1207 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x9A, 0); //CR154
1209 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x88, 0x02);//CR239
1212 // Enable internal digital loopback:CR154 |= 0000 0001
1213 ControlvReadByte (pDevice
, MESSAGE_REQUEST_BBREG
, 0x9A, &byData
);//CR154
1214 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x9A, (BYTE
)(byData
| 0x01));//CR154
1216 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x21, 0); //CR33
1218 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x88, 0x03);//CR239
1222 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0E, 0);//CR14
1225 ControlvReadByte (pDevice
, MESSAGE_REQUEST_BBREG
, 0x09, &pDevice
->byBBCR09
);
1226 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x09, (BYTE
)(pDevice
->byBBCR09
& 0xDE));
1230 * Description: Turn off BaseBand Loopback mode
1234 * pDevice - Device Structure
1239 * Return Value: none
1242 void BBvLoopbackOff (PSDevice pDevice
)
1246 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, pDevice
->byBBCRc9
);//CR201
1247 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x88, pDevice
->byBBCR88
);//CR136
1248 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x09, pDevice
->byBBCR09
);//CR136
1249 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x4D, pDevice
->byBBCR4d
);//CR77
1251 if (pDevice
->wCurrentRate
<= RATE_11M
) { // CCK
1252 // Set the CR33 Bit2 to disable internal Loopback.
1253 ControlvReadByte (pDevice
, MESSAGE_REQUEST_BBREG
, 0x21, &byData
);//CR33
1254 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x21, (BYTE
)(byData
& 0xFE));//CR33
1257 ControlvReadByte (pDevice
, MESSAGE_REQUEST_BBREG
, 0x9A, &byData
);//CR154
1258 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x9A, (BYTE
)(byData
& 0xFE));//CR154
1260 ControlvReadByte (pDevice
, MESSAGE_REQUEST_BBREG
, 0x0E, &byData
);//CR14
1261 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0E, (BYTE
)(byData
| 0x80));//CR14
1267 * Description: Set ShortSlotTime mode
1271 * pDevice - Device Structure
1275 * Return Value: none
1279 BBvSetShortSlotTime (PSDevice pDevice
)
1283 if (pDevice
->bShortSlotTime
) {
1284 pDevice
->byBBRxConf
&= 0xDF;//1101 1111
1286 pDevice
->byBBRxConf
|= 0x20;//0010 0000
1289 ControlvReadByte (pDevice
, MESSAGE_REQUEST_BBREG
, 0xE7, &byBBVGA
);
1290 if (byBBVGA
== pDevice
->abyBBVGA
[0]) {
1291 pDevice
->byBBRxConf
|= 0x20;//0010 0000
1294 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0A, pDevice
->byBBRxConf
);
1299 VOID
BBvSetVGAGainOffset(PSDevice pDevice
, BYTE byData
)
1302 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xE7, byData
);
1304 // patch for 3253B0 Baseband with Cardbus module
1305 if (byData
== pDevice
->abyBBVGA
[0]) {
1306 pDevice
->byBBRxConf
|= 0x20;//0010 0000
1307 } else if (pDevice
->bShortSlotTime
) {
1308 pDevice
->byBBRxConf
&= 0xDF;//1101 1111
1310 pDevice
->byBBRxConf
|= 0x20;//0010 0000
1312 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0A, pDevice
->byBBRxConf
);//CR10
1317 * Description: Baseband SoftwareReset
1321 * dwIoBase - I/O base address
1325 * Return Value: none
1329 BBvSoftwareReset (PSDevice pDevice
)
1331 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x50, 0x40);
1332 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x50, 0);
1333 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x9C, 0x01);
1334 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x9C, 0);
1338 * Description: BBvSetDeepSleep
1342 * pDevice - Device Structure
1346 * Return Value: none
1350 BBvSetDeepSleep (PSDevice pDevice
)
1352 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0c, 0x17);//CR12
1353 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0D, 0xB9);//CR13
1357 BBvExitDeepSleep (PSDevice pDevice
)
1359 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0C, 0x00);//CR12
1360 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0x0D, 0x01);//CR13
1366 s_ulGetLowSQ3(PSDevice pDevice
)
1372 ulMaxPacket
= pDevice
->aulPktNum
[RATE_54M
];
1373 if ( pDevice
->aulPktNum
[RATE_54M
] != 0 ) {
1374 ulSQ3
= pDevice
->aulSQ3Val
[RATE_54M
] / pDevice
->aulPktNum
[RATE_54M
];
1376 for ( ii
=RATE_48M
;ii
>=RATE_6M
;ii
-- ) {
1377 if ( pDevice
->aulPktNum
[ii
] > ulMaxPacket
) {
1378 ulMaxPacket
= pDevice
->aulPktNum
[ii
];
1379 ulSQ3
= pDevice
->aulSQ3Val
[ii
] / pDevice
->aulPktNum
[ii
];
1390 s_ulGetRatio (PSDevice pDevice
)
1397 //This is a thousand-ratio
1398 ulMaxPacket
= pDevice
->aulPktNum
[RATE_54M
];
1399 if ( pDevice
->aulPktNum
[RATE_54M
] != 0 ) {
1400 ulPacketNum
= pDevice
->aulPktNum
[RATE_54M
];
1401 ulRatio
= (ulPacketNum
* 1000 / pDevice
->uDiversityCnt
);
1402 ulRatio
+= TOP_RATE_54M
;
1404 for ( ii
=RATE_48M
;ii
>=RATE_1M
;ii
-- ) {
1405 if ( pDevice
->aulPktNum
[ii
] > ulMaxPacket
) {
1407 for ( jj
=RATE_54M
;jj
>=ii
;jj
--)
1408 ulPacketNum
+= pDevice
->aulPktNum
[jj
];
1409 ulRatio
= (ulPacketNum
* 1000 / pDevice
->uDiversityCnt
);
1410 ulRatio
+= TOP_RATE_48M
;
1411 ulMaxPacket
= pDevice
->aulPktNum
[ii
];
1422 s_vClearSQ3Value (PSDevice pDevice
)
1425 pDevice
->uDiversityCnt
= 0;
1427 for ( ii
=RATE_1M
;ii
<MAX_RATE
;ii
++) {
1428 pDevice
->aulPktNum
[ii
] = 0;
1429 pDevice
->aulSQ3Val
[ii
] = 0;
1435 * Description: Antenna Diversity
1439 * pDevice - Device Structure
1440 * byRSR - RSR from received packet
1441 * bySQ3 - SQ3 value from received packet
1445 * Return Value: none
1450 BBvAntennaDiversity (PSDevice pDevice
, BYTE byRxRate
, BYTE bySQ3
)
1453 pDevice
->uDiversityCnt
++;
1454 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"pDevice->uDiversityCnt = %d\n", (int)pDevice
->uDiversityCnt
);
1456 if (byRxRate
== 2) {
1457 pDevice
->aulPktNum
[RATE_1M
]++;
1459 else if (byRxRate
==4) {
1460 pDevice
->aulPktNum
[RATE_2M
]++;
1462 else if (byRxRate
==11) {
1463 pDevice
->aulPktNum
[RATE_5M
]++;
1465 else if (byRxRate
==22) {
1466 pDevice
->aulPktNum
[RATE_11M
]++;
1468 else if(byRxRate
==12){
1469 pDevice
->aulPktNum
[RATE_6M
]++;
1470 pDevice
->aulSQ3Val
[RATE_6M
] += bySQ3
;
1472 else if(byRxRate
==18){
1473 pDevice
->aulPktNum
[RATE_9M
]++;
1474 pDevice
->aulSQ3Val
[RATE_9M
] += bySQ3
;
1476 else if(byRxRate
==24){
1477 pDevice
->aulPktNum
[RATE_12M
]++;
1478 pDevice
->aulSQ3Val
[RATE_12M
] += bySQ3
;
1480 else if(byRxRate
==36){
1481 pDevice
->aulPktNum
[RATE_18M
]++;
1482 pDevice
->aulSQ3Val
[RATE_18M
] += bySQ3
;
1484 else if(byRxRate
==48){
1485 pDevice
->aulPktNum
[RATE_24M
]++;
1486 pDevice
->aulSQ3Val
[RATE_24M
] += bySQ3
;
1488 else if(byRxRate
==72){
1489 pDevice
->aulPktNum
[RATE_36M
]++;
1490 pDevice
->aulSQ3Val
[RATE_36M
] += bySQ3
;
1492 else if(byRxRate
==96){
1493 pDevice
->aulPktNum
[RATE_48M
]++;
1494 pDevice
->aulSQ3Val
[RATE_48M
] += bySQ3
;
1496 else if(byRxRate
==108){
1497 pDevice
->aulPktNum
[RATE_54M
]++;
1498 pDevice
->aulSQ3Val
[RATE_54M
] += bySQ3
;
1501 if (pDevice
->byAntennaState
== 0) {
1503 if (pDevice
->uDiversityCnt
> pDevice
->ulDiversityNValue
) {
1504 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"ulDiversityNValue=[%d],54M-[%d]\n",(int)pDevice
->ulDiversityNValue
, (int)pDevice
->aulPktNum
[RATE_54M
]);
1506 pDevice
->ulSQ3_State0
= s_ulGetLowSQ3(pDevice
);
1507 pDevice
->ulRatio_State0
= s_ulGetRatio(pDevice
);
1508 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"SQ3_State0, SQ3= [%08x] rate = [%08x]\n",(int)pDevice
->ulSQ3_State0
,(int)pDevice
->ulRatio_State0
);
1510 if ( ((pDevice
->aulPktNum
[RATE_54M
] < pDevice
->ulDiversityNValue
/2) &&
1511 (pDevice
->ulSQ3_State0
> pDevice
->ulSQ3TH
) ) ||
1512 (pDevice
->ulSQ3_State0
== 0 ) ) {
1514 if ( pDevice
->byTMax
== 0 )
1517 bScheduleCommand((HANDLE
) pDevice
, WLAN_CMD_CHANGE_ANTENNA
, NULL
);
1519 pDevice
->byAntennaState
= 1;
1521 del_timer(&pDevice
->TimerSQ3Tmax3
);
1522 del_timer(&pDevice
->TimerSQ3Tmax2
);
1523 pDevice
->TimerSQ3Tmax1
.expires
= RUN_AT(pDevice
->byTMax
* HZ
);
1524 add_timer(&pDevice
->TimerSQ3Tmax1
);
1527 pDevice
->TimerSQ3Tmax3
.expires
= RUN_AT(pDevice
->byTMax3
* HZ
);
1528 add_timer(&pDevice
->TimerSQ3Tmax3
);
1530 s_vClearSQ3Value(pDevice
);
1533 } else { //byAntennaState == 1
1535 if (pDevice
->uDiversityCnt
> pDevice
->ulDiversityMValue
) {
1537 del_timer(&pDevice
->TimerSQ3Tmax1
);
1538 pDevice
->ulSQ3_State1
= s_ulGetLowSQ3(pDevice
);
1539 pDevice
->ulRatio_State1
= s_ulGetRatio(pDevice
);
1540 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"SQ3_State1, rate0 = %08x,rate1 = %08x\n",(int)pDevice
->ulRatio_State0
,(int)pDevice
->ulRatio_State1
);
1542 if ( ((pDevice
->ulSQ3_State1
== 0) && (pDevice
->ulSQ3_State0
!= 0)) ||
1543 ((pDevice
->ulSQ3_State1
== 0) && (pDevice
->ulSQ3_State0
== 0) && (pDevice
->ulRatio_State1
< pDevice
->ulRatio_State0
)) ||
1544 ((pDevice
->ulSQ3_State1
!= 0) && (pDevice
->ulSQ3_State0
!= 0) && (pDevice
->ulSQ3_State0
< pDevice
->ulSQ3_State1
))
1547 bScheduleCommand((HANDLE
) pDevice
, WLAN_CMD_CHANGE_ANTENNA
, NULL
);
1549 pDevice
->TimerSQ3Tmax3
.expires
= RUN_AT(pDevice
->byTMax3
* HZ
);
1550 pDevice
->TimerSQ3Tmax2
.expires
= RUN_AT(pDevice
->byTMax2
* HZ
);
1551 add_timer(&pDevice
->TimerSQ3Tmax3
);
1552 add_timer(&pDevice
->TimerSQ3Tmax2
);
1555 pDevice
->byAntennaState
= 0;
1556 s_vClearSQ3Value(pDevice
);
1565 * Timer for SQ3 antenna diversity
1570 * hDeviceContext - Pointer to the adapter
1576 * Return Value: none
1582 IN HANDLE hDeviceContext
1585 PSDevice pDevice
= (PSDevice
)hDeviceContext
;
1587 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"TimerSQ3CallBack...");
1588 spin_lock_irq(&pDevice
->lock
);
1590 bScheduleCommand((HANDLE
) pDevice
, WLAN_CMD_CHANGE_ANTENNA
, NULL
);
1591 pDevice
->byAntennaState
= 0;
1592 s_vClearSQ3Value(pDevice
);
1593 pDevice
->TimerSQ3Tmax3
.expires
= RUN_AT(pDevice
->byTMax3
* HZ
);
1594 pDevice
->TimerSQ3Tmax2
.expires
= RUN_AT(pDevice
->byTMax2
* HZ
);
1595 add_timer(&pDevice
->TimerSQ3Tmax3
);
1596 add_timer(&pDevice
->TimerSQ3Tmax2
);
1599 spin_unlock_irq(&pDevice
->lock
);
1607 * Timer for SQ3 antenna diversity
1612 * hDeviceContext - Pointer to the adapter
1618 * Return Value: none
1623 TimerSQ3Tmax3CallBack (
1624 IN HANDLE hDeviceContext
1627 PSDevice pDevice
= (PSDevice
)hDeviceContext
;
1629 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"TimerSQ3Tmax3CallBack...");
1630 spin_lock_irq(&pDevice
->lock
);
1632 pDevice
->ulRatio_State0
= s_ulGetRatio(pDevice
);
1633 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
"SQ3_State0 = [%08x]\n",(int)pDevice
->ulRatio_State0
);
1635 s_vClearSQ3Value(pDevice
);
1636 if ( pDevice
->byTMax
== 0 ) {
1637 pDevice
->TimerSQ3Tmax3
.expires
= RUN_AT(pDevice
->byTMax3
* HZ
);
1638 add_timer(&pDevice
->TimerSQ3Tmax3
);
1639 spin_unlock_irq(&pDevice
->lock
);
1643 bScheduleCommand((HANDLE
) pDevice
, WLAN_CMD_CHANGE_ANTENNA
, NULL
);
1644 pDevice
->byAntennaState
= 1;
1645 del_timer(&pDevice
->TimerSQ3Tmax3
);
1646 del_timer(&pDevice
->TimerSQ3Tmax2
);
1647 pDevice
->TimerSQ3Tmax1
.expires
= RUN_AT(pDevice
->byTMax
* HZ
);
1648 add_timer(&pDevice
->TimerSQ3Tmax1
);
1650 spin_unlock_irq(&pDevice
->lock
);
1655 BBvUpdatePreEDThreshold(
1656 IN PSDevice pDevice
,
1661 switch(pDevice
->byRFType
)
1666 //RobertYu:20060627, update new table
1669 { // need Max sensitivity //RSSI -69, -70,....
1670 if(pDevice
->byBBPreEDIndex
== 0) break;
1671 pDevice
->byBBPreEDIndex
= 0;
1672 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1673 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1674 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -69, -70, -71,...\n");
1678 if(pDevice
->byBBPreEDRSSI
<= 45) { // RSSI 0, -1,-2,....-45
1679 if(pDevice
->byBBPreEDIndex
== 20) break;
1680 pDevice
->byBBPreEDIndex
= 20;
1681 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0xFF); //CR201(0xC9)
1682 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1683 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI 0, -1,-2,..-45\n");
1684 } else if(pDevice
->byBBPreEDRSSI
<= 46) { //RSSI -46
1685 if(pDevice
->byBBPreEDIndex
== 19) break;
1686 pDevice
->byBBPreEDIndex
= 19;
1687 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x1A); //CR201(0xC9)
1688 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1689 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -46\n");
1690 } else if(pDevice
->byBBPreEDRSSI
<= 47) { //RSSI -47
1691 if(pDevice
->byBBPreEDIndex
== 18) break;
1692 pDevice
->byBBPreEDIndex
= 18;
1693 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x15); //CR201(0xC9)
1694 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1695 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -47\n");
1696 } else if(pDevice
->byBBPreEDRSSI
<= 49) { //RSSI -48, -49
1697 if(pDevice
->byBBPreEDIndex
== 17) break;
1698 pDevice
->byBBPreEDIndex
= 17;
1699 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x0E); //CR201(0xC9)
1700 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1701 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -48,-49\n");
1702 } else if(pDevice
->byBBPreEDRSSI
<= 51) { //RSSI -50, -51
1703 if(pDevice
->byBBPreEDIndex
== 16) break;
1704 pDevice
->byBBPreEDIndex
= 16;
1705 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x09); //CR201(0xC9)
1706 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1707 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -50,-51\n");
1708 } else if(pDevice
->byBBPreEDRSSI
<= 53) { //RSSI -52, -53
1709 if(pDevice
->byBBPreEDIndex
== 15) break;
1710 pDevice
->byBBPreEDIndex
= 15;
1711 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x06); //CR201(0xC9)
1712 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1713 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -52,-53\n");
1714 } else if(pDevice
->byBBPreEDRSSI
<= 55) { //RSSI -54, -55
1715 if(pDevice
->byBBPreEDIndex
== 14) break;
1716 pDevice
->byBBPreEDIndex
= 14;
1717 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x03); //CR201(0xC9)
1718 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1719 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -54,-55\n");
1720 } else if(pDevice
->byBBPreEDRSSI
<= 56) { //RSSI -56
1721 if(pDevice
->byBBPreEDIndex
== 13) break;
1722 pDevice
->byBBPreEDIndex
= 13;
1723 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1724 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xA0); //CR206(0xCE)
1725 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -56\n");
1726 } else if(pDevice
->byBBPreEDRSSI
<= 57) { //RSSI -57
1727 if(pDevice
->byBBPreEDIndex
== 12) break;
1728 pDevice
->byBBPreEDIndex
= 12;
1729 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1730 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x20); //CR206(0xCE)
1731 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -57\n");
1732 } else if(pDevice
->byBBPreEDRSSI
<= 58) { //RSSI -58
1733 if(pDevice
->byBBPreEDIndex
== 11) break;
1734 pDevice
->byBBPreEDIndex
= 11;
1735 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1736 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xA0); //CR206(0xCE)
1737 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -58\n");
1738 } else if(pDevice
->byBBPreEDRSSI
<= 59) { //RSSI -59
1739 if(pDevice
->byBBPreEDIndex
== 10) break;
1740 pDevice
->byBBPreEDIndex
= 10;
1741 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1742 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x54); //CR206(0xCE)
1743 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -59\n");
1744 } else if(pDevice
->byBBPreEDRSSI
<= 60) { //RSSI -60
1745 if(pDevice
->byBBPreEDIndex
== 9) break;
1746 pDevice
->byBBPreEDIndex
= 9;
1747 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1748 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x18); //CR206(0xCE)
1749 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -60\n");
1750 } else if(pDevice
->byBBPreEDRSSI
<= 61) { //RSSI -61
1751 if(pDevice
->byBBPreEDIndex
== 8) break;
1752 pDevice
->byBBPreEDIndex
= 8;
1753 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1754 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xE3); //CR206(0xCE)
1755 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -61\n");
1756 } else if(pDevice
->byBBPreEDRSSI
<= 62) { //RSSI -62
1757 if(pDevice
->byBBPreEDIndex
== 7) break;
1758 pDevice
->byBBPreEDIndex
= 7;
1759 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1760 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xB9); //CR206(0xCE)
1761 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -62\n");
1762 } else if(pDevice
->byBBPreEDRSSI
<= 63) { //RSSI -63
1763 if(pDevice
->byBBPreEDIndex
== 6) break;
1764 pDevice
->byBBPreEDIndex
= 6;
1765 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1766 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x93); //CR206(0xCE)
1767 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -63\n");
1768 } else if(pDevice
->byBBPreEDRSSI
<= 64) { //RSSI -64
1769 if(pDevice
->byBBPreEDIndex
== 5) break;
1770 pDevice
->byBBPreEDIndex
= 5;
1771 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1772 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x79); //CR206(0xCE)
1773 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -64\n");
1774 } else if(pDevice
->byBBPreEDRSSI
<= 65) { //RSSI -65
1775 if(pDevice
->byBBPreEDIndex
== 4) break;
1776 pDevice
->byBBPreEDIndex
= 4;
1777 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1778 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x62); //CR206(0xCE)
1779 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -65\n");
1780 } else if(pDevice
->byBBPreEDRSSI
<= 66) { //RSSI -66
1781 if(pDevice
->byBBPreEDIndex
== 3) break;
1782 pDevice
->byBBPreEDIndex
= 3;
1783 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1784 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x51); //CR206(0xCE)
1785 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -66\n");
1786 } else if(pDevice
->byBBPreEDRSSI
<= 67) { //RSSI -67
1787 if(pDevice
->byBBPreEDIndex
== 2) break;
1788 pDevice
->byBBPreEDIndex
= 2;
1789 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1790 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x43); //CR206(0xCE)
1791 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -67\n");
1792 } else if(pDevice
->byBBPreEDRSSI
<= 68) { //RSSI -68
1793 if(pDevice
->byBBPreEDIndex
== 1) break;
1794 pDevice
->byBBPreEDIndex
= 1;
1795 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1796 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x36); //CR206(0xCE)
1797 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -68\n");
1798 } else { //RSSI -69, -70,....
1799 if(pDevice
->byBBPreEDIndex
== 0) break;
1800 pDevice
->byBBPreEDIndex
= 0;
1801 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1802 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1803 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -69, -70,...\n");
1809 //RobertYu:20060627, update new table
1812 { // need Max sensitivity //RSSI -69, -70, ...
1813 if(pDevice
->byBBPreEDIndex
== 0) break;
1814 pDevice
->byBBPreEDIndex
= 0;
1815 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1816 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x24); //CR206(0xCE)
1817 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -69, -70,..\n");
1821 if(pDevice
->byBBPreEDRSSI
<= 41) { // RSSI 0, -1,-2,....-41
1822 if(pDevice
->byBBPreEDIndex
== 22) break;
1823 pDevice
->byBBPreEDIndex
= 22;
1824 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0xFF); //CR201(0xC9)
1825 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1826 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI 0, -1,-2,..-41\n");
1827 } else if(pDevice
->byBBPreEDRSSI
<= 42) { //RSSI -42
1828 if(pDevice
->byBBPreEDIndex
== 21) break;
1829 pDevice
->byBBPreEDIndex
= 21;
1830 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x36); //CR201(0xC9)
1831 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1832 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -42\n");
1833 } else if(pDevice
->byBBPreEDRSSI
<= 43) { //RSSI -43
1834 if(pDevice
->byBBPreEDIndex
== 20) break;
1835 pDevice
->byBBPreEDIndex
= 20;
1836 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x26); //CR201(0xC9)
1837 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1838 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -43\n");
1839 } else if(pDevice
->byBBPreEDRSSI
<= 45) { //RSSI -44, -45
1840 if(pDevice
->byBBPreEDIndex
== 19) break;
1841 pDevice
->byBBPreEDIndex
= 19;
1842 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x18); //CR201(0xC9)
1843 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1844 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -44,-45\n");
1845 } else if(pDevice
->byBBPreEDRSSI
<= 47) { //RSSI -46, -47
1846 if(pDevice
->byBBPreEDIndex
== 18) break;
1847 pDevice
->byBBPreEDIndex
= 18;
1848 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x11); //CR201(0xC9)
1849 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1850 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -46,-47\n");
1851 } else if(pDevice
->byBBPreEDRSSI
<= 49) { //RSSI -48, -49
1852 if(pDevice
->byBBPreEDIndex
== 17) break;
1853 pDevice
->byBBPreEDIndex
= 17;
1854 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x0a); //CR201(0xC9)
1855 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1856 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -48,-49\n");
1857 } else if(pDevice
->byBBPreEDRSSI
<= 51) { //RSSI -50, -51
1858 if(pDevice
->byBBPreEDIndex
== 16) break;
1859 pDevice
->byBBPreEDIndex
= 16;
1860 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x07); //CR201(0xC9)
1861 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1862 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -50,-51\n");
1863 } else if(pDevice
->byBBPreEDRSSI
<= 53) { //RSSI -52, -53
1864 if(pDevice
->byBBPreEDIndex
== 15) break;
1865 pDevice
->byBBPreEDIndex
= 15;
1866 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x04); //CR201(0xC9)
1867 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1868 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -52,-53\n");
1869 } else if(pDevice
->byBBPreEDRSSI
<= 55) { //RSSI -54, -55
1870 if(pDevice
->byBBPreEDIndex
== 14) break;
1871 pDevice
->byBBPreEDIndex
= 14;
1872 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1873 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xC0); //CR206(0xCE)
1874 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -54,-55\n");
1875 } else if(pDevice
->byBBPreEDRSSI
<= 56) { //RSSI -56
1876 if(pDevice
->byBBPreEDIndex
== 13) break;
1877 pDevice
->byBBPreEDIndex
= 13;
1878 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
1879 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1880 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -56\n");
1881 } else if(pDevice
->byBBPreEDRSSI
<= 57) { //RSSI -57
1882 if(pDevice
->byBBPreEDIndex
== 12) break;
1883 pDevice
->byBBPreEDIndex
= 12;
1884 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1885 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xB0); //CR206(0xCE)
1886 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -57\n");
1887 } else if(pDevice
->byBBPreEDRSSI
<= 58) { //RSSI -58
1888 if(pDevice
->byBBPreEDIndex
== 11) break;
1889 pDevice
->byBBPreEDIndex
= 11;
1890 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1891 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x70); //CR206(0xCE)
1892 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -58\n");
1893 } else if(pDevice
->byBBPreEDRSSI
<= 59) { //RSSI -59
1894 if(pDevice
->byBBPreEDIndex
== 10) break;
1895 pDevice
->byBBPreEDIndex
= 10;
1896 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
1897 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
1898 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -59\n");
1899 } else if(pDevice
->byBBPreEDRSSI
<= 60) { //RSSI -60
1900 if(pDevice
->byBBPreEDIndex
== 9) break;
1901 pDevice
->byBBPreEDIndex
= 9;
1902 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1903 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xEA); //CR206(0xCE)
1904 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -60\n");
1905 } else if(pDevice
->byBBPreEDRSSI
<= 61) { //RSSI -61
1906 if(pDevice
->byBBPreEDIndex
== 8) break;
1907 pDevice
->byBBPreEDIndex
= 8;
1908 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1909 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xC0); //CR206(0xCE)
1910 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -61\n");
1911 } else if(pDevice
->byBBPreEDRSSI
<= 62) { //RSSI -62
1912 if(pDevice
->byBBPreEDIndex
== 7) break;
1913 pDevice
->byBBPreEDIndex
= 7;
1914 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1915 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x9C); //CR206(0xCE)
1916 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -62\n");
1917 } else if(pDevice
->byBBPreEDRSSI
<= 63) { //RSSI -63
1918 if(pDevice
->byBBPreEDIndex
== 6) break;
1919 pDevice
->byBBPreEDIndex
= 6;
1920 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1921 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x80); //CR206(0xCE)
1922 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -63\n");
1923 } else if(pDevice
->byBBPreEDRSSI
<= 64) { //RSSI -64
1924 if(pDevice
->byBBPreEDIndex
== 5) break;
1925 pDevice
->byBBPreEDIndex
= 5;
1926 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1927 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x68); //CR206(0xCE)
1928 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -64\n");
1929 } else if(pDevice
->byBBPreEDRSSI
<= 65) { //RSSI -65
1930 if(pDevice
->byBBPreEDIndex
== 4) break;
1931 pDevice
->byBBPreEDIndex
= 4;
1932 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1933 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x52); //CR206(0xCE)
1934 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -65\n");
1935 } else if(pDevice
->byBBPreEDRSSI
<= 66) { //RSSI -66
1936 if(pDevice
->byBBPreEDIndex
== 3) break;
1937 pDevice
->byBBPreEDIndex
= 3;
1938 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1939 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x43); //CR206(0xCE)
1940 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -66\n");
1941 } else if(pDevice
->byBBPreEDRSSI
<= 67) { //RSSI -67
1942 if(pDevice
->byBBPreEDIndex
== 2) break;
1943 pDevice
->byBBPreEDIndex
= 2;
1944 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1945 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x36); //CR206(0xCE)
1946 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -67\n");
1947 } else if(pDevice
->byBBPreEDRSSI
<= 68) { //RSSI -68
1948 if(pDevice
->byBBPreEDIndex
== 1) break;
1949 pDevice
->byBBPreEDIndex
= 1;
1950 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1951 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x2D); //CR206(0xCE)
1952 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -68\n");
1953 } else { //RSSI -69, -70, ...
1954 if(pDevice
->byBBPreEDIndex
== 0) break;
1955 pDevice
->byBBPreEDIndex
= 0;
1956 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1957 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x24); //CR206(0xCE)
1958 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -69, -70,..\n");
1962 case RF_VT3342A0
: //RobertYu:20060627, testing table
1964 { // need Max sensitivity //RSSI -67, -68, ...
1965 if(pDevice
->byBBPreEDIndex
== 0) break;
1966 pDevice
->byBBPreEDIndex
= 0;
1967 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
1968 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x38); //CR206(0xCE)
1969 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -67, -68,..\n");
1973 if(pDevice
->byBBPreEDRSSI
<= 41) { // RSSI 0, -1,-2,....-41
1974 if(pDevice
->byBBPreEDIndex
== 20) break;
1975 pDevice
->byBBPreEDIndex
= 20;
1976 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0xFF); //CR201(0xC9)
1977 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1978 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI 0, -1,-2,..-41\n");
1979 } else if(pDevice
->byBBPreEDRSSI
<= 42) { //RSSI -42
1980 if(pDevice
->byBBPreEDIndex
== 19) break;
1981 pDevice
->byBBPreEDIndex
= 19;
1982 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x36); //CR201(0xC9)
1983 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1984 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -42\n");
1985 } else if(pDevice
->byBBPreEDRSSI
<= 43) { //RSSI -43
1986 if(pDevice
->byBBPreEDIndex
== 18) break;
1987 pDevice
->byBBPreEDIndex
= 18;
1988 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x26); //CR201(0xC9)
1989 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1990 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -43\n");
1991 } else if(pDevice
->byBBPreEDRSSI
<= 45) { //RSSI -44, -45
1992 if(pDevice
->byBBPreEDIndex
== 17) break;
1993 pDevice
->byBBPreEDIndex
= 17;
1994 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x18); //CR201(0xC9)
1995 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
1996 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -44,-45\n");
1997 } else if(pDevice
->byBBPreEDRSSI
<= 47) { //RSSI -46, -47
1998 if(pDevice
->byBBPreEDIndex
== 16) break;
1999 pDevice
->byBBPreEDIndex
= 16;
2000 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x11); //CR201(0xC9)
2001 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
2002 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -46,-47\n");
2003 } else if(pDevice
->byBBPreEDRSSI
<= 49) { //RSSI -48, -49
2004 if(pDevice
->byBBPreEDIndex
== 15) break;
2005 pDevice
->byBBPreEDIndex
= 15;
2006 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x0a); //CR201(0xC9)
2007 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
2008 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -48,-49\n");
2009 } else if(pDevice
->byBBPreEDRSSI
<= 51) { //RSSI -50, -51
2010 if(pDevice
->byBBPreEDIndex
== 14) break;
2011 pDevice
->byBBPreEDIndex
= 14;
2012 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x07); //CR201(0xC9)
2013 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
2014 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -50,-51\n");
2015 } else if(pDevice
->byBBPreEDRSSI
<= 53) { //RSSI -52, -53
2016 if(pDevice
->byBBPreEDIndex
== 13) break;
2017 pDevice
->byBBPreEDIndex
= 13;
2018 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x04); //CR201(0xC9)
2019 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x00); //CR206(0xCE)
2020 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -52,-53\n");
2021 } else if(pDevice
->byBBPreEDRSSI
<= 55) { //RSSI -54, -55
2022 if(pDevice
->byBBPreEDIndex
== 12) break;
2023 pDevice
->byBBPreEDIndex
= 12;
2024 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
2025 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xC0); //CR206(0xCE)
2026 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -54,-55\n");
2027 } else if(pDevice
->byBBPreEDRSSI
<= 56) { //RSSI -56
2028 if(pDevice
->byBBPreEDIndex
== 11) break;
2029 pDevice
->byBBPreEDIndex
= 11;
2030 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x02); //CR201(0xC9)
2031 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
2032 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -56\n");
2033 } else if(pDevice
->byBBPreEDRSSI
<= 57) { //RSSI -57
2034 if(pDevice
->byBBPreEDIndex
== 10) break;
2035 pDevice
->byBBPreEDIndex
= 10;
2036 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
2037 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xB0); //CR206(0xCE)
2038 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -57\n");
2039 } else if(pDevice
->byBBPreEDRSSI
<= 58) { //RSSI -58
2040 if(pDevice
->byBBPreEDIndex
== 9) break;
2041 pDevice
->byBBPreEDIndex
= 9;
2042 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
2043 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x70); //CR206(0xCE)
2044 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -58\n");
2045 } else if(pDevice
->byBBPreEDRSSI
<= 59) { //RSSI -59
2046 if(pDevice
->byBBPreEDIndex
== 8) break;
2047 pDevice
->byBBPreEDIndex
= 8;
2048 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x01); //CR201(0xC9)
2049 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x30); //CR206(0xCE)
2050 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -59\n");
2051 } else if(pDevice
->byBBPreEDRSSI
<= 60) { //RSSI -60
2052 if(pDevice
->byBBPreEDIndex
== 7) break;
2053 pDevice
->byBBPreEDIndex
= 7;
2054 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
2055 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xEA); //CR206(0xCE)
2056 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -60\n");
2057 } else if(pDevice
->byBBPreEDRSSI
<= 61) { //RSSI -61
2058 if(pDevice
->byBBPreEDIndex
== 6) break;
2059 pDevice
->byBBPreEDIndex
= 6;
2060 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
2061 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0xC0); //CR206(0xCE)
2062 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -61\n");
2063 } else if(pDevice
->byBBPreEDRSSI
<= 62) { //RSSI -62
2064 if(pDevice
->byBBPreEDIndex
== 5) break;
2065 pDevice
->byBBPreEDIndex
= 5;
2066 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
2067 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x9C); //CR206(0xCE)
2068 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -62\n");
2069 } else if(pDevice
->byBBPreEDRSSI
<= 63) { //RSSI -63
2070 if(pDevice
->byBBPreEDIndex
== 4) break;
2071 pDevice
->byBBPreEDIndex
= 4;
2072 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
2073 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x80); //CR206(0xCE)
2074 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -63\n");
2075 } else if(pDevice
->byBBPreEDRSSI
<= 64) { //RSSI -64
2076 if(pDevice
->byBBPreEDIndex
== 3) break;
2077 pDevice
->byBBPreEDIndex
= 3;
2078 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
2079 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x68); //CR206(0xCE)
2080 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -64\n");
2081 } else if(pDevice
->byBBPreEDRSSI
<= 65) { //RSSI -65
2082 if(pDevice
->byBBPreEDIndex
== 2) break;
2083 pDevice
->byBBPreEDIndex
= 2;
2084 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
2085 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x52); //CR206(0xCE)
2086 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -65\n");
2087 } else if(pDevice
->byBBPreEDRSSI
<= 66) { //RSSI -66
2088 if(pDevice
->byBBPreEDIndex
== 1) break;
2089 pDevice
->byBBPreEDIndex
= 1;
2090 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
2091 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x43); //CR206(0xCE)
2092 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -66\n");
2093 } else { //RSSI -67, -68, ...
2094 if(pDevice
->byBBPreEDIndex
== 0) break;
2095 pDevice
->byBBPreEDIndex
= 0;
2096 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xC9, 0x00); //CR201(0xC9)
2097 ControlvWriteByte(pDevice
, MESSAGE_REQUEST_BBREG
, 0xCE, 0x38); //CR206(0xCE)
2098 DBG_PRT(MSG_LEVEL_DEBUG
, KERN_INFO
" pDevice->byBBPreEDRSSI -67, -68,..\n");