drivers/net/wireless/intel/iwlwifi/mld/mld.c

Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mld/mld.c

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/intel/iwlwifi/mld/mld.c
Extension
.c
Size
21449 bytes
Lines
791
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.

Dependency Surface

Detected Declarations

Annotated Snippet

module_init(iwl_mld_init);

static void __exit iwl_mld_exit(void)
{
	iwl_opmode_deregister("iwlmld");
}
module_exit(iwl_mld_exit);

static void iwl_mld_hw_set_regulatory(struct iwl_mld *mld)
{
	struct wiphy *wiphy = mld->wiphy;

	wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED;
	wiphy->regulatory_flags |= REGULATORY_ENABLE_RELAX_NO_IR;
}

VISIBLE_IF_IWLWIFI_KUNIT
void iwl_construct_mld(struct iwl_mld *mld, struct iwl_trans *trans,
		       const struct iwl_rf_cfg *cfg, const struct iwl_fw *fw,
		       struct ieee80211_hw *hw, struct dentry *dbgfs_dir)
{
	mld->dev = trans->dev;
	mld->trans = trans;
	mld->cfg = cfg;
	mld->fw = fw;
	mld->hw = hw;
	mld->wiphy = hw->wiphy;
	mld->debugfs_dir = dbgfs_dir;

	iwl_notification_wait_init(&mld->notif_wait);

	/* Setup async RX handling */
	spin_lock_init(&mld->async_handlers_lock);
	INIT_LIST_HEAD(&mld->async_handlers_list);
	wiphy_work_init(&mld->async_handlers_wk,
			iwl_mld_async_handlers_wk);

	/* Dynamic Queue Allocation */
	spin_lock_init(&mld->add_txqs_lock);
	INIT_LIST_HEAD(&mld->txqs_to_add);
	wiphy_work_init(&mld->add_txqs_wk, iwl_mld_add_txqs_wk);

	/* Setup RX queues sync wait queue */
	init_waitqueue_head(&mld->rxq_sync.waitq);
}
EXPORT_SYMBOL_IF_IWLWIFI_KUNIT(iwl_construct_mld);

static void __acquires(&mld->wiphy->mtx)
iwl_mld_fwrt_dump_start(void *ctx)
{
	struct iwl_mld *mld = ctx;

	wiphy_lock(mld->wiphy);
}

static void __releases(&mld->wiphy->mtx)
iwl_mld_fwrt_dump_end(void *ctx)
{
	struct iwl_mld *mld = ctx;

	wiphy_unlock(mld->wiphy);
}

static bool iwl_mld_d3_debug_enable(void *ctx)
{
	return IWL_MLD_D3_DEBUG;
}

static int iwl_mld_fwrt_send_hcmd(void *ctx, struct iwl_host_cmd *host_cmd)
{
	struct iwl_mld *mld = (struct iwl_mld *)ctx;
	int ret;

	wiphy_lock(mld->wiphy);
	ret = iwl_mld_send_cmd(mld, host_cmd);
	wiphy_unlock(mld->wiphy);

	return ret;
}

static const struct iwl_fw_runtime_ops iwl_mld_fwrt_ops = {
	.dump_start = iwl_mld_fwrt_dump_start,
	.dump_end = iwl_mld_fwrt_dump_end,
	.send_hcmd = iwl_mld_fwrt_send_hcmd,
	.d3_debug_enable = iwl_mld_d3_debug_enable,
};

static void
iwl_mld_construct_fw_runtime(struct iwl_mld *mld, struct iwl_trans *trans,
			     const struct iwl_fw *fw,

Annotation

Implementation Notes