]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: iwlwifi: trans: move ext_32khz_clock_valid to config
authorJohannes Berg <johannes.berg@intel.com>
Sun, 4 May 2025 10:26:18 +0000 (13:26 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 7 May 2025 03:08:01 +0000 (06:08 +0300)
This value is used for the device start, so it's really
part of the configuration.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250504132447.637ed7514587.I6c8fdeb3e2078a5fe9b755391e3ef7258ef2b279@changeid
drivers/net/wireless/intel/iwlwifi/iwl-trans.h
drivers/net/wireless/intel/iwlwifi/mld/mld.c
drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c

index 362e52b24a14a00ab489b7ff108cc331551d5d95..a9d14e78b68d0980a2453b560f5b08a53f0180e9 100644 (file)
@@ -421,6 +421,7 @@ struct iwl_dump_sanitize_ops {
  * @dsbr_urm_permanent: switch to URM permanently
  * @mbx_addr_0_step: step address data 0
  * @mbx_addr_1_step: step address data 1
+ * @ext_32khz_clock_valid: if true, the external 32 KHz clock can be used
  */
 struct iwl_trans_config {
        u8 cmd_queue;
@@ -441,7 +442,8 @@ struct iwl_trans_config {
        u8 rx_mpdu_cmd, rx_mpdu_cmd_hdr_size;
 
        u8 dsbr_urm_fw_dependent:1,
-          dsbr_urm_permanent:1;
+          dsbr_urm_permanent:1,
+          ext_32khz_clock_valid:1;
 
        u32 mbx_addr_0_step;
        u32 mbx_addr_1_step;
@@ -882,7 +884,6 @@ struct iwl_trans_info {
  * @restart.mode: reset/restart error mode information
  * @restart.during_reset: error occurred during previous software reset
  * @trans_specific: data for the specific transport this is allocated for/with
- * @ext_32khz_clock_valid: if true, the external 32 KHz clock can be used
  * @request_top_reset: TOP reset was requested, used by the reset
  *     worker that should be scheduled (with appropriate reason)
  * @do_top_reset: indication to the (PCIe) transport/context-info
@@ -905,8 +906,6 @@ struct iwl_trans {
        bool reduced_cap_sku;
        bool step_urm;
 
-       bool ext_32khz_clock_valid;
-
        bool pm_support;
        bool ltr_enabled;
        u8 pnvm_loaded:1;
index 578941098b58d9fc34eabb8b1e10cc7ae2686ede..dfb9908de09dfb2ae222c28db6456ac03fec360c 100644 (file)
@@ -328,10 +328,16 @@ iwl_mld_configure_trans(struct iwl_op_mode *op_mode)
        struct iwl_mld *mld = IWL_OP_MODE_GET_MLD(op_mode);
        static const u8 no_reclaim_cmds[] = {TX_CMD};
        struct iwl_trans *trans = mld->trans;
+       u32 eckv_value;
 
        iwl_bios_setup_step(trans, &mld->fwrt);
        iwl_uefi_get_step_table(trans);
 
+       if (iwl_bios_get_eckv(&mld->fwrt, &eckv_value))
+               IWL_DEBUG_RADIO(mld, "ECKV table doesn't exist in BIOS\n");
+       else
+               trans->conf.ext_32khz_clock_valid = !!eckv_value;
+
        trans->conf.rx_buf_size = iwl_amsdu_size_to_rxb_size();
        trans->conf.command_groups = iwl_mld_groups;
        trans->conf.command_groups_size = ARRAY_SIZE(iwl_mld_groups);
@@ -369,7 +375,6 @@ iwl_op_mode_mld_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
        struct ieee80211_hw *hw;
        struct iwl_op_mode *op_mode;
        struct iwl_mld *mld;
-       u32 eckv_value;
        int ret;
 
        /* Allocate and initialize a new hardware device */
@@ -391,10 +396,6 @@ iwl_op_mode_mld_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
 
        iwl_mld_get_bios_tables(mld);
        iwl_uefi_get_sgom_table(trans, &mld->fwrt);
-       if (iwl_bios_get_eckv(&mld->fwrt, &eckv_value))
-               IWL_DEBUG_RADIO(mld, "ECKV table doesn't exist in BIOS\n");
-       else
-               trans->ext_32khz_clock_valid = !!eckv_value;
        mld->bios_enable_puncturing = iwl_uefi_get_puncturing(&mld->fwrt);
 
        iwl_mld_hw_set_regulatory(mld);
index e06c137d193e8d5c47dc8c2b7105e1aa6f7456d8..05876aea42e3f6b9ed90564140d6d3d526477953 100644 (file)
@@ -138,7 +138,7 @@ int iwl_pcie_ctxt_info_gen3_alloc(struct iwl_trans *trans,
        if (trans->conf.dsbr_urm_permanent)
                control_flags_ext |= IWL_PRPH_SCRATCH_EXT_URM_PERM;
 
-       if (trans->ext_32khz_clock_valid)
+       if (trans->conf.ext_32khz_clock_valid)
                control_flags_ext |= IWL_PRPH_SCRATCH_EXT_32KHZ_CLK_VALID;
 
        /* Allocate prph scratch */