Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1001112iog; Thu, 30 Jun 2022 14:50:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vh6mtbM9ieuwQuyWrmS2idxc3HW39lYdibqjlLkbTJcGfGFKHOyMfbBDCELqmh2PsB8qTg X-Received: by 2002:a05:6a00:1941:b0:50d:807d:530b with SMTP id s1-20020a056a00194100b0050d807d530bmr17412860pfk.17.1656625855868; Thu, 30 Jun 2022 14:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656625855; cv=none; d=google.com; s=arc-20160816; b=kVd0gBjoVDAxXT+D5zjCyheZ/JcJ0jZzPc9ABeEQotepbFxLCOlkHJEjjx5lHXkS+I CW/agmaaUFyiPPEV2/8W6V6SWVvVYh9kWzF7gJNn7oBO/iYgv9QnmuunIbJzu+gYhCNZ ay7UUV3y/G+N1iBIfe4h5AKgJE/WM1llPCZtM0armxGYyRfT8tSHR1TUYb7uXkXnpibd RoaKAZKLSLgexDjgukVdeNU30B7lxnUrYVf7cVosXkWvN4hRtuhhqdD0P4qA94+swUaE EmVdTioWPvtWzGBSHJu7PCihDIhmkEX0IBYedeUcB3UxgVMgrXCv9jsaISgzHnvksIu2 WD8Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rJd9EQQOHmckLP7O9iIinmzXBcD9q2cBrpNhpud632Y=; b=ARG0iLWrX1Jk73M3ftHsMeH6h+Sl2uvCrWGu7hrpd6Tf0h9z4Jo9NOMRp92acSeBh3 7JLoh1BYV/URRMuDfA6RSb+6wGgWn4YApKUpzCRag8irOumiEoskR+QTRgLOs0PqLEgt SQ4aj1ywHHrucO1FHpWuFHO+SPT+gSeFHo/ueY9t6kreF+rNquT81AG27lkXyBGmAzq+ OlS/XtznWl/C6TwZR0/R24dzRiaKj+2hime6DmPRk03yYV2kXgvy2r7phAyYQhaN+PV8 NEgkzwnPrGR1dZrPEB3ZEfVDwCJjqaFUsd/wPXjmM/ZdFGuLPP+DFIlmjUpRGMvIPZ95 5FIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zrm2aGUV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h13-20020a056a00170d00b0051c3dcbe8ffsi28796681pfc.373.2022.06.30.14.50.48; Thu, 30 Jun 2022 14:50:55 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=Zrm2aGUV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237041AbiF3Vlk (ORCPT + 65 others); Thu, 30 Jun 2022 17:41:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229834AbiF3Vlk (ORCPT ); Thu, 30 Jun 2022 17:41:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F26E4393FB for ; Thu, 30 Jun 2022 14:41:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A97EEB82D5D for ; Thu, 30 Jun 2022 21:41:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DE3CC34115; Thu, 30 Jun 2022 21:41:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656625296; bh=LFx5M3MsEUG8CDUwME9wNhj2usf01XioWcoAIWIOFc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zrm2aGUVLcVNQIPY4gddvnXhev/k8xaZ+Q7AS0qy9BJIvLnyFH+38h8AlM3lz5htp HQSDx3ERsK2VSQy+wcJvzSg37f/NB9eJrhZBtJjF9qFAdmK47yRVjU2hoqls96Zbtn v99flJ0QcpNlvW4aTcBubRajSlpOa/zF0YBI3OCfmAvRy/8tq5hpM6N5J2MpGOwZ0P dZzJuWu7rHeE6L/ZAkTKiguZvY+I2IRfTN6V8OA6eLvpZXuX+sS7h/z6T+4RqpRlTG l6ab4xdN6Bb5yrvp+cfouw8RPF618gZfNf3c7i7tSqTUQv5+uqOtCcHI/VsN4qVYKi AQ9U+e1LbyWsw== From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org, ryder.lee@mediatek.com, evelyn.tsai@mediatek.com, sean.wang@mediatek.com Subject: [PATCH 1/5] mt76: add phy_idx in mt76_rx_status Date: Thu, 30 Jun 2022 23:41:12 +0200 Message-Id: <0226dfff1ef89e97c3aa9360fd2c735511368cd1.1656624320.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Introduce phy_idx mt76_rx_status instead of ext_idx. This is a preliminary patch to add mt7990 chipset support Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mac80211.c | 6 +++--- drivers/net/wireless/mediatek/mt76/mt76.h | 11 ++++++----- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index ecf5bd9605db..b2c834632b37 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -739,7 +739,7 @@ static void mt76_rx_release_burst(struct mt76_phy *phy, enum mt76_rxq_id q, void mt76_rx(struct mt76_dev *dev, enum mt76_rxq_id q, struct sk_buff *skb) { struct mt76_rx_status *status = (struct mt76_rx_status *)skb->cb; - struct mt76_phy *phy = mt76_dev_phy(dev, status->ext_phy); + struct mt76_phy *phy = mt76_dev_phy(dev, status->phy_idx); if (!test_bit(MT76_STATE_RUNNING, &phy->state)) { dev_kfree_skb(skb); @@ -1015,7 +1015,7 @@ mt76_rx_convert(struct mt76_dev *dev, struct sk_buff *skb, sizeof(mstat.chain_signal)); *sta = wcid_to_sta(mstat.wcid); - *hw = mt76_phy_hw(dev, mstat.ext_phy); + *hw = mt76_phy_hw(dev, mstat.phy_idx); } static int @@ -1178,7 +1178,7 @@ mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb) u8 tidno = status->qos_ctl & IEEE80211_QOS_CTL_TID_MASK; bool ps; - hw = mt76_phy_hw(dev, status->ext_phy); + hw = mt76_phy_hw(dev, status->phy_idx); if (ieee80211_is_pspoll(hdr->frame_control) && !wcid && !(status->flag & RX_FLAG_8023)) { sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr2, NULL); diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index 6b4150c54b96..3ee7db911529 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -575,7 +575,7 @@ struct mt76_rx_status { u8 iv[6]; - u8 ext_phy:1; + u8 phy_idx:2; u8 aggr:1; u8 qos_ctl; u16 seqno; @@ -1001,17 +1001,18 @@ static inline int mt76_init_mcu_queue(struct mt76_dev *dev, int qid, int idx, } static inline struct mt76_phy * -mt76_dev_phy(struct mt76_dev *dev, bool phy_ext) +mt76_dev_phy(struct mt76_dev *dev, u8 phy_idx) { - if (phy_ext && dev->phy2) + if (phy_idx && dev->phy2) return dev->phy2; + return &dev->phy; } static inline struct ieee80211_hw * -mt76_phy_hw(struct mt76_dev *dev, bool phy_ext) +mt76_phy_hw(struct mt76_dev *dev, u8 phy_idx) { - return mt76_dev_phy(dev, phy_ext)->hw; + return mt76_dev_phy(dev, phy_idx)->hw; } static inline u8 * diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index d9dd3d404986..1afcf964a587 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -500,7 +500,7 @@ static int mt7615_mac_fill_rx(struct mt7615_dev *dev, struct sk_buff *skb) if (phy_idx == 1 && phy2) { mphy = dev->mt76.phy2; phy = phy2; - status->ext_phy = true; + status->phy_idx = phy_idx; } if (!mt7615_firmware_offload(dev) && chfreq != phy->chfreq) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c index f696c20dc6e3..58d65904fdfb 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -247,7 +247,7 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb) return -EINVAL; phy = mphy->priv; - status->ext_phy = true; + status->phy_idx = 1; } if (!test_bit(MT76_STATE_RUNNING, &mphy->state)) -- 2.36.1