diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2010-01-22 17:22:53 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-25 16:36:24 -0500 |
commit | 158bea07c6017fa67bc0c64815ce5c3a998083dc (patch) | |
tree | 5cfd028cf21c9abf2f997a7623314a60f4449e51 | |
parent | 1d8c4ae9169ee8d8ca7fb84a7b6bb4c7a4d49397 (diff) |
iwlwifi: reorder device setup
It is better to first notify cfg80211 about the hw
rfkill state (so the rfkill device that will be
registered won't have the wrong state while being
registered), and the power/tt variable init can
(and probably should) also be done first.
Also rename iwl_setup_mac to
iwl_mac_setup_register to better describe what it
really does.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index bed5dda8d6b2..1853064855cd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2608,7 +2608,7 @@ void iwl_post_associate(struct iwl_priv *priv) | |||
2608 | * Not a mac80211 entry point function, but it fits in with all the | 2608 | * Not a mac80211 entry point function, but it fits in with all the |
2609 | * other mac80211 functions grouped here. | 2609 | * other mac80211 functions grouped here. |
2610 | */ | 2610 | */ |
2611 | static int iwl_setup_mac(struct iwl_priv *priv) | 2611 | static int iwl_mac_setup_register(struct iwl_priv *priv) |
2612 | { | 2612 | { |
2613 | int ret; | 2613 | int ret; |
2614 | struct ieee80211_hw *hw = priv->hw; | 2614 | struct ieee80211_hw *hw = priv->hw; |
@@ -3625,9 +3625,9 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3625 | iwl_setup_deferred_work(priv); | 3625 | iwl_setup_deferred_work(priv); |
3626 | iwl_setup_rx_handlers(priv); | 3626 | iwl_setup_rx_handlers(priv); |
3627 | 3627 | ||
3628 | /********************************** | 3628 | /********************************************* |
3629 | * 8. Setup and register mac80211 | 3629 | * 8. Enable interrupts and read RFKILL state |
3630 | **********************************/ | 3630 | *********************************************/ |
3631 | 3631 | ||
3632 | /* enable interrupts if needed: hw bug w/a */ | 3632 | /* enable interrupts if needed: hw bug w/a */ |
3633 | pci_read_config_word(priv->pci_dev, PCI_COMMAND, &pci_cmd); | 3633 | pci_read_config_word(priv->pci_dev, PCI_COMMAND, &pci_cmd); |
@@ -3638,14 +3638,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3638 | 3638 | ||
3639 | iwl_enable_interrupts(priv); | 3639 | iwl_enable_interrupts(priv); |
3640 | 3640 | ||
3641 | err = iwl_setup_mac(priv); | ||
3642 | if (err) | ||
3643 | goto out_remove_sysfs; | ||
3644 | |||
3645 | err = iwl_dbgfs_register(priv, DRV_NAME); | ||
3646 | if (err) | ||
3647 | IWL_ERR(priv, "failed to create debugfs files. Ignoring error: %d\n", err); | ||
3648 | |||
3649 | /* If platform's RF_KILL switch is NOT set to KILL */ | 3641 | /* If platform's RF_KILL switch is NOT set to KILL */ |
3650 | if (iwl_read32(priv, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW) | 3642 | if (iwl_read32(priv, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW) |
3651 | clear_bit(STATUS_RF_KILL_HW, &priv->status); | 3643 | clear_bit(STATUS_RF_KILL_HW, &priv->status); |
@@ -3657,6 +3649,18 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3657 | 3649 | ||
3658 | iwl_power_initialize(priv); | 3650 | iwl_power_initialize(priv); |
3659 | iwl_tt_initialize(priv); | 3651 | iwl_tt_initialize(priv); |
3652 | |||
3653 | /************************************************** | ||
3654 | * 9. Setup and register with mac80211 and debugfs | ||
3655 | **************************************************/ | ||
3656 | err = iwl_mac_setup_register(priv); | ||
3657 | if (err) | ||
3658 | goto out_remove_sysfs; | ||
3659 | |||
3660 | err = iwl_dbgfs_register(priv, DRV_NAME); | ||
3661 | if (err) | ||
3662 | IWL_ERR(priv, "failed to create debugfs files. Ignoring error: %d\n", err); | ||
3663 | |||
3660 | return 0; | 3664 | return 0; |
3661 | 3665 | ||
3662 | out_remove_sysfs: | 3666 | out_remove_sysfs: |