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

Commit 2c810ccd authored by Johannes Berg's avatar Johannes Berg Committed by Reinette Chatre
Browse files

iwlwifi: rework broadcast station management



Currently, the broadcast station is managed along
with the interface type, rather than always being
present. That leads to a bug with injection -- it
is currently not possible to inject frames when
the only virtual interface is a monitor, because
in that the required broadcast station is missing.

Additionally, allocating and deallocating the
broadcast station's LQ all the time is wasteful,
and the code to support this is fairly complex.

So this changes completely the way we manage the
broadcast station. Rather than manage it along
with any interface, we now allocate it when we
bring the device up, and remove it again when we
bring the device down. When we bring the device
up, we don't immediately program the broadcast
station into it, instead we just mark it active
and rely on the next restore cycle to upload it
to the device. This works because an unassociated
RXON is always required at least once to set up
device parameters, which implies a reprogramming
of stations into the device.

As we now manage all stations properly, there no
longer is a need for forcing a clearing of them
via iwl_clear_ucode_stations(), which can become
a lot simpler.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
parent a6a0345c
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -212,7 +212,6 @@ static struct iwl_lib_ops iwl1000_lib = {
		.temperature = iwlagn_temperature,
		.temperature = iwlagn_temperature,
		.set_ct_kill = iwl1000_set_ct_threshold,
		.set_ct_kill = iwl1000_set_ct_threshold,
	 },
	 },
	.add_bcast_station = iwl_add_bcast_station,
	.manage_ibss_station = iwlagn_manage_ibss_station,
	.manage_ibss_station = iwlagn_manage_ibss_station,
	.debugfs_ops = {
	.debugfs_ops = {
		.rx_stats_read = iwl_ucode_rx_stats_read,
		.rx_stats_read = iwl_ucode_rx_stats_read,
+2 −3
Original line number Original line Diff line number Diff line
@@ -1992,7 +1992,7 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv)
				  "configuration (%d).\n", rc);
				  "configuration (%d).\n", rc);
			return rc;
			return rc;
		}
		}
		iwl_clear_ucode_stations(priv, false);
		iwl_clear_ucode_stations(priv);
		iwl_restore_stations(priv);
		iwl_restore_stations(priv);
	}
	}


@@ -2025,7 +2025,7 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv)
	memcpy(active_rxon, staging_rxon, sizeof(*active_rxon));
	memcpy(active_rxon, staging_rxon, sizeof(*active_rxon));


	if (!new_assoc) {
	if (!new_assoc) {
		iwl_clear_ucode_stations(priv, false);
		iwl_clear_ucode_stations(priv);
		iwl_restore_stations(priv);
		iwl_restore_stations(priv);
	}
	}


@@ -2853,7 +2853,6 @@ static struct iwl_lib_ops iwl3945_lib = {
	.isr = iwl_isr_legacy,
	.isr = iwl_isr_legacy,
	.config_ap = iwl3945_config_ap,
	.config_ap = iwl3945_config_ap,
	.manage_ibss_station = iwl3945_manage_ibss_station,
	.manage_ibss_station = iwl3945_manage_ibss_station,
	.add_bcast_station = iwl3945_add_bcast_station,
	.check_plcp_health = iwl3945_good_plcp_health,
	.check_plcp_health = iwl3945_good_plcp_health,


	.debugfs_ops = {
	.debugfs_ops = {
+0 −1
Original line number Original line Diff line number Diff line
@@ -2190,7 +2190,6 @@ static struct iwl_lib_ops iwl4965_lib = {
		.temperature = iwl4965_temperature_calib,
		.temperature = iwl4965_temperature_calib,
		.set_ct_kill = iwl4965_set_ct_threshold,
		.set_ct_kill = iwl4965_set_ct_threshold,
	},
	},
	.add_bcast_station = iwl_add_bcast_station,
	.manage_ibss_station = iwlagn_manage_ibss_station,
	.manage_ibss_station = iwlagn_manage_ibss_station,
	.debugfs_ops = {
	.debugfs_ops = {
		.rx_stats_read = iwl_ucode_rx_stats_read,
		.rx_stats_read = iwl_ucode_rx_stats_read,
+0 −2
Original line number Original line Diff line number Diff line
@@ -351,7 +351,6 @@ static struct iwl_lib_ops iwl5000_lib = {
		.temperature = iwlagn_temperature,
		.temperature = iwlagn_temperature,
		.set_ct_kill = iwl5000_set_ct_threshold,
		.set_ct_kill = iwl5000_set_ct_threshold,
	 },
	 },
	.add_bcast_station = iwl_add_bcast_station,
	.manage_ibss_station = iwlagn_manage_ibss_station,
	.manage_ibss_station = iwlagn_manage_ibss_station,
	.debugfs_ops = {
	.debugfs_ops = {
		.rx_stats_read = iwl_ucode_rx_stats_read,
		.rx_stats_read = iwl_ucode_rx_stats_read,
@@ -414,7 +413,6 @@ static struct iwl_lib_ops iwl5150_lib = {
		.temperature = iwl5150_temperature,
		.temperature = iwl5150_temperature,
		.set_ct_kill = iwl5150_set_ct_threshold,
		.set_ct_kill = iwl5150_set_ct_threshold,
	 },
	 },
	.add_bcast_station = iwl_add_bcast_station,
	.manage_ibss_station = iwlagn_manage_ibss_station,
	.manage_ibss_station = iwlagn_manage_ibss_station,
	.debugfs_ops = {
	.debugfs_ops = {
		.rx_stats_read = iwl_ucode_rx_stats_read,
		.rx_stats_read = iwl_ucode_rx_stats_read,
+0 −2
Original line number Original line Diff line number Diff line
@@ -317,7 +317,6 @@ static struct iwl_lib_ops iwl6000_lib = {
		.temperature = iwlagn_temperature,
		.temperature = iwlagn_temperature,
		.set_ct_kill = iwl6000_set_ct_threshold,
		.set_ct_kill = iwl6000_set_ct_threshold,
	 },
	 },
	.add_bcast_station = iwl_add_bcast_station,
	.manage_ibss_station = iwlagn_manage_ibss_station,
	.manage_ibss_station = iwlagn_manage_ibss_station,
	.debugfs_ops = {
	.debugfs_ops = {
		.rx_stats_read = iwl_ucode_rx_stats_read,
		.rx_stats_read = iwl_ucode_rx_stats_read,
@@ -390,7 +389,6 @@ static struct iwl_lib_ops iwl6050_lib = {
		.set_ct_kill = iwl6000_set_ct_threshold,
		.set_ct_kill = iwl6000_set_ct_threshold,
		.set_calib_version = iwl6050_set_calib_version,
		.set_calib_version = iwl6050_set_calib_version,
	 },
	 },
	.add_bcast_station = iwl_add_bcast_station,
	.manage_ibss_station = iwlagn_manage_ibss_station,
	.manage_ibss_station = iwlagn_manage_ibss_station,
	.debugfs_ops = {
	.debugfs_ops = {
		.rx_stats_read = iwl_ucode_rx_stats_read,
		.rx_stats_read = iwl_ucode_rx_stats_read,
Loading