From patchwork Thu Sep 20 09:11:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10607227 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 8BD8014BD for ; Thu, 20 Sep 2018 09:25:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 776C32CC06 for ; Thu, 20 Sep 2018 09:25:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BD9F2CDC1; Thu, 20 Sep 2018 09:25:30 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EA5B52CC06 for ; Thu, 20 Sep 2018 09:25:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=SToPkqdAjNSSPrVB5LslARC34NeAPsrhq9UhMZ4toRQ=; b=TT7eRcr5HbUlI04eslnEAp4L0g UkLsHfeR4+/wS0zvnymRtGmSThlz2eY2YansJ8ReibXuk1/VPtfOre2m3ckaO/a/vco+ZfDnb0FDj Txg/lnSnruocRzbScO13uMoO8ZFlOIwQMXH8ZDvP/h8r0AWYdbeLQ3HWFqURv+gr/i3ZXc6b5eR+W zlTE+L7BelLTm62ugIZtYRKf5u35vF+mQI0kfoEfeviYsImGaLraec0+2RROJW51Q67KB9BS+IB9x 4mZQqqkCW66cbCgjjG5zEnxbdxaj/3o7ArO4qqyCFboJlnoi9DYVmX/DZmiJxh6rezMkFBUJ6G8wO wf+Ur6EA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2vDB-0007AD-LC; Thu, 20 Sep 2018 09:25:25 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2vCo-0006BC-9x for linux-mediatek@bombadil.infradead.org; Thu, 20 Sep 2018 09:25:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding: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=Nx/oFJUqavrXoksHdEJWvyNDiQ0daeQdzoA/Hbd2oZo=; b=TzRfkva3xXPzZ/vhSBjx0jgW4 qt1NvmXstchtAsqhSTwJ2OBt1GPGD9hi/tgJ7/MGOdg0Emi6ONYbDt04MdxGyKQJyVEPGkXYhuZWD Ge0rB4RBCliJUB553OvefcwXf094N115rpSTGVKs6ubzL8EkJohJl+CP4SAPjBta959RLwJ5J73Me S4i6kmhXHKJa0vD0UDSX4tga8vb5zvcDXwWzJBqcuAFPQDPPEKPnf5ONVu2L4WdURbDqKTgp8H+G8 QsEX1dbFQK7wC+P0d5KZrlejngl/ZdPsMYrvwIONFR7ObQ93B8zcaqudDjI4qispgDFw4jBfDWSCm k8vxVtqNw==; Received: from mail-wr1-f67.google.com ([209.85.221.67]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2v0o-000491-FG for linux-mediatek@lists.infradead.org; Thu, 20 Sep 2018 09:12:40 +0000 Received: by mail-wr1-f67.google.com with SMTP id v16-v6so8567602wro.11 for ; Thu, 20 Sep 2018 02:12:26 -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=Nx/oFJUqavrXoksHdEJWvyNDiQ0daeQdzoA/Hbd2oZo=; b=BT0367SkeVB4m8qjtKOFMPWWDpGrM4ET/4ZRtmdwbBCXDaJ7f889GiCM5P6de3gRvA j61r/xWrKwVGrV5PoaLNMEmx3DEuc1lrqRU8aLDjvhayfBPKgRDPQyy3rcy+3+t9WH5B +gWRtZVB90kRLWaIk3Zxi71yeiEQQJn2vKP3/N0qAJ3QznKYhva2h1wMtmaUcSviZXzD 3vE5oYAhMpRHI+TvdrokQW9ORwYhankNpXzkTU6P6mt6ZoGJsOX9nPJFJom6DYJsAQ4U 1DcP3kWKhOIZ9zWEIfEt8pVS8H1A8H+hSqizGxv2aKS2e4SYWvdVyOQFsTtk0H5mRXRF 7jmg== X-Gm-Message-State: APzg51BGQYI+GbTwJwO+WgBSj1cH5PYA/HH18UYKABJ1zSfkk0uGPXmb zq8IJG79VKT6xGDtCUJPVcEP6CPdh+Y= X-Google-Smtp-Source: ANB0VdboOXKqdKuQcoiow54OZfeDcUZXA/WThVMYKhtjqaLWPWIBesfk7E4sP+3O3xqyjJMO9PEGtQ== X-Received: by 2002:a5d:4990:: with SMTP id r16-v6mr32669229wrq.116.1537434745938; Thu, 20 Sep 2018 02:12:25 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 02:12:25 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Subject: [PATCH 02/20] mt76: add stbc entries to mt76_rate_power Date: Thu, 20 Sep 2018 11:11:49 +0200 Message-Id: <15d756db7fef57befcc2e2e28e640be10493df88.1537433365.git.lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180920_101238_512248_311613C9 X-CRM114-Status: GOOD ( 13.61 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sgruszka@redhat.com, linux-mediatek@lists.infradead.org, linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Felix Fietkau Add stbc tx power eeprom parsing support for mt76x2 driver. Signed-off-by: Felix Fietkau Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt76.h | 3 ++- drivers/net/wireless/mediatek/mt76/mt76x2_debugfs.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt76x2_eeprom.c | 1 + drivers/net/wireless/mediatek/mt76/mt76x2_phy_common.c | 4 ++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index b4980959efa7..9febace6ef23 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -423,10 +423,11 @@ struct mt76_rate_power { struct { s8 cck[4]; s8 ofdm[8]; + s8 stbc[8]; s8 ht[16]; s8 vht[10]; }; - s8 all[38]; + s8 all[46]; }; }; diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_debugfs.c b/drivers/net/wireless/mediatek/mt76/mt76x2_debugfs.c index 2cd0d8200a57..45f3439a6563 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_debugfs.c @@ -59,6 +59,8 @@ static int read_txpower(struct seq_file *file, void *data) ARRAY_SIZE(dev->rate_power.cck)); mt76_seq_puts_array(file, "OFDM", dev->rate_power.ofdm, ARRAY_SIZE(dev->rate_power.ofdm)); + mt76_seq_puts_array(file, "STBC", dev->rate_power.stbc, + ARRAY_SIZE(dev->rate_power.stbc)); mt76_seq_puts_array(file, "HT", dev->rate_power.ht, ARRAY_SIZE(dev->rate_power.ht)); mt76_seq_puts_array(file, "VHT", dev->rate_power.vht, diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_eeprom.c b/drivers/net/wireless/mediatek/mt76/mt76x2_eeprom.c index 1753bcb36356..807bf46e0dd9 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_eeprom.c @@ -461,6 +461,7 @@ void mt76x2_get_rate_power(struct mt76x2_dev *dev, struct mt76_rate_power *t, val = mt76x2_eeprom_get(dev, MT_EE_TX_POWER_HT_MCS4); t->ht[4] = t->ht[5] = mt76x2_rate_power_val(val); t->ht[6] = t->ht[7] = mt76x2_rate_power_val(val >> 8); + memcpy(t->stbc, t->ht, sizeof(t->stbc)); val = mt76x2_eeprom_get(dev, MT_EE_TX_POWER_HT_MCS8); t->ht[8] = t->ht[9] = mt76x2_rate_power_val(val); diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_phy_common.c b/drivers/net/wireless/mediatek/mt76/mt76x2_phy_common.c index 3b704a70fad1..42ca855c7579 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_phy_common.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_phy_common.c @@ -227,9 +227,9 @@ void mt76x2_phy_set_txpower(struct mt76x2_dev *dev) mt76_wr(dev, MT_TX_PWR_CFG_2, mt76x2_tx_power_mask(t.ht[4], t.ht[6], t.ht[8], t.ht[10])); mt76_wr(dev, MT_TX_PWR_CFG_3, - mt76x2_tx_power_mask(t.ht[12], t.ht[14], t.ht[0], t.ht[2])); + mt76x2_tx_power_mask(t.ht[12], t.ht[14], t.stbc[0], t.stbc[2])); mt76_wr(dev, MT_TX_PWR_CFG_4, - mt76x2_tx_power_mask(t.ht[4], t.ht[6], 0, 0)); + mt76x2_tx_power_mask(t.stbc[4], t.stbc[6], 0, 0)); mt76_wr(dev, MT_TX_PWR_CFG_7, mt76x2_tx_power_mask(t.ofdm[6], t.vht[8], t.ht[6], t.vht[8])); mt76_wr(dev, MT_TX_PWR_CFG_8,