Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3833662rdb; Thu, 28 Dec 2023 01:08:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQ7vUjlpzhXExYO4NRHu0tYr2UHJ2V4uQjykY+gRc2XugoFZTPoBa0aFCPzgsVjI78xxPU X-Received: by 2002:a05:6214:dc1:b0:67f:1f0c:b30e with SMTP id 1-20020a0562140dc100b0067f1f0cb30emr14939423qvt.32.1703754507934; Thu, 28 Dec 2023 01:08:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703754507; cv=none; d=google.com; s=arc-20160816; b=Ji9adfyhpKyTbsd5Xi5I967vModYEwNyAVvgis6BufX371MEvE1g/exyqUI6/DpnZK 3VQa4G8kMtz4NHg5cPzDFJhWtYCDejKF5c630a8jLB1XCNGs40F6j3+nVDRTSTTMKUVB +Rgx5VAwsqOmt8kZWFVUDy43ILSB4ViI01W9MzJ+oJJ9eBtFRl3/GO9VlnnFULVJDMnq DUIiO+3mQTI8i4GosOlH6nfQNqj/Vs7uFbAdpYW4Ly5buiMTX3Os7P1WHS85752M6qM/ SKP7e5FLcdNjaFEGNuNNZ5hrKfcbyI3QAF5n5vUne/jSX2pfXliUm0CfVlqHltilVepS 1X9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KWpiIQtLjDPLAdoQ8qHMuR2ReGdC3GYqShwY/8A+DLQ=; fh=xmX3nUiCDRywM7GN/jnkxEI0WXifvWaaBmhMyTMYa4c=; b=bkH/IDATV9mjNLl/U1kc/MnbhmU15jwJXlzdxOPLV2SGE22vhxY993qen6V4aJ7/GH fHZ3UhD9qo7V9zMdUmgD0dO/bl97kZWBHY6mU8zhoZi8KUXgW3uij5GCu5a8qm+dJe0Y ecob6IFkeqZN/RsfWfXwHihc3mcJHxHtbS2RtT3DCGj/dP0Jq5Z8sZZwCAKG/bpOqPmc COAahvWf98z/Ptg2v5zvq4VW7SZ+kvVKEeyT46Ian/9T7o2mMsJ3IDr/TcaE0dflGL7i VaYxvyIsa7MCv2q8MNuln+oQSVgtcm224Zqz5spjqY4KcEU0ruyKO58yjddshIoi9XJ8 D7XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=cmb3T38z; spf=pass (google.com: domain of linux-wireless+bounces-1301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1301-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o18-20020a05620a22d200b0077d7d812dc5si15752099qki.703.2023.12.28.01.08.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 01:08:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=cmb3T38z; spf=pass (google.com: domain of linux-wireless+bounces-1301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1301-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AB0C81C21B54 for ; Thu, 28 Dec 2023 09:08:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 519C67489; Thu, 28 Dec 2023 09:08:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="cmb3T38z" X-Original-To: linux-wireless@vger.kernel.org Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 610C26FA1 for ; Thu, 28 Dec 2023 09:08:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com X-UUID: 94b885faa56011ee9e680517dc993faa-20231228 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=KWpiIQtLjDPLAdoQ8qHMuR2ReGdC3GYqShwY/8A+DLQ=; b=cmb3T38zLllzGQ6WpN/uUcYG6W9za4gLprSeBuqfDywo7LsGZ7Vg+8f5Zz5n7/DPWRVcehgS7j9+TZ2clvWbRh9QuMrUk8Ea7EAETut6NxNxGhAsgdzU7H7d2to32BK2xPMB8DF2qXQ51TtzaKuYSgfImUoouq7QgHELV4EFKO0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:7c206727-9b94-4728-bd1c-d71c123b80cf,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:5d391d7,CLOUDID:20954282-8d4f-477b-89d2-1e3bdbef96d1,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO, DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 94b885faa56011ee9e680517dc993faa-20231228 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 353804192; Thu, 28 Dec 2023 17:07:52 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 28 Dec 2023 17:07:51 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 28 Dec 2023 17:07:51 +0800 From: Mingyen Hsieh To: , CC: , , , , , , , , , , , , , , Ming Yen Hsieh Subject: [PATCH 04/10] wifi: mt76: mt7925: fix wmm queue mapping Date: Thu, 28 Dec 2023 17:07:43 +0800 Message-ID: <20231228090749.15191-5-mingyen.hsieh@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20231228090749.15191-1-mingyen.hsieh@mediatek.com> References: <20231228090749.15191-1-mingyen.hsieh@mediatek.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain From: Ming Yen Hsieh Firmware uses access class index (ACI) for wmm parameters update, so convert mac80211 queue to ACI in mt7925_conf_tx(). Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips") Signed-off-by: Ming Yen Hsieh --- .../net/wireless/mediatek/mt76/mt7925/main.c | 21 ++++++++++++++++++- .../net/wireless/mediatek/mt76/mt7925/mcu.c | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index a080df58120f..b832dd8adee5 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -1273,6 +1273,25 @@ mt7925_channel_switch_beacon(struct ieee80211_hw *hw, mt792x_mutex_release(dev); } +static int +mt7925_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + unsigned int link_id, u16 queue, + const struct ieee80211_tx_queue_params *params) +{ + struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; + const u8 mq_to_aci[] = { + [IEEE80211_AC_VO] = 3, + [IEEE80211_AC_VI] = 2, + [IEEE80211_AC_BE] = 0, + [IEEE80211_AC_BK] = 1, + }; + + /* firmware uses access class index */ + mvif->queue_params[mq_to_aci[queue]] = *params; + + return 0; +} + static int mt7925_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *link_conf) @@ -1396,7 +1415,7 @@ const struct ieee80211_ops mt7925_ops = { .add_interface = mt7925_add_interface, .remove_interface = mt792x_remove_interface, .config = mt7925_config, - .conf_tx = mt792x_conf_tx, + .conf_tx = mt7925_conf_tx, .configure_filter = mt7925_configure_filter, .bss_info_changed = mt7925_bss_info_changed, .start_ap = mt7925_start_ap, diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 4811fccbe30e..0299045b4b83 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -895,7 +895,7 @@ int mt7925_mcu_set_tx(struct mt792x_dev *dev, struct ieee80211_vif *vif) e = (struct edca *)tlv; e->set = WMM_PARAM_SET; - e->queue = ac + mvif->mt76.wmm_idx * MT76_CONNAC_MAX_WMM_SETS; + e->queue = ac; e->aifs = q->aifs; e->txop = cpu_to_le16(q->txop); -- 2.18.0