aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-06-04 12:26:06 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-06-10 13:27:49 -0400
commita60e77e5a41330334fd0ca428f18919d1ea6ed62 (patch)
tree74ab8959c0bb0dece119c52db41c55df0926f6ea /drivers/net/wireless/iwlwifi/iwl3945-base.c
parent1506e30b5f25f6c3357167a18f0e4ae6f5662a28 (diff)
iwlwifi: port to cfg80211 rfkill
This ports the iwlwifi rfkill code to the new API offered by cfg80211 and thus removes a lot of useless stuff. The soft- rfkill is completely removed since that is now handled by setting the interfaces down. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Tested-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.c41
1 files changed, 6 insertions, 35 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 92fa1a39c446..83d31606dd00 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -1009,18 +1009,12 @@ static void iwl3945_rx_card_state_notif(struct iwl_priv *priv,
1009 clear_bit(STATUS_RF_KILL_HW, &priv->status); 1009 clear_bit(STATUS_RF_KILL_HW, &priv->status);
1010 1010
1011 1011
1012 if (flags & SW_CARD_DISABLED)
1013 set_bit(STATUS_RF_KILL_SW, &priv->status);
1014 else
1015 clear_bit(STATUS_RF_KILL_SW, &priv->status);
1016
1017 iwl_scan_cancel(priv); 1012 iwl_scan_cancel(priv);
1018 1013
1019 if ((test_bit(STATUS_RF_KILL_HW, &status) != 1014 if ((test_bit(STATUS_RF_KILL_HW, &status) !=
1020 test_bit(STATUS_RF_KILL_HW, &priv->status)) || 1015 test_bit(STATUS_RF_KILL_HW, &priv->status)))
1021 (test_bit(STATUS_RF_KILL_SW, &status) != 1016 wiphy_rfkill_set_hw_state(priv->hw->wiphy,
1022 test_bit(STATUS_RF_KILL_SW, &priv->status))) 1017 test_bit(STATUS_RF_KILL_HW, &priv->status));
1023 queue_work(priv->workqueue, &priv->rf_kill);
1024 else 1018 else
1025 wake_up_interruptible(&priv->wait_command_queue); 1019 wake_up_interruptible(&priv->wait_command_queue);
1026} 1020}
@@ -2586,8 +2580,6 @@ static void __iwl3945_down(struct iwl_priv *priv)
2586 if (!iwl_is_init(priv)) { 2580 if (!iwl_is_init(priv)) {
2587 priv->status = test_bit(STATUS_RF_KILL_HW, &priv->status) << 2581 priv->status = test_bit(STATUS_RF_KILL_HW, &priv->status) <<
2588 STATUS_RF_KILL_HW | 2582 STATUS_RF_KILL_HW |
2589 test_bit(STATUS_RF_KILL_SW, &priv->status) <<
2590 STATUS_RF_KILL_SW |
2591 test_bit(STATUS_GEO_CONFIGURED, &priv->status) << 2583 test_bit(STATUS_GEO_CONFIGURED, &priv->status) <<
2592 STATUS_GEO_CONFIGURED | 2584 STATUS_GEO_CONFIGURED |
2593 test_bit(STATUS_EXIT_PENDING, &priv->status) << 2585 test_bit(STATUS_EXIT_PENDING, &priv->status) <<
@@ -2596,11 +2588,9 @@ static void __iwl3945_down(struct iwl_priv *priv)
2596 } 2588 }
2597 2589
2598 /* ...otherwise clear out all the status bits but the RF Kill 2590 /* ...otherwise clear out all the status bits but the RF Kill
2599 * bits and continue taking the NIC down. */ 2591 * bit and continue taking the NIC down. */
2600 priv->status &= test_bit(STATUS_RF_KILL_HW, &priv->status) << 2592 priv->status &= test_bit(STATUS_RF_KILL_HW, &priv->status) <<
2601 STATUS_RF_KILL_HW | 2593 STATUS_RF_KILL_HW |
2602 test_bit(STATUS_RF_KILL_SW, &priv->status) <<
2603 STATUS_RF_KILL_SW |
2604 test_bit(STATUS_GEO_CONFIGURED, &priv->status) << 2594 test_bit(STATUS_GEO_CONFIGURED, &priv->status) <<
2605 STATUS_GEO_CONFIGURED | 2595 STATUS_GEO_CONFIGURED |
2606 test_bit(STATUS_FW_ERROR, &priv->status) << 2596 test_bit(STATUS_FW_ERROR, &priv->status) <<
@@ -2657,12 +2647,6 @@ static int __iwl3945_up(struct iwl_priv *priv)
2657 return -EIO; 2647 return -EIO;
2658 } 2648 }
2659 2649
2660 if (test_bit(STATUS_RF_KILL_SW, &priv->status)) {
2661 IWL_WARN(priv, "Radio disabled by SW RF kill (module "
2662 "parameter)\n");
2663 return -ENODEV;
2664 }
2665
2666 if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) { 2650 if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) {
2667 IWL_ERR(priv, "ucode not available for device bring up\n"); 2651 IWL_ERR(priv, "ucode not available for device bring up\n");
2668 return -EIO; 2652 return -EIO;
@@ -2779,15 +2763,14 @@ static void iwl3945_rfkill_poll(struct work_struct *data)
2779{ 2763{
2780 struct iwl_priv *priv = 2764 struct iwl_priv *priv =
2781 container_of(data, struct iwl_priv, rfkill_poll.work); 2765 container_of(data, struct iwl_priv, rfkill_poll.work);
2782 unsigned long status = priv->status;
2783 2766
2784 if (iwl_read32(priv, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW) 2767 if (iwl_read32(priv, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
2785 clear_bit(STATUS_RF_KILL_HW, &priv->status); 2768 clear_bit(STATUS_RF_KILL_HW, &priv->status);
2786 else 2769 else
2787 set_bit(STATUS_RF_KILL_HW, &priv->status); 2770 set_bit(STATUS_RF_KILL_HW, &priv->status);
2788 2771
2789 if (test_bit(STATUS_RF_KILL_HW, &status) != test_bit(STATUS_RF_KILL_HW, &priv->status)) 2772 wiphy_rfkill_set_hw_state(priv->hw->wiphy,
2790 queue_work(priv->workqueue, &priv->rf_kill); 2773 test_bit(STATUS_RF_KILL_HW, &priv->status));
2791 2774
2792 queue_delayed_work(priv->workqueue, &priv->rfkill_poll, 2775 queue_delayed_work(priv->workqueue, &priv->rfkill_poll,
2793 round_jiffies_relative(2 * HZ)); 2776 round_jiffies_relative(2 * HZ));
@@ -3019,7 +3002,6 @@ static void iwl3945_bg_up(struct work_struct *data)
3019 mutex_lock(&priv->mutex); 3002 mutex_lock(&priv->mutex);
3020 __iwl3945_up(priv); 3003 __iwl3945_up(priv);
3021 mutex_unlock(&priv->mutex); 3004 mutex_unlock(&priv->mutex);
3022 iwl_rfkill_set_hw_state(priv);
3023} 3005}
3024 3006
3025static void iwl3945_bg_restart(struct work_struct *data) 3007static void iwl3945_bg_restart(struct work_struct *data)
@@ -3182,8 +3164,6 @@ static int iwl3945_mac_start(struct ieee80211_hw *hw)
3182 3164
3183 mutex_unlock(&priv->mutex); 3165 mutex_unlock(&priv->mutex);
3184 3166
3185 iwl_rfkill_set_hw_state(priv);
3186
3187 if (ret) 3167 if (ret)
3188 goto out_release_irq; 3168 goto out_release_irq;
3189 3169
@@ -3836,7 +3816,6 @@ static void iwl3945_setup_deferred_work(struct iwl_priv *priv)
3836 INIT_WORK(&priv->up, iwl3945_bg_up); 3816 INIT_WORK(&priv->up, iwl3945_bg_up);
3837 INIT_WORK(&priv->restart, iwl3945_bg_restart); 3817 INIT_WORK(&priv->restart, iwl3945_bg_restart);
3838 INIT_WORK(&priv->rx_replenish, iwl3945_bg_rx_replenish); 3818 INIT_WORK(&priv->rx_replenish, iwl3945_bg_rx_replenish);
3839 INIT_WORK(&priv->rf_kill, iwl_bg_rf_kill);
3840 INIT_WORK(&priv->beacon_update, iwl3945_bg_beacon_update); 3819 INIT_WORK(&priv->beacon_update, iwl3945_bg_beacon_update);
3841 INIT_DELAYED_WORK(&priv->init_alive_start, iwl3945_bg_init_alive_start); 3820 INIT_DELAYED_WORK(&priv->init_alive_start, iwl3945_bg_init_alive_start);
3842 INIT_DELAYED_WORK(&priv->alive_start, iwl3945_bg_alive_start); 3821 INIT_DELAYED_WORK(&priv->alive_start, iwl3945_bg_alive_start);
@@ -4203,13 +4182,6 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
4203 if (err) 4182 if (err)
4204 IWL_ERR(priv, "failed to create debugfs files. Ignoring error: %d\n", err); 4183 IWL_ERR(priv, "failed to create debugfs files. Ignoring error: %d\n", err);
4205 4184
4206 err = iwl_rfkill_init(priv);
4207 if (err)
4208 IWL_ERR(priv, "Unable to initialize RFKILL system. "
4209 "Ignoring error: %d\n", err);
4210 else
4211 iwl_rfkill_set_hw_state(priv);
4212
4213 /* Start monitoring the killswitch */ 4185 /* Start monitoring the killswitch */
4214 queue_delayed_work(priv->workqueue, &priv->rfkill_poll, 4186 queue_delayed_work(priv->workqueue, &priv->rfkill_poll,
4215 2 * HZ); 4187 2 * HZ);
@@ -4275,7 +4247,6 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev)
4275 4247
4276 sysfs_remove_group(&pdev->dev.kobj, &iwl3945_attribute_group); 4248 sysfs_remove_group(&pdev->dev.kobj, &iwl3945_attribute_group);
4277 4249
4278 iwl_rfkill_unregister(priv);
4279 cancel_delayed_work_sync(&priv->rfkill_poll); 4250 cancel_delayed_work_sync(&priv->rfkill_poll);
4280 4251
4281 iwl3945_dealloc_ucode_pci(priv); 4252 iwl3945_dealloc_ucode_pci(priv);