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

Commit 5ee2b215 authored by Alexander Bondar's avatar Alexander Bondar Committed by Johannes Berg
Browse files

iwlwifi: mvm: don't disable power management due to P2P device



Currently power management is supported only when only a single
virtual interface is present. The driver verifies number of created
interfaces and disables power management when multiple interfaces
present. However, this rule does not extend to a P2P device that is
handled differently in the firmware. If a P2P device is added power
management can remain enabled.

Signed-off-by: default avatarAlexander Bondar <alexander.bondar@intel.com>
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent f4a3e2fe
Loading
Loading
Loading
Loading
+10 −5
Original line number Original line Diff line number Diff line
@@ -502,10 +502,14 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
	/*
	/*
	 * TODO: remove this temporary code.
	 * TODO: remove this temporary code.
	 * Currently MVM FW supports power management only on single MAC.
	 * Currently MVM FW supports power management only on single MAC.
	 * Iterate and disable PM on all active interfaces.
	 * If new interface added, disable PM on existing interface.
	 * P2P device is a special case, since it is handled by FW similary to
	 * scan. If P2P deviced is added, PM remains enabled on existing
	 * interface.
	 * Note: the method below does not count the new interface being added
	 * Note: the method below does not count the new interface being added
	 * at this moment.
	 * at this moment.
	 */
	 */
	if (vif->type != NL80211_IFTYPE_P2P_DEVICE)
		mvm->vif_count++;
		mvm->vif_count++;
	if (mvm->vif_count > 1) {
	if (mvm->vif_count > 1) {
		IWL_DEBUG_MAC80211(mvm,
		IWL_DEBUG_MAC80211(mvm,
@@ -576,9 +580,10 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
	/*
	/*
	 * TODO: remove this temporary code.
	 * TODO: remove this temporary code.
	 * Currently MVM FW supports power management only on single MAC.
	 * Currently MVM FW supports power management only on single MAC.
	 * Check if only one additional interface remains after rereasing
	 * Check if only one additional interface remains after releasing
	 * current one. Update power mode on the remaining interface.
	 * current one. Update power mode on the remaining interface.
	 */
	 */
	if (vif->type != NL80211_IFTYPE_P2P_DEVICE)
		mvm->vif_count--;
		mvm->vif_count--;
	IWL_DEBUG_MAC80211(mvm, "Currently %d interfaces active\n",
	IWL_DEBUG_MAC80211(mvm, "Currently %d interfaces active\n",
			   mvm->vif_count);
			   mvm->vif_count);
@@ -666,7 +671,7 @@ static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw,
	 * Check if only one additional interface remains after removing
	 * Check if only one additional interface remains after removing
	 * current one. Update power mode on the remaining interface.
	 * current one. Update power mode on the remaining interface.
	 */
	 */
	if (mvm->vif_count)
	if (mvm->vif_count && vif->type != NL80211_IFTYPE_P2P_DEVICE)
		mvm->vif_count--;
		mvm->vif_count--;
	IWL_DEBUG_MAC80211(mvm, "Currently %d interfaces active\n",
	IWL_DEBUG_MAC80211(mvm, "Currently %d interfaces active\n",
			   mvm->vif_count);
			   mvm->vif_count);
+7 −0
Original line number Original line Diff line number Diff line
@@ -322,6 +322,13 @@ struct iwl_mvm {
	 * can hold 16 keys at most. Reflect this fact.
	 * can hold 16 keys at most. Reflect this fact.
	 */
	 */
	unsigned long fw_key_table[BITS_TO_LONGS(STA_KEY_MAX_NUM)];
	unsigned long fw_key_table[BITS_TO_LONGS(STA_KEY_MAX_NUM)];

	/*
	 * This counter of created interfaces is referenced only in conjunction
	 * with FW limitation related to power management. Currently PM is
	 * supported only on a single interface.
	 * IMPORTANT: this variable counts all interfaces except P2P device.
	 */
	u8 vif_count;
	u8 vif_count;


	struct led_classdev led;
	struct led_classdev led;