drivers/net/wireless/marvell/mwifiex/init.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/marvell/mwifiex/init.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/marvell/mwifiex/init.c- Extension
.c- Size
- 20000 bytes
- Lines
- 719
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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
decl.hioctl.hutil.hfw.hmain.hwmm.h11n.h
Detected Declarations
function mwifiex_add_bss_prio_tblfunction wakeup_timer_fnfunction fw_dump_workfunction mwifiex_init_privfunction mwifiex_allocate_adapterfunction mwifiex_init_adapterfunction mwifiex_set_trans_startfunction mwifiex_wake_up_net_dev_queuefunction mwifiex_stop_net_dev_queuefunction mwifiex_invalidate_listsfunction mwifiex_adapter_cleanupfunction mwifiex_free_cmd_buffersfunction mwifiex_init_lock_listfunction mwifiex_init_fwfunction mwifiex_delete_bss_prio_tblfunction list_for_each_entry_safefunction mwifiex_free_privfunction mwifiex_shutdown_drvfunction mwifiex_dnld_fwexport mwifiex_dnld_fw
Annotated Snippet
if (bssprio_node->priv == priv) {
mwifiex_dbg(adapter, INFO,
"info: Delete\t"
"node %p, next = %p\n",
bssprio_node, tmp_node);
list_del(&bssprio_node->list);
kfree(bssprio_node);
}
}
spin_unlock_bh(lock);
}
}
}
/*
* This function frees the private structure, including cleans
* up the TX and RX queues and frees the BSS priority tables.
*/
void mwifiex_free_priv(struct mwifiex_private *priv)
{
mwifiex_clean_txrx(priv);
mwifiex_delete_bss_prio_tbl(priv);
mwifiex_free_curr_bcn(priv);
}
/*
* This function is used to shutdown the driver.
*
* The following operations are performed sequentially -
* - Check if already shut down
* - Make sure the main process has stopped
* - Clean up the Tx and Rx queues
* - Delete BSS priority tables
* - Free the adapter
* - Notify completion
*/
void
mwifiex_shutdown_drv(struct mwifiex_adapter *adapter)
{
struct mwifiex_private *priv;
s32 i;
struct sk_buff *skb;
/* mwifiex already shutdown */
if (adapter->hw_status == MWIFIEX_HW_STATUS_NOT_READY)
return;
/* cancel current command */
if (adapter->curr_cmd) {
mwifiex_dbg(adapter, WARN,
"curr_cmd is still in processing\n");
timer_delete_sync(&adapter->cmd_timer);
mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd);
adapter->curr_cmd = NULL;
}
/* shut down mwifiex */
mwifiex_dbg(adapter, MSG,
"info: shutdown mwifiex...\n");
/* Clean up Tx/Rx queues and delete BSS priority table */
for (i = 0; i < adapter->priv_num; i++) {
priv = adapter->priv[i];
mwifiex_clean_auto_tdls(priv);
mwifiex_abort_cac(priv);
mwifiex_free_priv(priv);
}
atomic_set(&adapter->tx_queued, 0);
while ((skb = skb_dequeue(&adapter->tx_data_q)))
mwifiex_write_data_complete(adapter, skb, 0, 0);
spin_lock_bh(&adapter->rx_proc_lock);
while ((skb = skb_dequeue(&adapter->rx_data_q))) {
struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb);
atomic_dec(&adapter->rx_pending);
priv = adapter->priv[rx_info->bss_num];
if (priv)
priv->stats.rx_dropped++;
dev_kfree_skb_any(skb);
}
spin_unlock_bh(&adapter->rx_proc_lock);
mwifiex_adapter_cleanup(adapter);
Annotation
- Immediate include surface: `decl.h`, `ioctl.h`, `util.h`, `fw.h`, `main.h`, `wmm.h`, `11n.h`.
- Detected declarations: `function mwifiex_add_bss_prio_tbl`, `function wakeup_timer_fn`, `function fw_dump_work`, `function mwifiex_init_priv`, `function mwifiex_allocate_adapter`, `function mwifiex_init_adapter`, `function mwifiex_set_trans_start`, `function mwifiex_wake_up_net_dev_queue`, `function mwifiex_stop_net_dev_queue`, `function mwifiex_invalidate_lists`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.