Skip to content

Commit dc28e12

Browse files
mattigotegrumbach
authored andcommitted
iwlwifi: mvm: ROC: Extend the ROC max delay duration & limit ROC duration
When associated to an AP and a ROC event with a long duration is scheduled the FW may have a hard time scheduling a consecutive time event, since it has to remain on the connection channel to hear the AP's DTIM. In addition, when associated and a ROC is requested with a duration greater than the DTIM interval, the FW will not be able to schedule the ROC event, since it needs to wake up for the DTIM. Increasing the "max delay" duration to the DTIM period will allow the FW to wait until after the DTIM and then schedule the ROC time event. Limiting the ROC to be less than the DTIM interval will assure that the time event will be scheduled for at least part of the time (instead of automatically failing) Extend the ROC max delay duration to min(dtim_interval * 3, 600TU), and limit the duration to be less than the DTIM interval. Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
1 parent 13555e8 commit dc28e12

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2707,7 +2707,11 @@ static bool iwl_mvm_rx_aux_roc(struct iwl_notif_wait_data *notif_wait,
27072707
return true;
27082708
}
27092709

2710-
#define AUX_ROC_MAX_DELAY_ON_CHANNEL 200
2710+
#define AUX_ROC_MIN_DURATION MSEC_TO_TU(100)
2711+
#define AUX_ROC_MIN_DELAY MSEC_TO_TU(200)
2712+
#define AUX_ROC_MAX_DELAY MSEC_TO_TU(600)
2713+
#define AUX_ROC_SAFETY_BUFFER MSEC_TO_TU(20)
2714+
#define AUX_ROC_MIN_SAFETY_BUFFER MSEC_TO_TU(10)
27112715
static int iwl_mvm_send_aux_roc_cmd(struct iwl_mvm *mvm,
27122716
struct ieee80211_channel *channel,
27132717
struct ieee80211_vif *vif,
@@ -2718,6 +2722,9 @@ static int iwl_mvm_send_aux_roc_cmd(struct iwl_mvm *mvm,
27182722
struct iwl_mvm_time_event_data *te_data = &mvmvif->hs_time_event_data;
27192723
static const u16 time_event_response[] = { HOT_SPOT_CMD };
27202724
struct iwl_notification_wait wait_time_event;
2725+
u32 dtim_interval = vif->bss_conf.dtim_period *
2726+
vif->bss_conf.beacon_int;
2727+
u32 req_dur, delay;
27212728
struct iwl_hs20_roc_req aux_roc_req = {
27222729
.action = cpu_to_le32(FW_CTXT_ACTION_ADD),
27232730
.id_and_color =
@@ -2730,11 +2737,38 @@ static int iwl_mvm_send_aux_roc_cmd(struct iwl_mvm *mvm,
27302737
.channel_info.width = PHY_VHT_CHANNEL_MODE20,
27312738
/* Set the time and duration */
27322739
.apply_time = cpu_to_le32(iwl_read_prph(mvm->trans, time_reg)),
2733-
.apply_time_max_delay =
2734-
cpu_to_le32(MSEC_TO_TU(AUX_ROC_MAX_DELAY_ON_CHANNEL)),
2735-
.duration = cpu_to_le32(MSEC_TO_TU(duration)),
27362740
};
27372741

2742+
delay = AUX_ROC_MIN_DELAY;
2743+
req_dur = MSEC_TO_TU(duration);
2744+
2745+
/*
2746+
* If we are associated we want the delay time to be at least one
2747+
* dtim interval so that the FW can wait until after the DTIM and
2748+
* then start the time event, this will potentially allow us to
2749+
* remain off-channel for the max duration.
2750+
* Since we want to use almost a whole dtim interval we would also
2751+
* like the delay to be for 2-3 dtim intervals, in case there are
2752+
* other time events with higher priority.
2753+
*/
2754+
if (vif->bss_conf.assoc) {
2755+
delay = min_t(u32, dtim_interval * 3, AUX_ROC_MAX_DELAY);
2756+
/* We cannot remain off-channel longer than the DTIM interval */
2757+
if (dtim_interval <= req_dur) {
2758+
req_dur = dtim_interval - AUX_ROC_SAFETY_BUFFER;
2759+
if (req_dur <= AUX_ROC_MIN_DURATION)
2760+
req_dur = dtim_interval -
2761+
AUX_ROC_MIN_SAFETY_BUFFER;
2762+
}
2763+
}
2764+
2765+
aux_roc_req.duration = cpu_to_le32(req_dur);
2766+
aux_roc_req.apply_time_max_delay = cpu_to_le32(delay);
2767+
2768+
IWL_DEBUG_TE(mvm,
2769+
"ROC: Requesting to remain on channel %u for %ums (requested = %ums, max_delay = %ums, dtim_interval = %ums)\n",
2770+
channel->hw_value, req_dur, duration, delay,
2771+
dtim_interval);
27382772
/* Set the node address */
27392773
memcpy(aux_roc_req.node_addr, vif->addr, ETH_ALEN);
27402774

0 commit comments

Comments
 (0)