drivers/staging/rtl8723bs/hal/odm_CfoTracking.c
Source file repositories/reference/linux-study-clean/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/rtl8723bs/hal/odm_CfoTracking.c- Extension
.c- Size
- 5397 bytes
- Lines
- 211
- 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_GetDefaultCrytaltalCapfunction odm_SetATCStatusfunction odm_GetATCStatusfunction ODM_CfoTrackingResetfunction ODM_CfoTrackingInitfunction ODM_CfoTrackingfunction odm_parsing_cfo
Annotated Snippet
if (pCfoTrack->bAdjust == false) {
if (CFO_ave > CFO_TH_XTAL_HIGH || CFO_ave < (-CFO_TH_XTAL_HIGH))
pCfoTrack->bAdjust = true;
} else {
if (CFO_ave < CFO_TH_XTAL_LOW && CFO_ave > (-CFO_TH_XTAL_LOW))
pCfoTrack->bAdjust = false;
}
/* 4 1.5 BT case: Disable CFO tracking */
if (pDM_Odm->bBtEnabled) {
pCfoTrack->bAdjust = false;
odm_SetCrystalCap(pDM_Odm, pCfoTrack->DefXCap);
}
/* 4 1.6 Big jump */
if (pCfoTrack->bAdjust) {
if (CFO_ave > CFO_TH_XTAL_LOW)
Adjust_Xtal = Adjust_Xtal + ((CFO_ave - CFO_TH_XTAL_LOW) >> 2);
else if (CFO_ave < (-CFO_TH_XTAL_LOW))
Adjust_Xtal = Adjust_Xtal + ((CFO_TH_XTAL_LOW - CFO_ave) >> 2);
}
/* 4 1.7 Adjust Crystal Cap. */
if (pCfoTrack->bAdjust) {
if (CFO_ave > CFO_TH_XTAL_LOW)
CrystalCap = CrystalCap + Adjust_Xtal;
else if (CFO_ave < (-CFO_TH_XTAL_LOW))
CrystalCap = CrystalCap - Adjust_Xtal;
if (CrystalCap > 0x3f)
CrystalCap = 0x3f;
else if (CrystalCap < 0)
CrystalCap = 0;
odm_SetCrystalCap(pDM_Odm, (u8)CrystalCap);
}
/* 3 2. Dynamic ATC switch */
if (CFO_ave < CFO_TH_ATC && CFO_ave > -CFO_TH_ATC)
odm_SetATCStatus(pDM_Odm, false);
else
odm_SetATCStatus(pDM_Odm, true);
}
}
void odm_parsing_cfo(void *dm_void, void *pkt_info_void, s8 *cfotail)
{
struct dm_odm_t *dm_odm = (struct dm_odm_t *)dm_void;
struct odm_packet_info *pkt_info = pkt_info_void;
struct cfo_tracking *cfo_track = &dm_odm->DM_CfoTrack;
u8 i;
if (!(dm_odm->SupportAbility & ODM_BB_CFO_TRACKING))
return;
if (pkt_info->station_id != 0) {
/*
* 3 Update CFO report for path-A & path-B
* Only paht-A and path-B have CFO tail and short CFO
*/
for (i = RF_PATH_A; i <= RF_PATH_B; i++)
cfo_track->CFO_tail[i] = (int)cfotail[i];
/* 3 Update packet counter */
if (cfo_track->packetCount == 0xffffffff)
cfo_track->packetCount = 0;
else
cfo_track->packetCount++;
}
}
Annotation
- Immediate include surface: `odm_precomp.h`.
- Detected declarations: `function Copyright`, `function odm_GetDefaultCrytaltalCap`, `function odm_SetATCStatus`, `function odm_GetATCStatus`, `function ODM_CfoTrackingReset`, `function ODM_CfoTrackingInit`, `function ODM_CfoTracking`, `function odm_parsing_cfo`.
- 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.