drivers/net/wireless/ath/wil6210/main.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/wil6210/main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/wil6210/main.c- Extension
.c- Size
- 53121 bytes
- Lines
- 2014
- 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.
- 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
linux/moduleparam.hlinux/if_arp.hlinux/etherdevice.hlinux/rtnetlink.hwil6210.htxrx.htxrx_edma.hwmi.hboot_loader.h
Detected Declarations
function mtu_max_setfunction ring_order_setfunction wil_memcpy_fromio_32function wil_memcpy_toio_32function wil_mem_access_lockfunction wil_mem_access_unlockfunction wil_ring_fini_txfunction wil_vif_is_connectedfunction wil_disconnect_cid_completefunction _wil6210_disconnect_completefunction wil_disconnect_cidfunction _wil6210_disconnectfunction wil_disconnect_workerfunction wil_wait_for_recoveryfunction wil_set_recovery_statefunction wil_is_recovery_blockedfunction wil_fw_error_workerfunction wil_find_free_ringfunction wil_ring_init_txfunction wil_bcast_initfunction wil_bcast_finifunction wil_bcast_fini_allfunction wil_priv_initfunction wil6210_bus_requestfunction commandfunction wil6210_disconnect_completefunction wil_priv_deinitfunction wil_shutdown_blfunction ARC_me_imm32function wil_freeze_blfunction wil_bl_prepare_haltfunction wil_halt_cpufunction wil_release_cpufunction wil_set_oob_modefunction wil_wait_device_readyfunction wil_wait_device_ready_talyn_mbfunction wil_target_resetfunction wil_collect_fw_infofunction wil_refresh_fw_capabilitiesfunction wil_mbox_ring_le2cpusfunction wil_get_board_filefunction wil_get_bl_infofunction wil_bl_crash_infofunction wil_get_otp_infofunction wil_wait_for_fw_readyfunction wil_abort_scanfunction wil_abort_scan_all_vifsfunction wil_ps_update
Annotated Snippet
test_bit(wil_status_suspended, wil->status)) {
up_read(&wil->mem_lock);
return -EBUSY;
}
return 0;
}
void wil_mem_access_unlock(struct wil6210_priv *wil)
{
up_read(&wil->mem_lock);
}
static void wil_ring_fini_tx(struct wil6210_priv *wil, int id)
{
struct wil_ring *ring = &wil->ring_tx[id];
struct wil_ring_tx_data *txdata = &wil->ring_tx_data[id];
lockdep_assert_held(&wil->mutex);
if (!ring->va)
return;
wil_dbg_misc(wil, "vring_fini_tx: id=%d\n", id);
spin_lock_bh(&txdata->lock);
txdata->dot1x_open = false;
txdata->mid = U8_MAX;
txdata->enabled = 0; /* no Tx can be in progress or start anew */
spin_unlock_bh(&txdata->lock);
/* napi_synchronize waits for completion of the current NAPI but will
* not prevent the next NAPI run.
* Add a memory barrier to guarantee that txdata->enabled is zeroed
* before napi_synchronize so that the next scheduled NAPI will not
* handle this vring
*/
wmb();
/* make sure NAPI won't touch this vring */
if (test_bit(wil_status_napi_en, wil->status))
napi_synchronize(&wil->napi_tx);
wil->txrx_ops.ring_fini_tx(wil, ring);
}
static bool wil_vif_is_connected(struct wil6210_priv *wil, u8 mid)
{
int i;
for (i = 0; i < wil->max_assoc_sta; i++) {
if (wil->sta[i].mid == mid &&
wil->sta[i].status == wil_sta_connected)
return true;
}
return false;
}
static void wil_disconnect_cid_complete(struct wil6210_vif *vif, int cid,
u16 reason_code)
__acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
{
uint i;
struct wil6210_priv *wil = vif_to_wil(vif);
struct wireless_dev *wdev = vif_to_wdev(vif);
struct wil_sta_info *sta = &wil->sta[cid];
int min_ring_id = wil_get_min_tx_ring_id(wil);
might_sleep();
wil_dbg_misc(wil,
"disconnect_cid_complete: CID %d, MID %d, status %d\n",
cid, sta->mid, sta->status);
/* inform upper layers */
if (sta->status != wil_sta_unused) {
if (vif->mid != sta->mid) {
wil_err(wil, "STA MID mismatch with VIF MID(%d)\n",
vif->mid);
}
switch (wdev->iftype) {
case NL80211_IFTYPE_AP:
case NL80211_IFTYPE_P2P_GO:
/* AP-like interface */
cfg80211_del_sta(wdev, sta->addr, GFP_KERNEL);
break;
default:
break;
}
sta->status = wil_sta_unused;
sta->mid = U8_MAX;
}
Annotation
- Immediate include surface: `linux/moduleparam.h`, `linux/if_arp.h`, `linux/etherdevice.h`, `linux/rtnetlink.h`, `wil6210.h`, `txrx.h`, `txrx_edma.h`, `wmi.h`.
- Detected declarations: `function mtu_max_set`, `function ring_order_set`, `function wil_memcpy_fromio_32`, `function wil_memcpy_toio_32`, `function wil_mem_access_lock`, `function wil_mem_access_unlock`, `function wil_ring_fini_tx`, `function wil_vif_is_connected`, `function wil_disconnect_cid_complete`, `function _wil6210_disconnect_complete`.
- 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.
- 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.