drivers/net/wireless/realtek/rtlwifi/pci.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtlwifi/pci.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtlwifi/pci.c- Extension
.c- Size
- 65715 bytes
- Lines
- 2366
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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.hcore.hpci.hbase.hps.hefuse.hlinux/interrupt.hlinux/export.hlinux/module.h
Detected Declarations
function _rtl_mac_to_hwqueuefunction _rtl_pci_update_default_settingfunction _rtl_pci_platform_switch_device_pci_aspmfunction _rtl_pci_switch_clk_reqfunction rtl_pci_disable_aspmfunction rtl_pci_enable_aspmfunction rtl_pci_get_amd_l1_patchfunction rtl_pci_parse_configurationfunction rtl_pci_init_aspmfunction _rtl_pci_io_handler_initfunction _rtl_update_earlymode_infofunction _rtl_pci_tx_chk_waitqfunction _rtl_pci_tx_isrfunction _rtl_pci_init_one_rxdescfunction _rtl_pci_rx_to_mac80211function _rtl_pci_hs_interruptfunction _rtl_pci_rx_interruptfunction _rtl_pci_interruptfunction _rtl_pci_irq_taskletfunction _rtl_pci_prepare_bcn_taskletfunction _rtl_pci_init_trx_varfunction _rtl_pci_init_structfunction _rtl_pci_init_tx_ringfunction _rtl_pci_init_rx_ringfunction _rtl_pci_free_tx_ringfunction _rtl_pci_free_rx_ringfunction _rtl_pci_init_trx_ringfunction _rtl_pci_deinit_trx_ringfunction rtl_pci_reset_trx_ringfunction rtl_pci_tx_chk_waitq_insertfunction rtl_pci_txfunction rtl_pci_flushfunction rtl_pci_deinitfunction rtl_pci_initfunction rtl_pci_startfunction rtl_pci_stopfunction _rtl_pci_find_adapterfunction rtl_pci_intr_mode_msifunction rtl_pci_intr_mode_legacyfunction rtl_pci_intr_mode_decidefunction platform_enable_dma64function rtl_pci_probefunction rtl_pci_disconnectfunction PCI_D0function rtl_pci_resumeexport rtl_pci_probeexport rtl_pci_disconnectexport rtl_pci_suspend
Annotated Snippet
if (next_info->flags & IEEE80211_TX_CTL_AMPDU) {
tcb_desc->empkt_len[tcb_desc->empkt_num] =
next_skb->len + additionlen;
tcb_desc->empkt_num++;
} else {
break;
}
if (skb_queue_is_last(&rtlpriv->mac80211.skb_waitq[tid],
next_skb))
break;
if (tcb_desc->empkt_num >= rtlhal->max_earlymode_num)
break;
}
spin_unlock_bh(&rtlpriv->locks.waitq_lock);
return true;
}
/* just for early mode now */
static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
struct sk_buff *skb = NULL;
struct ieee80211_tx_info *info = NULL;
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
int tid;
if (!rtlpriv->rtlhal.earlymode_enable)
return;
/* we just use em for BE/BK/VI/VO */
for (tid = 7; tid >= 0; tid--) {
u8 hw_queue = ac_to_hwq[rtl_tid_to_ac(tid)];
struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue];
while (!mac->act_scanning &&
rtlpriv->psc.rfpwr_state == ERFON) {
struct rtl_tcb_desc tcb_desc;
memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc));
spin_lock(&rtlpriv->locks.waitq_lock);
if (!skb_queue_empty(&mac->skb_waitq[tid]) &&
(ring->entries - skb_queue_len(&ring->queue) >
rtlhal->max_earlymode_num)) {
skb = skb_dequeue(&mac->skb_waitq[tid]);
} else {
spin_unlock(&rtlpriv->locks.waitq_lock);
break;
}
spin_unlock(&rtlpriv->locks.waitq_lock);
/* Some macaddr can't do early mode. like
* multicast/broadcast/no_qos data
*/
info = IEEE80211_SKB_CB(skb);
if (info->flags & IEEE80211_TX_CTL_AMPDU)
_rtl_update_earlymode_info(hw, skb,
&tcb_desc, tid);
rtlpriv->intf_ops->adapter_tx(hw, NULL, skb, &tcb_desc);
}
}
}
static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[prio];
while (skb_queue_len(&ring->queue)) {
struct sk_buff *skb;
struct ieee80211_tx_info *info;
__le16 fc;
u8 tid;
u8 *entry;
if (rtlpriv->use_new_trx_flow)
entry = (u8 *)(&ring->buffer_desc[ring->idx]);
else
entry = (u8 *)(&ring->desc[ring->idx]);
if (!rtlpriv->cfg->ops->is_tx_desc_closed(hw, prio, ring->idx))
return;
Annotation
- Immediate include surface: `wifi.h`, `core.h`, `pci.h`, `base.h`, `ps.h`, `efuse.h`, `linux/interrupt.h`, `linux/export.h`.
- Detected declarations: `function _rtl_mac_to_hwqueue`, `function _rtl_pci_update_default_setting`, `function _rtl_pci_platform_switch_device_pci_aspm`, `function _rtl_pci_switch_clk_req`, `function rtl_pci_disable_aspm`, `function rtl_pci_enable_aspm`, `function rtl_pci_get_amd_l1_patch`, `function rtl_pci_parse_configuration`, `function rtl_pci_init_aspm`, `function _rtl_pci_io_handler_init`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.