Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1efb92f authored by Sasha Levin's avatar Sasha Levin
Browse files

iwlwifi: mvm: don't allow sched scans without matches to be started

[ Upstream commit 5e56276e7555b34550d51459a801ff75eca8b907 ]

The firmware can perform a scheduled scan with not matchsets passed,
but it can't send notification that results were found.  Since the
userspace then cannot know when we got new results and the firmware
wouldn't trigger a wake in case we are sleeping, it's better not to
allow scans without matchsets.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=110831



Cc: <stable@vger.kernel.org> [3.17+]
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
[SL: Backport to 4.1]
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent 6e9c571a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2144,6 +2144,10 @@ static int iwl_mvm_mac_sched_scan_start(struct ieee80211_hw *hw,
	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
	int ret;

	/* we don't support "match all" in the firmware */
	if (!req->n_match_sets)
		return -EOPNOTSUPP;

	ret = iwl_mvm_cancel_scan_wait_notif(mvm, IWL_MVM_SCAN_OS);
	if (ret)
		return ret;