Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp9449012ybc; Sat, 30 Nov 2019 07:31:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxQoxTuIhhl2EFKpPtIN6Dt+HXEO9cUWxYpZtOVopLEr2ZtITtABn8yzZvZeVF4ptQgGo0O X-Received: by 2002:a17:906:411:: with SMTP id d17mr67242675eja.299.1575127904828; Sat, 30 Nov 2019 07:31:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575127904; cv=none; d=google.com; s=arc-20160816; b=0J1ZOGGftsBCzURY+mCtNhw1mjlGwshUcJLFg1IeUJa74IrXBfgCQfpKE1zZSvzW9q O173Tz0XDAe99QRqUX1RrAVJK808aomx1jZGQYod+rXeM6n/S0ARZqA8M3A6VAkq1270 LifUUYQfiU1jW52kqPSiZ1n3FNWkZMVNgfy/wbg7xJSTG5ri261kNtKggfLkhQY7uE8n BfuOcae58z/5MXEC90ao6CaLkLTIbpaoU8S9TURlwlP4OD19GRPTFH1u2mJjLmdUN3Ry t3Ul2KBH+w4eXLr8DQyAMRu6BI9hwDtJvPdtYdqVb3iaQ/O29K6pc0MjpDlE1ByZIhqU h0Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=QkL0hHKwEU9pWAfErjoUrKx40tQxxLoqdoVZYG7V4og=; b=H2QG/5N/R8a0LlBtoVZHZJboa5pCCuZRR0y5DlWM12Dud7dajfipE2A8SPsqgnAoQV en20K1znajsQPX2G1UdKO65031Nq+MXcZDATL7a7cW1KyqpvsHV5W4BRmhJVBRlVu8bd DOQryqDtx6NL/8RQX08LQ9EpR6cO7TlfY3MkHHgzJIyjwFjxuKMsaVGDEfIKOzWdKB0y OrfA+rvyJVAHORrOv/WgP8pwTngPkcxB7x0XesReWcj0AT2Xk1WjgTCgq/z9GDRq/+0s VQXMibdCoeAfaIpgGE1fHS+fyCF4XDI1mp+5cck4K6GfeUxgBmjI/PRB9dTXq3BqlWv7 H15Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=uXxBwzpD; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20si16156486ejm.348.2019.11.30.07.31.20; Sat, 30 Nov 2019 07:31:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=uXxBwzpD; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727312AbfK3PbB (ORCPT + 99 others); Sat, 30 Nov 2019 10:31:01 -0500 Received: from nbd.name ([46.4.11.11]:56064 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727200AbfK3Pat (ORCPT ); Sat, 30 Nov 2019 10:30:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=QkL0hHKwEU9pWAfErjoUrKx40tQxxLoqdoVZYG7V4og=; b=uXxBwzpDN6Ba7uZwiWJVmKYINd MuXwPXx9V5ubhLH0rSRVZ2PiCrQ8Fb2x8IuFd9cFhbADx6m2B6ePpjXgaLQSNiXisvLDNSHmvtb0D hBOf46A4XRXe8aBvjmjIrVcmX3w3UgZTt5OirBJds+0yTgPjh2Lss6rcU0lP/UuXjL8Y=; Received: from p5b2067e3.dip0.t-ipconnect.de ([91.32.103.227] helo=maeck.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ib4hr-0006iM-Qn for linux-wireless@vger.kernel.org; Sat, 30 Nov 2019 16:30:48 +0100 Received: by maeck.local (Postfix, from userid 501) id 0C981721EBE9; Sat, 30 Nov 2019 16:30:45 +0100 (CET) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 21/29] mt76: mt7615: remove useless MT_HW_RDD0/1 enum Date: Sat, 30 Nov 2019 16:30:37 +0100 Message-Id: <20191130153045.28105-21-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191130153045.28105-1-nbd@nbd.name> References: <20191130153045.28105-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Writing 0/1 is shorter and just as clear Signed-off-by: Felix Fietkau --- .../net/wireless/mediatek/mt76/mt7615/init.c | 3 +- .../net/wireless/mediatek/mt76/mt7615/mac.c | 29 ++++++++----------- .../wireless/mediatek/mt76/mt7615/mt7615.h | 5 ---- 3 files changed, 13 insertions(+), 24 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/init.c b/drivers/net/wireless/mediatek/mt76/mt7615/init.c index 9dcc3b26ff33..8d80aaf9723a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/init.c @@ -257,8 +257,7 @@ mt7615_regd_notifier(struct wiphy *wiphy, mt7615_dfs_stop_radar_detector(dev); if (request->dfs_region == NL80211_DFS_UNSET) - mt7615_mcu_rdd_cmd(dev, RDD_CAC_END, MT_HW_RDD0, - MT_RX_SEL0, 0); + mt7615_mcu_rdd_cmd(dev, RDD_CAC_END, 0, MT_RX_SEL0, 0); else mt7615_dfs_start_radar_detector(dev); } diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index 71b3de5c810c..8223c7fa1c65 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -1502,15 +1502,13 @@ int mt7615_dfs_stop_radar_detector(struct mt7615_dev *dev) struct cfg80211_chan_def *chandef = &dev->mphy.chandef; int err; - err = mt7615_mcu_rdd_cmd(dev, RDD_STOP, MT_HW_RDD0, - MT_RX_SEL0, 0); + err = mt7615_mcu_rdd_cmd(dev, RDD_STOP, 0, MT_RX_SEL0, 0); if (err < 0) return err; if (chandef->width == NL80211_CHAN_WIDTH_160 || chandef->width == NL80211_CHAN_WIDTH_80P80) - err = mt7615_mcu_rdd_cmd(dev, RDD_STOP, MT_HW_RDD1, - MT_RX_SEL0, 0); + err = mt7615_mcu_rdd_cmd(dev, RDD_STOP, 1, MT_RX_SEL0, 0); return err; } @@ -1532,20 +1530,19 @@ int mt7615_dfs_start_radar_detector(struct mt7615_dev *dev) int err; /* start CAC */ - err = mt7615_mcu_rdd_cmd(dev, RDD_CAC_START, MT_HW_RDD0, - MT_RX_SEL0, 0); + err = mt7615_mcu_rdd_cmd(dev, RDD_CAC_START, 0, MT_RX_SEL0, 0); if (err < 0) return err; /* TODO: DBDC support */ - err = mt7615_dfs_start_rdd(dev, MT_HW_RDD0); + err = mt7615_dfs_start_rdd(dev, 0); if (err < 0) return err; if (chandef->width == NL80211_CHAN_WIDTH_160 || chandef->width == NL80211_CHAN_WIDTH_80P80) { - err = mt7615_dfs_start_rdd(dev, MT_HW_RDD1); + err = mt7615_dfs_start_rdd(dev, 1); if (err < 0) return err; } @@ -1572,15 +1569,13 @@ int mt7615_dfs_init_radar_detector(struct mt7615_dev *dev) if (chandef->chan->flags & IEEE80211_CHAN_RADAR) { if (chandef->chan->dfs_state != NL80211_DFS_AVAILABLE) return mt7615_dfs_start_radar_detector(dev); - else - return mt7615_mcu_rdd_cmd(dev, RDD_CAC_END, MT_HW_RDD0, - MT_RX_SEL0, 0); - } else { - err = mt7615_mcu_rdd_cmd(dev, RDD_NORMAL_START, - MT_HW_RDD0, MT_RX_SEL0, 0); - if (err < 0) - return err; - return mt7615_dfs_stop_radar_detector(dev); + return mt7615_mcu_rdd_cmd(dev, RDD_CAC_END, 0, MT_RX_SEL0, 0); } + + err = mt7615_mcu_rdd_cmd(dev, RDD_NORMAL_START, 0, MT_RX_SEL0, 0); + if (err < 0) + return err; + + return mt7615_dfs_stop_radar_detector(dev); } diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h index 88e903324f07..bd9014421b00 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h @@ -149,11 +149,6 @@ enum { EXT_BSSID_END }; -enum { - MT_HW_RDD0, - MT_HW_RDD1, -}; - enum { MT_RX_SEL0, MT_RX_SEL1, -- 2.24.0