From patchwork Fri Jul 24 10:20:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 11682833 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6BD73618 for ; Fri, 24 Jul 2020 10:15:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F24B206F0 for ; Fri, 24 Jul 2020 10:15:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FMoHIRGi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726997AbgGXKPb (ORCPT ); Fri, 24 Jul 2020 06:15:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726810AbgGXKPb (ORCPT ); Fri, 24 Jul 2020 06:15:31 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0442BC0619D3 for ; Fri, 24 Jul 2020 03:15:31 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id a6so8274782wmm.0 for ; Fri, 24 Jul 2020 03:15:30 -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=AC9PhQt3qPoQSVZrvVZhCbJsw+v4/9rtWxCmdq4xQP4=; b=FMoHIRGi20EPBYQiqwOq+4yYuRwsoZy00vuFU/NV4bwSVYTWKjDbVv8+wo68eZqMnt 4ydzEno7hr2RZKRgsI7bbUojI0Ohs1EMzkycOX+zxDMC5eG5cWSy5AHON8eXNFLbNIN/ mebq+PcEEI9TzJNOCwvOq8QIFw3jQbkZZuOlUKBpQ9EBWAmXsw+eB7Oj+xyDaNIBlgZK 80idUukrtsWUO4L5az7mdIOr/GDqf7eaeJe66czkccW46IhNV3EPQIA02G80UJmvBoZI 1Gc2dk6PxxTIDWZjgzCldu6QStSYqbW4Ts8XtICZMvgwPuzoKMNB6nDU7ndjmLj2w+xm gFTg== 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=AC9PhQt3qPoQSVZrvVZhCbJsw+v4/9rtWxCmdq4xQP4=; b=tEDlilHaABdz3H6Fqc+NIk6Q2l6lvJxRxf09a1iriZtgbnPY3SF2d1EyN64UeBVCBt DBP9hNraNPkzxT5Ds948SX72oTq+C8FC1br5b65k1aUKqu+s04AvIOtZeMryQxZnNorC rQlXSTBt+RYn2gQdUjLg1hirr8zRWE5fQkrRlLbybxb9QXiQyjo/k7ZFhj4fFQRK8m8q PXVg8h3VukYW1FAOP6Q5AoEr80EqS8tCbFFP3fJUu2wHtJ1U5FrBQ2fSLdOTBTBk/Cl5 6RPA+b8iyP2xAvwPJgqerVqejTWZbnJSM3Tu7y/NFrP5rQBxlZr1Qy2uaNj70Ax+PSVe nDlw== X-Gm-Message-State: AOAM533IedcS8PtH2DJMCv5T34v/6v5TGfovxxc7lCI6y4R3+TypcK1Q 5IEFDmoeso5Djz+v0Ly9oCWeCSX8a+U= X-Google-Smtp-Source: ABdhPJwTCUHBI2Wl0j+35e3XAsLcfjR8WxFiiuN/XpeFbr1NkEfVKRBNQdf5GWA/6ZUpH5yZbh2wyA== X-Received: by 2002:a1c:9d53:: with SMTP id g80mr2089486wme.70.1595585729629; Fri, 24 Jul 2020 03:15:29 -0700 (PDT) Received: from localhost.localdomain ([88.122.66.28]) by smtp.gmail.com with ESMTPSA id d18sm774714wrj.8.2020.07.24.03.15.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jul 2020 03:15:29 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, Loic Poulain Subject: [PATCH v2 1/6] wcn36xx: Fix multiple AMPDU sessions support Date: Fri, 24 Jul 2020 12:20:47 +0200 Message-Id: <1595586052-16081-2-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595586052-16081-1-git-send-email-loic.poulain@linaro.org> References: <1595586052-16081-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 Several AMPDU sessions can be started, e.g. for different TIDs. Currently the driver does not take care of the session ID when requesting block-ack (statically set to 0), which leads to never block-acked packet with sessions other than 0. Fix this by saving the session id when creating the ba session and use it in subsequent ba operations. This issue can be reproduced with iperf in two steps (tid 0 strem then tid 6 stream). 1.0 iperf -s # wcn36xx side 1.1 iperf -c ${IP_ADDR} # host side Then 2.0 iperf -s -u -S 0xC0 # wcn36xx side 2.1 iperf -c ${IP_ADDR} -u -S 0xC0 -l 2000 # host side Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/main.c | 10 ++++++---- drivers/net/wireless/ath/wcn36xx/smd.c | 32 ++++++++++++++++++++++++++------ drivers/net/wireless/ath/wcn36xx/smd.h | 4 ++-- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 702b689..af32bd6 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1083,6 +1083,7 @@ static int wcn36xx_ampdu_action(struct ieee80211_hw *hw, u16 tid = params->tid; u16 *ssn = ¶ms->ssn; int ret = 0; + u8 session; wcn36xx_dbg(WCN36XX_DBG_MAC, "mac ampdu action action %d tid %d\n", action, tid); @@ -1092,10 +1093,11 @@ static int wcn36xx_ampdu_action(struct ieee80211_hw *hw, switch (action) { case IEEE80211_AMPDU_RX_START: sta_priv->tid = tid; - wcn36xx_smd_add_ba_session(wcn, sta, tid, ssn, 0, - get_sta_index(vif, sta_priv)); - wcn36xx_smd_add_ba(wcn); - wcn36xx_smd_trigger_ba(wcn, get_sta_index(vif, sta_priv)); + session = wcn36xx_smd_add_ba_session(wcn, sta, tid, ssn, 0, + get_sta_index(vif, sta_priv)); + wcn36xx_smd_add_ba(wcn, session); + wcn36xx_smd_trigger_ba(wcn, get_sta_index(vif, sta_priv), tid, + session); break; case IEEE80211_AMPDU_RX_STOP: wcn36xx_smd_del_ba(wcn, tid, get_sta_index(vif, sta_priv)); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 77269ac..59f9f53 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2102,6 +2102,22 @@ int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn) return ret; } +static int wcn36xx_smd_add_ba_session_rsp(void *buf, int len, u8 *session) +{ + struct wcn36xx_hal_add_ba_session_rsp_msg *rsp; + + if (len < sizeof(*rsp)) + return -EINVAL; + + rsp = (struct wcn36xx_hal_add_ba_session_rsp_msg *)buf; + if (rsp->status != WCN36XX_FW_MSG_RESULT_SUCCESS) + return rsp->status; + + *session = rsp->ba_session_id; + + return 0; +} + int wcn36xx_smd_add_ba_session(struct wcn36xx *wcn, struct ieee80211_sta *sta, u16 tid, @@ -2110,6 +2126,7 @@ int wcn36xx_smd_add_ba_session(struct wcn36xx *wcn, u8 sta_index) { struct wcn36xx_hal_add_ba_session_req_msg msg_body; + u8 session_id; int ret; mutex_lock(&wcn->hal_mutex); @@ -2135,17 +2152,20 @@ int wcn36xx_smd_add_ba_session(struct wcn36xx *wcn, wcn36xx_err("Sending hal_add_ba_session failed\n"); goto out; } - ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); + ret = wcn36xx_smd_add_ba_session_rsp(wcn->hal_buf, wcn->hal_rsp_len, + &session_id); if (ret) { wcn36xx_err("hal_add_ba_session response failed err=%d\n", ret); goto out; } + + ret = session_id; out: mutex_unlock(&wcn->hal_mutex); return ret; } -int wcn36xx_smd_add_ba(struct wcn36xx *wcn) +int wcn36xx_smd_add_ba(struct wcn36xx *wcn, u8 session_id) { struct wcn36xx_hal_add_ba_req_msg msg_body; int ret; @@ -2153,7 +2173,7 @@ int wcn36xx_smd_add_ba(struct wcn36xx *wcn) mutex_lock(&wcn->hal_mutex); INIT_HAL_MSG(msg_body, WCN36XX_HAL_ADD_BA_REQ); - msg_body.session_id = 0; + msg_body.session_id = session_id; msg_body.win_size = WCN36XX_AGGR_BUFFER_SIZE; PREPARE_HAL_BUF(wcn->hal_buf, msg_body); @@ -2212,7 +2232,7 @@ static int wcn36xx_smd_trigger_ba_rsp(void *buf, int len) return rsp->status; } -int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index) +int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index, u16 tid, u8 session_id) { struct wcn36xx_hal_trigger_ba_req_msg msg_body; struct wcn36xx_hal_trigger_ba_req_candidate *candidate; @@ -2221,7 +2241,7 @@ int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index) mutex_lock(&wcn->hal_mutex); INIT_HAL_MSG(msg_body, WCN36XX_HAL_TRIGGER_BA_REQ); - msg_body.session_id = 0; + msg_body.session_id = session_id; msg_body.candidate_cnt = 1; msg_body.header.len += sizeof(*candidate); PREPARE_HAL_BUF(wcn->hal_buf, msg_body); @@ -2229,7 +2249,7 @@ int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index) candidate = (struct wcn36xx_hal_trigger_ba_req_candidate *) (wcn->hal_buf + sizeof(msg_body)); candidate->sta_index = sta_index; - candidate->tid_bitmap = 1; + candidate->tid_bitmap = 1 << tid; ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); if (ret) { diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index ff15df8..68c59df 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -132,9 +132,9 @@ int wcn36xx_smd_add_ba_session(struct wcn36xx *wcn, u16 *ssn, u8 direction, u8 sta_index); -int wcn36xx_smd_add_ba(struct wcn36xx *wcn); +int wcn36xx_smd_add_ba(struct wcn36xx *wcn, u8 session_id); int wcn36xx_smd_del_ba(struct wcn36xx *wcn, u16 tid, u8 sta_index); -int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index); +int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index, u16 tid, u8 session_id); int wcn36xx_smd_update_cfg(struct wcn36xx *wcn, u32 cfg_id, u32 value); From patchwork Fri Jul 24 10:20:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 11682835 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E592B618 for ; Fri, 24 Jul 2020 10:15:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C6FCF2065C for ; Fri, 24 Jul 2020 10:15:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Bc/gd/nq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727811AbgGXKPe (ORCPT ); Fri, 24 Jul 2020 06:15:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726810AbgGXKPd (ORCPT ); Fri, 24 Jul 2020 06:15:33 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81D22C0619D3 for ; Fri, 24 Jul 2020 03:15:32 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id f7so7815442wrw.1 for ; Fri, 24 Jul 2020 03:15:32 -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=odT6kLPnDXapaMumnxiChGk1KiPid9TEGBDoPxHNhxg=; b=Bc/gd/nq0VwLndk+QoEqDqgBXC7Pk14K+xy9g+dTDDNYvjgzYd21ZMN3Cs8/IH7URm /E6wavmaBVnCw4IcUUyjltvGnG2GFuqrmsixzhdK9wp9LOv9xj1Q2bh8vIfFsfQ3ohc5 5KccI+UNzHswiLpx2vajlqRR7WlbT1QdZXQ6yEjSgxjo4gkxEFDtdm9NyD6ck+LDxdSx EOmxMWXsPLVZ7zGs3TiZOcT6zakd17xmWtlHmFnxw+RLoEXUvneN381R8Z73fDba3W2G LURclqc0jC+tXDDQUr7WqONisGoLuVpRXq5oMB+eS/7V3zBBGBB4QghV4/ULaACjocxJ aeFg== 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=odT6kLPnDXapaMumnxiChGk1KiPid9TEGBDoPxHNhxg=; b=EoutXtnW/4f7n/8l6GcYQ1ikBCECUjqzNWnziCdVNND/cQ2peNG/mcZgAvbALvr3Ds NN9f664qPCD0hfq/6dBmLtEW5+zCwoIG/bpCWgcdfe5h59JrOAMhocb1uE58yvqVYaA3 OPWnhEP2oqm3YPRNDQ83SoQInKKOpUzUhGTIaQe16Tcjn1+HJxJR6EjEklihh9Lvzcru 0aabl6YsEk9L1Rj83LSbxi6lg1MZyYdGis/GXXnz3ztJclLlwSb5FwCsCI6Xr0BNiAy2 Zo9nILwkvL/rmGtJrrFxesOWJLiyT45lppZ6vQcL8AZY4raa4z2KaKIkcR00t4BjRB1l xGfg== X-Gm-Message-State: AOAM533gW6fbTsVNmcLe9HA8m8kmbbmrJnM1Gx3vXCO0269/qyyNk1xq ACoBtvDz2FEhYiP1wVLbsMidMQ== X-Google-Smtp-Source: ABdhPJyMpBFgYDxS/JG0ZvPGsZ4v20x8hZPVO3GuIH+J28idt43v1QQVuJD1TWPMRQd1dmNvx77Hig== X-Received: by 2002:a05:6000:150:: with SMTP id r16mr7770858wrx.63.1595585730938; Fri, 24 Jul 2020 03:15:30 -0700 (PDT) Received: from localhost.localdomain ([88.122.66.28]) by smtp.gmail.com with ESMTPSA id d18sm774714wrj.8.2020.07.24.03.15.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jul 2020 03:15:30 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, Loic Poulain Subject: [PATCH v2 2/6] wcn36xx: Add TX ack support Date: Fri, 24 Jul 2020 12:20:48 +0200 Message-Id: <1595586052-16081-3-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595586052-16081-1-git-send-email-loic.poulain@linaro.org> References: <1595586052-16081-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 The controller is capable of reporting TX indication which can be used to report TX ack when IEEE80211_TX_CTL_REQ_TX_STATUS is set. The support was only partially implemented. The firmware can be configured for reporting event when a packet is acked, without specifying which packet though. In order to send a packet flagged with TX status callback, we need to stop the queue, submit the packet and wait for the firmware ack event. Then the queue can be restarted and mac80211 status callback called. In case the packet is not acked, no ack event will be received, therefore a timeout mechanism is introduced to restart the queue and call the status cb in case no event is received after a 100ms. Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/dxe.c | 57 ++++++++++++++++++++++++++++-- drivers/net/wireless/ath/wcn36xx/main.c | 1 + drivers/net/wireless/ath/wcn36xx/txrx.c | 20 +++++++---- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 + 4 files changed, 70 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c index bab30f7..6307923 100644 --- a/drivers/net/wireless/ath/wcn36xx/dxe.c +++ b/drivers/net/wireless/ath/wcn36xx/dxe.c @@ -334,6 +334,7 @@ void wcn36xx_dxe_tx_ack_ind(struct wcn36xx *wcn, u32 status) spin_lock_irqsave(&wcn->dxe_lock, flags); skb = wcn->tx_ack_skb; wcn->tx_ack_skb = NULL; + del_timer(&wcn->tx_ack_timer); spin_unlock_irqrestore(&wcn->dxe_lock, flags); if (!skb) { @@ -345,6 +346,8 @@ void wcn36xx_dxe_tx_ack_ind(struct wcn36xx *wcn, u32 status) if (status == 1) info->flags |= IEEE80211_TX_STAT_ACK; + else + info->flags &= ~IEEE80211_TX_STAT_ACK; wcn36xx_dbg(WCN36XX_DBG_DXE, "dxe tx ack status: %d\n", status); @@ -352,6 +355,32 @@ void wcn36xx_dxe_tx_ack_ind(struct wcn36xx *wcn, u32 status) ieee80211_wake_queues(wcn->hw); } +static void wcn36xx_dxe_tx_timer(struct timer_list *t) +{ + struct wcn36xx *wcn = from_timer(wcn, t, tx_ack_timer); + struct ieee80211_tx_info *info; + unsigned long flags; + struct sk_buff *skb; + + /* TX Timeout */ + wcn36xx_dbg(WCN36XX_DBG_DXE, "TX timeout\n"); + + spin_lock_irqsave(&wcn->dxe_lock, flags); + skb = wcn->tx_ack_skb; + wcn->tx_ack_skb = NULL; + spin_unlock_irqrestore(&wcn->dxe_lock, flags); + + if (!skb) + return; + + info = IEEE80211_SKB_CB(skb); + info->flags &= ~IEEE80211_TX_STAT_ACK; + info->flags &= ~IEEE80211_TX_STAT_NOACK_TRANSMITTED; + + ieee80211_tx_status_irqsafe(wcn->hw, skb); + ieee80211_wake_queues(wcn->hw); +} + static void reap_tx_dxes(struct wcn36xx *wcn, struct wcn36xx_dxe_ch *ch) { struct wcn36xx_dxe_ctl *ctl; @@ -397,6 +426,7 @@ static irqreturn_t wcn36xx_irq_tx_complete(int irq, void *dev) { struct wcn36xx *wcn = (struct wcn36xx *)dev; int int_src, int_reason; + bool transmitted = false; wcn36xx_dxe_read_register(wcn, WCN36XX_DXE_INT_SRC_RAW_REG, &int_src); @@ -434,8 +464,10 @@ static irqreturn_t wcn36xx_irq_tx_complete(int irq, void *dev) int_reason); if (int_reason & (WCN36XX_CH_STAT_INT_DONE_MASK | - WCN36XX_CH_STAT_INT_ED_MASK)) + WCN36XX_CH_STAT_INT_ED_MASK)) { reap_tx_dxes(wcn, &wcn->dxe_tx_h_ch); + transmitted = true; + } } if (int_src & WCN36XX_INT_MASK_CHAN_TX_L) { @@ -473,9 +505,27 @@ static irqreturn_t wcn36xx_irq_tx_complete(int irq, void *dev) int_reason); if (int_reason & (WCN36XX_CH_STAT_INT_DONE_MASK | - WCN36XX_CH_STAT_INT_ED_MASK)) + WCN36XX_CH_STAT_INT_ED_MASK)) { reap_tx_dxes(wcn, &wcn->dxe_tx_l_ch); + transmitted = true; + } + } + + spin_lock(&wcn->dxe_lock); + if (wcn->tx_ack_skb && transmitted) { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(wcn->tx_ack_skb); + + /* TX complete, no need to wait for 802.11 ack indication */ + if (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS && + info->flags & IEEE80211_TX_CTL_NO_ACK) { + info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED; + del_timer(&wcn->tx_ack_timer); + ieee80211_tx_status_irqsafe(wcn->hw, wcn->tx_ack_skb); + wcn->tx_ack_skb = NULL; + ieee80211_wake_queues(wcn->hw); + } } + spin_unlock(&wcn->dxe_lock); return IRQ_HANDLED; } @@ -916,6 +966,8 @@ int wcn36xx_dxe_init(struct wcn36xx *wcn) if (ret < 0) goto out_err_irq; + timer_setup(&wcn->tx_ack_timer, wcn36xx_dxe_tx_timer, 0); + return 0; out_err_irq: @@ -934,6 +986,7 @@ void wcn36xx_dxe_deinit(struct wcn36xx *wcn) { free_irq(wcn->tx_irq, wcn); free_irq(wcn->rx_irq, wcn); + del_timer(&wcn->tx_ack_timer); if (wcn->tx_ack_skb) { ieee80211_tx_status_irqsafe(wcn->hw, wcn->tx_ack_skb); diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index af32bd6..c19648f 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1175,6 +1175,7 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn) ieee80211_hw_set(wcn->hw, SIGNAL_DBM); ieee80211_hw_set(wcn->hw, HAS_RATE_CONTROL); ieee80211_hw_set(wcn->hw, SINGLE_SCAN_ON_ALL_BANDS); + ieee80211_hw_set(wcn->hw, REPORTS_TX_ACK_STATUS); wcn->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP) | diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c index a690237..274cf58 100644 --- a/drivers/net/wireless/ath/wcn36xx/txrx.c +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c @@ -191,9 +191,10 @@ static void wcn36xx_set_tx_data(struct wcn36xx_tx_bd *bd, bd->dpu_sign = __vif_priv->self_ucast_dpu_sign; } - if (ieee80211_is_nullfunc(hdr->frame_control) || - (sta_priv && !sta_priv->is_data_encrypted)) + if (ieee80211_is_any_nullfunc(hdr->frame_control) || + (sta_priv && !sta_priv->is_data_encrypted)) { bd->dpu_ne = 1; + } if (bcast) { bd->ub = 1; @@ -287,9 +288,9 @@ int wcn36xx_start_tx(struct wcn36xx *wcn, bd.dpu_rf = WCN36XX_BMU_WQ_TX; - bd.tx_comp = !!(info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS); - if (bd.tx_comp) { + if (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS) { wcn36xx_dbg(WCN36XX_DBG_DXE, "TX_ACK status requested\n"); + spin_lock_irqsave(&wcn->dxe_lock, flags); if (wcn->tx_ack_skb) { spin_unlock_irqrestore(&wcn->dxe_lock, flags); @@ -302,10 +303,15 @@ int wcn36xx_start_tx(struct wcn36xx *wcn, /* Only one at a time is supported by fw. Stop the TX queues * until the ack status gets back. - * - * TODO: Add watchdog in case FW does not answer */ ieee80211_stop_queues(wcn->hw); + + /* TX watchdog if no TX irq or ack indication received */ + mod_timer(&wcn->tx_ack_timer, jiffies + HZ / 10); + + /* Request ack indication from the firmware */ + if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) + bd.tx_comp = 1; } /* Data frames served first*/ @@ -319,7 +325,7 @@ int wcn36xx_start_tx(struct wcn36xx *wcn, bd.tx_bd_sign = 0xbdbdbdbd; ret = wcn36xx_dxe_tx_frame(wcn, vif_priv, &bd, skb, is_low); - if (ret && bd.tx_comp) { + if (ret && (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS)) { /* If the skb has not been transmitted, * don't keep a reference to it. */ diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index a58f313..2d89849 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -245,6 +245,7 @@ struct wcn36xx { struct wcn36xx_dxe_mem_pool data_mem_pool; struct sk_buff *tx_ack_skb; + struct timer_list tx_ack_timer; /* RF module */ unsigned rf_id; From patchwork Fri Jul 24 10:20:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 11682837 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB3A5913 for ; Fri, 24 Jul 2020 10:15:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 930A4206F0 for ; Fri, 24 Jul 2020 10:15:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rkDDKscM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727862AbgGXKPe (ORCPT ); Fri, 24 Jul 2020 06:15:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726800AbgGXKPd (ORCPT ); Fri, 24 Jul 2020 06:15:33 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96DD2C0619E4 for ; Fri, 24 Jul 2020 03:15:33 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id t142so1394988wmt.4 for ; Fri, 24 Jul 2020 03:15:33 -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=xOOjQJESRtYt2KufOtjIRxHNZwgGy+9IHcMsoZIrghI=; b=rkDDKscMOyVNcs2gFEAVvnX0wv/PljueUqLwXnis0CGjRvXdVHnshtPaKz0FSVRVvD ZHJWW6GSf/reU/djVc5KUYqe5IkhOjHGb4l2Srneo3pHEcoJXy/nGzV2DPeMV9WXwQnq N/zXaLD8T8N8x97Yya6UMm1IbQ6VkeO+AuPsXCXlzX/X7sLY4y5CP1XVwunzkgYWx9JO iS4mdZE1f9iudpvA3KKW5z4IzZCIKGoCXuhqboxyBMGg5AtaomMGjaanCYO6oQuMT1Vb oLX6RvVuq+DJM44dr94V7rL5XtZhqzizLB7Y+yvYzzCqaLQwd4LfHdQlbjtekcdGef5R /32g== 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=xOOjQJESRtYt2KufOtjIRxHNZwgGy+9IHcMsoZIrghI=; b=ZBBrf4qpWSCevI/OIlkP24uwuFKzvJDqytR+Lzq7yU46o2sHJTDs8cSawRGRIlYGHg ZmW88OEcSVdMxYzxFe5YzhsWQeoTUrENU0Lygb1EcKNmuOtqxpaEB7q4SFVECjd6mmSS vyH3e5mkhyflOVfmm8wMvEjRJMb2yJLzgdvB5LVbxq+pYc0zun4LPoY+/Gt3bNeBMjLK mY9HHkwMxZIG9ehzoW0OqJWy0MN6/MnQsg1ehA1N6zhK+C71jbtA3ikqmCyJ1UJOtIlZ Y5/ILiY6SWtcsTxR68FBqkJBgzDzjXZUFKmvYLWGoexe8/mc0dW9h7Jq+gCB078vigA5 U70A== X-Gm-Message-State: AOAM532PIwuAdOExBD3C0NxG5WsjyxaUYzZzVCGc8SqRypE9s3Io/tKl a5iCGZZfAEfU2Vv7f31VKZz+/g== X-Google-Smtp-Source: ABdhPJxXN5wp6qm73HC7GcGKHnv4qnkwMuJY7iiIz8tsUZ/S4sckHi4wiSWdL8oyNtqT6uVTLrDGDQ== X-Received: by 2002:a1c:7ecb:: with SMTP id z194mr7594250wmc.12.1595585732200; Fri, 24 Jul 2020 03:15:32 -0700 (PDT) Received: from localhost.localdomain ([88.122.66.28]) by smtp.gmail.com with ESMTPSA id d18sm774714wrj.8.2020.07.24.03.15.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jul 2020 03:15:31 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, Loic Poulain Subject: [PATCH v2 3/6] wcn36xx: Increase number of TX retries Date: Fri, 24 Jul 2020 12:20:49 +0200 Message-Id: <1595586052-16081-4-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595586052-16081-1-git-send-email-loic.poulain@linaro.org> References: <1595586052-16081-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 Increase the short/long retry limit to 15 in order to impove TX robustness in noisy/busy environment. 15 is the default value defined in the downstream driver. Observed number of ack timeout is reduced with this change. Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/smd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 59f9f53..908cc6c 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -45,8 +45,8 @@ static struct wcn36xx_cfg_val wcn36xx_cfg_vals[] = { WCN36XX_CFG_VAL(MAX_MEDIUM_TIME, 6000), WCN36XX_CFG_VAL(MAX_MPDUS_IN_AMPDU, 64), WCN36XX_CFG_VAL(RTS_THRESHOLD, 2347), - WCN36XX_CFG_VAL(SHORT_RETRY_LIMIT, 6), - WCN36XX_CFG_VAL(LONG_RETRY_LIMIT, 6), + WCN36XX_CFG_VAL(SHORT_RETRY_LIMIT, 15), + WCN36XX_CFG_VAL(LONG_RETRY_LIMIT, 15), WCN36XX_CFG_VAL(FRAGMENTATION_THRESHOLD, 8000), WCN36XX_CFG_VAL(DYNAMIC_THRESHOLD_ZERO, 5), WCN36XX_CFG_VAL(DYNAMIC_THRESHOLD_ONE, 10), From patchwork Fri Jul 24 10:20:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 11682839 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF6F313B1 for ; Fri, 24 Jul 2020 10:15:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE9362074F for ; Fri, 24 Jul 2020 10:15:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="m4QVLZ8y" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727873AbgGXKPg (ORCPT ); Fri, 24 Jul 2020 06:15:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726800AbgGXKPf (ORCPT ); Fri, 24 Jul 2020 06:15:35 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E23D2C0619D3 for ; Fri, 24 Jul 2020 03:15:34 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id p14so7106877wmg.1 for ; Fri, 24 Jul 2020 03:15:34 -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=6sIBs2chvdtlEKeOF6rmdpIMaaTVwiwiQeevfHl2XXk=; b=m4QVLZ8yfq0jCWgZZhasLvAzDwhOnovGfmIrWzAePSJr8qA/rxrsHf80FwCrRlceUC vWfNM4lSAkKHjyDOIC51I8EDM8kQU2/0FrUuKE8LHt4xJQquk8LFXsoHwaqEWki5ODy/ ytTEtWfzjku5DnY+a9O/FG46+yhc8F3w76yla1VbiLFC1Czec09kcvAb3MLPo1oVqxb8 MvBGuBkRbtug+ohZPeOy/opp5voOjvBfCiBVB1nxuFVO2k9bg53L1INmNW4Ab7BjwOD6 f5fFQHKFWh0b65kOUzTxbCbD0aJUh7F9+pugj5+VYY1L/oPj7MQXIrgUFuTnYNibtiw0 E2fQ== 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=6sIBs2chvdtlEKeOF6rmdpIMaaTVwiwiQeevfHl2XXk=; b=Z+Fr3o8zHHWB/4Gxq15lFE8WQ3AOcVXs5ImtRbXA67TYMBFFDyj5jKja88k6QK/amc VIEzTaAawYHKHfRbtzhYjyXK6X1SMGKF/b8vDk9eX9RvuoYX3oZ6E8gAKtkaaHIqRnFy dlAnw4t5F14WfE2+kseRr6q5F/j21e/wnpkUUysKqqxrfSo8xNjHHHGpxTkme+2KSKYH dXYokMjCt2naB8ytSZUDavwachZsAxmLYeLrBPeq5A4WWQkz0Iy0GoKivXjuqiBDbthn t60QqLgoz4s7Nmzjjd57kjVzJEsoNDB0WNolJu03K5U3V4CcbyPS3B4mHAXXwPAZ3v9e pW3w== X-Gm-Message-State: AOAM531EPMom9xudK9r7Crik9QXtIscxRIKzWE3E6DV9nUeuNG9j1Qnj rBOftm/yaUhmCuOy/1h+ZfeD1g== X-Google-Smtp-Source: ABdhPJwg3hSv/7exm0i0KMK9ArjANj4yxY46PKbm2dJFhvL45UEU/nQ7ZT04SsFGomlR6drLCVvBVQ== X-Received: by 2002:a7b:cb47:: with SMTP id v7mr7705694wmj.57.1595585733593; Fri, 24 Jul 2020 03:15:33 -0700 (PDT) Received: from localhost.localdomain ([88.122.66.28]) by smtp.gmail.com with ESMTPSA id d18sm774714wrj.8.2020.07.24.03.15.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jul 2020 03:15:33 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, Loic Poulain Subject: [PATCH v2 4/6] wcn36xx: Fix TX data path Date: Fri, 24 Jul 2020 12:20:50 +0200 Message-Id: <1595586052-16081-5-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595586052-16081-1-git-send-email-loic.poulain@linaro.org> References: <1595586052-16081-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 This patch contains the following fixes: - Use correct queue for submitting QoS packet. The queue id to use is a one-to-one mapping with the TID. - Don't encrypt a frame with IEEE80211_TX_INTFL_DONT_ENCRYPT flag. - Use the 'special queue' for null packets, preventing the firmware to submit it as AMPDU. Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/txrx.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c index 274cf58..dcc2ec0 100644 --- a/drivers/net/wireless/ath/wcn36xx/txrx.c +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c @@ -160,9 +160,11 @@ static void wcn36xx_set_tx_data(struct wcn36xx_tx_bd *bd, bool bcast) { struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_vif *vif = NULL; struct wcn36xx_vif *__vif_priv = NULL; - bool is_data_qos; + bool is_data_qos = ieee80211_is_data_qos(hdr->frame_control); + u16 tid = 0; bd->bd_rate = WCN36XX_BD_RATE_DATA; @@ -191,24 +193,33 @@ static void wcn36xx_set_tx_data(struct wcn36xx_tx_bd *bd, bd->dpu_sign = __vif_priv->self_ucast_dpu_sign; } - if (ieee80211_is_any_nullfunc(hdr->frame_control) || - (sta_priv && !sta_priv->is_data_encrypted)) { + if (is_data_qos) { + tid = ieee80211_get_tid(hdr); + /* TID->QID is one-to-one mapping */ + bd->queue_id = tid; + } + + if (info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT || + (sta_priv && !sta_priv->is_data_encrypted)) { bd->dpu_ne = 1; } + if (ieee80211_is_any_nullfunc(hdr->frame_control)) { + /* Don't use a regular queue for null packet (no ampdu) */ + bd->queue_id = WCN36XX_TX_U_WQ_ID; + } + if (bcast) { bd->ub = 1; bd->ack_policy = 1; } *vif_priv = __vif_priv; - is_data_qos = ieee80211_is_data_qos(hdr->frame_control); - wcn36xx_set_tx_pdu(bd, is_data_qos ? sizeof(struct ieee80211_qos_hdr) : sizeof(struct ieee80211_hdr_3addr), - skb->len, sta_priv ? sta_priv->tid : 0); + skb->len, tid); if (sta_priv && is_data_qos) wcn36xx_tx_start_ampdu(wcn, sta_priv, skb); From patchwork Fri Jul 24 10:20:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 11682841 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB26F618 for ; Fri, 24 Jul 2020 10:15:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2608206F0 for ; Fri, 24 Jul 2020 10:15:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XdU8POTS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726987AbgGXKPh (ORCPT ); Fri, 24 Jul 2020 06:15:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726754AbgGXKPg (ORCPT ); Fri, 24 Jul 2020 06:15:36 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F807C0619D3 for ; Fri, 24 Jul 2020 03:15:36 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id r2so2708727wrs.8 for ; Fri, 24 Jul 2020 03:15:36 -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=V+NZI24h/qHWQCCjOsGwSFpRmwVY2/CMFNAa9dHrpy8=; b=XdU8POTSeQgLtDBvoZfg4w10dwv9rmhKNZ6PqYGg2YxkYHPZIbOby8BuSPJiUUGULy ErEm9KK3Wvs/KzoN6RbYISwJ3+GcjfLyDBVaXrozQkosVjscAy1x+QPiWIfsaZ8/C+JP KVpUN1Tk936CMOgR0xKyifpY5HFD079s9ltxz4x6Toim8YE1A3KHUzEs02XfuuigoWvv aj5p+WpainC5ghaLhrs68TuvfhfTIC5TV5ouSL0sYe1wpPIqSVAfQxA7O5idcreE2t84 8ZFqceq2bE4aqO9qAuL08RFYzyK0yYYyeg42mb+oDva5Pu6cqtDHyYizbFvEvCeqEDmH gPiA== 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=V+NZI24h/qHWQCCjOsGwSFpRmwVY2/CMFNAa9dHrpy8=; b=RYp3zM6cyhjxMCDMUHx7nbLgWD3uE7m17DkzsgqTopoux1E67EMph35XtuKVxT4gD+ Ui0McboaIe575VA+P92I95lT9/LeljIy7RoLkh3uEhafJDUZwzgqq1vIO2sXDZCcxGQO d4ip7zv8vVzKDGEBVy8Yl/kEiP0MVqewobymmHFkVsv8kYI6a88SnErS1wsUt8tkb2Mk 3Vah/Dyx3zSEXXfZulz1hRN07Q/VS2hWV92l35VAGMtrRTyTMiTDudGLti75FSMrbcfl jpyj/26t/OOQ6KvlzL6wFtOzwa481w0z/8iAdtQNIxEy9ZM3SgmYJyADiVS/TLdtl20D jkmQ== X-Gm-Message-State: AOAM530ujwoiVjBZZhRn+MKSmYIljsTUgg4k31ndqG91tssazislfbkL RMhO+F120YYzSfQFz1zFMT/p5ldyZSg= X-Google-Smtp-Source: ABdhPJxwTkW6f+NYsx6erXGd6f2jNXoai52lmLMUbjQbZ5tFoZU/FUHBmnQlun8KbVS1EQn31Ng3Sg== X-Received: by 2002:a5d:69d2:: with SMTP id s18mr7836815wrw.408.1595585735025; Fri, 24 Jul 2020 03:15:35 -0700 (PDT) Received: from localhost.localdomain ([88.122.66.28]) by smtp.gmail.com with ESMTPSA id d18sm774714wrj.8.2020.07.24.03.15.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jul 2020 03:15:34 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, Loic Poulain Subject: [PATCH v2 5/6] wcn36xx: Fix software-driven scan Date: Fri, 24 Jul 2020 12:20:51 +0200 Message-Id: <1595586052-16081-6-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595586052-16081-1-git-send-email-loic.poulain@linaro.org> References: <1595586052-16081-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 For software-driven scan, rely on mac80211 software scan instead of internal driver implementation. The internal implementation cause connection trouble since it keep the antenna busy during the entire scan duration, moreover it's only a passive scanning (no probe request). Therefore, let mac80211 manages sw scan. Note: we fallback to software scan if firmware does not report scan offload support or if we need to scan the 5Ghz band (currently not supported by the offload scan...). Signed-off-by: Loic Poulain Tested-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 161 +++++++++++++++-------------- drivers/net/wireless/ath/wcn36xx/smd.c | 23 ++++- drivers/net/wireless/ath/wcn36xx/smd.h | 8 +- drivers/net/wireless/ath/wcn36xx/txrx.c | 11 +- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 6 +- 5 files changed, 116 insertions(+), 93 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index c19648f..0f6ebc7 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -354,8 +354,6 @@ static void wcn36xx_stop(struct ieee80211_hw *hw) wcn36xx_dbg(WCN36XX_DBG_MAC, "mac stop\n"); - cancel_work_sync(&wcn->scan_work); - mutex_lock(&wcn->scan_lock); if (wcn->scan_req) { struct cfg80211_scan_info scan_info = { @@ -378,12 +376,37 @@ static void wcn36xx_stop(struct ieee80211_hw *hw) kfree(wcn->hal_buf); } -static int wcn36xx_config(struct ieee80211_hw *hw, u32 changed) +static void wcn36xx_change_ps(struct wcn36xx *wcn, bool enable) { - struct wcn36xx *wcn = hw->priv; struct ieee80211_vif *vif = NULL; struct wcn36xx_vif *tmp; + list_for_each_entry(tmp, &wcn->vif_list, list) { + vif = wcn36xx_priv_to_vif(tmp); + if (enable && !wcn->sw_scan) { + if (vif->bss_conf.ps) /* ps allowed ? */ + wcn36xx_pmc_enter_bmps_state(wcn, vif); + } else { + wcn36xx_pmc_exit_bmps_state(wcn, vif); + } + } +} + +static void wcn36xx_change_opchannel(struct wcn36xx *wcn, int ch) +{ + struct ieee80211_vif *vif = NULL; + struct wcn36xx_vif *tmp; + + list_for_each_entry(tmp, &wcn->vif_list, list) { + vif = wcn36xx_priv_to_vif(tmp); + wcn36xx_smd_switch_channel(wcn, vif, ch); + } +} + +static int wcn36xx_config(struct ieee80211_hw *hw, u32 changed) +{ + struct wcn36xx *wcn = hw->priv; + wcn36xx_dbg(WCN36XX_DBG_MAC, "mac config changed 0x%08x\n", changed); mutex_lock(&wcn->conf_mutex); @@ -392,24 +415,29 @@ static int wcn36xx_config(struct ieee80211_hw *hw, u32 changed) int ch = WCN36XX_HW_CHANNEL(wcn); wcn36xx_dbg(WCN36XX_DBG_MAC, "wcn36xx_config channel switch=%d\n", ch); - list_for_each_entry(tmp, &wcn->vif_list, list) { - vif = wcn36xx_priv_to_vif(tmp); - wcn36xx_smd_switch_channel(wcn, vif, ch); - } - } - if (changed & IEEE80211_CONF_CHANGE_PS) { - list_for_each_entry(tmp, &wcn->vif_list, list) { - vif = wcn36xx_priv_to_vif(tmp); - if (hw->conf.flags & IEEE80211_CONF_PS) { - if (vif->bss_conf.ps) /* ps allowed ? */ - wcn36xx_pmc_enter_bmps_state(wcn, vif); - } else { - wcn36xx_pmc_exit_bmps_state(wcn, vif); - } + if (wcn->sw_scan_opchannel == ch) { + /* If channel is the initial operating channel, we may + * want to receive/transmit regular data packets, then + * simply stop the scan session and exit PS mode. + */ + wcn36xx_smd_finish_scan(wcn, HAL_SYS_MODE_SCAN, + wcn->sw_scan_vif, ch); + } else if (wcn->sw_scan) { + /* A scan is ongoing, do not change the operating + * channel, but start a scan session on the channel. + */ + wcn36xx_smd_init_scan(wcn, HAL_SYS_MODE_SCAN, + wcn->sw_scan_vif); + wcn36xx_smd_start_scan(wcn, ch); + } else { + wcn36xx_change_opchannel(wcn, ch); } } + if (changed & IEEE80211_CONF_CHANGE_PS) + wcn36xx_change_ps(wcn, hw->conf.flags & IEEE80211_CONF_PS); + mutex_unlock(&wcn->conf_mutex); return 0; @@ -614,55 +642,26 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, return ret; } -static void wcn36xx_hw_scan_worker(struct work_struct *work) +static int wcn36xx_hw_scan(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_scan_request *hw_req) { - struct wcn36xx *wcn = container_of(work, struct wcn36xx, scan_work); - struct cfg80211_scan_request *req = wcn->scan_req; - u8 channels[WCN36XX_HAL_PNO_MAX_NETW_CHANNELS_EX]; - struct cfg80211_scan_info scan_info = {}; - bool aborted = false; + struct wcn36xx *wcn = hw->priv; int i; - wcn36xx_dbg(WCN36XX_DBG_MAC, "mac80211 scan %d channels worker\n", req->n_channels); - - for (i = 0; i < req->n_channels; i++) - channels[i] = req->channels[i]->hw_value; - - wcn36xx_smd_update_scan_params(wcn, channels, req->n_channels); - - wcn36xx_smd_init_scan(wcn, HAL_SYS_MODE_SCAN); - for (i = 0; i < req->n_channels; i++) { - mutex_lock(&wcn->scan_lock); - aborted = wcn->scan_aborted; - mutex_unlock(&wcn->scan_lock); - - if (aborted) - break; - - wcn->scan_freq = req->channels[i]->center_freq; - wcn->scan_band = req->channels[i]->band; - - wcn36xx_smd_start_scan(wcn, req->channels[i]->hw_value); - msleep(30); - wcn36xx_smd_end_scan(wcn, req->channels[i]->hw_value); - - wcn->scan_freq = 0; + if (!get_feat_caps(wcn->fw_feat_caps, SCAN_OFFLOAD)) { + /* fallback to mac80211 software scan */ + return 1; } - wcn36xx_smd_finish_scan(wcn, HAL_SYS_MODE_SCAN); - scan_info.aborted = aborted; - ieee80211_scan_completed(wcn->hw, &scan_info); - - mutex_lock(&wcn->scan_lock); - wcn->scan_req = NULL; - mutex_unlock(&wcn->scan_lock); -} + /* For unknown reason, the hardware offloaded scan only works with + * 2.4Ghz channels, fallback to software scan in other cases. + */ + for (i = 0; i < hw_req->req.n_channels; i++) { + if (hw_req->req.channels[i]->band != NL80211_BAND_2GHZ) + return 1; + } -static int wcn36xx_hw_scan(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, - struct ieee80211_scan_request *hw_req) -{ - struct wcn36xx *wcn = hw->priv; mutex_lock(&wcn->scan_lock); if (wcn->scan_req) { mutex_unlock(&wcn->scan_lock); @@ -674,12 +673,6 @@ static int wcn36xx_hw_scan(struct ieee80211_hw *hw, mutex_unlock(&wcn->scan_lock); - if (!get_feat_caps(wcn->fw_feat_caps, SCAN_OFFLOAD)) { - /* legacy manual/sw scan */ - schedule_work(&wcn->scan_work); - return 0; - } - return wcn36xx_smd_start_hw_scan(wcn, vif, &hw_req->req); } @@ -696,16 +689,32 @@ static void wcn36xx_cancel_hw_scan(struct ieee80211_hw *hw, /* ieee80211_scan_completed will be called on FW scan * indication */ wcn36xx_smd_stop_hw_scan(wcn); - } else { - struct cfg80211_scan_info scan_info = { - .aborted = true, - }; - - cancel_work_sync(&wcn->scan_work); - ieee80211_scan_completed(wcn->hw, &scan_info); } } +static void wcn36xx_sw_scan_start(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + const u8 *mac_addr) +{ + struct wcn36xx *wcn = hw->priv; + + wcn->sw_scan = true; + wcn->sw_scan_vif = vif; + wcn->sw_scan_opchannel = WCN36XX_HW_CHANNEL(wcn); +} + +static void wcn36xx_sw_scan_complete(struct ieee80211_hw *hw, + struct ieee80211_vif *vif) +{ + struct wcn36xx *wcn = hw->priv; + + /* ensure that any scan session is finished */ + wcn36xx_smd_finish_scan(wcn, HAL_SYS_MODE_SCAN, wcn->sw_scan_vif, + wcn->sw_scan_opchannel); + wcn->sw_scan = false; + wcn->sw_scan_opchannel = 0; +} + static void wcn36xx_update_allowed_rates(struct ieee80211_sta *sta, enum nl80211_band band) { @@ -1151,6 +1160,8 @@ static const struct ieee80211_ops wcn36xx_ops = { .set_key = wcn36xx_set_key, .hw_scan = wcn36xx_hw_scan, .cancel_hw_scan = wcn36xx_cancel_hw_scan, + .sw_scan_start = wcn36xx_sw_scan_start, + .sw_scan_complete = wcn36xx_sw_scan_complete, .bss_info_changed = wcn36xx_bss_info_changed, .set_rts_threshold = wcn36xx_set_rts_threshold, .sta_add = wcn36xx_sta_add, @@ -1329,8 +1340,6 @@ static int wcn36xx_probe(struct platform_device *pdev) goto out_wq; } - INIT_WORK(&wcn->scan_work, wcn36xx_hw_scan_worker); - wcn->smd_channel = qcom_wcnss_open_channel(wcnss, "WLAN_CTRL", wcn36xx_smd_rsp_process, hw); if (IS_ERR(wcn->smd_channel)) { wcn36xx_err("failed to open WLAN_CTRL channel\n"); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 908cc6c..218f702 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -517,8 +517,10 @@ int wcn36xx_smd_stop(struct wcn36xx *wcn) return ret; } -int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode) +int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode, + struct ieee80211_vif *vif) { + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); struct wcn36xx_hal_init_scan_req_msg msg_body; int ret; @@ -526,6 +528,13 @@ int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode) INIT_HAL_MSG(msg_body, WCN36XX_HAL_INIT_SCAN_REQ); msg_body.mode = mode; + if (vif_priv->bss_index != WCN36XX_HAL_BSS_INVALID_IDX) { + /* Notify BSSID with null DATA packet */ + msg_body.frame_type = 2; + msg_body.notify = 1; + msg_body.scan_entry.bss_index[0] = vif_priv->bss_index; + msg_body.scan_entry.active_bss_count = 1; + } PREPARE_HAL_BUF(wcn->hal_buf, msg_body); @@ -607,8 +616,10 @@ int wcn36xx_smd_end_scan(struct wcn36xx *wcn, u8 scan_channel) } int wcn36xx_smd_finish_scan(struct wcn36xx *wcn, - enum wcn36xx_hal_sys_mode mode) + enum wcn36xx_hal_sys_mode mode, + struct ieee80211_vif *vif, u8 channel) { + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); struct wcn36xx_hal_finish_scan_req_msg msg_body; int ret; @@ -616,6 +627,14 @@ int wcn36xx_smd_finish_scan(struct wcn36xx *wcn, INIT_HAL_MSG(msg_body, WCN36XX_HAL_FINISH_SCAN_REQ); msg_body.mode = mode; + if (vif_priv->bss_index != WCN36XX_HAL_BSS_INVALID_IDX) { + /* Notify BSSID with null data packet */ + msg_body.notify = 1; + msg_body.frame_type = 2; + msg_body.oper_channel = channel; + msg_body.scan_entry.bss_index[0] = vif_priv->bss_index; + msg_body.scan_entry.active_bss_count = 1; + } PREPARE_HAL_BUF(wcn->hal_buf, msg_body); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index 68c59df..ffe8b0c 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -59,11 +59,13 @@ void wcn36xx_smd_close(struct wcn36xx *wcn); int wcn36xx_smd_load_nv(struct wcn36xx *wcn); int wcn36xx_smd_start(struct wcn36xx *wcn); int wcn36xx_smd_stop(struct wcn36xx *wcn); -int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode); int wcn36xx_smd_start_scan(struct wcn36xx *wcn, u8 scan_channel); int wcn36xx_smd_end_scan(struct wcn36xx *wcn, u8 scan_channel); -int wcn36xx_smd_finish_scan(struct wcn36xx *wcn, - enum wcn36xx_hal_sys_mode mode); +int wcn36xx_smd_finish_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode, + struct ieee80211_vif *vif, u8 channel); +int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode, + struct ieee80211_vif *vif); + int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn, u8 *channels, size_t channel_count); int wcn36xx_smd_start_hw_scan(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct cfg80211_scan_request *req); diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c index dcc2ec0..c9cf3db 100644 --- a/drivers/net/wireless/ath/wcn36xx/txrx.c +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c @@ -49,15 +49,8 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb) fc = __le16_to_cpu(hdr->frame_control); sn = IEEE80211_SEQ_TO_SN(__le16_to_cpu(hdr->seq_ctrl)); - /* When scanning associate beacons to this */ - if (ieee80211_is_beacon(hdr->frame_control) && wcn->scan_freq) { - status.freq = wcn->scan_freq; - status.band = wcn->scan_band; - } else { - status.freq = WCN36XX_CENTER_FREQ(wcn); - status.band = WCN36XX_BAND(wcn); - } - + status.freq = WCN36XX_CENTER_FREQ(wcn); + status.band = WCN36XX_BAND(wcn); status.mactime = 10; status.signal = -get_rssi0(bd); status.antenna = 1; diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 2d89849..3221fed 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -223,10 +223,10 @@ struct wcn36xx { spinlock_t hal_ind_lock; struct list_head hal_ind_queue; - struct work_struct scan_work; struct cfg80211_scan_request *scan_req; - int scan_freq; - int scan_band; + bool sw_scan; + u8 sw_scan_opchannel; + struct ieee80211_vif *sw_scan_vif; struct mutex scan_lock; bool scan_aborted; From patchwork Fri Jul 24 10:20:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 11682843 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B4F813B1 for ; Fri, 24 Jul 2020 10:15:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 43B24206F0 for ; Fri, 24 Jul 2020 10:15:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="OuAeZJWZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727892AbgGXKPi (ORCPT ); Fri, 24 Jul 2020 06:15:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726754AbgGXKPh (ORCPT ); Fri, 24 Jul 2020 06:15:37 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ADA3C0619D3 for ; Fri, 24 Jul 2020 03:15:37 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id f18so7819748wrs.0 for ; Fri, 24 Jul 2020 03:15:37 -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=29iinGb2cUivlj3Yy97UBPj5TwYQxxenBj0F2fDuKtQ=; b=OuAeZJWZyi+t0YpFltWxopOi5yvySOM2ve3AT145cSx6P+nZqCUa1cfVEqeEbk7kzK TpxReg6v8tAcqZCxGwNsBOXkXOwG8EWJsTH9xgJlop5+CKDEgzlqU7ptUSukLVcZ3Cgm OlzwUc7ZoC2oXodz7nxqQG0gMhXiqVgUlC0d2TIoVTTjgbkaNHlsncdfDuKQkAYvvo2K KyoW33ir/A50Yn/CO7aewdJE5+zlpnjBKeoYMIC7RIU4cK2Px2E9bNyb95Erabl/JdNM baqmlTT76+6h2YU7LlAIiTmnnRM8oHF6AWWTukm9btqbrIsbwKj9w5SYmkFKVMhc271R oegQ== 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=29iinGb2cUivlj3Yy97UBPj5TwYQxxenBj0F2fDuKtQ=; b=iwYPZNef8mH3DSjGLs93abV6q8g3LW6poTKFWVJr7aftB0QQio9acB8/NwpFMbURyt PwxaEvz0L11h/hHvizcjDXkU9oCWd8gjx6IhZ0w3ObMpx3yuFm2UlWm6hMzwiZrE1gXB wrghAx9XZ//Qz+D1zaXnnrmg2GFxza5l6XGZGRb7rR+mqwN9w/OZn4s1X7Js4ZId7FjM CiTRzR+xt4ckzWpZvv9jj5kvIe5nNVh/gmjt0e+FiVZTBoS8bsCpp+ZrAtEbX2zbtJPR 6RacNHspq6PYNLJKqsn743+A1D0ahy6IWVyIOFmy2lI/Wdj8Mz63TBPubvR9xY9uOlHA gyvw== X-Gm-Message-State: AOAM533giDc74XF0VogYKZhdfqavS+PZ6SSGE0iomSzqq9t+Td4C3+7n NBFpRKvGS2HtnmOH5c8VmeEmEA== X-Google-Smtp-Source: ABdhPJystyvVxyKdSZkFX726yNy/bKwL69gASA5iPFARUr7ka2+Ebhyro9fn/qM/Byv9wUKhogIQ6g== X-Received: by 2002:adf:a15c:: with SMTP id r28mr7901311wrr.151.1595585736299; Fri, 24 Jul 2020 03:15:36 -0700 (PDT) Received: from localhost.localdomain ([88.122.66.28]) by smtp.gmail.com with ESMTPSA id d18sm774714wrj.8.2020.07.24.03.15.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jul 2020 03:15:35 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, Loic Poulain Subject: [PATCH v2 6/6] wcn36xx: Use sequence number allocated by mac80211 Date: Fri, 24 Jul 2020 12:20:52 +0200 Message-Id: <1595586052-16081-7-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595586052-16081-1-git-send-email-loic.poulain@linaro.org> References: <1595586052-16081-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 Instead of using the firmware generated sequence number, use the one already allocated by the mac80211 layer. This allows better control of the sequence numbers and avoid to rely on same sequence for Data, QOS Data and QOS Null Data packets. Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/txrx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c index c9cf3db..3f668ef 100644 --- a/drivers/net/wireless/ath/wcn36xx/txrx.c +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c @@ -93,7 +93,8 @@ static void wcn36xx_set_tx_pdu(struct wcn36xx_tx_bd *bd, bd->pdu.mpdu_header_off; bd->pdu.mpdu_len = len; bd->pdu.tid = tid; - bd->pdu.bd_ssn = WCN36XX_TXBD_SSN_FILL_DPU_QOS; + /* Use seq number generated by mac80211 */ + bd->pdu.bd_ssn = WCN36XX_TXBD_SSN_FILL_HOST; } static inline struct wcn36xx_vif *get_vif_by_addr(struct wcn36xx *wcn, @@ -200,6 +201,7 @@ static void wcn36xx_set_tx_data(struct wcn36xx_tx_bd *bd, if (ieee80211_is_any_nullfunc(hdr->frame_control)) { /* Don't use a regular queue for null packet (no ampdu) */ bd->queue_id = WCN36XX_TX_U_WQ_ID; + } if (bcast) {