VOID odm_RxPhyStatus92CSeries_Parsing( IN OUT PDM_ODM_T pDM_Odm, OUT PODM_PHY_INFO_T pPhyInfo, IN pu1Byte pPhyStatus, IN PODM_PACKET_INFO_T pPktinfo ) { SWAT_T *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; u1Byte i, Max_spatial_stream; s1Byte rx_pwr[4], rx_pwr_all=0; u1Byte EVM, PWDB_ALL = 0, PWDB_ALL_BT; u1Byte RSSI, total_rssi=0; u1Byte isCCKrate=0; u1Byte rf_rx_num = 0; u1Byte cck_highpwr = 0; u1Byte LNA_idx, VGA_idx; PPHY_STATUS_RPT_8192CD_T pPhyStaRpt = (PPHY_STATUS_RPT_8192CD_T)pPhyStatus; isCCKrate = ((pPktinfo->Rate >= DESC92C_RATE1M ) && (pPktinfo->Rate <= DESC92C_RATE11M ))?TRUE :FALSE; pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_A] = -1; pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_B] = -1; if(isCCKrate) { u1Byte report; u1Byte cck_agc_rpt; pDM_Odm->PhyDbgInfo.NumQryPhyStatusCCK++; // // (1)Hardware does not provide RSSI for CCK // (2)PWDB, Average PWDB cacluated by hardware (for rate adaptive) // //if(pHalData->eRFPowerState == eRfOn) cck_highpwr = pDM_Odm->bCckHighPower; //else // cck_highpwr = FALSE; cck_agc_rpt = pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a ; //2011.11.28 LukeLee: 88E use different LNA & VGA gain table //The RSSI formula should be modified according to the gain table //In 88E, cck_highpwr is always set to 1 if(pDM_Odm->SupportICType & (ODM_RTL8188E|ODM_RTL8812)) { LNA_idx = ((cck_agc_rpt & 0xE0) >>5); VGA_idx = (cck_agc_rpt & 0x1F); switch(LNA_idx) { case 7: if(VGA_idx <= 27) rx_pwr_all = -100 + 2*(27-VGA_idx); //VGA_idx = 27~2 else rx_pwr_all = -100; break; case 6: rx_pwr_all = -48 + 2*(2-VGA_idx); //VGA_idx = 2~0 break; case 5: rx_pwr_all = -42 + 2*(7-VGA_idx); //VGA_idx = 7~5 break; case 4: rx_pwr_all = -36 + 2*(7-VGA_idx); //VGA_idx = 7~4 break; case 3: //rx_pwr_all = -28 + 2*(7-VGA_idx); //VGA_idx = 7~0 rx_pwr_all = -24 + 2*(7-VGA_idx); //VGA_idx = 7~0 break; case 2: if(cck_highpwr) rx_pwr_all = -12 + 2*(5-VGA_idx); //VGA_idx = 5~0 else rx_pwr_all = -6+ 2*(5-VGA_idx); break; case 1: rx_pwr_all = 8-2*VGA_idx; break; case 0: rx_pwr_all = 14-2*VGA_idx; break; default: //DbgPrint("CCK Exception default\n"); break; } rx_pwr_all += 6; PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all); if(cck_highpwr == FALSE) { if(PWDB_ALL >= 80) PWDB_ALL = ((PWDB_ALL-80)<<1)+((PWDB_ALL-80)>>1)+80; else if((PWDB_ALL <= 78) && (PWDB_ALL >= 20)) PWDB_ALL += 3; if(PWDB_ALL>100) PWDB_ALL = 100; } }
static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm, struct odm_phy_status_info *pPhyInfo, u8 *pPhyStatus, struct odm_per_pkt_info *pPktinfo) { struct sw_ant_switch *pDM_SWAT_Table = &dm_odm->DM_SWAT_Table; u8 i, Max_spatial_stream; s8 rx_pwr[4], rx_pwr_all = 0; u8 EVM, PWDB_ALL = 0, PWDB_ALL_BT; u8 RSSI, total_rssi = 0; u8 isCCKrate = 0; u8 rf_rx_num = 0; u8 cck_highpwr = 0; u8 LNA_idx, VGA_idx; struct phy_status_rpt *pPhyStaRpt = (struct phy_status_rpt *)pPhyStatus; isCCKrate = ((pPktinfo->Rate >= DESC92C_RATE1M) && (pPktinfo->Rate <= DESC92C_RATE11M)) ? true : false; pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_A] = -1; pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_B] = -1; if (isCCKrate) { u8 report; u8 cck_agc_rpt; dm_odm->PhyDbgInfo.NumQryPhyStatusCCK++; /* (1)Hardware does not provide RSSI for CCK */ /* (2)PWDB, Average PWDB cacluated by hardware (for rate adaptive) */ cck_highpwr = dm_odm->bCckHighPower; cck_agc_rpt = pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a ; /* 2011.11.28 LukeLee: 88E use different LNA & VGA gain table */ /* The RSSI formula should be modified according to the gain table */ /* In 88E, cck_highpwr is always set to 1 */ if (dm_odm->SupportICType & (ODM_RTL8188E|ODM_RTL8812)) { LNA_idx = ((cck_agc_rpt & 0xE0) >> 5); VGA_idx = (cck_agc_rpt & 0x1F); switch (LNA_idx) { case 7: if (VGA_idx <= 27) rx_pwr_all = -100 + 2*(27-VGA_idx); /* VGA_idx = 27~2 */ else rx_pwr_all = -100; break; case 6: rx_pwr_all = -48 + 2*(2-VGA_idx); /* VGA_idx = 2~0 */ break; case 5: rx_pwr_all = -42 + 2*(7-VGA_idx); /* VGA_idx = 7~5 */ break; case 4: rx_pwr_all = -36 + 2*(7-VGA_idx); /* VGA_idx = 7~4 */ break; case 3: rx_pwr_all = -24 + 2*(7-VGA_idx); /* VGA_idx = 7~0 */ break; case 2: if (cck_highpwr) rx_pwr_all = -12 + 2*(5-VGA_idx); /* VGA_idx = 5~0 */ else rx_pwr_all = -6 + 2*(5-VGA_idx); break; case 1: rx_pwr_all = 8-2*VGA_idx; break; case 0: rx_pwr_all = 14-2*VGA_idx; break; default: break; } rx_pwr_all += 6; PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all); if (!cck_highpwr) { if (PWDB_ALL >= 80) PWDB_ALL = ((PWDB_ALL-80)<<1)+((PWDB_ALL-80)>>1)+80; else if ((PWDB_ALL <= 78) && (PWDB_ALL >= 20)) PWDB_ALL += 3; if (PWDB_ALL > 100) PWDB_ALL = 100; } } else {