From patchwork Fri Mar 20 11:02:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Puzyniak X-Patchwork-Id: 6055581 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 68E90BF90F for ; Fri, 20 Mar 2015 11:01:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2E89E204D1 for ; Fri, 20 Mar 2015 11:01:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4A6E020303 for ; Fri, 20 Mar 2015 11:01:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YYufy-0003yZ-89; Fri, 20 Mar 2015 11:01:14 +0000 Received: from mail-la0-x232.google.com ([2a00:1450:4010:c03::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YYufv-0003kR-S1 for ath10k@lists.infradead.org; Fri, 20 Mar 2015 11:01:12 +0000 Received: by labjg1 with SMTP id jg1so84064360lab.2 for ; Fri, 20 Mar 2015 04:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cUiDq7/O2H3qkRtu8/EMRdLRsZ1LgEZywkI+jU82DGM=; b=Pt6/PmaTw5TDGHFR1ZaimbQKD23JvdXDWbm+sP+8MwBIXejG6eGojodp1tlTvzeOcI 5+/GtfcuiupU5S4PgCNkRoy9rT8Htf3l6R9f/PHkyIV54WoX4o9exi+2rmFpoiSUvHNR Z4x5gqBNYMNaREWW+Lvv7Q85ImJoZTQ5Fg3c8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cUiDq7/O2H3qkRtu8/EMRdLRsZ1LgEZywkI+jU82DGM=; b=mgZsaXVOHMCg926QcgeB9if4DJXpeA8K28tt0NQRzPJIa6Csp3Nomlzhrq89ebrVom EvFg1KWVZYtx4qC58NSTpBkvEeTeq6weO+hcXWLnN2iRaBLn5rOHNqIZU/g8IomAmXfE GpNTr3jgqX6hzdQXlfhzBXZP1shK1pLa+Dr2Z1KnvjC9H3s9kA7pP0+wHEc/qvEActyW Mq57/SbIHXCu9b++ZQYBgHMUpdy17H/3MrCs67bf1Vo0PNcv5ANq+CKJsXCmjI5JGDfX LMEtGnosta8O9hveHGD1DQDnA2CSL0qf/DPEa5LXm7KflgrBAStD4qj+3rHp3mEWhEDa lKpA== X-Gm-Message-State: ALoCoQlmZe84J4+7y5zT5Ng1Lm9cgdWUCsUxExknmFa5kU82xM9//LMPhDuYQpszFJmZSNedRnEdtP5sTsieOBr9BH9RrrUMbfs133FmFkfs/a0Yl7ZBBk8VtFuyJjC3wj8WDHb8QBt4 X-Received: by 10.152.1.70 with SMTP id 6mr49539500lak.83.1426849249506; Fri, 20 Mar 2015 04:00:49 -0700 (PDT) Received: from dell-lap.com ([91.198.246.8]) by mx.google.com with ESMTPSA id ds8sm856282lbb.18.2015.03.20.04.00.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Mar 2015 04:00:48 -0700 (PDT) From: Marek Puzyniak To: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [PATCH v4 4/6] ath10k: update station counting Date: Fri, 20 Mar 2015 12:02:57 +0100 Message-Id: <1426849379-7562-5-git-send-email-marek.puzyniak@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1426849379-7562-1-git-send-email-marek.puzyniak@tieto.com> References: <1426849379-7562-1-git-send-email-marek.puzyniak@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150320_040112_089141_13B09671 X-CRM114-Status: UNSURE ( 9.18 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: Marek Puzyniak X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: Marek Puzyniak --- drivers/net/wireless/ath/ath10k/mac.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 866c948..3c25507 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4386,14 +4386,14 @@ static void ath10k_sta_rc_update_wk(struct work_struct *wk) 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; lockdep_assert_held(&ar->conf_mutex); - if (arvif->vdev_type != WMI_VDEV_TYPE_AP && - arvif->vdev_type != WMI_VDEV_TYPE_IBSS) + if (arvif->vdev_type == WMI_VDEV_TYPE_STA && !sta->tdls) return 0; if (ar->num_stations >= ar->max_num_stations) @@ -4404,14 +4404,14 @@ static int ath10k_mac_inc_num_stations(struct ath10k_vif *arvif) 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; lockdep_assert_held(&ar->conf_mutex); - if (arvif->vdev_type != WMI_VDEV_TYPE_AP && - arvif->vdev_type != WMI_VDEV_TYPE_IBSS) + if (arvif->vdev_type == WMI_VDEV_TYPE_STA && !sta->tdls) return; ar->num_stations--; @@ -4453,7 +4453,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, ar->num_stations + 1, ar->max_num_stations, 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) { ath10k_warn(ar, "refusing to associate station: too many connected already (%d)\n", ar->max_num_stations); @@ -4465,7 +4465,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, if (ret) { ath10k_warn(ar, "failed to add peer %pM for vdev %d when adding a new sta: %i\n", sta->addr, arvif->vdev_id, ret); - ath10k_mac_dec_num_stations(arvif); + ath10k_mac_dec_num_stations(arvif, sta); goto exit; } @@ -4478,7 +4478,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, arvif->vdev_id, ret); WARN_ON(ath10k_peer_delete(ar, arvif->vdev_id, sta->addr)); - ath10k_mac_dec_num_stations(arvif); + ath10k_mac_dec_num_stations(arvif, sta); goto exit; } @@ -4509,7 +4509,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, ath10k_warn(ar, "failed to delete peer %pM for vdev %d: %i\n", 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 && new_state == IEEE80211_STA_ASSOC && (vif->type == NL80211_IFTYPE_AP ||