aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-sta.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-sta.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
index 23e9eab477bb..c4175603864b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
@@ -546,6 +546,41 @@ out_err:
546 return -EINVAL; 546 return -EINVAL;
547} 547}
548 548
549void iwl_deactivate_station(struct iwl_priv *priv, const u8 sta_id,
550 const u8 *addr)
551{
552 u8 tid;
553
554 if (!iwl_is_ready(priv)) {
555 IWL_DEBUG_INFO(priv,
556 "Unable to remove station %pM, device not ready.\n",
557 addr);
558 return;
559 }
560
561 IWL_DEBUG_ASSOC(priv, "Deactivating STA: %pM (%d)\n", addr, sta_id);
562
563 if (WARN_ON_ONCE(sta_id == IWL_INVALID_STATION))
564 return;
565
566 spin_lock_bh(&priv->sta_lock);
567
568 WARN_ON_ONCE(!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE));
569
570 for (tid = 0; tid < IWL_MAX_TID_COUNT; tid++)
571 memset(&priv->tid_data[sta_id][tid], 0,
572 sizeof(priv->tid_data[sta_id][tid]));
573
574 priv->stations[sta_id].used &= ~IWL_STA_DRIVER_ACTIVE;
575
576 priv->num_stations--;
577
578 if (WARN_ON_ONCE(priv->num_stations < 0))
579 priv->num_stations = 0;
580
581 spin_unlock_bh(&priv->sta_lock);
582}
583
549/** 584/**
550 * iwl_clear_ucode_stations - clear ucode station table bits 585 * iwl_clear_ucode_stations - clear ucode station table bits
551 * 586 *