diff options
author | Zhu, Yi <yi.zhu@intel.com> | 2008-10-29 17:05:45 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-10 15:17:36 -0500 |
commit | 60294de3af99586bb4a205274d02a7c8b910c0c3 (patch) | |
tree | 5f28e0bbb7286ed379c34544e7dfa78f9d212743 /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | eb4779c40549f8e0dd45c9a30f279134c9a86131 (diff) |
iwlwifi: fix priv->iw_mode setting when multiple vif are configured
mac80211 supports multiple virtual interfaces for a single device. For
example, a managed interface (wlan0) and a monitor interface (mon0) can
exist at the same time. Thus priv->iw_mode is not sufficient to track
the wireless mode any more. The patch redefines priv->iw_mode as the
first interface mode (the same as priv->vif->type if priv->vif != NULL).
If another monitor type interface is created later, we don't change
priv->iw_mode into monitor. This way, the original interface still
works. The patch also requests mac80211 to do reassociation after we
change the Rx filter flags.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-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.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 9a4ffab29610..119185fb1e26 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -2175,13 +2175,14 @@ static void iwl3945_set_flags_for_phymode(struct iwl3945_priv *priv, | |||
2175 | /* | 2175 | /* |
2176 | * initialize rxon structure with default values from eeprom | 2176 | * initialize rxon structure with default values from eeprom |
2177 | */ | 2177 | */ |
2178 | static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv) | 2178 | static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv, |
2179 | int mode) | ||
2179 | { | 2180 | { |
2180 | const struct iwl3945_channel_info *ch_info; | 2181 | const struct iwl3945_channel_info *ch_info; |
2181 | 2182 | ||
2182 | memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon)); | 2183 | memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon)); |
2183 | 2184 | ||
2184 | switch (priv->iw_mode) { | 2185 | switch (mode) { |
2185 | case NL80211_IFTYPE_AP: | 2186 | case NL80211_IFTYPE_AP: |
2186 | priv->staging_rxon.dev_type = RXON_DEV_TYPE_AP; | 2187 | priv->staging_rxon.dev_type = RXON_DEV_TYPE_AP; |
2187 | break; | 2188 | break; |
@@ -2204,7 +2205,7 @@ static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv) | |||
2204 | RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK; | 2205 | RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK; |
2205 | break; | 2206 | break; |
2206 | default: | 2207 | default: |
2207 | IWL_ERROR("Unsupported interface type %d\n", priv->iw_mode); | 2208 | IWL_ERROR("Unsupported interface type %d\n", mode); |
2208 | break; | 2209 | break; |
2209 | } | 2210 | } |
2210 | 2211 | ||
@@ -2227,8 +2228,7 @@ static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv) | |||
2227 | * in some case A channels are all non IBSS | 2228 | * in some case A channels are all non IBSS |
2228 | * in this case force B/G channel | 2229 | * in this case force B/G channel |
2229 | */ | 2230 | */ |
2230 | if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) && | 2231 | if ((mode == NL80211_IFTYPE_ADHOC) && !(is_channel_ibss(ch_info))) |
2231 | !(is_channel_ibss(ch_info))) | ||
2232 | ch_info = &priv->channel_info[0]; | 2232 | ch_info = &priv->channel_info[0]; |
2233 | 2233 | ||
2234 | priv->staging_rxon.channel = cpu_to_le16(ch_info->channel); | 2234 | priv->staging_rxon.channel = cpu_to_le16(ch_info->channel); |
@@ -2261,9 +2261,7 @@ static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode) | |||
2261 | } | 2261 | } |
2262 | } | 2262 | } |
2263 | 2263 | ||
2264 | priv->iw_mode = mode; | 2264 | iwl3945_connection_init_rx_config(priv, mode); |
2265 | |||
2266 | iwl3945_connection_init_rx_config(priv); | ||
2267 | memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN); | 2265 | memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN); |
2268 | 2266 | ||
2269 | iwl3945_clear_stations_table(priv); | 2267 | iwl3945_clear_stations_table(priv); |
@@ -5685,7 +5683,7 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv) | |||
5685 | active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 5683 | active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
5686 | } else { | 5684 | } else { |
5687 | /* Initialize our rx_config data */ | 5685 | /* Initialize our rx_config data */ |
5688 | iwl3945_connection_init_rx_config(priv); | 5686 | iwl3945_connection_init_rx_config(priv, priv->iw_mode); |
5689 | memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN); | 5687 | memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN); |
5690 | } | 5688 | } |
5691 | 5689 | ||
@@ -6001,6 +5999,7 @@ static void iwl3945_bg_set_monitor(struct work_struct *work) | |||
6001 | IWL_ERROR("iwl3945_set_mode() failed\n"); | 5999 | IWL_ERROR("iwl3945_set_mode() failed\n"); |
6002 | 6000 | ||
6003 | mutex_unlock(&priv->mutex); | 6001 | mutex_unlock(&priv->mutex); |
6002 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
6004 | } | 6003 | } |
6005 | 6004 | ||
6006 | #define IWL_SCAN_CHECK_WATCHDOG (7 * HZ) | 6005 | #define IWL_SCAN_CHECK_WATCHDOG (7 * HZ) |
@@ -6544,6 +6543,7 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw, | |||
6544 | 6543 | ||
6545 | spin_lock_irqsave(&priv->lock, flags); | 6544 | spin_lock_irqsave(&priv->lock, flags); |
6546 | priv->vif = conf->vif; | 6545 | priv->vif = conf->vif; |
6546 | priv->iw_mode = conf->type; | ||
6547 | 6547 | ||
6548 | spin_unlock_irqrestore(&priv->lock, flags); | 6548 | spin_unlock_irqrestore(&priv->lock, flags); |
6549 | 6549 | ||