aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-11-10 12:56:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-11-15 13:26:43 -0500
commitae79d23d0b2c16998e60f49a16dae53521c76a45 (patch)
tree09af0e450cb44daa707c7ba77735453a9ac96baa /drivers/net/wireless
parent2a21ff446c07b95d08cbb830bd20112f3ee1d76e (diff)
iwlagn: fix non-5000+ build
When building 4965 without 5000+ there were a lot of build errors due to functions being used that weren't even compiled in. To fix this move some code around and only compile the HCMD code for 5000+ series as it's not used for 4965. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/Makefile4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-sta.c32
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c34
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h5
6 files changed, 57 insertions, 50 deletions
diff --git a/drivers/net/wireless/iwlwifi/Makefile b/drivers/net/wireless/iwlwifi/Makefile
index ce05c260870e..b85a9c8ed01e 100644
--- a/drivers/net/wireless/iwlwifi/Makefile
+++ b/drivers/net/wireless/iwlwifi/Makefile
@@ -12,13 +12,13 @@ CFLAGS_iwl-devtrace.o := -I$(src)
12# AGN 12# AGN
13obj-$(CONFIG_IWLAGN) += iwlagn.o 13obj-$(CONFIG_IWLAGN) += iwlagn.o
14iwlagn-objs := iwl-agn.o iwl-agn-rs.o iwl-agn-led.o iwl-agn-ict.o 14iwlagn-objs := iwl-agn.o iwl-agn-rs.o iwl-agn-led.o iwl-agn-ict.o
15iwlagn-objs += iwl-agn-ucode.o iwl-agn-hcmd.o iwl-agn-tx.o 15iwlagn-objs += iwl-agn-ucode.o iwl-agn-tx.o
16iwlagn-objs += iwl-agn-lib.o iwl-agn-rx.o iwl-agn-calib.o 16iwlagn-objs += iwl-agn-lib.o iwl-agn-rx.o iwl-agn-calib.o
17iwlagn-objs += iwl-agn-tt.o iwl-agn-sta.o iwl-agn-eeprom.o 17iwlagn-objs += iwl-agn-tt.o iwl-agn-sta.o iwl-agn-eeprom.o
18iwlagn-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-agn-debugfs.o 18iwlagn-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-agn-debugfs.o
19 19
20iwlagn-$(CONFIG_IWL4965) += iwl-4965.o 20iwlagn-$(CONFIG_IWL4965) += iwl-4965.o
21iwlagn-$(CONFIG_IWL5000) += iwl-agn-rxon.o 21iwlagn-$(CONFIG_IWL5000) += iwl-agn-rxon.o iwl-agn-hcmd.o
22iwlagn-$(CONFIG_IWL5000) += iwl-5000.o 22iwlagn-$(CONFIG_IWL5000) += iwl-5000.o
23iwlagn-$(CONFIG_IWL5000) += iwl-6000.o 23iwlagn-$(CONFIG_IWL5000) += iwl-6000.o
24iwlagn-$(CONFIG_IWL5000) += iwl-1000.o 24iwlagn-$(CONFIG_IWL5000) += iwl-1000.o
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 3427fc2b7d68..019d4e7d7348 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -1587,22 +1587,6 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
1587 return ret; 1587 return ret;
1588} 1588}
1589 1589
1590void iwlagn_post_scan(struct iwl_priv *priv)
1591{
1592 struct iwl_rxon_context *ctx;
1593
1594 /*
1595 * Since setting the RXON may have been deferred while
1596 * performing the scan, fire one off if needed
1597 */
1598 for_each_context(priv, ctx)
1599 if (memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
1600 iwlagn_commit_rxon(priv, ctx);
1601
1602 if (priv->cfg->ops->hcmd->set_pan_params)
1603 priv->cfg->ops->hcmd->set_pan_params(priv);
1604}
1605
1606int iwlagn_manage_ibss_station(struct iwl_priv *priv, 1590int iwlagn_manage_ibss_station(struct iwl_priv *priv,
1607 struct ieee80211_vif *vif, bool add) 1591 struct ieee80211_vif *vif, bool add)
1608{ 1592{
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index 11b3d8888360..f0ddfb1a9c87 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -585,3 +585,19 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
585 585
586 mutex_unlock(&priv->mutex); 586 mutex_unlock(&priv->mutex);
587} 587}
588
589void iwlagn_post_scan(struct iwl_priv *priv)
590{
591 struct iwl_rxon_context *ctx;
592
593 /*
594 * Since setting the RXON may have been deferred while
595 * performing the scan, fire one off if needed
596 */
597 for_each_context(priv, ctx)
598 if (memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
599 iwlagn_commit_rxon(priv, ctx);
600
601 if (priv->cfg->ops->hcmd->set_pan_params)
602 priv->cfg->ops->hcmd->set_pan_params(priv);
603}
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
index 35a30d2e0734..35f085ac336b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
@@ -684,7 +684,7 @@ int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta,
684 return iwl_send_add_sta(priv, &sta_cmd, CMD_SYNC); 684 return iwl_send_add_sta(priv, &sta_cmd, CMD_SYNC);
685} 685}
686 686
687void iwl_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id) 687static void iwl_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id)
688{ 688{
689 unsigned long flags; 689 unsigned long flags;
690 690
@@ -714,3 +714,33 @@ void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt)
714 spin_unlock_irqrestore(&priv->sta_lock, flags); 714 spin_unlock_irqrestore(&priv->sta_lock, flags);
715 715
716} 716}
717
718void iwlagn_mac_sta_notify(struct ieee80211_hw *hw,
719 struct ieee80211_vif *vif,
720 enum sta_notify_cmd cmd,
721 struct ieee80211_sta *sta)
722{
723 struct iwl_priv *priv = hw->priv;
724 struct iwl_station_priv *sta_priv = (void *)sta->drv_priv;
725 int sta_id;
726
727 switch (cmd) {
728 case STA_NOTIFY_SLEEP:
729 WARN_ON(!sta_priv->client);
730 sta_priv->asleep = true;
731 if (atomic_read(&sta_priv->pending_frames) > 0)
732 ieee80211_sta_block_awake(hw, sta, true);
733 break;
734 case STA_NOTIFY_AWAKE:
735 WARN_ON(!sta_priv->client);
736 if (!sta_priv->asleep)
737 break;
738 sta_priv->asleep = false;
739 sta_id = iwl_sta_id(sta);
740 if (sta_id != IWL_INVALID_STATION)
741 iwl_sta_modify_ps_wake(priv, sta_id);
742 break;
743 default:
744 break;
745 }
746}
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index f7feac22a47c..573017474610 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3474,36 +3474,6 @@ int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
3474 return ret; 3474 return ret;
3475} 3475}
3476 3476
3477static void iwlagn_mac_sta_notify(struct ieee80211_hw *hw,
3478 struct ieee80211_vif *vif,
3479 enum sta_notify_cmd cmd,
3480 struct ieee80211_sta *sta)
3481{
3482 struct iwl_priv *priv = hw->priv;
3483 struct iwl_station_priv *sta_priv = (void *)sta->drv_priv;
3484 int sta_id;
3485
3486 switch (cmd) {
3487 case STA_NOTIFY_SLEEP:
3488 WARN_ON(!sta_priv->client);
3489 sta_priv->asleep = true;
3490 if (atomic_read(&sta_priv->pending_frames) > 0)
3491 ieee80211_sta_block_awake(hw, sta, true);
3492 break;
3493 case STA_NOTIFY_AWAKE:
3494 WARN_ON(!sta_priv->client);
3495 if (!sta_priv->asleep)
3496 break;
3497 sta_priv->asleep = false;
3498 sta_id = iwl_sta_id(sta);
3499 if (sta_id != IWL_INVALID_STATION)
3500 iwl_sta_modify_ps_wake(priv, sta_id);
3501 break;
3502 default:
3503 break;
3504 }
3505}
3506
3507int iwlagn_mac_sta_add(struct ieee80211_hw *hw, 3477int iwlagn_mac_sta_add(struct ieee80211_hw *hw,
3508 struct ieee80211_vif *vif, 3478 struct ieee80211_vif *vif,
3509 struct ieee80211_sta *sta) 3479 struct ieee80211_sta *sta)
@@ -3903,6 +3873,7 @@ static void iwl_uninit_drv(struct iwl_priv *priv)
3903 kfree(priv->scan_cmd); 3873 kfree(priv->scan_cmd);
3904} 3874}
3905 3875
3876#ifdef CONFIG_IWL5000
3906struct ieee80211_ops iwlagn_hw_ops = { 3877struct ieee80211_ops iwlagn_hw_ops = {
3907 .tx = iwlagn_mac_tx, 3878 .tx = iwlagn_mac_tx,
3908 .start = iwlagn_mac_start, 3879 .start = iwlagn_mac_start,
@@ -3925,6 +3896,7 @@ struct ieee80211_ops iwlagn_hw_ops = {
3925 .flush = iwlagn_mac_flush, 3896 .flush = iwlagn_mac_flush,
3926 .tx_last_beacon = iwl_mac_tx_last_beacon, 3897 .tx_last_beacon = iwl_mac_tx_last_beacon,
3927}; 3898};
3899#endif
3928 3900
3929static void iwl_hw_detect(struct iwl_priv *priv) 3901static void iwl_hw_detect(struct iwl_priv *priv)
3930{ 3902{
@@ -3992,7 +3964,9 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3992 if (cfg->mod_params->disable_hw_scan) { 3964 if (cfg->mod_params->disable_hw_scan) {
3993 dev_printk(KERN_DEBUG, &(pdev->dev), 3965 dev_printk(KERN_DEBUG, &(pdev->dev),
3994 "sw scan support is deprecated\n"); 3966 "sw scan support is deprecated\n");
3967#ifdef CONFIG_IWL5000
3995 iwlagn_hw_ops.hw_scan = NULL; 3968 iwlagn_hw_ops.hw_scan = NULL;
3969#endif
3996#ifdef CONFIG_IWL4965 3970#ifdef CONFIG_IWL4965
3997 iwl4965_hw_ops.hw_scan = NULL; 3971 iwl4965_hw_ops.hw_scan = NULL;
3998#endif 3972#endif
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index aca93f4477a8..28837a185a28 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -301,9 +301,12 @@ int iwl_sta_rx_agg_start(struct iwl_priv *priv, struct ieee80211_sta *sta,
301 int tid, u16 ssn); 301 int tid, u16 ssn);
302int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta, 302int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta,
303 int tid); 303 int tid);
304void iwl_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id);
305void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt); 304void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt);
306int iwl_update_bcast_stations(struct iwl_priv *priv); 305int iwl_update_bcast_stations(struct iwl_priv *priv);
306void iwlagn_mac_sta_notify(struct ieee80211_hw *hw,
307 struct ieee80211_vif *vif,
308 enum sta_notify_cmd cmd,
309 struct ieee80211_sta *sta);
307 310
308/* rate */ 311/* rate */
309static inline u32 iwl_ant_idx_to_flags(u8 ant_idx) 312static inline u32 iwl_ant_idx_to_flags(u8 ant_idx)