From patchwork Tue Mar 29 06:06:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 8682581 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BB2C49F44D for ; Tue, 29 Mar 2016 06:09:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA71B2014A for ; Tue, 29 Mar 2016 06:09:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CEED6201F5 for ; Tue, 29 Mar 2016 06:09:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755984AbcC2GGv (ORCPT ); Tue, 29 Mar 2016 02:06:51 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:36079 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755926AbcC2GGr (ORCPT ); Tue, 29 Mar 2016 02:06:47 -0400 Received: by mail-pf0-f173.google.com with SMTP id u190so6575228pfb.3 for ; Mon, 28 Mar 2016 23:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tPzcCMqDu3jvM/cL+ZO9rh9Ry0Ybak+ruhq2ks+hoOs=; b=LbnYkIxdo37phXsbnnqW+bZ5SKgcFaUWbRpz/klFTHYfdJqmi443hSW5WR2cgyWW79 rs5Xn7EWC73N/ICcsioNY3ZlsCdUOCJvNKxzxxZ9nS1pcj1SbFijhvlWKYm3gg+Uhnsw kZ59T80PCSoN2EGD/Wi0IdrAGv+b+kIfJwK84= 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=tPzcCMqDu3jvM/cL+ZO9rh9Ry0Ybak+ruhq2ks+hoOs=; b=TA3f2vL7Qb8KxmCLTCozutDyvefvmSPPYkotL72l0TP5JIzRPEF8ctf4q1Uyr4JnoK jMOy+nzu02P6GcIQ/DVVUbWS5XXJfXfxmyuJtr7DX/NHFk2Vcv9IDOoA35693R4MqVRH dFXNlONGAewq4j48EjYp0rIUWSgvtxlQX0hHW7X5OFb4+k/aLQ8FI6VY77idp3ruX4T7 7yDM5rRHK82dqr6KXesW2ORRgCD/8mS4C2YGhsOueo3DrW0QfLR2gn7MA0MpuFWMq4jb qN6jrZkuTtH2BYrJpQzlmbz2dEJ/UD2hbq2uovUUByVMJLR1PEaSaLuZD3+l2V1+SahD 5C6w== X-Gm-Message-State: AD7BkJJZfTShpoujz2zaNbrNtWkxkmsWQywFEA9z6XWnYBPYBF/iZxP+Dzq5wYG9CdUnFaQK X-Received: by 10.98.9.219 with SMTP id 88mr777933pfj.0.1459231606161; Mon, 28 Mar 2016 23:06:46 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id k88sm39878073pfj.0.2016.03.28.23.06.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Mar 2016 23:06:45 -0700 (PDT) From: Bjorn Andersson To: Eugene Krasnikov , Kalle Valo Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Pontus Fuchs Subject: [PATCH 08/16] wcn36xx: Remove sta pointer in private vif struct Date: Mon, 28 Mar 2016 23:06:25 -0700 Message-Id: <1459231593-360-9-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459231593-360-1-git-send-email-bjorn.andersson@linaro.org> References: <1459231593-360-1-git-send-email-bjorn.andersson@linaro.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 From: Pontus Fuchs This does not work with multiple sta's in a vif. Signed-off-by: Pontus Fuchs Signed-off-by: Bjorn Andersson --- drivers/net/wireless/ath/wcn36xx/main.c | 3 --- drivers/net/wireless/ath/wcn36xx/smd.c | 28 +++++++++++++++------------- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 - 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index a23738deb5b3..7c06ca9fdd2c 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -796,7 +796,6 @@ static int wcn36xx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, vif, sta->addr); spin_lock_init(&sta_priv->ampdu_lock); - vif_priv->sta = sta_priv; sta_priv->vif = vif_priv; /* * For STA mode HW will be configured on BSS_CHANGED_ASSOC because @@ -815,14 +814,12 @@ static int wcn36xx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_sta *sta) { struct wcn36xx *wcn = hw->priv; - struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta); wcn36xx_dbg(WCN36XX_DBG_MAC, "mac sta remove vif %p sta %pM index %d\n", vif, sta->addr, sta_priv->sta_index); wcn36xx_smd_delete_sta(wcn, sta_priv->sta_index); - vif_priv->sta = NULL; sta_priv->vif = NULL; return 0; } diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index b75e7211049d..887781dff110 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1170,6 +1170,7 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, void *buf, size_t len) { @@ -1200,9 +1201,10 @@ static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn, vif_priv->bss_index = params->bss_index; - if (vif_priv->sta) { - vif_priv->sta->bss_sta_index = params->bss_sta_index; - vif_priv->sta->bss_dpu_desc_index = params->dpu_desc_index; + if (sta) { + struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta); + sta_priv->bss_sta_index = params->bss_sta_index; + sta_priv->bss_dpu_desc_index = params->dpu_desc_index; } vif_priv->self_ucast_dpu_sign = params->ucast_dpu_signature; @@ -1329,6 +1331,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, } ret = wcn36xx_smd_config_bss_rsp(wcn, vif, + sta, wcn->hal_buf, wcn->hal_rsp_len); if (ret) { @@ -2053,25 +2056,24 @@ static int wcn36xx_smd_delete_sta_context_ind(struct wcn36xx *wcn, { struct wcn36xx_hal_delete_sta_context_ind_msg *rsp = buf; struct wcn36xx_vif *tmp; - struct ieee80211_sta *sta = NULL; + struct ieee80211_sta *sta; if (len != sizeof(*rsp)) { wcn36xx_warn("Corrupted delete sta indication\n"); return -EIO; } + wcn36xx_dbg(WCN36XX_DBG_HAL, "delete station indication %pM index %d\n", + rsp->addr2, rsp->sta_id); + list_for_each_entry(tmp, &wcn->vif_list, list) { - if (sta && (tmp->sta->sta_index == rsp->sta_id)) { - sta = container_of((void *)tmp->sta, - struct ieee80211_sta, - drv_priv); - wcn36xx_dbg(WCN36XX_DBG_HAL, - "delete station indication %pM index %d\n", - rsp->addr2, - rsp->sta_id); + rcu_read_lock(); + sta = ieee80211_find_sta(wcn36xx_priv_to_vif(tmp), rsp->addr2); + if (sta) ieee80211_report_low_ack(sta, 0); + rcu_read_unlock(); + if (sta) return 0; - } } wcn36xx_warn("STA with addr %pM and index %d not found\n", diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index c368a34c8de7..54000db0af1a 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -125,7 +125,6 @@ struct wcn36xx_platform_ctrl_ops { */ struct wcn36xx_vif { struct list_head list; - struct wcn36xx_sta *sta; u8 dtim_period; enum ani_ed_type encrypt_type; bool is_joining;