drivers/net/wireless/ath/ath9k/gpio.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/gpio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath9k/gpio.c- Extension
.c- Size
- 14370 bytes
- Lines
- 521
- 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
ath9k.h
Detected Declarations
function Copyrightfunction ath_led_brightnessfunction ath_deinit_ledsfunction ath_init_ledsfunction ath_is_rfkill_setfunction ath9k_rfkill_poll_statefunction ath_start_rfkill_pollfunction ath_detect_bt_priorityfunction ath_mci_ftp_adjustfunction ath_btcoex_period_timerfunction ath_btcoex_no_stomp_timerfunction ath_init_btcoex_timerfunction ath9k_btcoex_timer_resumefunction ath9k_btcoex_timer_pausefunction ath9k_btcoex_stop_gen_timerfunction ath9k_btcoex_aggr_limitfunction ath9k_btcoex_handle_interruptfunction ath9k_start_btcoexfunction ath9k_stop_btcoexfunction ath9k_deinit_btcoexfunction ath9k_init_btcoexfunction ath9k_dump_mci_btcoexfunction ath9k_dump_legacy_btcoexfunction ath9k_dump_btcoex
Annotated Snippet
msecs_to_jiffies(ATH_BT_PRIORITY_TIME_THRESHOLD))) {
clear_bit(BT_OP_PRIORITY_DETECTED, &btcoex->op_flags);
clear_bit(BT_OP_SCAN, &btcoex->op_flags);
/* Detect if colocated bt started scanning */
if (btcoex->bt_priority_cnt >= ATH_BT_CNT_SCAN_THRESHOLD) {
ath_dbg(ath9k_hw_common(sc->sc_ah), BTCOEX,
"BT scan detected\n");
set_bit(BT_OP_PRIORITY_DETECTED, &btcoex->op_flags);
set_bit(BT_OP_SCAN, &btcoex->op_flags);
} else if (btcoex->bt_priority_cnt >= ATH_BT_CNT_THRESHOLD) {
ath_dbg(ath9k_hw_common(sc->sc_ah), BTCOEX,
"BT priority traffic detected\n");
set_bit(BT_OP_PRIORITY_DETECTED, &btcoex->op_flags);
}
btcoex->bt_priority_cnt = 0;
btcoex->bt_priority_time = jiffies;
}
}
static void ath_mci_ftp_adjust(struct ath_softc *sc)
{
struct ath_btcoex *btcoex = &sc->btcoex;
struct ath_mci_profile *mci = &btcoex->mci;
struct ath_hw *ah = sc->sc_ah;
if (btcoex->bt_wait_time > ATH_BTCOEX_RX_WAIT_TIME) {
if (ar9003_mci_state(ah, MCI_STATE_NEED_FTP_STOMP) &&
(mci->num_pan || mci->num_other_acl))
ah->btcoex_hw.mci.stomp_ftp =
(sc->rx.num_pkts < ATH_BTCOEX_STOMP_FTP_THRESH);
else
ah->btcoex_hw.mci.stomp_ftp = false;
btcoex->bt_wait_time = 0;
sc->rx.num_pkts = 0;
}
}
/*
* This is the master bt coex timer which runs for every
* 45ms, bt traffic will be given priority during 55% of this
* period while wlan gets remaining 45%
*/
static void ath_btcoex_period_timer(struct timer_list *t)
{
struct ath_softc *sc = timer_container_of(sc, t, btcoex.period_timer);
struct ath_hw *ah = sc->sc_ah;
struct ath_btcoex *btcoex = &sc->btcoex;
enum ath_stomp_type stomp_type;
u32 timer_period;
unsigned long flags;
spin_lock_irqsave(&sc->sc_pm_lock, flags);
if (sc->sc_ah->power_mode == ATH9K_PM_NETWORK_SLEEP) {
btcoex->bt_wait_time += btcoex->btcoex_period;
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
goto skip_hw_wakeup;
}
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
ath9k_ps_wakeup(sc);
spin_lock_bh(&btcoex->btcoex_lock);
if (ah->caps.hw_caps & ATH9K_HW_CAP_MCI) {
ath9k_mci_update_rssi(sc);
ath_mci_ftp_adjust(sc);
}
if (!(ah->caps.hw_caps & ATH9K_HW_CAP_MCI))
ath_detect_bt_priority(sc);
stomp_type = btcoex->bt_stomp_type;
timer_period = btcoex->btcoex_no_stomp;
if (!(ah->caps.hw_caps & ATH9K_HW_CAP_MCI)) {
if (test_bit(BT_OP_SCAN, &btcoex->op_flags)) {
stomp_type = ATH_BTCOEX_STOMP_ALL;
timer_period = btcoex->btscan_no_stomp;
}
} else if (btcoex->stomp_audio >= 5) {
stomp_type = ATH_BTCOEX_STOMP_AUDIO;
btcoex->stomp_audio = 0;
}
ath9k_hw_btcoex_bt_stomp(ah, stomp_type);
ath9k_hw_btcoex_enable(ah);
spin_unlock_bh(&btcoex->btcoex_lock);
if (btcoex->btcoex_period != btcoex->btcoex_no_stomp)
Annotation
- Immediate include surface: `ath9k.h`.
- Detected declarations: `function Copyright`, `function ath_led_brightness`, `function ath_deinit_leds`, `function ath_init_leds`, `function ath_is_rfkill_set`, `function ath9k_rfkill_poll_state`, `function ath_start_rfkill_poll`, `function ath_detect_bt_priority`, `function ath_mci_ftp_adjust`, `function ath_btcoex_period_timer`.
- 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.