aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-09-22 12:02:01 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-10-07 18:50:33 -0400
commita30e3112a8bcb5bc1caa48547e597de3992e1b21 (patch)
tree3690cb36a987af1a3778011390221e48763c1b80 /drivers/net/wireless/iwlwifi/iwl-3945.c
parentd3f5ba958d6c425a87535c6fa2a69ca90eb6e930 (diff)
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: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-3945.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index a7dbb2806b1a..4b3eb785dcb2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -2299,6 +2299,32 @@ static u16 iwl3945_build_addsta_hcmd(const struct iwl_addsta_cmd *cmd, u8 *data)
2299 return (u16)sizeof(struct iwl3945_addsta_cmd); 2299 return (u16)sizeof(struct iwl3945_addsta_cmd);
2300} 2300}
2301 2301
2302static int iwl3945_add_bssid_station(struct iwl_priv *priv,
2303 const u8 *addr, u8 *sta_id_r)
2304{
2305 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
2306 int ret;
2307 u8 sta_id;
2308 unsigned long flags;
2309
2310 if (sta_id_r)
2311 *sta_id_r = IWL_INVALID_STATION;
2312
2313 ret = iwl_add_station_common(priv, ctx, addr, 0, NULL, &sta_id);
2314 if (ret) {
2315 IWL_ERR(priv, "Unable to add station %pM\n", addr);
2316 return ret;
2317 }
2318
2319 if (sta_id_r)
2320 *sta_id_r = sta_id;
2321
2322 spin_lock_irqsave(&priv->sta_lock, flags);
2323 priv->stations[sta_id].used |= IWL_STA_LOCAL;
2324 spin_unlock_irqrestore(&priv->sta_lock, flags);
2325
2326 return 0;
2327}
2302static int iwl3945_manage_ibss_station(struct iwl_priv *priv, 2328static int iwl3945_manage_ibss_station(struct iwl_priv *priv,
2303 struct ieee80211_vif *vif, bool add) 2329 struct ieee80211_vif *vif, bool add)
2304{ 2330{
@@ -2306,10 +2332,8 @@ static int iwl3945_manage_ibss_station(struct iwl_priv *priv,
2306 int ret; 2332 int ret;
2307 2333
2308 if (add) { 2334 if (add) {
2309 ret = iwl_add_bssid_station( 2335 ret = iwl3945_add_bssid_station(priv, vif->bss_conf.bssid,
2310 priv, &priv->contexts[IWL_RXON_CTX_BSS], 2336 &vif_priv->ibss_bssid_sta_id);
2311 vif->bss_conf.bssid, false,
2312 &vif_priv->ibss_bssid_sta_id);
2313 if (ret) 2337 if (ret)
2314 return ret; 2338 return ret;
2315 2339