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

Commit a30e3112 authored by Johannes Berg's avatar Johannes Berg Committed by Wey-Yi Guy
Browse files

iwlwifi: move agn specific station code there



By duplicating a little bit of code between 3945
and agn, we can move a lot of code into an agn
specific station management file and thus reduce
the amount of code in core that is dead to 3945.

before:
   text	   data	    bss	    dec	    hex	filename
 212886	   3872	     96	 216854	  34f16	iwlcore.ko
 620542	  10448	    304	 631294	  9a1fe	iwlagn.ko
 314013	   3264	    196	 317473	  4d821	iwl3945.ko

after:
   text	   data	    bss	    dec	    hex	filename
 202857	   3872	     92	 206821	  327e5	iwlcore.ko
 629102	  10448	    308	 639858	  9c372	iwlagn.ko
 314240	   3264	    196	 317700	  4d904	iwl3945.ko

delta:
 -10029   iwlcore.ko
   8560   iwlagn.ko
    227   iwl3945.ko

so it's a net win even if you have both loaded,
likely because a lot of EXPORT_SYMBOLs go away.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent d3f5ba95
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ obj-$(CONFIG_IWLAGN) += iwlagn.o
iwlagn-objs		:= iwl-agn.o iwl-agn-rs.o iwl-agn-led.o iwl-agn-ict.o
iwlagn-objs		+= iwl-agn-ucode.o iwl-agn-hcmd.o iwl-agn-tx.o
iwlagn-objs		+= iwl-agn-lib.o iwl-agn-rx.o iwl-agn-calib.o
iwlagn-objs		+= iwl-agn-tt.o
iwlagn-objs		+= iwl-agn-tt.o iwl-agn-sta.o
iwlagn-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-agn-debugfs.o

iwlagn-$(CONFIG_IWL4965) += iwl-4965.o
+28 −4
Original line number Diff line number Diff line
@@ -2299,6 +2299,32 @@ static u16 iwl3945_build_addsta_hcmd(const struct iwl_addsta_cmd *cmd, u8 *data)
	return (u16)sizeof(struct iwl3945_addsta_cmd);
}

static int iwl3945_add_bssid_station(struct iwl_priv *priv,
				     const u8 *addr, u8 *sta_id_r)
{
	struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
	int ret;
	u8 sta_id;
	unsigned long flags;

	if (sta_id_r)
		*sta_id_r = IWL_INVALID_STATION;

	ret = iwl_add_station_common(priv, ctx, addr, 0, NULL, &sta_id);
	if (ret) {
		IWL_ERR(priv, "Unable to add station %pM\n", addr);
		return ret;
	}

	if (sta_id_r)
		*sta_id_r = sta_id;

	spin_lock_irqsave(&priv->sta_lock, flags);
	priv->stations[sta_id].used |= IWL_STA_LOCAL;
	spin_unlock_irqrestore(&priv->sta_lock, flags);

	return 0;
}
static int iwl3945_manage_ibss_station(struct iwl_priv *priv,
				       struct ieee80211_vif *vif, bool add)
{
@@ -2306,9 +2332,7 @@ static int iwl3945_manage_ibss_station(struct iwl_priv *priv,
	int ret;

	if (add) {
		ret = iwl_add_bssid_station(
				priv, &priv->contexts[IWL_RXON_CTX_BSS],
				vif->bss_conf.bssid, false,
		ret = iwl3945_add_bssid_station(priv, vif->bss_conf.bssid,
						&vif_priv->ibss_bssid_sta_id);
		if (ret)
			return ret;
+3 −3
Original line number Diff line number Diff line
@@ -1587,8 +1587,8 @@ int iwlagn_manage_ibss_station(struct iwl_priv *priv,
	struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv;

	if (add)
		return iwl_add_bssid_station(priv, vif_priv->ctx,
					     vif->bss_conf.bssid, true,
		return iwlagn_add_bssid_station(priv, vif_priv->ctx,
						vif->bss_conf.bssid,
						&vif_priv->ibss_bssid_sta_id);
	return iwl_remove_station(priv, vif_priv->ibss_bssid_sta_id,
				  vif->bss_conf.bssid);
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
#include "iwl-dev.h"
#include "iwl-sta.h"
#include "iwl-core.h"
#include "iwl-agn.h"

#define RS_NAME "iwl-agn-rs"

+716 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading