From patchwork Thu Sep 20 09:11:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10607177 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 CF6721390 for ; Thu, 20 Sep 2018 09:12:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C11702CC77 for ; Thu, 20 Sep 2018 09:12:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B587D2CCB4; Thu, 20 Sep 2018 09:12:37 +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 36A142CC13 for ; Thu, 20 Sep 2018 09:12:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387474AbeITOzE (ORCPT ); Thu, 20 Sep 2018 10:55:04 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:37296 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387433AbeITOzD (ORCPT ); Thu, 20 Sep 2018 10:55:03 -0400 Received: by mail-wr1-f65.google.com with SMTP id u12-v6so8581175wrr.4 for ; Thu, 20 Sep 2018 02:12:34 -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:in-reply-to :references; bh=pTP+Z4WWIn6SO7Fo1gacwASAnQom8Px1On+RC6dcYAQ=; b=U078DKKh1AHoV3Er7zbzRA09ODjp7cR5ly7RNs6XLqvkJe+dzcjnpJfqJbfyC8ovI0 wHIKn4k3Axy7XD4wrYlaqOetsHrNKGfPJDlWAjMOd+L3m9Q87E5BiSEQofFKnsh20ySF uHMXn7GWfKdVSCU+B9xrSEdVvCZXThFgK86hbRpw9aR/a2T9yC348baxcNVDpTlS6QrO F5dI3nZOWYlMmfHG3QCAwIil3UqhQnFxGjhb8PEYBF56HLiXO5UxIWJDnfGxOp7Z9jxn zPeB0XK/neB+9JLNPOUcRqJFkMs2YV7u3racPics2mycWZo7Wa4IBLjwOerFRSBFQ1IK 99LQ== X-Gm-Message-State: APzg51BBkVdg6CqPrhdW/Vuzx5KFeqM492UiL9S9lHoO7Q8/Pkto8g23 6XBS8uhHhswgoogxNs4xjn+qpA== X-Google-Smtp-Source: ANB0VdaMO3xLYwNtTExH+p1Xh8XbeEh+5anCtTTRGI5ksepZlGRcpm1tKvTonbcArSWv0VXIRJB+0A== X-Received: by 2002:adf:add0:: with SMTP id w74-v6mr33249412wrc.73.1537434753912; Thu, 20 Sep 2018 02:12:33 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 34-v6sm35501691wra.20.2018.09.20.02.12.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 02:12:33 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, sgruszka@redhat.com, linux-mediatek@lists.infradead.org Subject: [PATCH 09/20] mt76x0: remove mt76x0_set_country_reg routine Date: Thu, 20 Sep 2018 11:11:56 +0200 Message-Id: <249232763e7ee05755b26bbb0a05c933d2a1ae95.1537433365.git.lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: 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 Remove mt76x0_set_country_reg routine for the moment since it is partial and it is not actually used Signed-off-by: Lorenzo Bianconi --- .../wireless/mediatek/mt76/mt76x0/debugfs.c | 2 - .../wireless/mediatek/mt76/mt76x0/eeprom.c | 38 ------------------- .../wireless/mediatek/mt76/mt76x0/eeprom.h | 2 - 3 files changed, 42 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt76x0/debugfs.c index f9e305840176..932c0e41196c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/debugfs.c @@ -117,8 +117,6 @@ mt76x0_eeprom_param_read(struct seq_file *file, void *data) val = mt76x02_eeprom_get(&dev->mt76, MT_EE_NIC_CONF_0); seq_printf(file, "Power Amplifier type %lx\n", val & MT_EE_NIC_CONF_0_PA_TYPE); - seq_printf(file, "Reg channels: %hhu-%hhu\n", dev->ee->reg.start, - dev->ee->reg.start + dev->ee->reg.num - 1); seq_puts(file, "Per channel power:\n"); for (i = 0; i < 58; i++) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c index 6c492a21be26..5d08a7bb16ce 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c @@ -103,43 +103,6 @@ mt76x0_set_temp_offset(struct mt76x0_dev *dev, u8 *eeprom) dev->ee->temp_off = -10; } -static void -mt76x0_set_country_reg(struct mt76x0_dev *dev, u8 *eeprom) -{ - /* Note: - region 31 is not valid for mt76x0 (see rtmp_init.c) - * - comments in rtmp_def.h are incorrect (see rt_channel.c) - */ - static const struct reg_channel_bounds chan_bounds[] = { - /* EEPROM country regions 0 - 7 */ - { 1, 11 }, { 1, 13 }, { 10, 2 }, { 10, 4 }, - { 14, 1 }, { 1, 14 }, { 3, 7 }, { 5, 9 }, - /* EEPROM country regions 32 - 33 */ - { 1, 11 }, { 1, 14 } - }; - u8 val = eeprom[MT_EE_COUNTRY_REGION_2GHZ]; - int idx = -1; - - dev_dbg(dev->mt76.dev, "REG 2GHZ %u REG 5GHZ %u\n", val, eeprom[MT_EE_COUNTRY_REGION_5GHZ]); - if (val < 8) - idx = val; - if (val > 31 && val < 33) - idx = val - 32 + 8; - - if (idx != -1) - dev_info(dev->mt76.dev, - "EEPROM country region %02hhx (channels %hhd-%hhd)\n", - val, chan_bounds[idx].start, - chan_bounds[idx].start + chan_bounds[idx].num - 1); - else - idx = 5; /* channels 1 - 14 */ - - dev->ee->reg = chan_bounds[idx]; - - /* TODO: country region 33 is special - phy should be set to B-mode - * before entering channel 14 (see sta/connect.c) - */ -} - static void mt76x0_set_rf_freq_off(struct mt76x0_dev *dev, u8 *eeprom) { @@ -353,7 +316,6 @@ mt76x0_eeprom_init(struct mt76x0_dev *dev) mt76x02_mac_setaddr(&dev->mt76, eeprom + MT_EE_MAC_ADDR); mt76x0_set_chip_cap(dev, eeprom); - mt76x0_set_country_reg(dev, eeprom); mt76x0_set_rf_freq_off(dev, eeprom); mt76x0_set_temp_offset(dev, eeprom); mt76x0_set_lna_gain(dev, eeprom); diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h b/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h index e58a30589aa2..dbfcbfa71291 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h @@ -41,8 +41,6 @@ struct mt76x0_eeprom_params { u32 tx_pwr_cfg_5g[5][2]; u8 tx_pwr_per_chan[58]; - - struct reg_channel_bounds reg; }; int mt76x0_eeprom_init(struct mt76x0_dev *dev);