drivers/net/wireless/ath/ath9k/htc_drv_init.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/htc_drv_init.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath9k/htc_drv_init.c- Extension
.c- Size
- 26202 bytes
- Lines
- 1024
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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
htc.h
Detected Declarations
function ath9k_htc_op_ps_wakeupfunction ath9k_htc_op_ps_restorefunction ath9k_htc_wait_for_targetfunction ath9k_deinit_privfunction ath9k_deinit_devicefunction ath9k_htc_connect_svcfunction ath9k_init_htc_servicesfunction ath9k_reg_notifierfunction ath9k_regreadfunction ath9k_multi_regreadfunction ath9k_regwrite_multifunction ath9k_regwrite_singlefunction ath9k_regwrite_bufferfunction ath9k_regwritefunction ath9k_enable_regwrite_bufferfunction ath9k_regwrite_flushfunction ath9k_reg_rmw_bufferfunction ath9k_reg_rmw_flushfunction ath9k_enable_rmw_bufferfunction ath9k_reg_rmw_singlefunction ath9k_reg_rmwfunction ath_usb_read_cachesizefunction ath_usb_eeprom_readfunction ath9k_init_queuesfunction ath9k_init_miscfunction ath9k_init_privfunction ath9k_set_hw_capabfunction ath9k_init_firmware_versionfunction ath9k_init_devicefunction ath9k_htc_probe_devicefunction ath9k_htc_disconnect_devicefunction ath9k_htc_suspendfunction ath9k_htc_resume
Annotated Snippet
if (unlikely(r)) {
ath_dbg(common, WMI,
"REGISTER RMW FAILED, multi len: %d\n",
priv->wmi->multi_rmw_idx);
}
priv->wmi->multi_rmw_idx = 0;
}
mutex_unlock(&priv->wmi->multi_rmw_mutex);
}
static void ath9k_reg_rmw_flush(void *hw_priv)
{
struct ath_hw *ah = hw_priv;
struct ath_common *common = ath9k_hw_common(ah);
struct ath9k_htc_priv *priv = common->priv;
u32 rsp_status;
int r;
if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags))
return;
atomic_dec(&priv->wmi->m_rmw_cnt);
mutex_lock(&priv->wmi->multi_rmw_mutex);
if (priv->wmi->multi_rmw_idx) {
r = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID,
(u8 *) &priv->wmi->multi_rmw,
sizeof(struct register_rmw) * priv->wmi->multi_rmw_idx,
(u8 *) &rsp_status, sizeof(rsp_status),
100);
if (unlikely(r)) {
ath_dbg(common, WMI,
"REGISTER RMW FAILED, multi len: %d\n",
priv->wmi->multi_rmw_idx);
}
priv->wmi->multi_rmw_idx = 0;
}
mutex_unlock(&priv->wmi->multi_rmw_mutex);
}
static void ath9k_enable_rmw_buffer(void *hw_priv)
{
struct ath_hw *ah = hw_priv;
struct ath_common *common = ath9k_hw_common(ah);
struct ath9k_htc_priv *priv = common->priv;
if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags))
return;
atomic_inc(&priv->wmi->m_rmw_cnt);
}
static void ath9k_reg_rmw_single(void *hw_priv,
u32 reg_offset, u32 set, u32 clr)
{
struct ath_hw *ah = hw_priv;
struct ath_common *common = ath9k_hw_common(ah);
struct ath9k_htc_priv *priv = common->priv;
struct register_rmw buf, buf_ret;
int ret;
buf.reg = cpu_to_be32(reg_offset);
buf.set = cpu_to_be32(set);
buf.clr = cpu_to_be32(clr);
ret = ath9k_wmi_cmd(priv->wmi, WMI_REG_RMW_CMDID,
(u8 *) &buf, sizeof(buf),
(u8 *) &buf_ret, sizeof(buf_ret),
100);
if (unlikely(ret)) {
ath_dbg(common, WMI, "REGISTER RMW FAILED:(0x%04x, %d)\n",
reg_offset, ret);
}
}
static u32 ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr)
{
struct ath_hw *ah = hw_priv;
struct ath_common *common = ath9k_hw_common(ah);
struct ath9k_htc_priv *priv = common->priv;
if (test_bit(HTC_FWFLAG_NO_RMW, &priv->fw_flags)) {
u32 val;
val = REG_READ(ah, reg_offset);
val &= ~clr;
val |= set;
Annotation
- Immediate include surface: `htc.h`.
- Detected declarations: `function ath9k_htc_op_ps_wakeup`, `function ath9k_htc_op_ps_restore`, `function ath9k_htc_wait_for_target`, `function ath9k_deinit_priv`, `function ath9k_deinit_device`, `function ath9k_htc_connect_svc`, `function ath9k_init_htc_services`, `function ath9k_reg_notifier`, `function ath9k_regread`, `function ath9k_multi_regread`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.