Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp230749pxu; Fri, 4 Dec 2020 01:41:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxevcl2wZMSm2DgFjprPce3JlC4bYXGweKU7vNFRF1V+pMwN0INVAwm/2x23+3ztrdiiUCU X-Received: by 2002:a17:906:2582:: with SMTP id m2mr6170404ejb.271.1607074900140; Fri, 04 Dec 2020 01:41:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607074900; cv=none; d=google.com; s=arc-20160816; b=qSO27bzx+i8Nobv7V5ci9pfrht19xZg2cLWIZ/XmoCBTZVEP7oZbswX6eOL+U8wASQ aEPNrMXcu+w2EHmSs8XyG4Ybl9Lzjw62M6EL09NdKwE6x97D/U+uVju3GvqkaKZzYfrK zBOdbJz8Ky0m9CabpDTdLAc5IIEu8q2AthrYDcf6QxzslOQQQQUahsgbx73N9O2bUTJi yy2M3gle2Elb3eFBV/Q7ZUAflU+JiK0EVd+mo59vD0rTtoCIUr/xW2gl4t+7MrTzBCco wcIKimf3Oebo8t8SCtHgqYAx+P6Ug0tHjpPyTMwWTtz/MMBa8Y9wChVgGjBkXzim2QOR SAnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=fmQCmxnCqm5Dd8QW3H72dYaLPDwdMv7TamVyZ7wsk+k=; b=sO1xqkdeD8JQQoZA0iwRvX9jLD7sXoOhOrFP8M+RfeV89AWUcuj7kBjqtL4NT1xqU0 Dn1CdGBTTilfQAQISqFAOk54wsBv+70PISMMFX99DrhUQ6TaXKuOXOjtHSjZz5j0ywH3 Zcp2TWmEkvEpKqW3RKRqlymOndgg8Z3USuB0634/REhcP/hAdWU2pmP9g9APCCLMEghs QgSJ84w6GwFn9wdZv8348YhV0rVE8plG7XDaWMEu47+YaZ9KEKbdP30f3I9p//TCma2z N478Iri+R9BtlyBxJowJXUac6iRPJTVgrbSrMugSAeq2jRwpRk0QChLx4DStT8npHuP8 r6pQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i19si1035768ejk.743.2020.12.04.01.41.17; Fri, 04 Dec 2020 01:41:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729450AbgLDJi3 (ORCPT + 99 others); Fri, 4 Dec 2020 04:38:29 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:52962 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725866AbgLDJi3 (ORCPT ); Fri, 4 Dec 2020 04:38:29 -0500 X-UUID: 85d5a77a64f241cc8a1ac777ab95e4a8-20201204 X-UUID: 85d5a77a64f241cc8a1ac777ab95e4a8-20201204 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1594686488; Fri, 04 Dec 2020 17:37:42 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 4 Dec 2020 17:37:19 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 4 Dec 2020 17:37:17 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , linux-mediatek , Shayne Chen Subject: [PATCH 3/5] mt76: testmode: move mtd part to mt76_dev Date: Fri, 4 Dec 2020 17:36:57 +0800 Message-ID: <20201204093659.20384-3-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20201204093659.20384-1-shayne.chen@mediatek.com> References: <20201204093659.20384-1-shayne.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: A00DEBCF65E99FBD6D07904414DF9A35D5ED59FC22E894ED589AD254CB8769712000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Move testmode mtd variables to mt76_dev, since they are the same on each phy. Signed-off-by: Shayne Chen Acked-by: Ryder Lee --- drivers/net/wireless/mediatek/mt76/eeprom.c | 4 ++-- drivers/net/wireless/mediatek/mt76/mt76.h | 7 ++++--- drivers/net/wireless/mediatek/mt76/testmode.c | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c index ffc9d547f4fe..665b54c5c8ae 100644 --- a/drivers/net/wireless/mediatek/mt76/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/eeprom.c @@ -75,8 +75,8 @@ mt76_get_of_eeprom(struct mt76_dev *dev, int len) } #ifdef CONFIG_NL80211_TESTMODE - dev->phy.test.mtd_name = devm_kstrdup(dev->dev, part, GFP_KERNEL); - dev->phy.test.mtd_offset = offset; + dev->test_mtd.name = devm_kstrdup(dev->dev, part, GFP_KERNEL); + dev->test_mtd.offset = offset; #endif out_put_node: diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index 8752890fc61e..367bbc9b40a9 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -543,9 +543,6 @@ struct mt76_testmode_data { u8 tx_power[4]; u8 tx_power_control; - const char *mtd_name; - u32 mtd_offset; - u32 tx_pending; u32 tx_queued; u32 tx_done; @@ -663,6 +660,10 @@ struct mt76_dev { #ifdef CONFIG_NL80211_TESTMODE const struct mt76_testmode_ops *test_ops; + struct { + const char *name; + u32 offset; + } test_mtd; #endif struct workqueue_struct *wq; diff --git a/drivers/net/wireless/mediatek/mt76/testmode.c b/drivers/net/wireless/mediatek/mt76/testmode.c index 184964b9bd42..8b14620e16fc 100644 --- a/drivers/net/wireless/mediatek/mt76/testmode.c +++ b/drivers/net/wireless/mediatek/mt76/testmode.c @@ -482,9 +482,9 @@ int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *msg, if (nla_put_u32(msg, MT76_TM_ATTR_STATE, td->state)) goto out; - if (td->mtd_name && - (nla_put_string(msg, MT76_TM_ATTR_MTD_PART, td->mtd_name) || - nla_put_u32(msg, MT76_TM_ATTR_MTD_OFFSET, td->mtd_offset))) + if (dev->test_mtd.name && + (nla_put_string(msg, MT76_TM_ATTR_MTD_PART, dev->test_mtd.name) || + nla_put_u32(msg, MT76_TM_ATTR_MTD_OFFSET, dev->test_mtd.offset))) goto out; if (nla_put_u32(msg, MT76_TM_ATTR_TX_COUNT, td->tx_count) || -- 2.17.1