summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>2025-07-09 23:05:29 +0300
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>2025-07-10 19:48:38 +0300
commit6fdd41b25fb4154bcde7a38ca1c98e072fa1177c (patch)
treeb2cbecb37504ba6ced756270cfa15e7c7a31c4d7
parent6b04716cdcac37bdbacde34def08bc6fdb5fc4e2 (diff)
wifi: iwlwifi: handle non-overlapping API ranges
The option to set an api_version_min/max also to the RF was added. In the case that both the MAC and the RF has a range defined, we take the narrower range of both. This doesn't work for non-overlapping ranges. In this case, we should just take the lower range of both. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250709200543.1628666-2-miriam.rachel.korenblit@intel.com
-rw-r--r--drivers/net/wireless/intel/iwlwifi/iwl-drv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index f62f7c7ee7f3..2dff87c07512 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -301,13 +301,17 @@ static void iwl_get_ucode_api_versions(struct iwl_trans *trans,
const struct iwl_family_base_params *base = trans->mac_cfg->base;
const struct iwl_rf_cfg *cfg = trans->cfg;
- if (!base->ucode_api_max) {
+ /* if the MAC doesn't have range or if its range it higher than the RF's */
+ if (!base->ucode_api_max ||
+ (cfg->ucode_api_max && base->ucode_api_min > cfg->ucode_api_max)) {
*api_min = cfg->ucode_api_min;
*api_max = cfg->ucode_api_max;
return;
}
- if (!cfg->ucode_api_max) {
+ /* if the RF doesn't have range or if its range it higher than the MAC's */
+ if (!cfg->ucode_api_max ||
+ (base->ucode_api_max && cfg->ucode_api_min > base->ucode_api_max)) {
*api_min = base->ucode_api_min;
*api_max = base->ucode_api_max;
return;