iwl3945: use iwl_mac_add_interface from iwlwifi
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>
Wed, 8 Apr 2009 18:26:46 +0000 (11:26 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 22 Apr 2009 20:54:43 +0000 (16:54 -0400)
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/net/wireless/iwlwifi/iwl3945-base.c

index 479fcf142707d5bfc839c9671c517204ebeb09bf..7e7b584ec25790661939b4a943e83ed1acb854bf 100644 (file)
@@ -2036,42 +2036,6 @@ static int iwl_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
        return NETDEV_TX_OK;
 }
 
-static int iwl_mac_add_interface(struct ieee80211_hw *hw,
-                                struct ieee80211_if_init_conf *conf)
-{
-       struct iwl_priv *priv = hw->priv;
-       unsigned long flags;
-
-       IWL_DEBUG_MAC80211(priv, "enter: type %d\n", conf->type);
-
-       if (priv->vif) {
-               IWL_DEBUG_MAC80211(priv, "leave - vif != NULL\n");
-               return -EOPNOTSUPP;
-       }
-
-       spin_lock_irqsave(&priv->lock, flags);
-       priv->vif = conf->vif;
-       priv->iw_mode = conf->type;
-
-       spin_unlock_irqrestore(&priv->lock, flags);
-
-       mutex_lock(&priv->mutex);
-
-       if (conf->mac_addr) {
-               IWL_DEBUG_MAC80211(priv, "Set %pM\n", conf->mac_addr);
-               memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);
-       }
-
-       if (iwl_set_mode(priv, conf->type) == -EAGAIN)
-               /* we are not ready, will run again when ready */
-               set_bit(STATUS_MODE_PENDING, &priv->status);
-
-       mutex_unlock(&priv->mutex);
-
-       IWL_DEBUG_MAC80211(priv, "leave\n");
-       return 0;
-}
-
 /**
  * iwl_mac_config - mac80211 config callback
  *
index 01e7604bf33f3ba274a435af0a1c556324163b1d..e08aee9b2b8ce75964c6260831e25e3f0587ee34 100644 (file)
@@ -2381,6 +2381,43 @@ int iwl_set_mode(struct iwl_priv *priv, int mode)
 }
 EXPORT_SYMBOL(iwl_set_mode);
 
+int iwl_mac_add_interface(struct ieee80211_hw *hw,
+                                struct ieee80211_if_init_conf *conf)
+{
+       struct iwl_priv *priv = hw->priv;
+       unsigned long flags;
+
+       IWL_DEBUG_MAC80211(priv, "enter: type %d\n", conf->type);
+
+       if (priv->vif) {
+               IWL_DEBUG_MAC80211(priv, "leave - vif != NULL\n");
+               return -EOPNOTSUPP;
+       }
+
+       spin_lock_irqsave(&priv->lock, flags);
+       priv->vif = conf->vif;
+       priv->iw_mode = conf->type;
+
+       spin_unlock_irqrestore(&priv->lock, flags);
+
+       mutex_lock(&priv->mutex);
+
+       if (conf->mac_addr) {
+               IWL_DEBUG_MAC80211(priv, "Set %pM\n", conf->mac_addr);
+               memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);
+       }
+
+       if (iwl_set_mode(priv, conf->type) == -EAGAIN)
+               /* we are not ready, will run again when ready */
+               set_bit(STATUS_MODE_PENDING, &priv->status);
+
+       mutex_unlock(&priv->mutex);
+
+       IWL_DEBUG_MAC80211(priv, "leave\n");
+       return 0;
+}
+EXPORT_SYMBOL(iwl_mac_add_interface);
+
 #ifdef CONFIG_PM
 
 int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
index 49df47a53b5d3b6f8eec08f91e0783ef6ce57a1f..7df54405bef76e6bb2c721b8bf24661d346cd7c6 100644 (file)
@@ -274,6 +274,8 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
 int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb);
 int iwl_commit_rxon(struct iwl_priv *priv);
 int iwl_set_mode(struct iwl_priv *priv, int mode);
+int iwl_mac_add_interface(struct ieee80211_hw *hw,
+                                struct ieee80211_if_init_conf *conf);
 
 /*****************************************************
  * RX handlers.
index 666c1fff62b28b8aaa5ea973696c13dc472631fd..955e50a124b512e8370a250aa127654633dc894a 100644 (file)
@@ -3380,41 +3380,6 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
        return NETDEV_TX_OK;
 }
 
-static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
-                                struct ieee80211_if_init_conf *conf)
-{
-       struct iwl_priv *priv = hw->priv;
-       unsigned long flags;
-
-       IWL_DEBUG_MAC80211(priv, "enter: type %d\n", conf->type);
-
-       if (priv->vif) {
-               IWL_DEBUG_MAC80211(priv, "leave - vif != NULL\n");
-               return -EOPNOTSUPP;
-       }
-
-       spin_lock_irqsave(&priv->lock, flags);
-       priv->vif = conf->vif;
-       priv->iw_mode = conf->type;
-
-       spin_unlock_irqrestore(&priv->lock, flags);
-
-       mutex_lock(&priv->mutex);
-
-       if (conf->mac_addr) {
-               IWL_DEBUG_MAC80211(priv, "Set: %pM\n", conf->mac_addr);
-               memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);
-       }
-
-       if (iwl_set_mode(priv, conf->type) == -EAGAIN)
-               set_bit(STATUS_MODE_PENDING, &priv->status);
-
-       mutex_unlock(&priv->mutex);
-
-       IWL_DEBUG_MAC80211(priv, "leave\n");
-       return 0;
-}
-
 /**
  * iwl3945_mac_config - mac80211 config callback
  *
@@ -4372,7 +4337,7 @@ static struct ieee80211_ops iwl3945_hw_ops = {
        .tx = iwl3945_mac_tx,
        .start = iwl3945_mac_start,
        .stop = iwl3945_mac_stop,
-       .add_interface = iwl3945_mac_add_interface,
+       .add_interface = iwl_mac_add_interface,
        .remove_interface = iwl3945_mac_remove_interface,
        .config = iwl3945_mac_config,
        .config_interface = iwl3945_mac_config_interface,