diff options
Diffstat (limited to 'drivers/staging/rtl8723bs/hal')
-rw-r--r-- | drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/hal_btcoex.c | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/hal_com.c | 1 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/hal_com_phycfg.c | 1076 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/odm_DIG.c | 1 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 10 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/rtl8723b_dm.c | 3 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 12 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c | 77 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c | 41 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 13 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/sdio_halinit.c | 5 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/sdio_ops.c | 127 |
13 files changed, 60 insertions, 1310 deletions
diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c index 3239d37087c8..1ca9063a269f 100644 --- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c +++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c @@ -402,8 +402,6 @@ static void GetDeltaSwingTable_8723B( *TemperatureUP_B = (u8 *)DeltaSwingTableIdx_2GA_P_8188E; *TemperatureDOWN_B = (u8 *)DeltaSwingTableIdx_2GA_N_8188E; } - - return; } diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c index 6e4a1fcb8790..d5793e4614bf 100644 --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c @@ -1315,7 +1315,7 @@ void EXhalbtcoutsrc_DisplayBtCoexInfo(PBTC_COEXIST pBtCoexist) /* * Description: - *Run BT-Coexist mechansim or not + *Run BT-Coexist mechanism or not * */ void hal_btcoex_SetBTCoexist(struct adapter *padapter, u8 bBtExist) diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c index eddd56abbb2d..109bd85b0cd8 100644 --- a/drivers/staging/rtl8723bs/hal/hal_com.c +++ b/drivers/staging/rtl8723bs/hal/hal_com.c @@ -30,7 +30,6 @@ void rtw_hal_data_deinit(struct adapter *padapter) { if (is_primary_adapter(padapter)) { /* if (padapter->isprimary) */ if (padapter->HalData) { - phy_free_filebuf(padapter); vfree(padapter->HalData); padapter->HalData = NULL; padapter->hal_data_sz = 0; diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c index 6539bee9b5ba..eb7de3617d83 100644 --- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c +++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c @@ -2202,1079 +2202,3 @@ void Hal_ChannelPlanToRegulation(struct adapter *Adapter, u16 ChannelPlan) break; } } - - -static char file_path_bs[PATH_MAX]; - -#define GetLineFromBuffer(buffer) strsep(&buffer, "\n") - -int phy_ConfigMACWithParaFile(struct adapter *Adapter, char *pFileName) -{ - struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - int rlen = 0, rtStatus = _FAIL; - char *szLine, *ptmp; - u32 u4bRegOffset, u4bRegValue, u4bMove; - - if (!(Adapter->registrypriv.load_phy_file & LOAD_MAC_PARA_FILE)) - return rtStatus; - - memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); - - if ((pHalData->mac_reg_len == 0) && !pHalData->mac_reg) { - rtw_merge_string(file_path_bs, PATH_MAX, rtw_phy_file_path, pFileName); - - if (rtw_is_file_readable(file_path_bs) == true) { - rlen = rtw_retrive_from_file(file_path_bs, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); - if (rlen > 0) { - rtStatus = _SUCCESS; - pHalData->mac_reg = vzalloc(rlen); - if (pHalData->mac_reg) { - memcpy(pHalData->mac_reg, pHalData->para_file_buf, rlen); - pHalData->mac_reg_len = rlen; - } else - DBG_871X("%s mac_reg alloc fail !\n", __func__); - } - } - } else { - if ((pHalData->mac_reg_len != 0) && (pHalData->mac_reg != NULL)) { - memcpy(pHalData->para_file_buf, pHalData->mac_reg, pHalData->mac_reg_len); - rtStatus = _SUCCESS; - } else - DBG_871X("%s(): Critical Error !!!\n", __func__); - } - - if (rtStatus == _SUCCESS) { - ptmp = pHalData->para_file_buf; - for (szLine = GetLineFromBuffer(ptmp); szLine != NULL; szLine = GetLineFromBuffer(ptmp)) { - if (!IsCommentString(szLine)) { - /* Get 1st hex value as register offset */ - if (GetHexValueFromString(szLine, &u4bRegOffset, &u4bMove)) { - if (u4bRegOffset == 0xffff) /* Ending. */ - break; - - /* Get 2nd hex value as register value. */ - szLine += u4bMove; - if (GetHexValueFromString(szLine, &u4bRegValue, &u4bMove)) - rtw_write8(Adapter, u4bRegOffset, (u8)u4bRegValue); - } - } - } - } else - DBG_871X("%s(): No File %s, Load from HWImg Array!\n", __func__, pFileName); - - return rtStatus; -} - -int phy_ConfigBBWithParaFile( - struct adapter *Adapter, char *pFileName, u32 ConfigType -) -{ - struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - int rlen = 0, rtStatus = _FAIL; - char *szLine, *ptmp; - u32 u4bRegOffset, u4bRegValue, u4bMove; - char *pBuf = NULL; - u32 *pBufLen = NULL; - - if (!(Adapter->registrypriv.load_phy_file & LOAD_BB_PARA_FILE)) - return rtStatus; - - switch (ConfigType) { - case CONFIG_BB_PHY_REG: - pBuf = pHalData->bb_phy_reg; - pBufLen = &pHalData->bb_phy_reg_len; - break; - case CONFIG_BB_AGC_TAB: - pBuf = pHalData->bb_agc_tab; - pBufLen = &pHalData->bb_agc_tab_len; - break; - default: - DBG_871X("Unknown ConfigType!! %d\r\n", ConfigType); - break; - } - - memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); - - if (pBufLen && (*pBufLen == 0) && !pBuf) { - rtw_merge_string(file_path_bs, PATH_MAX, rtw_phy_file_path, pFileName); - - if (rtw_is_file_readable(file_path_bs) == true) { - rlen = rtw_retrive_from_file(file_path_bs, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); - if (rlen > 0) { - rtStatus = _SUCCESS; - pBuf = vzalloc(rlen); - if (pBuf) { - memcpy(pBuf, pHalData->para_file_buf, rlen); - *pBufLen = rlen; - - switch (ConfigType) { - case CONFIG_BB_PHY_REG: - pHalData->bb_phy_reg = pBuf; - break; - case CONFIG_BB_AGC_TAB: - pHalData->bb_agc_tab = pBuf; - break; - } - } else - DBG_871X("%s(): ConfigType %d alloc fail !\n", __func__, ConfigType); - } - } - } else { - if (pBufLen && (*pBufLen == 0) && !pBuf) { - memcpy(pHalData->para_file_buf, pBuf, *pBufLen); - rtStatus = _SUCCESS; - } else - DBG_871X("%s(): Critical Error !!!\n", __func__); - } - - if (rtStatus == _SUCCESS) { - ptmp = pHalData->para_file_buf; - for (szLine = GetLineFromBuffer(ptmp); szLine != NULL; szLine = GetLineFromBuffer(ptmp)) { - if (!IsCommentString(szLine)) { - /* Get 1st hex value as register offset. */ - if (GetHexValueFromString(szLine, &u4bRegOffset, &u4bMove)) { - if (u4bRegOffset == 0xffff) /* Ending. */ - break; - else if (u4bRegOffset == 0xfe || u4bRegOffset == 0xffe) - msleep(50); - else if (u4bRegOffset == 0xfd) - mdelay(5); - else if (u4bRegOffset == 0xfc) - mdelay(1); - else if (u4bRegOffset == 0xfb) - udelay(50); - else if (u4bRegOffset == 0xfa) - udelay(5); - else if (u4bRegOffset == 0xf9) - udelay(1); - - /* Get 2nd hex value as register value. */ - szLine += u4bMove; - if (GetHexValueFromString(szLine, &u4bRegValue, &u4bMove)) { - /* DBG_871X("[BB-ADDR]%03lX =%08lX\n", u4bRegOffset, u4bRegValue); */ - PHY_SetBBReg(Adapter, u4bRegOffset, bMaskDWord, u4bRegValue); - - if (u4bRegOffset == 0xa24) - pHalData->odmpriv.RFCalibrateInfo.RegA24 = u4bRegValue; - - /* Add 1us delay between BB/RF register setting. */ - udelay(1); - } - } - } - } - } else - DBG_871X("%s(): No File %s, Load from HWImg Array!\n", __func__, pFileName); - - return rtStatus; -} - -static void phy_DecryptBBPgParaFile(struct adapter *Adapter, char *buffer) -{ - u32 i = 0, j = 0; - u8 map[95] = {0}; - u8 currentChar; - char *BufOfLines, *ptmp; - - /* DBG_871X("=====>phy_DecryptBBPgParaFile()\n"); */ - /* 32 the ascii code of the first visable char, 126 the last one */ - for (i = 0; i < 95; ++i) - map[i] = (u8) (94 - i); - - ptmp = buffer; - i = 0; - for (BufOfLines = GetLineFromBuffer(ptmp); BufOfLines != NULL; BufOfLines = GetLineFromBuffer(ptmp)) { - /* DBG_871X("Encrypted Line: %s\n", BufOfLines); */ - - for (j = 0; j < strlen(BufOfLines); ++j) { - currentChar = BufOfLines[j]; - - if (currentChar == '\0') - break; - - currentChar -= (u8) ((((i + j) * 3) % 128)); - - BufOfLines[j] = map[currentChar - 32] + 32; - } - /* DBG_871X("Decrypted Line: %s\n", BufOfLines); */ - if (strlen(BufOfLines) != 0) - i++; - BufOfLines[strlen(BufOfLines)] = '\n'; - } -} - -static int phy_ParseBBPgParaFile(struct adapter *Adapter, char *buffer) -{ - int rtStatus = _SUCCESS; - struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - char *szLine, *ptmp; - u32 u4bRegOffset, u4bRegMask, u4bRegValue; - u32 u4bMove; - bool firstLine = true; - u8 tx_num = 0; - u8 band = 0, rf_path = 0; - - /* DBG_871X("=====>phy_ParseBBPgParaFile()\n"); */ - - if (Adapter->registrypriv.RegDecryptCustomFile == 1) - phy_DecryptBBPgParaFile(Adapter, buffer); - - ptmp = buffer; - for (szLine = GetLineFromBuffer(ptmp); szLine != NULL; szLine = GetLineFromBuffer(ptmp)) { - if (!IsCommentString(szLine)) { - if (isAllSpaceOrTab(szLine, sizeof(*szLine))) - continue; - - /* Get header info (relative value or exact value) */ - if (firstLine) { - if (eqNByte(szLine, (u8 *)("#[v1]"), 5)) { - - pHalData->odmpriv.PhyRegPgVersion = szLine[3] - '0'; - /* DBG_871X("This is a new format PHY_REG_PG.txt\n"); */ - } else if (eqNByte(szLine, (u8 *)("#[v0]"), 5)) { - pHalData->odmpriv.PhyRegPgVersion = szLine[3] - '0'; - /* DBG_871X("This is a old format PHY_REG_PG.txt ok\n"); */ - } else { - DBG_871X("The format in PHY_REG_PG are invalid %s\n", szLine); - return _FAIL; - } - - if (eqNByte(szLine + 5, (u8 *)("[Exact]#"), 8)) { - pHalData->odmpriv.PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE; - /* DBG_871X("The values in PHY_REG_PG are exact values ok\n"); */ - firstLine = false; - continue; - } else if (eqNByte(szLine + 5, (u8 *)("[Relative]#"), 11)) { - pHalData->odmpriv.PhyRegPgValueType = PHY_REG_PG_RELATIVE_VALUE; - /* DBG_871X("The values in PHY_REG_PG are relative values ok\n"); */ - firstLine = false; - continue; - } else { - DBG_871X("The values in PHY_REG_PG are invalid %s\n", szLine); - return _FAIL; - } - } - - if (pHalData->odmpriv.PhyRegPgVersion == 0) { - /* Get 1st hex value as register offset. */ - if (GetHexValueFromString(szLine, &u4bRegOffset, &u4bMove)) { - szLine += u4bMove; - if (u4bRegOffset == 0xffff) /* Ending. */ - break; - - /* Get 2nd hex value as register mask. */ - if (GetHexValueFromString(szLine, &u4bRegMask, &u4bMove)) - szLine += u4bMove; - else - return _FAIL; - - if (pHalData->odmpriv.PhyRegPgValueType == PHY_REG_PG_RELATIVE_VALUE) { - /* Get 3rd hex value as register value. */ - if (GetHexValueFromString(szLine, &u4bRegValue, &u4bMove)) { - PHY_StoreTxPowerByRate(Adapter, 0, 0, 1, u4bRegOffset, u4bRegMask, u4bRegValue); - /* DBG_871X("[ADDR] %03X =%08X Mask =%08x\n", u4bRegOffset, u4bRegValue, u4bRegMask); */ - } else - return _FAIL; - } else if (pHalData->odmpriv.PhyRegPgValueType == PHY_REG_PG_EXACT_VALUE) { - u32 combineValue = 0; - u8 integer = 0, fraction = 0; - - if (GetFractionValueFromString(szLine, &integer, &fraction, &u4bMove)) - szLine += u4bMove; - else - return _FAIL; - - integer *= 2; - if (fraction == 5) - integer += 1; - combineValue |= (((integer / 10) << 4) + (integer % 10)); - /* DBG_871X(" %d", integer); */ - - if (GetFractionValueFromString(szLine, &integer, &fraction, &u4bMove)) - szLine += u4bMove; - else - return _FAIL; - - integer *= 2; - if (fraction == 5) - integer += 1; - combineValue <<= 8; - combineValue |= (((integer / 10) << 4) + (integer % 10)); - /* DBG_871X(" %d", integer); */ - - if (GetFractionValueFromString(szLine, &integer, &fraction, &u4bMove)) - szLine += u4bMove; - else - return _FAIL; - - integer *= 2; - if (fraction == 5) - integer += 1; - combineValue <<= 8; - combineValue |= (((integer / 10) << 4) + (integer % 10)); - /* DBG_871X(" %d", integer); */ - - if (GetFractionValueFromString(szLine, &integer, &fraction, &u4bMove)) - szLine += u4bMove; - else - return _FAIL; - - integer *= 2; - if (fraction == 5) - integer += 1; - combineValue <<= 8; - combineValue |= (((integer / 10) << 4) + (integer % 10)); - /* DBG_871X(" %d", integer); */ - PHY_StoreTxPowerByRate(Adapter, 0, 0, 1, u4bRegOffset, u4bRegMask, combineValue); - - /* DBG_871X("[ADDR] 0x%3x = 0x%4x\n", u4bRegOffset, combineValue); */ - } - } - } else if (pHalData->odmpriv.PhyRegPgVersion > 0) { - u32 index = 0; - - if (eqNByte(szLine, "0xffff", 6)) - break; - - if (!eqNByte("#[END]#", szLine, 7)) { - /* load the table label info */ - if (szLine[0] == '#') { - index = 0; - if (eqNByte(szLine, "#[2.4G]", 7)) { - band = BAND_ON_2_4G; - index += 8; - } else if (eqNByte(szLine, "#[5G]", 5)) { - band = BAND_ON_5G; - index += 6; - } else { - DBG_871X("Invalid band %s in PHY_REG_PG.txt\n", szLine); - return _FAIL; - } - - rf_path = szLine[index] - 'A'; - /* DBG_871X(" Table label Band %d, RfPath %d\n", band, rf_path); */ - } else { /* load rows of tables */ - if (szLine[1] == '1') - tx_num = RF_1TX; - else if (szLine[1] == '2') - tx_num = RF_2TX; - else if (szLine[1] == '3') - tx_num = RF_3TX; - else if (szLine[1] == '4') - tx_num = RF_4TX; - else { - DBG_871X("Invalid row in PHY_REG_PG.txt %c\n", szLine[1]); - return _FAIL; - } - - while (szLine[index] != ']') - ++index; - ++index;/* skip ] */ - - /* Get 2nd hex value as register offset. */ - szLine += index; - if (GetHexValueFromString(szLine, &u4bRegOffset, &u4bMove)) - szLine += u4bMove; - else - return _FAIL; - - /* Get 2nd hex value as register mask. */ - if (GetHexValueFromString(szLine, &u4bRegMask, &u4bMove)) - szLine += u4bMove; - else - return _FAIL; - - if (pHalData->odmpriv.PhyRegPgValueType == PHY_REG_PG_RELATIVE_VALUE) { - /* Get 3rd hex value as register value. */ - if (GetHexValueFromString(szLine, &u4bRegValue, &u4bMove)) { - PHY_StoreTxPowerByRate(Adapter, band, rf_path, tx_num, u4bRegOffset, u4bRegMask, u4bRegValue); - /* DBG_871X("[ADDR] %03X (tx_num %d) =%08X Mask =%08x\n", u4bRegOffset, tx_num, u4bRegValue, u4bRegMask); */ - } else - return _FAIL; - } else if (pHalData->odmpriv.PhyRegPgValueType == PHY_REG_PG_EXACT_VALUE) { - u32 combineValue = 0; - u8 integer = 0, fraction = 0; - - if (GetFractionValueFromString(szLine, &integer, &fraction, &u4bMove)) - szLine += u4bMove; - else - return _FAIL; - - integer *= 2; - if (fraction == 5) - integer += 1; - combineValue |= (((integer / 10) << 4) + (integer % 10)); - /* DBG_871X(" %d", integer); */ - - if (GetFractionValueFromString(szLine, &integer, &fraction, &u4bMove)) - szLine += u4bMove; - else - return _FAIL; - - integer *= 2; - if (fraction == 5) - integer += 1; - combineValue <<= 8; - combineValue |= (((integer / 10) << 4) + (integer % 10)); - /* DBG_871X(" %d", integer); */ - - if (GetFractionValueFromString(szLine, &integer, &fraction, &u4bMove)) - szLine += u4bMove; - else - return _FAIL; - - integer *= 2; - if (fraction == 5) - integer += 1; - combineValue <<= 8; - combineValue |= (((integer / 10) << 4) + (integer % 10)); - /* DBG_871X(" %d", integer); */ - - if (GetFractionValueFromString(szLine, &integer, &fraction, &u4bMove)) - szLine += u4bMove; - else - return _FAIL; - - integer *= 2; - if (fraction == 5) - integer += 1; - combineValue <<= 8; - combineValue |= (((integer / 10) << 4) + (integer % 10)); - /* DBG_871X(" %d", integer); */ - PHY_StoreTxPowerByRate(Adapter, band, rf_path, tx_num, u4bRegOffset, u4bRegMask, combineValue); - - /* DBG_871X("[ADDR] 0x%3x (tx_num %d) = 0x%4x\n", u4bRegOffset, tx_num, combineValue); */ - } - } - } - } - } - } - /* DBG_871X("<=====phy_ParseBBPgParaFile()\n"); */ - return rtStatus; -} - -int phy_ConfigBBWithPgParaFile(struct adapter *Adapter, char *pFileName) -{ - struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - int rlen = 0, rtStatus = _FAIL; - - if (!(Adapter->registrypriv.load_phy_file & LOAD_BB_PG_PARA_FILE)) - return rtStatus; - - memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); - - if ((pHalData->bb_phy_reg_pg_len == 0) && !pHalData->bb_phy_reg_pg) { - rtw_merge_string(file_path_bs, PATH_MAX, rtw_phy_file_path, pFileName); - - if (rtw_is_file_readable(file_path_bs) == true) { - rlen = rtw_retrive_from_file(file_path_bs, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); - if (rlen > 0) { - rtStatus = _SUCCESS; - pHalData->bb_phy_reg_pg = vzalloc(rlen); - if (pHalData->bb_phy_reg_pg) { - memcpy(pHalData->bb_phy_reg_pg, pHalData->para_file_buf, rlen); - pHalData->bb_phy_reg_pg_len = rlen; - } else - DBG_871X("%s bb_phy_reg_pg alloc fail !\n", __func__); - } - } - } else { - if ((pHalData->bb_phy_reg_pg_len != 0) && (pHalData->bb_phy_reg_pg != NULL)) { - memcpy(pHalData->para_file_buf, pHalData->bb_phy_reg_pg, pHalData->bb_phy_reg_pg_len); - rtStatus = _SUCCESS; - } else - DBG_871X("%s(): Critical Error !!!\n", __func__); - } - - if (rtStatus == _SUCCESS) { - /* DBG_871X("phy_ConfigBBWithPgParaFile(): read %s ok\n", pFileName); */ - phy_ParseBBPgParaFile(Adapter, pHalData->para_file_buf); - } else - DBG_871X("%s(): No File %s, Load from HWImg Array!\n", __func__, pFileName); - - return rtStatus; -} - -int PHY_ConfigRFWithParaFile( - struct adapter *Adapter, char *pFileName, u8 eRFPath -) -{ - struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - int rlen = 0, rtStatus = _FAIL; - char *szLine, *ptmp; - u32 u4bRegOffset, u4bRegValue, u4bMove; - u16 i; - char *pBuf = NULL; - u32 *pBufLen = NULL; - - if (!(Adapter->registrypriv.load_phy_file & LOAD_RF_PARA_FILE)) - return rtStatus; - - switch (eRFPath) { - case ODM_RF_PATH_A: - pBuf = pHalData->rf_radio_a; - pBufLen = &pHalData->rf_radio_a_len; - break; - case ODM_RF_PATH_B: - pBuf = pHalData->rf_radio_b; - pBufLen = &pHalData->rf_radio_b_len; - break; - default: - DBG_871X("Unknown RF path!! %d\r\n", eRFPath); - break; - } - - memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); - - if (pBufLen && (*pBufLen == 0) && !pBuf) { - rtw_merge_string(file_path_bs, PATH_MAX, rtw_phy_file_path, pFileName); - - if (rtw_is_file_readable(file_path_bs) == true) { - rlen = rtw_retrive_from_file(file_path_bs, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); - if (rlen > 0) { - rtStatus = _SUCCESS; - pBuf = vzalloc(rlen); - if (pBuf) { - memcpy(pBuf, pHalData->para_file_buf, rlen); - *pBufLen = rlen; - - switch (eRFPath) { - case ODM_RF_PATH_A: - pHalData->rf_radio_a = pBuf; - break; - case ODM_RF_PATH_B: - pHalData->rf_radio_b = pBuf; - break; - } - } else - DBG_871X("%s(): eRFPath =%d alloc fail !\n", __func__, eRFPath); - } - } - } else { - if (pBufLen && (*pBufLen == 0) && !pBuf) { - memcpy(pHalData->para_file_buf, pBuf, *pBufLen); - rtStatus = _SUCCESS; - } else - DBG_871X("%s(): Critical Error !!!\n", __func__); - } - - if (rtStatus == _SUCCESS) { - /* DBG_871X("%s(): read %s successfully\n", __func__, pFileName); */ - - ptmp = pHalData->para_file_buf; - for (szLine = GetLineFromBuffer(ptmp); szLine != NULL; szLine = GetLineFromBuffer(ptmp)) { - if (!IsCommentString(szLine)) { - /* Get 1st hex value as register offset. */ - if (GetHexValueFromString(szLine, &u4bRegOffset, &u4bMove)) { - if (u4bRegOffset == 0xfe || u4bRegOffset == 0xffe) /* Deay specific ms. Only RF configuration require delay. */ - msleep(50); - else if (u4bRegOffset == 0xfd) { - /* mdelay(5); */ - for (i = 0; i < 100; i++) - udelay(MAX_STALL_TIME); - } else if (u4bRegOffset == 0xfc) { - /* mdelay(1); */ - for (i = 0; i < 20; i++) - udelay(MAX_STALL_TIME); - } else if (u4bRegOffset == 0xfb) - udelay(50); - else if (u4bRegOffset == 0xfa) - udelay(5); - else if (u4bRegOffset == 0xf9) - udelay(1); - else if (u4bRegOffset == 0xffff) - break; - - /* Get 2nd hex value as register value. */ - szLine += u4bMove; - if (GetHexValueFromString(szLine, &u4bRegValue, &u4bMove)) { - PHY_SetRFReg(Adapter, eRFPath, u4bRegOffset, bRFRegOffsetMask, u4bRegValue); - - /* Temp add, for frequency lock, if no delay, that may cause */ - /* frequency shift, ex: 2412MHz => 2417MHz */ - /* If frequency shift, the following action may works. */ - /* Fractional-N table in radio_a.txt */ - /* 0x2a 0x00001 channel 1 */ - /* 0x2b 0x00808 frequency divider. */ - /* 0x2b 0x53333 */ - /* 0x2c 0x0000c */ - udelay(1); - } - } - } - } - } else - DBG_871X("%s(): No File %s, Load from HWImg Array!\n", __func__, pFileName); - - return rtStatus; -} - -static void initDeltaSwingIndexTables( - struct adapter *Adapter, - char *Band, - char *Path, - char *Sign, - char *Channel, - char *Rate, - char *Data -) -{ - #define STR_EQUAL_5G(_band, _path, _sign, _rate, _chnl) \ - ((strcmp(Band, _band) == 0) && (strcmp(Path, _path) == 0) && (strcmp(Sign, _sign) == 0) &&\ - (strcmp(Rate, _rate) == 0) && (strcmp(Channel, _chnl) == 0)\ - ) - #define STR_EQUAL_2G(_band, _path, _sign, _rate) \ - ((strcmp(Band, _band) == 0) && (strcmp(Path, _path) == 0) && (strcmp(Sign, _sign) == 0) &&\ - (strcmp(Rate, _rate) == 0)\ - ) - - #define STORE_SWING_TABLE(_array, _iteratedIdx) \ - for (token = strsep(&Data, delim); token != NULL; token = strsep(&Data, delim)) {\ - sscanf(token, "%d", &idx);\ - _array[_iteratedIdx++] = (u8)idx;\ - } \ - - struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - PDM_ODM_T pDM_Odm = &pHalData->odmpriv; - PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo); - u32 j = 0; - char *token; - char delim[] = ","; - u32 idx = 0; - - /* DBG_871X("===>initDeltaSwingIndexTables(): Band: %s;\nPath: %s;\nSign: %s;\nChannel: %s;\nRate: %s;\n, Data: %s;\n", */ - /* Band, Path, Sign, Channel, Rate, Data); */ - - if (STR_EQUAL_2G("2G", "A", "+", "CCK")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_P, j); - } else if (STR_EQUAL_2G("2G", "A", "-", "CCK")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_N, j); - } else if (STR_EQUAL_2G("2G", "B", "+", "CCK")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_P, j); - } else if (STR_EQUAL_2G("2G", "B", "-", "CCK")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_N, j); - } else if (STR_EQUAL_2G("2G", "A", "+", "ALL")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_2GA_P, j); - } else if (STR_EQUAL_2G("2G", "A", "-", "ALL")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_2GA_N, j); - } else if (STR_EQUAL_2G("2G", "B", "+", "ALL")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_2GB_P, j); - } else if (STR_EQUAL_2G("2G", "B", "-", "ALL")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_2GB_N, j); - } else if (STR_EQUAL_5G("5G", "A", "+", "ALL", "0")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P[0], j); - } else if (STR_EQUAL_5G("5G", "A", "-", "ALL", "0")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N[0], j); - } else if (STR_EQUAL_5G("5G", "B", "+", "ALL", "0")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P[0], j); - } else if (STR_EQUAL_5G("5G", "B", "-", "ALL", "0")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N[0], j); - } else if (STR_EQUAL_5G("5G", "A", "+", "ALL", "1")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P[1], j); - } else if (STR_EQUAL_5G("5G", "A", "-", "ALL", "1")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N[1], j); - } else if (STR_EQUAL_5G("5G", "B", "+", "ALL", "1")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P[1], j); - } else if (STR_EQUAL_5G("5G", "B", "-", "ALL", "1")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N[1], j); - } else if (STR_EQUAL_5G("5G", "A", "+", "ALL", "2")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P[2], j); - } else if (STR_EQUAL_5G("5G", "A", "-", "ALL", "2")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N[2], j); - } else if (STR_EQUAL_5G("5G", "B", "+", "ALL", "2")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P[2], j); - } else if (STR_EQUAL_5G("5G", "B", "-", "ALL", "2")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N[2], j); - } else if (STR_EQUAL_5G("5G", "A", "+", "ALL", "3")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P[3], j); - } else if (STR_EQUAL_5G("5G", "A", "-", "ALL", "3")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N[3], j); - } else if (STR_EQUAL_5G("5G", "B", "+", "ALL", "3")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P[3], j); - } else if (STR_EQUAL_5G("5G", "B", "-", "ALL", "3")) { - STORE_SWING_TABLE(pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N[3], j); - } else - DBG_871X("===>initDeltaSwingIndexTables(): The input is invalid!!\n"); -} - -int PHY_ConfigRFWithTxPwrTrackParaFile(struct adapter *Adapter, char *pFileName) -{ - struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - int rlen = 0, rtStatus = _FAIL; - char *szLine, *ptmp; - - if (!(Adapter->registrypriv.load_phy_file & LOAD_RF_TXPWR_TRACK_PARA_FILE)) - return rtStatus; - - memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); - - if ((pHalData->rf_tx_pwr_track_len == 0) && !pHalData->rf_tx_pwr_track) { - rtw_merge_string(file_path_bs, PATH_MAX, rtw_phy_file_path, pFileName); - - if (rtw_is_file_readable(file_path_bs) == true) { - rlen = rtw_retrive_from_file(file_path_bs, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); - if (rlen > 0) { - rtStatus = _SUCCESS; - pHalData->rf_tx_pwr_track = vzalloc(rlen); - if (pHalData->rf_tx_pwr_track) { - memcpy(pHalData->rf_tx_pwr_track, pHalData->para_file_buf, rlen); - pHalData->rf_tx_pwr_track_len = rlen; - } else - DBG_871X("%s rf_tx_pwr_track alloc fail !\n", __func__); - } - } - } else { - if ((pHalData->rf_tx_pwr_track_len != 0) && (pHalData->rf_tx_pwr_track != NULL)) { - memcpy(pHalData->para_file_buf, pHalData->rf_tx_pwr_track, pHalData->rf_tx_pwr_track_len); - rtStatus = _SUCCESS; - } else - DBG_871X("%s(): Critical Error !!!\n", __func__); - } - - if (rtStatus == _SUCCESS) { - /* DBG_871X("%s(): read %s successfully\n", __func__, pFileName); */ - - ptmp = pHalData->para_file_buf; - for (szLine = GetLineFromBuffer(ptmp); szLine != NULL; szLine = GetLineFromBuffer(ptmp)) { - if (!IsCommentString(szLine)) { - char band[5] = "", path[5] = "", sign[5] = ""; - char chnl[5] = "", rate[10] = ""; - char data[300] = ""; /* 100 is too small */ - const int len = strlen(szLine); - int i; - - if (len < 10 || szLine[0] != '[') - continue; - - strncpy(band, szLine+1, 2); - strncpy(path, szLine+5, 1); - strncpy(sign, szLine+8, 1); - - i = 10; /* szLine+10 */ - if (!ParseQualifiedString(szLine, &i, rate, '[', ']')) { - /* DBG_871X("Fail to parse rate!\n"); */ - } - if (!ParseQualifiedString(szLine, &i, chnl, '[', ']')) { - /* DBG_871X("Fail to parse channel group!\n"); */ - } - while (i < len && szLine[i] != '{') - i++; - if (!ParseQualifiedString(szLine, &i, data, '{', '}')) { - /* DBG_871X("Fail to parse data!\n"); */ - } - - initDeltaSwingIndexTables(Adapter, band, path, sign, chnl, rate, data); - } - } - } else - DBG_871X("%s(): No File %s, Load from HWImg Array!\n", __func__, pFileName); - - return rtStatus; -} - -static int phy_ParsePowerLimitTableFile(struct adapter *Adapter, char *buffer) -{ - u32 i = 0, forCnt = 0; - u8 loadingStage = 0, limitValue = 0, fraction = 0; - char *szLine, *ptmp; - int rtStatus = _SUCCESS; - char band[10], bandwidth[10], rateSection[10], - regulation[TXPWR_LMT_MAX_REGULATION_NUM][10], rfPath[10], colNumBuf[10]; - u8 colNum = 0; - - DBG_871X("===>phy_ParsePowerLimitTableFile()\n"); - - if (Adapter->registrypriv.RegDecryptCustomFile == 1) - phy_DecryptBBPgParaFile(Adapter, buffer); - - ptmp = buffer; - for (szLine = GetLineFromBuffer(ptmp); szLine != NULL; szLine = GetLineFromBuffer(ptmp)) { - /* skip comment */ - if (IsCommentString(szLine)) { - continue; - } - - if (loadingStage == 0) { - for (forCnt = 0; forCnt < TXPWR_LMT_MAX_REGULATION_NUM; ++forCnt) - memset((void *) regulation[forCnt], 0, 10); - - memset((void *) band, 0, 10); - memset((void *) bandwidth, 0, 10); - memset((void *) rateSection, 0, 10); - memset((void *) rfPath, 0, 10); - memset((void *) colNumBuf, 0, 10); - - if (szLine[0] != '#' || szLine[1] != '#') - continue; - - /* skip the space */ - i = 2; - while (szLine[i] == ' ' || szLine[i] == '\t') - ++i; - - szLine[--i] = ' '; /* return the space in front of the regulation info */ - - /* Parse the label of the table */ - if (!ParseQualifiedString(szLine, &i, band, ' ', ',')) { - DBG_871X("Fail to parse band!\n"); - return _FAIL; - } - if (!ParseQualifiedString(szLine, &i, bandwidth, ' ', ',')) { - DBG_871X("Fail to parse bandwidth!\n"); - return _FAIL; - } - if (!ParseQualifiedString(szLine, &i, rfPath, ' ', ',')) { - DBG_871X("Fail to parse rf path!\n"); - return _FAIL; - } - if (!ParseQualifiedString(szLine, &i, rateSection, ' ', ',')) { - DBG_871X("Fail to parse rate!\n"); - return _FAIL; - } - - loadingStage = 1; - } else if (loadingStage == 1) { - if (szLine[0] != '#' || szLine[1] != '#') - continue; - - /* skip the space */ - i = 2; - while (szLine[i] == ' ' || szLine[i] == '\t') - ++i; - - if (!eqNByte((u8 *)(szLine + i), (u8 *)("START"), 5)) { - DBG_871X("Lost \"## START\" label\n"); - return _FAIL; - } - - loadingStage = 2; - } else if (loadingStage == 2) { - if (szLine[0] != '#' || szLine[1] != '#') - continue; - - /* skip the space */ - i = 2; - while (szLine[i] == ' ' || szLine[i] == '\t') - ++i; - - if (!ParseQualifiedString(szLine, &i, colNumBuf, '#', '#')) { - DBG_871X("Fail to parse column number!\n"); - return _FAIL; - } - - if (!GetU1ByteIntegerFromStringInDecimal(colNumBuf, &colNum)) - return _FAIL; - - if (colNum > TXPWR_LMT_MAX_REGULATION_NUM) { - DBG_871X( - "invalid col number %d (greater than max %d)\n", - colNum, TXPWR_LMT_MAX_REGULATION_NUM - ); - return _FAIL; - } - - for (forCnt = 0; forCnt < colNum; ++forCnt) { - u8 regulation_name_cnt = 0; - - /* skip the space */ - while (szLine[i] == ' ' || szLine[i] == '\t') - ++i; - - while (szLine[i] != ' ' && szLine[i] != '\t' && szLine[i] != '\0') - regulation[forCnt][regulation_name_cnt++] = szLine[i++]; - /* DBG_871X("regulation %s!\n", regulation[forCnt]); */ - - if (regulation_name_cnt == 0) { - DBG_871X("invalid number of regulation!\n"); - return _FAIL; - } - } - - loadingStage = 3; - } else if (loadingStage == 3) { - char channel[10] = {0}, powerLimit[10] = {0}; - u8 cnt = 0; - - /* the table ends */ - if (szLine[0] == '#' && szLine[1] == '#') { - i = 2; - while (szLine[i] == ' ' || szLine[i] == '\t') - ++i; - - if (eqNByte((u8 *)(szLine + i), (u8 *)("END"), 3)) { - loadingStage = 0; - continue; - } else { - DBG_871X("Wrong format\n"); - DBG_871X("<===== phy_ParsePowerLimitTableFile()\n"); - return _FAIL; - } - } - - if ((szLine[0] != 'c' && szLine[0] != 'C') || - (szLine[1] != 'h' && szLine[1] != 'H')) { - DBG_871X("Meet wrong channel => power limt pair\n"); - continue; - } - i = 2;/* move to the location behind 'h' */ - - /* load the channel number */ - cnt = 0; - while (szLine[i] >= '0' && szLine[i] <= '9') { - channel[cnt] = szLine[i]; - ++cnt; - ++i; - } - /* DBG_871X("chnl %s!\n", channel); */ - - for (forCnt = 0; forCnt < colNum; ++forCnt) { - /* skip the space between channel number and the power limit value */ - while (szLine[i] == ' ' || szLine[i] == '\t') - ++i; - - /* load the power limit value */ - cnt = 0; - fraction = 0; - memset((void *) powerLimit, 0, 10); - while ((szLine[i] >= '0' && szLine[i] <= '9') || szLine[i] == '.') { - if (szLine[i] == '.') { - if ((szLine[i+1] >= '0' && szLine[i+1] <= '9')) { - fraction = szLine[i+1]; - i += 2; - } else { - DBG_871X("Wrong fraction in TXPWR_LMT.txt\n"); - return _FAIL; - } - - break; - } - - powerLimit[cnt] = szLine[i]; - ++cnt; - ++i; - } - - if (powerLimit[0] == '\0') { - powerLimit[0] = '6'; - powerLimit[1] = '3'; - i += 2; - } else { - if (!GetU1ByteIntegerFromStringInDecimal(powerLimit, &limitValue)) - return _FAIL; - - limitValue *= 2; - cnt = 0; - if (fraction == '5') - ++limitValue; - - /* the value is greater or equal to 100 */ - if (limitValue >= 100) { - powerLimit[cnt++] = limitValue/100 + '0'; - limitValue %= 100; - - if (limitValue >= 10) { - powerLimit[cnt++] = limitValue/10 + '0'; - limitValue %= 10; - } else - powerLimit[cnt++] = '0'; - - powerLimit[cnt++] = limitValue + '0'; - } else if (limitValue >= 10) { /* the value is greater or equal to 10 */ - powerLimit[cnt++] = limitValue/10 + '0'; - limitValue %= 10; - powerLimit[cnt++] = limitValue + '0'; - } - /* the value is less than 10 */ - else - powerLimit[cnt++] = limitValue + '0'; - - powerLimit[cnt] = '\0'; - } - - /* DBG_871X("ch%s => %s\n", channel, powerLimit); */ - - /* store the power limit value */ - PHY_SetTxPowerLimit(Adapter, (u8 *)regulation[forCnt], (u8 *)band, - (u8 *)bandwidth, (u8 *)rateSection, (u8 *)rfPath, (u8 *)channel, (u8 *)powerLimit); - - } - } else { - DBG_871X("Abnormal loading stage in phy_ParsePowerLimitTableFile()!\n"); - rtStatus = _FAIL; - break; - } - } - - DBG_871X("<===phy_ParsePowerLimitTableFile()\n"); - return rtStatus; -} - -int PHY_ConfigRFWithPowerLimitTableParaFile( - struct adapter *Adapter, char *pFileName -) -{ - struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - int rlen = 0, rtStatus = _FAIL; - - if (!(Adapter->registrypriv.load_phy_file & LOAD_RF_TXPWR_LMT_PARA_FILE)) - return rtStatus; - - memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); - - if ((pHalData->rf_tx_pwr_lmt_len == 0) && !pHalData->rf_tx_pwr_lmt) { - rtw_merge_string(file_path_bs, PATH_MAX, rtw_phy_file_path, pFileName); - - if (rtw_is_file_readable(file_path_bs) == true) { - rlen = rtw_retrive_from_file(file_path_bs, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); - if (rlen > 0) { - rtStatus = _SUCCESS; - pHalData->rf_tx_pwr_lmt = vzalloc(rlen); - if (pHalData->rf_tx_pwr_lmt) { - memcpy(pHalData->rf_tx_pwr_lmt, pHalData->para_file_buf, rlen); - pHalData->rf_tx_pwr_lmt_len = rlen; - } else - DBG_871X("%s rf_tx_pwr_lmt alloc fail !\n", __func__); - } - } - } else { - if ((pHalData->rf_tx_pwr_lmt_len != 0) && (pHalData->rf_tx_pwr_lmt != NULL)) { - memcpy(pHalData->para_file_buf, pHalData->rf_tx_pwr_lmt, pHalData->rf_tx_pwr_lmt_len); - rtStatus = _SUCCESS; - } else - DBG_871X("%s(): Critical Error !!!\n", __func__); - } - - if (rtStatus == _SUCCESS) { - /* DBG_871X("%s(): read %s ok\n", __func__, pFileName); */ - rtStatus = phy_ParsePowerLimitTableFile(Adapter, pHalData->para_file_buf); - } else - DBG_871X("%s(): No File %s, Load from HWImg Array!\n", __func__, pFileName); - - return rtStatus; -} - -void phy_free_filebuf(struct adapter *padapter) -{ - struct hal_com_data *pHalData = GET_HAL_DATA(padapter); - - if (pHalData->mac_reg) - vfree(pHalData->mac_reg); - if (pHalData->bb_phy_reg) - vfree(pHalData->bb_phy_reg); - if (pHalData->bb_agc_tab) - vfree(pHalData->bb_agc_tab); - if (pHalData->bb_phy_reg_pg) - vfree(pHalData->bb_phy_reg_pg); - if (pHalData->bb_phy_reg_mp) - vfree(pHalData->bb_phy_reg_mp); - if (pHalData->rf_radio_a) - vfree(pHalData->rf_radio_a); - if (pHalData->rf_radio_b) - vfree(pHalData->rf_radio_b); - if (pHalData->rf_tx_pwr_track) - vfree(pHalData->rf_tx_pwr_track); - if (pHalData->rf_tx_pwr_lmt) - vfree(pHalData->rf_tx_pwr_lmt); - -} diff --git a/drivers/staging/rtl8723bs/hal/odm_DIG.c b/drivers/staging/rtl8723bs/hal/odm_DIG.c index 70d98c58ca97..40fe43c62c45 100644 --- a/drivers/staging/rtl8723bs/hal/odm_DIG.c +++ b/drivers/staging/rtl8723bs/hal/odm_DIG.c @@ -1074,7 +1074,6 @@ void odm_FAThresholdCheck( dm_FA_thres[1] = 4000; dm_FA_thres[2] = 5000; } - return; } u8 odm_ForbiddenIGICheck(void *pDM_VOID, u8 DIG_Dynamic_MIN, u8 CurrentIGI) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c index 7760fd0eb6c9..71b5a50b6ef6 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c @@ -2071,8 +2071,6 @@ static void ConstructBtNullFunctionData( struct ieee80211_hdr *pwlanhdr; __le16 *fctrl; u32 pktlen; - struct mlme_ext_priv *pmlmeext; - struct mlme_ext_info *pmlmeinfo; u8 bssid[ETH_ALEN]; @@ -2080,8 +2078,6 @@ static void ConstructBtNullFunctionData( FUNC_ADPT_ARG(padapter), bQoS, bEosp, bForcePowerSave); pwlanhdr = (struct ieee80211_hdr *)pframe; - pmlmeext = &padapter->mlmeextpriv; - pmlmeinfo = &pmlmeext->mlmext_info; if (!StaAddr) { memcpy(bssid, myid(&padapter->eeprompriv), ETH_ALEN); @@ -2122,12 +2118,9 @@ static void ConstructBtNullFunctionData( static void SetFwRsvdPagePkt_BTCoex(struct adapter *padapter) { - struct hal_com_data *pHalData; struct xmit_frame *pcmdframe; struct pkt_attrib *pattrib; struct xmit_priv *pxmitpriv; - struct mlme_ext_priv *pmlmeext; - struct mlme_ext_info *pmlmeinfo; u32 BeaconLength = 0; u32 BTQosNullLength = 0; u8 *ReservedPagePacket; @@ -2140,10 +2133,7 @@ static void SetFwRsvdPagePkt_BTCoex(struct adapter *padapter) /* DBG_8192C("+" FUNC_ADPT_FMT "\n", FUNC_ADPT_ARG(padapter)); */ - pHalData = GET_HAL_DATA(padapter); pxmitpriv = &padapter->xmitpriv; - pmlmeext = &padapter->mlmeextpriv; - pmlmeinfo = &pmlmeext->mlmext_info; TxDescLen = TXDESC_SIZE; TxDescOffset = TXDESC_OFFSET; PageSize = PAGE_SIZE_TX_8723B; diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_dm.c b/drivers/staging/rtl8723bs/hal/rtl8723b_dm.c index c514cb735afd..650fbedd34e8 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_dm.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_dm.c @@ -188,7 +188,8 @@ void rtl8723b_HalDmWatchDog(struct adapter *Adapter) bBtDisabled = hal_btcoex_IsBtDisabled(Adapter); - ODM_CmnInfoUpdate(&pHalData->odmpriv, ODM_CMNINFO_BT_ENABLED, ((bBtDisabled == true)?false:true)); + ODM_CmnInfoUpdate(&pHalData->odmpriv, ODM_CMNINFO_BT_ENABLED, + !bBtDisabled); ODM_DMWatchdog(&pHalData->odmpriv); } diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c index faeaf24fa833..66127f6c8e4d 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c @@ -2234,12 +2234,8 @@ void rtl8723b_set_hal_ops(struct hal_ops *pHalFunc) void rtl8723b_InitAntenna_Selection(struct adapter *padapter) { - struct hal_com_data *pHalData; u8 val; - - pHalData = GET_HAL_DATA(padapter); - val = rtw_read8(padapter, REG_LEDCFG2); /* Let 8051 take control antenna settting */ val |= BIT(7); /* DPDT_SEL_EN, 0x4C[23] */ @@ -3053,7 +3049,6 @@ static void rtl8723b_fill_default_txdesc( { struct adapter *padapter; struct hal_com_data *pHalData; - struct dm_priv *pdmpriv; struct mlme_ext_priv *pmlmeext; struct mlme_ext_info *pmlmeinfo; struct pkt_attrib *pattrib; @@ -3064,7 +3059,6 @@ static void rtl8723b_fill_default_txdesc( padapter = pxmitframe->padapter; pHalData = GET_HAL_DATA(padapter); - pdmpriv = &pHalData->dmpriv; pmlmeext = &padapter->mlmeextpriv; pmlmeinfo = &(pmlmeext->mlmext_info); @@ -3773,7 +3767,6 @@ void C2HPacketHandler_8723B(struct adapter *padapter, u8 *pbuffer, u16 length) process_c2h_event(padapter, &C2hEvent, tmpBuf); /* c2h_handler_8723b(padapter,&C2hEvent); */ - return; } void SetHwReg8723B(struct adapter *padapter, u8 variable, u8 *val) @@ -4157,9 +4150,8 @@ void SetHwReg8723B(struct adapter *padapter, u8 variable, u8 *val) break; } - /* The value of ((usNavUpper + HAL_NAV_UPPER_UNIT_8723B - 1) / HAL_NAV_UPPER_UNIT_8723B) */ - /* is getting the upper integer. */ - usNavUpper = (usNavUpper + HAL_NAV_UPPER_UNIT_8723B - 1) / HAL_NAV_UPPER_UNIT_8723B; + usNavUpper = DIV_ROUND_UP(usNavUpper, + HAL_NAV_UPPER_UNIT_8723B); rtw_write8(padapter, REG_NAV_UPPER, (u8)usNavUpper); } break; diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c index 6df2b58bdc67..cf23414d7224 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c @@ -362,24 +362,10 @@ void PHY_SetRFReg_8723B( */ s32 PHY_MACConfig8723B(struct adapter *Adapter) { - int rtStatus = _SUCCESS; struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - s8 *pszMACRegFile; - s8 sz8723MACRegFile[] = RTL8723B_PHY_MACREG; - - - pszMACRegFile = sz8723MACRegFile; - - /* */ - /* Config MAC */ - /* */ - rtStatus = phy_ConfigMACWithParaFile(Adapter, pszMACRegFile); - if (rtStatus == _FAIL) { - ODM_ReadAndConfig_MP_8723B_MAC_REG(&pHalData->odmpriv); - rtStatus = _SUCCESS; - } - return rtStatus; + ODM_ReadAndConfig_MP_8723B_MAC_REG(&pHalData->odmpriv); + return _SUCCESS; } /** @@ -427,17 +413,6 @@ static void phy_InitBBRFRegisterDefinition(struct adapter *Adapter) static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter) { struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - int rtStatus = _SUCCESS; - u8 sz8723BBRegFile[] = RTL8723B_PHY_REG; - u8 sz8723AGCTableFile[] = RTL8723B_AGC_TAB; - u8 sz8723BBBRegPgFile[] = RTL8723B_PHY_REG_PG; - u8 sz8723BRFTxPwrLmtFile[] = RTL8723B_TXPWR_LMT; - u8 *pszBBRegFile = NULL, *pszAGCTableFile = NULL, *pszBBRegPgFile = NULL, *pszRFTxPwrLmtFile = NULL; - - pszBBRegFile = sz8723BBRegFile; - pszAGCTableFile = sz8723AGCTableFile; - pszBBRegPgFile = sz8723BBBRegPgFile; - pszRFTxPwrLmtFile = sz8723BRFTxPwrLmtFile; /* Read Tx Power Limit File */ PHY_InitTxPowerLimit(Adapter); @@ -445,30 +420,14 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter) Adapter->registrypriv.RegEnableTxPowerLimit == 1 || (Adapter->registrypriv.RegEnableTxPowerLimit == 2 && pHalData->EEPROMRegulatory == 1) ) { - if (PHY_ConfigRFWithPowerLimitTableParaFile(Adapter, pszRFTxPwrLmtFile) == _FAIL) { - if (HAL_STATUS_SUCCESS != ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_TXPWR_LMT, (ODM_RF_RADIO_PATH_E)0)) - rtStatus = _FAIL; - } - - if (rtStatus != _SUCCESS) { - DBG_871X("%s():Read Tx power limit fail\n", __func__); - goto phy_BB8190_Config_ParaFile_Fail; - } + ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, + CONFIG_RF_TXPWR_LMT, 0); } /* */ /* 1. Read PHY_REG.TXT BB INIT!! */ /* */ - if (phy_ConfigBBWithParaFile(Adapter, pszBBRegFile, CONFIG_BB_PHY_REG) == - _FAIL) { - if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG)) - rtStatus = _FAIL; - } - - if (rtStatus != _SUCCESS) { - DBG_8192C("%s():Write BB Reg Fail!!", __func__); - goto phy_BB8190_Config_ParaFile_Fail; - } + ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG); /* If EEPROM or EFUSE autoload OK, We must config by PHY_REG_PG.txt */ PHY_InitTxPowerByRate(Adapter); @@ -476,11 +435,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter) Adapter->registrypriv.RegEnableTxPowerByRate == 1 || (Adapter->registrypriv.RegEnableTxPowerByRate == 2 && pHalData->EEPROMRegulatory != 2) ) { - if (phy_ConfigBBWithPgParaFile(Adapter, pszBBRegPgFile) == - _FAIL) { - if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG_PG)) - rtStatus = _FAIL; - } + ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, + CONFIG_BB_PHY_REG_PG); if (pHalData->odmpriv.PhyRegPgValueType == PHY_REG_PG_EXACT_VALUE) PHY_TxPowerByRateConfiguration(Adapter); @@ -490,29 +446,14 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter) (Adapter->registrypriv.RegEnableTxPowerLimit == 2 && pHalData->EEPROMRegulatory == 1) ) PHY_ConvertTxPowerLimitToPowerIndex(Adapter); - - if (rtStatus != _SUCCESS) { - DBG_8192C("%s():BB_PG Reg Fail!!\n", __func__); - } } /* */ /* 2. Read BB AGC table Initialization */ /* */ - if (phy_ConfigBBWithParaFile(Adapter, pszAGCTableFile, - CONFIG_BB_AGC_TAB) == _FAIL) { - if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_AGC_TAB)) - rtStatus = _FAIL; - } - - if (rtStatus != _SUCCESS) { - DBG_8192C("%s():AGC Table Fail\n", __func__); - goto phy_BB8190_Config_ParaFile_Fail; - } - -phy_BB8190_Config_ParaFile_Fail: + ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_AGC_TAB); - return rtStatus; + return _SUCCESS; } diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c b/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c index d0ffe0af5339..aafceaf9b139 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c @@ -85,19 +85,8 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter) u32 u4RegValue = 0; u8 eRFPath; struct bb_register_def *pPhyReg; - - int rtStatus = _SUCCESS; struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - static char sz8723RadioAFile[] = RTL8723B_PHY_RADIO_A; - static char sz8723RadioBFile[] = RTL8723B_PHY_RADIO_B; - static s8 sz8723BTxPwrTrackFile[] = RTL8723B_TXPWR_TRACK; - char *pszRadioAFile, *pszRadioBFile, *pszTxPwrTrackFile; - - pszRadioAFile = sz8723RadioAFile; - pszRadioBFile = sz8723RadioBFile; - pszTxPwrTrackFile = sz8723BTxPwrTrackFile; - /* 3----------------------------------------------------------------- */ /* 3 <2> Initialize RF */ /* 3----------------------------------------------------------------- */ @@ -136,21 +125,11 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter) /*----Initialize RF fom connfiguration file----*/ switch (eRFPath) { case RF_PATH_A: - if (PHY_ConfigRFWithParaFile(Adapter, pszRadioAFile, - eRFPath) == _FAIL) { - if (HAL_STATUS_FAILURE == ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_RADIO, (ODM_RF_RADIO_PATH_E)eRFPath)) - rtStatus = _FAIL; - } - break; case RF_PATH_B: - if (PHY_ConfigRFWithParaFile(Adapter, pszRadioBFile, - eRFPath) == _FAIL) { - if (HAL_STATUS_FAILURE == ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_RADIO, (ODM_RF_RADIO_PATH_E)eRFPath)) - rtStatus = _FAIL; - } + ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, + CONFIG_RF_RADIO, eRFPath); break; case RF_PATH_C: - break; case RF_PATH_D: break; } @@ -166,28 +145,16 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter) PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV << 16, u4RegValue); break; } - - if (rtStatus != _SUCCESS) { - /* RT_TRACE(COMP_FPGA, DBG_LOUD, ("phy_RF6052_Config_ParaFile():Radio[%d] Fail!!", eRFPath)); */ - goto phy_RF6052_Config_ParaFile_Fail; - } - } /* 3 ----------------------------------------------------------------- */ /* 3 Configuration of Tx Power Tracking */ /* 3 ----------------------------------------------------------------- */ - if (PHY_ConfigRFWithTxPwrTrackParaFile(Adapter, pszTxPwrTrackFile) == - _FAIL) { - ODM_ConfigRFWithTxPwrTrackHeaderFile(&pHalData->odmpriv); - } + ODM_ConfigRFWithTxPwrTrackHeaderFile(&pHalData->odmpriv); /* RT_TRACE(COMP_INIT, DBG_LOUD, ("<---phy_RF6052_Config_ParaFile()\n")); */ - return rtStatus; - -phy_RF6052_Config_ParaFile_Fail: - return rtStatus; + return _SUCCESS; } diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c index 0f3301091258..1e8b61443408 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c @@ -179,8 +179,6 @@ static void rtl8723bs_c2h_packet_handler(struct adapter *padapter, kfree(tmp); /* DBG_871X("-%s res(%d)\n", __func__, res); */ - - return; } static inline union recv_frame *try_alloc_recvframe(struct recv_priv *precvpriv, @@ -232,7 +230,7 @@ static inline bool pkt_exceeds_tail(struct recv_priv *precvpriv, return false; } -static void rtl8723bs_recv_tasklet(void *priv) +static void rtl8723bs_recv_tasklet(unsigned long priv) { struct adapter *padapter; struct hal_com_data *p_hal_data; @@ -246,7 +244,7 @@ static void rtl8723bs_recv_tasklet(void *priv) _pkt *pkt_copy = NULL; u8 shift_sz = 0, rx_report_sz = 0; - padapter = priv; + padapter = (struct adapter *)priv; p_hal_data = GET_HAL_DATA(padapter); precvpriv = &padapter->recvpriv; recv_buf_queue = &precvpriv->recv_buf_pending_queue; @@ -464,11 +462,8 @@ s32 rtl8723bs_init_recv_priv(struct adapter *padapter) goto initbuferror; /* 3 2. init tasklet */ - tasklet_init( - &precvpriv->recv_tasklet, - (void(*)(unsigned long))rtl8723bs_recv_tasklet, - (unsigned long)padapter - ); + tasklet_init(&precvpriv->recv_tasklet, rtl8723bs_recv_tasklet, + (unsigned long)padapter); goto exit; diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c index 0f5dd4629e6f..e813382e78a6 100644 --- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c +++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c @@ -570,14 +570,11 @@ static void HalRxAggr8723BSdio(struct adapter *padapter) static void sdio_AggSettingRxUpdate(struct adapter *padapter) { - struct hal_com_data *pHalData; u8 valueDMA; u8 valueRxAggCtrl = 0; u8 aggBurstNum = 3; /* 0:1, 1:2, 2:3, 3:4 */ u8 aggBurstSize = 0; /* 0:1K, 1:512Byte, 2:256Byte... */ - pHalData = GET_HAL_DATA(padapter); - valueDMA = rtw_read8(padapter, REG_TRXDMA_CTRL); valueDMA |= RXDMA_AGG_EN; rtw_write8(padapter, REG_TRXDMA_CTRL, valueDMA); @@ -713,13 +710,11 @@ static u32 rtl8723bs_hal_init(struct adapter *padapter) s32 ret; struct hal_com_data *pHalData; struct pwrctrl_priv *pwrctrlpriv; - struct registry_priv *pregistrypriv; u32 NavUpper = WiFiNavUpperUs; u8 u1bTmp; pHalData = GET_HAL_DATA(padapter); pwrctrlpriv = adapter_to_pwrctl(padapter); - pregistrypriv = &padapter->registrypriv; if ( adapter_to_pwrctl(padapter)->bips_processing == true && diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c index 301d327d0624..b6b4adb5a28a 100644 --- a/drivers/staging/rtl8723bs/hal/sdio_ops.c +++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c @@ -15,7 +15,7 @@ /* */ /* Description: */ -/* The following mapping is for SDIO host local register space. */ +/* The following mapping is for SDIO host local register space. */ /* */ /* Creadted by Roger, 2011.01.31. */ /* */ @@ -61,7 +61,6 @@ static u8 get_deviceid(u32 addr) u8 devide_id; u16 pseudo_id; - pseudo_id = (u16)(addr >> 16); switch (pseudo_id) { case 0x1025: @@ -72,10 +71,6 @@ static u8 get_deviceid(u32 addr) devide_id = WLAN_IOREG_DEVICE_ID; break; -/* case 0x1027: */ -/* devide_id = SDIO_FIRMWARE_FIFO; */ -/* break; */ - case 0x1031: devide_id = WLAN_TX_HIQ_DEVICE_ID; break; @@ -93,7 +88,6 @@ static u8 get_deviceid(u32 addr) break; default: -/* devide_id = (u8)((addr >> 13) & 0xF); */ devide_id = WLAN_IOREG_DEVICE_ID; break; } @@ -111,7 +105,6 @@ static u32 _cvrt2ftaddr(const u32 addr, u8 *pdevice_id, u16 *poffset) u16 offset; u32 ftaddr; - device_id = get_deviceid(addr); offset = 0; @@ -427,20 +420,16 @@ static u32 sdio_read_port( struct adapter *adapter; struct sdio_data *psdio; struct hal_com_data *hal; - u32 oldcnt; s32 err; - adapter = intfhdl->padapter; psdio = &adapter_to_dvobj(adapter)->intf_data; hal = GET_HAL_DATA(adapter); HalSdioGetCmdAddr8723BSdio(adapter, addr, hal->SdioRxFIFOCnt++, &addr); - oldcnt = cnt; if (cnt > psdio->block_transfer_len) cnt = _RND(cnt, psdio->block_transfer_len); -/* cnt = sdio_align_size(cnt); */ err = _sd_read(intfhdl, addr, cnt, mem); @@ -490,7 +479,6 @@ static u32 sdio_write_port( if (cnt > psdio->block_transfer_len) cnt = _RND(cnt, psdio->block_transfer_len); -/* cnt = sdio_align_size(cnt); */ err = sd_write(intfhdl, addr, cnt, xmitbuf->pdata); @@ -538,7 +526,6 @@ static s32 _sdio_local_read( u8 *tmpbuf; u32 n; - intfhdl = &adapter->iopriv.intf; HalSdioGetCmdAddr8723BSdio(adapter, SDIO_LOCAL_DEVICE_ID, addr, &addr); @@ -711,7 +698,6 @@ static s32 ReadInterrupt8723BSdio(struct adapter *adapter, u32 *phisr) u32 hisr, himr; u8 val8, hisr_len; - if (!phisr) return false; @@ -737,73 +723,48 @@ static s32 ReadInterrupt8723BSdio(struct adapter *adapter, u32 *phisr) } /* */ -/* Description: */ -/* Initialize SDIO Host Interrupt Mask configuration variables for future use. */ +/* Description: */ +/* Initialize SDIO Host Interrupt Mask configuration variables for future use. */ /* */ -/* Assumption: */ -/* Using SDIO Local register ONLY for configuration. */ +/* Assumption: */ +/* Using SDIO Local register ONLY for configuration. */ /* */ -/* Created by Roger, 2011.02.11. */ +/* Created by Roger, 2011.02.11. */ /* */ void InitInterrupt8723BSdio(struct adapter *adapter) { struct hal_com_data *haldata; - haldata = GET_HAL_DATA(adapter); - haldata->sdio_himr = (u32)( \ - SDIO_HIMR_RX_REQUEST_MSK | - SDIO_HIMR_AVAL_MSK | -/* SDIO_HIMR_TXERR_MSK | */ -/* SDIO_HIMR_RXERR_MSK | */ -/* SDIO_HIMR_TXFOVW_MSK | */ -/* SDIO_HIMR_RXFOVW_MSK | */ -/* SDIO_HIMR_TXBCNOK_MSK | */ -/* SDIO_HIMR_TXBCNERR_MSK | */ -/* SDIO_HIMR_BCNERLY_INT_MSK | */ -/* SDIO_HIMR_C2HCMD_MSK | */ -/* SDIO_HIMR_HSISR_IND_MSK | */ -/* SDIO_HIMR_GTINT3_IND_MSK | */ -/* SDIO_HIMR_GTINT4_IND_MSK | */ -/* SDIO_HIMR_PSTIMEOUT_MSK | */ -/* SDIO_HIMR_OCPINT_MSK | */ -/* SDIO_HIMR_ATIMEND_MSK | */ -/* SDIO_HIMR_ATIMEND_E_MSK | */ -/* SDIO_HIMR_CTWEND_MSK | */ - 0); + haldata->sdio_himr = (u32)(SDIO_HIMR_RX_REQUEST_MSK | + SDIO_HIMR_AVAL_MSK | + 0); } /* */ -/* Description: */ -/* Initialize System Host Interrupt Mask configuration variables for future use. */ +/* Description: */ +/* Initialize System Host Interrupt Mask configuration variables for future use. */ /* */ -/* Created by Roger, 2011.08.03. */ +/* Created by Roger, 2011.08.03. */ /* */ void InitSysInterrupt8723BSdio(struct adapter *adapter) { struct hal_com_data *haldata; - haldata = GET_HAL_DATA(adapter); - haldata->SysIntrMask = ( \ -/* HSIMR_GPIO12_0_INT_EN | */ -/* HSIMR_SPS_OCP_INT_EN | */ -/* HSIMR_RON_INT_EN | */ -/* HSIMR_PDNINT_EN | */ -/* HSIMR_GPIO9_INT_EN | */ - 0); + haldata->SysIntrMask = (0); } /* */ -/* Description: */ -/* Enalbe SDIO Host Interrupt Mask configuration on SDIO local domain. */ +/* Description: */ +/* Enalbe SDIO Host Interrupt Mask configuration on SDIO local domain. */ /* */ -/* Assumption: */ -/* 1. Using SDIO Local register ONLY for configuration. */ -/* 2. PASSIVE LEVEL */ +/* Assumption: */ +/* 1. Using SDIO Local register ONLY for configuration. */ +/* 2. PASSIVE LEVEL */ /* */ -/* Created by Roger, 2011.02.11. */ +/* Created by Roger, 2011.02.11. */ /* */ void EnableInterrupt8723BSdio(struct adapter *adapter) { @@ -849,13 +810,13 @@ void EnableInterrupt8723BSdio(struct adapter *adapter) } /* */ -/* Description: */ -/* Disable SDIO Host IMR configuration to mask unnecessary interrupt service. */ +/* Description: */ +/* Disable SDIO Host IMR configuration to mask unnecessary interrupt service. */ /* */ -/* Assumption: */ -/* Using SDIO Local register ONLY for configuration. */ +/* Assumption: */ +/* Using SDIO Local register ONLY for configuration. */ /* */ -/* Created by Roger, 2011.02.11. */ +/* Created by Roger, 2011.02.11. */ /* */ void DisableInterrupt8723BSdio(struct adapter *adapter) { @@ -866,13 +827,13 @@ void DisableInterrupt8723BSdio(struct adapter *adapter) } /* */ -/* Description: */ -/* Using 0x100 to check the power status of FW. */ +/* Description: */ +/* Using 0x100 to check the power status of FW. */ /* */ -/* Assumption: */ -/* Using SDIO Local register ONLY for configuration. */ +/* Assumption: */ +/* Using SDIO Local register ONLY for configuration. */ /* */ -/* Created by Isaac, 2013.09.10. */ +/* Created by Isaac, 2013.09.10. */ /* */ u8 CheckIPSStatus(struct adapter *adapter) { @@ -896,7 +857,6 @@ static struct recv_buf *sd_recv_rxfifo(struct adapter *adapter, u32 size) struct recv_priv *recv_priv; struct recv_buf *recvbuf; - /* Patch for some SDIO Host 4 bytes issue */ /* ex. RK3188 */ readsize = RND4(size); @@ -938,7 +898,6 @@ static struct recv_buf *sd_recv_rxfifo(struct adapter *adapter, u32 size) return NULL; } - /* 3 4. init recvbuf */ recvbuf->len = size; recvbuf->phead = recvbuf->pskb->head; @@ -972,7 +931,6 @@ void sd_int_dpc(struct adapter *adapter) struct intf_hdl *intfhdl = &adapter->iopriv.intf; struct pwrctrl_priv *pwrctl; - hal = GET_HAL_DATA(adapter); dvobj = adapter_to_dvobj(adapter); pwrctl = dvobj_to_pwrctl(dvobj); @@ -992,7 +950,6 @@ void sd_int_dpc(struct adapter *adapter) report.state = SdioLocalCmd52Read1Byte(adapter, SDIO_REG_HCPWM1_8723B); - /* cpwm_int_hdl(adapter, &report); */ _set_workitem(&(pwrctl->cpwm_event)); } @@ -1029,7 +986,7 @@ void sd_int_dpc(struct adapter *adapter) if (c2h_id_filter_ccx_8723b((u8 *)c2h_evt)) { /* Handle CCX report here */ rtw_hal_c2h_handler(adapter, (u8 *)c2h_evt); - kfree((u8 *)c2h_evt); + kfree(c2h_evt); } else { rtw_c2h_wk_cmd(adapter, (u8 *)c2h_evt); } @@ -1049,13 +1006,11 @@ void sd_int_dpc(struct adapter *adapter) if (hal->sdio_hisr & SDIO_HISR_RXERR) DBG_8192C("%s: Rx Error\n", __func__); - if (hal->sdio_hisr & SDIO_HISR_RX_REQUEST) { struct recv_buf *recvbuf; int alloc_fail_time = 0; u32 hisr; -/* DBG_8192C("%s: RX Request, size =%d\n", __func__, hal->SdioRxFIFOSize); */ hal->sdio_hisr ^= SDIO_HISR_RX_REQUEST; do { hal->SdioRxFIFOSize = SdioLocalCmd52Read2Byte(adapter, SDIO_REG_RX0_REQ_LEN); @@ -1090,7 +1045,6 @@ void sd_int_hdl(struct adapter *adapter) { struct hal_com_data *hal; - if ( (adapter->bDriverStopped) || (adapter->bSurpriseRemoved) ) @@ -1120,27 +1074,24 @@ void sd_int_hdl(struct adapter *adapter) } /* */ -/* Description: */ -/* Query SDIO Local register to query current the number of Free TxPacketBuffer page. */ +/* Description: */ +/* Query SDIO Local register to query current the number of Free TxPacketBuffer page. */ /* */ -/* Assumption: */ -/* 1. Running at PASSIVE_LEVEL */ -/* 2. RT_TX_SPINLOCK is NOT acquired. */ +/* Assumption: */ +/* 1. Running at PASSIVE_LEVEL */ +/* 2. RT_TX_SPINLOCK is NOT acquired. */ /* */ -/* Created by Roger, 2011.01.28. */ +/* Created by Roger, 2011.01.28. */ /* */ u8 HalQueryTxBufferStatus8723BSdio(struct adapter *adapter) { struct hal_com_data *hal; u32 numof_free_page; - /* _irql irql; */ - hal = GET_HAL_DATA(adapter); numof_free_page = SdioLocalCmd53Read4Byte(adapter, SDIO_REG_FREE_TXPG); - /* spin_lock_bh(&phal->SdioTxFIFOFreePageLock); */ memcpy(hal->SdioTxFIFOFreePage, &numof_free_page, 4); RT_TRACE(_module_hci_ops_c_, _drv_notice_, ("%s: Free page for HIQ(%#x), MIDQ(%#x), LOWQ(%#x), PUBQ(%#x)\n", @@ -1149,14 +1100,13 @@ u8 HalQueryTxBufferStatus8723BSdio(struct adapter *adapter) hal->SdioTxFIFOFreePage[MID_QUEUE_IDX], hal->SdioTxFIFOFreePage[LOW_QUEUE_IDX], hal->SdioTxFIFOFreePage[PUBLIC_QUEUE_IDX])); - /* spin_unlock_bh(&hal->SdioTxFIFOFreePageLock); */ return true; } /* */ -/* Description: */ -/* Query SDIO Local register to get the current number of TX OQT Free Space. */ +/* Description: */ +/* Query SDIO Local register to get the current number of TX OQT Free Space. */ /* */ void HalQueryTxOQTBufferStatus8723BSdio(struct adapter *adapter) { @@ -1190,7 +1140,6 @@ u8 RecvOnePkt(struct adapter *adapter, u32 size) recvbuf = sd_recv_rxfifo(adapter, size); if (recvbuf) { - /* printk("Completed Recv One Pkt.\n"); */ sd_rxhandler(adapter, recvbuf); res = true; } else { |