From patchwork Sat Jul 13 15:09:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 11043037 X-Patchwork-Delegate: nbd@nbd.name Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8DD0214C0 for ; Sat, 13 Jul 2019 15:09:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7914D281D2 for ; Sat, 13 Jul 2019 15:09:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DA9F28397; Sat, 13 Jul 2019 15:09:22 +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 1CB1B281D2 for ; Sat, 13 Jul 2019 15:09:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727896AbfGMPJV (ORCPT ); Sat, 13 Jul 2019 11:09:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:51608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727626AbfGMPJV (ORCPT ); Sat, 13 Jul 2019 11:09:21 -0400 Received: from lore-desk-wlan.lan (unknown [151.66.36.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6D69C20838; Sat, 13 Jul 2019 15:09:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563030560; bh=fd4IavovR/bNyKUIlTxowqh3rbDHp5AfLZO7lc+/SWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZyeMMefm+Tq8HvIFWI/zewCw5bv7OughikbPna4HAlgpo+1bcwR6WgCQda2jW+745 RWzHzww+oe2yv1PSkkom+pPyYSucUwyqK9Smr5r8K30v+ipfPDRmK5iAEWKi/RhcGs 6NSkkyvLQGnc8THHKpw4Hx52No6z//YrEfZbFddU= From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, ryder.lee@mediatek.com, royluo@google.com, linux-wireless@vger.kernel.org Subject: [PATCH 2/7] mt76: mt7615: add mt7615_mac_wtbl_addr routine Date: Sat, 13 Jul 2019 17:09:02 +0200 Message-Id: <8ebcb9d6fe715a9a7683cd25250325c5a3d2ddb2.1563029769.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 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 Introduce mt7615_mac_wtbl_addr rouinte to compute sta wtbl address. This is a preliminary patch to update wtbl key directly from host processor Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index 53937573662f..fb28f68486fd 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -449,13 +449,18 @@ void mt7615_txp_skb_unmap(struct mt76_dev *dev, le16_to_cpu(txp->len[i]), DMA_TO_DEVICE); } +static u32 mt7615_mac_wtbl_addr(int wcid) +{ + return MT_WTBL_BASE + wcid * MT_WTBL_ENTRY_SIZE; +} + void mt7615_mac_set_rates(struct mt7615_dev *dev, struct mt7615_sta *sta, struct ieee80211_tx_rate *probe_rate, struct ieee80211_tx_rate *rates) { struct ieee80211_tx_rate *ref; int wcid = sta->wcid.idx; - u32 addr = MT_WTBL_BASE + wcid * MT_WTBL_ENTRY_SIZE; + u32 addr = mt7615_mac_wtbl_addr(wcid); bool stbc = false; int n_rates = sta->n_rates; u8 bw, bw_prev, bw_idx = 0;