drivers/staging/rtl8723bs/hal/odm_DIG.c
Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/hal/odm_DIG.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/rtl8723bs/hal/odm_DIG.c- Extension
.c- Size
- 23980 bytes
- Lines
- 814
- Domain
- Driver Families
- Bucket
- drivers/staging
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
odm_precomp.h
Detected Declarations
function Copyrightfunction odm_NHMCounterStatisticsfunction odm_GetNHMCounterStatisticsfunction odm_NHMCounterStatisticsResetfunction odm_NHMBBInitfunction odm_NHMBBfunction odm_SearchPwdBLowerBoundfunction odm_AdaptivityInitfunction odm_Adaptivityfunction ODM_Write_DIGfunction odm_DigAbortfunction odm_DIGInitfunction odm_DIGfunction odm_DIGbyRSSI_LPSfunction odm_FalseAlarmCounterStatisticsfunction odm_FAThresholdCheckfunction odm_ForbiddenIGICheckfunction odm_CCKPacketDetectionThreshfunction ODM_Write_CCK_CCA_Thres
Annotated Snippet
if (pDM_Odm->NHM_cnt_0 >= 190 || pDM_Odm->adaptivity_flag == true) {
/* Enable EDCCA since it is possible running Adaptivity testing */
/* test_status = 1; */
pDM_Odm->adaptivity_flag = true;
pDM_Odm->tolerance_cnt = 0;
} else {
if (pDM_Odm->tolerance_cnt < 3)
pDM_Odm->tolerance_cnt = pDM_Odm->tolerance_cnt + 1;
else
pDM_Odm->tolerance_cnt = 4;
/* test_status = 5; */
if (pDM_Odm->tolerance_cnt > 3) {
/* test_status = 3; */
pDM_Odm->adaptivity_flag = false;
}
}
} else { /* TX<RX */
if (pDM_Odm->adaptivity_flag == true && pDM_Odm->NHM_cnt_0 <= 200) {
/* test_status = 2; */
pDM_Odm->tolerance_cnt = 0;
} else {
if (pDM_Odm->tolerance_cnt < 3)
pDM_Odm->tolerance_cnt = pDM_Odm->tolerance_cnt + 1;
else
pDM_Odm->tolerance_cnt = 4;
/* test_status = 5; */
if (pDM_Odm->tolerance_cnt > 3) {
/* test_status = 4; */
pDM_Odm->adaptivity_flag = false;
}
}
}
}
void odm_SearchPwdBLowerBound(void *pDM_VOID, u8 IGI_target)
{
struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID;
u32 value32 = 0;
u8 cnt, IGI;
bool bAdjust = true;
s8 TH_L2H_dmc, TH_H2L_dmc;
s8 Diff;
IGI = 0x50; /* find H2L, L2H lower bound */
ODM_Write_DIG(pDM_Odm, IGI);
Diff = IGI_target-(s8)IGI;
TH_L2H_dmc = pDM_Odm->TH_L2H_ini + Diff;
if (TH_L2H_dmc > 10)
TH_L2H_dmc = 10;
TH_H2L_dmc = TH_L2H_dmc - pDM_Odm->TH_EDCCA_HL_diff;
PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_ECCAThreshold, bMaskByte0, (u8)TH_L2H_dmc);
PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_ECCAThreshold, bMaskByte2, (u8)TH_H2L_dmc);
mdelay(5);
while (bAdjust) {
for (cnt = 0; cnt < 20; cnt++) {
value32 = PHY_QueryBBReg(pDM_Odm->Adapter, ODM_REG_RPT_11N, bMaskDWord);
if (value32 & BIT30)
pDM_Odm->txEdcca1 = pDM_Odm->txEdcca1 + 1;
else if (value32 & BIT29)
pDM_Odm->txEdcca1 = pDM_Odm->txEdcca1 + 1;
else
pDM_Odm->txEdcca0 = pDM_Odm->txEdcca0 + 1;
}
if (pDM_Odm->txEdcca1 > 5) {
IGI = IGI-1;
TH_L2H_dmc = TH_L2H_dmc + 1;
if (TH_L2H_dmc > 10)
TH_L2H_dmc = 10;
TH_H2L_dmc = TH_L2H_dmc - pDM_Odm->TH_EDCCA_HL_diff;
PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_ECCAThreshold, bMaskByte0, (u8)TH_L2H_dmc);
PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_ECCAThreshold, bMaskByte2, (u8)TH_H2L_dmc);
pDM_Odm->TxHangFlg = true;
pDM_Odm->txEdcca1 = 0;
pDM_Odm->txEdcca0 = 0;
if (TH_L2H_dmc == 10) {
bAdjust = false;
pDM_Odm->TxHangFlg = false;
pDM_Odm->txEdcca1 = 0;
pDM_Odm->txEdcca0 = 0;
pDM_Odm->H2L_lb = TH_H2L_dmc;
pDM_Odm->L2H_lb = TH_L2H_dmc;
pDM_Odm->Adaptivity_IGI_upper = IGI;
Annotation
- Immediate include surface: `odm_precomp.h`.
- Detected declarations: `function Copyright`, `function odm_NHMCounterStatistics`, `function odm_GetNHMCounterStatistics`, `function odm_NHMCounterStatisticsReset`, `function odm_NHMBBInit`, `function odm_NHMBB`, `function odm_SearchPwdBLowerBound`, `function odm_AdaptivityInit`, `function odm_Adaptivity`, `function ODM_Write_DIG`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.