mirror of
https://github.com/openharmony/device_board_unionman.git
synced 2026-07-01 04:19:15 -04:00
fix: clean up rtl88x2cs hal driver
Signed-off-by: AlgoIdeas <minjie.yu@unionman.com.cn>
This commit is contained in:
@@ -339,13 +339,6 @@ void halbtcoutsrc_NormalLps(PBTC_COEXIST pBtCoexist)
|
||||
rtw_btcoex_LPS_Leave(padapter);
|
||||
pBtCoexist->bt_info.bt_ctrl_lps = _FALSE;
|
||||
|
||||
/* recover the LPS state to the original */
|
||||
#if 0
|
||||
padapter->hal_func.UpdateLPSStatusHandler(
|
||||
padapter,
|
||||
pPSC->RegLeisurePsMode,
|
||||
pPSC->RegPowerSaveMode);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1156,13 +1149,9 @@ u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf)
|
||||
break;
|
||||
|
||||
case BTC_GET_BL_WIFI_SCAN:
|
||||
#if 0
|
||||
*pu8 = (rtw_mi_check_fwstate(padapter, WIFI_UNDER_SURVEY)) ? _TRUE : _FALSE;
|
||||
#else
|
||||
/* Use the value of the new variable GLBtcWiFiInScanState to judge whether WiFi is in scan state or not, since the originally used flag
|
||||
WIFI_UNDER_SURVEY in fwstate may not be cleared in time */
|
||||
*pu8 = GLBtcWiFiInScanState;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case BTC_GET_BL_WIFI_LINK:
|
||||
@@ -1519,11 +1508,7 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf)
|
||||
|
||||
/* the following are some action which will be triggered */
|
||||
case BTC_SET_ACT_GET_BT_RSSI:
|
||||
#if 0
|
||||
BT_SendGetBtRssiEvent(padapter);
|
||||
#else
|
||||
ret = _FALSE;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case BTC_SET_ACT_AGGREGATE_CTRL:
|
||||
@@ -1631,17 +1616,7 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf)
|
||||
#endif /* CONFIG_BT_COEXIST_SOCKET_TRX */
|
||||
break;
|
||||
case BTC_SET_ACT_CTRL_8723B_ANT:
|
||||
#if 0
|
||||
{
|
||||
u8 dataLen = *pU1Tmp;
|
||||
u8 tmpBuf[BTC_TMP_BUF_SHORT];
|
||||
if (dataLen)
|
||||
PlatformMoveMemory(&tmpBuf[0], pU1Tmp + 1, dataLen);
|
||||
BT_Set8723bAnt(Adapter, dataLen, &tmpBuf[0]);
|
||||
}
|
||||
#else
|
||||
ret = _FALSE;
|
||||
#endif
|
||||
break;
|
||||
case BTC_SET_BL_BT_LNA_CONSTRAIN_LEVEL:
|
||||
halbtcoutsrc_LnaConstrainLvl(pBtCoexist, pu8);
|
||||
@@ -1727,156 +1702,6 @@ u8 halbtcoutsrc_Under32K(PBTC_COEXIST pBtCoexist)
|
||||
|
||||
void halbtcoutsrc_DisplayCoexStatistics(PBTC_COEXIST pBtCoexist)
|
||||
{
|
||||
#if 0
|
||||
PADAPTER padapter = (PADAPTER)pBtCoexist->Adapter;
|
||||
PBT_MGNT pBtMgnt = &padapter->MgntInfo.BtInfo.BtMgnt;
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter);
|
||||
u8 *cliBuf = pBtCoexist->cliBuf;
|
||||
u8 i, j;
|
||||
u8 tmpbuf[BTC_TMP_BUF_SHORT];
|
||||
|
||||
|
||||
if (gl_coex_offload.cnt_h2c_sent) {
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Coex h2c notify]============");
|
||||
CL_PRINTF(cliBuf);
|
||||
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = H2c(%d)/Ack(%d)", "Coex h2c/c2h overall statistics",
|
||||
gl_coex_offload.cnt_h2c_sent, gl_coex_offload.cnt_c2h_ack);
|
||||
for (j = 0; j < COL_STATUS_MAX; j++) {
|
||||
if (gl_coex_offload.status[j]) {
|
||||
CL_SPRINTF(tmpbuf, BTC_TMP_BUF_SHORT, ", %s:%d", coexH2cResultString[j], gl_coex_offload.status[j]);
|
||||
CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, tmpbuf, BTC_TMP_BUF_SHORT);
|
||||
}
|
||||
}
|
||||
CL_PRINTF(cliBuf);
|
||||
}
|
||||
for (i = 0; i < COL_OP_WIFI_OPCODE_MAX; i++) {
|
||||
if (gl_coex_offload.h2c_record[i].count) {
|
||||
/*==========================================*/
|
||||
/* H2C result statistics*/
|
||||
/*==========================================*/
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = total:%d", coexOpcodeString[i], gl_coex_offload.h2c_record[i].count);
|
||||
for (j = 0; j < COL_STATUS_MAX; j++) {
|
||||
if (gl_coex_offload.h2c_record[i].status[j]) {
|
||||
CL_SPRINTF(tmpbuf, BTC_TMP_BUF_SHORT, ", %s:%d", coexH2cResultString[j], gl_coex_offload.h2c_record[i].status[j]);
|
||||
CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, tmpbuf, BTC_TMP_BUF_SHORT);
|
||||
}
|
||||
}
|
||||
CL_PRINTF(cliBuf);
|
||||
/*==========================================*/
|
||||
/* H2C/C2H content*/
|
||||
/*==========================================*/
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = ", "H2C / C2H content");
|
||||
for (j = 0; j < gl_coex_offload.h2c_record[i].h2c_len; j++) {
|
||||
CL_SPRINTF(tmpbuf, BTC_TMP_BUF_SHORT, "%02x ", gl_coex_offload.h2c_record[i].h2c_buf[j]);
|
||||
CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, tmpbuf, 3);
|
||||
}
|
||||
if (gl_coex_offload.h2c_record[i].c2h_ack_len) {
|
||||
CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, "/ ", 2);
|
||||
for (j = 0; j < gl_coex_offload.h2c_record[i].c2h_ack_len; j++) {
|
||||
CL_SPRINTF(tmpbuf, BTC_TMP_BUF_SHORT, "%02x ", gl_coex_offload.h2c_record[i].c2h_ack_buf[j]);
|
||||
CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, tmpbuf, 3);
|
||||
}
|
||||
}
|
||||
CL_PRINTF(cliBuf);
|
||||
/*==========================================*/
|
||||
}
|
||||
}
|
||||
|
||||
if (gl_coex_offload.cnt_c2h_ind) {
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Coex c2h indication]============");
|
||||
CL_PRINTF(cliBuf);
|
||||
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = Ind(%d)", "C2H indication statistics",
|
||||
gl_coex_offload.cnt_c2h_ind);
|
||||
for (j = 0; j < COL_STATUS_MAX; j++) {
|
||||
if (gl_coex_offload.c2h_ind_status[j]) {
|
||||
CL_SPRINTF(tmpbuf, BTC_TMP_BUF_SHORT, ", %s:%d", coexH2cResultString[j], gl_coex_offload.c2h_ind_status[j]);
|
||||
CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, tmpbuf, BTC_TMP_BUF_SHORT);
|
||||
}
|
||||
}
|
||||
CL_PRINTF(cliBuf);
|
||||
}
|
||||
for (i = 0; i < COL_IND_MAX; i++) {
|
||||
if (gl_coex_offload.c2h_ind_record[i].count) {
|
||||
/*==========================================*/
|
||||
/* H2C result statistics*/
|
||||
/*==========================================*/
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = total:%d", coexIndTypeString[i], gl_coex_offload.c2h_ind_record[i].count);
|
||||
for (j = 0; j < COL_STATUS_MAX; j++) {
|
||||
if (gl_coex_offload.c2h_ind_record[i].status[j]) {
|
||||
CL_SPRINTF(tmpbuf, BTC_TMP_BUF_SHORT, ", %s:%d", coexH2cResultString[j], gl_coex_offload.c2h_ind_record[i].status[j]);
|
||||
CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, tmpbuf, BTC_TMP_BUF_SHORT);
|
||||
}
|
||||
}
|
||||
CL_PRINTF(cliBuf);
|
||||
/*==========================================*/
|
||||
/* content*/
|
||||
/*==========================================*/
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = ", "C2H indication content");
|
||||
for (j = 0; j < gl_coex_offload.c2h_ind_record[i].ind_len; j++) {
|
||||
CL_SPRINTF(tmpbuf, BTC_TMP_BUF_SHORT, "%02x ", gl_coex_offload.c2h_ind_record[i].ind_buf[j]);
|
||||
CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, tmpbuf, 3);
|
||||
}
|
||||
CL_PRINTF(cliBuf);
|
||||
/*==========================================*/
|
||||
}
|
||||
}
|
||||
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Statistics]============");
|
||||
CL_PRINTF(cliBuf);
|
||||
|
||||
#if (H2C_USE_IO_THREAD != 1)
|
||||
for (i = 0; i < H2C_STATUS_MAX; i++) {
|
||||
if (pHalData->h2cStatistics[i]) {
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s] = %d", "H2C statistics", \
|
||||
h2cStaString[i], pHalData->h2cStatistics[i]);
|
||||
CL_PRINTF(cliBuf);
|
||||
}
|
||||
}
|
||||
#else
|
||||
for (i = 0; i < IO_STATUS_MAX; i++) {
|
||||
if (Adapter->ioComStr.ioH2cStatistics[i]) {
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s] = %d", "H2C statistics", \
|
||||
ioStaString[i], Adapter->ioComStr.ioH2cStatistics[i]);
|
||||
CL_PRINTF(cliBuf);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if 0
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x", "lastHMEBoxNum", \
|
||||
pHalData->LastHMEBoxNum);
|
||||
CL_PRINTF(cliBuf);
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x / 0x%x", "LastOkH2c/FirstFailH2c(fwNotRead)", \
|
||||
pHalData->lastSuccessH2cEid, pHalData->firstFailedH2cEid);
|
||||
CL_PRINTF(cliBuf);
|
||||
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d/ %d", "c2hIsr/c2hIntr/clr1AF/noRdy/noBuf", \
|
||||
pHalData->InterruptLog.nIMR_C2HCMD, DBG_Var.c2hInterruptCnt, DBG_Var.c2hClrReadC2hCnt,
|
||||
DBG_Var.c2hNotReadyCnt, DBG_Var.c2hBufAlloFailCnt);
|
||||
CL_PRINTF(cliBuf);
|
||||
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "c2hPacket", \
|
||||
DBG_Var.c2hPacketCnt);
|
||||
CL_PRINTF(cliBuf);
|
||||
#endif
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Periodical/ DbgCtrl", \
|
||||
pBtCoexist->statistics.cntPeriodical, pBtCoexist->statistics.cntDbgCtrl);
|
||||
CL_PRINTF(cliBuf);
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d", "PowerOn/InitHw/InitCoexDm/RfStatus", \
|
||||
pBtCoexist->statistics.cntPowerOn, pBtCoexist->statistics.cntInitHwConfig, pBtCoexist->statistics.cntInitCoexDm,
|
||||
pBtCoexist->statistics.cntRfStatusNotify);
|
||||
CL_PRINTF(cliBuf);
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d/ %d", "Ips/Lps/Scan/Connect/Mstatus", \
|
||||
pBtCoexist->statistics.cntIpsNotify, pBtCoexist->statistics.cntLpsNotify,
|
||||
pBtCoexist->statistics.cntScanNotify, pBtCoexist->statistics.cntConnectNotify,
|
||||
pBtCoexist->statistics.cntMediaStatusNotify);
|
||||
CL_PRINTF(cliBuf);
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d", "Special pkt/Bt info/ bind",
|
||||
pBtCoexist->statistics.cntSpecialPacketNotify, pBtCoexist->statistics.cntBtInfoNotify,
|
||||
pBtCoexist->statistics.cntBind);
|
||||
CL_PRINTF(cliBuf);
|
||||
#endif
|
||||
PADAPTER padapter = pBtCoexist->Adapter;
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter);
|
||||
u8 *cliBuf = pBtCoexist->cli_buf;
|
||||
@@ -1893,30 +1718,6 @@ void halbtcoutsrc_DisplayCoexStatistics(PBTC_COEXIST pBtCoexist)
|
||||
|
||||
void halbtcoutsrc_DisplayBtLinkInfo(PBTC_COEXIST pBtCoexist)
|
||||
{
|
||||
#if 0
|
||||
PADAPTER padapter = (PADAPTER)pBtCoexist->Adapter;
|
||||
PBT_MGNT pBtMgnt = &padapter->MgntInfo.BtInfo.BtMgnt;
|
||||
u8 *cliBuf = pBtCoexist->cliBuf;
|
||||
u8 i;
|
||||
|
||||
|
||||
if (pBtCoexist->stack_info.profile_notified) {
|
||||
for (i = 0; i < pBtMgnt->ExtConfig.NumberOfACL; i++) {
|
||||
if (pBtMgnt->ExtConfig.HCIExtensionVer >= 1) {
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/ %s/ %s", "Bt link type/spec/role", \
|
||||
BtProfileString[pBtMgnt->ExtConfig.aclLink[i].BTProfile],
|
||||
BtSpecString[pBtMgnt->ExtConfig.aclLink[i].BTCoreSpec],
|
||||
BtLinkRoleString[pBtMgnt->ExtConfig.aclLink[i].linkRole]);
|
||||
CL_PRINTF(cliBuf);
|
||||
} else {
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/ %s", "Bt link type/spec", \
|
||||
BtProfileString[pBtMgnt->ExtConfig.aclLink[i].BTProfile],
|
||||
BtSpecString[pBtMgnt->ExtConfig.aclLink[i].BTCoreSpec]);
|
||||
CL_PRINTF(cliBuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void halbtcoutsrc_DisplayWifiStatus(PBTC_COEXIST pBtCoexist)
|
||||
@@ -2527,20 +2328,7 @@ u16 halbtcoutsrc_SetBtReg(void *pBtcContext, u8 RegType, u32 RegAddr, u32 Data)
|
||||
u8 halbtcoutsrc_SetBtAntDetection(void *pBtcContext, u8 txTime, u8 btChnl)
|
||||
{
|
||||
/* Always return _FALSE since we don't implement this yet */
|
||||
#if 0
|
||||
PBTC_COEXIST pBtCoexist = (PBTC_COEXIST)pBtcContext;
|
||||
PADAPTER Adapter = pBtCoexist->Adapter;
|
||||
u8 btCanTx = 0;
|
||||
BOOLEAN bStatus = FALSE;
|
||||
|
||||
bStatus = NDBG_SetBtAntDetection(Adapter, txTime, btChnl, &btCanTx);
|
||||
if (bStatus && btCanTx)
|
||||
return _TRUE;
|
||||
else
|
||||
return _FALSE;
|
||||
#else
|
||||
return _FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
u8 halbtcoutsrc_SetBtTRXMASK(void *pBtcContext, u8 bt_trx_mask)
|
||||
@@ -2709,18 +2497,6 @@ static COL_H2C_STATUS halbtcoutsrc_send_h2c(PADAPTER Adapter, PCOL_H2C pcol_h2c,
|
||||
INIT_COMPLETION(gl_coex_offload.c2h_event[pcol_h2c->req_num]);
|
||||
#endif
|
||||
|
||||
if (TRUE) {
|
||||
#if 0 /*(USE_HAL_MAC_API == 1) */
|
||||
if (RT_STATUS_SUCCESS == HAL_MAC_Send_BT_COEX(&GET_HAL_MAC_INFO(Adapter), (u8 *)(pcol_h2c), (u32)h2c_cmd_len, 1)) {
|
||||
if (!wait_for_completion_timeout(&gl_coex_offload.c2h_event[pcol_h2c->req_num], 20)) {
|
||||
h2c_status = COL_STATUS_H2C_TIMTOUT;
|
||||
}
|
||||
} else {
|
||||
h2c_status = COL_STATUS_H2C_HALMAC_FAIL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return h2c_status;
|
||||
}
|
||||
|
||||
@@ -2804,21 +2580,7 @@ COL_H2C_STATUS halbtcoutsrc_CoexH2cProcess(void *pBtCoexist,
|
||||
u8 halbtcoutsrc_GetAntDetValFromBt(void *pBtcContext)
|
||||
{
|
||||
/* Always return 0 since we don't implement this yet */
|
||||
#if 0
|
||||
struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext;
|
||||
PADAPTER Adapter = pBtCoexist->Adapter;
|
||||
u8 AntDetVal = 0x0;
|
||||
u8 opcodeVer = 1;
|
||||
BOOLEAN status = false;
|
||||
|
||||
status = NDBG_GetAntDetValFromBt(Adapter, opcodeVer, &AntDetVal);
|
||||
|
||||
RT_TRACE(COMP_DBG, DBG_LOUD, ("$$$ halbtcoutsrc_GetAntDetValFromBt(): status = %d, feature = %x\n", status, AntDetVal));
|
||||
|
||||
return AntDetVal;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
u8 halbtcoutsrc_GetBleScanTypeFromBt(void *pBtcContext)
|
||||
@@ -2970,9 +2732,7 @@ void halbtcoutsrc_phydm_modify_RA_PCR_threshold(void *pBtcContext, u8 RA_offset_
|
||||
struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext;
|
||||
|
||||
/* switch to #if 0 in case the phydm version does not provide the function */
|
||||
#if 1
|
||||
phydm_modify_RA_PCR_threshold(pBtCoexist->odm_priv, RA_offset_direction, RA_threshold_offset);
|
||||
#endif
|
||||
}
|
||||
|
||||
u32 halbtcoutsrc_phydm_query_PHY_counter(void *pBtcContext, u8 info_type)
|
||||
@@ -2980,11 +2740,7 @@ u32 halbtcoutsrc_phydm_query_PHY_counter(void *pBtcContext, u8 info_type)
|
||||
struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext;
|
||||
|
||||
/* switch to #if 0 in case the phydm version does not provide the function */
|
||||
#if 1
|
||||
return phydm_cmn_info_query((struct dm_struct *)pBtCoexist->odm_priv, (enum phydm_info_query)info_type);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void halbtcoutsrc_reduce_wl_tx_power(void *pBtcContext, s8 tx_power)
|
||||
@@ -2997,121 +2753,6 @@ void halbtcoutsrc_reduce_wl_tx_power(void *pBtcContext, s8 tx_power)
|
||||
rtw_hal_set_tx_power_level(pBtCoexist->Adapter, pHalData->current_channel);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void BT_CoexOffloadRecordErrC2hAck(PADAPTER Adapter)
|
||||
{
|
||||
PADAPTER pDefaultAdapter = GetDefaultAdapter(Adapter);
|
||||
|
||||
if (pDefaultAdapter != Adapter)
|
||||
return;
|
||||
|
||||
if (!hal_btcoex_IsBtExist(Adapter))
|
||||
return;
|
||||
|
||||
gl_coex_offload.cnt_c2h_ack++;
|
||||
|
||||
gl_coex_offload.status[COL_STATUS_INVALID_C2H_LEN]++;
|
||||
}
|
||||
|
||||
static void BT_CoexOffloadC2hAckCheck(PADAPTER Adapter, u8 *tmpBuf, u8 length)
|
||||
{
|
||||
PADAPTER pDefaultAdapter = GetDefaultAdapter(Adapter);
|
||||
PCOL_C2H_ACK p_c2h_ack = NULL;
|
||||
u8 req_num = 0xff;
|
||||
|
||||
if (pDefaultAdapter != Adapter)
|
||||
return;
|
||||
|
||||
if (!hal_btcoex_IsBtExist(Adapter))
|
||||
return;
|
||||
|
||||
gl_coex_offload.cnt_c2h_ack++;
|
||||
|
||||
if (length < COL_C2H_ACK_HDR_LEN) { /* c2h ack length must >= 3 (status, opcode_ver, req_num and ret_len) */
|
||||
gl_coex_offload.status[COL_STATUS_INVALID_C2H_LEN]++;
|
||||
} else {
|
||||
BT_PrintData(Adapter, "[COL], c2h ack:", length, tmpBuf);
|
||||
|
||||
p_c2h_ack = (PCOL_C2H_ACK)tmpBuf;
|
||||
req_num = p_c2h_ack->req_num;
|
||||
|
||||
_rtw_memmove(&gl_coex_offload.c2h_ack_buf[req_num][0], tmpBuf, length);
|
||||
gl_coex_offload.c2h_ack_len[req_num] = length;
|
||||
|
||||
complete(&gl_coex_offload.c2h_event[req_num]);
|
||||
}
|
||||
}
|
||||
|
||||
static void BT_CoexOffloadC2hIndCheck(PADAPTER Adapter, u8 *tmpBuf, u8 length)
|
||||
{
|
||||
PADAPTER pDefaultAdapter = GetDefaultAdapter(Adapter);
|
||||
PCOL_C2H_IND p_c2h_ind = NULL;
|
||||
u8 ind_type = 0, ind_version = 0, ind_length = 0;
|
||||
|
||||
if (pDefaultAdapter != Adapter)
|
||||
return;
|
||||
|
||||
if (!hal_btcoex_IsBtExist(Adapter))
|
||||
return;
|
||||
|
||||
gl_coex_offload.cnt_c2h_ind++;
|
||||
|
||||
if (length < COL_C2H_IND_HDR_LEN) { /* c2h indication length must >= 3 (type, version and length) */
|
||||
gl_coex_offload.c2h_ind_status[COL_STATUS_INVALID_C2H_LEN]++;
|
||||
} else {
|
||||
BT_PrintData(Adapter, "[COL], c2h indication:", length, tmpBuf);
|
||||
|
||||
p_c2h_ind = (PCOL_C2H_IND)tmpBuf;
|
||||
ind_type = p_c2h_ind->type;
|
||||
ind_version = p_c2h_ind->version;
|
||||
ind_length = p_c2h_ind->length;
|
||||
|
||||
_rtw_memmove(&gl_coex_offload.c2h_ind_buf[0], tmpBuf, length);
|
||||
gl_coex_offload.c2h_ind_len = length;
|
||||
|
||||
/* log */
|
||||
gl_coex_offload.c2h_ind_record[ind_type].count++;
|
||||
gl_coex_offload.c2h_ind_record[ind_type].status[COL_STATUS_C2H_OK]++;
|
||||
_rtw_memmove(&gl_coex_offload.c2h_ind_record[ind_type].ind_buf[0], tmpBuf, length);
|
||||
gl_coex_offload.c2h_ind_record[ind_type].ind_len = length;
|
||||
|
||||
gl_coex_offload.c2h_ind_status[COL_STATUS_C2H_OK]++;
|
||||
/*TODO: need to check c2h indication length*/
|
||||
/* TODO: Notification */
|
||||
}
|
||||
}
|
||||
|
||||
void BT_CoexOffloadC2hCheck(PADAPTER Adapter, u8 *Buffer, u8 Length)
|
||||
{
|
||||
#if 0 /*(USE_HAL_MAC_API == 1)*/
|
||||
u8 c2hSubCmdId = 0, c2hAckLen = 0, h2cCmdId = 0, h2cSubCmdId = 0, c2hIndLen = 0;
|
||||
|
||||
BT_PrintData(Adapter, "[COL], c2h packet:", Length - 2, Buffer + 2);
|
||||
c2hSubCmdId = (u8)C2H_HDR_GET_C2H_SUB_CMD_ID(Buffer);
|
||||
|
||||
if (c2hSubCmdId == C2H_SUB_CMD_ID_H2C_ACK_HDR ||
|
||||
c2hSubCmdId == C2H_SUB_CMD_ID_BT_COEX_INFO) {
|
||||
if (c2hSubCmdId == C2H_SUB_CMD_ID_H2C_ACK_HDR) {
|
||||
/* coex c2h ack */
|
||||
h2cCmdId = (u8)H2C_ACK_HDR_GET_H2C_CMD_ID(Buffer);
|
||||
h2cSubCmdId = (u8)H2C_ACK_HDR_GET_H2C_SUB_CMD_ID(Buffer);
|
||||
if (h2cCmdId == 0xff && h2cSubCmdId == 0x60) {
|
||||
c2hAckLen = (u8)C2H_HDR_GET_LEN(Buffer);
|
||||
if (c2hAckLen >= 8)
|
||||
BT_CoexOffloadC2hAckCheck(Adapter, &Buffer[12], (u8)(c2hAckLen - 8));
|
||||
else
|
||||
BT_CoexOffloadRecordErrC2hAck(Adapter);
|
||||
}
|
||||
} else if (c2hSubCmdId == C2H_SUB_CMD_ID_BT_COEX_INFO) {
|
||||
/* coex c2h indication */
|
||||
c2hIndLen = (u8)C2H_HDR_GET_LEN(Buffer);
|
||||
BT_CoexOffloadC2hIndCheck(Adapter, &Buffer[4], (u8)c2hIndLen);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (CONFIG_BTCOEX_SUPPORT_BTC_CMN == 1)
|
||||
static void halbtcoutsrc_wl_noisy_detect(struct btc_coexist *btc)
|
||||
{
|
||||
@@ -4019,32 +3660,6 @@ void EXhalbtcoutsrc_scan_notify(PBTC_COEXIST pBtCoexist, u8 type)
|
||||
|
||||
void EXhalbtcoutsrc_SetAntennaPathNotify(PBTC_COEXIST pBtCoexist, u8 type)
|
||||
{
|
||||
#if 0
|
||||
u8 switchType;
|
||||
|
||||
if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist))
|
||||
return;
|
||||
|
||||
if (pBtCoexist->manual_control)
|
||||
return;
|
||||
|
||||
halbtcoutsrc_LeaveLowPower(pBtCoexist);
|
||||
|
||||
switchType = type;
|
||||
|
||||
if (IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) {
|
||||
if (pBtCoexist->board_info.btdm_ant_num == 1)
|
||||
ex_halbtc8723b1ant_set_antenna_notify(pBtCoexist, type);
|
||||
}
|
||||
if (IS_HARDWARE_TYPE_8723D(pBtCoexist->Adapter)) {
|
||||
if (pBtCoexist->board_info.btdm_ant_num == 1)
|
||||
ex_halbtc8723d1ant_set_antenna_notify(pBtCoexist, type);
|
||||
else if (pBtCoexist->board_info.btdm_ant_num == 2)
|
||||
ex_halbtc8723d2ant_set_antenna_notify(pBtCoexist, type);
|
||||
}
|
||||
|
||||
halbtcoutsrc_NormalLowPower(pBtCoexist);
|
||||
#endif
|
||||
}
|
||||
|
||||
void EXhalbtcoutsrc_connect_notify(PBTC_COEXIST pBtCoexist, u8 assoType)
|
||||
@@ -4627,28 +4242,6 @@ EXhalbtcoutsrc_RfStatusNotify(
|
||||
|
||||
void EXhalbtcoutsrc_StackOperationNotify(PBTC_COEXIST pBtCoexist, u8 type)
|
||||
{
|
||||
#if 0
|
||||
u8 stackOpType;
|
||||
|
||||
if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist))
|
||||
return;
|
||||
pBtCoexist->statistics.cntStackOperationNotify++;
|
||||
if (pBtCoexist->manual_control)
|
||||
return;
|
||||
|
||||
if ((HCI_BT_OP_INQUIRY_START == type) ||
|
||||
(HCI_BT_OP_PAGING_START == type) ||
|
||||
(HCI_BT_OP_PAIRING_START == type))
|
||||
stackOpType = BTC_STACK_OP_INQ_PAGE_PAIR_START;
|
||||
else if ((HCI_BT_OP_INQUIRY_FINISH == type) ||
|
||||
(HCI_BT_OP_PAGING_SUCCESS == type) ||
|
||||
(HCI_BT_OP_PAGING_UNSUCCESS == type) ||
|
||||
(HCI_BT_OP_PAIRING_FINISH == type))
|
||||
stackOpType = BTC_STACK_OP_INQ_PAGE_PAIR_FINISH;
|
||||
else
|
||||
stackOpType = BTC_STACK_OP_NONE;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void EXhalbtcoutsrc_halt_notify(PBTC_COEXIST pBtCoexist)
|
||||
@@ -5164,34 +4757,6 @@ void EXhalbtcoutsrc_dbg_control(PBTC_COEXIST pBtCoexist, u8 opCode, u8 opLen, u8
|
||||
/* halbtcoutsrc_NormalLowPower(pBtCoexist); */
|
||||
}
|
||||
|
||||
#if 0
|
||||
void
|
||||
EXhalbtcoutsrc_AntennaDetection(
|
||||
PBTC_COEXIST pBtCoexist,
|
||||
u32 centFreq,
|
||||
u32 offset,
|
||||
u32 span,
|
||||
u32 seconds
|
||||
)
|
||||
{
|
||||
if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist))
|
||||
return;
|
||||
|
||||
/* Need to refine the following power save operations to enable this function in the future */
|
||||
#if 0
|
||||
IPSDisable(pBtCoexist->Adapter, FALSE, 0);
|
||||
LeisurePSLeave(pBtCoexist->Adapter, LPS_DISABLE_BT_COEX);
|
||||
#endif
|
||||
|
||||
if (IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) {
|
||||
if (pBtCoexist->board_info.btdm_ant_num == 1)
|
||||
ex_halbtc8723b1ant_AntennaDetection(pBtCoexist, centFreq, offset, span, seconds);
|
||||
}
|
||||
|
||||
/* IPSReturn(pBtCoexist->Adapter, 0xff); */
|
||||
}
|
||||
#endif
|
||||
|
||||
void EXhalbtcoutsrc_StackUpdateProfileInfo(void)
|
||||
{
|
||||
#ifdef CONFIG_BT_COEXIST_SOCKET_TRX
|
||||
@@ -5276,12 +4841,6 @@ void EXhalbtcoutsrc_SetBtPatchVersion(u16 btHciVersion, u16 btPatchVersion)
|
||||
pBtCoexist->bt_info.bt_hci_ver = btHciVersion;
|
||||
}
|
||||
|
||||
#if 0
|
||||
void EXhalbtcoutsrc_SetBtExist(u8 bBtExist)
|
||||
{
|
||||
GLBtCoexist.boardInfo.bBtExist = bBtExist;
|
||||
}
|
||||
#endif
|
||||
void EXhalbtcoutsrc_SetChipType(u8 chipType)
|
||||
{
|
||||
switch (chipType) {
|
||||
@@ -5315,15 +4874,6 @@ void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum)
|
||||
if (BT_COEX_ANT_TYPE_PG == type) {
|
||||
GLBtCoexist.board_info.pg_ant_num = antNum;
|
||||
GLBtCoexist.board_info.btdm_ant_num = antNum;
|
||||
#if 0
|
||||
/* The antenna position: Main (default) or Aux for pgAntNum=2 && btdmAntNum =1 */
|
||||
/* The antenna position should be determined by auto-detect mechanism */
|
||||
/* The following is assumed to main, and those must be modified if y auto-detect mechanism is ready */
|
||||
if ((GLBtCoexist.board_info.pg_ant_num == 2) && (GLBtCoexist.board_info.btdm_ant_num == 1))
|
||||
GLBtCoexist.board_info.btdm_ant_pos = BTC_ANTENNA_AT_MAIN_PORT;
|
||||
else
|
||||
GLBtCoexist.board_info.btdm_ant_pos = BTC_ANTENNA_AT_MAIN_PORT;
|
||||
#endif
|
||||
} else if (BT_COEX_ANT_TYPE_ANTDIV == type) {
|
||||
GLBtCoexist.board_info.btdm_ant_num = antNum;
|
||||
/* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */
|
||||
@@ -6035,12 +5585,8 @@ void hal_btcoex_SuspendNotify(PADAPTER padapter, u8 state)
|
||||
break;
|
||||
case BTCOEX_SUSPEND_STATE_SUSPEND_KEEP_ANT:
|
||||
/* should switch to "#if 1" once all ICs' coex. revision are upgraded to support the KEEP_ANT case */
|
||||
#if 0
|
||||
EXhalbtcoutsrc_pnp_notify(&GLBtCoexist, BTC_WIFI_PNP_SLEEP_KEEP_ANT);
|
||||
#else
|
||||
EXhalbtcoutsrc_pnp_notify(&GLBtCoexist, BTC_WIFI_PNP_SLEEP);
|
||||
EXhalbtcoutsrc_pnp_notify(&GLBtCoexist, BTC_WIFI_PNP_SLEEP_KEEP_ANT);
|
||||
#endif
|
||||
break;
|
||||
case BTCOEX_SUSPEND_STATE_RESUME:
|
||||
#ifdef CONFIG_FW_MULTI_PORT_SUPPORT
|
||||
@@ -6267,92 +5813,6 @@ u32 hal_btcoex_GetDBG(PADAPTER padapter, u8 *pStrBuf, u32 bufSize)
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
|
||||
#if 0
|
||||
count = rtw_sprintf(pstr, leftSize, "INTERFACE Debug Setting Definition:\n");
|
||||
if ((count < 0) || (count >= leftSize))
|
||||
goto exit;
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
count = rtw_sprintf(pstr, leftSize, "\tbit[0]=%d for INTF_INIT\n",
|
||||
GLBtcDbgType[BTC_MSG_INTERFACE] & INTF_INIT ? 1 : 0);
|
||||
if ((count < 0) || (count >= leftSize))
|
||||
goto exit;
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
count = rtw_sprintf(pstr, leftSize, "\tbit[2]=%d for INTF_NOTIFY\n\n",
|
||||
GLBtcDbgType[BTC_MSG_INTERFACE] & INTF_NOTIFY ? 1 : 0);
|
||||
if ((count < 0) || (count >= leftSize))
|
||||
goto exit;
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
|
||||
count = rtw_sprintf(pstr, leftSize, "ALGORITHM Debug Setting Definition:\n");
|
||||
if ((count < 0) || (count >= leftSize))
|
||||
goto exit;
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
count = rtw_sprintf(pstr, leftSize, "\tbit[0]=%d for BT_RSSI_STATE\n",
|
||||
GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_BT_RSSI_STATE ? 1 : 0);
|
||||
if ((count < 0) || (count >= leftSize))
|
||||
goto exit;
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
count = rtw_sprintf(pstr, leftSize, "\tbit[1]=%d for WIFI_RSSI_STATE\n",
|
||||
GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_WIFI_RSSI_STATE ? 1 : 0);
|
||||
if ((count < 0) || (count >= leftSize))
|
||||
goto exit;
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
count = rtw_sprintf(pstr, leftSize, "\tbit[2]=%d for BT_MONITOR\n",
|
||||
GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_BT_MONITOR ? 1 : 0);
|
||||
if ((count < 0) || (count >= leftSize))
|
||||
goto exit;
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
count = rtw_sprintf(pstr, leftSize, "\tbit[3]=%d for TRACE\n",
|
||||
GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE ? 1 : 0);
|
||||
if ((count < 0) || (count >= leftSize))
|
||||
goto exit;
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
count = rtw_sprintf(pstr, leftSize, "\tbit[4]=%d for TRACE_FW\n",
|
||||
GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_FW ? 1 : 0);
|
||||
if ((count < 0) || (count >= leftSize))
|
||||
goto exit;
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
count = rtw_sprintf(pstr, leftSize, "\tbit[5]=%d for TRACE_FW_DETAIL\n",
|
||||
GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_FW_DETAIL ? 1 : 0);
|
||||
if ((count < 0) || (count >= leftSize))
|
||||
goto exit;
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
count = rtw_sprintf(pstr, leftSize, "\tbit[6]=%d for TRACE_FW_EXEC\n",
|
||||
GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_FW_EXEC ? 1 : 0);
|
||||
if ((count < 0) || (count >= leftSize))
|
||||
goto exit;
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
count = rtw_sprintf(pstr, leftSize, "\tbit[7]=%d for TRACE_SW\n",
|
||||
GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_SW ? 1 : 0);
|
||||
if ((count < 0) || (count >= leftSize))
|
||||
goto exit;
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
count = rtw_sprintf(pstr, leftSize, "\tbit[8]=%d for TRACE_SW_DETAIL\n",
|
||||
GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_SW_DETAIL ? 1 : 0);
|
||||
if ((count < 0) || (count >= leftSize))
|
||||
goto exit;
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
count = rtw_sprintf(pstr, leftSize, "\tbit[9]=%d for TRACE_SW_EXEC\n",
|
||||
GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_SW_EXEC ? 1 : 0);
|
||||
if ((count < 0) || (count >= leftSize))
|
||||
goto exit;
|
||||
pstr += count;
|
||||
leftSize -= count;
|
||||
#endif
|
||||
|
||||
exit:
|
||||
count = pstr - pStrBuf;
|
||||
/* RTW_INFO(FUNC_ADPT_FMT ": usedsize=%d\n", FUNC_ADPT_ARG(padapter), count); */
|
||||
|
||||
@@ -934,50 +934,7 @@ static void _ThreeOutPipeMapping(
|
||||
}
|
||||
|
||||
}
|
||||
#if 0
|
||||
static void _FourOutPipeMapping(
|
||||
PADAPTER pAdapter,
|
||||
BOOLEAN bWIFICfg
|
||||
)
|
||||
{
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(pAdapter);
|
||||
|
||||
if (bWIFICfg) { /* for WMM */
|
||||
|
||||
/* BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA */
|
||||
/* { 1, 2, 1, 0, 0, 0, 0, 0, 0 }; */
|
||||
/* 0:H, 1:N, 2:L ,3:E */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];/* VI */
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];/* BE */
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[1];/* BK */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[3];/* HIGH */
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
|
||||
|
||||
} else { /* typical setting */
|
||||
|
||||
|
||||
/* BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA */
|
||||
/* { 2, 2, 1, 0, 0, 0, 0, 0, 0 }; */
|
||||
/* 0:H, 1:N, 2:L */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];/* VI */
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];/* BE */
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[2];/* BK */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[3];/* HIGH */
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
BOOLEAN
|
||||
Hal_MappingOutPipe(
|
||||
PADAPTER pAdapter,
|
||||
@@ -2108,21 +2065,7 @@ void rtw_hal_update_sta_mimo_type(_adapter *adapter, struct sta_info *psta)
|
||||
void rtw_hal_update_sta_smps_cap(_adapter *adapter, struct sta_info *psta)
|
||||
{
|
||||
/*Spatial Multiplexing Power Save*/
|
||||
#if 0
|
||||
if (check_fwstate(&adapter->mlmepriv, WIFI_AP_STATE) == _TRUE) {
|
||||
#ifdef CONFIG_80211N_HT
|
||||
if (psta->htpriv.ht_option) {
|
||||
if (psta->htpriv.smps_cap == 0)
|
||||
psta->cmn.sm_ps = SM_PS_STATIC;
|
||||
else if (psta->htpriv.smps_cap == 1)
|
||||
psta->cmn.sm_ps = SM_PS_DYNAMIC;
|
||||
else
|
||||
psta->cmn.sm_ps = SM_PS_DISABLE;
|
||||
}
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
} else
|
||||
#endif
|
||||
psta->cmn.sm_ps = SM_PS_DISABLE;
|
||||
psta->cmn.sm_ps = SM_PS_DISABLE;
|
||||
|
||||
RTW_INFO("STA - MAC_ID:%d, SM_PS %d\n",
|
||||
psta->cmn.mac_id, psta->cmn.sm_ps);
|
||||
@@ -2466,17 +2409,7 @@ void rtw_sec_write_cam_ent(_adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key)
|
||||
u32 wdata, wdata1 = 0;
|
||||
|
||||
/* TODO: consider other key length accordingly */
|
||||
#if 0
|
||||
switch ((ctrl & 0x1c) >> 2) {
|
||||
case _WEP40_:
|
||||
case _TKIP_:
|
||||
case _AES_:
|
||||
case _WEP104_:
|
||||
|
||||
}
|
||||
#else
|
||||
j = 7;
|
||||
#endif
|
||||
|
||||
for (; j >= 0; j--) {
|
||||
switch (j) {
|
||||
@@ -3029,13 +2962,6 @@ void rtw_ap_multi_bcn_cfg(_adapter *adapter)
|
||||
rtw_halmac_set_bcn_interval(adapter_to_dvobj(adapter), HW_PORT0, dft_bcn_space);
|
||||
rtw_write8(adapter, REG_MBSSID_BCN_SPACE3 + 2, sub_bcn_space);
|
||||
|
||||
#if 0 /*setting in hw_var_set_opmode_mbid - ResumeTxBeacon*/
|
||||
/*BCN hold time 0x540[19:8] = 0x80*/
|
||||
rtw_write8(adapter, REG_TBTT_PROHIBIT + 1, TBTT_PROHIBIT_HOLD_TIME & 0xFF);
|
||||
rtw_write8(adapter, REG_TBTT_PROHIBIT + 2,
|
||||
(rtw_read8(adapter, REG_TBTT_PROHIBIT + 2) & 0xF0) | (TBTT_PROHIBIT_HOLD_TIME >> 8));
|
||||
#endif
|
||||
|
||||
/*ATIM window -0x55A = 0x32, reg 0x570 = 0x32, reg 0x5A0 = 0x32 */
|
||||
rtw_write8(adapter, REG_ATIMWND, 0x32);
|
||||
rtw_write8(adapter, REG_ATIMWND1_V1, 0x32);
|
||||
@@ -3186,46 +3112,6 @@ void rtw_ap_multi_bcn_cfg(_adapter *adapter)
|
||||
#ifdef CONFIG_MI_WITH_MBSSID_CAM
|
||||
void rtw_hal_set_macaddr_mbid(_adapter *adapter, u8 *mac_addr)
|
||||
{
|
||||
|
||||
#if 0 /*TODO - modify for more flexible*/
|
||||
u8 idx = 0;
|
||||
|
||||
if ((check_fwstate(&adapter->mlmepriv, WIFI_STATION_STATE) == _TRUE) &&
|
||||
(DEV_STA_NUM(adapter_to_dvobj(adapter)) == 1)) {
|
||||
for (idx = 0; idx < 6; idx++)
|
||||
rtw_write8(GET_PRIMARY_ADAPTER(adapter), (REG_MACID + idx), val[idx]);
|
||||
} else {
|
||||
/*MBID entry_id = 0~7 ,0 for root AP, 1~7 for VAP*/
|
||||
u8 entry_id;
|
||||
|
||||
if ((check_fwstate(&adapter->mlmepriv, WIFI_AP_STATE) == _TRUE) &&
|
||||
(DEV_AP_NUM(adapter_to_dvobj(adapter)) == 1)) {
|
||||
entry_id = 0;
|
||||
if (rtw_mbid_cam_assign(adapter, val, entry_id)) {
|
||||
RTW_INFO(FUNC_ADPT_FMT" Root AP assigned success\n", FUNC_ADPT_ARG(adapter));
|
||||
write_mbssid_cam(adapter, entry_id, val);
|
||||
}
|
||||
} else {
|
||||
entry_id = rtw_mbid_camid_alloc(adapter, val);
|
||||
if (entry_id != INVALID_CAM_ID)
|
||||
write_mbssid_cam(adapter, entry_id, val);
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
/*
|
||||
MBID entry_id = 0~7 ,for IFACE_ID0 ~ IFACE_IDx
|
||||
*/
|
||||
u8 entry_id = rtw_mbid_camid_alloc(adapter, mac_addr);
|
||||
|
||||
|
||||
if (entry_id != INVALID_CAM_ID) {
|
||||
write_mbssid_cam(adapter, entry_id, mac_addr);
|
||||
RTW_INFO("%s "ADPT_FMT"- mbid(%d) mac_addr ="MAC_FMT"\n", __func__,
|
||||
ADPT_ARG(adapter), entry_id, MAC_ARG(mac_addr));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void rtw_hal_change_macaddr_mbid(_adapter *adapter, u8 *mac_addr)
|
||||
@@ -4350,123 +4236,6 @@ s32 rtw_set_ps_rsvd_page(_adapter *adapter)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if 0
|
||||
_adapter * _rtw_search_dp_iface(_adapter *adapter)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
_adapter *iface;
|
||||
_adapter *target_iface = NULL;
|
||||
int i;
|
||||
u8 sta_num = 0, tdls_num = 0, ap_num = 0, mesh_num = 0, adhoc_num = 0;
|
||||
u8 p2p_go_num = 0, p2p_gc_num = 0;
|
||||
_adapter *sta_ifs[8];
|
||||
_adapter *ap_ifs[8];
|
||||
_adapter *mesh_ifs[8];
|
||||
_adapter *gc_ifs[8];
|
||||
_adapter *go_ifs[8];
|
||||
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
iface = dvobj->padapters[i];
|
||||
|
||||
if (check_fwstate(&iface->mlmepriv, WIFI_STATION_STATE) == _TRUE) {
|
||||
if (check_fwstate(&iface->mlmepriv, WIFI_ASOC_STATE) == _TRUE) {
|
||||
sta_ifs[sta_num++] = iface;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if (iface->tdlsinfo.link_established == _TRUE)
|
||||
tdls_num++;
|
||||
#endif
|
||||
#ifdef CONFIG_P2P
|
||||
if (MLME_IS_GC(iface))
|
||||
gc_ifs[p2p_gc_num++] = iface;
|
||||
#endif
|
||||
}
|
||||
#ifdef CONFIG_AP_MODE
|
||||
} else if (check_fwstate(&iface->mlmepriv, WIFI_AP_STATE) == _TRUE ) {
|
||||
if (check_fwstate(&iface->mlmepriv, WIFI_ASOC_STATE) == _TRUE) {
|
||||
ap_ifs[ap_num++] = iface;
|
||||
#ifdef CONFIG_P2P
|
||||
if (MLME_IS_GO(iface))
|
||||
go_ifs[p2p_go_num++] = iface;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
} else if (check_fwstate(&iface->mlmepriv, WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE) == _TRUE
|
||||
&& check_fwstate(&iface->mlmepriv, WIFI_ASOC_STATE) == _TRUE
|
||||
) {
|
||||
adhoc_num++;
|
||||
|
||||
#ifdef CONFIG_RTW_MESH
|
||||
} else if (check_fwstate(&iface->mlmepriv, WIFI_MESH_STATE) == _TRUE
|
||||
&& check_fwstate(&iface->mlmepriv, WIFI_ASOC_STATE) == _TRUE
|
||||
) {
|
||||
mesh_ifs[mesh_num++] = iface;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (p2p_gc_num) {
|
||||
target_iface = gc_ifs[0];
|
||||
}
|
||||
else if (sta_num) {
|
||||
if(sta_num == 1) {
|
||||
target_iface = sta_ifs[0];
|
||||
} else if (sta_num >= 2) {
|
||||
/*TODO get target_iface by timestamp*/
|
||||
target_iface = sta_ifs[0];
|
||||
}
|
||||
} else if (ap_num) {
|
||||
target_iface = ap_ifs[0];
|
||||
}
|
||||
|
||||
RTW_INFO("[IFS_ASSOC_STATUS] - STA :%d", sta_num);
|
||||
RTW_INFO("[IFS_ASSOC_STATUS] - TDLS :%d", tdls_num);
|
||||
RTW_INFO("[IFS_ASSOC_STATUS] - AP:%d", ap_num);
|
||||
RTW_INFO("[IFS_ASSOC_STATUS] - MESH :%d", mesh_num);
|
||||
RTW_INFO("[IFS_ASSOC_STATUS] - ADHOC :%d", adhoc_num);
|
||||
RTW_INFO("[IFS_ASSOC_STATUS] - P2P-GC :%d", p2p_gc_num);
|
||||
RTW_INFO("[IFS_ASSOC_STATUS] - P2P-GO :%d", p2p_go_num);
|
||||
|
||||
if (target_iface)
|
||||
RTW_INFO("%s => target_iface ("ADPT_FMT")\n",
|
||||
__func__, ADPT_ARG(target_iface));
|
||||
else
|
||||
RTW_INFO("%s => target_iface NULL\n", __func__);
|
||||
|
||||
return target_iface;
|
||||
}
|
||||
|
||||
void rtw_search_default_port(_adapter *adapter)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
_adapter *adp_iface = NULL;
|
||||
#ifdef CONFIG_WOWLAN
|
||||
struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(dvobj);
|
||||
|
||||
if (pwrpriv->wowlan_mode == _TRUE) {
|
||||
adp_iface = adapter;
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
adp_iface = _rtw_search_dp_iface(adapter);
|
||||
|
||||
exit :
|
||||
if ((adp_iface != NULL) && (MLME_IS_STA(adp_iface)))
|
||||
rtw_set_default_port_id(adp_iface);
|
||||
else
|
||||
rtw_hal_set_default_port_id_cmd(adapter, 0);
|
||||
|
||||
if (1) {
|
||||
_adapter *tmp_adp;
|
||||
|
||||
tmp_adp = (adp_iface) ? adp_iface : adapter;
|
||||
|
||||
RTW_INFO("%s ("ADPT_FMT")=> hw_port :%d, default_port(%d)\n",
|
||||
__func__, ADPT_ARG(adapter), get_hw_port(tmp_adp), get_dft_portid(tmp_adp));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /*CONFIG_FW_MULTI_PORT_SUPPORT*/
|
||||
|
||||
#ifdef CONFIG_P2P_PS
|
||||
@@ -5955,14 +5724,6 @@ static u8 rtw_hal_set_remote_wake_ctrl_cmd(_adapter *adapter, u8 enable)
|
||||
SET_H2CCMD_REMOTE_WAKE_CTRL_NBNS_FILTER_EN(
|
||||
u1H2CRemoteWakeCtrlParm, enable);
|
||||
#endif /*CONFIG_IPV6*/
|
||||
#if 0 /* replaced by WOWLAN pattern match */
|
||||
#ifdef CONFIG_RTL8192F
|
||||
if (IS_HARDWARE_TYPE_8192F(adapter)){
|
||||
SET_H2CCMD_REMOTE_WAKE_CTRL_FW_UNICAST_EN(
|
||||
u1H2CRemoteWakeCtrlParm, enable);
|
||||
}
|
||||
#endif /* CONFIG_RTL8192F */
|
||||
#endif
|
||||
if (psecuritypriv->dot11PrivacyAlgrthm == _TKIP_) {
|
||||
#ifdef CONFIG_GTK_OL
|
||||
if(_rtw_wow_chk_cap(adapter, WOW_CAP_TKIP_OL))
|
||||
@@ -6212,13 +5973,6 @@ void rtw_hal_set_fw_wow_related_cmd(_adapter *padapter, u8 enable)
|
||||
#endif /* CONFIG_WAR_OFFLOAD */
|
||||
|
||||
} else {
|
||||
#if 0
|
||||
{
|
||||
u32 PageSize = 0;
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_TX_PAGE_SIZE, (u8 *)&PageSize);
|
||||
dump_TX_FIFO(padapter, 4, PageSize);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#ifdef CONFIG_CUSTOM_PULSE
|
||||
rtw_hal_set_gpio_custom_cmd(padapter, enable);
|
||||
@@ -6708,21 +6462,6 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe
|
||||
pframe += (cur_network->IELength + len_diff);
|
||||
pktlen += (cur_network->IELength + len_diff);
|
||||
}
|
||||
#if 0
|
||||
{
|
||||
u8 *wps_ie;
|
||||
uint wps_ielen;
|
||||
u8 sr = 0;
|
||||
wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr + TXDESC_OFFSET + sizeof(struct rtw_ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_,
|
||||
pattrib->pktlen - sizeof(struct rtw_ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_, NULL, &wps_ielen);
|
||||
if (wps_ie && wps_ielen > 0)
|
||||
rtw_get_wps_attr_content(wps_ie, wps_ielen, WPS_ATTR_SELECTED_REGISTRAR, (u8 *)(&sr), NULL);
|
||||
if (sr != 0)
|
||||
set_fwstate(pmlmepriv, WIFI_UNDER_WPS);
|
||||
else
|
||||
_clr_fwstate_(pmlmepriv, WIFI_UNDER_WPS);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_P2P
|
||||
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) {
|
||||
u32 len;
|
||||
@@ -6813,18 +6552,6 @@ _issue_bcn:
|
||||
* #endif */ /* #if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */
|
||||
|
||||
*pLength = pktlen;
|
||||
#if 0
|
||||
/* printf dbg msg */
|
||||
dbgbufLen = pktlen;
|
||||
RTW_INFO("======> DBG MSG FOR CONSTRAUCT P2P BEACON\n");
|
||||
|
||||
for (index = 0; index < dbgbufLen; index++)
|
||||
printk("%x ", *(dbgbuf + index));
|
||||
|
||||
printk("\n");
|
||||
RTW_INFO("<====== DBG MSG FOR CONSTRAUCT P2P BEACON\n");
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength)
|
||||
@@ -7099,18 +6826,6 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p
|
||||
#endif
|
||||
|
||||
*pLength = pktlen;
|
||||
|
||||
#if 0
|
||||
/* printf dbg msg */
|
||||
dbgbufLen = pktlen;
|
||||
RTW_INFO("======> DBG MSG FOR CONSTRAUCT P2P Probe Rsp\n");
|
||||
|
||||
for (index = 0; index < dbgbufLen; index++)
|
||||
printk("%x ", *(dbgbuf + index));
|
||||
|
||||
printk("\n");
|
||||
RTW_INFO("<====== DBG MSG FOR CONSTRAUCT P2P Probe Rsp\n");
|
||||
#endif
|
||||
}
|
||||
static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pLength)
|
||||
{
|
||||
@@ -7503,17 +7218,6 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL
|
||||
#endif
|
||||
|
||||
*pLength = pktlen;
|
||||
#if 0
|
||||
/* printf dbg msg */
|
||||
dbgbufLen = pktlen;
|
||||
RTW_INFO("======> DBG MSG FOR CONSTRAUCT Nego Rsp\n");
|
||||
|
||||
for (index = 0; index < dbgbufLen; index++)
|
||||
printk("%x ", *(dbgbuf + index));
|
||||
|
||||
printk("\n");
|
||||
RTW_INFO("<====== DBG MSG FOR CONSTRAUCT Nego Rsp\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 *pLength)
|
||||
@@ -7615,130 +7319,6 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 *
|
||||
p2pie[p2pielen++] = 200; /* 2 seconds needed to be the P2P Client */
|
||||
|
||||
/* due to defult value is FAIL INFO UNAVAILABLE, so the following IE is not needed */
|
||||
#if 0
|
||||
if (status_code == P2P_STATUS_SUCCESS) {
|
||||
struct p2p_channels *ch_list = &(adapter_to_rfctl(padapter)->channel_list);
|
||||
|
||||
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) {
|
||||
/* The P2P Invitation request frame asks this Wi-Fi device to be the P2P GO */
|
||||
/* In this case, the P2P Invitation response frame should carry the two more P2P attributes. */
|
||||
/* First one is operating channel attribute. */
|
||||
/* Second one is P2P Group BSSID attribute. */
|
||||
|
||||
/* Operating Channel */
|
||||
/* Type: */
|
||||
p2pie[p2pielen++] = P2P_ATTR_OPERATING_CH;
|
||||
|
||||
/* Length: */
|
||||
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(0x0005);
|
||||
p2pielen += 2;
|
||||
|
||||
/* Value: */
|
||||
/* Country String */
|
||||
p2pie[p2pielen++] = 'X';
|
||||
p2pie[p2pielen++] = 'X';
|
||||
|
||||
/* The third byte should be set to 0x04. */
|
||||
/* Described in the "Operating Channel Attribute" section. */
|
||||
p2pie[p2pielen++] = 0x04;
|
||||
|
||||
/* Operating Class */
|
||||
p2pie[p2pielen++] = 0x51; /* Copy from SD7 */
|
||||
|
||||
/* Channel Number */
|
||||
p2pie[p2pielen++] = pwdinfo->operating_channel; /* operating channel number */
|
||||
|
||||
|
||||
/* P2P Group BSSID */
|
||||
/* Type: */
|
||||
p2pie[p2pielen++] = P2P_ATTR_GROUP_BSSID;
|
||||
|
||||
/* Length: */
|
||||
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(ETH_ALEN);
|
||||
p2pielen += 2;
|
||||
|
||||
/* Value: */
|
||||
/* P2P Device Address for GO */
|
||||
_rtw_memcpy(p2pie + p2pielen, adapter_mac_addr(padapter), ETH_ALEN);
|
||||
p2pielen += ETH_ALEN;
|
||||
|
||||
}
|
||||
|
||||
/* Channel List */
|
||||
/* Type: */
|
||||
p2pie[p2pielen++] = P2P_ATTR_CH_LIST;
|
||||
|
||||
/* Length: */
|
||||
/* Country String(3) */
|
||||
/* + ( Operating Class (1) + Number of Channels(1) ) * Operation Classes (?) */
|
||||
/* + number of channels in all classes */
|
||||
len_channellist_attr = 3
|
||||
+ (1 + 1) * (u16)ch_list->reg_classes
|
||||
+ get_reg_classes_full_count(ch_list);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (rtw_mi_check_status(padapter, MI_LINKED))
|
||||
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(5 + 1);
|
||||
else
|
||||
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr);
|
||||
|
||||
#else
|
||||
|
||||
*(u16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr);
|
||||
|
||||
#endif
|
||||
p2pielen += 2;
|
||||
|
||||
/* Value: */
|
||||
/* Country String */
|
||||
p2pie[p2pielen++] = 'X';
|
||||
p2pie[p2pielen++] = 'X';
|
||||
|
||||
/* The third byte should be set to 0x04. */
|
||||
/* Described in the "Operating Channel Attribute" section. */
|
||||
p2pie[p2pielen++] = 0x04;
|
||||
|
||||
/* Channel Entry List */
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (rtw_mi_check_status(padapter, MI_LINKED)) {
|
||||
u8 union_ch = rtw_mi_get_union_chan(padapter);
|
||||
|
||||
/* Operating Class */
|
||||
if (union_ch > 14) {
|
||||
if (union_ch >= 149)
|
||||
p2pie[p2pielen++] = 0x7c;
|
||||
else
|
||||
p2pie[p2pielen++] = 0x73;
|
||||
|
||||
} else
|
||||
p2pie[p2pielen++] = 0x51;
|
||||
|
||||
|
||||
/* Number of Channels */
|
||||
/* Just support 1 channel and this channel is AP's channel */
|
||||
p2pie[p2pielen++] = 1;
|
||||
|
||||
/* Channel List */
|
||||
p2pie[p2pielen++] = union_ch;
|
||||
} else
|
||||
#endif /* CONFIG_CONCURRENT_MODE */
|
||||
{
|
||||
int i, j;
|
||||
for (j = 0; j < ch_list->reg_classes; j++) {
|
||||
/* Operating Class */
|
||||
p2pie[p2pielen++] = ch_list->reg_class[j].reg_class;
|
||||
|
||||
/* Number of Channels */
|
||||
p2pie[p2pielen++] = ch_list->reg_class[j].channels;
|
||||
|
||||
/* Channel List */
|
||||
for (i = 0; i < ch_list->reg_class[j].channels; i++)
|
||||
p2pie[p2pielen++] = ch_list->reg_class[j].channel[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pktlen);
|
||||
|
||||
#ifdef CONFIG_WFD
|
||||
@@ -7748,18 +7328,6 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 *
|
||||
#endif
|
||||
|
||||
*pLength = pktlen;
|
||||
|
||||
#if 0
|
||||
/* printf dbg msg */
|
||||
dbgbufLen = pktlen;
|
||||
RTW_INFO("======> DBG MSG FOR CONSTRAUCT Invite Rsp\n");
|
||||
|
||||
for (index = 0; index < dbgbufLen; index++)
|
||||
printk("%x ", *(dbgbuf + index));
|
||||
|
||||
printk("\n");
|
||||
RTW_INFO("<====== DBG MSG FOR CONSTRAUCT Invite Rsp\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -7822,20 +7390,6 @@ static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe,
|
||||
RTW_PUT_BE32(wpsie, WPSOUI);
|
||||
wpsielen += 4;
|
||||
|
||||
#if 0
|
||||
/* WPS version */
|
||||
/* Type: */
|
||||
*(u16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_ATTR_VER1);
|
||||
wpsielen += 2;
|
||||
|
||||
/* Length: */
|
||||
*(u16 *)(wpsie + wpsielen) = cpu_to_be16(0x0001);
|
||||
wpsielen += 2;
|
||||
|
||||
/* Value: */
|
||||
wpsie[wpsielen++] = WPS_VERSION_1; /* Version 1.0 */
|
||||
#endif
|
||||
|
||||
/* Config Method */
|
||||
/* Type: */
|
||||
/* *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_CONF_METHOD ); */
|
||||
@@ -7861,18 +7415,6 @@ static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe,
|
||||
#endif
|
||||
|
||||
*pLength = pktlen;
|
||||
|
||||
/* printf dbg msg */
|
||||
#if 0
|
||||
dbgbufLen = pktlen;
|
||||
RTW_INFO("======> DBG MSG FOR CONSTRAUCT ProvisionDis Rsp\n");
|
||||
|
||||
for (index = 0; index < dbgbufLen; index++)
|
||||
printk("%x ", *(dbgbuf + index));
|
||||
|
||||
printk("\n");
|
||||
RTW_INFO("<====== DBG MSG FOR CONSTRAUCT ProvisionDis Rsp\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
u8 rtw_hal_set_FwP2PRsvdPage_cmd(_adapter *adapter, PRSVDPAGE_LOC rsvdpageloc)
|
||||
@@ -7984,54 +7526,6 @@ void rtw_hal_construct_beacon(_adapter *padapter,
|
||||
pframe += 2;
|
||||
pktlen += 2;
|
||||
|
||||
#if 0
|
||||
/* capability info: 2 bytes */
|
||||
_rtw_memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2);
|
||||
|
||||
pframe += 2;
|
||||
pktlen += 2;
|
||||
|
||||
if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
|
||||
/* RTW_INFO("ie len=%d\n", cur_network->IELength); */
|
||||
pktlen += cur_network->IELength - sizeof(NDIS_802_11_FIXED_IEs);
|
||||
_rtw_memcpy(pframe, cur_network->IEs + sizeof(NDIS_802_11_FIXED_IEs), pktlen);
|
||||
|
||||
goto _ConstructBeacon;
|
||||
}
|
||||
|
||||
/* below for ad-hoc mode */
|
||||
|
||||
/* SSID */
|
||||
pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pktlen);
|
||||
|
||||
/* supported rates... */
|
||||
rate_len = rtw_get_rateset_len(cur_network->SupportedRates);
|
||||
pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pktlen);
|
||||
|
||||
/* DS parameter set */
|
||||
pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen);
|
||||
|
||||
if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) {
|
||||
u32 ATIMWindow;
|
||||
/* IBSS Parameter Set... */
|
||||
/* ATIMWindow = cur->Configuration.ATIMWindow; */
|
||||
ATIMWindow = 0;
|
||||
pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pktlen);
|
||||
}
|
||||
|
||||
|
||||
/* todo: ERP IE */
|
||||
|
||||
|
||||
/* EXTERNDED SUPPORTED RATE */
|
||||
if (rate_len > 8)
|
||||
pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen);
|
||||
|
||||
/* todo:HT for adhoc */
|
||||
|
||||
_ConstructBeacon:
|
||||
#endif
|
||||
|
||||
if ((pktlen + TXDESC_SIZE) > MAX_BEACON_LEN) {
|
||||
RTW_ERR("beacon frame too large ,len(%d,%d)\n",
|
||||
(pktlen + TXDESC_SIZE), MAX_BEACON_LEN);
|
||||
@@ -10034,121 +9528,6 @@ void rtw_clean_pattern(_adapter *adapter)
|
||||
|
||||
rtw_write8(adapter, REG_WKFMCAM_NUM, 0);
|
||||
}
|
||||
#if 0
|
||||
static int rtw_hal_set_pattern(_adapter *adapter, u8 *pattern,
|
||||
u8 len, u8 *mask, u8 idx)
|
||||
{
|
||||
struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(adapter);
|
||||
struct mlme_ext_priv *pmlmeext = NULL;
|
||||
struct mlme_ext_info *pmlmeinfo = NULL;
|
||||
struct rtl_wow_pattern wow_pattern;
|
||||
u8 mask_hw[MAX_WKFM_SIZE] = {0};
|
||||
u8 content[MAX_WKFM_PATTERN_SIZE] = {0};
|
||||
u8 broadcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||
u8 multicast_addr1[2] = {0x33, 0x33};
|
||||
u8 multicast_addr2[3] = {0x01, 0x00, 0x5e};
|
||||
u8 res = _FALSE, index = 0, mask_len = 0;
|
||||
u8 mac_addr[ETH_ALEN] = {0};
|
||||
u16 count = 0;
|
||||
int i, j;
|
||||
|
||||
if (pwrctl->wowlan_pattern_idx > MAX_WKFM_CAM_NUM) {
|
||||
RTW_INFO("%s pattern_idx is more than MAX_FMC_NUM: %d\n",
|
||||
__func__, MAX_WKFM_CAM_NUM);
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
pmlmeext = &adapter->mlmeextpriv;
|
||||
pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
_rtw_memcpy(mac_addr, adapter_mac_addr(adapter), ETH_ALEN);
|
||||
_rtw_memset(&wow_pattern, 0, sizeof(struct rtl_wow_pattern));
|
||||
|
||||
mask_len = DIV_ROUND_UP(len, 8);
|
||||
|
||||
/* 1. setup A1 table */
|
||||
if (memcmp(pattern, broadcast_addr, ETH_ALEN) == 0)
|
||||
wow_pattern.type = PATTERN_BROADCAST;
|
||||
else if (memcmp(pattern, multicast_addr1, 2) == 0)
|
||||
wow_pattern.type = PATTERN_MULTICAST;
|
||||
else if (memcmp(pattern, multicast_addr2, 3) == 0)
|
||||
wow_pattern.type = PATTERN_MULTICAST;
|
||||
else if (memcmp(pattern, mac_addr, ETH_ALEN) == 0)
|
||||
wow_pattern.type = PATTERN_UNICAST;
|
||||
else
|
||||
wow_pattern.type = PATTERN_INVALID;
|
||||
|
||||
/* translate mask from os to mask for hw */
|
||||
|
||||
/******************************************************************************
|
||||
* pattern from OS uses 'ethenet frame', like this:
|
||||
|
||||
| 6 | 6 | 2 | 20 | Variable | 4 |
|
||||
|--------+--------+------+-----------+------------+-----|
|
||||
| 802.3 Mac Header | IP Header | TCP Packet | FCS |
|
||||
| DA | SA | Type |
|
||||
|
||||
* BUT, packet catched by our HW is in '802.11 frame', begin from LLC,
|
||||
|
||||
| 24 or 30 | 6 | 2 | 20 | Variable | 4 |
|
||||
|-------------------+--------+------+-----------+------------+-----|
|
||||
| 802.11 MAC Header | LLC | IP Header | TCP Packet | FCS |
|
||||
| Others | Tpye |
|
||||
|
||||
* Therefore, we need translate mask_from_OS to mask_to_hw.
|
||||
* We should left-shift mask by 6 bits, then set the new bit[0~5] = 0,
|
||||
* because new mask[0~5] means 'SA', but our HW packet begins from LLC,
|
||||
* bit[0~5] corresponds to first 6 Bytes in LLC, they just don't match.
|
||||
******************************************************************************/
|
||||
/* Shift 6 bits */
|
||||
for (i = 0; i < mask_len - 1; i++) {
|
||||
mask_hw[i] = mask[i] >> 6;
|
||||
mask_hw[i] |= (mask[i + 1] & 0x3F) << 2;
|
||||
}
|
||||
|
||||
mask_hw[i] = (mask[i] >> 6) & 0x3F;
|
||||
/* Set bit 0-5 to zero */
|
||||
mask_hw[0] &= 0xC0;
|
||||
|
||||
for (i = 0; i < (MAX_WKFM_SIZE / 4); i++) {
|
||||
wow_pattern.mask[i] = mask_hw[i * 4];
|
||||
wow_pattern.mask[i] |= (mask_hw[i * 4 + 1] << 8);
|
||||
wow_pattern.mask[i] |= (mask_hw[i * 4 + 2] << 16);
|
||||
wow_pattern.mask[i] |= (mask_hw[i * 4 + 3] << 24);
|
||||
}
|
||||
|
||||
/* To get the wake up pattern from the mask.
|
||||
* We do not count first 12 bits which means
|
||||
* DA[6] and SA[6] in the pattern to match HW design. */
|
||||
count = 0;
|
||||
for (i = 12; i < len; i++) {
|
||||
if ((mask[i / 8] >> (i % 8)) & 0x01) {
|
||||
content[count] = pattern[i];
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
wow_pattern.crc = rtw_calc_crc(content, count);
|
||||
|
||||
if (wow_pattern.crc != 0) {
|
||||
if (wow_pattern.type == PATTERN_INVALID)
|
||||
wow_pattern.type = PATTERN_VALID;
|
||||
}
|
||||
|
||||
index = idx;
|
||||
|
||||
if (!pwrctl->bInSuspend)
|
||||
index += 2;
|
||||
|
||||
/* write pattern */
|
||||
res = rtw_write_to_frame_mask(adapter, index, &wow_pattern);
|
||||
|
||||
if (res == _FALSE)
|
||||
RTW_INFO("%s: ERROR!! idx: %d write_to_frame_mask_cam fail\n",
|
||||
__func__, idx);
|
||||
|
||||
return res;
|
||||
}
|
||||
#endif
|
||||
#else /*CONFIG_WOW_PATTERN_HW_CAM*/
|
||||
|
||||
#define WOW_CAM_ACCESS_TIMEOUT_MS 200
|
||||
@@ -11012,22 +10391,6 @@ void rtw_hal_set_wow_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 index,
|
||||
}
|
||||
CurtPktPageNum = (u8)PageNum(GTKLength, page_size);
|
||||
}
|
||||
#if 0
|
||||
{
|
||||
int i;
|
||||
printk("\ntoFW KCK: ");
|
||||
for (i = 0; i < 16; i++)
|
||||
printk(" %02x ", kck[i]);
|
||||
printk("\ntoFW KEK: ");
|
||||
for (i = 0; i < 16; i++)
|
||||
printk(" %02x ", kek[i]);
|
||||
printk("\n");
|
||||
}
|
||||
|
||||
RTW_INFO("%s(): HW_VAR_SET_TX_CMD: KEK KCK %p %d\n",
|
||||
__FUNCTION__, &pframe[index - tx_desc],
|
||||
(tx_desc + RTW_KCK_LEN + RTW_KEK_LEN));
|
||||
#endif
|
||||
|
||||
*page_num += CurtPktPageNum;
|
||||
|
||||
@@ -11041,22 +10404,6 @@ void rtw_hal_set_wow_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 index,
|
||||
|
||||
rtw_hal_fill_fake_txdesc(adapter, &pframe[index - tx_desc],
|
||||
GTKLength, _FALSE, _FALSE, _TRUE);
|
||||
#if 0
|
||||
{
|
||||
int gj;
|
||||
printk("123GTK pkt=>\n");
|
||||
for (gj = 0; gj < GTKLength + tx_desc; gj++) {
|
||||
printk(" %02x ", pframe[index - tx_desc + gj]);
|
||||
if ((gj + 1) % 16 == 0)
|
||||
printk("\n");
|
||||
}
|
||||
printk(" <=end\n");
|
||||
}
|
||||
|
||||
RTW_INFO("%s(): HW_VAR_SET_TX_CMD: GTK RSP %p %d\n",
|
||||
__FUNCTION__, &pframe[index - tx_desc],
|
||||
(tx_desc + GTKLength));
|
||||
#endif
|
||||
|
||||
CurtPktPageNum = (u8)PageNum(tx_desc + GTKLength, page_size);
|
||||
|
||||
@@ -11487,11 +10834,6 @@ void rtw_hal_set_p2p_wow_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 index,
|
||||
rtw_hal_fill_fake_txdesc(adapter, &pframe[index - tx_desc],
|
||||
P2PBCNLength, _FALSE, _FALSE, _FALSE);
|
||||
|
||||
#if 0
|
||||
RTW_INFO("%s(): HW_VAR_SET_TX_CMD: PROBE RSP %p %d\n",
|
||||
__FUNCTION__, &pframe[index - tx_desc], (P2PBCNLength + tx_desc));
|
||||
#endif
|
||||
|
||||
CurtPktPageNum = (u8)PageNum(tx_desc + P2PBCNLength, page_size);
|
||||
|
||||
*page_num += CurtPktPageNum;
|
||||
@@ -11987,16 +11329,7 @@ u8 rtw_hal_set_lps_pg_info(_adapter *adapter)
|
||||
|
||||
void rtw_hal_lps_pg_rssi_lv_decide(_adapter *adapter, struct sta_info *sta)
|
||||
{
|
||||
#if 0
|
||||
if (sta->cmn.ra_info.rssi_level >= 4)
|
||||
sta->lps_pg_rssi_lv = 3; /*RSSI High - 1SS_VHT_MCS7*/
|
||||
else if (sta->cmn.ra_info.rssi_level >= 2)
|
||||
sta->lps_pg_rssi_lv = 2; /*RSSI Middle - 1SS_VHT_MCS3*/
|
||||
else
|
||||
sta->lps_pg_rssi_lv = 1; /*RSSI Lower - Lowest_rate*/
|
||||
#else
|
||||
sta->lps_pg_rssi_lv = 0;
|
||||
#endif
|
||||
RTW_INFO("%s mac-id:%d, rssi:%d, rssi_level:%d, lps_pg_rssi_lv:%d\n",
|
||||
__func__, sta->cmn.mac_id, sta->cmn.rssi_stat.rssi, sta->cmn.ra_info.rssi_level, sta->lps_pg_rssi_lv);
|
||||
}
|
||||
@@ -14016,10 +13349,6 @@ u8 rtw_hal_query_txbfer_rf_num(_adapter *adapter)
|
||||
if ((pregistrypriv->beamformer_rf_num) && (IS_HARDWARE_TYPE_8814AE(adapter) || IS_HARDWARE_TYPE_8814AU(adapter) || IS_HARDWARE_TYPE_8822BU(adapter) || IS_HARDWARE_TYPE_8821C(adapter)))
|
||||
return pregistrypriv->beamformer_rf_num;
|
||||
else if (IS_HARDWARE_TYPE_8814AE(adapter)
|
||||
#if 0
|
||||
#if defined(CONFIG_USB_HCI)
|
||||
|| (IS_HARDWARE_TYPE_8814AU(adapter) && (pUsbModeMech->CurUsbMode == 2 || pUsbModeMech->HubUsbMode == 2)) /* for USB3.0 */
|
||||
#endif
|
||||
#endif
|
||||
) {
|
||||
/*BF cap provided by Yu Chen, Sean, 2015, 01 */
|
||||
@@ -14064,12 +13393,6 @@ void rtw_hal_beamforming_config_csirate(PADAPTER adapter)
|
||||
|
||||
/* Acting as BFee */
|
||||
if (IS_BEAMFORMEE(adapter)) {
|
||||
#if 0
|
||||
/* Do not enable now because it will affect MU performance and CTS/BA rate. 2016.07.19. by tynli. [PCIE-1660] */
|
||||
if (IS_HARDWARE_TYPE_8821C(Adapter))
|
||||
FixRateEnable = 1; /* Support after 8821C */
|
||||
#endif
|
||||
|
||||
p_dm_odm = adapter_to_phydm(adapter);
|
||||
bf_info = GET_BEAMFORM_INFO(adapter);
|
||||
|
||||
@@ -16309,14 +15632,6 @@ static void _hw_client_port_alloc(_adapter *adapter)
|
||||
_irqL irql;
|
||||
int i;
|
||||
|
||||
#if 0
|
||||
if (cltp->num > MAX_CLIENT_PORT_NUM) {
|
||||
RTW_ERR(ADPT_FMT" cann't alloc client (%d)\n", ADPT_ARG(adapter), cltp->num);
|
||||
rtw_warn_on(1);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (adapter->client_id != MAX_CLIENT_PORT_NUM) {
|
||||
RTW_INFO(ADPT_FMT" client_id %d has allocated port:%d\n",
|
||||
ADPT_ARG(adapter), adapter->client_id, adapter->client_port);
|
||||
@@ -16344,13 +15659,6 @@ static void _hw_client_port_free(_adapter *adapter)
|
||||
struct clt_port_t *cltp = &dvobj->clt_port;
|
||||
_irqL irql;
|
||||
|
||||
#if 0
|
||||
if (adapter->client_id >= MAX_CLIENT_PORT_NUM) {
|
||||
RTW_ERR(ADPT_FMT" client_id %d is invalid\n", ADPT_ARG(adapter), adapter->client_id);
|
||||
/*rtw_warn_on(1);*/
|
||||
}
|
||||
#endif
|
||||
|
||||
RTW_INFO("%s ("ADPT_FMT") id:%d, port:%d clt_num:%d\n",
|
||||
__func__, ADPT_ARG(adapter), adapter->client_id, adapter->client_port, cltp->num);
|
||||
|
||||
|
||||
@@ -359,10 +359,6 @@ void phydm_set_pa_bias_to_rf_8822b(void *dm_void, u8 e_rf_path, s8 tx_pa_bias)
|
||||
"[kfree] 8822b 2g rf(0x51)=0x%X rf(0x52)=0x%X path=%d\n",
|
||||
rf_reg_51, rf_reg_52, e_rf_path);
|
||||
|
||||
#if 0
|
||||
/*rf3f => rf52[19:17] = rf3f[2:0] rf52[16:15] = rf3f[4:3] rf52[3:0] = rf3f[8:5]*/
|
||||
/*rf3f => rf51[6:3] = rf3f[12:9] rf52[13] = rf3f[13]*/
|
||||
#endif
|
||||
rf_reg_3f = ((rf_reg_52 & 0xe0000) >> 17) |
|
||||
(((rf_reg_52 & 0x18000) >> 15) << 3) |
|
||||
((rf_reg_52 & 0xf) << 5) |
|
||||
@@ -746,25 +742,6 @@ void phydm_set_kfree_to_rf_8192f(void *dm_void, u8 e_rf_path, u8 channel_idx,
|
||||
BIT(15) | BIT(14))), e_rf_path, channel_idx);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
void phydm_clear_kfree_to_rf_8192f(void *dm_void, u8 e_rf_path, u8 data)
|
||||
{
|
||||
struct dm_struct *dm = (struct dm_struct *)dm_void;
|
||||
struct dm_rf_calibration_struct *cali_info = &dm->rf_calibrate_info;
|
||||
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x55, BIT(19), (data & BIT(0)));
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x55, (BIT(18) | BIT(17) | BIT(16) | BIT(15) | BIT(14)), ((data & 0x1f) >> 1));
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8192F clear power trim 0x55[19:14]=0x%X path=%d\n",
|
||||
odm_get_rf_reg(dm, e_rf_path, RF_0x55, (BIT(19) | BIT(18) | BIT(17) | BIT(16) | BIT(15) | BIT(14))),
|
||||
e_rf_path
|
||||
);
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
|
||||
void phydm_get_thermal_trim_offset_8198f(void *dm_void)
|
||||
{
|
||||
struct dm_struct *dm = (struct dm_struct *)dm_void;
|
||||
@@ -1030,46 +1007,7 @@ void phydm_set_kfree_to_rf_8198f(void *dm_void, u8 e_rf_path, u8 data)
|
||||
|
||||
void phydm_clear_kfree_to_rf_8198f(void *dm_void, u8 e_rf_path, u8 data)
|
||||
{
|
||||
struct dm_struct *dm = (struct dm_struct *)dm_void;
|
||||
#if 0
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] %s:Clear kfree to rf 0x55\n", __func__);
|
||||
|
||||
/*power_trim based on 55[19:14]*/
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x55, BIT(5), 1);
|
||||
/*enable 55[14] for 0.5db step*/
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0xf5, BIT(18), 1);
|
||||
/*enter power_trim debug mode*/
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0xdf, BIT(7), 0);
|
||||
/*write enable*/
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0xef, BIT(7), 1);
|
||||
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x70000, 0);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x3F, data);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x70000, 1);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x3F, data);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x70000, 2);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x3F, data);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x70000, 3);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x3F, data);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x70000, 4);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x3F, data);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x70000, 5);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x3F, data);
|
||||
|
||||
/*leave power_trim debug mode*/
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0xdf, BIT(7), 0);
|
||||
/*enable 55[14] for 0.5db step*/
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0xf5, BIT(18), 0);
|
||||
/*write disable*/
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0xef, BIT(7), 0);
|
||||
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0xdf, BIT(7), 1);
|
||||
/*odm_set_rf_reg(dm, e_rf_path, RF_0xf5, BIT(18), 0);*/
|
||||
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void phydm_get_set_thermal_trim_offset_8822c(void *dm_void)
|
||||
@@ -1481,21 +1419,6 @@ void phydm_set_power_trim_offset_8812f(void *dm_void)
|
||||
for (e_rf_path = RF_PATH_A; e_rf_path < 2; e_rf_path++)
|
||||
{
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0xee, BIT(19), 1);
|
||||
|
||||
#if 0
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, RFREGOFFSETMASK, 0x0);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x3f, RFREGOFFSETMASK,
|
||||
power_trim_info->bb_gain[0][e_rf_path]);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, RFREGOFFSETMASK, 0x1);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x3f, RFREGOFFSETMASK,
|
||||
power_trim_info->bb_gain[1][e_rf_path]);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, RFREGOFFSETMASK, 0x2);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x3f, RFREGOFFSETMASK,
|
||||
power_trim_info->bb_gain[2][e_rf_path]);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, RFREGOFFSETMASK, 0x3);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x3f, RFREGOFFSETMASK,
|
||||
power_trim_info->bb_gain[2][e_rf_path]);
|
||||
#endif
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x33, RFREGOFFSETMASK, 0x4);
|
||||
odm_set_rf_reg(dm, e_rf_path, RF_0x3f, RFREGOFFSETMASK,
|
||||
power_trim_info->bb_gain[3][e_rf_path]);
|
||||
@@ -1553,25 +1476,6 @@ void phydm_get_set_power_trim_offset_8812f(void *dm_void)
|
||||
pg_power4 != 0xff || pg_power5 != 0xff) &&
|
||||
(pg_power1 != 0x0 || pg_power2 != 0x0 || pg_power3 != 0x0 ||
|
||||
pg_power4 != 0x0 || pg_power5 != 0x0)) {
|
||||
#if 0
|
||||
odm_efuse_one_byte_read(dm, PPG_2GL_TXAB_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[0][0] = pg_power & 0xf;
|
||||
power_trim_info->bb_gain[0][1] = (pg_power & 0xf0) >> 4;
|
||||
|
||||
odm_efuse_one_byte_read(dm, PPG_2GM_TXAB_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[1][0] = pg_power & 0xf;
|
||||
power_trim_info->bb_gain[1][1] = (pg_power & 0xf0) >> 4;
|
||||
|
||||
odm_efuse_one_byte_read(dm, PPG_2GH_TXAB_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[2][0] = pg_power & 0xf;
|
||||
power_trim_info->bb_gain[2][1] = (pg_power & 0xf0) >> 4;
|
||||
#endif
|
||||
odm_efuse_one_byte_read(dm, PPG_5GL1_TXA_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
@@ -1645,12 +1549,6 @@ void phydm_get_tssi_trim_offset_8812f(void *dm_void)
|
||||
u8 i, j ;
|
||||
u8 pg_power[16] = {0};
|
||||
|
||||
#if 0
|
||||
odm_efuse_one_byte_read(dm, TSSI_2GM_TXA_22C, &pg_power[0], false);
|
||||
odm_efuse_one_byte_read(dm, TSSI_2GM_TXB_22C, &pg_power[1], false);
|
||||
odm_efuse_one_byte_read(dm, TSSI_2GH_TXA_22C, &pg_power[2], false);
|
||||
odm_efuse_one_byte_read(dm, TSSI_2GH_TXB_22C, &pg_power[3], false);
|
||||
#endif
|
||||
odm_efuse_one_byte_read(dm, TSSI_5GL1_TXA_22C, &pg_power[4], false);
|
||||
odm_efuse_one_byte_read(dm, TSSI_5GL1_TXB_22C, &pg_power[5], false);
|
||||
odm_efuse_one_byte_read(dm, TSSI_5GL2_TXA_22C, &pg_power[6], false);
|
||||
@@ -1673,14 +1571,6 @@ void phydm_get_tssi_trim_offset_8812f(void *dm_void)
|
||||
if (j == 12) {
|
||||
RF_DBG(dm, DBG_RF_MP, "[kfree] 8812f tssi trim no PG\n");
|
||||
} else {
|
||||
#if 0
|
||||
power_trim_info->tssi_trim[0][0] = (s8)pg_power[0];
|
||||
power_trim_info->tssi_trim[0][1] = (s8)pg_power[1];
|
||||
power_trim_info->tssi_trim[1][0] = (s8)pg_power[0];
|
||||
power_trim_info->tssi_trim[1][1] = (s8)pg_power[1];
|
||||
power_trim_info->tssi_trim[2][0] = (s8)pg_power[2];
|
||||
power_trim_info->tssi_trim[2][1] = (s8)pg_power[3];
|
||||
#endif
|
||||
power_trim_info->tssi_trim[3][0] = (s8)pg_power[4];
|
||||
power_trim_info->tssi_trim[3][1] = (s8)pg_power[5];
|
||||
power_trim_info->tssi_trim[4][0] = (s8)pg_power[6];
|
||||
@@ -1755,25 +1645,6 @@ void phydm_get_set_pa_bias_offset_8812f(void *dm_void)
|
||||
odm_efuse_one_byte_read(dm, PPG_PABIAS_5GA_22C, &pg_pa_bias, false);
|
||||
|
||||
if (pg_pa_bias != 0xff && pg_pa_bias != 0x0) {
|
||||
#if 0
|
||||
/*2G s0*/
|
||||
odm_efuse_one_byte_read(dm, PPG_PABIAS_2GA_22C,
|
||||
&pg_pa_bias, false);
|
||||
pg_pa_bias = pg_pa_bias & 0xf;
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP, "[kfree] 2G s0 pa_bias=0x%x\n", pg_pa_bias);
|
||||
|
||||
odm_set_rf_reg(dm, RF_PATH_A, 0x60, 0x0000f000, pg_pa_bias);
|
||||
|
||||
/*2G s1*/
|
||||
odm_efuse_one_byte_read(dm, PPG_PABIAS_2GB_22C,
|
||||
&pg_pa_bias, false);
|
||||
pg_pa_bias = pg_pa_bias & 0xf;
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP, "[kfree] 2G s1 pa_bias=0x%x\n", pg_pa_bias);
|
||||
|
||||
odm_set_rf_reg(dm, RF_PATH_B, 0x60, 0x0000f000, pg_pa_bias);
|
||||
#endif
|
||||
|
||||
/*5G s0*/
|
||||
odm_efuse_one_byte_read(dm, PPG_PABIAS_5GA_22C,
|
||||
@@ -2146,40 +2017,7 @@ void phydm_get_set_power_trim_offset_8721d(void *dm_void)
|
||||
|
||||
void phydm_get_set_pa_bias_offset_8721d(void *dm_void)
|
||||
{
|
||||
#if 0
|
||||
struct dm_struct *dm = (struct dm_struct *)dm_void;
|
||||
struct odm_power_trim_data *power_trim_info = &dm->power_trim_data;
|
||||
|
||||
u8 pg_pa_bias = 0xff;
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP, "======>%s\n", __func__);
|
||||
|
||||
odm_efuse_one_byte_read(dm, PPG_PABIAS_2GA_95B, &pg_pa_bias, false);
|
||||
|
||||
if (pg_pa_bias != 0xff) {
|
||||
/*2G*/
|
||||
odm_efuse_one_byte_read(dm, PPG_PABIAS_2GA_95B,
|
||||
&pg_pa_bias, false);
|
||||
pg_pa_bias = pg_pa_bias & 0xf;
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP, "[kfree] 2G pa_bias=0x%x\n", pg_pa_bias);
|
||||
|
||||
odm_set_rf_reg(dm, RF_PATH_A, 0x60, 0x0000f000, pg_pa_bias);
|
||||
|
||||
/*5G*/
|
||||
odm_efuse_one_byte_read(dm, PPG_PABIAS_5GA_95B,
|
||||
&pg_pa_bias, false);
|
||||
pg_pa_bias = pg_pa_bias & 0xf;
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP, "[kfree] 5G pa_bias=0x%x\n", pg_pa_bias);
|
||||
|
||||
odm_set_rf_reg(dm, RF_PATH_A, 0x60, 0x000f0000, pg_pa_bias);
|
||||
|
||||
power_trim_info->pa_bias_flag |= PA_BIAS_FLAG_ON;
|
||||
} else {
|
||||
RF_DBG(dm, DBG_RF_MP, "[kfree] 8721d tx pa bias no pg\n");
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
void phydm_get_thermal_trim_offset_8197g(void *dm_void)
|
||||
@@ -2895,315 +2733,14 @@ s8 phydm_get_tssi_trim_de_8814b(void *dm_void, u8 path)
|
||||
|
||||
void phydm_set_pabias_bandedge_2g_rf_8814b(void *dm_void)
|
||||
{
|
||||
#if 0
|
||||
struct dm_struct *dm = (struct dm_struct *)dm_void;
|
||||
struct odm_power_trim_data *power_trim_info = &dm->power_trim_data;
|
||||
|
||||
u32 rf_reg_51 = 0, rf_reg_52 = 0, rf_reg_53 = 0, rf_reg_3f = 0;
|
||||
u8 i, j;
|
||||
s32 pa_bias_tmp, bandedge_tmp, reg_tmp;
|
||||
|
||||
#if 0
|
||||
/*2.4G bias*/
|
||||
/*rf3f == rf53*/
|
||||
#endif
|
||||
for (i = 0; i < MAX_PATH_NUM_8814B; i++) {
|
||||
rf_reg_51 = odm_get_rf_reg(dm, i, RF_0x51, RFREGOFFSETMASK);
|
||||
rf_reg_52 = odm_get_rf_reg(dm, i, RF_0x52, RFREGOFFSETMASK);
|
||||
rf_reg_53 = odm_get_rf_reg(dm, i, RF_0x53, RFREGOFFSETMASK);
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8814b 2g rf(0x51)=0x%X rf(0x52)=0x%X rf(0x53)=0x%X path=%d\n",
|
||||
rf_reg_51, rf_reg_52, rf_reg_53, i);
|
||||
|
||||
/*2.4G bias*/
|
||||
rf_reg_3f = rf_reg_53;
|
||||
pa_bias_tmp = rf_reg_3f & 0xf;
|
||||
|
||||
reg_tmp = pa_bias_tmp + power_trim_info->pa_bias_trim[0][i];
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8814b 2g pa bias reg_tmp(%d) = pa_bias_tmp(%d) + power_trim_info->pa_bias_trim[0][%d](%d)\n",
|
||||
reg_tmp, pa_bias_tmp, i, power_trim_info->pa_bias_trim[0][i]);
|
||||
|
||||
#if 0
|
||||
if (reg_tmp < 0) {
|
||||
reg_tmp = 0;
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 2g pa bias reg_tmp < 0. Set 0 path=%d\n", i);
|
||||
} else if (reg_tmp > 7) {
|
||||
reg_tmp = 7;
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 2g pa bias reg_tmp > 7. Set 7 path=%d\n", i);
|
||||
}
|
||||
#endif
|
||||
|
||||
rf_reg_3f = ((rf_reg_3f & 0xffff0) | reg_tmp);
|
||||
rf_reg_3f = ((rf_reg_3f & 0x0ffff) | 0x10000);
|
||||
|
||||
odm_set_rf_reg(dm, i, RF_0xef, BIT(10), 0x1);
|
||||
for (j = 0; j <= 0xf; j++) {
|
||||
odm_set_rf_reg(dm, i, RF_0x30, RFREGOFFSETMASK, (j << 16));
|
||||
odm_set_rf_reg(dm, i, RF_0x3f, RFREGOFFSETMASK, rf_reg_3f);
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8814b 2G pa bias write RF_0x30=0x%05x RF_0x3f=0x%x path=%d\n",
|
||||
(j << 16), rf_reg_3f, i);
|
||||
}
|
||||
odm_set_rf_reg(dm, i, RF_0xef, BIT(10), 0x0);
|
||||
|
||||
#if 0
|
||||
/*2.4G bandedge*/
|
||||
/*rf3f =>*/
|
||||
/*rf51[3:1] = rf3f[17:15]*/
|
||||
/*rf52[2:0] = rf3f[14:12]*/
|
||||
/*rf52[18] = rf3f[11]*/
|
||||
/*rf51[6:4] = rf3f[10:8]*/
|
||||
/*rf51[11:8] = rf3f[7:4]*/
|
||||
/*rf51[16:13] = rf3f[3:0]*/
|
||||
#endif
|
||||
/*2.4G bandedge*/
|
||||
rf_reg_3f = (((rf_reg_51 & 0xe) >> 1) << 15) |
|
||||
((rf_reg_52 & 0x7) << 12) |
|
||||
(((rf_reg_52 & 0x40000) >> 18) << 11) |
|
||||
(((rf_reg_51 & 0x70) >> 4) << 8) |
|
||||
(((rf_reg_51 & 0xf00) >> 8) << 4) |
|
||||
((rf_reg_51 & 0x1e000) >> 13);
|
||||
|
||||
bandedge_tmp = rf_reg_3f & 0xf;
|
||||
|
||||
reg_tmp = bandedge_tmp + power_trim_info->pa_bias_trim[0][i];
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8814b 2g bandedge reg_tmp(%d) = bandedge_tmp(%d) + power_trim_info->pa_bias_trim[0][%d](%d)\n",
|
||||
reg_tmp, bandedge_tmp, i, power_trim_info->pa_bias_trim[0][i]);
|
||||
|
||||
#if 0
|
||||
if (reg_tmp < 0) {
|
||||
reg_tmp = 0;
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 2g bandedge reg_tmp < 0. Set 0 path=%d\n", i);
|
||||
} else if (reg_tmp > 7) {
|
||||
reg_tmp = 7;
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 2g bandedge reg_tmp > 7. Set 7 path=%d\n", i);
|
||||
}
|
||||
#endif
|
||||
|
||||
rf_reg_3f = ((rf_reg_3f & 0xffff0) | reg_tmp);
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8814b 2G bandedge RF_0x30=0x%05X RF_0x3f=0x%x path=%d\n",
|
||||
0x00001, rf_reg_3f, i);
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8814b 2G bandedge RF_0x30=0x%05X RF_0x3f=0x%x path=%d\n",
|
||||
0x0000b, rf_reg_3f, i);
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8814b 2G bandedge RF_0x30=0x%05X RF_0x3f=0x%x path=%d\n",
|
||||
0x00023, rf_reg_3f, i);
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8814b 2G bandedge RF_0x30=0x%05X RF_0x3f=0x%x path=%d\n",
|
||||
0x00029, rf_reg_3f, i);
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8814b 2G bandedge RF_0x30=0x%05X RF_0x3f=0x%x path=%d\n",
|
||||
0x0002a, rf_reg_3f, i);
|
||||
|
||||
odm_set_rf_reg(dm, i, RF_0xef, BIT(8), 0x1);
|
||||
odm_set_rf_reg(dm, i, RF_0x33, RFREGOFFSETMASK, 0x00001);
|
||||
odm_set_rf_reg(dm, i, RF_0x3f, RFREGOFFSETMASK, rf_reg_3f);
|
||||
odm_set_rf_reg(dm, i, RF_0x33, RFREGOFFSETMASK, 0x0000b);
|
||||
odm_set_rf_reg(dm, i, RF_0x3f, RFREGOFFSETMASK, rf_reg_3f);
|
||||
odm_set_rf_reg(dm, i, RF_0x33, RFREGOFFSETMASK, 0x00023);
|
||||
odm_set_rf_reg(dm, i, RF_0x3f, RFREGOFFSETMASK, rf_reg_3f);
|
||||
odm_set_rf_reg(dm, i, RF_0x33, RFREGOFFSETMASK, 0x00029);
|
||||
odm_set_rf_reg(dm, i, RF_0x3f, RFREGOFFSETMASK, rf_reg_3f);
|
||||
odm_set_rf_reg(dm, i, RF_0x33, RFREGOFFSETMASK, 0x0002a);
|
||||
odm_set_rf_reg(dm, i, RF_0x3f, RFREGOFFSETMASK, rf_reg_3f);
|
||||
odm_set_rf_reg(dm, i, RF_0xef, BIT(8), 0x0);
|
||||
|
||||
}
|
||||
#endif
|
||||
return ;
|
||||
}
|
||||
|
||||
void phydm_set_pabias_bandedge_5g_rf_8814b(void *dm_void)
|
||||
{
|
||||
#if 0
|
||||
struct dm_struct *dm = (struct dm_struct *)dm_void;
|
||||
struct odm_power_trim_data *power_trim_info = &dm->power_trim_data;
|
||||
|
||||
u32 rf_reg_18[MAX_PATH_NUM_8814B] = {0},
|
||||
rf_reg_61[15][MAX_PATH_NUM_8814B] = {0},
|
||||
rf_reg_62[3][MAX_PATH_NUM_8814B] = {0};
|
||||
u8 i, j;
|
||||
u32 bandedge[15][MAX_PATH_NUM_8814B] = {0},
|
||||
pa_bias[3][MAX_PATH_NUM_8814B] = {0};
|
||||
|
||||
s32 pa_bias_tmp, reg_tmp;
|
||||
|
||||
|
||||
for (i = 0; i < MAX_PATH_NUM_8814B; i++) {
|
||||
rf_reg_18[i] = odm_get_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK);
|
||||
|
||||
for (j = 0; j < 3; j++) {
|
||||
if (j == 0)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x10d24);
|
||||
else if (j == 1)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x30d64);
|
||||
else if (j == 2)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x50da9);
|
||||
|
||||
rf_reg_62[j][i] = odm_get_rf_reg(dm, i, 0x62, RFREGOFFSETMASK);
|
||||
|
||||
#if 0
|
||||
/*5G bias*/
|
||||
/*rf62[19:16] == rf30[11:8]*/
|
||||
/*rf62[15:12] == rf30[7:4]*/
|
||||
/*rf62[11:8] == rf3030[3:0]*/
|
||||
#endif
|
||||
pa_bias[j][i] = (((rf_reg_62[j][i] & 0xf0000) >> 16) << 8) |
|
||||
(((rf_reg_62[j][i] & 0xf000) >> 12) << 4) |
|
||||
((rf_reg_62[j][i] & 0xf00) >> 8);
|
||||
}
|
||||
|
||||
for (j = 0; j < 15; j++) {
|
||||
if (j == 0)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x10d24);/*ch36*/
|
||||
else if (j == 1)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x11926);/*ch38*/
|
||||
else if (j == 2)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x1252a);/*ch42*/
|
||||
else if (j == 3)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x1253a);/*ch58*/
|
||||
else if (j == 4)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x1193e);/*ch62*/
|
||||
else if (j == 5)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x10d40);/*ch64*/
|
||||
else if (j == 6)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x30d64);/*ch100*/
|
||||
else if (j == 7)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x31966);/*ch102*/
|
||||
else if (j == 8)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x3256a);/*ch106*/
|
||||
else if (j == 9)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x3257a);/*ch122*/
|
||||
else if (j == 10)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x31986);/*ch134*/
|
||||
else if (j == 11)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x30d8c);/*ch140*/
|
||||
else if (j == 12)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x50d95);/*ch149*/
|
||||
else if (j == 13)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x51997);/*ch151*/
|
||||
else if (j == 14)
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, 0x5259b);/*ch155*/
|
||||
|
||||
|
||||
rf_reg_61[j][i] = odm_get_rf_reg(dm, i, RF_0x61, RFREGOFFSETMASK);
|
||||
#if 0
|
||||
/*5G bandedge*/
|
||||
/*rf61[11:8] == rf30[11:8]*/
|
||||
/*rf61[7:4] == rf30[7:4]*/
|
||||
/*rf61[3:0] == rf3030[3:0]*/
|
||||
#endif
|
||||
bandedge[j][i] = rf_reg_61[j][i] & 0xfff;
|
||||
}
|
||||
|
||||
odm_set_rf_reg(dm, i, RF_0x18, RFREGOFFSETMASK, rf_reg_18[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_PATH_NUM_8814B; i++) {
|
||||
for (j = 0; j < 3; j++) {
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] pa_bias[%d][%d]=0x%x\n", j, i, pa_bias[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_PATH_NUM_8814B; i++) {
|
||||
for (j = 0; j < 15; j++) {
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] bandedge[%d][%d]=0x%x\n", j, i, bandedge[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*5G bias*/
|
||||
for (i = 0; i < MAX_PATH_NUM_8814B; i++) {
|
||||
odm_set_rf_reg(dm, i, RF_0xee, BIT(8), 0x1);
|
||||
for (j = 0; j <= 0xb; j++) {
|
||||
|
||||
if (j >= 0 && j <= 3)
|
||||
pa_bias_tmp = pa_bias[0][i] & 0xf;
|
||||
else if (j >= 4 && j <= 0x7)
|
||||
pa_bias_tmp = pa_bias[1][i] & 0xf;
|
||||
else if (j >= 0x8 && j <= 0xb)
|
||||
pa_bias_tmp = pa_bias[2][i] & 0xf;
|
||||
|
||||
reg_tmp = pa_bias_tmp + power_trim_info->pa_bias_trim[1][i];
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8814b 5g pa bias reg_tmp(%d) = pa_bias_tmp(%d) + power_trim_info->pa_bias_trim[1][%d](%d)\n",
|
||||
reg_tmp, pa_bias_tmp, i, power_trim_info->pa_bias_trim[1][i]);
|
||||
#if 0
|
||||
if (reg_tmp < 0) {
|
||||
reg_tmp = 0;
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 5g pa bias reg_tmp < 0. Set 0 path=%d\n", i);
|
||||
} else if (reg_tmp > 7) {
|
||||
reg_tmp = 7;
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 5g pa bias reg_tmp > 7. Set 7 path=%d\n", i);
|
||||
}
|
||||
#endif
|
||||
if (j >= 0 && j <= 3)
|
||||
reg_tmp = ((pa_bias[0][i] & 0xffff0) | reg_tmp | (j << 12));
|
||||
else if (j >= 4 && j <= 0x7)
|
||||
reg_tmp = ((pa_bias[1][i] & 0xffff0) | reg_tmp | (j << 12));
|
||||
else if (j >= 0x8 && j <= 0xb)
|
||||
reg_tmp = ((pa_bias[2][i] & 0xffff0) | reg_tmp | (j << 12));
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8814b write RF_0x30=0x%05x path=%d\n",
|
||||
reg_tmp, i);
|
||||
|
||||
odm_set_rf_reg(dm, i, RF_0x30, RFREGOFFSETMASK, reg_tmp);
|
||||
}
|
||||
odm_set_rf_reg(dm, i, RF_0xee, BIT(8), 0x0);
|
||||
}
|
||||
|
||||
/*5G bandedge*/
|
||||
for (i = 0; i < MAX_PATH_NUM_8814B; i++) {
|
||||
odm_set_rf_reg(dm, i, RF_0xee, BIT(9), 0x1);
|
||||
for (j = 0; j <= 0xe; j++) {
|
||||
reg_tmp = bandedge[j][i] + power_trim_info->pa_bias_trim[1][i];
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8814b 5g bandedge reg_tmp(%d)(0x%X) = bandedge_org(%d) + power_trim_info->pa_bias_trim[1][%d](%d)\n",
|
||||
reg_tmp, reg_tmp, bandedge[j][i], i, power_trim_info->pa_bias_trim[1][i]);
|
||||
#if 0
|
||||
if (reg_tmp < 0) {
|
||||
reg_tmp = 0;
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 5g bandedge reg_tmp < 0. Set 0 path=%d\n", i);
|
||||
} else if (reg_tmp > 7) {
|
||||
reg_tmp = 7;
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 5g bandedge reg_tmp > 7. Set 7 path=%d\n", i);
|
||||
}
|
||||
#endif
|
||||
|
||||
reg_tmp = ((bandedge[j][i] & 0xffff0) | reg_tmp | (j << 12));
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8814b write RF_0x30=0x%05x path=%d\n",
|
||||
reg_tmp, i);
|
||||
|
||||
odm_set_rf_reg(dm, i, RF_0x30, RFREGOFFSETMASK, reg_tmp);
|
||||
}
|
||||
odm_set_rf_reg(dm, i, RF_0xee, BIT(9), 0x0);
|
||||
}
|
||||
|
||||
#endif
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
void phydm_get_pa_bias_offset_8814b(void *dm_void)
|
||||
{
|
||||
struct dm_struct *dm = (struct dm_struct *)dm_void;
|
||||
@@ -3234,20 +2771,6 @@ void phydm_get_pa_bias_offset_8814b(void *dm_void)
|
||||
power_trim_info->pa_bias_trim[0][k], k);
|
||||
odm_set_rf_reg(dm, k, 0x60, 0x0000f000, power_trim_info->pa_bias_trim[0][k]);
|
||||
}
|
||||
|
||||
#if 0
|
||||
for (k = 0; k < MAX_PATH_NUM_8814B; k++) {
|
||||
if ((power_trim_info->pa_bias_trim[0][k] & BIT(0)) == 0)
|
||||
power_trim_info->pa_bias_trim[0][k] = (-1 * (power_trim_info->pa_bias_trim[0][k] >> 1));
|
||||
else
|
||||
power_trim_info->pa_bias_trim[0][k] = (power_trim_info->pa_bias_trim[0][k] >> 1);
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP, "[kfree] 8814b 2g PA Bias K power_trim_info->pa_bias_trim[0][%d]=0x%x\n",
|
||||
k, power_trim_info->pa_bias_trim[0][k]);
|
||||
}
|
||||
|
||||
phydm_set_pabias_bandedge_2g_rf_8814b(dm);
|
||||
#endif
|
||||
}
|
||||
|
||||
odm_efuse_one_byte_read(dm, PPG_PABIAS_5GAC_14B, &tssi_pa_bias_5g[0], false);
|
||||
@@ -3273,21 +2796,7 @@ void phydm_get_pa_bias_offset_8814b(void *dm_void)
|
||||
|
||||
odm_set_rf_reg(dm, k, 0x60, 0x000f0000, power_trim_info->pa_bias_trim[1][k]);
|
||||
}
|
||||
#if 0
|
||||
for (k = 0; k < MAX_PATH_NUM_8814B; k++) {
|
||||
if ((power_trim_info->pa_bias_trim[1][k] & BIT(0)) == 0)
|
||||
power_trim_info->pa_bias_trim[1][k] = (-1 * (power_trim_info->pa_bias_trim[1][k] >> 1));
|
||||
else
|
||||
power_trim_info->pa_bias_trim[1][k] = (power_trim_info->pa_bias_trim[1][k] >> 1);
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP, "[kfree] 8814b 5g PA Bias K power_trim_info->pa_bias_trim[1][%d]=0x%x\n",
|
||||
k, power_trim_info->pa_bias_trim[1][k]);
|
||||
}
|
||||
|
||||
phydm_set_pabias_bandedge_5g_rf_8814b(dm);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3367,103 +2876,7 @@ void phydm_get_thermal_trim_offset_8723f(void *dm_void)
|
||||
|
||||
void phydm_get_set_power_trim_offset_8723f(void *dm_void)
|
||||
{
|
||||
struct dm_struct *dm = (struct dm_struct *)dm_void;
|
||||
struct odm_power_trim_data *power_trim_info = &dm->power_trim_data;
|
||||
u8 pg_power = 0xff, i, j;
|
||||
u8 pg_power1, pg_power2 , pg_power3, pg_power4, pg_power5;
|
||||
#if 0
|
||||
odm_efuse_one_byte_read(dm, PPG_2GL_TXAB_22C, &pg_power1, false);
|
||||
odm_efuse_one_byte_read(dm, PPG_2GM_TXAB_22C, &pg_power2, false);
|
||||
odm_efuse_one_byte_read(dm, PPG_2GH_TXAB_22C, &pg_power3, false);
|
||||
odm_efuse_one_byte_read(dm, PPG_5GL1_TXA_22C, &pg_power4, false);
|
||||
odm_efuse_one_byte_read(dm, PPG_5GL1_TXB_22C, &pg_power5, false);
|
||||
|
||||
if (pg_power1 != 0xff || pg_power2 != 0xff || pg_power3 != 0xff ||
|
||||
pg_power4 != 0xff || pg_power5 != 0xff) {
|
||||
odm_efuse_one_byte_read(dm, PPG_2GL_TXAB_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[0][0] = pg_power & 0xf;
|
||||
power_trim_info->bb_gain[0][1] = (pg_power & 0xf0) >> 4;
|
||||
|
||||
odm_efuse_one_byte_read(dm, PPG_2GM_TXAB_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[1][0] = pg_power & 0xf;
|
||||
power_trim_info->bb_gain[1][1] = (pg_power & 0xf0) >> 4;
|
||||
|
||||
odm_efuse_one_byte_read(dm, PPG_2GH_TXAB_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[2][0] = pg_power & 0xf;
|
||||
power_trim_info->bb_gain[2][1] = (pg_power & 0xf0) >> 4;
|
||||
|
||||
odm_efuse_one_byte_read(dm, PPG_5GL1_TXA_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[3][0] = pg_power & 0x1f;
|
||||
odm_efuse_one_byte_read(dm, PPG_5GL1_TXB_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[3][1] = pg_power & 0x1f;
|
||||
|
||||
odm_efuse_one_byte_read(dm, PPG_5GL2_TXA_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[4][0] = pg_power & 0x1f;
|
||||
odm_efuse_one_byte_read(dm, PPG_5GL2_TXB_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[4][1] = pg_power & 0x1f;
|
||||
|
||||
odm_efuse_one_byte_read(dm, PPG_5GM1_TXA_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[5][0] = pg_power & 0x1f;
|
||||
odm_efuse_one_byte_read(dm, PPG_5GM1_TXB_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[5][1] = pg_power & 0x1f;
|
||||
|
||||
odm_efuse_one_byte_read(dm, PPG_5GM2_TXA_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[6][0] = pg_power & 0x1f;
|
||||
odm_efuse_one_byte_read(dm, PPG_5GM2_TXB_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[6][1] = pg_power & 0x1f;
|
||||
|
||||
odm_efuse_one_byte_read(dm, PPG_5GH1_TXA_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[7][0] = pg_power & 0x1f;
|
||||
odm_efuse_one_byte_read(dm, PPG_5GH1_TXB_22C, &pg_power, false);
|
||||
if (pg_power == 0xff)
|
||||
pg_power = 0;
|
||||
power_trim_info->bb_gain[7][1] = pg_power & 0x1f;
|
||||
|
||||
power_trim_info->flag =
|
||||
power_trim_info->flag | KFREE_FLAG_ON |
|
||||
KFREE_FLAG_ON_2G |
|
||||
KFREE_FLAG_ON_5G;
|
||||
|
||||
phydm_set_power_trim_offset_8822c(dm);
|
||||
}
|
||||
|
||||
RF_DBG(dm, DBG_RF_MP, "[kfree] 8822c power trim flag:0x%02x\n",
|
||||
power_trim_info->flag);
|
||||
|
||||
if (power_trim_info->flag & KFREE_FLAG_ON) {
|
||||
for (i = 0; i < KFREE_BAND_NUM; i++) {
|
||||
for (j = 0; j < 2; j++) {
|
||||
RF_DBG(dm, DBG_RF_MP,
|
||||
"[kfree] 8822c pwr_trim->bb_gain[%d][%d]=0x%X\n",
|
||||
i, j, power_trim_info->bb_gain[i][j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return ;
|
||||
}
|
||||
|
||||
void phydm_get_tssi_trim_offset_8723f(void *dm_void)
|
||||
@@ -3785,16 +3198,6 @@ void phydm_get_power_trim_offset(void *dm_void)
|
||||
{
|
||||
struct dm_struct *dm = (struct dm_struct *)dm_void;
|
||||
|
||||
#if 0 //(DM_ODM_SUPPORT_TYPE & ODM_WIN) // 2017 MH DM Should use the same code.s
|
||||
void *adapter = dm->adapter;
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(((PADAPTER)adapter));
|
||||
PEFUSE_HAL pEfuseHal = &hal_data->EfuseHal;
|
||||
u1Byte eFuseContent[DCMD_EFUSE_MAX_SECTION_NUM * EFUSE_MAX_WORD_UNIT * 2];
|
||||
|
||||
if (HAL_MAC_Dump_EFUSE(&GET_HAL_MAC_INFO(adapter), EFUSE_WIFI, eFuseContent, pEfuseHal->PhysicalLen_WiFi, HAL_MAC_EFUSE_PHYSICAL, HAL_MAC_EFUSE_PARSE_DRV) != RT_STATUS_SUCCESS)
|
||||
RF_DBG(dm, DBG_RF_MP, "[kfree] dump efuse fail !!!\n");
|
||||
#endif
|
||||
|
||||
if (dm->support_ic_type & ODM_RTL8821C)
|
||||
phydm_get_power_trim_offset_8821c(dm_void);
|
||||
else if (dm->support_ic_type & ODM_RTL8822B)
|
||||
@@ -3942,18 +3345,6 @@ void phydm_do_kfree(void *dm_void, u8 channel_to_sw)
|
||||
phydm_clear_kfree_to_rf(dm, rfpath, bb_gain);
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
/*else if(dm->support_ic_type & ODM_RTL8192F){
|
||||
if (channel_to_sw >= 1 && channel_to_sw <= 3)
|
||||
channel_idx = 0;
|
||||
if (channel_to_sw >= 4 && channel_to_sw <= 9)
|
||||
channel_idx = 1;
|
||||
if (channel_to_sw >= 9 && channel_to_sw <= 14)
|
||||
channel_idx = 2;
|
||||
for (rfpath = RF_PATH_A; rfpath < max_path; rfpath++)
|
||||
phydm_clear_kfree_to_rf_8192f(dm, rfpath, pwrtrim->bb_gain[channel_idx][rfpath]);
|
||||
}*/
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4000,9 +3391,6 @@ void phydm_config_kfree(void *dm_void, u8 channel_to_sw)
|
||||
__func__);
|
||||
return;
|
||||
}
|
||||
#if 0
|
||||
/*if kfree_table[0] == 0xff, means no Kfree*/
|
||||
#endif
|
||||
phydm_do_kfree(dm, channel_to_sw);
|
||||
}
|
||||
RF_DBG(dm, DBG_RF_MP, "<===[kfree] phy_ConfigKFree()\n");
|
||||
|
||||
Reference in New Issue
Block a user