drivers/net/wireless/intel/iwlwifi/dvm/rxon.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/dvm/rxon.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/dvm/rxon.c- Extension
.c- Size
- 44772 bytes
- Lines
- 1548
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/etherdevice.hiwl-trans.hiwl-modparams.hdev.hagn.hcalib.h
Detected Declarations
function Copyrightfunction iwlagn_disable_bssfunction iwlagn_disable_panfunction iwlagn_disconn_panfunction iwlagn_update_qosfunction iwlagn_update_beaconfunction iwlagn_send_rxon_assocfunction iwl_adjust_beacon_intervalfunction iwl_send_rxon_timingfunction iwl_is_associatedfunction iwlagn_rxon_disconnfunction iwl_set_tx_powerfunction iwlagn_rxon_connectfunction iwlagn_set_pan_paramsfunction _iwl_set_rxon_htfunction iwl_set_rxon_htfunction iwl_set_rxon_channelfunction iwl_set_flags_for_bandfunction iwl_set_rxon_hwcryptofunction iwl_check_rxon_cmdfunction tunefunction iwl_print_rx_config_cmdfunction iwl_calc_basic_ratesfunction for_each_set_bitfunction iwlagn_commit_rxonfunction iwlagn_config_ht40function iwlagn_mac_configfunction for_each_contextfunction iwlagn_check_needed_chainsfunction iwlagn_chain_noise_resetfunction iwlagn_bss_info_changedfunction iwlagn_post_scan
Annotated Snippet
if (ctx->vif) {
ret = iwl_send_rxon_timing(priv, ctx);
if (ret) {
IWL_ERR(priv, "Failed to send timing (%d)!\n", ret);
return ret;
}
ret = iwlagn_disconn_pan(priv, ctx, &ctx->staging);
}
}
if (ret)
return ret;
/*
* Un-assoc RXON clears the station table and WEP
* keys, so we have to restore those afterwards.
*/
iwl_clear_ucode_stations(priv, ctx);
/* update -- might need P2P now */
iwl_update_bcast_station(priv, ctx);
iwl_restore_stations(priv, ctx);
ret = iwl_restore_default_wep_keys(priv, ctx);
if (ret) {
IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret);
return ret;
}
memcpy(active, &ctx->staging, sizeof(*active));
return 0;
}
static int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
{
int ret;
s8 prev_tx_power;
bool defer;
struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
if (priv->calib_disabled & IWL_TX_POWER_CALIB_DISABLED)
return 0;
lockdep_assert_held(&priv->mutex);
if (priv->tx_power_user_lmt == tx_power && !force)
return 0;
if (tx_power < IWLAGN_TX_POWER_TARGET_POWER_MIN) {
IWL_WARN(priv,
"Requested user TXPOWER %d below lower limit %d.\n",
tx_power,
IWLAGN_TX_POWER_TARGET_POWER_MIN);
return -EINVAL;
}
if (tx_power > DIV_ROUND_UP(priv->nvm_data->max_tx_pwr_half_dbm, 2)) {
IWL_WARN(priv,
"Requested user TXPOWER %d above upper limit %d.\n",
tx_power, priv->nvm_data->max_tx_pwr_half_dbm);
return -EINVAL;
}
if (!iwl_is_ready_rf(priv))
return -EIO;
/* scan complete and commit_rxon use tx_power_next value,
* it always need to be updated for newest request */
priv->tx_power_next = tx_power;
/* do not set tx power when scanning or channel changing */
defer = test_bit(STATUS_SCANNING, &priv->status) ||
memcmp(&ctx->active, &ctx->staging, sizeof(ctx->staging));
if (defer && !force) {
IWL_DEBUG_INFO(priv, "Deferring tx power set\n");
return 0;
}
prev_tx_power = priv->tx_power_user_lmt;
priv->tx_power_user_lmt = tx_power;
ret = iwlagn_send_tx_power(priv);
/* if fail to set tx_power, restore the orig. tx power */
if (ret) {
priv->tx_power_user_lmt = prev_tx_power;
priv->tx_power_next = prev_tx_power;
}
return ret;
}
static int iwlagn_rxon_connect(struct iwl_priv *priv,
struct iwl_rxon_context *ctx)
Annotation
- Immediate include surface: `linux/etherdevice.h`, `iwl-trans.h`, `iwl-modparams.h`, `dev.h`, `agn.h`, `calib.h`.
- Detected declarations: `function Copyright`, `function iwlagn_disable_bss`, `function iwlagn_disable_pan`, `function iwlagn_disconn_pan`, `function iwlagn_update_qos`, `function iwlagn_update_beacon`, `function iwlagn_send_rxon_assoc`, `function iwl_adjust_beacon_interval`, `function iwl_send_rxon_timing`, `function iwl_is_associated`.
- 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.