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 * BBvCalculateParameter - Calculate PhyLength, PhyService and Phy Signal parameter for baseband Tx
31 * BBbVT3184Init - VIA VT3184 baseband chip init code
48 static int msglevel =MSG_LEVEL_INFO;
49 //static int msglevel =MSG_LEVEL_DEBUG;
51 u8 abyVT3184_AGC[] = {
55 0x02, //3 //RobertYu:20060505, 0x04, //3
57 0x04, //5 //RobertYu:20060505, 0x06, //5
118 u8 abyVT3184_AL2230[] = {
128 0x45,//tx //0x64 for FPGA
146 0x8e, //RobertYu:20060522, //0x8d,
147 0x0a, //RobertYu:20060515, //0x09,
166 0x0c, //RobertYu:20060522, //0x10,
199 0x00,//50 //RobertYu:20060505, //0x15,//50
208 0xd0, //RobertYu:20060505, //0xb0,
227 0x00, //0x80 for FPGA
257 0x1f, //RobertYu:20060516, //0x0f,
262 0x00, //RobertYu:20060505, //0x02,
263 0x20,//90 //RobertYu:20060505, //0x22,//90
292 0x15, //RobertYu:20060516, //0x00,
316 0xff, //RobertYu:20060509, //0x2c,
317 0x0e, //RobertYu:20060530, //0x0c,
320 0x00, //RobertYu:20060505, //0x01,
321 0x82, //RobertYu:20060516, //0x8f,
325 0x30, //RobertYu:20060627, //0x0b,
326 0x05, //RobertYu:20060516, //0x25,
344 0xf3, //RobertYu:20060516, //0xd3,
350 0x12, //RobertYu:20060627, //0x10,
358 0x05, //RobertYu:20060516, //0x0c,
377 //{{RobertYu:20060515, new BB setting for VT3226D0
378 u8 abyVT3184_VT3226D0[] = {
388 0x45,//tx //0x64 for FPGA
406 0x8e, //RobertYu:20060525, //0x8d,
407 0x0a, //RobertYu:20060515, //0x09,
426 0x0c, //RobertYu:20060525, //0x10,
459 0x00,//50 //RobertYu:20060505, //0x15,//50
468 0xd0, //RobertYu:20060505, //0xb0,
487 0x00, //0x80 for FPGA
517 0x1f, //RobertYu:20060515, //0x0f,
522 0x00, //RobertYu:20060505, //0x02,
523 0x20,//90 //RobertYu:20060505, //0x22,//90
576 0xff, //RobertYu:20060509, //0x2c,
577 0x10, //RobertYu:20060525, //0x0c,
580 0x00, //RobertYu:20060505, //0x01,
581 0x84, //RobertYu:20060525, //0x8f,
585 0x24, //RobertYu:20060627, //0x18,
586 0x05, //RobertYu:20060515, //0x25,
604 0xf3, //RobertYu:20060515, //0xd3,
610 0x10, //RobertYu:20060627, //0x0e,
618 0x08, //RobertYu:20060515, //0x0c,
637 const u16 awcFrameTime[MAX_RATE] =
638 {10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216};
643 s_ulGetLowSQ3(PSDevice pDevice);
647 s_ulGetRatio(PSDevice pDevice);
651 s_vClearSQ3Value(PSDevice pDevice);
655 * Description: Calculate data frame transmitting time
659 * byPreambleType - Preamble Type
660 * byPktType - PK_TYPE_11A, PK_TYPE_11B, PK_TYPE_11GB, PK_TYPE_11GA
661 * cbFrameLength - Baseband Type
665 * Return Value: FrameTime
672 unsigned int cbFrameLength,
676 unsigned int uFrameTime;
677 unsigned int uPreamble;
679 unsigned int uRateIdx = (unsigned int)wRate;
680 unsigned int uRate = 0;
682 if (uRateIdx > RATE_54M) {
687 uRate = (unsigned int)awcFrameTime[uRateIdx];
689 if (uRateIdx <= 3) { //CCK mode
691 if (byPreambleType == 1) {//Short
696 uFrameTime = (cbFrameLength * 80) / uRate; //?????
697 uTmp = (uFrameTime * uRate) / 80;
698 if (cbFrameLength != uTmp) {
702 return (uPreamble + uFrameTime);
705 uFrameTime = (cbFrameLength * 8 + 22) / uRate; //????????
706 uTmp = ((uFrameTime * uRate) - 22) / 8;
707 if(cbFrameLength != uTmp) {
710 uFrameTime = uFrameTime * 4; //???????
711 if(byPktType != PK_TYPE_11A) {
714 return (20 + uFrameTime); //??????
719 * Description: Calculate Length, Service, and Signal fields of Phy for Tx
723 * pDevice - Device Structure
724 * cbFrameLength - Tx Frame Length
727 * pwPhyLen - pointer to Phy Length field
728 * pbyPhySrv - pointer to Phy Service field
729 * pbyPhySgn - pointer to Phy Signal field
734 void BBvCalculateParameter(struct vnt_private *pDevice, u32 cbFrameLength,
735 u16 wRate, u8 byPacketType, u16 *pwPhyLen, u8 *pbyPhySrv,
742 u8 byPreambleType = pDevice->byPreambleType;
743 int bCCK = pDevice->bCCK;
745 cbBitCount = cbFrameLength * 8;
750 cbUsCount = cbBitCount;
755 cbUsCount = cbBitCount / 2;
756 if (byPreambleType == 1)
758 else // long preamble
765 cbUsCount = (cbBitCount * 10) / 55;
766 cbTmp = (cbUsCount * 55) / 10;
767 if (cbTmp != cbBitCount)
769 if (byPreambleType == 1)
771 else // long preamble
779 cbUsCount = cbBitCount / 11;
780 cbTmp = cbUsCount * 11;
781 if (cbTmp != cbBitCount) {
783 if ((cbBitCount - cbTmp) <= 3)
786 if (byPreambleType == 1)
788 else // long preamble
793 if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ
794 *pbyPhySgn = 0x9B; //1001 1011
797 *pbyPhySgn = 0x8B; //1000 1011
802 if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ
803 *pbyPhySgn = 0x9F; //1001 1111
806 *pbyPhySgn = 0x8F; //1000 1111
811 if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ
812 *pbyPhySgn = 0x9A; //1001 1010
815 *pbyPhySgn = 0x8A; //1000 1010
820 if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ
821 *pbyPhySgn = 0x9E; //1001 1110
824 *pbyPhySgn = 0x8E; //1000 1110
829 if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ
830 *pbyPhySgn = 0x99; //1001 1001
833 *pbyPhySgn = 0x89; //1000 1001
838 if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ
839 *pbyPhySgn = 0x9D; //1001 1101
842 *pbyPhySgn = 0x8D; //1000 1101
847 if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ
848 *pbyPhySgn = 0x98; //1001 1000
851 *pbyPhySgn = 0x88; //1000 1000
856 if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
857 *pbyPhySgn = 0x9C; //1001 1100
860 *pbyPhySgn = 0x8C; //1000 1100
865 if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
866 *pbyPhySgn = 0x9C; //1001 1100
869 *pbyPhySgn = 0x8C; //1000 1100
874 if (byPacketType == PK_TYPE_11B) {
877 *pbyPhySrv = *pbyPhySrv | 0x80;
878 *pwPhyLen = (u16) cbUsCount;
882 *pwPhyLen = (u16)cbFrameLength;
887 * Description: Set Antenna mode
891 * pDevice - Device Structure
892 * byAntennaMode - Antenna Mode
899 void BBvSetAntennaMode(struct vnt_private *pDevice, u8 byAntennaMode)
901 switch (byAntennaMode) {
906 pDevice->byBBRxConf &= 0xFC;
909 pDevice->byBBRxConf &= 0xFE;
910 pDevice->byBBRxConf |= 0x02;
914 CONTROLnsRequestOut(pDevice,
915 MESSAGE_TYPE_SET_ANTMD,
923 * Description: Set Antenna mode
927 * pDevice - Device Structure
928 * byAntennaMode - Antenna Mode
936 int BBbVT3184Init(struct vnt_private *pDevice)
946 ntStatus = CONTROLnsRequestIn(pDevice,
949 MESSAGE_REQUEST_EEPROM,
950 EEP_MAX_CONTEXT_SIZE,
952 if (ntStatus != STATUS_SUCCESS) {
956 // if ((pDevice->abyEEPROM[EEP_OFS_RADIOCTL]&0x06)==0x04)
960 pDevice->byOriginalZonetype = pDevice->abyEEPROM[EEP_OFS_ZONETYPE];
961 if(pDevice->config_file.ZoneType >= 0) { //read zonetype file ok!
962 if ((pDevice->config_file.ZoneType == 0)&&
963 (pDevice->abyEEPROM[EEP_OFS_ZONETYPE] !=0x00)){ //for USA
964 pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0;
965 pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0B;
966 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Init Zone Type :USA\n");
968 else if((pDevice->config_file.ZoneType == 1)&&
969 (pDevice->abyEEPROM[EEP_OFS_ZONETYPE]!=0x01)){ //for Japan
970 pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0x01;
971 pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0D;
972 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Init Zone Type :Japan\n");
974 else if((pDevice->config_file.ZoneType == 2)&&
975 (pDevice->abyEEPROM[EEP_OFS_ZONETYPE]!=0x02)){ //for Europe
976 pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0x02;
977 pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0D;
978 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Init Zone Type :Europe\n");
981 if(pDevice->config_file.ZoneType !=pDevice->abyEEPROM[EEP_OFS_ZONETYPE])
982 printk("zonetype in file[%02x] mismatch with in EEPROM[%02x]\n",pDevice->config_file.ZoneType,pDevice->abyEEPROM[EEP_OFS_ZONETYPE]);
984 printk("Read Zonetype file success,use default zonetype setting[%02x]\n",pDevice->config_file.ZoneType);
988 if ( !pDevice->bZoneRegExist ) {
989 pDevice->byZoneType = pDevice->abyEEPROM[EEP_OFS_ZONETYPE];
991 pDevice->byRFType = pDevice->abyEEPROM[EEP_OFS_RFTYPE];
993 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Zone Type %x\n", pDevice->byZoneType);
994 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"RF Type %d\n", pDevice->byRFType);
996 if ((pDevice->byRFType == RF_AL2230) || (pDevice->byRFType == RF_AL2230S)) {
997 pDevice->byBBRxConf = abyVT3184_AL2230[10];
998 wLength = sizeof(abyVT3184_AL2230);
999 pbyAddr = abyVT3184_AL2230;
1000 pbyAgc = abyVT3184_AGC;
1001 wLengthAgc = sizeof(abyVT3184_AGC);
1003 pDevice->abyBBVGA[0] = 0x1C;
1004 pDevice->abyBBVGA[1] = 0x10;
1005 pDevice->abyBBVGA[2] = 0x0;
1006 pDevice->abyBBVGA[3] = 0x0;
1007 pDevice->ldBmThreshold[0] = -70;
1008 pDevice->ldBmThreshold[1] = -48;
1009 pDevice->ldBmThreshold[2] = 0;
1010 pDevice->ldBmThreshold[3] = 0;
1012 else if (pDevice->byRFType == RF_AIROHA7230) {
1013 pDevice->byBBRxConf = abyVT3184_AL2230[10];
1014 wLength = sizeof(abyVT3184_AL2230);
1015 pbyAddr = abyVT3184_AL2230;
1016 pbyAgc = abyVT3184_AGC;
1017 wLengthAgc = sizeof(abyVT3184_AGC);
1019 // Init ANT B select,TX Config CR09 = 0x61->0x45, 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted)
1020 //pbyAddr[0x09] = 0x41;
1021 // Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted)
1022 //pbyAddr[0x0a] = 0x28;
1023 // Select VC1/VC2, CR215 = 0x02->0x06
1024 pbyAddr[0xd7] = 0x06;
1026 pDevice->abyBBVGA[0] = 0x1C;
1027 pDevice->abyBBVGA[1] = 0x10;
1028 pDevice->abyBBVGA[2] = 0x0;
1029 pDevice->abyBBVGA[3] = 0x0;
1030 pDevice->ldBmThreshold[0] = -70;
1031 pDevice->ldBmThreshold[1] = -48;
1032 pDevice->ldBmThreshold[2] = 0;
1033 pDevice->ldBmThreshold[3] = 0;
1035 else if ( (pDevice->byRFType == RF_VT3226) || (pDevice->byRFType == RF_VT3226D0) ) {
1036 pDevice->byBBRxConf = abyVT3184_VT3226D0[10]; //RobertYu:20060515
1037 wLength = sizeof(abyVT3184_VT3226D0); //RobertYu:20060515
1038 pbyAddr = abyVT3184_VT3226D0; //RobertYu:20060515
1039 pbyAgc = abyVT3184_AGC;
1040 wLengthAgc = sizeof(abyVT3184_AGC);
1042 pDevice->abyBBVGA[0] = 0x20; //RobertYu:20060104, reguest by Jack
1043 pDevice->abyBBVGA[1] = 0x10;
1044 pDevice->abyBBVGA[2] = 0x0;
1045 pDevice->abyBBVGA[3] = 0x0;
1046 pDevice->ldBmThreshold[0] = -70;
1047 pDevice->ldBmThreshold[1] = -48;
1048 pDevice->ldBmThreshold[2] = 0;
1049 pDevice->ldBmThreshold[3] = 0;
1050 // Fix VT3226 DFC system timing issue
1051 MACvRegBitsOn(pDevice, MAC_REG_SOFTPWRCTL2, SOFTPWRCTL_RFLEOPT);
1053 //{{RobertYu:20060609
1054 } else if ( (pDevice->byRFType == RF_VT3342A0) ) {
1055 pDevice->byBBRxConf = abyVT3184_VT3226D0[10];
1056 wLength = sizeof(abyVT3184_VT3226D0);
1057 pbyAddr = abyVT3184_VT3226D0;
1058 pbyAgc = abyVT3184_AGC;
1059 wLengthAgc = sizeof(abyVT3184_AGC);
1061 pDevice->abyBBVGA[0] = 0x20;
1062 pDevice->abyBBVGA[1] = 0x10;
1063 pDevice->abyBBVGA[2] = 0x0;
1064 pDevice->abyBBVGA[3] = 0x0;
1065 pDevice->ldBmThreshold[0] = -70;
1066 pDevice->ldBmThreshold[1] = -48;
1067 pDevice->ldBmThreshold[2] = 0;
1068 pDevice->ldBmThreshold[3] = 0;
1069 // Fix VT3226 DFC system timing issue
1070 MACvRegBitsOn(pDevice, MAC_REG_SOFTPWRCTL2, SOFTPWRCTL_RFLEOPT);
1076 memcpy(abyArray, pbyAddr, wLength);
1077 CONTROLnsRequestOut(pDevice,
1080 MESSAGE_REQUEST_BBREG,
1085 memcpy(abyArray, pbyAgc, wLengthAgc);
1086 CONTROLnsRequestOut(pDevice,
1089 MESSAGE_REQUEST_BBAGC,
1094 if ((pDevice->byRFType == RF_VT3226) || //RobertYu:20051116, 20060111 remove VT3226D0
1095 (pDevice->byRFType == RF_VT3342A0) //RobertYu:20060609
1097 ControlvWriteByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_ITRTMSET,0x23);
1098 MACvRegBitsOn(pDevice,MAC_REG_PAPEDELAY,0x01);
1100 else if (pDevice->byRFType == RF_VT3226D0)
1102 ControlvWriteByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_ITRTMSET,0x11);
1103 MACvRegBitsOn(pDevice,MAC_REG_PAPEDELAY,0x01);
1106 ControlvWriteByte(pDevice,MESSAGE_REQUEST_BBREG,0x04,0x7F);
1107 ControlvWriteByte(pDevice,MESSAGE_REQUEST_BBREG,0x0D,0x01);
1109 RFbRFTableDownload(pDevice);
1111 /* Fix for TX USB resets from vendors driver */
1112 CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_READ, USB_REG4,
1113 MESSAGE_REQUEST_MEM, sizeof(data), &data);
1117 CONTROLnsRequestOut(pDevice, MESSAGE_TYPE_WRITE, USB_REG4,
1118 MESSAGE_REQUEST_MEM, sizeof(data), &data);
1120 return true;//ntStatus;
1124 * Description: Set ShortSlotTime mode
1128 * pDevice - Device Structure
1132 * Return Value: none
1135 void BBvSetShortSlotTime(struct vnt_private *pDevice)
1139 if (pDevice->bShortSlotTime)
1140 pDevice->byBBRxConf &= 0xDF;//1101 1111
1142 pDevice->byBBRxConf |= 0x20;//0010 0000
1144 ControlvReadByte (pDevice, MESSAGE_REQUEST_BBREG, 0xE7, &byBBVGA);
1145 if (byBBVGA == pDevice->abyBBVGA[0])
1146 pDevice->byBBRxConf |= 0x20;//0010 0000
1148 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0A, pDevice->byBBRxConf);
1151 void BBvSetVGAGainOffset(struct vnt_private *pDevice, u8 byData)
1154 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xE7, byData);
1156 // patch for 3253B0 Baseband with Cardbus module
1157 if (pDevice->bShortSlotTime)
1158 pDevice->byBBRxConf &= 0xDF; /* 1101 1111 */
1160 pDevice->byBBRxConf |= 0x20; /* 0010 0000 */
1162 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0A, pDevice->byBBRxConf);//CR10
1166 * Description: BBvSetDeepSleep
1170 * pDevice - Device Structure
1174 * Return Value: none
1177 void BBvSetDeepSleep(struct vnt_private *pDevice)
1179 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0c, 0x17);//CR12
1180 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0D, 0xB9);//CR13
1183 void BBvExitDeepSleep(struct vnt_private *pDevice)
1185 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0C, 0x00);//CR12
1186 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0x0D, 0x01);//CR13
1189 static unsigned long s_ulGetLowSQ3(struct vnt_private *pDevice)
1192 unsigned long ulSQ3 = 0;
1193 unsigned long ulMaxPacket;
1195 ulMaxPacket = pDevice->aulPktNum[RATE_54M];
1196 if (pDevice->aulPktNum[RATE_54M] != 0)
1197 ulSQ3 = pDevice->aulSQ3Val[RATE_54M] / pDevice->aulPktNum[RATE_54M];
1199 for (ii = RATE_48M; ii >= RATE_6M; ii--)
1200 if (pDevice->aulPktNum[ii] > ulMaxPacket) {
1201 ulMaxPacket = pDevice->aulPktNum[ii];
1202 ulSQ3 = pDevice->aulSQ3Val[ii] / pDevice->aulPktNum[ii];
1208 static unsigned long s_ulGetRatio(struct vnt_private *pDevice)
1211 unsigned long ulRatio = 0;
1212 unsigned long ulMaxPacket;
1213 unsigned long ulPacketNum;
1215 //This is a thousand-ratio
1216 ulMaxPacket = pDevice->aulPktNum[RATE_54M];
1217 if ( pDevice->aulPktNum[RATE_54M] != 0 ) {
1218 ulPacketNum = pDevice->aulPktNum[RATE_54M];
1219 ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt);
1220 ulRatio += TOP_RATE_54M;
1222 for (ii = RATE_48M; ii >= RATE_1M; ii--)
1223 if ( pDevice->aulPktNum[ii] > ulMaxPacket ) {
1225 for ( jj=RATE_54M;jj>=ii;jj--)
1226 ulPacketNum += pDevice->aulPktNum[jj];
1227 ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt);
1228 ulRatio += TOP_RATE_48M;
1229 ulMaxPacket = pDevice->aulPktNum[ii];
1235 static void s_vClearSQ3Value(struct vnt_private *pDevice)
1238 pDevice->uDiversityCnt = 0;
1240 for ( ii=RATE_1M;ii<MAX_RATE;ii++) {
1241 pDevice->aulPktNum[ii] = 0;
1242 pDevice->aulSQ3Val[ii] = 0;
1247 * Description: Antenna Diversity
1251 * pDevice - Device Structure
1252 * byRSR - RSR from received packet
1253 * bySQ3 - SQ3 value from received packet
1257 * Return Value: none
1261 void BBvAntennaDiversity(struct vnt_private *pDevice,
1262 u8 byRxRate, u8 bySQ3)
1265 pDevice->uDiversityCnt++;
1266 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pDevice->uDiversityCnt = %d\n", (int)pDevice->uDiversityCnt);
1268 if (byRxRate == 2) {
1269 pDevice->aulPktNum[RATE_1M]++;
1271 else if (byRxRate==4) {
1272 pDevice->aulPktNum[RATE_2M]++;
1274 else if (byRxRate==11) {
1275 pDevice->aulPktNum[RATE_5M]++;
1277 else if (byRxRate==22) {
1278 pDevice->aulPktNum[RATE_11M]++;
1280 else if(byRxRate==12){
1281 pDevice->aulPktNum[RATE_6M]++;
1282 pDevice->aulSQ3Val[RATE_6M] += bySQ3;
1284 else if(byRxRate==18){
1285 pDevice->aulPktNum[RATE_9M]++;
1286 pDevice->aulSQ3Val[RATE_9M] += bySQ3;
1288 else if(byRxRate==24){
1289 pDevice->aulPktNum[RATE_12M]++;
1290 pDevice->aulSQ3Val[RATE_12M] += bySQ3;
1292 else if(byRxRate==36){
1293 pDevice->aulPktNum[RATE_18M]++;
1294 pDevice->aulSQ3Val[RATE_18M] += bySQ3;
1296 else if(byRxRate==48){
1297 pDevice->aulPktNum[RATE_24M]++;
1298 pDevice->aulSQ3Val[RATE_24M] += bySQ3;
1300 else if(byRxRate==72){
1301 pDevice->aulPktNum[RATE_36M]++;
1302 pDevice->aulSQ3Val[RATE_36M] += bySQ3;
1304 else if(byRxRate==96){
1305 pDevice->aulPktNum[RATE_48M]++;
1306 pDevice->aulSQ3Val[RATE_48M] += bySQ3;
1308 else if(byRxRate==108){
1309 pDevice->aulPktNum[RATE_54M]++;
1310 pDevice->aulSQ3Val[RATE_54M] += bySQ3;
1313 if (pDevice->byAntennaState == 0) {
1315 if (pDevice->uDiversityCnt > pDevice->ulDiversityNValue) {
1316 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ulDiversityNValue=[%d],54M-[%d]\n",(int)pDevice->ulDiversityNValue, (int)pDevice->aulPktNum[RATE_54M]);
1318 pDevice->ulSQ3_State0 = s_ulGetLowSQ3(pDevice);
1319 pDevice->ulRatio_State0 = s_ulGetRatio(pDevice);
1320 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"SQ3_State0, SQ3= [%08x] rate = [%08x]\n",(int)pDevice->ulSQ3_State0,(int)pDevice->ulRatio_State0);
1322 if ( ((pDevice->aulPktNum[RATE_54M] < pDevice->ulDiversityNValue/2) &&
1323 (pDevice->ulSQ3_State0 > pDevice->ulSQ3TH) ) ||
1324 (pDevice->ulSQ3_State0 == 0 ) ) {
1326 if ( pDevice->byTMax == 0 )
1329 bScheduleCommand((void *) pDevice,
1330 WLAN_CMD_CHANGE_ANTENNA,
1333 pDevice->byAntennaState = 1;
1335 del_timer(&pDevice->TimerSQ3Tmax3);
1336 del_timer(&pDevice->TimerSQ3Tmax2);
1337 pDevice->TimerSQ3Tmax1.expires = RUN_AT(pDevice->byTMax * HZ);
1338 add_timer(&pDevice->TimerSQ3Tmax1);
1341 pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ);
1342 add_timer(&pDevice->TimerSQ3Tmax3);
1344 s_vClearSQ3Value(pDevice);
1347 } else { //byAntennaState == 1
1349 if (pDevice->uDiversityCnt > pDevice->ulDiversityMValue) {
1351 del_timer(&pDevice->TimerSQ3Tmax1);
1352 pDevice->ulSQ3_State1 = s_ulGetLowSQ3(pDevice);
1353 pDevice->ulRatio_State1 = s_ulGetRatio(pDevice);
1354 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"SQ3_State1, rate0 = %08x,rate1 = %08x\n",(int)pDevice->ulRatio_State0,(int)pDevice->ulRatio_State1);
1356 if ( ((pDevice->ulSQ3_State1 == 0) && (pDevice->ulSQ3_State0 != 0)) ||
1357 ((pDevice->ulSQ3_State1 == 0) && (pDevice->ulSQ3_State0 == 0) && (pDevice->ulRatio_State1 < pDevice->ulRatio_State0)) ||
1358 ((pDevice->ulSQ3_State1 != 0) && (pDevice->ulSQ3_State0 != 0) && (pDevice->ulSQ3_State0 < pDevice->ulSQ3_State1))
1361 bScheduleCommand((void *) pDevice,
1362 WLAN_CMD_CHANGE_ANTENNA,
1365 pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ);
1366 pDevice->TimerSQ3Tmax2.expires = RUN_AT(pDevice->byTMax2 * HZ);
1367 add_timer(&pDevice->TimerSQ3Tmax3);
1368 add_timer(&pDevice->TimerSQ3Tmax2);
1371 pDevice->byAntennaState = 0;
1372 s_vClearSQ3Value(pDevice);
1380 * Timer for SQ3 antenna diversity
1385 * hDeviceContext - Pointer to the adapter
1391 * Return Value: none
1395 void TimerSQ3CallBack(struct vnt_private *pDevice)
1398 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"TimerSQ3CallBack...");
1399 spin_lock_irq(&pDevice->lock);
1401 bScheduleCommand((void *) pDevice, WLAN_CMD_CHANGE_ANTENNA, NULL);
1402 pDevice->byAntennaState = 0;
1403 s_vClearSQ3Value(pDevice);
1404 pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ);
1405 pDevice->TimerSQ3Tmax2.expires = RUN_AT(pDevice->byTMax2 * HZ);
1406 add_timer(&pDevice->TimerSQ3Tmax3);
1407 add_timer(&pDevice->TimerSQ3Tmax2);
1409 spin_unlock_irq(&pDevice->lock);
1415 * Timer for SQ3 antenna diversity
1420 * hDeviceContext - Pointer to the adapter
1426 * Return Value: none
1430 void TimerSQ3Tmax3CallBack(struct vnt_private *pDevice)
1433 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"TimerSQ3Tmax3CallBack...");
1434 spin_lock_irq(&pDevice->lock);
1436 pDevice->ulRatio_State0 = s_ulGetRatio(pDevice);
1437 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"SQ3_State0 = [%08x]\n",(int)pDevice->ulRatio_State0);
1439 s_vClearSQ3Value(pDevice);
1440 if ( pDevice->byTMax == 0 ) {
1441 pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ);
1442 add_timer(&pDevice->TimerSQ3Tmax3);
1443 spin_unlock_irq(&pDevice->lock);
1447 bScheduleCommand((void *) pDevice, WLAN_CMD_CHANGE_ANTENNA, NULL);
1448 pDevice->byAntennaState = 1;
1449 del_timer(&pDevice->TimerSQ3Tmax3);
1450 del_timer(&pDevice->TimerSQ3Tmax2);
1451 pDevice->TimerSQ3Tmax1.expires = RUN_AT(pDevice->byTMax * HZ);
1452 add_timer(&pDevice->TimerSQ3Tmax1);
1454 spin_unlock_irq(&pDevice->lock);
1457 void BBvUpdatePreEDThreshold(struct vnt_private *pDevice, int bScanning)
1460 switch(pDevice->byRFType)
1465 //RobertYu:20060627, update new table
1468 { // need Max sensitivity //RSSI -69, -70,....
1469 pDevice->byBBPreEDIndex = 0;
1470 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1471 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x30); //CR206(0xCE)
1472 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -69, -70, -71,...\n");
1476 if(pDevice->byBBPreEDRSSI <= 45) { // RSSI 0, -1,-2,....-45
1477 if(pDevice->byBBPreEDIndex == 20) break;
1478 pDevice->byBBPreEDIndex = 20;
1479 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0xFF); //CR201(0xC9)
1480 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1481 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI 0, -1,-2,..-45\n");
1482 } else if(pDevice->byBBPreEDRSSI <= 46) { //RSSI -46
1483 if(pDevice->byBBPreEDIndex == 19) break;
1484 pDevice->byBBPreEDIndex = 19;
1485 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x1A); //CR201(0xC9)
1486 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1487 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -46\n");
1488 } else if(pDevice->byBBPreEDRSSI <= 47) { //RSSI -47
1489 if(pDevice->byBBPreEDIndex == 18) break;
1490 pDevice->byBBPreEDIndex = 18;
1491 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x15); //CR201(0xC9)
1492 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1493 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -47\n");
1494 } else if(pDevice->byBBPreEDRSSI <= 49) { //RSSI -48, -49
1495 if(pDevice->byBBPreEDIndex == 17) break;
1496 pDevice->byBBPreEDIndex = 17;
1497 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x0E); //CR201(0xC9)
1498 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1499 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -48,-49\n");
1500 } else if(pDevice->byBBPreEDRSSI <= 51) { //RSSI -50, -51
1501 if(pDevice->byBBPreEDIndex == 16) break;
1502 pDevice->byBBPreEDIndex = 16;
1503 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x09); //CR201(0xC9)
1504 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1505 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -50,-51\n");
1506 } else if(pDevice->byBBPreEDRSSI <= 53) { //RSSI -52, -53
1507 if(pDevice->byBBPreEDIndex == 15) break;
1508 pDevice->byBBPreEDIndex = 15;
1509 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x06); //CR201(0xC9)
1510 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1511 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -52,-53\n");
1512 } else if(pDevice->byBBPreEDRSSI <= 55) { //RSSI -54, -55
1513 if(pDevice->byBBPreEDIndex == 14) break;
1514 pDevice->byBBPreEDIndex = 14;
1515 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x03); //CR201(0xC9)
1516 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1517 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -54,-55\n");
1518 } else if(pDevice->byBBPreEDRSSI <= 56) { //RSSI -56
1519 if(pDevice->byBBPreEDIndex == 13) break;
1520 pDevice->byBBPreEDIndex = 13;
1521 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x02); //CR201(0xC9)
1522 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xA0); //CR206(0xCE)
1523 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -56\n");
1524 } else if(pDevice->byBBPreEDRSSI <= 57) { //RSSI -57
1525 if(pDevice->byBBPreEDIndex == 12) break;
1526 pDevice->byBBPreEDIndex = 12;
1527 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x02); //CR201(0xC9)
1528 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x20); //CR206(0xCE)
1529 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -57\n");
1530 } else if(pDevice->byBBPreEDRSSI <= 58) { //RSSI -58
1531 if(pDevice->byBBPreEDIndex == 11) break;
1532 pDevice->byBBPreEDIndex = 11;
1533 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
1534 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xA0); //CR206(0xCE)
1535 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -58\n");
1536 } else if(pDevice->byBBPreEDRSSI <= 59) { //RSSI -59
1537 if(pDevice->byBBPreEDIndex == 10) break;
1538 pDevice->byBBPreEDIndex = 10;
1539 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
1540 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x54); //CR206(0xCE)
1541 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -59\n");
1542 } else if(pDevice->byBBPreEDRSSI <= 60) { //RSSI -60
1543 if(pDevice->byBBPreEDIndex == 9) break;
1544 pDevice->byBBPreEDIndex = 9;
1545 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
1546 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x18); //CR206(0xCE)
1547 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -60\n");
1548 } else if(pDevice->byBBPreEDRSSI <= 61) { //RSSI -61
1549 if(pDevice->byBBPreEDIndex == 8) break;
1550 pDevice->byBBPreEDIndex = 8;
1551 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1552 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xE3); //CR206(0xCE)
1553 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -61\n");
1554 } else if(pDevice->byBBPreEDRSSI <= 62) { //RSSI -62
1555 if(pDevice->byBBPreEDIndex == 7) break;
1556 pDevice->byBBPreEDIndex = 7;
1557 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1558 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xB9); //CR206(0xCE)
1559 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -62\n");
1560 } else if(pDevice->byBBPreEDRSSI <= 63) { //RSSI -63
1561 if(pDevice->byBBPreEDIndex == 6) break;
1562 pDevice->byBBPreEDIndex = 6;
1563 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1564 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x93); //CR206(0xCE)
1565 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -63\n");
1566 } else if(pDevice->byBBPreEDRSSI <= 64) { //RSSI -64
1567 if(pDevice->byBBPreEDIndex == 5) break;
1568 pDevice->byBBPreEDIndex = 5;
1569 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1570 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x79); //CR206(0xCE)
1571 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -64\n");
1572 } else if(pDevice->byBBPreEDRSSI <= 65) { //RSSI -65
1573 if(pDevice->byBBPreEDIndex == 4) break;
1574 pDevice->byBBPreEDIndex = 4;
1575 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1576 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x62); //CR206(0xCE)
1577 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -65\n");
1578 } else if(pDevice->byBBPreEDRSSI <= 66) { //RSSI -66
1579 if(pDevice->byBBPreEDIndex == 3) break;
1580 pDevice->byBBPreEDIndex = 3;
1581 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1582 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x51); //CR206(0xCE)
1583 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -66\n");
1584 } else if(pDevice->byBBPreEDRSSI <= 67) { //RSSI -67
1585 if(pDevice->byBBPreEDIndex == 2) break;
1586 pDevice->byBBPreEDIndex = 2;
1587 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1588 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x43); //CR206(0xCE)
1589 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -67\n");
1590 } else if(pDevice->byBBPreEDRSSI <= 68) { //RSSI -68
1591 if(pDevice->byBBPreEDIndex == 1) break;
1592 pDevice->byBBPreEDIndex = 1;
1593 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1594 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x36); //CR206(0xCE)
1595 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -68\n");
1596 } else { //RSSI -69, -70,....
1597 if(pDevice->byBBPreEDIndex == 0) break;
1598 pDevice->byBBPreEDIndex = 0;
1599 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1600 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x30); //CR206(0xCE)
1601 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -69, -70,...\n");
1607 //RobertYu:20060627, update new table
1610 { // need Max sensitivity //RSSI -69, -70, ...
1611 pDevice->byBBPreEDIndex = 0;
1612 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1613 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x24); //CR206(0xCE)
1614 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -69, -70,..\n");
1618 if(pDevice->byBBPreEDRSSI <= 41) { // RSSI 0, -1,-2,....-41
1619 if(pDevice->byBBPreEDIndex == 22) break;
1620 pDevice->byBBPreEDIndex = 22;
1621 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0xFF); //CR201(0xC9)
1622 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1623 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI 0, -1,-2,..-41\n");
1624 } else if(pDevice->byBBPreEDRSSI <= 42) { //RSSI -42
1625 if(pDevice->byBBPreEDIndex == 21) break;
1626 pDevice->byBBPreEDIndex = 21;
1627 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x36); //CR201(0xC9)
1628 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1629 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -42\n");
1630 } else if(pDevice->byBBPreEDRSSI <= 43) { //RSSI -43
1631 if(pDevice->byBBPreEDIndex == 20) break;
1632 pDevice->byBBPreEDIndex = 20;
1633 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x26); //CR201(0xC9)
1634 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1635 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -43\n");
1636 } else if(pDevice->byBBPreEDRSSI <= 45) { //RSSI -44, -45
1637 if(pDevice->byBBPreEDIndex == 19) break;
1638 pDevice->byBBPreEDIndex = 19;
1639 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x18); //CR201(0xC9)
1640 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1641 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -44,-45\n");
1642 } else if(pDevice->byBBPreEDRSSI <= 47) { //RSSI -46, -47
1643 if(pDevice->byBBPreEDIndex == 18) break;
1644 pDevice->byBBPreEDIndex = 18;
1645 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x11); //CR201(0xC9)
1646 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1647 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -46,-47\n");
1648 } else if(pDevice->byBBPreEDRSSI <= 49) { //RSSI -48, -49
1649 if(pDevice->byBBPreEDIndex == 17) break;
1650 pDevice->byBBPreEDIndex = 17;
1651 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x0a); //CR201(0xC9)
1652 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1653 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -48,-49\n");
1654 } else if(pDevice->byBBPreEDRSSI <= 51) { //RSSI -50, -51
1655 if(pDevice->byBBPreEDIndex == 16) break;
1656 pDevice->byBBPreEDIndex = 16;
1657 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x07); //CR201(0xC9)
1658 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1659 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -50,-51\n");
1660 } else if(pDevice->byBBPreEDRSSI <= 53) { //RSSI -52, -53
1661 if(pDevice->byBBPreEDIndex == 15) break;
1662 pDevice->byBBPreEDIndex = 15;
1663 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x04); //CR201(0xC9)
1664 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1665 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -52,-53\n");
1666 } else if(pDevice->byBBPreEDRSSI <= 55) { //RSSI -54, -55
1667 if(pDevice->byBBPreEDIndex == 14) break;
1668 pDevice->byBBPreEDIndex = 14;
1669 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x02); //CR201(0xC9)
1670 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xC0); //CR206(0xCE)
1671 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -54,-55\n");
1672 } else if(pDevice->byBBPreEDRSSI <= 56) { //RSSI -56
1673 if(pDevice->byBBPreEDIndex == 13) break;
1674 pDevice->byBBPreEDIndex = 13;
1675 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x02); //CR201(0xC9)
1676 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x30); //CR206(0xCE)
1677 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -56\n");
1678 } else if(pDevice->byBBPreEDRSSI <= 57) { //RSSI -57
1679 if(pDevice->byBBPreEDIndex == 12) break;
1680 pDevice->byBBPreEDIndex = 12;
1681 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
1682 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xB0); //CR206(0xCE)
1683 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -57\n");
1684 } else if(pDevice->byBBPreEDRSSI <= 58) { //RSSI -58
1685 if(pDevice->byBBPreEDIndex == 11) break;
1686 pDevice->byBBPreEDIndex = 11;
1687 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
1688 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x70); //CR206(0xCE)
1689 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -58\n");
1690 } else if(pDevice->byBBPreEDRSSI <= 59) { //RSSI -59
1691 if(pDevice->byBBPreEDIndex == 10) break;
1692 pDevice->byBBPreEDIndex = 10;
1693 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
1694 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x30); //CR206(0xCE)
1695 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -59\n");
1696 } else if(pDevice->byBBPreEDRSSI <= 60) { //RSSI -60
1697 if(pDevice->byBBPreEDIndex == 9) break;
1698 pDevice->byBBPreEDIndex = 9;
1699 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1700 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xEA); //CR206(0xCE)
1701 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -60\n");
1702 } else if(pDevice->byBBPreEDRSSI <= 61) { //RSSI -61
1703 if(pDevice->byBBPreEDIndex == 8) break;
1704 pDevice->byBBPreEDIndex = 8;
1705 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1706 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xC0); //CR206(0xCE)
1707 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -61\n");
1708 } else if(pDevice->byBBPreEDRSSI <= 62) { //RSSI -62
1709 if(pDevice->byBBPreEDIndex == 7) break;
1710 pDevice->byBBPreEDIndex = 7;
1711 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1712 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x9C); //CR206(0xCE)
1713 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -62\n");
1714 } else if(pDevice->byBBPreEDRSSI <= 63) { //RSSI -63
1715 if(pDevice->byBBPreEDIndex == 6) break;
1716 pDevice->byBBPreEDIndex = 6;
1717 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1718 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x80); //CR206(0xCE)
1719 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -63\n");
1720 } else if(pDevice->byBBPreEDRSSI <= 64) { //RSSI -64
1721 if(pDevice->byBBPreEDIndex == 5) break;
1722 pDevice->byBBPreEDIndex = 5;
1723 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1724 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x68); //CR206(0xCE)
1725 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -64\n");
1726 } else if(pDevice->byBBPreEDRSSI <= 65) { //RSSI -65
1727 if(pDevice->byBBPreEDIndex == 4) break;
1728 pDevice->byBBPreEDIndex = 4;
1729 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1730 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x52); //CR206(0xCE)
1731 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -65\n");
1732 } else if(pDevice->byBBPreEDRSSI <= 66) { //RSSI -66
1733 if(pDevice->byBBPreEDIndex == 3) break;
1734 pDevice->byBBPreEDIndex = 3;
1735 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1736 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x43); //CR206(0xCE)
1737 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -66\n");
1738 } else if(pDevice->byBBPreEDRSSI <= 67) { //RSSI -67
1739 if(pDevice->byBBPreEDIndex == 2) break;
1740 pDevice->byBBPreEDIndex = 2;
1741 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1742 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x36); //CR206(0xCE)
1743 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -67\n");
1744 } else if(pDevice->byBBPreEDRSSI <= 68) { //RSSI -68
1745 if(pDevice->byBBPreEDIndex == 1) break;
1746 pDevice->byBBPreEDIndex = 1;
1747 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1748 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x2D); //CR206(0xCE)
1749 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -68\n");
1750 } else { //RSSI -69, -70, ...
1751 if(pDevice->byBBPreEDIndex == 0) break;
1752 pDevice->byBBPreEDIndex = 0;
1753 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1754 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x24); //CR206(0xCE)
1755 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -69, -70,..\n");
1759 case RF_VT3342A0: //RobertYu:20060627, testing table
1761 { // need Max sensitivity //RSSI -67, -68, ...
1762 pDevice->byBBPreEDIndex = 0;
1763 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1764 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x38); //CR206(0xCE)
1765 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -67, -68,..\n");
1769 if(pDevice->byBBPreEDRSSI <= 41) { // RSSI 0, -1,-2,....-41
1770 if(pDevice->byBBPreEDIndex == 20) break;
1771 pDevice->byBBPreEDIndex = 20;
1772 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0xFF); //CR201(0xC9)
1773 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1774 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI 0, -1,-2,..-41\n");
1775 } else if(pDevice->byBBPreEDRSSI <= 42) { //RSSI -42
1776 if(pDevice->byBBPreEDIndex == 19) break;
1777 pDevice->byBBPreEDIndex = 19;
1778 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x36); //CR201(0xC9)
1779 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1780 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -42\n");
1781 } else if(pDevice->byBBPreEDRSSI <= 43) { //RSSI -43
1782 if(pDevice->byBBPreEDIndex == 18) break;
1783 pDevice->byBBPreEDIndex = 18;
1784 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x26); //CR201(0xC9)
1785 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1786 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -43\n");
1787 } else if(pDevice->byBBPreEDRSSI <= 45) { //RSSI -44, -45
1788 if(pDevice->byBBPreEDIndex == 17) break;
1789 pDevice->byBBPreEDIndex = 17;
1790 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x18); //CR201(0xC9)
1791 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1792 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -44,-45\n");
1793 } else if(pDevice->byBBPreEDRSSI <= 47) { //RSSI -46, -47
1794 if(pDevice->byBBPreEDIndex == 16) break;
1795 pDevice->byBBPreEDIndex = 16;
1796 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x11); //CR201(0xC9)
1797 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1798 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -46,-47\n");
1799 } else if(pDevice->byBBPreEDRSSI <= 49) { //RSSI -48, -49
1800 if(pDevice->byBBPreEDIndex == 15) break;
1801 pDevice->byBBPreEDIndex = 15;
1802 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x0a); //CR201(0xC9)
1803 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1804 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -48,-49\n");
1805 } else if(pDevice->byBBPreEDRSSI <= 51) { //RSSI -50, -51
1806 if(pDevice->byBBPreEDIndex == 14) break;
1807 pDevice->byBBPreEDIndex = 14;
1808 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x07); //CR201(0xC9)
1809 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1810 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -50,-51\n");
1811 } else if(pDevice->byBBPreEDRSSI <= 53) { //RSSI -52, -53
1812 if(pDevice->byBBPreEDIndex == 13) break;
1813 pDevice->byBBPreEDIndex = 13;
1814 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x04); //CR201(0xC9)
1815 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x00); //CR206(0xCE)
1816 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -52,-53\n");
1817 } else if(pDevice->byBBPreEDRSSI <= 55) { //RSSI -54, -55
1818 if(pDevice->byBBPreEDIndex == 12) break;
1819 pDevice->byBBPreEDIndex = 12;
1820 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x02); //CR201(0xC9)
1821 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xC0); //CR206(0xCE)
1822 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -54,-55\n");
1823 } else if(pDevice->byBBPreEDRSSI <= 56) { //RSSI -56
1824 if(pDevice->byBBPreEDIndex == 11) break;
1825 pDevice->byBBPreEDIndex = 11;
1826 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x02); //CR201(0xC9)
1827 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x30); //CR206(0xCE)
1828 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -56\n");
1829 } else if(pDevice->byBBPreEDRSSI <= 57) { //RSSI -57
1830 if(pDevice->byBBPreEDIndex == 10) break;
1831 pDevice->byBBPreEDIndex = 10;
1832 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
1833 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xB0); //CR206(0xCE)
1834 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -57\n");
1835 } else if(pDevice->byBBPreEDRSSI <= 58) { //RSSI -58
1836 if(pDevice->byBBPreEDIndex == 9) break;
1837 pDevice->byBBPreEDIndex = 9;
1838 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
1839 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x70); //CR206(0xCE)
1840 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -58\n");
1841 } else if(pDevice->byBBPreEDRSSI <= 59) { //RSSI -59
1842 if(pDevice->byBBPreEDIndex == 8) break;
1843 pDevice->byBBPreEDIndex = 8;
1844 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x01); //CR201(0xC9)
1845 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x30); //CR206(0xCE)
1846 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -59\n");
1847 } else if(pDevice->byBBPreEDRSSI <= 60) { //RSSI -60
1848 if(pDevice->byBBPreEDIndex == 7) break;
1849 pDevice->byBBPreEDIndex = 7;
1850 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1851 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xEA); //CR206(0xCE)
1852 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -60\n");
1853 } else if(pDevice->byBBPreEDRSSI <= 61) { //RSSI -61
1854 if(pDevice->byBBPreEDIndex == 6) break;
1855 pDevice->byBBPreEDIndex = 6;
1856 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1857 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0xC0); //CR206(0xCE)
1858 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -61\n");
1859 } else if(pDevice->byBBPreEDRSSI <= 62) { //RSSI -62
1860 if(pDevice->byBBPreEDIndex == 5) break;
1861 pDevice->byBBPreEDIndex = 5;
1862 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1863 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x9C); //CR206(0xCE)
1864 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -62\n");
1865 } else if(pDevice->byBBPreEDRSSI <= 63) { //RSSI -63
1866 if(pDevice->byBBPreEDIndex == 4) break;
1867 pDevice->byBBPreEDIndex = 4;
1868 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1869 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x80); //CR206(0xCE)
1870 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -63\n");
1871 } else if(pDevice->byBBPreEDRSSI <= 64) { //RSSI -64
1872 if(pDevice->byBBPreEDIndex == 3) break;
1873 pDevice->byBBPreEDIndex = 3;
1874 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1875 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x68); //CR206(0xCE)
1876 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -64\n");
1877 } else if(pDevice->byBBPreEDRSSI <= 65) { //RSSI -65
1878 if(pDevice->byBBPreEDIndex == 2) break;
1879 pDevice->byBBPreEDIndex = 2;
1880 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1881 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x52); //CR206(0xCE)
1882 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -65\n");
1883 } else if(pDevice->byBBPreEDRSSI <= 66) { //RSSI -66
1884 if(pDevice->byBBPreEDIndex == 1) break;
1885 pDevice->byBBPreEDIndex = 1;
1886 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1887 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x43); //CR206(0xCE)
1888 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -66\n");
1889 } else { //RSSI -67, -68, ...
1890 if(pDevice->byBBPreEDIndex == 0) break;
1891 pDevice->byBBPreEDIndex = 0;
1892 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); //CR201(0xC9)
1893 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x38); //CR206(0xCE)
1894 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->byBBPreEDRSSI -67, -68,..\n");