From patchwork Mon May 28 11:29:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 137069 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2703076lji; Mon, 28 May 2018 04:29:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqarxRB7ySuOiVwdIadQVlFGjWLxIkqmenfk6ppW8aamWURiyXU+A6ECghw+tR60cvGwBg5 X-Received: by 2002:a17:902:8a:: with SMTP id a10-v6mr13163035pla.89.1527506970941; Mon, 28 May 2018 04:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527506970; cv=none; d=google.com; s=arc-20160816; b=NdTZame7/CPesidUW+p52nx2B1biKFpebxfgyRZFpwT19T9eYZVMgKGMm5ic9Vt+Ua V0ZSdgWOvP5yP0IR+uoYnyia52++DWatKwhAOMAxAKwHgUZX+RSHGbUHCmdhx87f1GE3 R+99BN8LP5yvbzQr0tTH1tz9sYbyL9oypKdW7w7QQrewePa4vAtm6Nl5/9osTWurKk10 fzeQyHpZf+v0iblV7vtmax6gBMJG48oD8Cw8sHtrmPoOJzpW2nsABsbTD2B2vc0yuktV qESBdhFX9XDttCDiOVquOKymDM7ZVw19wwIjrHF9rjvARG7oTGrnPjv2J0Vg7NRmWnNw hkFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=oHlkhOw59wUJL3gUrZ64R5Rl877VpQEXBkHo9xzqils=; b=Yu6ZxWa6ctCsr7jgf6nKB+PVdfzG3wyJ5l5aX5uWQN5Xb0mPWrI8sG0+EiII2Sp4j2 PpNrEhVyVaDj3wzXe6HPMmBWIP0L9MDE/A+KkfFZS9Cx9wRA3etBB7zd+95L4xmUSr0x d2/8Nw5O5Z4SQDD+Vxp5+OE2bLh72fYEGAXjAng0kNY1ExR+u4nVEqn2meA3OgeNiUhG VXvmGey9wxOZwueN3smF4T7vnxrK1+b0PigDPnqwbN8+UpWnU8WLninSUFBYijDFWja0 YZnvd+hN2m8wB/+Dj1xpdmiouuYgTtP/HkQqH9EhkdLv4LXd8oqay2i/4NTR9WFofN40 nXbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FwMipl8w; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3-v6si13505166plb.529.2018.05.28.04.29.30; Mon, 28 May 2018 04:29:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FwMipl8w; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938298AbeE1L32 (ORCPT + 3 others); Mon, 28 May 2018 07:29:28 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:53327 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938132AbeE1L3Y (ORCPT ); Mon, 28 May 2018 07:29:24 -0400 Received: by mail-wm0-f66.google.com with SMTP id a67-v6so31163749wmf.3 for ; Mon, 28 May 2018 04:29:24 -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; bh=oHlkhOw59wUJL3gUrZ64R5Rl877VpQEXBkHo9xzqils=; b=FwMipl8w3a/Gql5wIYu/qISBb3m+iH8YX+XyUwLc0CmpyALAAfCQuBgGtVIUKrBSMj vxLYo2RhGSfzaYgRqhysHXO4TTLzwxvYSzg32uOt6tUDru6rnYyOUmCVWdcHAUmhIeZ/ UNCwOVmBNRLkG3Uq0glRQFTl5zT0oyVufH2iA= 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; bh=oHlkhOw59wUJL3gUrZ64R5Rl877VpQEXBkHo9xzqils=; b=N0hGxVZuEAZlQgoWYssefWT+1nzRYpviHQGuadEhNAd4VMC5kC/gls1jxZsvKZmkhb ywpkMP/GP4mQNEOHfr+2PpPz0fNQfD4tWT+Ctxlmnu4ekkeKsxmLAc4EaJiDpZn6VI59 wPWANwln15IvRlv2kN6bqIUnirYzeteRRGmt7+jNT1LF+AoVXz/NH6cZzJnhngHpJGOt a0QmJB5xNH04PGG1RVXv/roBf4dXH5Tg1Bz4JApGtiFMLGjMvKTGrGla8bmfdix5bW6g 45DMzfTVpul/+8PXFqEmTJ1C9v+pw3I+uyXMPwIXfl3MEztk6N0OynEbcJFrJkzf5pdH rsKQ== X-Gm-Message-State: ALKqPwfmJhFQjALK2h9ctAU7fFNikF6Mg7QASc8aE/yVtcwyjCsQxmYD MqB1mwBk4RSjSMP3W1x6MCSqHg== X-Received: by 2002:a1c:aac3:: with SMTP id t186-v6mr1205411wme.14.1527506963656; Mon, 28 May 2018 04:29:23 -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.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 May 2018 04:29:22 -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 1/3] wcn36xx: Fix WEP104 encryption type Date: Mon, 28 May 2018 13:29:18 +0200 Message-Id: <1527506960-13358-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index aeb5e6e..4648a78 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -512,7 +512,7 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, vif_priv->encrypt_type = WCN36XX_HAL_ED_WEP40; break; case WLAN_CIPHER_SUITE_WEP104: - vif_priv->encrypt_type = WCN36XX_HAL_ED_WEP40; + vif_priv->encrypt_type = WCN36XX_HAL_ED_WEP104; break; case WLAN_CIPHER_SUITE_CCMP: vif_priv->encrypt_type = WCN36XX_HAL_ED_CCMP; 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: 137070 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2703109lji; Mon, 28 May 2018 04:29:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo5hkGhtqAIJ8Tf1+76fwZ9xWR08BHhKqGyxmX9jns+V5rObkZK6fv729WNbcgXM5HpgSDK X-Received: by 2002:a63:7f15:: with SMTP id a21-v6mr10263316pgd.21.1527506973131; Mon, 28 May 2018 04:29:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527506973; cv=none; d=google.com; s=arc-20160816; b=z7DgQC5gNnmAujR7nGPFoERW6A/hLl4mCX2p0NCYk5WjIsa+RwjF+5LII0Cv/MaffC /+/ZODe21iLjcQMbuh50Qw8rBvIQbL7aVK8cj1Wphko4ypiQOtFIl8aWn1St40QoYq9d XU7H9oG/2OCly1lyIvXy/eK6bBLjXqIwpYjCxxnrNKEynKSbx5ZomASCSg5tGiq1yXuz 5OBhrNvILLmC0GG0VmkbXdGO57uCUio7BBvy5DaJSU6Pyq0PpkShhVvMNOFJwj5Qe63z M6NXPWvVfrLTtAlk6/03p5PThdasF87V/Xx+hjEfgpt14k0K6Rz2BfU4HTodDg+oN0rT AzEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=nB76wVnq+Y3AlRH8AQWxhFRuNZs+fIwBlZod3wDEJpQ=; b=zvSGAs54QRTvw25TvFdiSAWTsxH02Y70XTLDyOS0ZrY6VuN/c4cuBbjacWiwhbLQye bKBdmaM87/qBaNa6F3+Y91ytwzqpgJPgKc6s6o9WExwOVr/Hbqh8s0CRgkVnSi74oz6A nwm+NLwfYSJyxUv1edjmCkG+tE3baUrtdafaGYDPT4TRpHZhICPwJTb2BRE7f3bdveuA XdJzocW1hKngZcaw+dHM2yDXQN9BQqvn9pW0ERktR5hUi+UtDxcjGRZM5ejb24ZmDQav mn0+UmrfV6YT1IPO1jtBiHEMN5KUUanjduYOgqtLGDPX9oKAf11t9wEipQ+TztWRAHzq CxlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Da4xidRU; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3-v6si13505166plb.529.2018.05.28.04.29.32; Mon, 28 May 2018 04:29:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Da4xidRU; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932647AbeE1L3b (ORCPT + 3 others); 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-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 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(+) -- 2.7.4 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; From patchwork Mon May 28 11:29:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 137071 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2703121lji; Mon, 28 May 2018 04:29:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoTqZLsUspxb4UlEgOr+oX/88VQlo6uEPvkRvuKyA3rfM9Hxc1irp7zF2cIYUjZ8684Jpru X-Received: by 2002:a17:902:43a4:: with SMTP id j33-v6mr13541882pld.118.1527506974031; Mon, 28 May 2018 04:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527506974; cv=none; d=google.com; s=arc-20160816; b=vA5zYCmN5pZ9s9+XDN/8ypu+d23H6RZgIJox3rp/BH4+12HO1oKJjMcyeRrILvudwC i+DRhgylsZpZWMH94ADpNxaVXRSpD6axqUekqNChOuLyfvB60krwYL9QnB6Ymm1uRUyh 9dQYdHnS/amDAT5v+qyb5dPGTlQZnnZg+apvKZhGvBPp/DadHqEGoNnoi7/yBp+0mmc8 PrQEO7pGbtO9JAsXHQtn1o2QY1+LJxhehBPsaZR3rraPZQvzY8mWg5PzPbJzPVX27TWp jPecQ7jePxddTwDsj/KnUIfJoA2zsWF5Mgy8tYt1VikpVepO2Wxnivmm+MJxPB/qzjRC y1JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=5iodCd8fhjhIO+8Pv39Ot4A0OLaOvGZajjBz7TleDR8=; b=BO4k/1xxLqZGLyP2AL34Mv4ODBrMSCca/setWQUE6IStDaYl52jeQ8eNL3YPoYRiPP BVz+TSmhLCkfi7sTl09DRg9mF6B2yJfXbfac5PpmuJUO2w43HVTHV+aF1WXdptfE+u06 ZGTBcPt9IrdLxLVQVvBG1o/W6g2Jjv4I/3xddGrevSGhGYU/8qEopFRnWynYgbQAmncG 6ZUeMop1n7WZqNEeA9yZtvi+psqDWXIUsJkcwa+bOH8YulbZDu+htQNeBKGZ0qCq1d3v 2bUXkMfmgtFxOc5lAQ1h5J9Qnym/HHLAKOsmnKhpViBT7biP6A6/y9T4Axe6woOpu2ZH Ackg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZofAPc7l; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3-v6si13505166plb.529.2018.05.28.04.29.33; Mon, 28 May 2018 04:29:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZofAPc7l; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938303AbeE1L3c (ORCPT + 3 others); Mon, 28 May 2018 07:29:32 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:36268 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938299AbeE1L3a (ORCPT ); Mon, 28 May 2018 07:29:30 -0400 Received: by mail-wr0-f195.google.com with SMTP id f16-v6so4409603wrm.3 for ; Mon, 28 May 2018 04:29:29 -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=5iodCd8fhjhIO+8Pv39Ot4A0OLaOvGZajjBz7TleDR8=; b=ZofAPc7lqYkxVIc/Sv/K8jfUdA6Ll3Mepz0Y05aagi4JcwvUVsGlgZg+zViPOmVtnn GmeSUL2+r/uz0Y/iAinIAIDwiVZo2OTtVplQUmMW4fBj1DGB4FMGE75KO/k/cbn8FAJs qzKf3nIr5cUmjM698Q4DDPMpA2xirZ7W/7/TU= 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=5iodCd8fhjhIO+8Pv39Ot4A0OLaOvGZajjBz7TleDR8=; b=lrxD6K+GLlh4xMqab2jOI2mVjb69489iBPFYFiThEHwzy7Zw1kPco8m1IcfwquV3vC Zj4zNbgNQHoEtvmsjHmRd92CJqxNqws7BgVPr5dn//RkLktCQPY/CLK3blsfFh67fVJY T3KuSPwKim4qV1swkgLOclBlDG9dTYsmLxiMA9+OoPpTge/c1zETD3y3wQ7W0XoCmo0F G3Yd0C6ZZGZ28092yYC/R3QX/M8P9iKOT8c+eC4UTFm/PF1I5IN1NnLzo59QQZwwWAe+ 5o8cwRBcFcMERbl549wma2Lje01F/8R+m++QQzrHMwxctAmclaDbkwl6nfrDTyf7cqwn xv5Q== X-Gm-Message-State: ALKqPwdnYsiytWQ58lQiyXxBMevbyyHyb2UT78rxAm+ag0291VMrK48m dT5aKkr5/8lnwL/17cAe6n9rDA== X-Received: by 2002:adf:de08:: with SMTP id b8-v6mr3253424wrm.39.1527506968794; Mon, 28 May 2018 04:29:28 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 May 2018 04:29:28 -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 3/3] wcn36xx: Fix WEP encryption Date: Mon, 28 May 2018 13:29:20 +0200 Message-Id: <1527506960-13358-3-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 In case of WEP encryption, driver has to configure shared key for associated station(s). Note that sta pointer is NULL in case of non pairwise key, causing NULL pointer dereference with existing code (sta_priv->is_data_encrypted). Fix this by using associated sta list instead. Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/main.c | 19 +++++++++++-------- drivers/net/wireless/ath/wcn36xx/smd.c | 20 ++++++++++++++------ 2 files changed, 25 insertions(+), 14 deletions(-) -- 2.7.4 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 6fd0bf6..e38443e 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -493,7 +493,7 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, { 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); + struct wcn36xx_sta *sta_priv = sta ? wcn36xx_sta_to_priv(sta) : NULL; int ret = 0; u8 key[WLAN_MAX_KEY_LEN]; @@ -570,13 +570,16 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, if ((WLAN_CIPHER_SUITE_WEP40 == key_conf->cipher) || (WLAN_CIPHER_SUITE_WEP104 == key_conf->cipher)) { - sta_priv->is_data_encrypted = true; - wcn36xx_smd_set_stakey(wcn, - vif_priv->encrypt_type, - key_conf->keyidx, - key_conf->keylen, - key, - get_sta_index(vif, sta_priv)); + list_for_each_entry(sta_priv, + &vif_priv->sta_list, list) { + sta_priv->is_data_encrypted = true; + wcn36xx_smd_set_stakey(wcn, + vif_priv->encrypt_type, + key_conf->keyidx, + key_conf->keylen, + key, + get_sta_index(vif, sta_priv)); + } } } break; diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index b4dadf7..304a86c 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1708,12 +1708,20 @@ int wcn36xx_smd_set_stakey(struct wcn36xx *wcn, msg_body.set_sta_key_params.sta_index = sta_index; msg_body.set_sta_key_params.enc_type = enc_type; - msg_body.set_sta_key_params.key[0].id = keyidx; - msg_body.set_sta_key_params.key[0].unicast = 1; - msg_body.set_sta_key_params.key[0].direction = WCN36XX_HAL_TX_RX; - msg_body.set_sta_key_params.key[0].pae_role = 0; - msg_body.set_sta_key_params.key[0].length = keylen; - memcpy(msg_body.set_sta_key_params.key[0].key, key, keylen); + if (enc_type == WCN36XX_HAL_ED_WEP104 || + enc_type == WCN36XX_HAL_ED_WEP40) { + /* Use bss key for wep (static) */ + msg_body.set_sta_key_params.def_wep_idx = keyidx; + msg_body.set_sta_key_params.wep_type = 0; + } else { + msg_body.set_sta_key_params.key[0].id = keyidx; + msg_body.set_sta_key_params.key[0].unicast = 1; + msg_body.set_sta_key_params.key[0].direction = WCN36XX_HAL_TX_RX; + msg_body.set_sta_key_params.key[0].pae_role = 0; + msg_body.set_sta_key_params.key[0].length = keylen; + memcpy(msg_body.set_sta_key_params.key[0].key, key, keylen); + } + msg_body.set_sta_key_params.single_tid_rc = 1; PREPARE_HAL_BUF(wcn->hal_buf, msg_body);