|
@@ -2175,13 +2175,14 @@ static void iwl3945_set_flags_for_phymode(struct iwl3945_priv *priv,
|
|
/*
|
|
/*
|
|
* initialize rxon structure with default values from eeprom
|
|
* initialize rxon structure with default values from eeprom
|
|
*/
|
|
*/
|
|
-static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv)
|
|
|
|
|
|
+static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv,
|
|
|
|
+ int mode)
|
|
{
|
|
{
|
|
const struct iwl3945_channel_info *ch_info;
|
|
const struct iwl3945_channel_info *ch_info;
|
|
|
|
|
|
memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon));
|
|
memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon));
|
|
|
|
|
|
- switch (priv->iw_mode) {
|
|
|
|
|
|
+ switch (mode) {
|
|
case NL80211_IFTYPE_AP:
|
|
case NL80211_IFTYPE_AP:
|
|
priv->staging_rxon.dev_type = RXON_DEV_TYPE_AP;
|
|
priv->staging_rxon.dev_type = RXON_DEV_TYPE_AP;
|
|
break;
|
|
break;
|
|
@@ -2204,7 +2205,7 @@ static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv)
|
|
RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK;
|
|
RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK;
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
- IWL_ERROR("Unsupported interface type %d\n", priv->iw_mode);
|
|
|
|
|
|
+ IWL_ERROR("Unsupported interface type %d\n", mode);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2227,8 +2228,7 @@ static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv)
|
|
* in some case A channels are all non IBSS
|
|
* in some case A channels are all non IBSS
|
|
* in this case force B/G channel
|
|
* in this case force B/G channel
|
|
*/
|
|
*/
|
|
- if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) &&
|
|
|
|
- !(is_channel_ibss(ch_info)))
|
|
|
|
|
|
+ if ((mode == NL80211_IFTYPE_ADHOC) && !(is_channel_ibss(ch_info)))
|
|
ch_info = &priv->channel_info[0];
|
|
ch_info = &priv->channel_info[0];
|
|
|
|
|
|
priv->staging_rxon.channel = cpu_to_le16(ch_info->channel);
|
|
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)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- priv->iw_mode = mode;
|
|
|
|
-
|
|
|
|
- iwl3945_connection_init_rx_config(priv);
|
|
|
|
|
|
+ iwl3945_connection_init_rx_config(priv, mode);
|
|
memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN);
|
|
memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN);
|
|
|
|
|
|
iwl3945_clear_stations_table(priv);
|
|
iwl3945_clear_stations_table(priv);
|
|
@@ -5685,7 +5683,7 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv)
|
|
active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
|
|
active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
|
|
} else {
|
|
} else {
|
|
/* Initialize our rx_config data */
|
|
/* Initialize our rx_config data */
|
|
- iwl3945_connection_init_rx_config(priv);
|
|
|
|
|
|
+ iwl3945_connection_init_rx_config(priv, priv->iw_mode);
|
|
memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN);
|
|
memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -6001,6 +5999,7 @@ static void iwl3945_bg_set_monitor(struct work_struct *work)
|
|
IWL_ERROR("iwl3945_set_mode() failed\n");
|
|
IWL_ERROR("iwl3945_set_mode() failed\n");
|
|
|
|
|
|
mutex_unlock(&priv->mutex);
|
|
mutex_unlock(&priv->mutex);
|
|
|
|
+ ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
|
|
}
|
|
}
|
|
|
|
|
|
#define IWL_SCAN_CHECK_WATCHDOG (7 * HZ)
|
|
#define IWL_SCAN_CHECK_WATCHDOG (7 * HZ)
|
|
@@ -6544,6 +6543,7 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
|
|
|
|
|
|
spin_lock_irqsave(&priv->lock, flags);
|
|
spin_lock_irqsave(&priv->lock, flags);
|
|
priv->vif = conf->vif;
|
|
priv->vif = conf->vif;
|
|
|
|
+ priv->iw_mode = conf->type;
|
|
|
|
|
|
spin_unlock_irqrestore(&priv->lock, flags);
|
|
spin_unlock_irqrestore(&priv->lock, flags);
|
|
|
|
|