提交 7c354242 编写于 作者: M Marek Puzyniak 提交者: Kalle Valo

ath10k: update station counting

Currently station counting functions
(inc_num_stations/dec_num_stations) does not handle
tdls type of stations. Tdls station should be counted
because it consumes peer in firmware. Only not tdls
stations are excluded from this counting.
Signed-off-by: NMarek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
上级 8cca3d60
...@@ -4401,14 +4401,14 @@ static void ath10k_sta_rc_update_wk(struct work_struct *wk) ...@@ -4401,14 +4401,14 @@ static void ath10k_sta_rc_update_wk(struct work_struct *wk)
mutex_unlock(&ar->conf_mutex); mutex_unlock(&ar->conf_mutex);
} }
static int ath10k_mac_inc_num_stations(struct ath10k_vif *arvif) static int ath10k_mac_inc_num_stations(struct ath10k_vif *arvif,
struct ieee80211_sta *sta)
{ {
struct ath10k *ar = arvif->ar; struct ath10k *ar = arvif->ar;
lockdep_assert_held(&ar->conf_mutex); lockdep_assert_held(&ar->conf_mutex);
if (arvif->vdev_type != WMI_VDEV_TYPE_AP && if (arvif->vdev_type == WMI_VDEV_TYPE_STA && !sta->tdls)
arvif->vdev_type != WMI_VDEV_TYPE_IBSS)
return 0; return 0;
if (ar->num_stations >= ar->max_num_stations) if (ar->num_stations >= ar->max_num_stations)
...@@ -4419,14 +4419,14 @@ static int ath10k_mac_inc_num_stations(struct ath10k_vif *arvif) ...@@ -4419,14 +4419,14 @@ static int ath10k_mac_inc_num_stations(struct ath10k_vif *arvif)
return 0; return 0;
} }
static void ath10k_mac_dec_num_stations(struct ath10k_vif *arvif) static void ath10k_mac_dec_num_stations(struct ath10k_vif *arvif,
struct ieee80211_sta *sta)
{ {
struct ath10k *ar = arvif->ar; struct ath10k *ar = arvif->ar;
lockdep_assert_held(&ar->conf_mutex); lockdep_assert_held(&ar->conf_mutex);
if (arvif->vdev_type != WMI_VDEV_TYPE_AP && if (arvif->vdev_type == WMI_VDEV_TYPE_STA && !sta->tdls)
arvif->vdev_type != WMI_VDEV_TYPE_IBSS)
return; return;
ar->num_stations--; ar->num_stations--;
...@@ -4468,7 +4468,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, ...@@ -4468,7 +4468,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
ar->num_stations + 1, ar->max_num_stations, ar->num_stations + 1, ar->max_num_stations,
ar->num_peers + 1, ar->max_num_peers); ar->num_peers + 1, ar->max_num_peers);
ret = ath10k_mac_inc_num_stations(arvif); ret = ath10k_mac_inc_num_stations(arvif, sta);
if (ret) { if (ret) {
ath10k_warn(ar, "refusing to associate station: too many connected already (%d)\n", ath10k_warn(ar, "refusing to associate station: too many connected already (%d)\n",
ar->max_num_stations); ar->max_num_stations);
...@@ -4480,7 +4480,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, ...@@ -4480,7 +4480,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
if (ret) { if (ret) {
ath10k_warn(ar, "failed to add peer %pM for vdev %d when adding a new sta: %i\n", ath10k_warn(ar, "failed to add peer %pM for vdev %d when adding a new sta: %i\n",
sta->addr, arvif->vdev_id, ret); sta->addr, arvif->vdev_id, ret);
ath10k_mac_dec_num_stations(arvif); ath10k_mac_dec_num_stations(arvif, sta);
goto exit; goto exit;
} }
...@@ -4493,7 +4493,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, ...@@ -4493,7 +4493,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
arvif->vdev_id, ret); arvif->vdev_id, ret);
WARN_ON(ath10k_peer_delete(ar, arvif->vdev_id, WARN_ON(ath10k_peer_delete(ar, arvif->vdev_id,
sta->addr)); sta->addr));
ath10k_mac_dec_num_stations(arvif); ath10k_mac_dec_num_stations(arvif, sta);
goto exit; goto exit;
} }
...@@ -4524,7 +4524,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, ...@@ -4524,7 +4524,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
ath10k_warn(ar, "failed to delete peer %pM for vdev %d: %i\n", ath10k_warn(ar, "failed to delete peer %pM for vdev %d: %i\n",
sta->addr, arvif->vdev_id, ret); sta->addr, arvif->vdev_id, ret);
ath10k_mac_dec_num_stations(arvif); ath10k_mac_dec_num_stations(arvif, sta);
} else if (old_state == IEEE80211_STA_AUTH && } else if (old_state == IEEE80211_STA_AUTH &&
new_state == IEEE80211_STA_ASSOC && new_state == IEEE80211_STA_ASSOC &&
(vif->type == NL80211_IFTYPE_AP || (vif->type == NL80211_IFTYPE_AP ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册