From patchwork Mon May 28 11:29:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10431889 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1F075602CB for ; Mon, 28 May 2018 11:29:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11D2C28C88 for ; Mon, 28 May 2018 11:29:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06CD828C93; Mon, 28 May 2018 11:29:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA0F628C88 for ; Mon, 28 May 2018 11:29:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932647AbeE1L3b (ORCPT ); Mon, 28 May 2018 07:29:31 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:41547 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938294AbeE1L31 (ORCPT ); Mon, 28 May 2018 07:29:27 -0400 Received: by mail-wr0-f196.google.com with SMTP id u12-v6so19713270wrn.8 for ; Mon, 28 May 2018 04:29:26 -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=nB76wVnq+Y3AlRH8AQWxhFRuNZs+fIwBlZod3wDEJpQ=; b=Da4xidRUkTl71X8+pxaoEAlH+nQ9KK5G4MG0w9EEma6AhuPmUHNFY4+vKqqT9F3CTk 7yXge7YIAvBgqlNCinyZndCzRgBrQl3gGI2vP/zgJYQ6IbNXjaSDn+oL9isrmsTVxe3m pAE3xq4uNACy9c9wjjoULMV230md0Z8lW0RYw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nB76wVnq+Y3AlRH8AQWxhFRuNZs+fIwBlZod3wDEJpQ=; b=KtVzhhslzDpATYip2SvTatjXuwnzkzT4KLVnAKt111bWk4WZHvt5v0C/2Ew8RJU11C oxUoWuBMJa+h9Sfw9RJNEuM/Be5MWNGp5bOQT5xhe9r4AUXCGqQCXAvGeNd6u2Lakm4C 3CeSDoveBwRdqfHPStNBsdJaNeaD7JMKlZSehVVFj7fZC933eL12bPjL2RqTSyzu7bwf /OtbbGiv826LDwqXGr9bZcuSCvHmpeSo3RneuPZiTqEjK9qFXCTQdgErj8uG4urfo5vA GYqp9QXl1/VDiDQgGCZpBwe58r7cULuYouZcQL50euDIFaN5KYmNAls83aJsIsXyZS96 H+wg== X-Gm-Message-State: ALKqPwezT8fM9wK08ZWZ3F/THnj6wEr+a2t4ztXVFD5JcCt7XmtUN8qo xDtu0AkVJAguWzUGUtyU9GMJJfWvuHs= X-Google-Smtp-Source: AB8JxZoX5fsGqN97Bb9b7LWt4/VWXnbH0YNkizhHGhxystybb8gHYWBtmLseEC3fVhwMim6I/vfjog== X-Received: by 2002:adf:c4b6:: with SMTP id m51-v6mr9963766wrf.103.1527506966197; Mon, 28 May 2018 04:29:26 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home (LFbn-1-10589-161.w90-89.abo.wanadoo.fr. [90.89.181.161]) by smtp.gmail.com with ESMTPSA id c18-v6sm16020324wrq.17.2018.05.28.04.29.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 May 2018 04:29:25 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, linux-arm-msm@vger.kernel.org, Loic Poulain Subject: [PATCH 2/3] wcn36xx: Track associated stations Date: Mon, 28 May 2018 13:29:19 +0200 Message-Id: <1527506960-13358-2-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527506960-13358-1-git-send-email-loic.poulain@linaro.org> References: <1527506960-13358-1-git-send-email-loic.poulain@linaro.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add list of associated stations(STA, AP, peer...) per vif. Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/main.c | 5 +++++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 4648a78..6fd0bf6 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -567,6 +567,7 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, key_conf->keyidx, key_conf->keylen, key); + if ((WLAN_CIPHER_SUITE_WEP40 == key_conf->cipher) || (WLAN_CIPHER_SUITE_WEP104 == key_conf->cipher)) { sta_priv->is_data_encrypted = true; @@ -984,6 +985,7 @@ static int wcn36xx_add_interface(struct ieee80211_hw *hw, mutex_lock(&wcn->conf_mutex); vif_priv->bss_index = WCN36XX_HAL_BSS_INVALID_IDX; + INIT_LIST_HEAD(&vif_priv->sta_list); list_add(&vif_priv->list, &wcn->vif_list); wcn36xx_smd_add_sta_self(wcn, vif); @@ -1005,6 +1007,8 @@ static int wcn36xx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, spin_lock_init(&sta_priv->ampdu_lock); sta_priv->vif = vif_priv; + list_add(&sta_priv->list, &vif_priv->sta_list); + /* * For STA mode HW will be configured on BSS_CHANGED_ASSOC because * at this stage AID is not available yet. @@ -1032,6 +1036,7 @@ static int wcn36xx_sta_remove(struct ieee80211_hw *hw, mutex_lock(&wcn->conf_mutex); + list_del(&sta_priv->list); wcn36xx_smd_delete_sta(wcn, sta_priv->sta_index); sta_priv->vif = NULL; diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 11e7401..a58f313 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -129,6 +129,8 @@ struct wcn36xx_vif { u8 self_sta_index; u8 self_dpu_desc_index; u8 self_ucast_dpu_sign; + + struct list_head sta_list; }; /** @@ -154,6 +156,7 @@ struct wcn36xx_vif { * |______________|_____________|_______________| */ struct wcn36xx_sta { + struct list_head list; struct wcn36xx_vif *vif; u16 aid; u16 tid;