drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c- Extension
.c- Size
- 27743 bytes
- Lines
- 991
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
../wifi.h../pci.h../base.h../stats.hreg.hdef.htrx.hled.hdm.hphy.hfw.h
Detected Declarations
function _rtl8821ae_map_hwqueue_to_fwqueuefunction odm_cfofunction _rtl8821ae_evm_dbm_jaguarfunction query_rxphystatusfunction translate_rx_signal_stufffunction rtl8821ae_insert_emcontentfunction rtl8821ae_get_rxdesc_is_htfunction rtl8821ae_get_rxdesc_is_vhtfunction rtl8821ae_get_rx_vht_nssfunction rtl8821ae_rx_query_descfunction rtl8821ae_bw_mappingfunction rtl8821ae_sc_mappingfunction rtl8821ae_tx_fill_descfunction is_broadcast_ether_addrfunction rtl8821ae_tx_fill_cmddescfunction rtl8821ae_set_descfunction rtl8821ae_get_descfunction rtl8821ae_is_tx_desc_closedfunction rtl8821ae_tx_polling
Annotated Snippet
if (rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8812AE) {
switch (lan_idx) {
case 7:
if (vga_idx <= 27)
/*VGA_idx = 27~2*/
rx_pwr_all = -100 + 2*(27-vga_idx);
else
rx_pwr_all = -100;
break;
case 6:
/*VGA_idx = 2~0*/
rx_pwr_all = -48 + 2*(2-vga_idx);
break;
case 5:
/*VGA_idx = 7~5*/
rx_pwr_all = -42 + 2*(7-vga_idx);
break;
case 4:
/*VGA_idx = 7~4*/
rx_pwr_all = -36 + 2*(7-vga_idx);
break;
case 3:
/*VGA_idx = 7~0*/
rx_pwr_all = -24 + 2*(7-vga_idx);
break;
case 2:
if (cck_highpwr)
/*VGA_idx = 5~0*/
rx_pwr_all = -12 + 2*(5-vga_idx);
else
rx_pwr_all = -6 + 2*(5-vga_idx);
break;
case 1:
rx_pwr_all = 8-2*vga_idx;
break;
case 0:
rx_pwr_all = 14-2*vga_idx;
break;
default:
break;
}
rx_pwr_all += 6;
pwdb_all = rtl_query_rxpwrpercentage(rx_pwr_all);
if (!cck_highpwr) {
if (pwdb_all >= 80)
pwdb_all =
((pwdb_all - 80)<<1) +
((pwdb_all - 80)>>1) + 80;
else if ((pwdb_all <= 78) && (pwdb_all >= 20))
pwdb_all += 3;
if (pwdb_all > 100)
pwdb_all = 100;
}
} else { /* 8821 */
s8 pout = -6;
switch (lan_idx) {
case 5:
rx_pwr_all = pout - 32 - (2*vga_idx);
break;
case 4:
rx_pwr_all = pout - 24 - (2*vga_idx);
break;
case 2:
rx_pwr_all = pout - 11 - (2*vga_idx);
break;
case 1:
rx_pwr_all = pout + 5 - (2*vga_idx);
break;
case 0:
rx_pwr_all = pout + 21 - (2*vga_idx);
break;
}
pwdb_all = rtl_query_rxpwrpercentage(rx_pwr_all);
}
pstatus->rx_pwdb_all = pwdb_all;
pstatus->recvsignalpower = rx_pwr_all;
/* (3) Get Signal Quality (EVM) */
if (bpacket_match_bssid) {
u8 sq;
if (pstatus->rx_pwdb_all > 40) {
sq = 100;
} else {
sq = p_phystrpt->pwdb_all;
if (sq > 64)
sq = 0;
else if (sq < 20)
Annotation
- Immediate include surface: `../wifi.h`, `../pci.h`, `../base.h`, `../stats.h`, `reg.h`, `def.h`, `trx.h`, `led.h`.
- Detected declarations: `function _rtl8821ae_map_hwqueue_to_fwqueue`, `function odm_cfo`, `function _rtl8821ae_evm_dbm_jaguar`, `function query_rxphystatus`, `function translate_rx_signal_stuff`, `function rtl8821ae_insert_emcontent`, `function rtl8821ae_get_rxdesc_is_ht`, `function rtl8821ae_get_rxdesc_is_vht`, `function rtl8821ae_get_rx_vht_nss`, `function rtl8821ae_rx_query_desc`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.