drivers/net/wireless/ath/carl9170/main.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/carl9170/main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/carl9170/main.c- Extension
.c- Size
- 49293 bytes
- Lines
- 2059
- 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
linux/slab.hlinux/module.hlinux/etherdevice.hlinux/random.hnet/mac80211.hnet/cfg80211.hhw.hcarl9170.hcmd.h
Detected Declarations
function carl9170_ampdu_gcfunction carl9170_flushfunction carl9170_flush_bafunction carl9170_zap_queuesfunction carl9170_op_startfunction carl9170_cancel_workerfunction carl9170_op_stopfunction carl9170_restart_workfunction carl9170_restartfunction carl9170_ping_workfunction carl9170_init_interfacefunction carl9170_op_add_interfacefunction carl9170_op_remove_interfacefunction carl9170_ps_checkfunction carl9170_ps_updatefunction carl9170_ps_workfunction carl9170_update_surveyfunction carl9170_stat_workfunction carl9170_op_configfunction carl9170_op_prepare_multicastfunction carl9170_op_configure_filterfunction carl9170_op_bss_info_changedfunction list_for_each_entry_rcufunction carl9170_op_get_tsffunction carl9170_op_set_keyfunction carl9170_op_sta_addfunction carl9170_op_sta_removefunction carl9170_op_conf_txfunction carl9170_ampdu_workfunction carl9170_op_ampdu_actionfunction carl9170_register_wps_buttonfunction carl9170_rng_getfunction carl9170_rng_readfunction carl9170_register_hwrngfunction carl9170_op_get_surveyfunction carl9170_op_flushfunction carl9170_op_get_statsfunction carl9170_op_sta_notifyfunction carl9170_tx_frames_pendingfunction carl9170_read_eepromfunction carl9170_parse_eepromfunction carl9170_reg_notifierfunction carl9170_registerfunction carl9170_unregisterfunction carl9170_free
Annotated Snippet
if (tid_info->state == CARL9170_TID_STATE_SHUTDOWN) {
tid_info->state = CARL9170_TID_STATE_KILLED;
list_del_rcu(&tid_info->list);
ar->tx_ampdu_list_len--;
list_add_tail(&tid_info->tmp_list, &tid_gc);
}
spin_unlock_bh(&ar->tx_ampdu_list_lock);
}
rcu_assign_pointer(ar->tx_ampdu_iter, tid_info);
rcu_read_unlock();
synchronize_rcu();
while (!list_empty(&tid_gc)) {
struct sk_buff *skb;
tid_info = list_first_entry(&tid_gc, struct carl9170_sta_tid,
tmp_list);
while ((skb = __skb_dequeue(&tid_info->queue)))
carl9170_tx_status(ar, skb, false);
list_del_init(&tid_info->tmp_list);
kfree(tid_info);
}
}
static void carl9170_flush(struct ar9170 *ar, bool drop_queued)
{
if (drop_queued) {
int i;
/*
* We can only drop frames which have not been uploaded
* to the device yet.
*/
for (i = 0; i < ar->hw->queues; i++) {
struct sk_buff *skb;
while ((skb = skb_dequeue(&ar->tx_pending[i]))) {
struct ieee80211_tx_info *info;
info = IEEE80211_SKB_CB(skb);
if (info->flags & IEEE80211_TX_CTL_AMPDU)
atomic_dec(&ar->tx_ampdu_upload);
carl9170_tx_status(ar, skb, false);
}
}
}
/* Wait for all other outstanding frames to timeout. */
if (atomic_read(&ar->tx_total_queued))
WARN_ON(wait_for_completion_timeout(&ar->tx_flush, HZ) == 0);
}
static void carl9170_flush_ba(struct ar9170 *ar)
{
struct sk_buff_head free;
struct carl9170_sta_tid *tid_info;
struct sk_buff *skb;
__skb_queue_head_init(&free);
rcu_read_lock();
spin_lock_bh(&ar->tx_ampdu_list_lock);
list_for_each_entry_rcu(tid_info, &ar->tx_ampdu_list, list) {
if (tid_info->state > CARL9170_TID_STATE_SUSPEND) {
tid_info->state = CARL9170_TID_STATE_SUSPEND;
spin_lock(&tid_info->lock);
while ((skb = __skb_dequeue(&tid_info->queue)))
__skb_queue_tail(&free, skb);
spin_unlock(&tid_info->lock);
}
}
spin_unlock_bh(&ar->tx_ampdu_list_lock);
rcu_read_unlock();
while ((skb = __skb_dequeue(&free)))
carl9170_tx_status(ar, skb, false);
}
static void carl9170_zap_queues(struct ar9170 *ar)
{
struct carl9170_vif_info *cvif;
unsigned int i;
carl9170_ampdu_gc(ar);
Annotation
- Immediate include surface: `linux/slab.h`, `linux/module.h`, `linux/etherdevice.h`, `linux/random.h`, `net/mac80211.h`, `net/cfg80211.h`, `hw.h`, `carl9170.h`.
- Detected declarations: `function carl9170_ampdu_gc`, `function carl9170_flush`, `function carl9170_flush_ba`, `function carl9170_zap_queues`, `function carl9170_op_start`, `function carl9170_cancel_worker`, `function carl9170_op_stop`, `function carl9170_restart_work`, `function carl9170_restart`, `function carl9170_ping_work`.
- 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.