Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121802
b: refs/heads/master
c: 60294de
h: refs/heads/master
v: v3
  • Loading branch information
Zhu, Yi authored and John W. Linville committed Nov 10, 2008
1 parent 4ac4a12 commit b3e3fc1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eb4779c40549f8e0dd45c9a30f279134c9a86131
refs/heads/master: 60294de3af99586bb4a205274d02a7c8b910c0c3
15 changes: 7 additions & 8 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,13 +726,13 @@ static void iwl_set_flags_for_band(struct iwl_priv *priv,
/*
* initialize rxon structure with default values from eeprom
*/
static void iwl4965_connection_init_rx_config(struct iwl_priv *priv)
static void iwl4965_connection_init_rx_config(struct iwl_priv *priv, int mode)
{
const struct iwl_channel_info *ch_info;

memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon));

switch (priv->iw_mode) {
switch (mode) {
case NL80211_IFTYPE_AP:
priv->staging_rxon.dev_type = RXON_DEV_TYPE_AP;
break;
Expand All @@ -755,7 +755,7 @@ static void iwl4965_connection_init_rx_config(struct iwl_priv *priv)
RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK;
break;
default:
IWL_ERROR("Unsupported interface type %d\n", priv->iw_mode);
IWL_ERROR("Unsupported interface type %d\n", mode);
break;
}

Expand Down Expand Up @@ -803,9 +803,7 @@ static void iwl4965_connection_init_rx_config(struct iwl_priv *priv)

static int iwl4965_set_mode(struct iwl_priv *priv, int mode)
{
priv->iw_mode = mode;

iwl4965_connection_init_rx_config(priv);
iwl4965_connection_init_rx_config(priv, mode);
memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN);

iwl_clear_stations_table(priv);
Expand Down Expand Up @@ -2056,7 +2054,7 @@ static void iwl_alive_start(struct iwl_priv *priv)
active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
} else {
/* Initialize our rx_config data */
iwl4965_connection_init_rx_config(priv);
iwl4965_connection_init_rx_config(priv, priv->iw_mode);
memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN);
}

Expand Down Expand Up @@ -2380,7 +2378,6 @@ static void iwl4965_bg_set_monitor(struct work_struct *work)
mutex_lock(&priv->mutex);

ret = iwl4965_set_mode(priv, NL80211_IFTYPE_MONITOR);

if (ret) {
if (ret == -EAGAIN)
IWL_DEBUG(IWL_DL_STATE, "leave - not ready\n");
Expand All @@ -2389,6 +2386,7 @@ static void iwl4965_bg_set_monitor(struct work_struct *work)
}

mutex_unlock(&priv->mutex);
ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
}

static void iwl_bg_run_time_calib_work(struct work_struct *work)
Expand Down Expand Up @@ -2720,6 +2718,7 @@ static int iwl4965_mac_add_interface(struct ieee80211_hw *hw,

spin_lock_irqsave(&priv->lock, flags);
priv->vif = conf->vif;
priv->iw_mode = conf->type;

spin_unlock_irqrestore(&priv->lock, flags);

Expand Down
18 changes: 9 additions & 9 deletions trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2175,13 +2175,14 @@ static void iwl3945_set_flags_for_phymode(struct iwl3945_priv *priv,
/*
* 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;

memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon));

switch (priv->iw_mode) {
switch (mode) {
case NL80211_IFTYPE_AP:
priv->staging_rxon.dev_type = RXON_DEV_TYPE_AP;
break;
Expand All @@ -2204,7 +2205,7 @@ static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv)
RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK;
break;
default:
IWL_ERROR("Unsupported interface type %d\n", priv->iw_mode);
IWL_ERROR("Unsupported interface type %d\n", mode);
break;
}

Expand All @@ -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 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];

priv->staging_rxon.channel = cpu_to_le16(ch_info->channel);
Expand Down Expand Up @@ -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);

iwl3945_clear_stations_table(priv);
Expand Down Expand Up @@ -5685,7 +5683,7 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv)
active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
} else {
/* 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);
}

Expand Down Expand Up @@ -6001,6 +5999,7 @@ static void iwl3945_bg_set_monitor(struct work_struct *work)
IWL_ERROR("iwl3945_set_mode() failed\n");

mutex_unlock(&priv->mutex);
ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
}

#define IWL_SCAN_CHECK_WATCHDOG (7 * HZ)
Expand Down Expand Up @@ -6544,6 +6543,7 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,

spin_lock_irqsave(&priv->lock, flags);
priv->vif = conf->vif;
priv->iw_mode = conf->type;

spin_unlock_irqrestore(&priv->lock, flags);

Expand Down

0 comments on commit b3e3fc1

Please sign in to comment.