drivers/net/wireless/ath/ath9k/htc_drv_main.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/htc_drv_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath9k/htc_drv_main.c- Extension
.c- Size
- 50716 bytes
- Lines
- 1913
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
htc.h
Detected Declarations
function Copyrightfunction ath9k_htc_setpowerfunction ath9k_htc_ps_wakeupfunction ath9k_htc_ps_restorefunction ath9k_ps_workfunction ath9k_htc_vif_iterfunction ath9k_htc_vif_reconfigfunction ath9k_htc_bssid_iterfunction ath9k_htc_set_mac_bssid_maskfunction ath9k_htc_set_opmodefunction ath9k_htc_resetfunction ath9k_htc_set_channelfunction __ath9k_htc_remove_monitor_interfacefunction ath9k_htc_add_monitor_interfacefunction ath9k_htc_remove_monitor_interfacefunction ath9k_htc_add_stationfunction ath9k_htc_remove_stationfunction ath9k_htc_update_cap_targetfunction ath9k_htc_setup_ratefunction ath9k_htc_send_rate_cmdfunction ath9k_htc_init_ratefunction ath9k_htc_update_ratefunction ath9k_htc_tx_aggr_operfunction ath9k_htc_start_anifunction ath9k_htc_stop_anifunction ath9k_htc_ani_workfunction ath9k_htc_txfunction ath9k_htc_startfunction ath9k_htc_stopfunction ath9k_htc_add_interfacefunction ath9k_htc_remove_interfacefunction ath9k_htc_configfunction ath9k_htc_configure_filterfunction ath9k_htc_sta_rc_update_workfunction ath9k_htc_sta_addfunction ath9k_htc_sta_removefunction ath9k_htc_sta_rc_updatefunction ath9k_htc_conf_txfunction ath9k_htc_set_keyfunction ath9k_htc_set_bssidfunction ath9k_htc_bss_iterfunction ath9k_htc_choose_set_bssidfunction ath9k_htc_bss_info_changedfunction ath9k_htc_get_tsffunction ath9k_htc_set_tsffunction ath9k_htc_reset_tsffunction ath9k_htc_ampdu_actionfunction ath9k_htc_sw_scan_start
Annotated Snippet
if (sta->deflink.supp_rates[sband->band] & BIT(i)) {
trate->rates.legacy_rates.rs_rates[j]
= (sband->bitrates[i].bitrate * 2) / 10;
j++;
}
}
trate->rates.legacy_rates.rs_nrates = j;
if (sta->deflink.ht_cap.ht_supported) {
for (i = 0, j = 0; i < 77; i++) {
if (sta->deflink.ht_cap.mcs.rx_mask[i/8] & (1<<(i%8)))
trate->rates.ht_rates.rs_rates[j++] = i;
if (j == ATH_HTC_RATE_MAX)
break;
}
trate->rates.ht_rates.rs_nrates = j;
caps = WLAN_RC_HT_FLAG;
if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_RX_STBC)
caps |= ATH_RC_TX_STBC_FLAG;
if (sta->deflink.ht_cap.mcs.rx_mask[1])
caps |= WLAN_RC_DS_FLAG;
if ((sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) &&
(conf_is_ht40(&priv->hw->conf)))
caps |= WLAN_RC_40_FLAG;
if (conf_is_ht40(&priv->hw->conf) &&
(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40))
caps |= WLAN_RC_SGI_FLAG;
else if (conf_is_ht20(&priv->hw->conf) &&
(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20))
caps |= WLAN_RC_SGI_FLAG;
}
trate->sta_index = ista->index;
trate->isnew = 1;
trate->capflags = cpu_to_be32(caps);
}
static int ath9k_htc_send_rate_cmd(struct ath9k_htc_priv *priv,
struct ath9k_htc_target_rate *trate)
{
struct ath_common *common = ath9k_hw_common(priv->ah);
int ret;
u8 cmd_rsp;
WMI_CMD_BUF(WMI_RC_RATE_UPDATE_CMDID, trate);
if (ret) {
ath_err(common,
"Unable to initialize Rate information on target\n");
}
return ret;
}
static void ath9k_htc_init_rate(struct ath9k_htc_priv *priv,
struct ieee80211_sta *sta)
{
struct ath_common *common = ath9k_hw_common(priv->ah);
struct ath9k_htc_target_rate trate;
int ret;
memset(&trate, 0, sizeof(struct ath9k_htc_target_rate));
ath9k_htc_setup_rate(priv, sta, &trate);
ret = ath9k_htc_send_rate_cmd(priv, &trate);
if (!ret)
ath_dbg(common, CONFIG,
"Updated target sta: %pM, rate caps: 0x%X\n",
sta->addr, be32_to_cpu(trate.capflags));
}
static void ath9k_htc_update_rate(struct ath9k_htc_priv *priv,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf)
{
struct ath_common *common = ath9k_hw_common(priv->ah);
struct ath9k_htc_target_rate trate;
struct ieee80211_sta *sta;
int ret;
memset(&trate, 0, sizeof(struct ath9k_htc_target_rate));
rcu_read_lock();
sta = ieee80211_find_sta(vif, bss_conf->bssid);
if (!sta) {
rcu_read_unlock();
return;
}
ath9k_htc_setup_rate(priv, sta, &trate);
rcu_read_unlock();
Annotation
- Immediate include surface: `htc.h`.
- Detected declarations: `function Copyright`, `function ath9k_htc_setpower`, `function ath9k_htc_ps_wakeup`, `function ath9k_htc_ps_restore`, `function ath9k_ps_work`, `function ath9k_htc_vif_iter`, `function ath9k_htc_vif_reconfig`, `function ath9k_htc_bssid_iter`, `function ath9k_htc_set_mac_bssid_mask`, `function ath9k_htc_set_opmode`.
- 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.