drivers/net/wireless/intel/iwlwifi/dvm/ucode.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/dvm/ucode.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/dvm/ucode.c- Extension
.c- Size
- 11326 bytes
- Lines
- 417
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hiwl-io.hiwl-agn-hw.hiwl-trans.hiwl-fh.hiwl-op-mode.hdev.hagn.hcalib.h
Detected Declarations
struct iwl_alive_datafunction Copyrightfunction iwl_set_temperature_offset_calibfunction iwl_set_temperature_offset_calib_v2function iwl_send_calib_cfgfunction iwl_init_alive_startfunction iwl_send_wimax_coexfunction iwl_send_prio_tblfunction iwl_send_bt_envfunction iwl_alive_notifyfunction iwl_alive_fnfunction iwl_load_ucode_wait_alivefunction iwlagn_wait_calibfunction iwl_run_init_ucode
Annotated Snippet
struct iwl_alive_data {
bool valid;
u8 subtype;
};
static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,
struct iwl_rx_packet *pkt, void *data)
{
struct iwl_priv *priv =
container_of(notif_wait, struct iwl_priv, notif_wait);
struct iwl_alive_data *alive_data = data;
struct iwl_alive_resp *palive;
palive = (void *)pkt->data;
IWL_DEBUG_FW(priv, "Alive ucode status 0x%08X revision "
"0x%01X 0x%01X\n",
palive->is_valid, palive->ver_type,
palive->ver_subtype);
priv->device_pointers.error_event_table =
le32_to_cpu(palive->error_event_table_ptr);
priv->device_pointers.log_event_table =
le32_to_cpu(palive->log_event_table_ptr);
alive_data->subtype = palive->ver_subtype;
alive_data->valid = palive->is_valid == UCODE_VALID_OK;
return true;
}
#define UCODE_ALIVE_TIMEOUT HZ
#define UCODE_CALIB_TIMEOUT (2*HZ)
int iwl_load_ucode_wait_alive(struct iwl_priv *priv,
enum iwl_ucode_type ucode_type)
{
struct iwl_notification_wait alive_wait;
struct iwl_alive_data alive_data;
int ret;
enum iwl_ucode_type old_type;
static const u16 alive_cmd[] = { REPLY_ALIVE };
old_type = priv->cur_ucode;
priv->cur_ucode = ucode_type;
priv->ucode_loaded = false;
iwl_init_notification_wait(&priv->notif_wait, &alive_wait,
alive_cmd, ARRAY_SIZE(alive_cmd),
iwl_alive_fn, &alive_data);
ret = iwl_trans_start_fw(priv->trans, priv->fw, ucode_type, false);
if (ret) {
priv->cur_ucode = old_type;
iwl_remove_notification(&priv->notif_wait, &alive_wait);
return ret;
}
/*
* Some things may run in the background now, but we
* just wait for the ALIVE notification here.
*/
ret = iwl_wait_notification(&priv->notif_wait, &alive_wait,
UCODE_ALIVE_TIMEOUT);
if (ret) {
priv->cur_ucode = old_type;
return ret;
}
if (!alive_data.valid) {
IWL_ERR(priv, "Loaded ucode is not valid!\n");
priv->cur_ucode = old_type;
return -EIO;
}
priv->ucode_loaded = true;
if (ucode_type != IWL_UCODE_WOWLAN) {
/* delay a bit to give rfkill time to run */
msleep(5);
}
ret = iwl_alive_notify(priv);
if (ret) {
IWL_WARN(priv,
"Could not complete ALIVE transition: %d\n", ret);
priv->cur_ucode = old_type;
return ret;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `iwl-io.h`, `iwl-agn-hw.h`, `iwl-trans.h`, `iwl-fh.h`, `iwl-op-mode.h`, `dev.h`, `agn.h`.
- Detected declarations: `struct iwl_alive_data`, `function Copyright`, `function iwl_set_temperature_offset_calib`, `function iwl_set_temperature_offset_calib_v2`, `function iwl_send_calib_cfg`, `function iwl_init_alive_start`, `function iwl_send_wimax_coex`, `function iwl_send_prio_tbl`, `function iwl_send_bt_env`, `function iwl_alive_notify`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.