Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3621880pxb; Fri, 4 Feb 2022 12:35:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTqFHqwwSJnvRVbgTTbWWFe6Ojf1ax2JzadHIevSYUopWhDsyioujafI692ZI5PyB66m2u X-Received: by 2002:a17:90b:1d0e:: with SMTP id on14mr332689pjb.59.1644006923663; Fri, 04 Feb 2022 12:35:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644006923; cv=none; d=google.com; s=arc-20160816; b=jh/6lfpe3yJ7B8lrxAtljHO6z+2U7dT0YsXlMu/pffJkmEOSZEc3vJJZknNVraOBgd S4GfNXeDYciaN1VKBf+Vss7rVtsBgJeTNAKrqZxOPT4ZsB3PI/I7JZcpbE141aajG7mE Fgl/l7d2wlk0aTTTK5QahAlUz3CQRykx0ZyjcT9Wmvz2TUaEVmXcyU1BUPxwo2QOzNyB bipVkhb9M8C2+09mXNEgxkrLtNIvQ/5sqpoMMkFs2JEWWI6Q2i8LvS5lMI9l3XeKTXc6 yV64DYzNtuDwx83jyUR8oZ8Gp5PNjTgo4Yy9x3SpxnBUrEiGjZD9xHjzASA/tpdbbi5L OHfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=uVwab4TfcccXXqCGUHK9nc7lKj1PiAidFfbcBOSSj64=; b=ImB1wqUT/A53bKjLATCkXD8FO8LDf8OdhemNe2ri4QVvBIuKR36vuY5D2ACVmlTgb9 ENJ/TbZltjvLnj5eKsEMppgDc5wKyMlLaO/gKjVBiyMLZLb3qG5mazk4SUII6b+vNldR e1VeTgxYpuF9dNumG+zRSmEyjNXdxX4BWXmAbeYxkJyi5NmC3T8KYQHMKeZ8yiWV9gDV Dis3A7lUwL2R5WJbqHUf0Ujr7P2lpfZ8/hAioK5UIhouf2Cd+cptUWKXpYg55N/yPRHw P2EJEePkkaeXd7RjIGOcdgIVInqzdnNv3sVcRtWsNVTIO77oTNEX+Ql8vgZMZUb9XLK1 zxRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@anyfinetworks-com.20210112.gappssmtp.com header.s=20210112 header.b=axMVRzwv; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y38si3009304pfa.204.2022.02.04.12.35.08; Fri, 04 Feb 2022 12:35:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@anyfinetworks-com.20210112.gappssmtp.com header.s=20210112 header.b=axMVRzwv; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359664AbiBDPrw (ORCPT + 72 others); Fri, 4 Feb 2022 10:47:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230391AbiBDPrv (ORCPT ); Fri, 4 Feb 2022 10:47:51 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63835C061714 for ; Fri, 4 Feb 2022 07:47:51 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id k13so13433721lfg.9 for ; Fri, 04 Feb 2022 07:47:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anyfinetworks-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uVwab4TfcccXXqCGUHK9nc7lKj1PiAidFfbcBOSSj64=; b=axMVRzwvKICE+mBEeohotURYQg4yaHWWtiV3x6r1n15fqgXjDS2RRtJeZpGGy3PB2t kTFns4+WNuaAsM4IpaE3dt1Oh6o9U/pXGZ03PXXpAAmQTv2Oq6L2GeyGV4rZw1XW9yQa rnYclvj/NNm0uhBYatgInM0ekI8xsU5N7STwZKiKFZvYbtxBUDRYvU6t4iBG0MBOfUdP 5D3MiGepiSzKwNUgfe/mCXRCFrmGQF4wfnlFYYdxn8QHetAxCm5WTGcVRCq3VrC1ne9b RpUswRJph1LA5tmTVOUuGRIsZ68Qc5AnL9UF0O6n7tBeBwFUrmEqPDBHkHl6ghoMCXtg 7D8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uVwab4TfcccXXqCGUHK9nc7lKj1PiAidFfbcBOSSj64=; b=zwd8NFTOQzFcDPK+33ynUd+aXof+Y3PoLYiQJIuQr1+DQUHS4plZOpKm7XvhooMemY jceAVZ3N4T5ovTpFCGh4SrUmtyUx5+O3BkPMKT+QbyjrtPGqK96x9cQxzaR0fwhddjHg 6Wu1KU8YMw/QWnJhptp7xoRMnvV5w9EH30EBj8BFEi5A2fEdanjgDe9wKUap7VTrghcE ApeMjvG1KtVrA28Oj8q5OaGWPWza+jqmorK7yA3gmJZ3rC2JNeZPoqbR/+4xhDU3Dh60 8nWztKujh2Iw+34BCoXZ8gMBLQMzN20kkKIg7cTbLidvSrjvGe1ao2/TKqlmydWrBNE6 Nbuw== X-Gm-Message-State: AOAM530jMGAcNKLPzmlIRknlJAzgytdBmKTRsh+9CGVWzB0VfaOMqbRO 7MckyA6M++3dLmqrjqh+VmJKJg== X-Received: by 2002:a05:6512:11f2:: with SMTP id p18mr2506351lfs.665.1643989669654; Fri, 04 Feb 2022 07:47:49 -0800 (PST) Received: from anpc2.lan ([62.119.107.74]) by smtp.gmail.com with ESMTPSA id k5sm364983lfe.19.2022.02.04.07.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Feb 2022 07:47:49 -0800 (PST) From: Johan Almbladh To: nbd@nbd.name, lorenzo.bianconi83@gmail.com Cc: ryder.lee@mediatek.com, linux-wireless@vger.kernel.org, Johan Almbladh Subject: [PATCH] mt76: mt7915: fix injected MPDU transmission to not use HW A-MSDU Date: Fri, 4 Feb 2022 16:47:30 +0100 Message-Id: <20220204154730.166194-1-johan.almbladh@anyfinetworks.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Before, the hardware would be allowed to transmit injected 802.11 MPDUs as A-MSDU. This resulted in corrupted frames being transmitted. Now, injected MPDUs are transmitted as-is, without A-MSDU. The fix was verified with frame injection on MT7915 hardware, both with and without the injected frame being encrypted. If the hardware cannot do A-MSDU aggregation on MPDUs, this problem would also be present in the TX path where mac80211 does the 802.11 encapsulation. However, I have not observed any such problem when disabling IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD to force that mode. Therefore this fix is isolated to injected frames only. The same A-MSDU logic is also present in the mt7921 driver, so it is likely that this fix should be applied there too. I do not have access to mt7921 hardware so I have not been able to test that. Signed-off-by: Johan Almbladh --- mt7915/mac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mt7915/mac.c b/mt7915/mac.c index 08ee78f6..1848fa16 100644 --- a/mt7915/mac.c +++ b/mt7915/mac.c @@ -1121,6 +1121,7 @@ mt7915_mac_write_txwi_80211(struct mt7915_dev *dev, __le32 *txwi, val = MT_TXD3_SN_VALID | FIELD_PREP(MT_TXD3_SEQ, IEEE80211_SEQ_TO_SN(seqno)); txwi[3] |= cpu_to_le32(val); + txwi[7] &= ~cpu_to_le32(MT_TXD7_HW_AMSDU); } val = FIELD_PREP(MT_TXD7_TYPE, fc_type) | -- 2.30.2