drivers/net/wireless/realtek/rtw89/acpi.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw89/acpi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw89/acpi.c- Extension
.c- Size
- 33082 bytes
- Lines
- 1282
- Domain
- Driver Families
- Bucket
- drivers/net
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/uuid.hacpi.hdebug.h
Detected Declarations
struct rtw89_acpi_sar_rec_parmfunction rtw89_acpi_traversal_objectfunction rtw89_acpi_calculate_object_lengthfunction rtw89_acpi_evaluate_methodfunction rtw89_acpi_dsm_get_valuefunction chk_acpi_policy_6ghz_sigfunction rtw89_acpi_dsm_get_policy_6ghzfunction chk_acpi_policy_6ghz_sp_sigfunction rtw89_acpi_dsm_get_policy_6ghz_spfunction chk_acpi_policy_6ghz_vlp_sigfunction rtw89_acpi_dsm_get_policy_6ghz_vlpfunction chk_acpi_policy_tas_sigfunction rtw89_acpi_dsm_get_policy_tasfunction chk_acpi_policy_reg_rules_sigfunction rtw89_acpi_dsm_get_policy_reg_rulesfunction rtw89_acpi_evaluate_dsmfunction rtw89_acpi_evaluate_rtagfunction rtw89_acpi_sar_get_subbandfunction rtw89_acpi_sar_subband_to_bandfunction rtw89_acpi_sar_rfpath_to_hp_antidxfunction rtw89_acpi_sar_rfpath_to_rt_antidxfunction rtw89_acpi_sar_normalize_hp_valfunction rtw89_acpi_sar_normalize_rt_valfunction rtw89_acpi_sar_load_std_legacyfunction rtw89_acpi_sar_load_std_has_6ghzfunction rtw89_acpi_sar_load_sml_legacyfunction rtw89_acpi_sar_load_sml_has_6ghzfunction rtw89_acpi_geo_sar_normalize_deltafunction rtw89_acpi_geo_sar_regd_convert_hp_idxfunction rtw89_acpi_geo_sar_regd_convert_rt_idxfunction rtw89_acpi_geo_sar_load_by_hpfunction rtw89_acpi_geo_sar_load_by_rtfunction rtw89_acpi_geo_sar_load_hp_legacyfunction rtw89_acpi_geo_sar_load_hp_has_6ghzfunction rtw89_acpi_geo_sar_load_rt_legacyfunction rtw89_acpi_geo_sar_load_rt_has_6ghzfunction rtw89_acpi_sar_recognizefunction rtw89_acpi_evaluate_static_sarfunction rtw89_acpi_evaluate_dynamic_sarfunction rtw89_acpi_evaluate_dynamic_sar_indicatorfunction rtw89_acpi_evaluate_geo_sarfunction rtw89_acpi_evaluate_sar
Annotated Snippet
struct rtw89_acpi_sar_rec_parm {
u32 pld_len;
u8 tbl_cnt;
u16 cid;
u8 rev;
};
static const struct rtw89_acpi_sar_recognition *
rtw89_acpi_sar_recognize(struct rtw89_dev *rtwdev,
const struct rtw89_acpi_sar_rec_parm *parm)
{
const u32 tbl_len = parm->pld_len / parm->tbl_cnt;
const struct rtw89_acpi_sar_recognition *rec;
struct rtw89_acpi_sar_identifier id = {};
rtw89_debug(rtwdev, RTW89_DBG_ACPI,
"%s: cid %u, rev %u, tbl len %u, tbl cnt %u\n",
__func__, parm->cid, parm->rev, tbl_len, parm->tbl_cnt);
if (unlikely(parm->pld_len % parm->tbl_cnt)) {
rtw89_debug(rtwdev, RTW89_DBG_ACPI, "invalid pld len %u\n",
parm->pld_len);
return NULL;
}
if (unlikely(tbl_len > RTW89_ACPI_SAR_SIZE_MAX)) {
rtw89_debug(rtwdev, RTW89_DBG_ACPI, "invalid tbl len %u\n",
tbl_len);
return NULL;
}
if (unlikely(parm->tbl_cnt > MAX_NUM_OF_RTW89_ACPI_SAR_TBL)) {
rtw89_debug(rtwdev, RTW89_DBG_ACPI, "invalid tbl cnt %u\n",
parm->tbl_cnt);
return NULL;
}
switch (parm->cid) {
case RTW89_ACPI_SAR_CID_HP:
case RTW89_ACPI_SAR_CID_RT:
id.cid = parm->cid;
break;
default:
rtw89_debug(rtwdev, RTW89_DBG_ACPI, "invalid cid 0x%x\n",
parm->cid);
return NULL;
}
switch (parm->rev) {
case RTW89_ACPI_SAR_REV_LEGACY:
case RTW89_ACPI_SAR_REV_HAS_6GHZ:
id.rev = parm->rev;
break;
default:
rtw89_debug(rtwdev, RTW89_DBG_ACPI, "invalid rev %u\n",
parm->rev);
return NULL;
}
id.size = tbl_len;
for (unsigned int i = 0; i < ARRAY_SIZE(rtw89_acpi_sar_recs); i++) {
rec = &rtw89_acpi_sar_recs[i];
if (memcmp(&rec->id, &id, sizeof(rec->id)) == 0)
return rec;
}
rtw89_debug(rtwdev, RTW89_DBG_ACPI, "failed to recognize\n");
return NULL;
}
static const struct rtw89_acpi_sar_recognition *
rtw89_acpi_evaluate_static_sar(struct rtw89_dev *rtwdev,
struct rtw89_sar_cfg_acpi *cfg)
{
const struct rtw89_acpi_sar_recognition *rec = NULL;
const struct rtw89_acpi_static_sar_hdr *hdr;
struct rtw89_sar_entry_from_acpi tmp = {};
struct rtw89_acpi_sar_rec_parm parm = {};
struct rtw89_sar_table_from_acpi *tbl;
const struct rtw89_acpi_data *data;
u32 len;
data = rtw89_acpi_evaluate_method(rtwdev, RTW89_ACPI_METHOD_STATIC_SAR);
if (!data)
return NULL;
rtw89_debug(rtwdev, RTW89_DBG_ACPI, "acpi load static sar\n");
len = data->len;
if (len <= sizeof(*hdr)) {
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/uuid.h`, `acpi.h`, `debug.h`.
- Detected declarations: `struct rtw89_acpi_sar_rec_parm`, `function rtw89_acpi_traversal_object`, `function rtw89_acpi_calculate_object_length`, `function rtw89_acpi_evaluate_method`, `function rtw89_acpi_dsm_get_value`, `function chk_acpi_policy_6ghz_sig`, `function rtw89_acpi_dsm_get_policy_6ghz`, `function chk_acpi_policy_6ghz_sp_sig`, `function rtw89_acpi_dsm_get_policy_6ghz_sp`, `function chk_acpi_policy_6ghz_vlp_sig`.
- Atlas domain: Driver Families / drivers/net.
- 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.