From patchwork Sat Aug 25 10:40:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10576059 X-Patchwork-Delegate: kvalo@adurom.com 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 4617D174C for ; Sat, 25 Aug 2018 10:41:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 233072B009 for ; Sat, 25 Aug 2018 10:41:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 068322AFC2; Sat, 25 Aug 2018 10:41:09 +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=-7.9 required=2.0 tests=BAYES_00,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 994292AE6D for ; Sat, 25 Aug 2018 10:41:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726712AbeHYOTi (ORCPT ); Sat, 25 Aug 2018 10:19:38 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:39667 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726624AbeHYOTi (ORCPT ); Sat, 25 Aug 2018 10:19:38 -0400 Received: by mail-wr1-f65.google.com with SMTP id o37-v6so9448039wrf.6 for ; Sat, 25 Aug 2018 03:41:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CcnPklmROzl1quW51pHcm/43LmaYboCrl835RGLsu0g=; b=pQZRoZG3Y+p4JQ7j++l0xHTrfnRlnAEAQcWsmMVRPR1oy0HhZDvRm1LrefzAMIVWY5 MuyfFb3Lr9uarAsYFOD42WCOJaG6IYhf+j9GLQ7NE1Cf1iXkcQMi+AT38HHM/EQEiYHY TWA8pF/lWkFKUyXJJsN+qHQSvCRCxRS5+fEHZlrk/ABdxAg2Pf7KloMSvq1dYw3oodhu Uu1xZqGLDOOEamjuvaJMMqLd7lzp7/zpz9vmLqjhbRuWDshzMtujgXJCpHkRxMxjoxn3 mGSpd12btxQ9pMyx1uteRPabo+F8MX6nKZjncQxJ3/cSzPEYisg6G25bpS9sliVWDlt9 HQzQ== X-Gm-Message-State: APzg51B1Ghn9U/xCBvrt/cud3OV21TkVQAnXkq/t6lLZQXqfE6rrWA3C qhpszg8nNbMllZaP3dFe8BzXmg== X-Google-Smtp-Source: ANB0VdZQl9h9XLd25XmurZwUgi0w6zAyrcXKiHJNgx8KOZmm6m2fRe5D/r7eDPCngyXLRwNprduApQ== X-Received: by 2002:a5d:61c1:: with SMTP id q1-v6mr3749500wrv.33.1535193662949; Sat, 25 Aug 2018 03:41:02 -0700 (PDT) Received: from localhost.localdomain ([151.66.53.29]) by smtp.gmail.com with ESMTPSA id l18-v6sm16391708wru.75.2018.08.25.03.41.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Aug 2018 03:41:02 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Cc: sgruszka@redhat.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 01/16] mt76: move mt76_reg_pair definition in mt76.h Date: Sat, 25 Aug 2018 12:40:41 +0200 Message-Id: <20180825104056.9130-2-lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.18.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 Move common definition of mt76_reg_pair in mt76.h and remove duplicated code in mt76x2_init_common.c Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt76.h | 5 +++++ drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h | 5 ----- .../net/wireless/mediatek/mt76/mt76x2_init_common.c | 11 +++-------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index b02b4191ef37..fc27260080af 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -53,6 +53,11 @@ enum mt76_txq_id { __MT_TXQ_MAX }; +struct mt76_reg_pair { + u32 reg; + u32 value; +}; + enum mt76_rxq_id { MT_RXQ_MAIN, MT_RXQ_MCU, diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h b/drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h index 12f3dd1cc405..a694cc46fac8 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h @@ -219,11 +219,6 @@ struct mt76x0_wcid { u8 tx_rate_nss; }; -struct mt76_reg_pair { - u32 reg; - u32 value; -}; - struct mt76x0_rxwi; extern const struct ieee80211_ops mt76x0_ops; diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_init_common.c b/drivers/net/wireless/mediatek/mt76/mt76x2_init_common.c index 953effec8c1a..6af26350c177 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_init_common.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_init_common.c @@ -47,11 +47,6 @@ struct ieee80211_rate mt76x2_rates[] = { }; EXPORT_SYMBOL_GPL(mt76x2_rates); -struct mt76x2_reg_pair { - u32 reg; - u32 value; -}; - static void mt76x2_set_wlan_state(struct mt76x2_dev *dev, bool enable) { @@ -93,7 +88,7 @@ EXPORT_SYMBOL_GPL(mt76x2_reset_wlan); static void mt76x2_write_reg_pairs(struct mt76x2_dev *dev, - const struct mt76x2_reg_pair *data, int len) + const struct mt76_reg_pair *data, int len) { while (len > 0) { mt76_wr(dev, data->reg, data->value); @@ -128,7 +123,7 @@ void mt76_write_mac_initvals(struct mt76x2_dev *dev) FIELD_PREP(MT_PROT_CFG_NAV, 1) | \ FIELD_PREP(MT_PROT_CFG_TXOP_ALLOW, 0x3f)) - static const struct mt76x2_reg_pair vals[] = { + static const struct mt76_reg_pair vals[] = { /* Copied from MediaTek reference source */ { MT_PBF_SYS_CTRL, 0x00080c00 }, { MT_PBF_CFG, 0x1efebcff }, @@ -184,7 +179,7 @@ void mt76_write_mac_initvals(struct mt76x2_dev *dev) { MT_PROT_AUTO_TX_CFG, 0x00830083 }, { MT_HT_CTRL_CFG, 0x000001ff }, }; - struct mt76x2_reg_pair prot_vals[] = { + struct mt76_reg_pair prot_vals[] = { { MT_CCK_PROT_CFG, DEFAULT_PROT_CFG_CCK }, { MT_OFDM_PROT_CFG, DEFAULT_PROT_CFG_OFDM }, { MT_MM20_PROT_CFG, DEFAULT_PROT_CFG_20 },