summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDon Fry <donald.h.fry@intel.com>2011-12-09 18:07:38 (GMT)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-12-16 15:23:48 (GMT)
commit09af14030d77d5f43229adabdd3c84c63f3499aa (patch)
tree09a05f78270554986c41306aa5a2a915cb22c23d /drivers
parent23fd7b029fa58c265bfa757603fd2af27c7af3ad (diff)
downloadlinux-09af14030d77d5f43229adabdd3c84c63f3499aa.tar.xz
iwlwifi: create iwl_mac80211 unregister routine
The mac80211 setup_register operations are collected in one routine, but the cleanup routines are not. Create a routine for this. Signed-off-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-mac80211.c9
3 files changed, 11 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 5a9370d..f7e089d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1915,12 +1915,7 @@ void __devexit iwl_remove(struct iwl_priv * priv)
set_bit(STATUS_EXIT_PENDING, &priv->shrd->status);
iwl_testmode_cleanup(priv);
- iwl_leds_exit(priv);
-
- if (priv->mac80211_registered) {
- ieee80211_unregister_hw(priv->hw);
- priv->mac80211_registered = 0;
- }
+ iwlagn_mac_unregister(priv);
iwl_tt_exit(priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index 66bcd3e..2c5b6c4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -91,6 +91,7 @@ void iwlagn_prepare_restart(struct iwl_priv *priv);
struct ieee80211_hw *iwl_alloc_all(void);
int iwlagn_mac_setup_register(struct iwl_priv *priv,
struct iwlagn_ucode_capabilities *capa);
+void iwlagn_mac_unregister(struct iwl_priv *priv);
/* RXON */
int iwlagn_set_pan_params(struct iwl_priv *priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
index 8074c6e..412ff48 100644
--- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c
+++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
@@ -245,6 +245,15 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
return 0;
}
+void iwlagn_mac_unregister(struct iwl_priv *priv)
+{
+ if (!priv->mac80211_registered)
+ return;
+ iwl_leds_exit(priv);
+ ieee80211_unregister_hw(priv->hw);
+ priv->mac80211_registered = 0;
+}
+
static int __iwl_up(struct iwl_priv *priv)
{
struct iwl_rxon_context *ctx;