Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291323
b: refs/heads/master
c: 9742051
h: refs/heads/master
i:
  291321: c447f4b
  291319: 92eb402
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Mar 8, 2012
1 parent 3327a6f commit b75c9ca
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 7 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: e6dd5838acf312516fcc4eb34516de5bc45e2980
refs/heads/master: 974205153be8944539890084a170e3ad407164bc
35 changes: 35 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,41 @@ int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id,
return -EINVAL;
}

void iwl_deactivate_station(struct iwl_priv *priv, const u8 sta_id,
const u8 *addr)
{
u8 tid;

if (!iwl_is_ready(priv)) {
IWL_DEBUG_INFO(priv,
"Unable to remove station %pM, device not ready.\n",
addr);
return;
}

IWL_DEBUG_ASSOC(priv, "Deactivating STA: %pM (%d)\n", addr, sta_id);

if (WARN_ON_ONCE(sta_id == IWL_INVALID_STATION))
return;

spin_lock_bh(&priv->sta_lock);

WARN_ON_ONCE(!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE));

for (tid = 0; tid < IWL_MAX_TID_COUNT; tid++)
memset(&priv->tid_data[sta_id][tid], 0,
sizeof(priv->tid_data[sta_id][tid]));

priv->stations[sta_id].used &= ~IWL_STA_DRIVER_ACTIVE;

priv->num_stations--;

if (WARN_ON_ONCE(priv->num_stations < 0))
priv->num_stations = 0;

spin_unlock_bh(&priv->sta_lock);
}

/**
* iwl_clear_ucode_stations - clear ucode station table bits
*
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ int iwl_add_station_common(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
struct ieee80211_sta *sta, u8 *sta_id_r);
int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id,
const u8 *addr);
void iwl_deactivate_station(struct iwl_priv *priv, const u8 sta_id,
const u8 *addr);
u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
const u8 *addr, bool is_ap, struct ieee80211_sta *sta);

Expand Down
22 changes: 16 additions & 6 deletions trunk/drivers/net/wireless/iwlwifi/iwl-mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,12 +724,22 @@ static int iwlagn_mac_sta_remove(struct ieee80211_hw *hw,
struct iwl_station_priv *sta_priv = (void *)sta->drv_priv;
int ret;

IWL_DEBUG_INFO(priv, "proceeding to remove station %pM\n",
sta->addr);
ret = iwl_remove_station(priv, sta_priv->sta_id, sta->addr);
if (ret)
IWL_DEBUG_QUIET_RFKILL(priv, "Error removing station %pM\n",
sta->addr);
IWL_DEBUG_INFO(priv, "proceeding to remove station %pM\n", sta->addr);

if (vif->type == NL80211_IFTYPE_STATION) {
/*
* Station will be removed from device when the RXON
* is set to unassociated -- just deactivate it here
* to avoid re-programming it.
*/
ret = 0;
iwl_deactivate_station(priv, sta_priv->sta_id, sta->addr);
} else {
ret = iwl_remove_station(priv, sta_priv->sta_id, sta->addr);
if (ret)
IWL_DEBUG_QUIET_RFKILL(priv,
"Error removing station %pM\n", sta->addr);
}
return ret;
}

Expand Down

0 comments on commit b75c9ca

Please sign in to comment.