aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2007-11-27 14:00:52 -0500
committerJohn W. Linville <linville@tuxdriver.com>2007-11-29 21:34:53 -0500
commit864792e3d93a89496e02ca21b2e2eeba0aa857ad (patch)
treeaf9eab356cbc8f5d5acd118f3cc25264b3f1002c /drivers/net/wireless/iwlwifi/iwl3945-base.c
parent6591e36a1c52445f95f26738394909ee9bf94390 (diff)
iwlwifi: fix iwl_mac_add_interface handler
This patch fixes iwl_mac_add_interface. 1. Currently only one interface is supported, instead of silently retuning 0 now it returns -EOPNOTSUPP (By Johannes Berg) 2. It enables changing mac address from user space (By Ian Schram) Signed-off-by: Tomas Winkler <tomas@localhost.localdomain> Cc: Zhu Yi <yi.zhu@intel.com> Cc: Reinette Chatre <reinette.chatre@intel.com> Cc: linux-wireless <linux-wireless@vger.kernel.org Cc: Ian Schram <ischram@telenet.be> Cc: Johannes Berg <johannes@sipsolutions.net> 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.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 5751c89857f0..ae89a0f2c799 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -6940,13 +6940,10 @@ static int iwl_mac_add_interface(struct ieee80211_hw *hw,
6940 DECLARE_MAC_BUF(mac); 6940 DECLARE_MAC_BUF(mac);
6941 6941
6942 IWL_DEBUG_MAC80211("enter: id %d, type %d\n", conf->if_id, conf->type); 6942 IWL_DEBUG_MAC80211("enter: id %d, type %d\n", conf->if_id, conf->type);
6943 if (conf->mac_addr)
6944 IWL_DEBUG_MAC80211("enter: MAC %s\n",
6945 print_mac(mac, conf->mac_addr));
6946 6943
6947 if (priv->interface_id) { 6944 if (priv->interface_id) {
6948 IWL_DEBUG_MAC80211("leave - interface_id != 0\n"); 6945 IWL_DEBUG_MAC80211("leave - interface_id != 0\n");
6949 return 0; 6946 return -EOPNOTSUPP;
6950 } 6947 }
6951 6948
6952 spin_lock_irqsave(&priv->lock, flags); 6949 spin_lock_irqsave(&priv->lock, flags);
@@ -6955,6 +6952,12 @@ static int iwl_mac_add_interface(struct ieee80211_hw *hw,
6955 spin_unlock_irqrestore(&priv->lock, flags); 6952 spin_unlock_irqrestore(&priv->lock, flags);
6956 6953
6957 mutex_lock(&priv->mutex); 6954 mutex_lock(&priv->mutex);
6955
6956 if (conf->mac_addr) {
6957 IWL_DEBUG_MAC80211("Set: %s\n", print_mac(mac, conf->mac_addr));
6958 memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);
6959 }
6960
6958 iwl_set_mode(priv, conf->type); 6961 iwl_set_mode(priv, conf->type);
6959 6962
6960 IWL_DEBUG_MAC80211("leave\n"); 6963 IWL_DEBUG_MAC80211("leave\n");