aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2009-02-18 18:54:27 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 14:52:45 -0500
commite9dde6f6edf9954e2c75d2d738cae0f00e9b0fbc (patch)
tree2af59857d5f05d975c10006277f3011bfb9ab609 /drivers/net/wireless/iwlwifi/iwl3945-base.c
parentcade0eb2c7c7b8df60ac54409592c1a23e3220c8 (diff)
iwl3945: use iwl_mac_hw_scan callback
3945 can use iwl_mac_hw_scan callback instead of iwl3945_mac_hw_scan callback. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c94
1 files changed, 1 insertions, 93 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 2ad4d760ad2d..6d816ebd7cea 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -726,38 +726,6 @@ static void iwl3945_setup_rxon_timing(struct iwl_priv *priv)
726 le16_to_cpu(priv->rxon_timing.atim_window)); 726 le16_to_cpu(priv->rxon_timing.atim_window));
727} 727}
728 728
729static int iwl3945_scan_initiate(struct iwl_priv *priv)
730{
731 if (!iwl_is_ready_rf(priv)) {
732 IWL_DEBUG_SCAN(priv, "Aborting scan due to not ready.\n");
733 return -EIO;
734 }
735
736 if (test_bit(STATUS_SCANNING, &priv->status)) {
737 IWL_DEBUG_SCAN(priv, "Scan already in progress.\n");
738 return -EAGAIN;
739 }
740
741 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
742 IWL_DEBUG_SCAN(priv, "Scan request while abort pending. "
743 "Queuing.\n");
744 return -EAGAIN;
745 }
746
747 IWL_DEBUG_INFO(priv, "Starting scan...\n");
748 if (priv->cfg->sku & IWL_SKU_G)
749 priv->scan_bands |= BIT(IEEE80211_BAND_2GHZ);
750 if (priv->cfg->sku & IWL_SKU_A)
751 priv->scan_bands |= BIT(IEEE80211_BAND_5GHZ);
752 set_bit(STATUS_SCANNING, &priv->status);
753 priv->scan_start = jiffies;
754 priv->scan_pass_start = priv->scan_start;
755
756 queue_work(priv->workqueue, &priv->request_scan);
757
758 return 0;
759}
760
761static int iwl3945_set_mode(struct iwl_priv *priv, int mode) 729static int iwl3945_set_mode(struct iwl_priv *priv, int mode)
762{ 730{
763 if (mode == NL80211_IFTYPE_ADHOC) { 731 if (mode == NL80211_IFTYPE_ADHOC) {
@@ -4316,66 +4284,6 @@ static void iwl3945_bss_info_changed(struct ieee80211_hw *hw,
4316 4284
4317} 4285}
4318 4286
4319static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw,
4320 struct cfg80211_scan_request *req)
4321{
4322 int rc = 0;
4323 unsigned long flags;
4324 struct iwl_priv *priv = hw->priv;
4325 size_t len = 0;
4326 u8 *ssid = NULL;
4327 DECLARE_SSID_BUF(ssid_buf);
4328
4329 IWL_DEBUG_MAC80211(priv, "enter\n");
4330
4331 if (req->n_ssids) {
4332 ssid = req->ssids[0].ssid;
4333 len = req->ssids[0].ssid_len;
4334 }
4335
4336 mutex_lock(&priv->mutex);
4337 spin_lock_irqsave(&priv->lock, flags);
4338
4339 if (!iwl_is_ready_rf(priv)) {
4340 rc = -EIO;
4341 IWL_DEBUG_MAC80211(priv, "leave - not ready or exit pending\n");
4342 goto out_unlock;
4343 }
4344
4345 /* we don't schedule scan within next_scan_jiffies period */
4346 if (priv->next_scan_jiffies &&
4347 time_after(priv->next_scan_jiffies, jiffies)) {
4348 rc = -EAGAIN;
4349 goto out_unlock;
4350 }
4351 /* if we just finished scan ask for delay for a broadcast scan */
4352 if ((len == 0) && priv->last_scan_jiffies &&
4353 time_after(priv->last_scan_jiffies + IWL_DELAY_NEXT_SCAN,
4354 jiffies)) {
4355 rc = -EAGAIN;
4356 goto out_unlock;
4357 }
4358 if (len) {
4359 IWL_DEBUG_SCAN(priv, "direct scan for %s [%zd]\n ",
4360 print_ssid(ssid_buf, ssid, len), len);
4361
4362 priv->one_direct_scan = 1;
4363 priv->direct_ssid_len = len;
4364 memcpy(priv->direct_ssid, ssid, len);
4365 } else
4366 priv->one_direct_scan = 0;
4367
4368 rc = iwl3945_scan_initiate(priv);
4369
4370 IWL_DEBUG_MAC80211(priv, "leave\n");
4371
4372out_unlock:
4373 spin_unlock_irqrestore(&priv->lock, flags);
4374 mutex_unlock(&priv->mutex);
4375
4376 return rc;
4377}
4378
4379static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, 4287static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
4380 struct ieee80211_vif *vif, 4288 struct ieee80211_vif *vif,
4381 struct ieee80211_sta *sta, 4289 struct ieee80211_sta *sta,
@@ -5149,7 +5057,7 @@ static struct ieee80211_ops iwl3945_hw_ops = {
5149 .conf_tx = iwl3945_mac_conf_tx, 5057 .conf_tx = iwl3945_mac_conf_tx,
5150 .reset_tsf = iwl3945_mac_reset_tsf, 5058 .reset_tsf = iwl3945_mac_reset_tsf,
5151 .bss_info_changed = iwl3945_bss_info_changed, 5059 .bss_info_changed = iwl3945_bss_info_changed,
5152 .hw_scan = iwl3945_mac_hw_scan 5060 .hw_scan = iwl_mac_hw_scan
5153}; 5061};
5154 5062
5155static int iwl3945_init_drv(struct iwl_priv *priv) 5063static int iwl3945_init_drv(struct iwl_priv *priv)