Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79073
b: refs/heads/master
c: fde3571
h: refs/heads/master
i:
  79071: 5639726
v: v3
  • Loading branch information
Mohamed Abbas authored and David S. Miller committed Jan 28, 2008
1 parent 097b4b0 commit 6a57ae4
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 43 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: 5c0eef960bdb87a53ba390aab7b069b2bc8d7f6d
refs/heads/master: fde3571fd8613483f1203d11394ae316c6b79a03
54 changes: 33 additions & 21 deletions trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2546,9 +2546,6 @@ static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv)

static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode)
{
if (!iwl3945_is_ready_rf(priv))
return -EAGAIN;

if (mode == IEEE80211_IF_TYPE_IBSS) {
const struct iwl3945_channel_info *ch_info;

Expand All @@ -2563,20 +2560,24 @@ static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode)
}
}

cancel_delayed_work(&priv->scan_check);
if (iwl3945_scan_cancel_timeout(priv, 100)) {
IWL_WARNING("Aborted scan still in progress after 100ms\n");
IWL_DEBUG_MAC80211("leaving - scan abort failed.\n");
return -EAGAIN;
}

priv->iw_mode = mode;

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

iwl3945_clear_stations_table(priv);

/* dont commit rxon if rf-kill is on*/
if (!iwl3945_is_ready_rf(priv))
return -EAGAIN;

cancel_delayed_work(&priv->scan_check);
if (iwl3945_scan_cancel_timeout(priv, 100)) {
IWL_WARNING("Aborted scan still in progress after 100ms\n");
IWL_DEBUG_MAC80211("leaving - scan abort failed.\n");
return -EAGAIN;
}

iwl3945_commit_rxon(priv);

return 0;
Expand Down Expand Up @@ -7020,6 +7021,12 @@ static void iwl3945_mac_stop(struct ieee80211_hw *hw)
* RXON_FILTER_ASSOC_MSK BIT
*/
priv->is_open = 0;
if (!iwl3945_is_ready_rf(priv)) {
IWL_DEBUG_MAC80211("leave - RF not ready\n");
mutex_unlock(&priv->mutex);
return;
}

iwl3945_scan_cancel_timeout(priv, 100);
cancel_delayed_work(&priv->post_associate);
priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
Expand Down Expand Up @@ -7291,6 +7298,9 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, int if_id,
priv->ibss_beacon = conf->beacon;
}

if (iwl3945_is_rfkill(priv))
goto done;

if (conf->bssid && !is_zero_ether_addr(conf->bssid) &&
!is_multicast_ether_addr(conf->bssid)) {
/* If there is currently a HW scan going on in the background
Expand Down Expand Up @@ -7325,6 +7335,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, int if_id,
iwl3945_commit_rxon(priv);
}

done:
spin_lock_irqsave(&priv->lock, flags);
if (!conf->ssid_len)
memset(priv->essid, 0, IW_ESSID_MAX_SIZE);
Expand Down Expand Up @@ -7361,11 +7372,12 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw,

mutex_lock(&priv->mutex);

iwl3945_scan_cancel_timeout(priv, 100);
cancel_delayed_work(&priv->post_associate);
priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
iwl3945_commit_rxon(priv);

if (iwl3945_is_ready_rf(priv)) {
iwl3945_scan_cancel_timeout(priv, 100);
cancel_delayed_work(&priv->post_associate);
priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
iwl3945_commit_rxon(priv);
}
if (priv->interface_id == conf->if_id) {
priv->interface_id = 0;
memset(priv->bssid, 0, ETH_ALEN);
Expand Down Expand Up @@ -7636,6 +7648,12 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)

spin_unlock_irqrestore(&priv->lock, flags);

if (!iwl3945_is_ready_rf(priv)) {
IWL_DEBUG_MAC80211("leave - not ready\n");
mutex_unlock(&priv->mutex);
return;
}

/* we are restarting association process
* clear RXON_FILTER_ASSOC_MSK bit
*/
Expand All @@ -7653,12 +7671,6 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
return;
}

if (!iwl3945_is_ready_rf(priv)) {
IWL_DEBUG_MAC80211("leave - not ready\n");
mutex_unlock(&priv->mutex);
return;
}

priv->only_active_channel = 0;

iwl3945_set_rate(priv);
Expand Down
54 changes: 33 additions & 21 deletions trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2649,9 +2649,6 @@ static void iwl4965_connection_init_rx_config(struct iwl4965_priv *priv)

static int iwl4965_set_mode(struct iwl4965_priv *priv, int mode)
{
if (!iwl4965_is_ready_rf(priv))
return -EAGAIN;

if (mode == IEEE80211_IF_TYPE_IBSS) {
const struct iwl4965_channel_info *ch_info;

Expand All @@ -2666,20 +2663,24 @@ static int iwl4965_set_mode(struct iwl4965_priv *priv, int mode)
}
}

cancel_delayed_work(&priv->scan_check);
if (iwl4965_scan_cancel_timeout(priv, 100)) {
IWL_WARNING("Aborted scan still in progress after 100ms\n");
IWL_DEBUG_MAC80211("leaving - scan abort failed.\n");
return -EAGAIN;
}

priv->iw_mode = mode;

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

iwl4965_clear_stations_table(priv);

/* dont commit rxon if rf-kill is on*/
if (!iwl4965_is_ready_rf(priv))
return -EAGAIN;

cancel_delayed_work(&priv->scan_check);
if (iwl4965_scan_cancel_timeout(priv, 100)) {
IWL_WARNING("Aborted scan still in progress after 100ms\n");
IWL_DEBUG_MAC80211("leaving - scan abort failed.\n");
return -EAGAIN;
}

iwl4965_commit_rxon(priv);

return 0;
Expand Down Expand Up @@ -7458,6 +7459,12 @@ static void iwl4965_mac_stop(struct ieee80211_hw *hw)
* RXON_FILTER_ASSOC_MSK BIT
*/
priv->is_open = 0;
if (!iwl4965_is_ready_rf(priv)) {
IWL_DEBUG_MAC80211("leave - RF not ready\n");
mutex_unlock(&priv->mutex);
return;
}

iwl4965_scan_cancel_timeout(priv, 100);
cancel_delayed_work(&priv->post_associate);
priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
Expand Down Expand Up @@ -7743,6 +7750,9 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw, int if_id,
priv->ibss_beacon = conf->beacon;
}

if (iwl4965_is_rfkill(priv))
goto done;

if (conf->bssid && !is_zero_ether_addr(conf->bssid) &&
!is_multicast_ether_addr(conf->bssid)) {
/* If there is currently a HW scan going on in the background
Expand Down Expand Up @@ -7777,6 +7787,7 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw, int if_id,
iwl4965_commit_rxon(priv);
}

done:
spin_lock_irqsave(&priv->lock, flags);
if (!conf->ssid_len)
memset(priv->essid, 0, IW_ESSID_MAX_SIZE);
Expand Down Expand Up @@ -7813,11 +7824,12 @@ static void iwl4965_mac_remove_interface(struct ieee80211_hw *hw,

mutex_lock(&priv->mutex);

iwl4965_scan_cancel_timeout(priv, 100);
cancel_delayed_work(&priv->post_associate);
priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
iwl4965_commit_rxon(priv);

if (iwl4965_is_ready_rf(priv)) {
iwl4965_scan_cancel_timeout(priv, 100);
cancel_delayed_work(&priv->post_associate);
priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
iwl4965_commit_rxon(priv);
}
if (priv->interface_id == conf->if_id) {
priv->interface_id = 0;
memset(priv->bssid, 0, ETH_ALEN);
Expand Down Expand Up @@ -8130,6 +8142,12 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw)

spin_unlock_irqrestore(&priv->lock, flags);

if (!iwl4965_is_ready_rf(priv)) {
IWL_DEBUG_MAC80211("leave - not ready\n");
mutex_unlock(&priv->mutex);
return;
}

/* we are restarting association process
* clear RXON_FILTER_ASSOC_MSK bit
*/
Expand All @@ -8147,12 +8165,6 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw)
return;
}

if (!iwl4965_is_ready_rf(priv)) {
IWL_DEBUG_MAC80211("leave - not ready\n");
mutex_unlock(&priv->mutex);
return;
}

priv->only_active_channel = 0;

iwl4965_set_rate(priv);
Expand Down

0 comments on commit 6a57ae4

Please sign in to comment.