drivers/net/wireless/intel/iwlwifi/dvm/scan.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/dvm/scan.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/dvm/scan.c- Extension
.c- Size
- 29522 bytes
- Lines
- 1063
- 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/types.hlinux/etherdevice.hnet/mac80211.hdev.hagn.h
Detected Declarations
function Copyrightfunction iwl_complete_scanfunction iwl_process_scan_completefunction iwl_force_scan_endfunction iwl_do_scan_abortfunction iwl_scan_cancelfunction iwl_scan_cancel_timeoutfunction iwl_rx_reply_scanfunction iwl_rx_scan_start_notiffunction iwl_rx_scan_results_notiffunction iwl_rx_scan_complete_notiffunction iwl_setup_rx_scan_handlersfunction iwl_get_active_dwell_timefunction iwl_limit_dwellfunction intervalfunction iwl_get_passive_dwell_timefunction iwl_get_single_channel_numberfunction for_each_contextfunction iwl_get_channel_for_reset_scanfunction iwl_get_channels_for_scanfunction iwl_fill_probe_reqfunction iwlagn_request_scanfunction iwl_init_scan_paramsfunction iwl_scan_initiatefunction iwl_internal_short_hw_scanfunction iwl_bg_start_internal_scanfunction iwl_bg_scan_checkfunction iwl_bg_abort_scanfunction iwl_bg_scan_completedfunction iwl_setup_scan_deferred_workfunction iwl_cancel_scan_deferred_work
Annotated Snippet
if (err) {
IWL_DEBUG_SCAN(priv,
"failed to initiate pending scan: %d\n", err);
aborted = true;
goto out_complete;
}
return;
}
out_complete:
iwl_complete_scan(priv, aborted);
out_settings:
/* Can we still talk to firmware ? */
if (!iwl_is_ready_rf(priv))
return;
iwlagn_post_scan(priv);
}
void iwl_force_scan_end(struct iwl_priv *priv)
{
lockdep_assert_held(&priv->mutex);
if (!test_bit(STATUS_SCANNING, &priv->status)) {
IWL_DEBUG_SCAN(priv, "Forcing scan end while not scanning\n");
return;
}
IWL_DEBUG_SCAN(priv, "Forcing scan end\n");
clear_bit(STATUS_SCANNING, &priv->status);
clear_bit(STATUS_SCAN_HW, &priv->status);
clear_bit(STATUS_SCAN_ABORTING, &priv->status);
clear_bit(STATUS_SCAN_COMPLETE, &priv->status);
iwl_complete_scan(priv, true);
}
static void iwl_do_scan_abort(struct iwl_priv *priv)
{
int ret;
lockdep_assert_held(&priv->mutex);
if (!test_bit(STATUS_SCANNING, &priv->status)) {
IWL_DEBUG_SCAN(priv, "Not performing scan to abort\n");
return;
}
if (test_and_set_bit(STATUS_SCAN_ABORTING, &priv->status)) {
IWL_DEBUG_SCAN(priv, "Scan abort in progress\n");
return;
}
ret = iwl_send_scan_abort(priv);
if (ret) {
IWL_DEBUG_SCAN(priv, "Send scan abort failed %d\n", ret);
iwl_force_scan_end(priv);
} else
IWL_DEBUG_SCAN(priv, "Successfully send scan abort\n");
}
/*
* iwl_scan_cancel - Cancel any currently executing HW scan
*/
int iwl_scan_cancel(struct iwl_priv *priv)
{
IWL_DEBUG_SCAN(priv, "Queuing abort scan\n");
queue_work(priv->workqueue, &priv->abort_scan);
return 0;
}
/*
* iwl_scan_cancel_timeout - Cancel any currently executing HW scan
* @ms: amount of time to wait (in milliseconds) for scan to abort
*/
void iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
{
unsigned long timeout = jiffies + msecs_to_jiffies(ms);
lockdep_assert_held(&priv->mutex);
IWL_DEBUG_SCAN(priv, "Scan cancel timeout\n");
iwl_do_scan_abort(priv);
while (time_before_eq(jiffies, timeout)) {
if (!test_bit(STATUS_SCAN_HW, &priv->status))
goto finished;
msleep(20);
Annotation
- Immediate include surface: `linux/slab.h`, `linux/types.h`, `linux/etherdevice.h`, `net/mac80211.h`, `dev.h`, `agn.h`.
- Detected declarations: `function Copyright`, `function iwl_complete_scan`, `function iwl_process_scan_complete`, `function iwl_force_scan_end`, `function iwl_do_scan_abort`, `function iwl_scan_cancel`, `function iwl_scan_cancel_timeout`, `function iwl_rx_reply_scan`, `function iwl_rx_scan_start_notif`, `function iwl_rx_scan_results_notif`.
- 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.