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: 6055521 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@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 D6986BF90F for ; Fri, 20 Mar 2015 11:00:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE873204D1 for ; Fri, 20 Mar 2015 11:00:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0523B20303 for ; Fri, 20 Mar 2015 11:00:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751043AbbCTLAv (ORCPT ); Fri, 20 Mar 2015 07:00:51 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:33640 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750990AbbCTLAu (ORCPT ); Fri, 20 Mar 2015 07:00:50 -0400 Received: by lbbrr9 with SMTP id rr9so8039352lbb.0 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=WFRCWifdzJDUt0y2DaVdwgVlqrm+VJiYUWFmaSbDgzjsKru7RyFkrmrx/aU8WsYco8 WHbFdRJi7EHAiVYpYqOg/I6hkkQ97Y+JKEkleeR9EfQpA/08VYCO9YOQZLGfxuBx0aNf QBePOqImw0FhMBrmFtlNYQcU+jAIc4LDXyZhVDhyGgaSa4/niB3949BO/Z1L2wvfQJvr e0kBod6l+1WerN28EcVCv8ScIT7vcJq4FMr237na0+nchyaKjja3JkfpHKbp+c9Tukiz wMRlg2MOhbH6kO1+0J6O3/4a/3XwCebTVEYso8BbNX6skwveV0BRcPjFTTkydssiJmUF /0+w== X-Gm-Message-State: ALoCoQlhI8KCSKpBaiGcw7ZoN30DrWgfMcktwCYpEdDLzQPVYDC7GOZmEdOQpne+hPAArdmKO5mArOFapIITb/9qh5oacoGzXTSVW8N4VSVqxe4r2tWvjL/HzMfV1MUFEECv3qoA4j8Syu+7X7z1I/adttYKie14uxDOtAMj8B5iT67RpxIPDXw+QnrvvZ1+dWUQy3oEpSvq 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 Cc: Marek Puzyniak 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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham 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 ||