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

Commit c91c3efc authored by Abhijeet Kolekar's avatar Abhijeet Kolekar Committed by John W. Linville
Browse files

iwlwifi: disable tx on beacon update notification

On beacon change update notification from mac we are not disabling
the tx in adhoc mode. Mac sends BSS_CHANGED_BEACON_ENABLED when
station leaves IBSS. Driver should indicate uCode to not to send
anything on receiving this notification.

Functionality to indicate uCode is duplicated across
two notifications so created a common function called iwl_set_no_assoc.

Fix the issue at
http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2133

.

Signed-off-by: default avatarAbhijeet Kolekar <abhijeet.kolekar@intel.com>
Tested-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c8106d76
Loading
Loading
Loading
Loading
+25 −20
Original line number Original line Diff line number Diff line
@@ -2344,6 +2344,21 @@ static void iwl_ht_conf(struct iwl_priv *priv,
	IWL_DEBUG_MAC80211(priv, "leave\n");
	IWL_DEBUG_MAC80211(priv, "leave\n");
}
}


static inline void iwl_set_no_assoc(struct iwl_priv *priv)
{
	priv->assoc_id = 0;
	iwl_led_disassociate(priv);
	/*
	 * inform the ucode that there is no longer an
	 * association and that no more packets should be
	 * sent
	 */
	priv->staging_rxon.filter_flags &=
		~RXON_FILTER_ASSOC_MSK;
	priv->staging_rxon.assoc_id = 0;
	iwlcore_commit_rxon(priv);
}

#define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6)
#define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6)
void iwl_bss_info_changed(struct ieee80211_hw *hw,
void iwl_bss_info_changed(struct ieee80211_hw *hw,
			  struct ieee80211_vif *vif,
			  struct ieee80211_vif *vif,
@@ -2475,20 +2490,8 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
					IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
					IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
			if (!iwl_is_rfkill(priv))
			if (!iwl_is_rfkill(priv))
				priv->cfg->ops->lib->post_associate(priv);
				priv->cfg->ops->lib->post_associate(priv);
		} else {
		} else
			priv->assoc_id = 0;
			iwl_set_no_assoc(priv);
			iwl_led_disassociate(priv);

			/*
			 * inform the ucode that there is no longer an
			 * association and that no more packets should be
			 * send
			 */
			priv->staging_rxon.filter_flags &=
				~RXON_FILTER_ASSOC_MSK;
			priv->staging_rxon.assoc_id = 0;
			iwlcore_commit_rxon(priv);
		}
	}
	}


	if (changes && iwl_is_associated(priv) && priv->assoc_id) {
	if (changes && iwl_is_associated(priv) && priv->assoc_id) {
@@ -2503,12 +2506,14 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
		}
		}
	}
	}


	if ((changes & BSS_CHANGED_BEACON_ENABLED) &&
	if (changes & BSS_CHANGED_BEACON_ENABLED) {
	    vif->bss_conf.enable_beacon) {
		if (vif->bss_conf.enable_beacon) {
			memcpy(priv->staging_rxon.bssid_addr,
			memcpy(priv->staging_rxon.bssid_addr,
			       bss_conf->bssid, ETH_ALEN);
			       bss_conf->bssid, ETH_ALEN);
			memcpy(priv->bssid, bss_conf->bssid, ETH_ALEN);
			memcpy(priv->bssid, bss_conf->bssid, ETH_ALEN);
			iwlcore_config_ap(priv);
			iwlcore_config_ap(priv);
		} else
			iwl_set_no_assoc(priv);
	}
	}


	mutex_unlock(&priv->mutex);
	mutex_unlock(&priv->mutex);