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

Commit 1fa61b2e authored by Johannes Berg's avatar Johannes Berg Committed by Reinette Chatre
Browse files

iwlwifi: manage IBSS station properly



Currently iwlwifi will eventually exhaust the station
table when adding the BSSID station for IBSS mode,
unless the interface is set down.

The new mac80211 ibss joined/left notification allows
us to fix that easily by moving the code to add the
IBSS station to the notification, and also adding
code to remove it again when we leave the IBSS.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
parent c0222df8
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -213,6 +213,7 @@ static struct iwl_lib_ops iwl1000_lib = {
		.set_ct_kill = iwl1000_set_ct_threshold,
		.set_ct_kill = iwl1000_set_ct_threshold,
	 },
	 },
	.add_bcast_station = iwl_add_bcast_station,
	.add_bcast_station = iwl_add_bcast_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,
		.tx_stats_read = iwl_ucode_tx_stats_read,
		.tx_stats_read = iwl_ucode_tx_stats_read,
+29 −1
Original line number Original line Diff line number Diff line
@@ -884,7 +884,8 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv,
		       tx_cmd->supp_rates[1], tx_cmd->supp_rates[0]);
		       tx_cmd->supp_rates[1], tx_cmd->supp_rates[0]);
}
}


u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id, u16 tx_rate, u8 flags)
static u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id,
			   u16 tx_rate, u8 flags)
{
{
	unsigned long flags_spin;
	unsigned long flags_spin;
	struct iwl_station_entry *station;
	struct iwl_station_entry *station;
@@ -2395,6 +2396,32 @@ static u16 iwl3945_build_addsta_hcmd(const struct iwl_addsta_cmd *cmd, u8 *data)
	return (u16)sizeof(struct iwl3945_addsta_cmd);
	return (u16)sizeof(struct iwl3945_addsta_cmd);
}
}


static int iwl3945_manage_ibss_station(struct iwl_priv *priv,
				       struct ieee80211_vif *vif, bool add)
{
	int ret;

	/*
	 * NB: this assumes that the station it gets will be
	 *     IWL_STA_ID, which will happen but isn't obvious.
	 */

	if (add) {
		ret = iwl_add_local_station(priv, vif->bss_conf.bssid, false);
		if (ret)
			return ret;

		iwl3945_sync_sta(priv, IWL_STA_ID,
				 (priv->band == IEEE80211_BAND_5GHZ) ?
				 IWL_RATE_6M_PLCP : IWL_RATE_1M_PLCP,
				 CMD_ASYNC);
		iwl3945_rate_scale_init(priv->hw, IWL_STA_ID);

		return 0;
	}

	return iwl_remove_station(priv, vif->bss_conf.bssid);
}


/**
/**
 * iwl3945_init_hw_rate_table - Initialize the hardware rate fallback table
 * iwl3945_init_hw_rate_table - Initialize the hardware rate fallback table
@@ -2802,6 +2829,7 @@ static struct iwl_lib_ops iwl3945_lib = {
	.post_associate = iwl3945_post_associate,
	.post_associate = iwl3945_post_associate,
	.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,
	.add_bcast_station = iwl3945_add_bcast_station,
	.add_bcast_station = iwl3945_add_bcast_station,


	.debugfs_ops = {
	.debugfs_ops = {
+0 −9
Original line number Original line Diff line number Diff line
@@ -211,13 +211,6 @@ extern int iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
				       char **buf, bool display);
				       char **buf, bool display);
extern void iwl3945_dump_nic_error_log(struct iwl_priv *priv);
extern void iwl3945_dump_nic_error_log(struct iwl_priv *priv);


/*
 * Currently used by iwl-3945-rs... look at restructuring so that it doesn't
 * call this... todo... fix that.
*/
extern u8 iwl3945_sync_station(struct iwl_priv *priv, int sta_id,
			   u16 tx_rate, u8 flags);

/******************************************************************************
/******************************************************************************
 *
 *
 * Functions implemented in iwl-[34]*.c which are forward declared here
 * Functions implemented in iwl-[34]*.c which are forward declared here
@@ -288,8 +281,6 @@ extern __le32 iwl3945_get_antenna_flags(const struct iwl_priv *priv);
extern int iwl3945_init_hw_rate_table(struct iwl_priv *priv);
extern int iwl3945_init_hw_rate_table(struct iwl_priv *priv);
extern void iwl3945_reg_txpower_periodic(struct iwl_priv *priv);
extern void iwl3945_reg_txpower_periodic(struct iwl_priv *priv);
extern int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv);
extern int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv);
extern u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id,
		 u16 tx_rate, u8 flags);


extern const struct iwl_channel_info *iwl3945_get_channel_info(
extern const struct iwl_channel_info *iwl3945_get_channel_info(
	const struct iwl_priv *priv, enum ieee80211_band band, u16 channel);
	const struct iwl_priv *priv, enum ieee80211_band band, u16 channel);
+1 −0
Original line number Original line Diff line number Diff line
@@ -2219,6 +2219,7 @@ static struct iwl_lib_ops iwl4965_lib = {
		.set_ct_kill = iwl4965_set_ct_threshold,
		.set_ct_kill = iwl4965_set_ct_threshold,
	},
	},
	.add_bcast_station = iwl_add_bcast_station,
	.add_bcast_station = iwl_add_bcast_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,
		.tx_stats_read = iwl_ucode_tx_stats_read,
		.tx_stats_read = iwl_ucode_tx_stats_read,
+2 −0
Original line number Original line Diff line number Diff line
@@ -352,6 +352,7 @@ static struct iwl_lib_ops iwl5000_lib = {
		.set_ct_kill = iwl5000_set_ct_threshold,
		.set_ct_kill = iwl5000_set_ct_threshold,
	 },
	 },
	.add_bcast_station = iwl_add_bcast_station,
	.add_bcast_station = iwl_add_bcast_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,
		.tx_stats_read = iwl_ucode_tx_stats_read,
		.tx_stats_read = iwl_ucode_tx_stats_read,
@@ -414,6 +415,7 @@ static struct iwl_lib_ops iwl5150_lib = {
		.set_ct_kill = iwl5150_set_ct_threshold,
		.set_ct_kill = iwl5150_set_ct_threshold,
	 },
	 },
	.add_bcast_station = iwl_add_bcast_station,
	.add_bcast_station = iwl_add_bcast_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,
		.tx_stats_read = iwl_ucode_tx_stats_read,
		.tx_stats_read = iwl_ucode_tx_stats_read,
Loading