Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
fc80f38f3d
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.10 = .142
|
||||
LINUX_KERNEL_HASH-5.10.142 = 3f47ebdb9afe152a0c32c1157336ef13fa5cc08ac6d884dfc1f6ddc2b7dba268
|
||||
LINUX_VERSION-5.10 = .143
|
||||
LINUX_KERNEL_HASH-5.10.143 = fa2c9edef272d39dca52e057e1d41433cf1b6ab6a00d24a00333c0b735054e91
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.15 = .67
|
||||
LINUX_KERNEL_HASH-5.15.67 = da47d9a80b694548835ccb553b6eb1a1f3f5d5cddd9e2bd6f4886b99ca14f940
|
||||
LINUX_VERSION-5.15 = .68
|
||||
LINUX_KERNEL_HASH-5.15.68 = 17bbb3cb5c9ba18583b6679cc28f828aec49c72abbfc6fbde310b0cb17218b7e
|
||||
|
||||
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=linux-firmware
|
||||
PKG_VERSION:=20220708
|
||||
PKG_VERSION:=20220913
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_HASH:=0abec827a035c82bdcabdf82aa37ded247bc682ef05861bd409ea6f477bab81d
|
||||
PKG_HASH:=26fd00f2d8e96c4af6f44269a6b893eb857253044f75ad28ef6706a2250cd8e9
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wireless-regdb
|
||||
PKG_VERSION:=2022.06.06
|
||||
PKG_VERSION:=2022.08.12
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/
|
||||
PKG_HASH:=ac00f97efecce5046ed069d1d93f3365fdf994c7c7854a8fc50831e959537230
|
||||
PKG_HASH:=59c8f7d17966db71b27f90e735ee8f5b42ca3527694a8c5e6e9b56bd379c3b84
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ define KernelPackage/ltq-vdsl-vr9-mei/description
|
||||
endef
|
||||
|
||||
|
||||
define Package/ltq-vdsl-mei-test
|
||||
define Package/ltq-vdsl-vr9-mei-test
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Lantiq mei driver test tool
|
||||
@ -47,7 +47,7 @@ define Package/ltq-vdsl-mei-test
|
||||
DEPENDS:=@TARGET_lantiq_xrx200
|
||||
endef
|
||||
|
||||
define Package/ltq-vdsl-mei-test/description
|
||||
define Package/ltq-vdsl-vr9-mei-test/description
|
||||
Userland tool to directly control the mei driver, this is only needed
|
||||
for test and development purposes.
|
||||
endef
|
||||
@ -56,10 +56,10 @@ MAKE_FLAGS += \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
SHELL="$(BASH)"
|
||||
|
||||
# ltq-vdsl-app uses a header provided by the MEI driver which has some
|
||||
# ltq-vdsl-vr9-app uses a header provided by the MEI driver which has some
|
||||
# conditionals.
|
||||
# Define the conditionals here to have the same view on both sides. If you
|
||||
# change them, you need to change them for the ltq-vdsl-app as well
|
||||
# change them, you need to change them for the ltq-vdsl-vr9-app as well
|
||||
MEI_DRV_CFLAGS = \
|
||||
-DMEI_DRV_ATM_PTM_INTERFACE_ENABLE=1 \
|
||||
-DMEI_SUPPORT_DEBUG_STREAMS=1 \
|
||||
@ -91,9 +91,9 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,ltq-vdsl-vr9-mei))
|
||||
|
||||
define Package/ltq-vdsl-mei-test/install
|
||||
define Package/ltq-vdsl-vr9-mei-test/install
|
||||
$(INSTALL_DIR) $(1)/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mei_cpe_drv_test $(1)/bin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ltq-vdsl-mei-test))
|
||||
$(eval $(call BuildPackage,ltq-vdsl-vr9-mei-test))
|
||||
@ -12,7 +12,7 @@ PKG_NAME:=kernel
|
||||
PKG_FLAGS:=hold
|
||||
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/packages
|
||||
SCAN_DEPS=modules/*.mk $(TOPDIR)/target/linux/*/modules.mk $(TOPDIR)/include/netfilter.mk
|
||||
SCAN_DEPS=modules/*.mk $(TOPDIR)/target/linux/*/modules.mk $(TOPDIR)/target/linux/*/*/modules.mk $(TOPDIR)/include/netfilter.mk
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=
|
||||
@ -64,3 +64,4 @@ $(eval $(if $(DUMP),,$(call BuildPackage,kernel)))
|
||||
|
||||
include $(sort $(wildcard ./modules/*.mk))
|
||||
-include $(TOPDIR)/target/linux/*/modules.mk
|
||||
-include $(TOPDIR)/target/linux/*/*/modules.mk
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
From patchwork Sat Sep 17 20:26:27 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979242
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:26:27 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 01/16] rt2x00: define RF5592 in init_eeprom routine
|
||||
Message-ID:
|
||||
<d7eccb2c7b8ec4cd360fa2007796abffc35abb0d.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
From: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
|
||||
Fix incorrect RF value encoded in EEPROM on devices with Ralink Rt5592
|
||||
PCIe radio (a single chip 2T2R 802.11abgn solution).
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -9435,6 +9435,8 @@ static int rt2800_init_eeprom(struct rt2
|
||||
rf = RF3853;
|
||||
else if (rt2x00_rt(rt2x00dev, RT5350))
|
||||
rf = RF5350;
|
||||
+ else if (rt2x00_rt(rt2x00dev, RT5592))
|
||||
+ rf = RF5592;
|
||||
else
|
||||
rf = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE);
|
||||
|
||||
@ -0,0 +1,76 @@
|
||||
From patchwork Sat Sep 17 20:26:40 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979243
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:26:40 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 02/16] rt2x00: add throughput LED trigger
|
||||
Message-ID:
|
||||
<73f5ba4134e621462a26186449400cf0c1ac1730.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
From: David Bauer <mail@david-bauer.net>
|
||||
|
||||
This adds a (currently missing) throughput LED trigger for the rt2x00
|
||||
driver. Previously, LED triggers had to be assigned to the netdev, which
|
||||
was limited to a single VAP.
|
||||
|
||||
Tested-by: Christoph Krapp <achterin@googlemail.com>
|
||||
Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
@@ -1093,6 +1093,19 @@ static void rt2x00lib_remove_hw(struct r
|
||||
kfree(rt2x00dev->spec.channels_info);
|
||||
}
|
||||
|
||||
+static const struct ieee80211_tpt_blink rt2x00_tpt_blink[] = {
|
||||
+ { .throughput = 0 * 1024, .blink_time = 334 },
|
||||
+ { .throughput = 1 * 1024, .blink_time = 260 },
|
||||
+ { .throughput = 2 * 1024, .blink_time = 220 },
|
||||
+ { .throughput = 5 * 1024, .blink_time = 190 },
|
||||
+ { .throughput = 10 * 1024, .blink_time = 170 },
|
||||
+ { .throughput = 25 * 1024, .blink_time = 150 },
|
||||
+ { .throughput = 54 * 1024, .blink_time = 130 },
|
||||
+ { .throughput = 120 * 1024, .blink_time = 110 },
|
||||
+ { .throughput = 265 * 1024, .blink_time = 80 },
|
||||
+ { .throughput = 586 * 1024, .blink_time = 50 },
|
||||
+};
|
||||
+
|
||||
static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
struct hw_mode_spec *spec = &rt2x00dev->spec;
|
||||
@@ -1174,6 +1187,11 @@ static int rt2x00lib_probe_hw(struct rt2
|
||||
|
||||
#undef RT2X00_TASKLET_INIT
|
||||
|
||||
+ ieee80211_create_tpt_led_trigger(rt2x00dev->hw,
|
||||
+ IEEE80211_TPT_LEDTRIG_FL_RADIO,
|
||||
+ rt2x00_tpt_blink,
|
||||
+ ARRAY_SIZE(rt2x00_tpt_blink));
|
||||
+
|
||||
/*
|
||||
* Register HW.
|
||||
*/
|
||||
@ -1,51 +0,0 @@
|
||||
From patchwork Thu Dec 27 14:05:26 2018
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Tom Psyborg <pozega.tomislav@gmail.com>
|
||||
X-Patchwork-Id: 10743707
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
From: =?utf-8?q?Tomislav_Po=C5=BEega?= <pozega.tomislav@gmail.com>
|
||||
To: linux-wireless@vger.kernel.org
|
||||
Cc: kvalo@codeaurora.org, hauke@hauke-m.de, nbd@nbd.name,
|
||||
john@phrozen.org, sgruszka@redhat.com, daniel@makrotopia.org
|
||||
Subject: [PATCH 2/2] rt2x00: define RF5592 in init_eeprom routine
|
||||
Date: Thu, 27 Dec 2018 15:05:26 +0100
|
||||
Message-Id: <1545919526-4074-2-git-send-email-pozega.tomislav@gmail.com>
|
||||
X-Mailer: git-send-email 1.7.0.4
|
||||
In-Reply-To: <1545919526-4074-1-git-send-email-pozega.tomislav@gmail.com>
|
||||
References: <1545919526-4074-1-git-send-email-pozega.tomislav@gmail.com>
|
||||
MIME-Version: 1.0
|
||||
Sender: linux-wireless-owner@vger.kernel.org
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
X-Virus-Scanned: ClamAV using ClamSMTP
|
||||
|
||||
This patch fixes following crash on Linksys EA2750 during 5GHz wifi
|
||||
init:
|
||||
|
||||
[ 7.955153] rt2800pci 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
|
||||
[ 7.962259] rt2800pci 0000:01:00.0: loaded eeprom from mtd device "Factory"
|
||||
[ 7.969435] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5592, rev 0222 detected
|
||||
[ 7.977348] ieee80211 phy0: rt2800_init_eeprom: Error - Invalid RF chipset 0x0000 detected
|
||||
[ 7.985793] ieee80211 phy0: rt2x00lib_probe_dev: Error - Failed to allocate device
|
||||
[ 7.993569] CPU 0 Unable to handle kernel paging request at virtual address 00000024, epc == 800c8f54, ra == 80249ff8
|
||||
[ 8.004408] Oops[#1]:
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 ++
|
||||
1 files changed, 2 insertions(+), 0 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -9435,6 +9435,8 @@ static int rt2800_init_eeprom(struct rt2
|
||||
rf = RF3853;
|
||||
else if (rt2x00_rt(rt2x00dev, RT5350))
|
||||
rf = RF5350;
|
||||
+ else if (rt2x00_rt(rt2x00dev, RT5592))
|
||||
+ rf = RF5592;
|
||||
else
|
||||
rf = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE);
|
||||
|
||||
@ -1,22 +1,42 @@
|
||||
From 9782a7f7488443568fa4d6088b73c9aff7eb8510 Mon Sep 17 00:00:00 2001
|
||||
From patchwork Sat Sep 17 20:26:55 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979244
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:26:55 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Wed, 19 Apr 2017 16:14:53 +0200
|
||||
Subject: [PATCH] rt2x00: add support for external PA on MT7620
|
||||
To: Stanislaw Gruszka <sgruszka@redhat.com>
|
||||
Cc: Helmut Schaa <helmut.schaa@googlemail.com>,
|
||||
linux-wireless@vger.kernel.org,
|
||||
Kalle Valo <kvalo@codeaurora.org>
|
||||
Content-Type: text/plain; charset="UTF-8"
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 03/16] rt2x00: add support for external PA on MT7620
|
||||
Message-ID:
|
||||
<af2c68ff831816a86fc39b0c10911c129a1f03dc.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav@gmail.com>
|
||||
Implement support for external PA connected to MT7620A.
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
[pozega.tomislav@gmail.com: use chanreg and dccal helpers.]
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800.h | 1 +
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 70 +++++++++++++++++++++++++-
|
||||
2 files changed, 70 insertions(+), 1 deletion(-)
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800.h | 1 +
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 52 ++++++++++++++++++-
|
||||
2 files changed, 52 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h
|
||||
@ -24,21 +44,19 @@ Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav@gmail.com>
|
||||
#define EEPROM_NIC_CONF2_RX_STREAM FIELD16(0x000f)
|
||||
#define EEPROM_NIC_CONF2_TX_STREAM FIELD16(0x00f0)
|
||||
#define EEPROM_NIC_CONF2_CRYSTAL FIELD16(0x0600)
|
||||
+#define EEPROM_NIC_CONF2_EXTERNAL_PA FIELD16(0xc000)
|
||||
+#define EEPROM_NIC_CONF2_EXTERNAL_PA FIELD16(0x8000)
|
||||
|
||||
/*
|
||||
* EEPROM LNA
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -4369,6 +4369,45 @@ static void rt2800_config_channel(struct
|
||||
@@ -4368,6 +4368,43 @@ static void rt2800_config_channel(struct
|
||||
rt2800_iq_calibrate(rt2x00dev, rf->channel);
|
||||
}
|
||||
|
||||
+ if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0,
|
||||
+ &rt2x00dev->cap_flags)) {
|
||||
+ rt2x00_warn(rt2x00dev, "Using incomplete support for " \
|
||||
+ "external PA\n");
|
||||
+ reg = rt2800_register_read(rt2x00dev, RF_CONTROL3);
|
||||
+ reg |= 0x00000101;
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL3, reg);
|
||||
@ -76,7 +94,7 @@ Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav@gmail.com>
|
||||
bbp = rt2800_bbp_read(rt2x00dev, 4);
|
||||
rt2x00_set_field8(&bbp, BBP4_BANDWIDTH, 2 * conf_is_ht40(conf));
|
||||
rt2800_bbp_write(rt2x00dev, 4, bbp);
|
||||
@@ -9578,7 +9617,8 @@ static int rt2800_init_eeprom(struct rt2
|
||||
@@ -9566,7 +9603,8 @@ static int rt2800_init_eeprom(struct rt2
|
||||
*/
|
||||
eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1);
|
||||
|
||||
@ -86,19 +104,19 @@ Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav@gmail.com>
|
||||
if (rt2x00_get_field16(eeprom,
|
||||
EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352))
|
||||
__set_bit(CAPABILITY_EXTERNAL_PA_TX0,
|
||||
@@ -9589,6 +9629,18 @@ static int rt2800_init_eeprom(struct rt2
|
||||
@@ -9577,6 +9615,18 @@ static int rt2800_init_eeprom(struct rt2
|
||||
&rt2x00dev->cap_flags);
|
||||
}
|
||||
|
||||
+ eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF2);
|
||||
+
|
||||
+ if (rt2x00_rt(rt2x00dev, RT6352) && eeprom != 0 && eeprom != 0xffff) {
|
||||
+ if (rt2x00_get_field16(eeprom,
|
||||
+ EEPROM_NIC_CONF2_EXTERNAL_PA)) {
|
||||
+ __set_bit(CAPABILITY_EXTERNAL_PA_TX0,
|
||||
+ &rt2x00dev->cap_flags);
|
||||
+ __set_bit(CAPABILITY_EXTERNAL_PA_TX1,
|
||||
+ &rt2x00dev->cap_flags);
|
||||
+ if (!rt2x00_get_field16(eeprom,
|
||||
+ EEPROM_NIC_CONF2_EXTERNAL_PA)) {
|
||||
+ __clear_bit(CAPABILITY_EXTERNAL_PA_TX0,
|
||||
+ &rt2x00dev->cap_flags);
|
||||
+ __clear_bit(CAPABILITY_EXTERNAL_PA_TX1,
|
||||
+ &rt2x00dev->cap_flags);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@ -0,0 +1,178 @@
|
||||
From patchwork Sat Sep 17 20:27:10 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979245
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:27:10 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 04/16] rt2x00: move up and reuse busy wait functions
|
||||
Message-ID:
|
||||
<3fdb9dc15e76a9f9c1948b4a3a1308a7a5677bb8.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Move bbp_ready and rf_ready busy wait functions up in the code so they
|
||||
can more easily be used. Allow specifying register mask in rf_ready
|
||||
function which is useful for calibration routines which will be added
|
||||
in follow-up commits.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 99 +++++++++----------
|
||||
1 file changed, 46 insertions(+), 53 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -2143,6 +2143,48 @@ void rt2800_config_erp(struct rt2x00_dev
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rt2800_config_erp);
|
||||
|
||||
+static int rt2800_wait_bbp_rf_ready(struct rt2x00_dev *rt2x00dev,
|
||||
+ const struct rt2x00_field32 mask)
|
||||
+{
|
||||
+ unsigned int i;
|
||||
+ u32 reg;
|
||||
+
|
||||
+ for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
|
||||
+ reg = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (!rt2x00_get_field32(reg, mask))
|
||||
+ return 0;
|
||||
+
|
||||
+ udelay(REGISTER_BUSY_DELAY);
|
||||
+ }
|
||||
+
|
||||
+ rt2x00_err(rt2x00dev, "BBP/RF register access failed, aborting\n");
|
||||
+ return -EACCES;
|
||||
+}
|
||||
+
|
||||
+static int rt2800_wait_bbp_ready(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ unsigned int i;
|
||||
+ u8 value;
|
||||
+
|
||||
+ /*
|
||||
+ * BBP was enabled after firmware was loaded,
|
||||
+ * but we need to reactivate it now.
|
||||
+ */
|
||||
+ rt2800_register_write(rt2x00dev, H2M_BBP_AGENT, 0);
|
||||
+ rt2800_register_write(rt2x00dev, H2M_MAILBOX_CSR, 0);
|
||||
+ msleep(1);
|
||||
+
|
||||
+ for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 0);
|
||||
+ if ((value != 0xff) && (value != 0x00))
|
||||
+ return 0;
|
||||
+ udelay(REGISTER_BUSY_DELAY);
|
||||
+ }
|
||||
+
|
||||
+ rt2x00_err(rt2x00dev, "BBP register access failed, aborting\n");
|
||||
+ return -EACCES;
|
||||
+}
|
||||
+
|
||||
static void rt2800_config_3572bt_ant(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
u32 reg;
|
||||
@@ -3799,10 +3841,9 @@ static void rt2800_config_alc(struct rt2
|
||||
struct ieee80211_channel *chan,
|
||||
int power_level) {
|
||||
u16 eeprom, target_power, max_power;
|
||||
- u32 mac_sys_ctrl, mac_status;
|
||||
+ u32 mac_sys_ctrl;
|
||||
u32 reg;
|
||||
u8 bbp;
|
||||
- int i;
|
||||
|
||||
/* hardware unit is 0.5dBm, limited to 23.5dBm */
|
||||
power_level *= 2;
|
||||
@@ -3838,16 +3879,8 @@ static void rt2800_config_alc(struct rt2
|
||||
/* Disable Tx/Rx */
|
||||
rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, 0);
|
||||
/* Check MAC Tx/Rx idle */
|
||||
- for (i = 0; i < 10000; i++) {
|
||||
- mac_status = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
- if (mac_status & 0x3)
|
||||
- usleep_range(50, 200);
|
||||
- else
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- if (i == 10000)
|
||||
- rt2x00_warn(rt2x00dev, "Wait MAC Status to MAX !!!\n");
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY)))
|
||||
+ rt2x00_warn(rt2x00dev, "RF busy while configuring ALC\n");
|
||||
|
||||
if (chan->center_freq > 2457) {
|
||||
bbp = rt2800_bbp_read(rt2x00dev, 30);
|
||||
@@ -6249,46 +6282,6 @@ static int rt2800_init_registers(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int rt2800_wait_bbp_rf_ready(struct rt2x00_dev *rt2x00dev)
|
||||
-{
|
||||
- unsigned int i;
|
||||
- u32 reg;
|
||||
-
|
||||
- for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
|
||||
- reg = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
- if (!rt2x00_get_field32(reg, MAC_STATUS_CFG_BBP_RF_BUSY))
|
||||
- return 0;
|
||||
-
|
||||
- udelay(REGISTER_BUSY_DELAY);
|
||||
- }
|
||||
-
|
||||
- rt2x00_err(rt2x00dev, "BBP/RF register access failed, aborting\n");
|
||||
- return -EACCES;
|
||||
-}
|
||||
-
|
||||
-static int rt2800_wait_bbp_ready(struct rt2x00_dev *rt2x00dev)
|
||||
-{
|
||||
- unsigned int i;
|
||||
- u8 value;
|
||||
-
|
||||
- /*
|
||||
- * BBP was enabled after firmware was loaded,
|
||||
- * but we need to reactivate it now.
|
||||
- */
|
||||
- rt2800_register_write(rt2x00dev, H2M_BBP_AGENT, 0);
|
||||
- rt2800_register_write(rt2x00dev, H2M_MAILBOX_CSR, 0);
|
||||
- msleep(1);
|
||||
-
|
||||
- for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
|
||||
- value = rt2800_bbp_read(rt2x00dev, 0);
|
||||
- if ((value != 0xff) && (value != 0x00))
|
||||
- return 0;
|
||||
- udelay(REGISTER_BUSY_DELAY);
|
||||
- }
|
||||
-
|
||||
- rt2x00_err(rt2x00dev, "BBP register access failed, aborting\n");
|
||||
- return -EACCES;
|
||||
-}
|
||||
|
||||
static void rt2800_bbp4_mac_if_ctrl(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
@@ -9110,7 +9103,7 @@ int rt2800_enable_radio(struct rt2x00_de
|
||||
/*
|
||||
* Wait BBP/RF to wake up.
|
||||
*/
|
||||
- if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev)))
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY)))
|
||||
return -EIO;
|
||||
|
||||
/*
|
||||
@ -1,20 +1,48 @@
|
||||
From: =?UTF-8?q?Tomislav=20Po=C5=BEega?= <pozega.tomislav@gmail.com>
|
||||
Date: Mon, 8 Jan 2018 13:42:27 +0100
|
||||
Subject: [PATCH] rt2x00: add RF self TXDC calibration
|
||||
From patchwork Sat Sep 17 20:27:26 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979246
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:27:26 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 05/16] rt2x00: add RF self TXDC calibration for MT7620
|
||||
Message-ID:
|
||||
<dbb6e5a0c12d6101477bd09e83253091d21512c9.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
From: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
|
||||
Add TX self calibration based on mtk driver.
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 51 +++++++++++++++++++
|
||||
1 file changed, 51 insertions(+)
|
||||
v2: use ++i instead of i = i + 1 in loops
|
||||
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 48 +++++++++++++++++++
|
||||
1 file changed, 48 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -8438,6 +8438,56 @@ static void rt2800_init_rfcsr_5592(struc
|
||||
@@ -8428,6 +8428,53 @@ static void rt2800_init_rfcsr_5592(struc
|
||||
rt2800_led_open_drain_enable(rt2x00dev);
|
||||
}
|
||||
|
||||
@ -24,7 +52,6 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ u32 mac0518, mac051c, mac0528, mac052c;
|
||||
+ u8 i;
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "RF Tx self calibration start\n");
|
||||
+ mac0518 = rt2800_register_read(rt2x00dev, RF_CONTROL0);
|
||||
+ mac051c = rt2800_register_read(rt2x00dev, RF_BYPASS0);
|
||||
+ mac0528 = rt2800_register_read(rt2x00dev, RF_CONTROL2);
|
||||
@ -41,19 +68,19 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rfb7r1_org = rt2800_rfcsr_read_bank(rt2x00dev, 7, 1);
|
||||
+
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 5, 1, 0x4);
|
||||
+ for (i = 0; i < 100; i = i + 1) {
|
||||
+ udelay(50);
|
||||
+ for (i = 0; i < 100; ++i) {
|
||||
+ usleep_range(50, 100);
|
||||
+ rfvalue = rt2800_rfcsr_read_bank(rt2x00dev, 5, 1);
|
||||
+ if((rfvalue & 0x04) != 0x4)
|
||||
+ if ((rfvalue & 0x04) != 0x4)
|
||||
+ break;
|
||||
+ }
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 5, 1, rfb5r1_org);
|
||||
+
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 7, 1, 0x4);
|
||||
+ for (i = 0; i < 100; i = i + 1) {
|
||||
+ udelay(50);
|
||||
+ for (i = 0; i < 100; ++i) {
|
||||
+ usleep_range(50, 100);
|
||||
+ rfvalue = rt2800_rfcsr_read_bank(rt2x00dev, 7, 1);
|
||||
+ if((rfvalue & 0x04) != 0x4)
|
||||
+ if ((rfvalue & 0x04) != 0x4)
|
||||
+ break;
|
||||
+ }
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 7, 1, rfb7r1_org);
|
||||
@ -64,14 +91,12 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_register_write(rt2x00dev, RF_BYPASS0, mac051c);
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL2, mac0528);
|
||||
+ rt2800_register_write(rt2x00dev, RF_BYPASS2, mac052c);
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "RF Tx self calibration end\n");
|
||||
+}
|
||||
+
|
||||
static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
|
||||
bool set_bw, bool is_ht40)
|
||||
{
|
||||
@@ -9045,6 +9095,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -9035,6 +9082,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00);
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
|
||||
|
||||
@ -1,28 +1,68 @@
|
||||
From: =?UTF-8?q?Tomislav=20Po=C5=BEega?= <pozega.tomislav@gmail.com>
|
||||
Date: Mon, 8 Jan 2018 13:42:58 +0100
|
||||
Subject: [PATCH] rt2x00: add r calibration
|
||||
From patchwork Sat Sep 17 20:27:41 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979247
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:27:41 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 06/16] rt2x00: add r calibration for MT7620
|
||||
Message-ID:
|
||||
<e0c34f233089bec4eb73826bc4f512166ee25934.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
From: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
|
||||
Add r calibration code as found in mtk driver.
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 150 ++++++++++++++++++
|
||||
1 file changed, 150 insertions(+)
|
||||
v2: use rt2800_wait_bbp_rf_ready()
|
||||
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800.h | 2 +
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 133 ++++++++++++++++++
|
||||
2 files changed, 135 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h
|
||||
@@ -1016,6 +1016,8 @@
|
||||
*/
|
||||
#define MAC_STATUS_CFG 0x1200
|
||||
#define MAC_STATUS_CFG_BBP_RF_BUSY FIELD32(0x00000003)
|
||||
+#define MAC_STATUS_CFG_BBP_RF_BUSY_TX FIELD32(0x00000001)
|
||||
+#define MAC_STATUS_CFG_BBP_RF_BUSY_RX FIELD32(0x00000002)
|
||||
|
||||
/*
|
||||
* PWR_PIN_CFG:
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -8488,6 +8488,155 @@ static void rt2800_rf_self_txdc_cal(stru
|
||||
rt2x00_info(rt2x00dev, "RF Tx self calibration end\n");
|
||||
@@ -8475,6 +8475,138 @@ static void rt2800_rf_self_txdc_cal(stru
|
||||
rt2800_register_write(rt2x00dev, RF_BYPASS2, mac052c);
|
||||
}
|
||||
|
||||
+static int rt2800_calcrcalibrationcode(struct rt2x00_dev *rt2x00dev, int d1, int d2)
|
||||
+{
|
||||
+ int calcode;
|
||||
+ calcode = ((d2 - d1) * 1000) / 43;
|
||||
+ if ((calcode%10) >= 5)
|
||||
+ int calcode = ((d2 - d1) * 1000) / 43;
|
||||
+
|
||||
+ if ((calcode % 10) >= 5)
|
||||
+ calcode += 10;
|
||||
+ calcode = (calcode / 10);
|
||||
+
|
||||
@ -42,8 +82,7 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ char d1 = 0, d2 = 0;
|
||||
+ u8 rfvalue;
|
||||
+ u32 MAC_RF_BYPASS0, MAC_RF_CONTROL0, MAC_PWR_PIN_CFG;
|
||||
+ u32 maccfg, macstatus;
|
||||
+ int i;
|
||||
+ u32 maccfg;
|
||||
+
|
||||
+ saverfb0r1 = rt2800_rfcsr_read_bank(rt2x00dev, 0, 1);
|
||||
+ saverfb0r34 = rt2800_rfcsr_read_bank(rt2x00dev, 0, 34);
|
||||
@ -67,30 +106,14 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ maccfg &= (~0x04);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, maccfg);
|
||||
+
|
||||
+ for (i = 0; i < 10000; i++) {
|
||||
+ macstatus = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macstatus & 0x1)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (i == 10000)
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_TX)))
|
||||
+ rt2x00_warn(rt2x00dev, "Wait MAC Tx Status to MAX !!!\n");
|
||||
+
|
||||
+ maccfg = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ maccfg &= (~0x04);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, maccfg);
|
||||
+
|
||||
+ for (i = 0; i < 10000; i++) {
|
||||
+ macstatus = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macstatus & 0x2)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (i == 10000)
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_RX)))
|
||||
+ rt2x00_warn(rt2x00dev, "Wait MAC Rx Status to MAX !!!\n");
|
||||
+
|
||||
+ rfvalue = (MAC_RF_BYPASS0 | 0x3004);
|
||||
@ -112,7 +135,7 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 47, 0x04);
|
||||
+ rt2800_bbp_write(rt2x00dev, 22, 0x80);
|
||||
+ udelay(100);
|
||||
+ usleep_range(100, 200);
|
||||
+ bytevalue = rt2800_bbp_read(rt2x00dev, 49);
|
||||
+ if (bytevalue > 128)
|
||||
+ d1 = bytevalue - 256;
|
||||
@ -122,7 +145,7 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 0, 35, 0x01);
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 22, 0x80);
|
||||
+ udelay(100);
|
||||
+ usleep_range(100, 200);
|
||||
+ bytevalue = rt2800_bbp_read(rt2x00dev, 49);
|
||||
+ if (bytevalue > 128)
|
||||
+ d2 = bytevalue - 256;
|
||||
@ -170,7 +193,7 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
|
||||
bool set_bw, bool is_ht40)
|
||||
{
|
||||
@@ -9095,6 +9244,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -9082,6 +9214,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00);
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
|
||||
|
||||
@ -1,27 +1,54 @@
|
||||
From: =?UTF-8?q?Tomislav=20Po=C5=BEega?= <pozega.tomislav@gmail.com>
|
||||
Date: Mon, 8 Jan 2018 13:43:37 +0100
|
||||
Subject: [PATCH] rt2x00: add RXDCOC calibration
|
||||
From patchwork Sat Sep 17 20:27:56 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979248
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:27:56 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 07/16] rt2x00: add RXDCOC calibration for MT7620
|
||||
Message-ID:
|
||||
<850b30f652e88de30d79e968af4eb47aa5bc2511.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
From: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
|
||||
Add RXDCOC calibration code from mtk driver.
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
[fixed typo reported by Serge Vasilugin <vasilugin@yandex.ru>]
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 65 +++++++++++++++++++
|
||||
1 file changed, 65 insertions(+)
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 60 +++++++++++++++++++
|
||||
1 file changed, 60 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -8637,6 +8637,70 @@ static void rt2800_r_calibration(struct
|
||||
@@ -8607,6 +8607,65 @@ static void rt2800_r_calibration(struct
|
||||
rt2800_register_write(rt2x00dev, PWR_PIN_CFG, MAC_PWR_PIN_CFG);
|
||||
}
|
||||
|
||||
+static void rt2800_rxdcoc_calibration(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ u8 bbpreg = 0;
|
||||
+ u32 macvalue = 0, macvalue1 = 0;
|
||||
+ u32 macvalue = 0;
|
||||
+ u8 saverfb0r2, saverfb5r4, saverfb7r4, rfvalue;
|
||||
+ int i;
|
||||
+
|
||||
@ -38,15 +65,10 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, 0x8);
|
||||
+
|
||||
+ for (i = 0; i < 10000; i++) {
|
||||
+ macvalue1 = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macvalue1 & 0x1)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_TX)))
|
||||
+ rt2x00_warn(rt2x00dev, "RF TX busy in RX RXDCOC calibration\n");
|
||||
+
|
||||
+ saverfb5r4 = rt2800_rfcsr_read_bank(rt2x00dev, 5, 0);
|
||||
+ saverfb5r4 = rt2800_rfcsr_read_bank(rt2x00dev, 5, 4);
|
||||
+ saverfb7r4 = rt2800_rfcsr_read_bank(rt2x00dev, 7, 4);
|
||||
+ saverfb5r4 = saverfb5r4 & (~0x40);
|
||||
+ saverfb7r4 = saverfb7r4 & (~0x40);
|
||||
@ -63,9 +85,9 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+
|
||||
+ for (i = 0; i < 10000; i++) {
|
||||
+ bbpreg = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ if ((bbpreg & 0x40)==0)
|
||||
+ if ((bbpreg & 0x40) == 0)
|
||||
+ break;
|
||||
+ udelay(50);
|
||||
+ usleep_range(50, 100);
|
||||
+ }
|
||||
+
|
||||
+ bbpreg = rt2800_bbp_read(rt2x00dev, 159);
|
||||
@ -85,7 +107,7 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
|
||||
bool set_bw, bool is_ht40)
|
||||
{
|
||||
@@ -9246,6 +9310,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -9216,6 +9275,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
|
||||
rt2800_r_calibration(rt2x00dev);
|
||||
rt2800_rf_self_txdc_cal(rt2x00dev);
|
||||
@ -1,32 +1,62 @@
|
||||
From: =?UTF-8?q?Tomislav=20Po=C5=BEega?= <pozega.tomislav@gmail.com>
|
||||
Date: Mon, 8 Jan 2018 13:43:56 +0100
|
||||
Subject: [PATCH] rt2x00: add RXIQ calibration
|
||||
From patchwork Sat Sep 17 20:28:10 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979249
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:28:10 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 08/16] rt2x00: add RXIQ calibration for MT7620
|
||||
Message-ID:
|
||||
<033a39a697d51f6df258acea4c33608e0944fe4c.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
From: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
|
||||
Add RXIQ calibration found in mtk driver. With old openwrt builds this
|
||||
gets us ~8Mbps more of RX bandwidth (test with iPA/eLNA layout).
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 379 ++++++++++++++++++
|
||||
1 file changed, 379 insertions(+)
|
||||
v2: use rt2800_wait_bbp_rf_ready(), fix indentation
|
||||
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 375 ++++++++++++++++++
|
||||
1 file changed, 375 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -8701,6 +8701,384 @@ static void rt2800_rxdcoc_calibration(st
|
||||
@@ -8666,6 +8666,380 @@ static void rt2800_rxdcoc_calibration(st
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 0, 2, saverfb0r2);
|
||||
}
|
||||
|
||||
+static u32 rt2800_do_sqrt_accumulation(u32 si) {
|
||||
+static u32 rt2800_do_sqrt_accumulation(u32 si)
|
||||
+{
|
||||
+ u32 root, root_pre, bit;
|
||||
+ char i;
|
||||
+
|
||||
+ bit = 1 << 15;
|
||||
+ root = 0;
|
||||
+ for (i = 15; i >= 0; i = i - 1) {
|
||||
+ root_pre = root + bit;
|
||||
+ if ((root_pre*root_pre) <= si)
|
||||
+ if ((root_pre * root_pre) <= si)
|
||||
+ root = root_pre;
|
||||
+ bit = bit >> 1;
|
||||
+ }
|
||||
@ -34,7 +64,8 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ return root;
|
||||
+}
|
||||
+
|
||||
+static void rt2800_rxiq_calibration(struct rt2x00_dev *rt2x00dev) {
|
||||
+static void rt2800_rxiq_calibration(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ u8 rfb0r1, rfb0r2, rfb0r42;
|
||||
+ u8 rfb4r0, rfb4r19;
|
||||
+ u8 rfb5r3, rfb5r4, rfb5r17, rfb5r18, rfb5r19, rfb5r20;
|
||||
@ -58,8 +89,8 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ u32 orig_RF_BYPASS1 = 0;
|
||||
+ u32 orig_RF_CONTROL3 = 0;
|
||||
+ u32 orig_RF_BYPASS3 = 0;
|
||||
+ u32 macstatus, bbpval1 = 0;
|
||||
+ u8 rf_vga_table[] = {0x20, 0x21, 0x22, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f};
|
||||
+ u32 bbpval1 = 0;
|
||||
+ static const u8 rf_vga_table[] = {0x20, 0x21, 0x22, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f};
|
||||
+
|
||||
+ savemacsysctrl = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ orig_RF_CONTROL0 = rt2800_register_read(rt2x00dev, RF_CONTROL0);
|
||||
@ -74,16 +105,8 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, 0x0);
|
||||
+
|
||||
+ for (i = 0; i < 10000; i++) {
|
||||
+ macstatus = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macstatus & 0x3)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (i == 10000)
|
||||
+ rt2x00_warn(rt2x00dev, "Wait MAC Status to MAX !!!\n");
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY)))
|
||||
+ rt2x00_warn(rt2x00dev, "Timeout waiting for MAC status in RXIQ calibration\n");
|
||||
+
|
||||
+ bbpval = bbp4 & (~0x18);
|
||||
+ bbpval = bbp4 | 0x00;
|
||||
@ -180,7 +203,7 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL0, 0x00001006);
|
||||
+ udelay(1);
|
||||
+
|
||||
+ bbpval = bbp1 & (~ 0x18);
|
||||
+ bbpval = bbp1 & (~0x18);
|
||||
+ bbpval = bbpval | 0x00;
|
||||
+ rt2800_bbp_write(rt2x00dev, 1, bbpval);
|
||||
+
|
||||
@ -199,132 +222,133 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL0, 0x00002006);
|
||||
+ udelay(1);
|
||||
+
|
||||
+ bbpval = bbp1 & (~ 0x18);
|
||||
+ bbpval = bbp1 & (~0x18);
|
||||
+ bbpval = bbpval | 0x08;
|
||||
+ rt2800_bbp_write(rt2x00dev, 1, bbpval);
|
||||
+
|
||||
+ rt2800_bbp_dcoc_write(rt2x00dev, 1, 0x01);
|
||||
+ }
|
||||
+ udelay(500);
|
||||
+ usleep_range(500, 1500);
|
||||
+
|
||||
+ vga_idx = 0;
|
||||
+ while (vga_idx < 11) {
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 3, rf_vga_table[vga_idx]);
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 4, rf_vga_table[vga_idx]);
|
||||
+ while (vga_idx < 11) {
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 3, rf_vga_table[vga_idx]);
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 4, rf_vga_table[vga_idx]);
|
||||
+
|
||||
+ rt2800_bbp_dcoc_write(rt2x00dev, 0, 0x93);
|
||||
+ rt2800_bbp_dcoc_write(rt2x00dev, 0, 0x93);
|
||||
+
|
||||
+ for (i = 0; i < 10000; i++) {
|
||||
+ bbpval = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ if ((bbpval & 0xff) == 0x93)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if ((bbpval & 0xff) == 0x93) {
|
||||
+ rt2x00_warn(rt2x00dev, "Fatal Error: Calibration doesn't finish");
|
||||
+ goto restore_value;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < 5; i++) {
|
||||
+ u32 bbptemp = 0;
|
||||
+ u8 value = 0;
|
||||
+ int result = 0;
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x1e);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, i);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x22);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + (value << 24);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x21);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + (value << 16);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x20);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + (value << 8);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x1f);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + value;
|
||||
+
|
||||
+ if ((i < 2) && (bbptemp & 0x800000))
|
||||
+ result = (bbptemp & 0xffffff) - 0x1000000;
|
||||
+ else if (i == 4)
|
||||
+ result = bbptemp;
|
||||
+ else
|
||||
+ result = bbptemp;
|
||||
+
|
||||
+ if (i == 0)
|
||||
+ mi = result/4096;
|
||||
+ else if (i == 1)
|
||||
+ mq = result/4096;
|
||||
+ else if (i == 2)
|
||||
+ si = bbptemp/4096;
|
||||
+ else if (i == 3)
|
||||
+ sq = bbptemp/4096;
|
||||
+ else
|
||||
+ riq = result/4096;
|
||||
+ }
|
||||
+
|
||||
+ bbpval1 = si - mi*mi;
|
||||
+ rt2x00_dbg(rt2x00dev, "RXIQ si=%d, sq=%d, riq=%d, bbpval %d, vga_idx %d", si, sq, riq, bbpval1, vga_idx);
|
||||
+
|
||||
+ if (bbpval1 >= (100*100))
|
||||
+ break;
|
||||
+
|
||||
+ if (bbpval1 <= 100)
|
||||
+ vga_idx = vga_idx + 9;
|
||||
+ else if (bbpval1 <= 158)
|
||||
+ vga_idx = vga_idx + 8;
|
||||
+ else if (bbpval1 <= 251)
|
||||
+ vga_idx = vga_idx + 7;
|
||||
+ else if (bbpval1 <= 398)
|
||||
+ vga_idx = vga_idx + 6;
|
||||
+ else if (bbpval1 <= 630)
|
||||
+ vga_idx = vga_idx + 5;
|
||||
+ else if (bbpval1 <= 1000)
|
||||
+ vga_idx = vga_idx + 4;
|
||||
+ else if (bbpval1 <= 1584)
|
||||
+ vga_idx = vga_idx + 3;
|
||||
+ else if (bbpval1 <= 2511)
|
||||
+ vga_idx = vga_idx + 2;
|
||||
+ for (i = 0; i < 10000; i++) {
|
||||
+ bbpval = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ if ((bbpval & 0xff) == 0x93)
|
||||
+ usleep_range(50, 100);
|
||||
+ else
|
||||
+ vga_idx = vga_idx + 1;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if ((bbpval & 0xff) == 0x93) {
|
||||
+ rt2x00_warn(rt2x00dev, "Fatal Error: Calibration doesn't finish");
|
||||
+ goto restore_value;
|
||||
+ }
|
||||
+ for (i = 0; i < 5; i++) {
|
||||
+ u32 bbptemp = 0;
|
||||
+ u8 value = 0;
|
||||
+ int result = 0;
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x1e);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, i);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x22);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + (value << 24);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x21);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + (value << 16);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x20);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + (value << 8);
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x1f);
|
||||
+ value = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbptemp = bbptemp + value;
|
||||
+
|
||||
+ if (i < 2 && (bbptemp & 0x800000))
|
||||
+ result = (bbptemp & 0xffffff) - 0x1000000;
|
||||
+ else if (i == 4)
|
||||
+ result = bbptemp;
|
||||
+ else
|
||||
+ result = bbptemp;
|
||||
+
|
||||
+ if (i == 0)
|
||||
+ mi = result / 4096;
|
||||
+ else if (i == 1)
|
||||
+ mq = result / 4096;
|
||||
+ else if (i == 2)
|
||||
+ si = bbptemp / 4096;
|
||||
+ else if (i == 3)
|
||||
+ sq = bbptemp / 4096;
|
||||
+ else
|
||||
+ riq = result / 4096;
|
||||
+ }
|
||||
+
|
||||
+ sigma_i = rt2800_do_sqrt_accumulation(100*(si - mi*mi));
|
||||
+ sigma_q = rt2800_do_sqrt_accumulation(100*(sq - mq*mq));
|
||||
+ r_iq = 10*(riq-(mi*mq));
|
||||
+ bbpval1 = si - mi * mi;
|
||||
+ rt2x00_dbg(rt2x00dev,
|
||||
+ "RXIQ si=%d, sq=%d, riq=%d, bbpval %d, vga_idx %d",
|
||||
+ si, sq, riq, bbpval1, vga_idx);
|
||||
+
|
||||
+ if (bbpval1 >= (100 * 100))
|
||||
+ break;
|
||||
+
|
||||
+ if (bbpval1 <= 100)
|
||||
+ vga_idx = vga_idx + 9;
|
||||
+ else if (bbpval1 <= 158)
|
||||
+ vga_idx = vga_idx + 8;
|
||||
+ else if (bbpval1 <= 251)
|
||||
+ vga_idx = vga_idx + 7;
|
||||
+ else if (bbpval1 <= 398)
|
||||
+ vga_idx = vga_idx + 6;
|
||||
+ else if (bbpval1 <= 630)
|
||||
+ vga_idx = vga_idx + 5;
|
||||
+ else if (bbpval1 <= 1000)
|
||||
+ vga_idx = vga_idx + 4;
|
||||
+ else if (bbpval1 <= 1584)
|
||||
+ vga_idx = vga_idx + 3;
|
||||
+ else if (bbpval1 <= 2511)
|
||||
+ vga_idx = vga_idx + 2;
|
||||
+ else
|
||||
+ vga_idx = vga_idx + 1;
|
||||
+ }
|
||||
+
|
||||
+ sigma_i = rt2800_do_sqrt_accumulation(100 * (si - mi * mi));
|
||||
+ sigma_q = rt2800_do_sqrt_accumulation(100 * (sq - mq * mq));
|
||||
+ r_iq = 10 * (riq - (mi * mq));
|
||||
+
|
||||
+ rt2x00_dbg(rt2x00dev, "Sigma_i=%d, Sigma_q=%d, R_iq=%d", sigma_i, sigma_q, r_iq);
|
||||
+
|
||||
+ if (((sigma_i <= 1400 ) && (sigma_i >= 1000))
|
||||
+ && ((sigma_i - sigma_q) <= 112)
|
||||
+ && ((sigma_i - sigma_q) >= -112)
|
||||
+ && ((mi <= 32) && (mi >= -32))
|
||||
+ && ((mq <= 32) && (mq >= -32))) {
|
||||
+ r_iq = 10*(riq-(mi*mq));
|
||||
+ rt2x00_dbg(rt2x00dev, "RXIQ Sigma_i=%d, Sigma_q=%d, R_iq=%d\n", sigma_i, sigma_q, r_iq);
|
||||
+ if (sigma_i <= 1400 && sigma_i >= 1000 &&
|
||||
+ (sigma_i - sigma_q) <= 112 &&
|
||||
+ (sigma_i - sigma_q) >= -112 &&
|
||||
+ mi <= 32 && mi >= -32 &&
|
||||
+ mq <= 32 && mq >= -32) {
|
||||
+ r_iq = 10 * (riq - (mi * mq));
|
||||
+ rt2x00_dbg(rt2x00dev, "RXIQ Sigma_i=%d, Sigma_q=%d, R_iq=%d\n",
|
||||
+ sigma_i, sigma_q, r_iq);
|
||||
+
|
||||
+ g_rx = (1000 * sigma_q) / sigma_i;
|
||||
+ g_imb = ((-2) * 128 * (1000 - g_rx)) / (1000 + g_rx);
|
||||
+ ph_rx = (r_iq * 2292) / (sigma_i * sigma_q);
|
||||
+ rt2x00_info(rt2x00dev, "RXIQ G_imb=%d, Ph_rx=%d\n", g_imb, ph_rx);
|
||||
+ g_rx = (1000 * sigma_q) / sigma_i;
|
||||
+ g_imb = ((-2) * 128 * (1000 - g_rx)) / (1000 + g_rx);
|
||||
+ ph_rx = (r_iq * 2292) / (sigma_i * sigma_q);
|
||||
+
|
||||
+ if ((ph_rx > 20) || (ph_rx < -20)) {
|
||||
+ ph_rx = 0;
|
||||
+ rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL");
|
||||
+ }
|
||||
+
|
||||
+ if ((g_imb > 12) || (g_imb < -12)) {
|
||||
+ g_imb = 0;
|
||||
+ rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL");
|
||||
+ }
|
||||
+ if (ph_rx > 20 || ph_rx < -20) {
|
||||
+ ph_rx = 0;
|
||||
+ rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL");
|
||||
+ }
|
||||
+ else {
|
||||
+
|
||||
+ if (g_imb > 12 || g_imb < -12) {
|
||||
+ g_imb = 0;
|
||||
+ rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL");
|
||||
+ }
|
||||
+ } else {
|
||||
+ g_imb = 0;
|
||||
+ ph_rx = 0;
|
||||
+ rt2x00_dbg(rt2x00dev, "RXIQ Sigma_i=%d, Sigma_q=%d, R_iq=%d\n", sigma_i, sigma_q, r_iq);
|
||||
+ rt2x00_dbg(rt2x00dev, "RXIQ Sigma_i=%d, Sigma_q=%d, R_iq=%d\n",
|
||||
+ sigma_i, sigma_q, r_iq);
|
||||
+ rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL");
|
||||
+ }
|
||||
+
|
||||
@ -400,7 +424,7 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
|
||||
bool set_bw, bool is_ht40)
|
||||
{
|
||||
@@ -9313,6 +9691,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -9278,6 +9652,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rxdcoc_calibration(rt2x00dev);
|
||||
rt2800_bw_filter_calibration(rt2x00dev, true);
|
||||
rt2800_bw_filter_calibration(rt2x00dev, false);
|
||||
@ -0,0 +1,52 @@
|
||||
From patchwork Sat Sep 17 20:28:29 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979250
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:28:29 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 09/16] rt2x00: don't run Rt5592 IQ calibration on MT7620
|
||||
Message-ID:
|
||||
<31a1c34ddbd296b82f38c18c9ae7339059215fdc.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
The function rt2800_iq_calibrate is intended for Rt5592 only.
|
||||
Don't call it for MT7620 which has it's own calibration functions.
|
||||
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
v2: test for RT5592 instead of !RT6352
|
||||
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -4398,7 +4398,8 @@ static void rt2800_config_channel(struct
|
||||
reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2*rt2x00dev->lna_gain;
|
||||
rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
|
||||
|
||||
- rt2800_iq_calibrate(rt2x00dev, rf->channel);
|
||||
+ if (rt2x00_rt(rt2x00dev, RT5592))
|
||||
+ rt2800_iq_calibrate(rt2x00dev, rf->channel);
|
||||
}
|
||||
|
||||
if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
@ -1,25 +1,56 @@
|
||||
From: =?UTF-8?q?Tomislav=20Po=C5=BEega?= <pozega.tomislav@gmail.com>
|
||||
Date: Thu, 11 Jan 2018 19:53:49 +0100
|
||||
Subject: [PATCH] rt2x00: add TX LOFT calibration
|
||||
From patchwork Sat Sep 17 20:28:43 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979251
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:28:43 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 10/16] rt2x00: add TX LOFT calibration for MT7620
|
||||
Message-ID:
|
||||
<d9295a9138a1f552b648aacb84e1419d38f5c896.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
From: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
|
||||
Add TX LOFT calibration from mtk driver.
|
||||
|
||||
Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 938 ++++++++++++++++++
|
||||
v2: use helper functions, make tables static const, remove useless
|
||||
debug prints
|
||||
v3: don't export function not used anywhere else
|
||||
Reported-by: kernel test robot <lkp@intel.com>
|
||||
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 902 ++++++++++++++++++
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.h | 10 +
|
||||
2 files changed, 948 insertions(+)
|
||||
2 files changed, 912 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -9079,6 +9079,943 @@ restore_value:
|
||||
@@ -9041,6 +9041,907 @@ restore_value:
|
||||
rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, savemacsysctrl);
|
||||
}
|
||||
|
||||
+static void rt2800_rf_configstore(struct rt2x00_dev *rt2x00dev, rf_reg_pair rf_reg_record[][13], u8 chain)
|
||||
+static void rt2800_rf_configstore(struct rt2x00_dev *rt2x00dev,
|
||||
+ struct rf_reg_pair rf_reg_record[][13], u8 chain)
|
||||
+{
|
||||
+ u8 rfvalue = 0;
|
||||
+
|
||||
@ -131,13 +162,11 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rf_reg_record[CHAIN_1][12].value = rfvalue;
|
||||
+ } else {
|
||||
+ rt2x00_warn(rt2x00dev, "Unknown chain = %u\n", chain);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static void rt2800_rf_configrecover(struct rt2x00_dev *rt2x00dev, rf_reg_pair rf_record[][13])
|
||||
+static void rt2800_rf_configrecover(struct rt2x00_dev *rt2x00dev,
|
||||
+ struct rf_reg_pair rf_record[][13])
|
||||
+{
|
||||
+ u8 chain_index = 0, record_index = 0;
|
||||
+ u8 bank = 0, rf_register = 0, value = 0;
|
||||
@ -148,11 +177,10 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rf_register = rf_record[chain_index][record_index].reg;
|
||||
+ value = rf_record[chain_index][record_index].value;
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, bank, rf_register, value);
|
||||
+ rt2x00_dbg(rt2x00dev, "bank: %d, rf_register: %d, value: %x\n", bank, rf_register, value);
|
||||
+ rt2x00_dbg(rt2x00dev, "bank: %d, rf_register: %d, value: %x\n",
|
||||
+ bank, rf_register, value);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static void rt2800_setbbptonegenerator(struct rt2x00_dev *rt2x00dev)
|
||||
@ -170,15 +198,13 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, 0x3F);
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 244, 0x40);
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static u32 rt2800_do_fft_accumulation(struct rt2x00_dev *rt2x00dev, u8 tidx, u8 read_neg)
|
||||
+{
|
||||
+ u32 macvalue = 0;
|
||||
+ int fftout_i = 0, fftout_q = 0;
|
||||
+ u32 ptmp=0, pint = 0;
|
||||
+ u32 ptmp = 0, pint = 0;
|
||||
+ u8 bbp = 0;
|
||||
+ u8 tidxi;
|
||||
+
|
||||
@ -188,7 +214,7 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ bbp = 0x9b;
|
||||
+
|
||||
+ while (bbp == 0x9b) {
|
||||
+ udelay(10);
|
||||
+ usleep_range(10, 50);
|
||||
+ bbp = rt2800_bbp_read(rt2x00dev, 159);
|
||||
+ bbp = bbp & 0xff;
|
||||
+ }
|
||||
@ -233,10 +259,11 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ return pint;
|
||||
+}
|
||||
+
|
||||
+static u32 rt2800_read_fft_accumulation(struct rt2x00_dev *rt2x00dev, u8 tidx) {
|
||||
+static u32 rt2800_read_fft_accumulation(struct rt2x00_dev *rt2x00dev, u8 tidx)
|
||||
+{
|
||||
+ u32 macvalue = 0;
|
||||
+ int fftout_i = 0, fftout_q = 0;
|
||||
+ u32 ptmp=0, pint = 0;
|
||||
+ u32 ptmp = 0, pint = 0;
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0xBA);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, tidx);
|
||||
@ -252,7 +279,6 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ ptmp = (fftout_i * fftout_i);
|
||||
+ ptmp = ptmp + (fftout_q * fftout_q);
|
||||
+ pint = ptmp;
|
||||
+ rt2x00_info(rt2x00dev, "I = %d, Q = %d, power = %x\n", fftout_i, fftout_q, pint);
|
||||
+
|
||||
+ return pint;
|
||||
+}
|
||||
@ -266,18 +292,17 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, bbp);
|
||||
+
|
||||
+ if (ch_idx == 0)
|
||||
+ bbp = (iorq == 0) ? 0xb1: 0xb2;
|
||||
+ bbp = (iorq == 0) ? 0xb1 : 0xb2;
|
||||
+ else
|
||||
+ bbp = (iorq == 0) ? 0xb8: 0xb9;
|
||||
+ bbp = (iorq == 0) ? 0xb8 : 0xb9;
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, bbp);
|
||||
+ bbp = dc;
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, bbp);
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static void rt2800_loft_search(struct rt2x00_dev *rt2x00dev, u8 ch_idx, u8 alc_idx, u8 dc_result[][RF_ALC_NUM][2])
|
||||
+static void rt2800_loft_search(struct rt2x00_dev *rt2x00dev, u8 ch_idx,
|
||||
+ u8 alc_idx, u8 dc_result[][RF_ALC_NUM][2])
|
||||
+{
|
||||
+ u32 p0 = 0, p1 = 0, pf = 0;
|
||||
+ char idx0 = 0, idx1 = 0;
|
||||
@ -291,8 +316,6 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+
|
||||
+ for (bidx = 5; bidx >= 0; bidx--) {
|
||||
+ for (iorq = 0; iorq <= 1; iorq++) {
|
||||
+ rt2x00_dbg(rt2x00dev, "\n========================================================\n");
|
||||
+
|
||||
+ if (idxf[iorq] == 0x20) {
|
||||
+ idx0 = 0x20;
|
||||
+ p0 = pf;
|
||||
@ -303,16 +326,17 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ p0 = rt2800_do_fft_accumulation(rt2x00dev, 0x0A, 0);
|
||||
+ }
|
||||
+
|
||||
+ idx1 = idxf[iorq] + ((bidx == 5) ? 0 : ibit);
|
||||
+ idx1 = idxf[iorq] + (bidx == 5 ? 0 : ibit);
|
||||
+ idx1 = idx1 & 0x3F;
|
||||
+ rt2800_write_dc(rt2x00dev, ch_idx, 0, iorq, idx1);
|
||||
+ p1 = rt2800_do_fft_accumulation(rt2x00dev, 0x0A, 0);
|
||||
+
|
||||
+ rt2x00_dbg(rt2x00dev, "alc=%u, IorQ=%u, idx_final=%2x\n", alc_idx, iorq, idxf[iorq]);
|
||||
+ rt2x00_dbg(rt2x00dev, "p0=%x, p1=%x, pf=%x, idx_0=%x, idx_1=%x, ibit=%x !\n", p0, p1, pf, idx0, idx1, ibit);
|
||||
+ rt2x00_dbg(rt2x00dev, "alc=%u, IorQ=%u, idx_final=%2x\n",
|
||||
+ alc_idx, iorq, idxf[iorq]);
|
||||
+ rt2x00_dbg(rt2x00dev, "p0=%x, p1=%x, pf=%x, idx_0=%x, idx_1=%x, ibit=%x\n",
|
||||
+ p0, p1, pf, idx0, idx1, ibit);
|
||||
+
|
||||
+ if ((bidx != 5) && (pf <= p0) && (pf < p1)) {
|
||||
+ pf = pf;
|
||||
+ if (bidx != 5 && pf <= p0 && pf < p1) {
|
||||
+ idxf[iorq] = idxf[iorq];
|
||||
+ } else if (p0 < p1) {
|
||||
+ pf = p0;
|
||||
@ -321,17 +345,15 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ pf = p1;
|
||||
+ idxf[iorq] = idx1 & 0x3F;
|
||||
+ }
|
||||
+ rt2x00_dbg(rt2x00dev, "IorQ=%u, idx_final[%u]:%x, pf:%8x\n", iorq, iorq, idxf[iorq], pf);
|
||||
+ rt2x00_dbg(rt2x00dev, "IorQ=%u, idx_final[%u]:%x, pf:%8x\n",
|
||||
+ iorq, iorq, idxf[iorq], pf);
|
||||
+
|
||||
+ rt2800_write_dc(rt2x00dev, ch_idx, 0, iorq, idxf[iorq]);
|
||||
+
|
||||
+ }
|
||||
+ ibit = ibit >> 1;
|
||||
+ }
|
||||
+ dc_result[ch_idx][alc_idx][0] = idxf[0];
|
||||
+ dc_result[ch_idx][alc_idx][1] = idxf[1];
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static void rt2800_iq_search(struct rt2x00_dev *rt2x00dev, u8 ch_idx, u8 *ges, u8 *pes)
|
||||
@ -349,26 +371,25 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ u8 bbp = 0;
|
||||
+ char bidx;
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "IQCalibration Start!\n");
|
||||
+ for (bidx = 5; bidx >= 1; bidx--) {
|
||||
+ for (gop = 0; gop < 2; gop++) {
|
||||
+ rt2x00_dbg(rt2x00dev, "\n========================================================\n");
|
||||
+
|
||||
+ if ((gop == 1) || (bidx < 4)) {
|
||||
+ if (gop == 1 || bidx < 4) {
|
||||
+ if (gop == 0)
|
||||
+ iq_err = gerr;
|
||||
+ else
|
||||
+ iq_err = perr;
|
||||
+
|
||||
+ first_search = (gop == 0) ? (bidx == 3) : (bidx == 5);
|
||||
+ touch_neg_max = (gop) ? ((iq_err & 0x0F) == 0x08) : ((iq_err & 0x3F) == 0x20);
|
||||
+ touch_neg_max = (gop) ? ((iq_err & 0x0F) == 0x08) :
|
||||
+ ((iq_err & 0x3F) == 0x20);
|
||||
+
|
||||
+ if (touch_neg_max) {
|
||||
+ p0 = pf;
|
||||
+ idx0 = iq_err;
|
||||
+ } else {
|
||||
+ idx0 = iq_err - ibit;
|
||||
+ bbp = (ch_idx == 0) ? ((gop == 0) ? 0x28 : 0x29): ((gop == 0) ? 0x46 : 0x47);
|
||||
+ bbp = (ch_idx == 0) ? ((gop == 0) ? 0x28 : 0x29) :
|
||||
+ ((gop == 0) ? 0x46 : 0x47);
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, bbp);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, idx0);
|
||||
@ -379,26 +400,30 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ idx1 = iq_err + (first_search ? 0 : ibit);
|
||||
+ idx1 = (gop == 0) ? (idx1 & 0x0F) : (idx1 & 0x3F);
|
||||
+
|
||||
+ bbp = (ch_idx == 0) ? (gop == 0) ? 0x28 : 0x29 : (gop == 0) ? 0x46 : 0x47;
|
||||
+ bbp = (ch_idx == 0) ? (gop == 0) ? 0x28 : 0x29 :
|
||||
+ (gop == 0) ? 0x46 : 0x47;
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, bbp);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, idx1);
|
||||
+
|
||||
+ p1 = rt2800_do_fft_accumulation(rt2x00dev, 0x14, 1);
|
||||
+
|
||||
+ rt2x00_dbg(rt2x00dev, "p0=%x, p1=%x, pwer_final=%x, idx0=%x, idx1=%x, iq_err=%x, gop=%d, ibit=%x !\n", p0, p1, pf, idx0, idx1, iq_err, gop, ibit);
|
||||
+ rt2x00_dbg(rt2x00dev,
|
||||
+ "p0=%x, p1=%x, pwer_final=%x, idx0=%x, idx1=%x, iq_err=%x, gop=%d, ibit=%x\n",
|
||||
+ p0, p1, pf, idx0, idx1, iq_err, gop, ibit);
|
||||
+
|
||||
+ if ((!first_search) && (pf <= p0) && (pf < p1)) {
|
||||
+ pf = pf;
|
||||
+ } else if (p0 < p1) {
|
||||
+ pf = p0;
|
||||
+ iq_err = idx0;
|
||||
+ } else {
|
||||
+ pf = p1;
|
||||
+ iq_err = idx1;
|
||||
+ if (!(!first_search && pf <= p0 && pf < p1)) {
|
||||
+ if (p0 < p1) {
|
||||
+ pf = p0;
|
||||
+ iq_err = idx0;
|
||||
+ } else {
|
||||
+ pf = p1;
|
||||
+ iq_err = idx1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ bbp = (ch_idx == 0) ? (gop == 0) ? 0x28 : 0x29 : (gop == 0) ? 0x46 : 0x47;
|
||||
+ bbp = (ch_idx == 0) ? (gop == 0) ? 0x28 : 0x29 :
|
||||
+ (gop == 0) ? 0x46 : 0x47;
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, bbp);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, iq_err);
|
||||
@ -408,8 +433,8 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ else
|
||||
+ perr = iq_err;
|
||||
+
|
||||
+ rt2x00_dbg(rt2x00dev, "IQCalibration pf=%8x (%2x, %2x) !\n", pf, gerr & 0x0F, perr & 0x3F);
|
||||
+
|
||||
+ rt2x00_dbg(rt2x00dev, "IQCalibration pf=%8x (%2x, %2x) !\n",
|
||||
+ pf, gerr & 0x0F, perr & 0x3F);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@ -438,25 +463,21 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, pef & 0x3F);
|
||||
+
|
||||
+ p1 = rt2800_do_fft_accumulation(rt2x00dev, 0x14, 1);
|
||||
+ if ((gef == gsta) && (pef == psta)) {
|
||||
+ if (gef == gsta && pef == psta) {
|
||||
+ pf = p1;
|
||||
+ gerr = gef;
|
||||
+ perr = pef;
|
||||
+ } else if (pf > p1) {
|
||||
+ pf = p1;
|
||||
+ gerr = gef;
|
||||
+ perr = pef;
|
||||
+ }
|
||||
+ else if (pf > p1){
|
||||
+ pf = p1;
|
||||
+ gerr = gef;
|
||||
+ perr = pef;
|
||||
+ }
|
||||
+ rt2x00_dbg(rt2x00dev, "Fine IQCalibration p1=%8x pf=%8x (%2x, %2x) !\n", p1, pf, gef & 0x0F, pef & 0x3F);
|
||||
+ rt2x00_dbg(rt2x00dev, "Fine IQCalibration p1=%8x pf=%8x (%2x, %2x) !\n",
|
||||
+ p1, pf, gef & 0x0F, pef & 0x3F);
|
||||
+ }
|
||||
+
|
||||
+ ges[ch_idx] = gerr & 0x0F;
|
||||
+ pes[ch_idx] = perr & 0x3F;
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "IQCalibration Done! CH = %u, (gain=%2x, phase=%2x)\n", ch_idx, gerr & 0x0F, perr & 0x3F);
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static void rt2800_rf_aux_tx0_loopback(struct rt2x00_dev *rt2x00dev)
|
||||
@ -493,9 +514,9 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 7, 20, 0x20);
|
||||
+}
|
||||
+
|
||||
+void rt2800_loft_iq_calibration(struct rt2x00_dev *rt2x00dev)
|
||||
+static void rt2800_loft_iq_calibration(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ rf_reg_pair rf_store[CHAIN_NUM][13];
|
||||
+ struct rf_reg_pair rf_store[CHAIN_NUM][13];
|
||||
+ u32 macorg1 = 0;
|
||||
+ u32 macorg2 = 0;
|
||||
+ u32 macorg3 = 0;
|
||||
@ -504,7 +525,7 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ u32 orig528 = 0;
|
||||
+ u32 orig52c = 0;
|
||||
+
|
||||
+ u32 savemacsysctrl = 0, mtxcycle = 0;
|
||||
+ u32 savemacsysctrl = 0;
|
||||
+ u32 macvalue = 0;
|
||||
+ u32 mac13b8 = 0;
|
||||
+ u32 p0 = 0, p1 = 0;
|
||||
@ -513,11 +534,8 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ u8 rfvalue;
|
||||
+ u8 loft_dc_search_result[CHAIN_NUM][RF_ALC_NUM][2];
|
||||
+ u8 ger[CHAIN_NUM], per[CHAIN_NUM];
|
||||
+ u8 rf_gain[] = {0x00, 0x01, 0x02, 0x04, 0x08, 0x0c};
|
||||
+ u8 rfvga_gain_table[] = {0x24, 0x25, 0x26, 0x27, 0x28, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3F};
|
||||
+
|
||||
+ u8 vga_gain[] = {14, 14};
|
||||
+ u8 bbp_2324gain[] = {0x16, 0x14, 0x12, 0x10, 0x0c, 0x08};
|
||||
+ u8 bbp = 0, ch_idx = 0, rf_alc_idx = 0, idx = 0;
|
||||
+ u8 bbpr30, rfb0r39, rfb0r42;
|
||||
+ u8 bbpr1;
|
||||
@ -525,6 +543,11 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ u8 bbpr241, bbpr242;
|
||||
+ u8 count_step;
|
||||
+
|
||||
+ static const u8 rf_gain[] = {0x00, 0x01, 0x02, 0x04, 0x08, 0x0c};
|
||||
+ static const u8 rfvga_gain_table[] = {0x24, 0x25, 0x26, 0x27, 0x28, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
|
||||
+ 0x31, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3F};
|
||||
+ static const u8 bbp_2324gain[] = {0x16, 0x14, 0x12, 0x10, 0x0c, 0x08};
|
||||
+
|
||||
+ savemacsysctrl = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ macorg1 = rt2800_register_read(rt2x00dev, TX_PIN_CFG);
|
||||
+ macorg2 = rt2800_register_read(rt2x00dev, RF_CONTROL0);
|
||||
@ -539,29 +562,18 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ macvalue &= (~0x04);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, macvalue);
|
||||
+
|
||||
+ for (mtxcycle = 0; mtxcycle < 10000; mtxcycle++) {
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macvalue & 0x01)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_TX)))
|
||||
+ rt2x00_warn(rt2x00dev, "RF TX busy in LOFT IQ calibration\n");
|
||||
+
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ macvalue &= (~0x08);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, macvalue);
|
||||
+
|
||||
+ for (mtxcycle = 0; mtxcycle < 10000; mtxcycle++) {
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macvalue & 0x02)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_RX)))
|
||||
+ rt2x00_warn(rt2x00dev, "RF RX busy in LOFT IQ calibration\n");
|
||||
+
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx++) {
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx++)
|
||||
+ rt2800_rf_configstore(rt2x00dev, rf_store, ch_idx);
|
||||
+ }
|
||||
+
|
||||
+ bbpr30 = rt2800_bbp_read(rt2x00dev, 30);
|
||||
+ rfb0r39 = rt2800_rfcsr_read_bank(rt2x00dev, 0, 39);
|
||||
@ -576,7 +588,7 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+
|
||||
+ rt2800_setbbptonegenerator(rt2x00dev);
|
||||
+
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx ++) {
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx++) {
|
||||
+ rt2800_bbp_write(rt2x00dev, 23, 0x00);
|
||||
+ rt2800_bbp_write(rt2x00dev, 24, 0x00);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, 0x00);
|
||||
@ -586,18 +598,17 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_register_write(rt2x00dev, 0x13b8, 0x10);
|
||||
+ udelay(1);
|
||||
+
|
||||
+ if (ch_idx == 0) {
|
||||
+ if (ch_idx == 0)
|
||||
+ rt2800_rf_aux_tx0_loopback(rt2x00dev);
|
||||
+ } else {
|
||||
+ else
|
||||
+ rt2800_rf_aux_tx1_loopback(rt2x00dev);
|
||||
+ }
|
||||
+
|
||||
+ udelay(1);
|
||||
+
|
||||
+ if (ch_idx == 0) {
|
||||
+ if (ch_idx == 0)
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL0, 0x00001004);
|
||||
+ } else {
|
||||
+ else
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL0, 0x00002004);
|
||||
+ }
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0x05);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, 0x00);
|
||||
@ -623,7 +634,8 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+
|
||||
+ if (rf_alc_idx == 0) {
|
||||
+ rt2800_write_dc(rt2x00dev, ch_idx, 0, 1, 0x21);
|
||||
+ for (;vga_gain[ch_idx] > 0;vga_gain[ch_idx] = vga_gain[ch_idx] - 2) {
|
||||
+ for (; vga_gain[ch_idx] > 0;
|
||||
+ vga_gain[ch_idx] = vga_gain[ch_idx] - 2) {
|
||||
+ rfvalue = rfvga_gain_table[vga_gain[ch_idx]];
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 3, rfvalue);
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 4, rfvalue);
|
||||
@ -633,15 +645,15 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_write_dc(rt2x00dev, ch_idx, 0, 0, 0x21);
|
||||
+ p1 = rt2800_do_fft_accumulation(rt2x00dev, 0x0A, 0);
|
||||
+ rt2x00_dbg(rt2x00dev, "LOFT AGC %d %d\n", p0, p1);
|
||||
+ if ((p0 < 7000*7000) && (p1 < (7000*7000))) {
|
||||
+ if ((p0 < 7000 * 7000) && (p1 < (7000 * 7000)))
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ rt2800_write_dc(rt2x00dev, ch_idx, 0, 0, 0x00);
|
||||
+ rt2800_write_dc(rt2x00dev, ch_idx, 0, 1, 0x00);
|
||||
+
|
||||
+ rt2x00_dbg(rt2x00dev, "Used VGA %d %x\n",vga_gain[ch_idx], rfvga_gain_table[vga_gain[ch_idx]]);
|
||||
+ rt2x00_dbg(rt2x00dev, "Used VGA %d %x\n", vga_gain[ch_idx],
|
||||
+ rfvga_gain_table[vga_gain[ch_idx]]);
|
||||
+
|
||||
+ if (vga_gain[ch_idx] < 0)
|
||||
+ vga_gain[ch_idx] = 0;
|
||||
@ -659,7 +671,7 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ for (rf_alc_idx = 0; rf_alc_idx < 3; rf_alc_idx++) {
|
||||
+ for (idx = 0; idx < 4; idx++) {
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0xB0);
|
||||
+ bbp = (idx<<2) + rf_alc_idx;
|
||||
+ bbp = (idx << 2) + rf_alc_idx;
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, bbp);
|
||||
+ rt2x00_dbg(rt2x00dev, " ALC %2x,", bbp);
|
||||
+
|
||||
@ -720,8 +732,6 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_register_write(rt2x00dev, RF_BYPASS2, orig52c);
|
||||
+ rt2800_register_write(rt2x00dev, 0x13b8, mac13b8);
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "LOFT Calibration Done!\n");
|
||||
+
|
||||
+ savemacsysctrl = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ macorg1 = rt2800_register_read(rt2x00dev, TX_PIN_CFG);
|
||||
+ macorg2 = rt2800_register_read(rt2x00dev, RF_CONTROL0);
|
||||
@ -738,24 +748,16 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ macvalue &= (~0x04);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, macvalue);
|
||||
+ for (mtxcycle = 0; mtxcycle < 10000; mtxcycle++) {
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macvalue & 0x01)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_TX)))
|
||||
+ rt2x00_warn(rt2x00dev, "RF TX busy in LOFT IQ calibration\n");
|
||||
+
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
+ macvalue &= (~0x08);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, macvalue);
|
||||
+ for (mtxcycle = 0; mtxcycle < 10000; mtxcycle++) {
|
||||
+ macvalue = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG);
|
||||
+ if (macvalue & 0x02)
|
||||
+ udelay(50);
|
||||
+ else
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_RX)))
|
||||
+ rt2x00_warn(rt2x00dev, "RF RX busy in LOFT IQ calibration\n");
|
||||
+
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags)) {
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL3, 0x00000101);
|
||||
@ -791,9 +793,8 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+
|
||||
+ rt2800_register_write(rt2x00dev, 0x13b8, 0x00000010);
|
||||
+
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx++) {
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx++)
|
||||
+ rt2800_rf_configstore(rt2x00dev, rf_store, ch_idx);
|
||||
+ }
|
||||
+
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 3, 0x3B);
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 4, 0x3B);
|
||||
@ -803,7 +804,7 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, 0xB0);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, 0x80);
|
||||
+
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx ++) {
|
||||
+ for (ch_idx = 0; ch_idx < 2; ch_idx++) {
|
||||
+ rt2800_bbp_write(rt2x00dev, 23, 0x00);
|
||||
+ rt2800_bbp_write(rt2x00dev, 24, 0x00);
|
||||
+
|
||||
@ -846,7 +847,7 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ count_step = 2;
|
||||
+ }
|
||||
+
|
||||
+ for (;vga_gain[ch_idx] < 19; vga_gain[ch_idx]=(vga_gain[ch_idx] + count_step)) {
|
||||
+ for (; vga_gain[ch_idx] < 19; vga_gain[ch_idx] = (vga_gain[ch_idx] + count_step)) {
|
||||
+ rfvalue = rfvga_gain_table[vga_gain[ch_idx]];
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 3, rfvalue);
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 4, rfvalue);
|
||||
@ -855,37 +856,35 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, bbp);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, 0x00);
|
||||
+ p0 = rt2800_do_fft_accumulation(rt2x00dev, 0x14, 0);
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags)) {
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags))
|
||||
+ p0_idx10 = rt2800_read_fft_accumulation(rt2x00dev, 0x0A);
|
||||
+ }
|
||||
+
|
||||
+ bbp = (ch_idx == 0) ? 0x29 : 0x47;
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, bbp);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, 0x21);
|
||||
+ p1 = rt2800_do_fft_accumulation(rt2x00dev, 0x14, 0);
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX1, &rt2x00dev->cap_flags)) {
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX1, &rt2x00dev->cap_flags))
|
||||
+ p1_idx10 = rt2800_read_fft_accumulation(rt2x00dev, 0x0A);
|
||||
+ }
|
||||
+
|
||||
+ rt2x00_dbg(rt2x00dev, "IQ AGC %d %d\n", p0, p1);
|
||||
+
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags)) {
|
||||
+ rt2x00_dbg(rt2x00dev, "IQ AGC IDX 10 %d %d\n", p0_idx10, p1_idx10);
|
||||
+ if ((p0_idx10 > 7000*7000) || (p1_idx10 > 7000*7000)) {
|
||||
+ if (vga_gain[ch_idx]!=0)
|
||||
+ vga_gain[ch_idx] = vga_gain[ch_idx]-1;
|
||||
+ if ((p0_idx10 > 7000 * 7000) || (p1_idx10 > 7000 * 7000)) {
|
||||
+ if (vga_gain[ch_idx] != 0)
|
||||
+ vga_gain[ch_idx] = vga_gain[ch_idx] - 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if ((p0 > 2500*2500) || (p1 > 2500*2500)) {
|
||||
+ if ((p0 > 2500 * 2500) || (p1 > 2500 * 2500))
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (vga_gain[ch_idx] > 18)
|
||||
+ vga_gain[ch_idx] = 18;
|
||||
+ rt2x00_dbg(rt2x00dev, "Used VGA %d %x\n",vga_gain[ch_idx], rfvga_gain_table[vga_gain[ch_idx]]);
|
||||
+ rt2x00_dbg(rt2x00dev, "Used VGA %d %x\n", vga_gain[ch_idx],
|
||||
+ rfvga_gain_table[vga_gain[ch_idx]]);
|
||||
+
|
||||
+ bbp = (ch_idx == 0) ? 0x29 : 0x47;
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, bbp);
|
||||
@ -930,9 +929,8 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 0, 39, rfb0r39);
|
||||
+ rt2800_rfcsr_write_bank(rt2x00dev, 0, 42, rfb0r42);
|
||||
+
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags)) {
|
||||
+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags))
|
||||
+ rt2800_bbp_write(rt2x00dev, 4, bbpr4);
|
||||
+ }
|
||||
+
|
||||
+ rt2800_bbp_write(rt2x00dev, 21, 0x01);
|
||||
+ udelay(1);
|
||||
@ -950,16 +948,12 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+ rt2800_register_write(rt2x00dev, RF_BYPASS3, macorg5);
|
||||
+ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, savemacsysctrl);
|
||||
+ rt2800_register_write(rt2x00dev, 0x13b8, mac13b8);
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "TX IQ Calibration Done!\n");
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
|
||||
bool set_bw, bool is_ht40)
|
||||
{
|
||||
@@ -9691,6 +10628,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -9653,6 +10554,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rxdcoc_calibration(rt2x00dev);
|
||||
rt2800_bw_filter_calibration(rt2x00dev, true);
|
||||
rt2800_bw_filter_calibration(rt2x00dev, false);
|
||||
@ -978,11 +972,11 @@ Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
|
||||
+#define RF_ALC_NUM 6
|
||||
+#define CHAIN_NUM 2
|
||||
+
|
||||
+typedef struct rf_reg_pair {
|
||||
+struct rf_reg_pair {
|
||||
+ u8 bank;
|
||||
+ u8 reg;
|
||||
+ u8 value;
|
||||
+} rf_reg_pair;
|
||||
+};
|
||||
|
||||
/* RT2800 driver data structure */
|
||||
struct rt2800_drv_data {
|
||||
@ -0,0 +1,94 @@
|
||||
From patchwork Sat Sep 17 20:28:58 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979252
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:28:58 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 11/16] rt2x00: move helper functions up in file
|
||||
Message-ID:
|
||||
<c27baa8efd5c29e2bcb2432925d9cdc5c913a125.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Move register access helper functions up to the head of the file so
|
||||
they can be used in all functions.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 40 +++++++++----------
|
||||
1 file changed, 20 insertions(+), 20 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -198,6 +198,26 @@ static void rt2800_rfcsr_write_dccal(str
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 7, reg, value);
|
||||
}
|
||||
|
||||
+static void rt2800_bbp_dcoc_write(struct rt2x00_dev *rt2x00dev,
|
||||
+ const u8 reg, const u8 value)
|
||||
+{
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, reg);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, value);
|
||||
+}
|
||||
+
|
||||
+static u8 rt2800_bbp_dcoc_read(struct rt2x00_dev *rt2x00dev, const u8 reg)
|
||||
+{
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, reg);
|
||||
+ return rt2800_bbp_read(rt2x00dev, 159);
|
||||
+}
|
||||
+
|
||||
+static void rt2800_bbp_glrt_write(struct rt2x00_dev *rt2x00dev,
|
||||
+ const u8 reg, const u8 value)
|
||||
+{
|
||||
+ rt2800_bbp_write(rt2x00dev, 195, reg);
|
||||
+ rt2800_bbp_write(rt2x00dev, 196, value);
|
||||
+}
|
||||
+
|
||||
static u8 rt2800_rfcsr_read(struct rt2x00_dev *rt2x00dev,
|
||||
const unsigned int word)
|
||||
{
|
||||
@@ -6947,26 +6967,6 @@ static void rt2800_init_bbp_5592(struct
|
||||
rt2800_bbp_write(rt2x00dev, 103, 0xc0);
|
||||
}
|
||||
|
||||
-static void rt2800_bbp_glrt_write(struct rt2x00_dev *rt2x00dev,
|
||||
- const u8 reg, const u8 value)
|
||||
-{
|
||||
- rt2800_bbp_write(rt2x00dev, 195, reg);
|
||||
- rt2800_bbp_write(rt2x00dev, 196, value);
|
||||
-}
|
||||
-
|
||||
-static void rt2800_bbp_dcoc_write(struct rt2x00_dev *rt2x00dev,
|
||||
- const u8 reg, const u8 value)
|
||||
-{
|
||||
- rt2800_bbp_write(rt2x00dev, 158, reg);
|
||||
- rt2800_bbp_write(rt2x00dev, 159, value);
|
||||
-}
|
||||
-
|
||||
-static u8 rt2800_bbp_dcoc_read(struct rt2x00_dev *rt2x00dev, const u8 reg)
|
||||
-{
|
||||
- rt2800_bbp_write(rt2x00dev, 158, reg);
|
||||
- return rt2800_bbp_read(rt2x00dev, 159);
|
||||
-}
|
||||
-
|
||||
static void rt2800_init_bbp_6352(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
u8 bbp;
|
||||
@ -0,0 +1,56 @@
|
||||
From patchwork Sat Sep 17 20:29:13 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979253
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:29:13 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 12/16] rt2x00: fix HT20/HT40 bandwidth switch on MT7620
|
||||
Message-ID:
|
||||
<1664d89ba149f7b0bcec18b2a2abaedf49654507.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Add missing configuration of the channel bandwidth filter to the
|
||||
channel setup function for MT7620.
|
||||
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -3855,6 +3855,14 @@ static void rt2800_config_channel_rf7620
|
||||
rfcsr |= tx_agc_fc;
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 7, 59, rfcsr);
|
||||
}
|
||||
+
|
||||
+ if (conf_is_ht40(conf)) {
|
||||
+ rt2800_bbp_glrt_write(rt2x00dev, 141, 0x10);
|
||||
+ rt2800_bbp_glrt_write(rt2x00dev, 157, 0x2f);
|
||||
+ } else {
|
||||
+ rt2800_bbp_glrt_write(rt2x00dev, 141, 0x1a);
|
||||
+ rt2800_bbp_glrt_write(rt2x00dev, 157, 0x40);
|
||||
+ }
|
||||
}
|
||||
|
||||
static void rt2800_config_alc(struct rt2x00_dev *rt2x00dev,
|
||||
@ -0,0 +1,52 @@
|
||||
From patchwork Sat Sep 17 20:29:26 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979254
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:29:26 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 13/16] rt2x00: set correct TX_SW_CFG1 MAC register for
|
||||
MT7620
|
||||
Message-ID:
|
||||
<4be38975ce600a34249e12d09a3cb758c6e71071.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Set correct TX_SW_CFG1 MAC register as it is done also in v3 of the
|
||||
vendor driver[1].
|
||||
|
||||
[1]: https://gitlab.com/dm38/padavan-ng/-/blob/master/trunk/proprietary/rt_wifi/rtpci/3.0.X.X/mt76x2/chips/rt6352.c#L531
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -5966,7 +5966,7 @@ static int rt2800_init_registers(struct
|
||||
rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
|
||||
} else if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401);
|
||||
- rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0000);
|
||||
+ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0001);
|
||||
rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
|
||||
rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x00000000);
|
||||
rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0);
|
||||
@ -0,0 +1,50 @@
|
||||
From patchwork Sat Sep 17 20:29:40 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979255
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:29:40 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 14/16] rt2x00: set VGC gain for both chains of MT7620
|
||||
Message-ID:
|
||||
<29e161397e5c9d9399da0fe87d44458aa2b90a78.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Set bbp66 for all chains of the MT7620.
|
||||
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -5743,7 +5743,8 @@ static inline void rt2800_set_vgc(struct
|
||||
if (qual->vgc_level != vgc_level) {
|
||||
if (rt2x00_rt(rt2x00dev, RT3572) ||
|
||||
rt2x00_rt(rt2x00dev, RT3593) ||
|
||||
- rt2x00_rt(rt2x00dev, RT3883)) {
|
||||
+ rt2x00_rt(rt2x00dev, RT3883) ||
|
||||
+ rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
rt2800_bbp_write_with_rx_chain(rt2x00dev, 66,
|
||||
vgc_level);
|
||||
} else if (rt2x00_rt(rt2x00dev, RT5592)) {
|
||||
@ -0,0 +1,70 @@
|
||||
From patchwork Sat Sep 17 20:29:55 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979256
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
Date: Sat, 17 Sep 2022 21:29:55 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 15/16] rt2x00: set SoC wmac clock register
|
||||
Message-ID:
|
||||
<3e275d259f476f597dab91a9c395015ef3fe3284.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Instead of using the default value 33 (pci), set US_CYC_CNT init based
|
||||
on Programming guide:
|
||||
If available, set chipset bus clock with fallback to cpu clock/3.
|
||||
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 21 +++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -6229,6 +6229,27 @@ static int rt2800_init_registers(struct
|
||||
reg = rt2800_register_read(rt2x00dev, US_CYC_CNT);
|
||||
rt2x00_set_field32(®, US_CYC_CNT_CLOCK_CYCLE, 125);
|
||||
rt2800_register_write(rt2x00dev, US_CYC_CNT, reg);
|
||||
+ } else if (rt2x00_is_soc(rt2x00dev)) {
|
||||
+ struct clk *clk = clk_get_sys("bus", NULL);
|
||||
+ int rate;
|
||||
+
|
||||
+ if (IS_ERR(clk)) {
|
||||
+ clk = clk_get_sys("cpu", NULL);
|
||||
+
|
||||
+ if (IS_ERR(clk)) {
|
||||
+ rate = 125;
|
||||
+ } else {
|
||||
+ rate = clk_get_rate(clk) / 3000000;
|
||||
+ clk_put(clk);
|
||||
+ }
|
||||
+ } else {
|
||||
+ rate = clk_get_rate(clk) / 1000000;
|
||||
+ clk_put(clk);
|
||||
+ }
|
||||
+
|
||||
+ reg = rt2800_register_read(rt2x00dev, US_CYC_CNT);
|
||||
+ rt2x00_set_field32(®, US_CYC_CNT_CLOCK_CYCLE, rate);
|
||||
+ rt2800_register_write(rt2x00dev, US_CYC_CNT, reg);
|
||||
}
|
||||
|
||||
reg = rt2800_register_read(rt2x00dev, HT_FBK_CFG0);
|
||||
@ -0,0 +1,79 @@
|
||||
From patchwork Sat Sep 17 20:30:09 2022
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 12979257
|
||||
X-Patchwork-Delegate: kvalo@adurom.com
|
||||
Return-Path: <linux-wireless-owner@kernel.org>
|
||||
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
|
||||
aws-us-west-2-korg-lkml-1.web.codeaurora.org
|
||||
Received: from vger.kernel.org (vger.kernel.org [23.128.96.18])
|
||||
by smtp.lore.kernel.org (Postfix) with ESMTP id E9118ECAAA1
|
||||
for <linux-wireless@archiver.kernel.org>;
|
||||
Sat, 17 Sep 2022 20:30:22 +0000 (UTC)
|
||||
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
|
||||
id S229639AbiIQUaV (ORCPT
|
||||
<rfc822;linux-wireless@archiver.kernel.org>);
|
||||
Sat, 17 Sep 2022 16:30:21 -0400
|
||||
Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53912 "EHLO
|
||||
lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
|
||||
with ESMTP id S229628AbiIQUaT (ORCPT
|
||||
<rfc822;linux-wireless@vger.kernel.org>);
|
||||
Sat, 17 Sep 2022 16:30:19 -0400
|
||||
Received: from fudo.makrotopia.org (fudo.makrotopia.org
|
||||
[IPv6:2a07:2ec0:3002::71])
|
||||
by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AEA822B27
|
||||
for <linux-wireless@vger.kernel.org>;
|
||||
Sat, 17 Sep 2022 13:30:16 -0700 (PDT)
|
||||
Received: from local
|
||||
by fudo.makrotopia.org with esmtpsa
|
||||
(TLS1.3:TLS_AES_256_GCM_SHA384:256)
|
||||
(Exim 4.96)
|
||||
(envelope-from <daniel@makrotopia.org>)
|
||||
id 1oZeS7-0003ra-0k;
|
||||
Sat, 17 Sep 2022 22:30:15 +0200
|
||||
Date: Sat, 17 Sep 2022 21:30:09 +0100
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
To: linux-wireless@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
"David S. Miller" <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
Subject: [PATCH v3 16/16] rt2x00: correctly set BBP register 86 for MT7620
|
||||
Message-ID:
|
||||
<257267247ee4fa7ebc6a5d0c4948b3f8119c0d77.1663445157.git.daniel@makrotopia.org>
|
||||
References: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Disposition: inline
|
||||
In-Reply-To: <cover.1663445157.git.daniel@makrotopia.org>
|
||||
Precedence: bulk
|
||||
List-ID: <linux-wireless.vger.kernel.org>
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
|
||||
Instead of 0 set the correct value for BBP register 86 for MT7620.
|
||||
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -4225,7 +4225,10 @@ static void rt2800_config_channel(struct
|
||||
rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
|
||||
rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
|
||||
rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
|
||||
- rt2800_bbp_write(rt2x00dev, 86, 0);
|
||||
+ if (rt2x00_rt(rt2x00dev, RT6352))
|
||||
+ rt2800_bbp_write(rt2x00dev, 86, 0x38);
|
||||
+ else
|
||||
+ rt2800_bbp_write(rt2x00dev, 86, 0);
|
||||
}
|
||||
|
||||
if (rf->channel <= 14) {
|
||||
@ -48,7 +48,7 @@
|
||||
obj-$(CPTCFG_RT2X00_LIB_MMIO) += rt2x00mmio.o
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
|
||||
@@ -37,6 +37,8 @@ struct rt2800_drv_data {
|
||||
@@ -47,6 +47,8 @@ struct rt2800_drv_data {
|
||||
struct ieee80211_sta *wcid_to_sta[STA_IDS_SIZE];
|
||||
};
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
struct rt2800_ops {
|
||||
u32 (*register_read)(struct rt2x00_dev *rt2x00dev,
|
||||
const unsigned int offset);
|
||||
@@ -135,6 +137,15 @@ static inline int rt2800_read_eeprom(str
|
||||
@@ -145,6 +147,15 @@ static inline int rt2800_read_eeprom(str
|
||||
{
|
||||
const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv;
|
||||
|
||||
@ -127,7 +127,7 @@
|
||||
DECLARE_KFIFO_PTR(txstatus_fifo, u32);
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
@@ -1401,6 +1401,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de
|
||||
@@ -1419,6 +1419,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de
|
||||
INIT_DELAYED_WORK(&rt2x00dev->autowakeup_work, rt2x00lib_autowakeup);
|
||||
INIT_WORK(&rt2x00dev->sleep_work, rt2x00lib_sleep);
|
||||
|
||||
@ -138,7 +138,7 @@
|
||||
/*
|
||||
* Let the driver probe the device to detect the capabilities.
|
||||
*/
|
||||
@@ -1541,6 +1545,11 @@ void rt2x00lib_remove_dev(struct rt2x00_
|
||||
@@ -1559,6 +1563,11 @@ void rt2x00lib_remove_dev(struct rt2x00_
|
||||
* Free the driver data.
|
||||
*/
|
||||
kfree(rt2x00dev->drv_data);
|
||||
@ -193,7 +193,7 @@
|
||||
+ if (pdata && pdata->eeprom_file_name)
|
||||
+ return pdata->eeprom_file_name;
|
||||
+
|
||||
+ return NULL
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static int rt2x00lib_request_eeprom_file(struct rt2x00_dev *rt2x00dev)
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
#include "rt2x00.h"
|
||||
#include "rt2x00lib.h"
|
||||
@@ -34,11 +35,21 @@ static const char *
|
||||
@@ -34,10 +35,20 @@ static const char *
|
||||
rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data;
|
||||
@ -20,14 +20,12 @@
|
||||
if (pdata && pdata->eeprom_file_name)
|
||||
return pdata->eeprom_file_name;
|
||||
|
||||
- return NULL
|
||||
+#ifdef CONFIG_OF
|
||||
+ np = rt2x00dev->dev->of_node;
|
||||
+ if (np && of_property_read_string(np, "ralink,eeprom", &eep) == 0)
|
||||
+ return eep;
|
||||
+#endif
|
||||
+
|
||||
+ return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int rt2x00lib_request_eeprom_file(struct rt2x00_dev *rt2x00dev)
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
#include "rt2x00.h"
|
||||
#include "rt2800lib.h"
|
||||
@@ -9549,6 +9550,17 @@ static int rt2800_init_eeprom(struct rt2
|
||||
@@ -11131,6 +11132,17 @@ static int rt2800_init_eeprom(struct rt2
|
||||
rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC);
|
||||
rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY);
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
@@ -1340,7 +1340,7 @@ static inline void rt2x00lib_set_if_comb
|
||||
@@ -1358,7 +1358,7 @@ static inline void rt2x00lib_set_if_comb
|
||||
*/
|
||||
if_limit = &rt2x00dev->if_limits_ap;
|
||||
if_limit->max = rt2x00dev->ops->max_ap_intf;
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
From: David Bauer <mail@david-bauer.net>
|
||||
Date: Mon, 16 Dec 2019 20:47:06 +0100
|
||||
Subject: [PATCH] rt2x00: add throughput LED trigger
|
||||
|
||||
This adds a (currently missing) throughput LED trigger for the rt2x00
|
||||
driver. Previously, LED triggers had to be assigned to the netdev, which
|
||||
was limited to a single VAP.
|
||||
|
||||
Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
Tested-by: Christoph Krapp <achterin@googlemail.com>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 17 +++++++++++++++++
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
@@ -1125,6 +1125,19 @@ static void rt2x00lib_remove_hw(struct r
|
||||
kfree(rt2x00dev->spec.channels_info);
|
||||
}
|
||||
|
||||
+static const struct ieee80211_tpt_blink rt2x00_tpt_blink[] = {
|
||||
+ { .throughput = 0 * 1024, .blink_time = 334 },
|
||||
+ { .throughput = 1 * 1024, .blink_time = 260 },
|
||||
+ { .throughput = 2 * 1024, .blink_time = 220 },
|
||||
+ { .throughput = 5 * 1024, .blink_time = 190 },
|
||||
+ { .throughput = 10 * 1024, .blink_time = 170 },
|
||||
+ { .throughput = 25 * 1024, .blink_time = 150 },
|
||||
+ { .throughput = 54 * 1024, .blink_time = 130 },
|
||||
+ { .throughput = 120 * 1024, .blink_time = 110 },
|
||||
+ { .throughput = 265 * 1024, .blink_time = 80 },
|
||||
+ { .throughput = 586 * 1024, .blink_time = 50 },
|
||||
+};
|
||||
+
|
||||
static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
struct hw_mode_spec *spec = &rt2x00dev->spec;
|
||||
@@ -1206,6 +1219,10 @@ static int rt2x00lib_probe_hw(struct rt2
|
||||
|
||||
#undef RT2X00_TASKLET_INIT
|
||||
|
||||
+ ieee80211_create_tpt_led_trigger(rt2x00dev->hw,
|
||||
+ IEEE80211_TPT_LEDTRIG_FL_RADIO, rt2x00_tpt_blink,
|
||||
+ ARRAY_SIZE(rt2x00_tpt_blink));
|
||||
+
|
||||
/*
|
||||
* Register HW.
|
||||
*/
|
||||
@ -1,423 +0,0 @@
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Mon, 12 Sep 2022 21:33:13 +0100
|
||||
Subject: [PATCH] rt2x00: various experimental fixes for MT7620
|
||||
|
||||
Serge Vasilugin reports:
|
||||
|
||||
To improve mt7620 built-in wifi performance some changes:
|
||||
1. Correct BW20/BW40 switching (see comments with mark see commets with mark (1))
|
||||
2. Correct TX_SW_CFG1 MAC reg from v3 of vendor driver see
|
||||
https://gitlab.com/dm38/padavan-ng/-/blob/master/trunk/proprietary/rt_wifi/rtpci/3.0.X.X/mt76x2/chips/rt6352.c#L531
|
||||
3. Set bbp66 for all chains.
|
||||
4. US_CYC_CNT init based on Programming guide, default value was 33 (pci),
|
||||
set chipset bus clock with fallback to cpu clock/3.
|
||||
5. Don't overwrite default values for mt7620.
|
||||
6. Correct some typos.
|
||||
7. Add support for external LNA:
|
||||
a) RF and BBP regs never be corrected for this mode
|
||||
b) eLNA is driven the same way as ePA with mt7620's pin PA
|
||||
but vendor driver explicitly pin PA to gpio mode (for forrect calibration?)
|
||||
so I'm not sure that request for pa_pin in dts-file will be enough
|
||||
|
||||
First 5 changes (really 2) improve performance for boards w/o eLNA/ePA.
|
||||
Changes 7 add support for eLNA
|
||||
|
||||
Configuration w/o eLAN/ePA and with eLNA show results
|
||||
tx/rx (from router point of view) for each stream:
|
||||
35-40/30-35 Mbps for HT20
|
||||
65-70/60-65 Mbps for HT40
|
||||
|
||||
Yes. Max results for 2T2R client is 140-145/135-140
|
||||
with peaks 160/150, It correspond to mediatek driver results.
|
||||
Boards with ePA untested.
|
||||
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -137,6 +137,26 @@ static u8 rt2800_bbp_read(struct rt2x00_
|
||||
|
||||
return value;
|
||||
}
|
||||
+//serge: move here for use in test
|
||||
+static void rt2800_bbp_glrt_write(struct rt2x00_dev *rt2x00dev,
|
||||
+ const u8 reg, const u8 value)
|
||||
+{
|
||||
+ rt2800_bbp_write(rt2x00dev, 195, reg);
|
||||
+ rt2800_bbp_write(rt2x00dev, 196, value);
|
||||
+}
|
||||
+
|
||||
+static void rt2800_bbp_dcoc_write(struct rt2x00_dev *rt2x00dev,
|
||||
+ const u8 reg, const u8 value)
|
||||
+{
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, reg);
|
||||
+ rt2800_bbp_write(rt2x00dev, 159, value);
|
||||
+}
|
||||
+
|
||||
+static u8 rt2800_bbp_dcoc_read(struct rt2x00_dev *rt2x00dev, const u8 reg)
|
||||
+{
|
||||
+ rt2800_bbp_write(rt2x00dev, 158, reg);
|
||||
+ return rt2800_bbp_read(rt2x00dev, 159);
|
||||
+}
|
||||
|
||||
static void rt2800_rfcsr_write(struct rt2x00_dev *rt2x00dev,
|
||||
const unsigned int word, const u8 value)
|
||||
@@ -284,6 +304,28 @@ static void rt2800_rf_write(struct rt2x0
|
||||
mutex_unlock(&rt2x00dev->csr_mutex);
|
||||
}
|
||||
|
||||
+void rt6352_enable_pa_pin(struct rt2x00_dev *rt2x00dev, int enable)
|
||||
+{
|
||||
+ if (!rt2x00dev->pinctrl)
|
||||
+ return;
|
||||
+
|
||||
+ if (enable) {
|
||||
+ if (!rt2x00dev->pins_default) {
|
||||
+ rt2x00_warn(rt2x00dev, "cannot enable PA pin! no default pinctrl\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ pinctrl_select_state(rt2x00dev->pinctrl, rt2x00dev->pins_default);
|
||||
+ } else {
|
||||
+ if (!rt2x00dev->pins_pa_gpio) {
|
||||
+ rt2x00_warn(rt2x00dev, "cannot disable PA pin! no pa_gpio pinctrl\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ pinctrl_select_state(rt2x00dev->pinctrl, rt2x00dev->pins_pa_gpio);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static const unsigned int rt2800_eeprom_map[EEPROM_WORD_COUNT] = {
|
||||
[EEPROM_CHIP_ID] = 0x0000,
|
||||
[EEPROM_VERSION] = 0x0001,
|
||||
@@ -3801,6 +3843,20 @@ static void rt2800_config_channel_rf7620
|
||||
rfcsr |= tx_agc_fc;
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 7, 59, rfcsr);
|
||||
}
|
||||
+
|
||||
+ if (conf_is_ht40(conf)) {//serge:skipped this step (1)
|
||||
+ rt2800_bbp_write(rt2x00dev, 195, 141);
|
||||
+ rt2800_bbp_write(rt2x00dev, 196, 0x10);
|
||||
+ rt2800_bbp_write(rt2x00dev, 195, 157);
|
||||
+ rt2800_bbp_write(rt2x00dev, 196, 0x2f);
|
||||
+ //rt2800_bbp_write(rt2x00dev, 105, 0x3C);
|
||||
+ } else {
|
||||
+ rt2800_bbp_write(rt2x00dev, 195, 141);
|
||||
+ rt2800_bbp_write(rt2x00dev, 196, 0x1a);
|
||||
+ rt2800_bbp_write(rt2x00dev, 195, 157);
|
||||
+ rt2800_bbp_write(rt2x00dev, 196, 0x40);
|
||||
+ //rt2800_bbp_write(rt2x00dev, 105, 0x1C);
|
||||
+ }
|
||||
}
|
||||
|
||||
static void rt2800_config_alc(struct rt2x00_dev *rt2x00dev,
|
||||
@@ -4172,6 +4228,11 @@ static void rt2800_config_channel(struct
|
||||
rt2800_bbp_write(rt2x00dev, 86, 0x46);
|
||||
else
|
||||
rt2800_bbp_write(rt2x00dev, 86, 0);
|
||||
+ } else if (rt2x00_rt(rt2x00dev, RT6352)) {//serge: don't overwite bbp r86 (5)
|
||||
+ rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
|
||||
+ rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
|
||||
+ rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
|
||||
+ rt2800_bbp_write(rt2x00dev, 86, 0x38);
|
||||
} else {
|
||||
rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
|
||||
rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
|
||||
@@ -4377,7 +4438,8 @@ static void rt2800_config_channel(struct
|
||||
reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2*rt2x00dev->lna_gain;
|
||||
rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
|
||||
|
||||
- rt2800_iq_calibrate(rt2x00dev, rf->channel);
|
||||
+ if (!rt2x00_rt(rt2x00dev, RT6352))//serge: this function for rt5592 only, for rt6352 it switch off compensations (5)
|
||||
+ rt2800_iq_calibrate(rt2x00dev, rf->channel);
|
||||
}
|
||||
|
||||
if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
@@ -4417,6 +4479,31 @@ static void rt2800_config_channel(struct
|
||||
rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN,
|
||||
0x6C6C6B6C);
|
||||
}
|
||||
+
|
||||
+ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {//serge: for support eLNA (7a)
|
||||
+ rt2x00_warn(rt2x00dev, "Correct RF/BBP for eLNA!\n");
|
||||
+ reg = rt2800_register_read(rt2x00dev, RF_CONTROL3);
|
||||
+ reg |= 0x00000101;
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL3, reg);
|
||||
+
|
||||
+ reg = rt2800_register_read(rt2x00dev, RF_BYPASS3);
|
||||
+ reg |= 0x00000101;
|
||||
+ rt2800_register_write(rt2x00dev, RF_BYPASS3, reg);
|
||||
+
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x42);
|
||||
+ rt2800_bbp_write(rt2x00dev, 75, 0x68);//serge: move bbp eLNA init here?
|
||||
+ rt2800_bbp_write(rt2x00dev, 76, 0x4C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 79, 0x1C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 80, 0x0C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 82, 0xB6);
|
||||
+ /* bank 0 RF reg 42 and glrt BBP reg 141
|
||||
+ will be set in config channel function
|
||||
+ in dependence of channel and HT20/HT40
|
||||
+ so don't touch it
|
||||
+ */
|
||||
+ }
|
||||
}
|
||||
|
||||
bbp = rt2800_bbp_read(rt2x00dev, 4);
|
||||
@@ -4457,6 +4544,9 @@ static void rt2800_config_channel(struct
|
||||
rt2x00_set_field8(&bbp, BBP49_UPDATE_FLAG, 0);
|
||||
rt2800_bbp_write(rt2x00dev, 49, bbp);
|
||||
}
|
||||
+//serge:just print results after config channel - don't forget to remove nahren (c) <- this is copyright, not ref to comments :)
|
||||
+ bbp = rt2800_bbp_dcoc_read(rt2x00dev, 0x03);
|
||||
+ pr_info("BBP tx/rx compensation control=0x%02x\n", bbp);
|
||||
}
|
||||
|
||||
static int rt2800_get_gain_calibration_delta(struct rt2x00_dev *rt2x00dev)
|
||||
@@ -5527,7 +5617,7 @@ void rt2800_vco_calibration(struct rt2x0
|
||||
}
|
||||
rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin);
|
||||
|
||||
- if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
+ if (rt2x00_rt(rt2x00dev, RT6352)) {//serge:remark - move all this code to rfcsr_6352 init?
|
||||
if (rt2x00dev->default_ant.rx_chain_num == 1) {
|
||||
rt2800_bbp_write(rt2x00dev, 91, 0x07);
|
||||
rt2800_bbp_write(rt2x00dev, 95, 0x1A);
|
||||
@@ -5695,7 +5785,8 @@ static inline void rt2800_set_vgc(struct
|
||||
if (qual->vgc_level != vgc_level) {
|
||||
if (rt2x00_rt(rt2x00dev, RT3572) ||
|
||||
rt2x00_rt(rt2x00dev, RT3593) ||
|
||||
- rt2x00_rt(rt2x00dev, RT3883)) {
|
||||
+ rt2x00_rt(rt2x00dev, RT3883) ||
|
||||
+ rt2x00_rt(rt2x00dev, RT6352)) {//serge: rt6352 too (3)
|
||||
rt2800_bbp_write_with_rx_chain(rt2x00dev, 66,
|
||||
vgc_level);
|
||||
} else if (rt2x00_rt(rt2x00dev, RT5592)) {
|
||||
@@ -5930,7 +6021,7 @@ static int rt2800_init_registers(struct
|
||||
0x00550055);
|
||||
} else {
|
||||
rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401);
|
||||
- rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0000);
|
||||
+ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0001);//serge:was 0x000C0000 (2)
|
||||
rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
|
||||
rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x00000000);
|
||||
rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0);
|
||||
@@ -6195,6 +6286,29 @@ static int rt2800_init_registers(struct
|
||||
reg = rt2800_register_read(rt2x00dev, US_CYC_CNT);
|
||||
rt2x00_set_field32(®, US_CYC_CNT_CLOCK_CYCLE, 125);
|
||||
rt2800_register_write(rt2x00dev, US_CYC_CNT, reg);
|
||||
+ } else if (rt2x00_is_soc(rt2x00dev)) {//serge:which value correct? (4)
|
||||
+ struct clk *clk = clk_get_sys("bus", NULL);
|
||||
+ int rate;
|
||||
+
|
||||
+ if (IS_ERR(clk)) {
|
||||
+ rt2x00_warn(rt2x00dev, "system bus clock undefined\n");
|
||||
+ clk = clk_get_sys("cpu", NULL);
|
||||
+
|
||||
+ if (IS_ERR(clk))
|
||||
+ rate = 125;
|
||||
+ else {
|
||||
+ rate = clk_get_rate(clk) / 3000000;
|
||||
+ clk_put(clk);
|
||||
+ }
|
||||
+ } else {
|
||||
+ rate = clk_get_rate(clk) / 1000000;
|
||||
+ clk_put(clk);
|
||||
+ }
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "set US_CYC=%dMHz\n", rate);
|
||||
+ reg = rt2800_register_read(rt2x00dev, US_CYC_CNT);
|
||||
+ rt2x00_set_field32(®, US_CYC_CNT_CLOCK_CYCLE, rate);
|
||||
+ rt2800_register_write(rt2x00dev, US_CYC_CNT, reg);
|
||||
}
|
||||
|
||||
reg = rt2800_register_read(rt2x00dev, HT_FBK_CFG0);
|
||||
@@ -6981,26 +7095,7 @@ static void rt2800_init_bbp_5592(struct
|
||||
if (rt2x00_rt_rev_gte(rt2x00dev, RT5592, REV_RT5592C))
|
||||
rt2800_bbp_write(rt2x00dev, 103, 0xc0);
|
||||
}
|
||||
-
|
||||
-static void rt2800_bbp_glrt_write(struct rt2x00_dev *rt2x00dev,
|
||||
- const u8 reg, const u8 value)
|
||||
-{
|
||||
- rt2800_bbp_write(rt2x00dev, 195, reg);
|
||||
- rt2800_bbp_write(rt2x00dev, 196, value);
|
||||
-}
|
||||
-
|
||||
-static void rt2800_bbp_dcoc_write(struct rt2x00_dev *rt2x00dev,
|
||||
- const u8 reg, const u8 value)
|
||||
-{
|
||||
- rt2800_bbp_write(rt2x00dev, 158, reg);
|
||||
- rt2800_bbp_write(rt2x00dev, 159, value);
|
||||
-}
|
||||
-
|
||||
-static u8 rt2800_bbp_dcoc_read(struct rt2x00_dev *rt2x00dev, const u8 reg)
|
||||
-{
|
||||
- rt2800_bbp_write(rt2x00dev, 158, reg);
|
||||
- return rt2800_bbp_read(rt2x00dev, 159);
|
||||
-}
|
||||
+//serge: move these function upper
|
||||
|
||||
static void rt2800_init_bbp_6352(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
@@ -8635,7 +8730,7 @@ static void rt2800_r_calibration(struct
|
||||
r_cal_code = (u8)rcalcode;
|
||||
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 0, 7, r_cal_code);
|
||||
-
|
||||
+ pr_info("RF bank 0 reg 5=0x%02x\n", r_cal_code);//serge: just for info to compare with vendor driver
|
||||
rt2800_bbp_write(rt2x00dev, 22, 0x0);
|
||||
|
||||
bytevalue = rt2800_bbp_read(rt2x00dev, 21);
|
||||
@@ -8693,7 +8788,7 @@ static void rt2800_rxdcoc_calibration(st
|
||||
break;
|
||||
}
|
||||
|
||||
- saverfb5r4 = rt2800_rfcsr_read_bank(rt2x00dev, 5, 0);
|
||||
+ saverfb5r4 = rt2800_rfcsr_read_bank(rt2x00dev, 5, 4);//serge: was 0 - typo? (6)
|
||||
saverfb7r4 = rt2800_rfcsr_read_bank(rt2x00dev, 7, 4);
|
||||
saverfb5r4 = saverfb5r4 & (~0x40);
|
||||
saverfb7r4 = saverfb7r4 & (~0x40);
|
||||
@@ -9022,13 +9117,15 @@ static void rt2800_rxiq_calibration(stru
|
||||
rt2x00_info(rt2x00dev, "RXIQ G_imb=%d, Ph_rx=%d\n", g_imb, ph_rx);
|
||||
|
||||
if ((ph_rx > 20) || (ph_rx < -20)) {
|
||||
+ rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL(ph_rx=%d out of [-20..20]", ph_rx);//serge:just to see value
|
||||
ph_rx = 0;
|
||||
- rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL");
|
||||
+ //rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL");
|
||||
}
|
||||
|
||||
if ((g_imb > 12) || (g_imb < -12)) {
|
||||
+ rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL(g_imb=%d out of (-12..12]", g_imb);//serge:just to see the reason
|
||||
g_imb = 0;
|
||||
- rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL");
|
||||
+ //rt2x00_warn(rt2x00dev, "RXIQ calibration FAIL");
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -9039,11 +9136,21 @@ static void rt2800_rxiq_calibration(stru
|
||||
}
|
||||
|
||||
if (ch_idx == 0) {
|
||||
+ //serge: just to see values
|
||||
+ pr_info("RXIQ RX0 g_imb (0x37, %2x) ph_rx (0x35, %2x)\n",
|
||||
+ g_imb & 0x3f,
|
||||
+ ph_rx & 0x3f
|
||||
+ );
|
||||
rt2800_bbp_write(rt2x00dev, 158, 0x37);
|
||||
rt2800_bbp_write(rt2x00dev, 159, g_imb & 0x3f);
|
||||
rt2800_bbp_write(rt2x00dev, 158, 0x35);
|
||||
rt2800_bbp_write(rt2x00dev, 159, ph_rx & 0x3f);
|
||||
} else {
|
||||
+ //serge: just to see values
|
||||
+ pr_info("RXIQ RX1 g_imb (0x55, %2x) ph_rx (0x53, %2x)\n",
|
||||
+ g_imb & 0x3f,
|
||||
+ ph_rx & 0x3f
|
||||
+ );
|
||||
rt2800_bbp_write(rt2x00dev, 158, 0x55);
|
||||
rt2800_bbp_write(rt2x00dev, 159, g_imb & 0x3f);
|
||||
rt2800_bbp_write(rt2x00dev, 158, 0x53);
|
||||
@@ -9745,6 +9852,15 @@ void rt2800_loft_iq_calibration(struct r
|
||||
}
|
||||
|
||||
for (rf_alc_idx = 0; rf_alc_idx < 3; rf_alc_idx++) {
|
||||
+ //serge: just to see values
|
||||
+ pr_info("LOFT ALC (0xb0, %2x) I0 (0xb1, %2x) Q0 (0xb2, %2x) I1 (0xb8, %2x) Q1 (0xb9, %2x)\n",
|
||||
+ rf_alc_idx,
|
||||
+ loft_dc_search_result[CHAIN_0][rf_alc_idx][0x00] & 0x3F,
|
||||
+ loft_dc_search_result[CHAIN_0][rf_alc_idx][0x01] & 0x3F,
|
||||
+ loft_dc_search_result[CHAIN_1][rf_alc_idx][0x00] & 0x3F,
|
||||
+ loft_dc_search_result[CHAIN_1][rf_alc_idx][0x01] & 0x3F
|
||||
+ );
|
||||
+
|
||||
for (idx = 0; idx < 4; idx++) {
|
||||
rt2800_bbp_write(rt2x00dev, 158, 0xB0);
|
||||
bbp = (idx<<2) + rf_alc_idx;
|
||||
@@ -10669,6 +10785,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
|
||||
}
|
||||
|
||||
+ rt6352_enable_pa_pin(rt2x00dev, 0);//serge: vendor driver do it before calibration (7b)
|
||||
rt2800_r_calibration(rt2x00dev);
|
||||
rt2800_rf_self_txdc_cal(rt2x00dev);
|
||||
rt2800_rxdcoc_calibration(rt2x00dev);
|
||||
@@ -10676,6 +10793,29 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_bw_filter_calibration(rt2x00dev, false);
|
||||
rt2800_loft_iq_calibration(rt2x00dev);
|
||||
rt2800_rxiq_calibration(rt2x00dev);
|
||||
+ rt6352_enable_pa_pin(rt2x00dev, 1);//serge: vendor driver do it after calibration (7b)
|
||||
+ /* Vendor driver restore iLNA/iPA before
|
||||
+ recalibration and set correct values after.
|
||||
+ Openwrt driver init iLNA and iPA but restore only
|
||||
+ ePA values after recalibration.
|
||||
+ So set eLNA values only
|
||||
+ */
|
||||
+ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {//serge: rf regs never corrected for eLNA (7a)
|
||||
+ rt2x00_info(rt2x00dev, "Correct RF/BBP for eLNA!\n");
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x42);
|
||||
+ rt2800_bbp_write(rt2x00dev, 75, 0x68);//serge: move bbp eLNA init here?
|
||||
+ rt2800_bbp_write(rt2x00dev, 76, 0x4C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 79, 0x1C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 80, 0x0C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 82, 0xB6);
|
||||
+ /* bank 0 RF reg 42 and glrt BBP reg 141
|
||||
+ will be set in config channel function
|
||||
+ in dependence of channel and HT20/HT40
|
||||
+ so don't touch it
|
||||
+ */
|
||||
+ }
|
||||
}
|
||||
|
||||
static void rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <linux/average.h>
|
||||
#include <linux/usb.h>
|
||||
#include <linux/clk.h>
|
||||
+#include <linux/pinctrl/consumer.h>
|
||||
#include <linux/rt2x00_platform.h>
|
||||
|
||||
#include <net/mac80211.h>
|
||||
@@ -1029,6 +1030,11 @@ struct rt2x00_dev {
|
||||
|
||||
/* Clock for System On Chip devices. */
|
||||
struct clk *clk;
|
||||
+
|
||||
+ /* pinctrl and states for System On Chip devices with PA/LNA. */
|
||||
+ struct pinctrl *pinctrl;
|
||||
+ struct pinctrl_state *pins_default;
|
||||
+ struct pinctrl_state *pins_pa_gpio;
|
||||
};
|
||||
|
||||
struct rt2x00_bar_list_entry {
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
|
||||
@@ -97,6 +97,21 @@ int rt2x00soc_probe(struct platform_devi
|
||||
if (retval)
|
||||
goto exit_free_reg;
|
||||
|
||||
+ rt2x00dev->pinctrl = devm_pinctrl_get(&pdev->dev);
|
||||
+ if (IS_ERR(rt2x00dev->pinctrl)) {
|
||||
+ rt2x00dev->pinctrl = NULL;
|
||||
+ rt2x00dev->pins_default = NULL;
|
||||
+ rt2x00dev->pins_pa_gpio = NULL;
|
||||
+ } else {
|
||||
+ rt2x00dev->pins_default = pinctrl_lookup_state(rt2x00dev->pinctrl, "default");
|
||||
+ if (IS_ERR(rt2x00dev->pins_default))
|
||||
+ rt2x00dev->pins_default = NULL;
|
||||
+
|
||||
+ rt2x00dev->pins_pa_gpio = pinctrl_lookup_state(rt2x00dev->pinctrl, "pa_gpio");
|
||||
+ if (IS_ERR(rt2x00dev->pins_pa_gpio))
|
||||
+ rt2x00dev->pins_pa_gpio = NULL;
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
|
||||
exit_free_reg:
|
||||
@ -0,0 +1,161 @@
|
||||
From 0fce1109f894ec7fcd72cb098843a1eff786716a Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Fri, 16 Sep 2022 20:49:42 +0100
|
||||
Subject: [PATCH 16/16] rt2x00: import support for external LNA on MT7620
|
||||
To: linux-wireless@vger.kernel.org,
|
||||
Stanislaw Gruszka <stf_xl@wp.pl>,
|
||||
Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
Cc: Kalle Valo <kvalo@kernel.org>,
|
||||
David S. Miller <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Johannes Berg <johannes.berg@intel.com>
|
||||
|
||||
In order to carry out calibration on boards with ePA or eLNA the PA pin
|
||||
needs to be switch to GPIO mode on MT7620. Implement that by selecting
|
||||
pinctrl state "pa_gpio" which should be defined for MT7620 boards with
|
||||
eLNA or ePA beside the "default" state.
|
||||
|
||||
Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 58 +++++++++++++++++++
|
||||
drivers/net/wireless/ralink/rt2x00/rt2x00.h | 5 ++
|
||||
.../net/wireless/ralink/rt2x00/rt2x00soc.c | 15 +++++
|
||||
3 files changed, 78 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -304,6 +304,24 @@ static void rt2800_rf_write(struct rt2x0
|
||||
mutex_unlock(&rt2x00dev->csr_mutex);
|
||||
}
|
||||
|
||||
+void rt6352_enable_pa_pin(struct rt2x00_dev *rt2x00dev, int enable)
|
||||
+{
|
||||
+ if (!rt2x00dev->pinctrl)
|
||||
+ return;
|
||||
+
|
||||
+ if (enable) {
|
||||
+ if (!rt2x00dev->pins_default)
|
||||
+ return;
|
||||
+
|
||||
+ pinctrl_select_state(rt2x00dev->pinctrl, rt2x00dev->pins_default);
|
||||
+ } else {
|
||||
+ if (!rt2x00dev->pins_pa_gpio)
|
||||
+ return;
|
||||
+
|
||||
+ pinctrl_select_state(rt2x00dev->pinctrl, rt2x00dev->pins_pa_gpio);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static const unsigned int rt2800_eeprom_map[EEPROM_WORD_COUNT] = {
|
||||
[EEPROM_CHIP_ID] = 0x0000,
|
||||
[EEPROM_VERSION] = 0x0001,
|
||||
@@ -4469,6 +4487,29 @@ static void rt2800_config_channel(struct
|
||||
rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN,
|
||||
0x6C6C6B6C);
|
||||
}
|
||||
+
|
||||
+ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
+ reg = rt2800_register_read(rt2x00dev, RF_CONTROL3);
|
||||
+ reg |= 0x00000101;
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL3, reg);
|
||||
+
|
||||
+ reg = rt2800_register_read(rt2x00dev, RF_BYPASS3);
|
||||
+ reg |= 0x00000101;
|
||||
+ rt2800_register_write(rt2x00dev, RF_BYPASS3, reg);
|
||||
+
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x42);
|
||||
+ rt2800_bbp_write(rt2x00dev, 75, 0x68);
|
||||
+ rt2800_bbp_write(rt2x00dev, 76, 0x4C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 79, 0x1C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 80, 0x0C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 82, 0xB6);
|
||||
+ /* bank 0 RF reg 42 and glrt BBP reg 141 will be set in
|
||||
+ * config channel function in dependence of channel and
|
||||
+ * HT20/HT40 so don't touch it
|
||||
+ */
|
||||
+ }
|
||||
}
|
||||
|
||||
bbp = rt2800_bbp_read(rt2x00dev, 4);
|
||||
@@ -10583,6 +10624,7 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00);
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
|
||||
|
||||
+ rt6352_enable_pa_pin(rt2x00dev, 0);
|
||||
rt2800_r_calibration(rt2x00dev);
|
||||
rt2800_rf_self_txdc_cal(rt2x00dev);
|
||||
rt2800_rxdcoc_calibration(rt2x00dev);
|
||||
@@ -10590,6 +10632,22 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_bw_filter_calibration(rt2x00dev, false);
|
||||
rt2800_loft_iq_calibration(rt2x00dev);
|
||||
rt2800_rxiq_calibration(rt2x00dev);
|
||||
+ rt6352_enable_pa_pin(rt2x00dev, 1);
|
||||
+
|
||||
+ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x42);
|
||||
+ rt2800_bbp_write(rt2x00dev, 75, 0x68);
|
||||
+ rt2800_bbp_write(rt2x00dev, 76, 0x4C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 79, 0x1C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 80, 0x0C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 82, 0xB6);
|
||||
+ /* bank 0 RF reg 42 and glrt BBP reg 141 will be set in config
|
||||
+ * channel function in dependence of channel and HT20/HT40,
|
||||
+ * so don't touch them here.
|
||||
+ */
|
||||
+ }
|
||||
}
|
||||
|
||||
static void rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev)
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <linux/average.h>
|
||||
#include <linux/usb.h>
|
||||
#include <linux/clk.h>
|
||||
+#include <linux/pinctrl/consumer.h>
|
||||
#include <linux/rt2x00_platform.h>
|
||||
|
||||
#include <net/mac80211.h>
|
||||
@@ -1029,6 +1030,11 @@ struct rt2x00_dev {
|
||||
|
||||
/* Clock for System On Chip devices. */
|
||||
struct clk *clk;
|
||||
+
|
||||
+ /* pinctrl and states for System On Chip devices with PA/LNA. */
|
||||
+ struct pinctrl *pinctrl;
|
||||
+ struct pinctrl_state *pins_default;
|
||||
+ struct pinctrl_state *pins_pa_gpio;
|
||||
};
|
||||
|
||||
struct rt2x00_bar_list_entry {
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
|
||||
@@ -97,6 +97,21 @@ int rt2x00soc_probe(struct platform_devi
|
||||
if (retval)
|
||||
goto exit_free_reg;
|
||||
|
||||
+ rt2x00dev->pinctrl = devm_pinctrl_get(&pdev->dev);
|
||||
+ if (IS_ERR(rt2x00dev->pinctrl)) {
|
||||
+ rt2x00dev->pinctrl = NULL;
|
||||
+ rt2x00dev->pins_default = NULL;
|
||||
+ rt2x00dev->pins_pa_gpio = NULL;
|
||||
+ } else {
|
||||
+ rt2x00dev->pins_default = pinctrl_lookup_state(rt2x00dev->pinctrl, "default");
|
||||
+ if (IS_ERR(rt2x00dev->pins_default))
|
||||
+ rt2x00dev->pins_default = NULL;
|
||||
+
|
||||
+ rt2x00dev->pins_pa_gpio = pinctrl_lookup_state(rt2x00dev->pinctrl, "pa_gpio");
|
||||
+ if (IS_ERR(rt2x00dev->pins_pa_gpio))
|
||||
+ rt2x00dev->pins_pa_gpio = NULL;
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
|
||||
exit_free_reg:
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h
|
||||
@@ -1042,6 +1042,11 @@
|
||||
@@ -1044,6 +1044,11 @@
|
||||
#define MIMO_PS_CFG_RX_STBY_POL FIELD32(0x00000010)
|
||||
#define MIMO_PS_CFG_RX_RX_STBY0 FIELD32(0x00000020)
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
*/
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -3698,14 +3698,16 @@ static void rt2800_config_channel_rf7620
|
||||
@@ -3778,14 +3778,16 @@ static void rt2800_config_channel_rf7620
|
||||
rt2x00_set_field8(&rfcsr, RFCSR19_K, rf->rf4);
|
||||
rt2800_rfcsr_write(rt2x00dev, 19, rfcsr);
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
rfcsr = rt2800_rfcsr_read(rt2x00dev, 1);
|
||||
rt2x00_set_field8(&rfcsr, RFCSR1_TX2_EN_MT7620,
|
||||
@@ -3739,18 +3741,23 @@ static void rt2800_config_channel_rf7620
|
||||
@@ -3819,18 +3821,23 @@ static void rt2800_config_channel_rf7620
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 59, 0x20);
|
||||
}
|
||||
|
||||
@ -73,9 +73,9 @@
|
||||
|
||||
if (!test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) {
|
||||
if (conf_is_ht40(conf)) {
|
||||
@@ -3850,25 +3857,29 @@ static void rt2800_config_alc(struct rt2
|
||||
if (i == 10000)
|
||||
rt2x00_warn(rt2x00dev, "Wait MAC Status to MAX !!!\n");
|
||||
@@ -3929,25 +3936,29 @@ static void rt2800_config_alc(struct rt2
|
||||
if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY)))
|
||||
rt2x00_warn(rt2x00dev, "RF busy while configuring ALC\n");
|
||||
|
||||
- if (chan->center_freq > 2457) {
|
||||
- bbp = rt2800_bbp_read(rt2x00dev, 30);
|
||||
@ -121,12 +121,12 @@
|
||||
rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, mac_sys_ctrl);
|
||||
|
||||
rt2800_vco_calibration(rt2x00dev);
|
||||
@@ -5906,18 +5917,33 @@ static int rt2800_init_registers(struct
|
||||
@@ -6011,18 +6022,33 @@ static int rt2800_init_registers(struct
|
||||
} else if (rt2x00_rt(rt2x00dev, RT5350)) {
|
||||
rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
|
||||
} else if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
- rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401);
|
||||
- rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0000);
|
||||
- rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0001);
|
||||
- rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
|
||||
- rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x00000000);
|
||||
- rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0);
|
||||
@ -150,7 +150,7 @@
|
||||
+ 0x00550055);
|
||||
+ } else {
|
||||
+ rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401);
|
||||
+ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0000);
|
||||
+ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0001);
|
||||
+ rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
|
||||
+ rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x00000000);
|
||||
+ rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0);
|
||||
@ -167,7 +167,7 @@
|
||||
reg = rt2800_register_read(rt2x00dev, TX_ALC_CFG_1);
|
||||
rt2x00_set_field32(®, TX_ALC_CFG_1_ROS_BUSY_EN, 0);
|
||||
rt2800_register_write(rt2x00dev, TX_ALC_CFG_1, reg);
|
||||
@@ -7061,14 +7087,16 @@ static void rt2800_init_bbp_6352(struct
|
||||
@@ -7127,14 +7153,16 @@ static void rt2800_init_bbp_6352(struct
|
||||
rt2800_bbp_write(rt2x00dev, 188, 0x00);
|
||||
rt2800_bbp_write(rt2x00dev, 189, 0x00);
|
||||
|
||||
@ -192,7 +192,7 @@
|
||||
|
||||
/* BBP for G band GLRT function (BBP_128 ~ BBP_221) */
|
||||
rt2800_bbp_glrt_write(rt2x00dev, 0, 0x00);
|
||||
@@ -10407,31 +10435,36 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -10408,31 +10436,36 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write(rt2x00dev, 42, 0x5B);
|
||||
rt2800_rfcsr_write(rt2x00dev, 43, 0x00);
|
||||
|
||||
@ -254,7 +254,7 @@
|
||||
|
||||
/* Initialize RF channel register to default value */
|
||||
rt2800_rfcsr_write_chanreg(rt2x00dev, 0, 0x03);
|
||||
@@ -10497,63 +10530,71 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -10498,63 +10531,71 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 6, 45, 0xC5);
|
||||
|
||||
@ -383,7 +383,7 @@
|
||||
|
||||
/* Initialize RF DC calibration register to default value */
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 0, 0x47);
|
||||
@@ -10616,12 +10657,17 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -10617,12 +10658,17 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 62, 0x00);
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 63, 0x00);
|
||||
|
||||
@ -404,5 +404,5 @@
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
|
||||
+ }
|
||||
|
||||
rt6352_enable_pa_pin(rt2x00dev, 0);
|
||||
rt2800_r_calibration(rt2x00dev);
|
||||
rt2800_rf_self_txdc_cal(rt2x00dev);
|
||||
@ -41,10 +41,26 @@ define Package/libusb-1.0/description
|
||||
many different operating systems.
|
||||
endef
|
||||
|
||||
define Package/fxload
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=fxload firmware loader
|
||||
URL:=http://linux-hotplug.sourceforge.net
|
||||
DEPENDS:=+libusb-1.0
|
||||
endef
|
||||
|
||||
define Package/fxload/description
|
||||
This program is conveniently able to download firmware into FX, FX2,
|
||||
and FX2LP EZ-USB devices, as well as the original AnchorChips EZ-USB.
|
||||
It is intended to be invoked by hotplug scripts when the unprogrammed
|
||||
device appears on the bus.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += $(FPIC)
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-udev \
|
||||
--disable-log
|
||||
--enable-examples-build \
|
||||
--disable-log \
|
||||
--disable-udev
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/libusb-1.0
|
||||
@ -60,4 +76,10 @@ define Package/libusb-1.0/install
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libusb-1.0.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/fxload/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/examples/.libs/fxload $(1)/usr/sbin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libusb-1.0))
|
||||
$(eval $(call BuildPackage,fxload))
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
if PACKAGE_libwolfssl
|
||||
menu "wolfSSL Library Configuration"
|
||||
|
||||
config WOLFSSL_HAS_AES_CCM
|
||||
bool "Include AES-CCM support"
|
||||
@ -66,38 +66,31 @@ config WOLFSSL_ALT_NAMES
|
||||
config WOLFSSL_HAS_DEVCRYPTO
|
||||
bool
|
||||
|
||||
config WOLFSSL_ASM_CAPABLE
|
||||
bool
|
||||
default x86_64 || (aarch64 && !TARGET_bcm27xx)
|
||||
if PACKAGE_libwolfssl
|
||||
if PACKAGE_libwolfssl-cpu-crypto
|
||||
comment "Hardware Acceleration does not apply to libwolfssl-cpu-crypto"
|
||||
endif
|
||||
choice
|
||||
prompt "Hardware Acceleration"
|
||||
default WOLFSSL_HAS_NO_HW
|
||||
|
||||
choice
|
||||
prompt "Hardware Acceleration"
|
||||
default WOLFSSL_HAS_NO_HW
|
||||
config WOLFSSL_HAS_NO_HW
|
||||
bool "None"
|
||||
|
||||
config WOLFSSL_HAS_NO_HW
|
||||
bool "None"
|
||||
config WOLFSSL_HAS_AFALG
|
||||
bool "AF_ALG"
|
||||
|
||||
config WOLFSSL_HAS_CPU_CRYPTO
|
||||
bool "Use CPU crypto instructions"
|
||||
depends on WOLFSSL_ASM_CAPABLE
|
||||
help
|
||||
This will use Intel AESNI insturctions or armv8 Crypto Extensions.
|
||||
Either of them should easily outperform hardware crypto in WolfSSL.
|
||||
config WOLFSSL_HAS_DEVCRYPTO_CBC
|
||||
bool "/dev/crytpo - AES-CBC-only"
|
||||
select WOLFSSL_HAS_DEVCRYPTO
|
||||
|
||||
config WOLFSSL_HAS_AFALG
|
||||
bool "AF_ALG"
|
||||
|
||||
config WOLFSSL_HAS_DEVCRYPTO_CBC
|
||||
bool "/dev/crytpo - AES-CBC-only"
|
||||
select WOLFSSL_HAS_DEVCRYPTO
|
||||
|
||||
config WOLFSSL_HAS_DEVCRYPTO_AES
|
||||
bool "/dev/crypto - AES-only (all supported modes)"
|
||||
select WOLFSSL_HAS_DEVCRYPTO
|
||||
|
||||
config WOLFSSL_HAS_DEVCRYPTO_FULL
|
||||
bool "/dev/crypto - full"
|
||||
select WOLFSSL_HAS_DEVCRYPTO
|
||||
endchoice
|
||||
config WOLFSSL_HAS_DEVCRYPTO_AES
|
||||
bool "/dev/crypto - AES-only (all supported modes)"
|
||||
select WOLFSSL_HAS_DEVCRYPTO
|
||||
|
||||
config WOLFSSL_HAS_DEVCRYPTO_FULL
|
||||
bool "/dev/crypto - full"
|
||||
select WOLFSSL_HAS_DEVCRYPTO
|
||||
endchoice
|
||||
endif
|
||||
endmenu
|
||||
|
||||
@ -45,7 +45,6 @@ PKG_ABI_VERSION:=$(patsubst %-stable,%,$(PKG_VERSION)).$(call version_abbrev,$(c
|
||||
|
||||
PKG_CONFIG_DEPENDS+=\
|
||||
CONFIG_WOLFSSL_HAS_AFALG \
|
||||
CONFIG_WOLFSSL_HAS_CPU_CRYPTO \
|
||||
CONFIG_WOLFSSL_HAS_DEVCRYPTO_AES \
|
||||
CONFIG_WOLFSSL_HAS_DEVCRYPTO_CBC \
|
||||
CONFIG_WOLFSSL_HAS_DEVCRYPTO_FULL
|
||||
@ -66,6 +65,9 @@ $(call Package/libwolfssl/Default)
|
||||
PROVIDES:=libcyassl
|
||||
DEPENDS:=+WOLFSSL_HAS_DEVCRYPTO:kmod-cryptodev +WOLFSSL_HAS_AFALG:kmod-crypto-user
|
||||
ABI_VERSION:=$(PKG_ABI_VERSION)
|
||||
VARIANT:=regular
|
||||
DEFAULT_VARIANT:=1
|
||||
CONFLICTS:=libwolfssl-cpu-crypto
|
||||
endef
|
||||
|
||||
define Package/libwolfssl/description
|
||||
@ -77,12 +79,38 @@ define Package/libwolfssl/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/libwolfssl-cpu-crypto
|
||||
$(call Package/libwolfssl/Default)
|
||||
TITLE:=wolfSSL library with AES CPU instructions
|
||||
PROVIDES:=libwolfssl libcyassl
|
||||
DEPENDS:=@((aarch64||x86_64)&&(m||!TARGET_bcm27xx))
|
||||
ABI_VERSION:=$(PKG_ABI_VERSION)
|
||||
VARIANT:=cpu-crypto
|
||||
endef
|
||||
|
||||
define Package/libwolfssl-benchmark
|
||||
$(call Package/libwolfssl/Default)
|
||||
TITLE:=wolfSSL Benchmark Utility
|
||||
DEPENDS:=libwolfssl
|
||||
endef
|
||||
|
||||
define Package/libwolfssl-cpu-crypto/description
|
||||
$(call Package/libwolfssl/description)
|
||||
This variant uses AES CPU instructions (Intel AESNI or ARMv8 Crypto Extension)
|
||||
endef
|
||||
|
||||
define Package/libwolfssl-cpu-crypto/config
|
||||
if TARGET_armvirt && PACKAGE_libwolfssl-cpu-crypto = y
|
||||
comment "You are about to build libwolfssl-cpu-crypto into an armvirt_64 image."
|
||||
comment "Ensure all of your installation targets support the Crypto Extension. "
|
||||
comment "Look for the 'aes' feature in /proc/cpuinfo. This library does not do "
|
||||
comment "run-time detection and will crash if the CPU does not support it. "
|
||||
endif
|
||||
if TARGET_bcm27xx && PACKAGE_libwolfssl-cpu-crypto
|
||||
comment "Beware that libwolfssl-cpu-crypto will not run in a bcm27xx target. "
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/libwolfssl-benchmark/description
|
||||
This is the wolfssl benchmark utility.
|
||||
endef
|
||||
@ -121,11 +149,23 @@ CONFIGURE_ARGS += \
|
||||
--$(if $(CONFIG_WOLFSSL_HAS_DTLS),enable,disable)-dtls \
|
||||
--$(if $(CONFIG_WOLFSSL_HAS_ECC25519),enable,disable)-curve25519 \
|
||||
--$(if $(CONFIG_WOLFSSL_HAS_ECC448),enable,disable)-curve448 \
|
||||
--$(if $(CONFIG_WOLFSSL_HAS_OPENVPN),enable,disable)-openvpn
|
||||
|
||||
ifeq ($(BUILD_VARIANT),regular)
|
||||
CONFIGURE_ARGS += \
|
||||
--$(if $(CONFIG_WOLFSSL_HAS_AFALG),enable,disable)-afalg \
|
||||
--$(if $(CONFIG_WOLFSSL_HAS_OPENVPN),enable,disable)-openvpn \
|
||||
--enable-devcrypto=$(if $(CONFIG_WOLFSSL_HAS_DEVCRYPTO_CBC),cbc\
|
||||
,$(if $(CONFIG_WOLFSSL_HAS_DEVCRYPTO_AES),aes\
|
||||
,$(if $(CONFIG_WOLFSSL_HAS_DEVCRYPTO_FULL),yes,no)))
|
||||
else ifdef CONFIG_aarch64
|
||||
CONFIGURE_ARGS += --enable-armasm
|
||||
TARGET_CFLAGS:=$(TARGET_CFLAGS:-mcpu%=-mcpu%+crypto)
|
||||
WOLFSSL_NOASM_REGEX:=^bcm27xx/.*
|
||||
Package/libwolfssl-cpu-crypto/preinst=\
|
||||
$(subst @@WOLFSSL_NOASM_REGEX@@,$(WOLFSSL_NOASM_REGEX),$(file <preinst.arm-ce))
|
||||
else ifdef CONFIG_TARGET_x86_64
|
||||
CONFIGURE_ARGS += --enable-intelasm
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_WOLFSSL_HAS_OCSP),y)
|
||||
CONFIGURE_ARGS += \
|
||||
@ -137,15 +177,6 @@ CONFIGURE_ARGS += \
|
||||
--enable-wpas --enable-fortress --enable-fastmath
|
||||
endif
|
||||
|
||||
ifdef CONFIG_WOLFSSL_HAS_CPU_CRYPTO
|
||||
ifdef CONFIG_aarch64
|
||||
CONFIGURE_ARGS += --enable-armasm
|
||||
TARGET_CFLAGS:=$(TARGET_CFLAGS:-mcpu%=-mcpu%+crypto)
|
||||
else ifdef CONFIG_TARGET_x86_64
|
||||
CONFIGURE_ARGS += --enable-intelasm
|
||||
endif
|
||||
endif
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
|
||||
@ -163,10 +194,13 @@ define Package/libwolfssl/install
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.so.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
Package/libwolfssl-cpu-crypto/install=$(Package/libwolfssl/install)
|
||||
|
||||
define Package/libwolfssl-benchmark/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(CP) $(PKG_BUILD_DIR)/wolfcrypt/benchmark/.libs/benchmark $(1)/usr/bin/wolfssl-benchmark
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libwolfssl))
|
||||
$(eval $(call BuildPackage,libwolfssl-cpu-crypto))
|
||||
$(eval $(call BuildPackage,libwolfssl-benchmark))
|
||||
|
||||
25
package/libs/wolfssl/preinst.arm-ce
Normal file
25
package/libs/wolfssl/preinst.arm-ce
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
exec >&2
|
||||
printf "[libwolfssl-cpu-crypto] Checking for Arm v8-A Cryptographic Extension support: "
|
||||
if [ -n "${IPKG_INSTROOT}" ]; then
|
||||
printf "...[offline]... "
|
||||
eval "$(grep '^DISTRIB_TARGET=' "${IPKG_INSTROOT}/etc/openwrt_release")"
|
||||
### @@WOLFSSL_NOASM_REGEX@@ is expanded from WOLFSSL_NOASM_REGEX in the Makefile
|
||||
echo "${DISTRIB_TARGET}" | grep '@@WOLFSSL_NOASM_REGEX@@' > /dev/null && {
|
||||
echo "not supported"
|
||||
echo "Error: Target ${DISTRIB_TARGET} does not support Arm Cryptographic Extension."
|
||||
echo "Install the regular libwolfssl package instead of libwolfssl-cpu-crypto."
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
grep -q '^Features.*\baes\b' /proc/cpuinfo || {
|
||||
echo "not supported"
|
||||
echo "Error: Arm v8-A Cryptographic Extension not supported."
|
||||
echo "Install the regular libwolfssl package instead of libwolfssl-cpu-crypto."
|
||||
echo "Contents of /proc/cpuinfo:"
|
||||
cat /proc/cpuinfo
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
echo OK
|
||||
exit 0
|
||||
@ -36,6 +36,7 @@ define Package/ltq-adsl-app
|
||||
TITLE:=Lantiq DSL userland tool
|
||||
URL:=http://www.lantiq.com/
|
||||
DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy||TARGET_lantiq_ase) +libpthread +ltq-dsl-base +libubox +libubus
|
||||
PROVIDES:=ltq-dsl-app
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
@ -77,7 +78,7 @@ TARGET_CFLAGS += -I$(LINUX_DIR)/include
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
$(CP) ../ltq-vdsl-app/src/src/dsl_cpe_ubus.c $(PKG_BUILD_DIR)/src/
|
||||
$(CP) ../ltq-vdsl-vr9-app/src/src/dsl_cpe_ubus.c $(PKG_BUILD_DIR)/src/
|
||||
endef
|
||||
|
||||
define Package/ltq-adsl-app/install
|
||||
|
||||
@ -3,7 +3,7 @@ From: Mathias Kresin <dev@kresin.me>
|
||||
Date: Mon, 16 Oct 2017 21:08:26 +0200
|
||||
Subject: ltq-adsl-app: add more script notifications
|
||||
|
||||
Backport HANDSHAKE and TRAINING notification from ltq-vdsl-app. It
|
||||
Backport HANDSHAKE and TRAINING notification from ltq-vdsl-vr9-app. It
|
||||
unifies the dsl led blinking pattern accross all subtargets and allows
|
||||
to get the current line status from the dsl led.
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ltq-vdsl-app
|
||||
PKG_NAME:=ltq-vdsl-vr9-app
|
||||
PKG_VERSION:=4.17.18.6
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
PKG_BASE_NAME:=dsl_cpe_control
|
||||
@ -17,32 +17,33 @@ PKG_HASH:=da8bb929526a61aea0e153ef524331fcd472a1ebbc6d88ca017735a4f82ece02
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_BASE_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=BSD-2-Clause
|
||||
|
||||
PKG_BUILD_DEPENDS:=ltq-vdsl
|
||||
PKG_BUILD_DEPENDS:=ltq-vdsl-vr9
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ltq-vdsl-app
|
||||
define Package/ltq-vdsl-vr9-app
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Lantiq VDSL userland tool
|
||||
URL:=http://www.lantiq.com/
|
||||
DEPENDS:=@TARGET_lantiq_xrx200 +libpthread +librt +ltq-dsl-base +libubox +libubus
|
||||
PROVIDES:=ltq-dsl-app
|
||||
endef
|
||||
|
||||
define Package/ltq-vdsl-app/description
|
||||
define Package/ltq-vdsl-vr9-app/description
|
||||
Userland tool needed to control Lantiq VDSL CPE
|
||||
endef
|
||||
|
||||
# ltq-vdsl-app uses a header provided by the MEI driver which has some
|
||||
# ltq-vdsl-vr9-app uses a header provided by the MEI driver which has some
|
||||
# conditionals.
|
||||
#
|
||||
# Define them here with the default values they would get in the MEI driver,
|
||||
# have the same view on both sides.
|
||||
#
|
||||
# If you change them, you need to change them for the ltq-vdsl-app as well
|
||||
# If you change them, you need to change them for the ltq-vdsl-vr9-app as well
|
||||
VDSL_APP_CFLAGS = \
|
||||
-DMAX_CLI_PIPES=1 \
|
||||
-DMEI_SUPPORT_DEBUG_STREAMS=1 \
|
||||
@ -69,7 +70,7 @@ CONFIGURE_ARGS += \
|
||||
#CONFIGURE_ARGS += --enable-model=typical
|
||||
#CONFIGURE_ARGS += --enable-model=debug
|
||||
|
||||
define Package/ltq-vdsl-app/install
|
||||
define Package/ltq-vdsl-vr9-app/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin $(1)/etc/hotplug.d/dsl
|
||||
$(INSTALL_BIN) ./files/dsl_control $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/10_atm.sh $(1)/etc/hotplug.d/dsl
|
||||
@ -79,4 +80,4 @@ define Package/ltq-vdsl-app/install
|
||||
$(INSTALL_BIN) ./files/dsl_cpe_pipe.sh $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ltq-vdsl-app))
|
||||
$(eval $(call BuildPackage,ltq-vdsl-vr9-app))
|
||||
@ -9,9 +9,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_URL:=http://w1.fi/hostap.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2022-06-02
|
||||
PKG_SOURCE_VERSION:=4383528e01955d995d3b3db201e4c0f9840e8236
|
||||
PKG_MIRROR_HASH:=1b533287661d4877d56aca8a5b2a53d84d2a90eebe246d8d9b3adf943da7f0a1
|
||||
PKG_SOURCE_DATE:=2022-07-29
|
||||
PKG_SOURCE_VERSION:=b704dc72ef824dfdd96674b90179b274d1d38105
|
||||
PKG_MIRROR_HASH:=6c9dd359ef5a4595b6576e07928566d6864957c4af6466d641d6c3f7717f4689
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
|
||||
@ -16,7 +16,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
|
||||
--- a/src/crypto/crypto_wolfssl.c
|
||||
+++ b/src/crypto/crypto_wolfssl.c
|
||||
@@ -1307,6 +1307,7 @@ int ecc_projective_add_point(ecc_point *
|
||||
@@ -1340,6 +1340,7 @@ int ecc_projective_add_point(ecc_point *
|
||||
|
||||
struct crypto_ec {
|
||||
ecc_key key;
|
||||
@ -24,7 +24,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
mp_int a;
|
||||
mp_int prime;
|
||||
mp_int order;
|
||||
@@ -1361,6 +1362,8 @@ struct crypto_ec * crypto_ec_init(int gr
|
||||
@@ -1394,6 +1395,8 @@ struct crypto_ec * crypto_ec_init(int gr
|
||||
return NULL;
|
||||
|
||||
if (wc_ecc_init(&e->key) != 0 ||
|
||||
@ -33,7 +33,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
wc_ecc_set_curve(&e->key, 0, curve_id) != 0 ||
|
||||
mp_init(&e->a) != MP_OKAY ||
|
||||
mp_init(&e->prime) != MP_OKAY ||
|
||||
@@ -1392,6 +1395,7 @@ void crypto_ec_deinit(struct crypto_ec*
|
||||
@@ -1425,6 +1428,7 @@ void crypto_ec_deinit(struct crypto_ec*
|
||||
mp_clear(&e->order);
|
||||
mp_clear(&e->prime);
|
||||
mp_clear(&e->a);
|
||||
|
||||
@ -14,7 +14,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -2409,7 +2409,7 @@ static int drv_supports_vht(struct wpa_s
|
||||
@@ -2436,7 +2436,7 @@ static int drv_supports_vht(struct wpa_s
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -2418,7 +2418,10 @@ static bool ibss_mesh_is_80mhz_avail(int
|
||||
@@ -2445,7 +2445,10 @@ static bool ibss_mesh_is_80mhz_avail(int
|
||||
|
||||
chan = hw_get_channel_chan(mode, i, NULL);
|
||||
if (!chan ||
|
||||
@ -35,7 +35,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2447,6 +2450,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
@@ -2474,6 +2477,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
int chwidth, seg0, seg1;
|
||||
u32 vht_caps = 0;
|
||||
bool is_24ghz, is_6ghz;
|
||||
@ -44,7 +44,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
|
||||
freq->freq = ssid->frequency;
|
||||
|
||||
@@ -2543,8 +2548,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
@@ -2570,8 +2575,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
return;
|
||||
|
||||
/* Check primary channel flags */
|
||||
@ -57,7 +57,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
|
||||
freq->channel = pri_chan->chan;
|
||||
|
||||
@@ -2577,8 +2585,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
@@ -2604,8 +2612,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
return;
|
||||
|
||||
/* Check secondary channel flags */
|
||||
@ -70,7 +70,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
|
||||
if (ht40 == -1) {
|
||||
if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
|
||||
@@ -2667,7 +2678,7 @@ skip_to_6ghz:
|
||||
@@ -2694,7 +2705,7 @@ skip_to_6ghz:
|
||||
return;
|
||||
|
||||
/* Back to HT configuration if channel not usable */
|
||||
@ -78,8 +78,8 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
+ if (!ibss_mesh_is_80mhz_avail(channel, mode, dfs_enabled))
|
||||
return;
|
||||
|
||||
chwidth = CHANWIDTH_80MHZ;
|
||||
@@ -2681,7 +2692,7 @@ skip_to_6ghz:
|
||||
chwidth = CONF_OPER_CHWIDTH_80MHZ;
|
||||
@@ -2708,7 +2719,7 @@ skip_to_6ghz:
|
||||
* above; check the remaining four 20 MHz channels for the total
|
||||
* of 160 MHz bandwidth.
|
||||
*/
|
||||
@ -88,7 +88,7 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
return;
|
||||
|
||||
for (j = 0; j < ARRAY_SIZE(bw160); j++) {
|
||||
@@ -2711,10 +2722,12 @@ skip_to_6ghz:
|
||||
@@ -2738,10 +2749,12 @@ skip_to_6ghz:
|
||||
if (!chan)
|
||||
continue;
|
||||
|
||||
@ -103,4 +103,4 @@ Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
+ continue;
|
||||
|
||||
/* Found a suitable second segment for 80+80 */
|
||||
chwidth = CHANWIDTH_80P80MHZ;
|
||||
chwidth = CONF_OPER_CHWIDTH_80P80MHZ;
|
||||
|
||||
@ -28,8 +28,8 @@ Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
|
||||
+#include "crypto/crypto.h"
|
||||
|
||||
|
||||
static int dfs_get_used_n_chans(struct hostapd_iface *iface, int *seg1)
|
||||
@@ -483,9 +484,14 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
enum dfs_channel_type {
|
||||
@@ -515,9 +516,14 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
int num_available_chandefs;
|
||||
int chan_idx, chan_idx2;
|
||||
int sec_chan_idx_80p80 = -1;
|
||||
@ -44,7 +44,7 @@ Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
|
||||
wpa_printf(MSG_DEBUG, "DFS: Selecting random channel");
|
||||
*secondary_channel = 0;
|
||||
*oper_centr_freq_seg0_idx = 0;
|
||||
@@ -505,8 +511,20 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
@@ -537,8 +543,20 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
if (num_available_chandefs == 0)
|
||||
return NULL;
|
||||
|
||||
@ -64,11 +64,11 @@ Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
|
||||
return NULL;
|
||||
+
|
||||
chan_idx = _rand % num_available_chandefs;
|
||||
dfs_find_channel(iface, &chan, chan_idx, skip_radar);
|
||||
dfs_find_channel(iface, &chan, chan_idx, type);
|
||||
if (!chan) {
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -9895,6 +9895,10 @@ static int nl80211_switch_channel(void *
|
||||
@@ -9948,6 +9948,10 @@ static int nl80211_switch_channel(void *
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -4944,6 +4944,13 @@ static int add_associated_sta(struct hos
|
||||
@@ -4963,6 +4963,13 @@ static int add_associated_sta(struct hos
|
||||
* drivers to accept the STA parameter configuration. Since this is
|
||||
* after a new FT-over-DS exchange, a new TK has been derived, so key
|
||||
* reinstallation is not a concern for this case.
|
||||
@ -14,7 +14,7 @@
|
||||
*/
|
||||
wpa_printf(MSG_DEBUG, "Add associated STA " MACSTR
|
||||
" (added_unassoc=%d auth_alg=%u ft_over_ds=%u reassoc=%d authorized=%d ft_tk=%d fils_tk=%d)",
|
||||
@@ -4957,7 +4964,8 @@ static int add_associated_sta(struct hos
|
||||
@@ -4976,7 +4983,8 @@ static int add_associated_sta(struct hos
|
||||
(!(sta->flags & WLAN_STA_AUTHORIZED) ||
|
||||
(reassoc && sta->ft_over_ds && sta->auth_alg == WLAN_AUTH_FT) ||
|
||||
(!wpa_auth_sta_ft_tk_already_set(sta->wpa_sm) &&
|
||||
|
||||
@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -3431,7 +3431,7 @@ static int hostapd_change_config_freq(st
|
||||
@@ -3453,7 +3453,7 @@ static int hostapd_change_config_freq(st
|
||||
struct hostapd_freq_params *old_params)
|
||||
{
|
||||
int channel;
|
||||
|
||||
@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <netpacket/packet.h>
|
||||
#include <linux/errqueue.h>
|
||||
@@ -5300,26 +5297,29 @@ fail:
|
||||
@@ -5344,26 +5341,29 @@ fail:
|
||||
|
||||
static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr)
|
||||
{
|
||||
@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (err < 0) {
|
||||
wpa_printf(MSG_DEBUG, "nl80211: bridge FDB entry delete for "
|
||||
MACSTR " ifindex=%d failed: %s", MAC2STR(addr),
|
||||
@@ -5329,9 +5329,8 @@ static void rtnl_neigh_delete_fdb_entry(
|
||||
@@ -5373,9 +5373,8 @@ static void rtnl_neigh_delete_fdb_entry(
|
||||
MACSTR, MAC2STR(addr));
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
}
|
||||
|
||||
|
||||
@@ -7714,7 +7713,6 @@ static void *i802_init(struct hostapd_da
|
||||
@@ -7763,7 +7762,6 @@ static void *i802_init(struct hostapd_da
|
||||
(params->num_bridge == 0 || !params->bridge[0]))
|
||||
add_ifidx(drv, br_ifindex, drv->ifindex);
|
||||
|
||||
@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (bss->added_if_into_bridge || bss->already_in_bridge) {
|
||||
int err;
|
||||
|
||||
@@ -7731,7 +7729,6 @@ static void *i802_init(struct hostapd_da
|
||||
@@ -7780,7 +7778,6 @@ static void *i802_init(struct hostapd_da
|
||||
goto failed;
|
||||
}
|
||||
}
|
||||
@ -92,7 +92,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
@@ -10678,13 +10675,14 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
@@ -10813,13 +10810,14 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
const u8 *ipaddr, int prefixlen,
|
||||
const u8 *addr)
|
||||
{
|
||||
@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
int res;
|
||||
|
||||
if (!ipaddr || prefixlen == 0 || !addr)
|
||||
@@ -10703,85 +10701,66 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
@@ -10838,85 +10836,66 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
}
|
||||
|
||||
if (version == 4) {
|
||||
@ -220,7 +220,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
addrsize = 16;
|
||||
} else {
|
||||
return -EINVAL;
|
||||
@@ -10799,41 +10778,30 @@ static int wpa_driver_br_delete_ip_neigh
|
||||
@@ -10934,41 +10913,30 @@ static int wpa_driver_br_delete_ip_neigh
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -3761,15 +3761,6 @@ static void handle_auth(struct hostapd_d
|
||||
@@ -3781,15 +3781,6 @@ static void handle_auth(struct hostapd_d
|
||||
seq_ctrl);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/hostapd/Makefile
|
||||
+++ b/hostapd/Makefile
|
||||
@@ -323,6 +323,7 @@ ifdef CONFIG_FILS
|
||||
@@ -324,6 +324,7 @@ ifdef CONFIG_FILS
|
||||
CFLAGS += -DCONFIG_FILS
|
||||
OBJS += ../src/ap/fils_hlp.o
|
||||
NEED_SHA384=y
|
||||
@ -10,7 +10,7 @@
|
||||
CFLAGS += -DCONFIG_FILS_SK_PFS
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -312,6 +312,7 @@ endif
|
||||
@@ -320,6 +320,7 @@ endif
|
||||
ifdef CONFIG_FILS
|
||||
CFLAGS += -DCONFIG_FILS
|
||||
NEED_SHA384=y
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
OBJS += ../src/ap/vlan_init.o
|
||||
OBJS += ../src/ap/vlan_ifconfig.o
|
||||
OBJS += ../src/ap/vlan.o
|
||||
@@ -350,10 +352,14 @@ CFLAGS += -DCONFIG_MBO
|
||||
@@ -357,10 +359,14 @@ CFLAGS += -DCONFIG_MBO
|
||||
OBJS += ../src/ap/mbo_ap.o
|
||||
endif
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
LIBS += $(DRV_AP_LIBS)
|
||||
|
||||
ifdef CONFIG_L2_PACKET
|
||||
@@ -1281,6 +1287,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
|
||||
@@ -1291,6 +1297,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR)
|
||||
_OBJS_VAR := OBJS
|
||||
include ../src/objs.mk
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
hostapd: $(OBJS)
|
||||
$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
|
||||
@$(E) " LD " $@
|
||||
@@ -1355,6 +1367,12 @@ include ../src/objs.mk
|
||||
@@ -1365,6 +1377,12 @@ include ../src/objs.mk
|
||||
_OBJS_VAR := SOBJS
|
||||
include ../src/objs.mk
|
||||
|
||||
@ -64,15 +64,15 @@
|
||||
@$(E) " LD " $@
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -17,6 +17,7 @@ endif
|
||||
@@ -10,6 +10,7 @@ ALL += dbus/fi.w1.wpa_supplicant1.servic
|
||||
EXTRA_TARGETS=dynamic_eap_methods
|
||||
|
||||
CONFIG_FILE=.config
|
||||
+-include $(if $(MULTICALL),../hostapd/.config)
|
||||
include ../src/build.rules
|
||||
|
||||
ifdef LIBS
|
||||
@@ -363,7 +364,9 @@ endif
|
||||
ifdef CONFIG_BUILD_WPA_CLIENT_SO
|
||||
@@ -371,7 +372,9 @@ endif
|
||||
ifdef CONFIG_IBSS_RSN
|
||||
NEED_RSN_AUTHENTICATOR=y
|
||||
CFLAGS += -DCONFIG_IBSS_RSN
|
||||
@ -82,7 +82,7 @@
|
||||
OBJS += ibss_rsn.o
|
||||
endif
|
||||
|
||||
@@ -900,6 +903,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
|
||||
@@ -912,6 +915,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
|
||||
CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
|
||||
LIBS += -ldl -rdynamic
|
||||
endif
|
||||
@ -93,7 +93,7 @@
|
||||
endif
|
||||
|
||||
ifdef CONFIG_AP
|
||||
@@ -907,9 +914,11 @@ NEED_EAP_COMMON=y
|
||||
@@ -919,9 +926,11 @@ NEED_EAP_COMMON=y
|
||||
NEED_RSN_AUTHENTICATOR=y
|
||||
CFLAGS += -DCONFIG_AP
|
||||
OBJS += ap.o
|
||||
@ -105,7 +105,7 @@
|
||||
OBJS += ../src/ap/hostapd.o
|
||||
OBJS += ../src/ap/wpa_auth_glue.o
|
||||
OBJS += ../src/ap/utils.o
|
||||
@@ -989,6 +998,12 @@ endif
|
||||
@@ -1008,6 +1017,12 @@ endif
|
||||
ifdef CONFIG_HS20
|
||||
OBJS += ../src/ap/hs20.o
|
||||
endif
|
||||
@ -118,7 +118,7 @@
|
||||
endif
|
||||
|
||||
ifdef CONFIG_MBO
|
||||
@@ -997,7 +1012,9 @@ CFLAGS += -DCONFIG_MBO
|
||||
@@ -1016,7 +1031,9 @@ CFLAGS += -DCONFIG_MBO
|
||||
endif
|
||||
|
||||
ifdef NEED_RSN_AUTHENTICATOR
|
||||
@ -128,7 +128,7 @@
|
||||
NEED_AES_WRAP=y
|
||||
OBJS += ../src/ap/wpa_auth.o
|
||||
OBJS += ../src/ap/wpa_auth_ie.o
|
||||
@@ -1891,6 +1908,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
|
||||
@@ -1920,6 +1937,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
|
||||
|
||||
_OBJS_VAR := OBJS
|
||||
include ../src/objs.mk
|
||||
@ -141,7 +141,7 @@
|
||||
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
|
||||
$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
|
||||
@$(E) " LD " $@
|
||||
@@ -2023,6 +2046,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK)
|
||||
@@ -2052,6 +2075,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK)
|
||||
$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
|
||||
@$(E) " sed" $<
|
||||
|
||||
@ -156,7 +156,7 @@
|
||||
wpa_cli.exe: wpa_cli
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -6033,8 +6033,8 @@ union wpa_event_data {
|
||||
@@ -6171,8 +6171,8 @@ union wpa_event_data {
|
||||
* Driver wrapper code should call this function whenever an event is received
|
||||
* from the driver.
|
||||
*/
|
||||
@ -167,7 +167,7 @@
|
||||
|
||||
/**
|
||||
* wpa_supplicant_event_global - Report a driver event for wpa_supplicant
|
||||
@@ -6046,7 +6046,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
@@ -6184,7 +6184,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
* Same as wpa_supplicant_event(), but we search for the interface in
|
||||
* wpa_global.
|
||||
*/
|
||||
@ -178,7 +178,7 @@
|
||||
/*
|
||||
--- a/src/ap/drv_callbacks.c
|
||||
+++ b/src/ap/drv_callbacks.c
|
||||
@@ -1842,8 +1842,8 @@ err:
|
||||
@@ -1872,8 +1872,8 @@ err:
|
||||
#endif /* CONFIG_OWE */
|
||||
|
||||
|
||||
@ -189,7 +189,7 @@
|
||||
{
|
||||
struct hostapd_data *hapd = ctx;
|
||||
#ifndef CONFIG_NO_STDOUT_DEBUG
|
||||
@@ -2088,7 +2088,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
@@ -2145,7 +2145,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
}
|
||||
|
||||
|
||||
@ -220,7 +220,7 @@
|
||||
union wpa_event_data *data)
|
||||
{
|
||||
struct wpa_priv_global *global = ctx;
|
||||
@@ -1215,6 +1215,8 @@ int main(int argc, char *argv[])
|
||||
@@ -1216,6 +1216,8 @@ int main(int argc, char *argv[])
|
||||
if (os_program_init())
|
||||
return -1;
|
||||
|
||||
@ -231,7 +231,7 @@
|
||||
os_memset(&global, 0, sizeof(global));
|
||||
--- a/wpa_supplicant/events.c
|
||||
+++ b/wpa_supplicant/events.c
|
||||
@@ -4891,8 +4891,8 @@ static void wpas_event_unprot_beacon(str
|
||||
@@ -4953,8 +4953,8 @@ static void wpas_event_unprot_beacon(str
|
||||
}
|
||||
|
||||
|
||||
@ -242,7 +242,7 @@
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = ctx;
|
||||
int resched;
|
||||
@@ -5745,7 +5745,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
@@ -5813,7 +5813,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
}
|
||||
|
||||
|
||||
@ -253,7 +253,7 @@
|
||||
struct wpa_supplicant *wpa_s;
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -7043,7 +7043,6 @@ struct wpa_interface * wpa_supplicant_ma
|
||||
@@ -7087,7 +7087,6 @@ struct wpa_interface * wpa_supplicant_ma
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -261,7 +261,7 @@
|
||||
/**
|
||||
* wpa_supplicant_match_existing - Match existing interfaces
|
||||
* @global: Pointer to global data from wpa_supplicant_init()
|
||||
@@ -7078,6 +7077,11 @@ static int wpa_supplicant_match_existing
|
||||
@@ -7122,6 +7121,11 @@ static int wpa_supplicant_match_existing
|
||||
|
||||
#endif /* CONFIG_MATCH_IFACE */
|
||||
|
||||
@ -273,7 +273,7 @@
|
||||
|
||||
/**
|
||||
* wpa_supplicant_add_iface - Add a new network interface
|
||||
@@ -7334,6 +7338,8 @@ struct wpa_global * wpa_supplicant_init(
|
||||
@@ -7378,6 +7382,8 @@ struct wpa_global * wpa_supplicant_init(
|
||||
#ifndef CONFIG_NO_WPA_MSG
|
||||
wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
|
||||
#endif /* CONFIG_NO_WPA_MSG */
|
||||
@ -284,7 +284,7 @@
|
||||
wpa_debug_open_file(params->wpa_debug_file_path);
|
||||
--- a/hostapd/main.c
|
||||
+++ b/hostapd/main.c
|
||||
@@ -590,6 +590,11 @@ fail:
|
||||
@@ -591,6 +591,11 @@ fail:
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -296,14 +296,14 @@
|
||||
|
||||
#ifdef CONFIG_WPS
|
||||
static int gen_uuid(const char *txt_addr)
|
||||
@@ -683,6 +688,8 @@ int main(int argc, char *argv[])
|
||||
@@ -684,6 +689,8 @@ int main(int argc, char *argv[])
|
||||
return -1;
|
||||
#endif /* CONFIG_DPP */
|
||||
|
||||
+ wpa_supplicant_event = hostapd_wpa_event;
|
||||
+ wpa_supplicant_event_global = hostapd_wpa_event_global;
|
||||
for (;;) {
|
||||
c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:");
|
||||
c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:q");
|
||||
if (c < 0)
|
||||
--- a/src/drivers/drivers.c
|
||||
+++ b/src/drivers/drivers.c
|
||||
@ -320,7 +320,7 @@
|
||||
{
|
||||
--- a/wpa_supplicant/eapol_test.c
|
||||
+++ b/wpa_supplicant/eapol_test.c
|
||||
@@ -30,7 +30,12 @@
|
||||
@@ -31,7 +31,12 @@
|
||||
#include "ctrl_iface.h"
|
||||
#include "pcsc_funcs.h"
|
||||
#include "wpas_glue.h"
|
||||
@ -333,7 +333,7 @@
|
||||
|
||||
const struct wpa_driver_ops *const wpa_drivers[] = { NULL };
|
||||
|
||||
@@ -1291,6 +1296,10 @@ static void usage(void)
|
||||
@@ -1303,6 +1308,10 @@ static void usage(void)
|
||||
"option several times.\n");
|
||||
}
|
||||
|
||||
@ -344,7 +344,7 @@
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@@ -1311,6 +1320,8 @@ int main(int argc, char *argv[])
|
||||
@@ -1323,6 +1332,8 @@ int main(int argc, char *argv[])
|
||||
if (os_program_init())
|
||||
return -1;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -3474,6 +3474,10 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -3439,6 +3439,10 @@ static int hostapd_config_fill(struct ho
|
||||
if (bss->ocv && !bss->ieee80211w)
|
||||
bss->ieee80211w = 1;
|
||||
#endif /* CONFIG_OCV */
|
||||
@ -13,7 +13,7 @@
|
||||
} else if (os_strcmp(buf, "ht_capab") == 0) {
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -1014,6 +1014,8 @@ struct hostapd_config {
|
||||
@@ -1043,6 +1043,8 @@ struct hostapd_config {
|
||||
|
||||
int ht_op_mode_fixed;
|
||||
u16 ht_capab;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/wpa_supplicant/config.c
|
||||
+++ b/wpa_supplicant/config.c
|
||||
@@ -2532,6 +2532,7 @@ static const struct parse_data ssid_fiel
|
||||
@@ -2555,6 +2555,7 @@ static const struct parse_data ssid_fiel
|
||||
#else /* CONFIG_MESH */
|
||||
{ INT_RANGE(mode, 0, 4) },
|
||||
#endif /* CONFIG_MESH */
|
||||
@ -10,7 +10,7 @@
|
||||
{ STR(id_str) },
|
||||
--- a/wpa_supplicant/config_file.c
|
||||
+++ b/wpa_supplicant/config_file.c
|
||||
@@ -769,6 +769,7 @@ static void wpa_config_write_network(FIL
|
||||
@@ -766,6 +766,7 @@ static void wpa_config_write_network(FIL
|
||||
#endif /* IEEE8021X_EAPOL */
|
||||
INT(mode);
|
||||
INT(no_auto_peer);
|
||||
@ -20,7 +20,7 @@
|
||||
INT(enable_edmg);
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -505,6 +505,8 @@ static int wpa_supplicant_mesh_init(stru
|
||||
@@ -506,6 +506,8 @@ static int wpa_supplicant_mesh_init(stru
|
||||
frequency);
|
||||
goto out_free;
|
||||
}
|
||||
@ -31,7 +31,7 @@
|
||||
/*
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -2436,7 +2436,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
@@ -2463,7 +2463,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
int ieee80211_mode = wpas_mode_to_ieee80211_mode(ssid->mode);
|
||||
enum hostapd_hw_mode hw_mode;
|
||||
struct hostapd_hw_modes *mode = NULL;
|
||||
@ -40,7 +40,7 @@
|
||||
184, 192 };
|
||||
int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955,
|
||||
6035, 6115, 6195, 6275, 6355, 6435, 6515,
|
||||
@@ -2444,7 +2444,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
@@ -2471,7 +2471,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
int bw160[] = { 5955, 6115, 6275, 6435, 6595, 6755, 6915 };
|
||||
struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL;
|
||||
u8 channel;
|
||||
@ -49,7 +49,7 @@
|
||||
unsigned int j, k;
|
||||
struct hostapd_freq_params vht_freq;
|
||||
int chwidth, seg0, seg1;
|
||||
@@ -2535,7 +2535,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
@@ -2562,7 +2562,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
#endif /* CONFIG_HE_OVERRIDES */
|
||||
|
||||
/* Setup higher BW only for 5 GHz */
|
||||
@ -60,7 +60,7 @@
|
||||
for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) {
|
||||
--- a/wpa_supplicant/config_ssid.h
|
||||
+++ b/wpa_supplicant/config_ssid.h
|
||||
@@ -974,6 +974,8 @@ struct wpa_ssid {
|
||||
@@ -981,6 +981,8 @@ struct wpa_ssid {
|
||||
*/
|
||||
int no_auto_peer;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -5377,7 +5377,7 @@ wpa_supplicant_alloc(struct wpa_supplica
|
||||
@@ -5419,7 +5419,7 @@ wpa_supplicant_alloc(struct wpa_supplica
|
||||
if (wpa_s == NULL)
|
||||
return NULL;
|
||||
wpa_s->scan_req = INITIAL_SCAN_REQ;
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -4986,7 +4986,7 @@ static int nl80211_set_channel(struct i8
|
||||
freq->freq, freq->ht_enabled, freq->vht_enabled, freq->he_enabled,
|
||||
freq->bandwidth, freq->center_freq1, freq->center_freq2);
|
||||
@@ -5022,7 +5022,7 @@ static int nl80211_set_channel(struct i8
|
||||
freq->he_enabled, freq->eht_enabled, freq->bandwidth,
|
||||
freq->center_freq1, freq->center_freq2);
|
||||
|
||||
- msg = nl80211_drv_msg(drv, 0, set_chan ? NL80211_CMD_SET_CHANNEL :
|
||||
+ msg = nl80211_bss_msg(bss, 0, set_chan ? NL80211_CMD_SET_CHANNEL :
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -115,6 +115,29 @@ static void hostapd_reload_bss(struct ho
|
||||
@@ -119,6 +119,29 @@ static void hostapd_reload_bss(struct ho
|
||||
#endif /* CONFIG_NO_RADIUS */
|
||||
|
||||
ssid = &hapd->conf->ssid;
|
||||
@ -30,7 +30,7 @@
|
||||
if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next &&
|
||||
ssid->wpa_passphrase_set && ssid->wpa_passphrase) {
|
||||
/*
|
||||
@@ -216,6 +238,7 @@ int hostapd_reload_config(struct hostapd
|
||||
@@ -220,6 +243,7 @@ int hostapd_reload_config(struct hostapd
|
||||
struct hostapd_data *hapd = iface->bss[0];
|
||||
struct hostapd_config *newconf, *oldconf;
|
||||
size_t j;
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
if (iface->config_fname == NULL) {
|
||||
/* Only in-memory config in use - assume it has been updated */
|
||||
@@ -266,24 +289,20 @@ int hostapd_reload_config(struct hostapd
|
||||
@@ -270,24 +294,20 @@ int hostapd_reload_config(struct hostapd
|
||||
}
|
||||
iface->conf = newconf;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/wpa_supplicant/ap.c
|
||||
+++ b/wpa_supplicant/ap.c
|
||||
@@ -1611,15 +1611,35 @@ int ap_switch_channel(struct wpa_supplic
|
||||
@@ -1803,15 +1803,35 @@ int ap_switch_channel(struct wpa_supplic
|
||||
|
||||
|
||||
#ifdef CONFIG_CTRL_IFACE
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -2932,11 +2932,11 @@ static int wpa_driver_nl80211_del_beacon
|
||||
@@ -2938,11 +2938,11 @@ static int wpa_driver_nl80211_del_beacon
|
||||
struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)",
|
||||
@ -14,7 +14,7 @@
|
||||
return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -5650,7 +5650,7 @@ static void nl80211_teardown_ap(struct i
|
||||
@@ -5661,7 +5661,7 @@ static void nl80211_teardown_ap(struct i
|
||||
nl80211_mgmt_unsubscribe(bss, "AP teardown");
|
||||
|
||||
nl80211_put_wiphy_data_ap(bss);
|
||||
@ -23,7 +23,7 @@
|
||||
}
|
||||
|
||||
|
||||
@@ -8104,8 +8104,6 @@ static int wpa_driver_nl80211_if_remove(
|
||||
@@ -8120,8 +8120,6 @@ static int wpa_driver_nl80211_if_remove(
|
||||
} else {
|
||||
wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
|
||||
nl80211_teardown_ap(bss);
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
|
||||
#ifdef NEED_AP_MLME
|
||||
static int hostapd_ctrl_iface_sa_query(struct hostapd_data *hapd,
|
||||
@@ -3771,6 +3828,8 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
@@ -3449,6 +3506,8 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
} else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
|
||||
reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
|
||||
reply_size);
|
||||
@ -89,7 +89,7 @@
|
||||
#ifdef RADIUS_SERVER
|
||||
--- a/src/ap/ctrl_iface_ap.c
|
||||
+++ b/src/ap/ctrl_iface_ap.c
|
||||
@@ -927,7 +927,13 @@ int hostapd_parse_csa_settings(const cha
|
||||
@@ -945,7 +945,13 @@ int hostapd_parse_csa_settings(const cha
|
||||
|
||||
int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd)
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -108,6 +108,8 @@ OBJS_c += ../src/utils/common.o
|
||||
@@ -115,6 +115,8 @@ OBJS_c += ../src/utils/common.o
|
||||
OBJS_c += ../src/common/cli.o
|
||||
OBJS += wmm_ac.o
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
dst->flags = src->flags;
|
||||
os_memcpy(dst->bssid, src->bssid, ETH_ALEN);
|
||||
dst->freq = src->freq;
|
||||
@@ -294,6 +299,15 @@ static void wpa_bss_copy_res(struct wpa_
|
||||
@@ -295,6 +300,15 @@ static void wpa_bss_copy_res(struct wpa_
|
||||
dst->est_throughput = src->est_throughput;
|
||||
dst->snr = src->snr;
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
/** Beacon interval in TUs (host byte order) */
|
||||
--- a/wpa_supplicant/main.c
|
||||
+++ b/wpa_supplicant/main.c
|
||||
@@ -34,7 +34,7 @@ static void usage(void)
|
||||
@@ -35,7 +35,7 @@ static void usage(void)
|
||||
"vW] [-P<pid file>] "
|
||||
"[-g<global ctrl>] \\\n"
|
||||
" [-G<group>] \\\n"
|
||||
@ -70,7 +70,7 @@
|
||||
"[-p<driver_param>] \\\n"
|
||||
" [-b<br_ifname>] [-e<entropy file>]"
|
||||
#ifdef CONFIG_DEBUG_FILE
|
||||
@@ -74,6 +74,7 @@ static void usage(void)
|
||||
@@ -75,6 +75,7 @@ static void usage(void)
|
||||
" -g = global ctrl_interface\n"
|
||||
" -G = global ctrl_interface group\n"
|
||||
" -h = show this help text\n"
|
||||
@ -78,7 +78,7 @@
|
||||
" -i = interface name\n"
|
||||
" -I = additional configuration file\n"
|
||||
" -K = include keys (passwords, etc.) in debug output\n"
|
||||
@@ -201,7 +202,7 @@ int main(int argc, char *argv[])
|
||||
@@ -202,7 +203,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (;;) {
|
||||
c = getopt(argc, argv,
|
||||
@ -87,7 +87,7 @@
|
||||
if (c < 0)
|
||||
break;
|
||||
switch (c) {
|
||||
@@ -248,6 +249,9 @@ int main(int argc, char *argv[])
|
||||
@@ -249,6 +250,9 @@ int main(int argc, char *argv[])
|
||||
usage();
|
||||
exitcode = 0;
|
||||
goto out;
|
||||
@ -99,7 +99,7 @@
|
||||
break;
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -130,6 +130,54 @@ static void wpas_update_fils_connect_par
|
||||
@@ -131,6 +131,54 @@ static void wpas_update_fils_connect_par
|
||||
static void wpas_update_owe_connect_params(struct wpa_supplicant *wpa_s);
|
||||
#endif /* CONFIG_OWE */
|
||||
|
||||
@ -154,7 +154,7 @@
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
/* Configure default/group WEP keys for static WEP */
|
||||
@@ -1015,6 +1063,8 @@ void wpa_supplicant_set_state(struct wpa
|
||||
@@ -1016,6 +1064,8 @@ void wpa_supplicant_set_state(struct wpa
|
||||
|
||||
sme_sched_obss_scan(wpa_s, 1);
|
||||
|
||||
@ -163,7 +163,7 @@
|
||||
#if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL)
|
||||
if (!fils_hlp_sent && ssid && ssid->eap.erp)
|
||||
update_fils_connect_params = true;
|
||||
@@ -1025,6 +1075,8 @@ void wpa_supplicant_set_state(struct wpa
|
||||
@@ -1026,6 +1076,8 @@ void wpa_supplicant_set_state(struct wpa
|
||||
#endif /* CONFIG_OWE */
|
||||
} else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING ||
|
||||
state == WPA_ASSOCIATED) {
|
||||
@ -172,7 +172,7 @@
|
||||
wpa_s->new_connection = 1;
|
||||
wpa_drv_set_operstate(wpa_s, 0);
|
||||
#ifndef IEEE8021X_EAPOL
|
||||
@@ -2308,6 +2360,8 @@ void wpa_supplicant_associate(struct wpa
|
||||
@@ -2335,6 +2387,8 @@ void wpa_supplicant_associate(struct wpa
|
||||
return;
|
||||
}
|
||||
wpa_s->current_bss = bss;
|
||||
@ -181,7 +181,7 @@
|
||||
#else /* CONFIG_MESH */
|
||||
wpa_msg(wpa_s, MSG_ERROR,
|
||||
"mesh mode support not included in the build");
|
||||
@@ -6650,6 +6704,16 @@ static int wpa_supplicant_init_iface(str
|
||||
@@ -6693,6 +6747,16 @@ static int wpa_supplicant_init_iface(str
|
||||
sizeof(wpa_s->bridge_ifname));
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@
|
||||
/* RSNA Supplicant Key Management - INITIALIZE */
|
||||
eapol_sm_notify_portEnabled(wpa_s->eapol, false);
|
||||
eapol_sm_notify_portValid(wpa_s->eapol, false);
|
||||
@@ -6987,6 +7051,11 @@ static void wpa_supplicant_deinit_iface(
|
||||
@@ -7031,6 +7095,11 @@ static void wpa_supplicant_deinit_iface(
|
||||
if (terminate)
|
||||
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);
|
||||
|
||||
@ -212,7 +212,7 @@
|
||||
|
||||
--- a/wpa_supplicant/wpa_supplicant_i.h
|
||||
+++ b/wpa_supplicant/wpa_supplicant_i.h
|
||||
@@ -104,6 +104,11 @@ struct wpa_interface {
|
||||
@@ -105,6 +105,11 @@ struct wpa_interface {
|
||||
const char *ifname;
|
||||
|
||||
/**
|
||||
@ -224,7 +224,7 @@
|
||||
* bridge_ifname - Optional bridge interface name
|
||||
*
|
||||
* If the driver interface (ifname) is included in a Linux bridge
|
||||
@@ -718,6 +723,8 @@ struct wpa_supplicant {
|
||||
@@ -717,6 +722,8 @@ struct wpa_supplicant {
|
||||
#endif /* CONFIG_CTRL_IFACE_BINDER */
|
||||
char bridge_ifname[16];
|
||||
|
||||
@ -235,7 +235,7 @@
|
||||
|
||||
--- a/hostapd/ctrl_iface.c
|
||||
+++ b/hostapd/ctrl_iface.c
|
||||
@@ -2889,6 +2889,12 @@ static int hostapd_ctrl_iface_chan_switc
|
||||
@@ -2641,6 +2641,12 @@ static int hostapd_ctrl_iface_chan_switc
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -247,10 +247,10 @@
|
||||
+
|
||||
for (i = 0; i < iface->num_bss; i++) {
|
||||
|
||||
/* Save CHAN_SWITCH VHT and HE config */
|
||||
/* Save CHAN_SWITCH VHT, HE, and EHT config */
|
||||
--- a/src/ap/beacon.c
|
||||
+++ b/src/ap/beacon.c
|
||||
@@ -1791,11 +1791,6 @@ static int __ieee802_11_set_beacon(struc
|
||||
@@ -1903,11 +1903,6 @@ static int __ieee802_11_set_beacon(struc
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -264,7 +264,7 @@
|
||||
if (ieee802_11_build_ap_params(hapd, ¶ms) < 0)
|
||||
--- a/wpa_supplicant/events.c
|
||||
+++ b/wpa_supplicant/events.c
|
||||
@@ -4891,6 +4891,60 @@ static void wpas_event_unprot_beacon(str
|
||||
@@ -4953,6 +4953,60 @@ static void wpas_event_unprot_beacon(str
|
||||
}
|
||||
|
||||
|
||||
@ -325,7 +325,7 @@
|
||||
void supplicant_event(void *ctx, enum wpa_event_type event,
|
||||
union wpa_event_data *data)
|
||||
{
|
||||
@@ -5206,8 +5260,10 @@ void supplicant_event(void *ctx, enum wp
|
||||
@@ -5268,8 +5322,10 @@ void supplicant_event(void *ctx, enum wp
|
||||
channel_width_to_string(data->ch_switch.ch_width),
|
||||
data->ch_switch.cf1,
|
||||
data->ch_switch.cf2);
|
||||
@ -339,7 +339,7 @@
|
||||
wpa_s->current_ssid->frequency = data->ch_switch.freq;
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -5837,6 +5837,7 @@ union wpa_event_data {
|
||||
@@ -5968,6 +5968,7 @@ union wpa_event_data {
|
||||
|
||||
/**
|
||||
* struct ch_switch
|
||||
@ -347,7 +347,7 @@
|
||||
* @freq: Frequency of new channel in MHz
|
||||
* @ht_enabled: Whether this is an HT channel
|
||||
* @ch_offset: Secondary channel offset
|
||||
@@ -5845,6 +5846,7 @@ union wpa_event_data {
|
||||
@@ -5976,6 +5977,7 @@ union wpa_event_data {
|
||||
* @cf2: Center frequency 2
|
||||
*/
|
||||
struct ch_switch {
|
||||
@ -357,7 +357,7 @@
|
||||
int ch_offset;
|
||||
--- a/src/drivers/driver_nl80211_event.c
|
||||
+++ b/src/drivers/driver_nl80211_event.c
|
||||
@@ -684,7 +684,7 @@ static void mlme_event_ch_switch(struct
|
||||
@@ -694,7 +694,7 @@ static void mlme_event_ch_switch(struct
|
||||
struct nlattr *ifindex, struct nlattr *freq,
|
||||
struct nlattr *type, struct nlattr *bw,
|
||||
struct nlattr *cf1, struct nlattr *cf2,
|
||||
@ -366,7 +366,7 @@
|
||||
{
|
||||
struct i802_bss *bss;
|
||||
union wpa_event_data data;
|
||||
@@ -745,6 +745,8 @@ static void mlme_event_ch_switch(struct
|
||||
@@ -755,6 +755,8 @@ static void mlme_event_ch_switch(struct
|
||||
data.ch_switch.cf1 = nla_get_u32(cf1);
|
||||
if (cf2)
|
||||
data.ch_switch.cf2 = nla_get_u32(cf2);
|
||||
@ -375,7 +375,7 @@
|
||||
|
||||
if (finished)
|
||||
bss->freq = data.ch_switch.freq;
|
||||
@@ -3003,6 +3005,7 @@ static void do_process_drv_event(struct
|
||||
@@ -3113,6 +3115,7 @@ static void do_process_drv_event(struct
|
||||
tb[NL80211_ATTR_CHANNEL_WIDTH],
|
||||
tb[NL80211_ATTR_CENTER_FREQ1],
|
||||
tb[NL80211_ATTR_CENTER_FREQ2],
|
||||
@ -383,7 +383,7 @@
|
||||
0);
|
||||
break;
|
||||
case NL80211_CMD_CH_SWITCH_NOTIFY:
|
||||
@@ -3013,6 +3016,7 @@ static void do_process_drv_event(struct
|
||||
@@ -3123,6 +3126,7 @@ static void do_process_drv_event(struct
|
||||
tb[NL80211_ATTR_CHANNEL_WIDTH],
|
||||
tb[NL80211_ATTR_CENTER_FREQ1],
|
||||
tb[NL80211_ATTR_CENTER_FREQ2],
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
else
|
||||
--- a/hostapd/ctrl_iface.c
|
||||
+++ b/hostapd/ctrl_iface.c
|
||||
@@ -3587,6 +3587,7 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
@@ -3265,6 +3265,7 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
reply_size);
|
||||
} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
|
||||
reply_len = hostapd_drv_status(hapd, reply, reply_size);
|
||||
@ -20,7 +20,7 @@
|
||||
} else if (os_strcmp(buf, "MIB") == 0) {
|
||||
reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
|
||||
if (reply_len >= 0) {
|
||||
@@ -3628,6 +3629,7 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
@@ -3306,6 +3307,7 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
|
||||
reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
|
||||
reply_size);
|
||||
@ -30,7 +30,7 @@
|
||||
reply_len = -1;
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -958,6 +958,9 @@ ifdef CONFIG_FILS
|
||||
@@ -973,6 +973,9 @@ ifdef CONFIG_FILS
|
||||
OBJS += ../src/ap/fils_hlp.o
|
||||
endif
|
||||
ifdef CONFIG_CTRL_IFACE
|
||||
@ -42,7 +42,7 @@
|
||||
|
||||
--- a/wpa_supplicant/ctrl_iface.c
|
||||
+++ b/wpa_supplicant/ctrl_iface.c
|
||||
@@ -2314,7 +2314,7 @@ static int wpa_supplicant_ctrl_iface_sta
|
||||
@@ -2325,7 +2325,7 @@ static int wpa_supplicant_ctrl_iface_sta
|
||||
pos += ret;
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
if (wpa_s->ap_iface) {
|
||||
pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos,
|
||||
end - pos,
|
||||
@@ -11494,6 +11494,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
@@ -11565,6 +11565,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
reply_len = -1;
|
||||
} else if (os_strncmp(buf, "NOTE ", 5) == 0) {
|
||||
wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
|
||||
@ -59,7 +59,7 @@
|
||||
} else if (os_strcmp(buf, "MIB") == 0) {
|
||||
reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
|
||||
if (reply_len >= 0) {
|
||||
@@ -11506,6 +11507,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
@@ -11577,6 +11578,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
reply_size - reply_len);
|
||||
#endif /* CONFIG_MACSEC */
|
||||
}
|
||||
@ -67,7 +67,7 @@
|
||||
} else if (os_strncmp(buf, "STATUS", 6) == 0) {
|
||||
reply_len = wpa_supplicant_ctrl_iface_status(
|
||||
wpa_s, buf + 6, reply, reply_size);
|
||||
@@ -11994,6 +11996,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
@@ -12065,6 +12067,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
reply_len = wpa_supplicant_ctrl_iface_bss(
|
||||
wpa_s, buf + 4, reply, reply_size);
|
||||
#ifdef CONFIG_AP
|
||||
@ -75,7 +75,7 @@
|
||||
} else if (os_strcmp(buf, "STA-FIRST") == 0) {
|
||||
reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
|
||||
} else if (os_strncmp(buf, "STA ", 4) == 0) {
|
||||
@@ -12002,12 +12005,15 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
@@ -12073,12 +12076,15 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
|
||||
reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
|
||||
reply_size);
|
||||
@ -93,15 +93,15 @@
|
||||
reply_len = -1;
|
||||
--- a/src/ap/ctrl_iface_ap.c
|
||||
+++ b/src/ap/ctrl_iface_ap.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "mbo_ap.h"
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "taxonomy.h"
|
||||
#include "wnm_ap.h"
|
||||
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
|
||||
static size_t hostapd_write_ht_mcs_bitmask(char *buf, size_t buflen,
|
||||
size_t curr_len, const u8 *mcs_set)
|
||||
@@ -459,6 +460,7 @@ int hostapd_ctrl_iface_sta_next(struct h
|
||||
@@ -460,6 +461,7 @@ int hostapd_ctrl_iface_sta_next(struct h
|
||||
return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@
|
||||
|
||||
#ifdef CONFIG_P2P_MANAGER
|
||||
static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
|
||||
@@ -815,12 +817,12 @@ int hostapd_ctrl_iface_status(struct hos
|
||||
@@ -832,12 +834,12 @@ int hostapd_ctrl_iface_status(struct hos
|
||||
return len;
|
||||
len += ret;
|
||||
}
|
||||
@ -126,7 +126,7 @@
|
||||
if (os_snprintf_error(buflen - len, ret))
|
||||
--- a/src/ap/ieee802_1x.c
|
||||
+++ b/src/ap/ieee802_1x.c
|
||||
@@ -2712,6 +2712,7 @@ static const char * bool_txt(bool val)
|
||||
@@ -2740,6 +2740,7 @@ static const char * bool_txt(bool val)
|
||||
return val ? "TRUE" : "FALSE";
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@
|
||||
|
||||
int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
|
||||
{
|
||||
@@ -2898,6 +2899,7 @@ int ieee802_1x_get_mib_sta(struct hostap
|
||||
@@ -2926,6 +2927,7 @@ int ieee802_1x_get_mib_sta(struct hostap
|
||||
return len;
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@
|
||||
static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx)
|
||||
--- a/src/ap/wpa_auth.c
|
||||
+++ b/src/ap/wpa_auth.c
|
||||
@@ -4519,6 +4519,7 @@ static const char * wpa_bool_txt(int val
|
||||
@@ -4559,6 +4559,7 @@ static const char * wpa_bool_txt(int val
|
||||
return val ? "TRUE" : "FALSE";
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@
|
||||
|
||||
#define RSN_SUITE "%02x-%02x-%02x-%d"
|
||||
#define RSN_SUITE_ARG(s) \
|
||||
@@ -4669,7 +4670,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
|
||||
@@ -4709,7 +4710,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
|
||||
|
||||
return len;
|
||||
}
|
||||
@ -163,7 +163,7 @@
|
||||
{
|
||||
--- a/src/rsn_supp/wpa.c
|
||||
+++ b/src/rsn_supp/wpa.c
|
||||
@@ -2777,6 +2777,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
|
||||
@@ -2802,6 +2802,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
|
||||
}
|
||||
|
||||
|
||||
@ -172,7 +172,7 @@
|
||||
#define RSN_SUITE "%02x-%02x-%02x-%d"
|
||||
#define RSN_SUITE_ARG(s) \
|
||||
((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
|
||||
@@ -2858,6 +2860,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
|
||||
@@ -2883,6 +2885,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
|
||||
|
||||
return (int) len;
|
||||
}
|
||||
@ -182,7 +182,7 @@
|
||||
|
||||
--- a/wpa_supplicant/ap.c
|
||||
+++ b/wpa_supplicant/ap.c
|
||||
@@ -1462,7 +1462,7 @@ int wpas_ap_wps_nfc_report_handover(stru
|
||||
@@ -1477,7 +1477,7 @@ int wpas_ap_wps_nfc_report_handover(stru
|
||||
#endif /* CONFIG_WPS */
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/src/common/wpa_common.c
|
||||
+++ b/src/common/wpa_common.c
|
||||
@@ -2444,6 +2444,31 @@ u32 wpa_akm_to_suite(int akm)
|
||||
@@ -2529,6 +2529,31 @@ u32 wpa_akm_to_suite(int akm)
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
int wpa_compare_rsn_ie(int ft_initial_assoc,
|
||||
const u8 *ie1, size_t ie1len,
|
||||
const u8 *ie2, size_t ie2len)
|
||||
@@ -2451,8 +2476,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
|
||||
@@ -2536,8 +2561,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
|
||||
if (ie1 == NULL || ie2 == NULL)
|
||||
return -1;
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
bss->wpa_pairwise |= WPA_CIPHER_TKIP;
|
||||
#endif /* CONFIG_NO_TKIP */
|
||||
bss->rsn_pairwise = bss->wpa_pairwise;
|
||||
@@ -1180,8 +1179,7 @@ int hostapd_init_wps(struct hostapd_data
|
||||
@@ -1181,8 +1180,7 @@ int hostapd_init_wps(struct hostapd_data
|
||||
WPA_CIPHER_GCMP_256)) {
|
||||
wps->encr_types |= WPS_ENCR_AES;
|
||||
wps->encr_types_rsn |= WPS_ENCR_AES;
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
|
||||
@@ -1579,13 +1575,10 @@ static const struct hostapd_cli_cmd host
|
||||
@@ -1588,13 +1584,10 @@ static const struct hostapd_cli_cmd host
|
||||
{ "disassociate", hostapd_cli_cmd_disassociate,
|
||||
hostapd_complete_stations,
|
||||
"<addr> = disassociate a station" },
|
||||
@ -46,7 +46,7 @@
|
||||
{ "wps_pin", hostapd_cli_cmd_wps_pin, NULL,
|
||||
"<uuid> <pin> [timeout] [addr] = add WPS Enrollee PIN" },
|
||||
{ "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL,
|
||||
@@ -1610,7 +1603,6 @@ static const struct hostapd_cli_cmd host
|
||||
@@ -1619,7 +1612,6 @@ static const struct hostapd_cli_cmd host
|
||||
"<SSID> <auth> <encr> <key> = configure AP" },
|
||||
{ "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL,
|
||||
"= show current WPS status" },
|
||||
|
||||
@ -22,7 +22,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
||||
#include "common/defs.h"
|
||||
#include "common/ieee802_11_defs.h"
|
||||
#include "common/wpa_common.h"
|
||||
@@ -857,6 +858,9 @@ struct wpa_driver_associate_params {
|
||||
@@ -894,6 +895,9 @@ struct wpa_driver_associate_params {
|
||||
* responsible for selecting with which BSS to associate. */
|
||||
const u8 *bssid;
|
||||
|
||||
@ -42,7 +42,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
||||
#include "config.h"
|
||||
|
||||
|
||||
@@ -2321,6 +2322,97 @@ static char * wpa_config_write_peerkey(c
|
||||
@@ -2345,6 +2346,97 @@ static char * wpa_config_write_peerkey(c
|
||||
#endif /* NO_CONFIG_WRITE */
|
||||
|
||||
|
||||
@ -140,7 +140,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
||||
/* Helper macros for network block parser */
|
||||
|
||||
#ifdef OFFSET
|
||||
@@ -2606,6 +2698,8 @@ static const struct parse_data ssid_fiel
|
||||
@@ -2629,6 +2721,8 @@ static const struct parse_data ssid_fiel
|
||||
{ INT(ap_max_inactivity) },
|
||||
{ INT(dtim_period) },
|
||||
{ INT(beacon_int) },
|
||||
@ -174,7 +174,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
||||
* macsec_policy - Determines the policy for MACsec secure session
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -3865,6 +3865,12 @@ static void wpas_start_assoc_cb(struct w
|
||||
@@ -3899,6 +3899,12 @@ static void wpas_start_assoc_cb(struct w
|
||||
params.beacon_int = ssid->beacon_int;
|
||||
else
|
||||
params.beacon_int = wpa_s->conf->beacon_int;
|
||||
|
||||
@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
||||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -5966,7 +5966,7 @@ static int wpa_driver_nl80211_ibss(struc
|
||||
@@ -6005,7 +6005,7 @@ static int wpa_driver_nl80211_ibss(struc
|
||||
struct wpa_driver_associate_params *params)
|
||||
{
|
||||
struct nl_msg *msg;
|
||||
@ -19,7 +19,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
||||
int count = 0;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
|
||||
@@ -5993,6 +5993,37 @@ retry:
|
||||
@@ -6032,6 +6032,37 @@ retry:
|
||||
nl80211_put_beacon_int(msg, params->beacon_int))
|
||||
goto fail;
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
|
||||
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -1624,6 +1624,7 @@ struct wpa_driver_mesh_join_params {
|
||||
@@ -1661,6 +1661,7 @@ struct wpa_driver_mesh_join_params {
|
||||
#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
|
||||
unsigned int flags;
|
||||
bool handle_dfs;
|
||||
@ -29,7 +29,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
|
||||
struct wpa_driver_set_key_params {
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -10496,6 +10496,18 @@ static int nl80211_put_mesh_id(struct nl
|
||||
@@ -10627,6 +10627,18 @@ static int nl80211_put_mesh_id(struct nl
|
||||
}
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
|
||||
static int nl80211_put_mesh_config(struct nl_msg *msg,
|
||||
struct wpa_driver_mesh_bss_params *params)
|
||||
{
|
||||
@@ -10557,6 +10569,7 @@ static int nl80211_join_mesh(struct i802
|
||||
@@ -10688,6 +10700,7 @@ static int nl80211_join_mesh(struct i802
|
||||
nl80211_put_basic_rates(msg, params->basic_rates) ||
|
||||
nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) ||
|
||||
nl80211_put_beacon_int(msg, params->beacon_int) ||
|
||||
@ -58,7 +58,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -631,6 +631,7 @@ int wpa_supplicant_join_mesh(struct wpa_
|
||||
@@ -632,6 +632,7 @@ int wpa_supplicant_join_mesh(struct wpa_
|
||||
|
||||
params->meshid = ssid->ssid;
|
||||
params->meshid_len = ssid->ssid_len;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -2512,11 +2512,13 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
@@ -2539,11 +2539,13 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
for (j = 0; j < wpa_s->last_scan_res_used; j++) {
|
||||
struct wpa_bss *bss = wpa_s->last_scan_res[j];
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -3485,6 +3485,8 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -3489,6 +3489,8 @@ static int hostapd_config_fill(struct ho
|
||||
} else if (os_strcmp(buf, "he_bss_color") == 0) {
|
||||
conf->he_op.he_bss_color = atoi(pos) & 0x3f;
|
||||
conf->he_op.he_bss_color_disabled = 0;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/hostapd/Makefile
|
||||
+++ b/hostapd/Makefile
|
||||
@@ -1297,7 +1297,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS)
|
||||
@@ -1307,7 +1307,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS)
|
||||
@$(AR) cr $@ hostapd_multi.o $(OBJS)
|
||||
|
||||
hostapd: $(OBJS)
|
||||
@ -9,7 +9,7 @@
|
||||
@$(E) " LD " $@
|
||||
|
||||
ifdef CONFIG_WPA_TRACE
|
||||
@@ -1308,7 +1308,7 @@ _OBJS_VAR := OBJS_c
|
||||
@@ -1318,7 +1318,7 @@ _OBJS_VAR := OBJS_c
|
||||
include ../src/objs.mk
|
||||
|
||||
hostapd_cli: $(OBJS_c)
|
||||
@ -20,7 +20,7 @@
|
||||
NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS)
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -1920,31 +1920,31 @@ wpa_supplicant_multi.a: .config $(BCHECK
|
||||
@@ -1949,31 +1949,31 @@ wpa_supplicant_multi.a: .config $(BCHECK
|
||||
@$(AR) cr $@ wpa_supplicant_multi.o $(OBJS)
|
||||
|
||||
wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/src/ap/hostapd.h
|
||||
+++ b/src/ap/hostapd.h
|
||||
@@ -150,6 +150,21 @@ struct hostapd_sae_commit_queue {
|
||||
@@ -162,6 +162,21 @@ struct hostapd_sae_commit_queue {
|
||||
};
|
||||
|
||||
/**
|
||||
@ -22,7 +22,7 @@
|
||||
* struct hostapd_data - hostapd per-BSS data structure
|
||||
*/
|
||||
struct hostapd_data {
|
||||
@@ -163,6 +178,9 @@ struct hostapd_data {
|
||||
@@ -175,6 +190,9 @@ struct hostapd_data {
|
||||
|
||||
u8 own_addr[ETH_ALEN];
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request to "
|
||||
MACSTR " dialog_token=%u req_mode=0x%x disassoc_timer=%u "
|
||||
"validity_interval=%u",
|
||||
@@ -646,10 +647,12 @@ int ieee802_11_rx_wnm_action_ap(struct h
|
||||
@@ -659,10 +660,12 @@ int ieee802_11_rx_wnm_action_ap(struct h
|
||||
|
||||
switch (action) {
|
||||
case WNM_BSS_TRANS_MGMT_QUERY:
|
||||
@ -55,7 +55,7 @@
|
||||
ieee802_11_rx_bss_trans_mgmt_resp(hapd, mgmt->sa, payload,
|
||||
plen);
|
||||
return 0;
|
||||
@@ -696,6 +699,7 @@ int wnm_send_disassoc_imminent(struct ho
|
||||
@@ -709,6 +712,7 @@ int wnm_send_disassoc_imminent(struct ho
|
||||
|
||||
pos = mgmt->u.action.u.bss_tm_req.variable;
|
||||
|
||||
@ -63,7 +63,7 @@
|
||||
wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request frame to indicate imminent disassociation (disassoc_timer=%d) to "
|
||||
MACSTR, disassoc_timer, MAC2STR(sta->addr));
|
||||
if (hostapd_drv_send_mlme(hapd, buf, pos - buf, 0, NULL, 0, 0) < 0) {
|
||||
@@ -777,6 +781,7 @@ int wnm_send_ess_disassoc_imminent(struc
|
||||
@@ -790,6 +794,7 @@ int wnm_send_ess_disassoc_imminent(struc
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
if (disassoc_timer) {
|
||||
/* send disassociation frame after time-out */
|
||||
set_disassoc_timer(hapd, sta, disassoc_timer);
|
||||
@@ -857,6 +862,7 @@ int wnm_send_bss_tm_req(struct hostapd_d
|
||||
@@ -870,6 +875,7 @@ int wnm_send_bss_tm_req(struct hostapd_d
|
||||
}
|
||||
os_free(buf);
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
CFLAGS += -O0 -fprofile-arcs -ftest-coverage
|
||||
--- a/src/ap/hostapd.h
|
||||
+++ b/src/ap/hostapd.h
|
||||
@@ -17,6 +17,7 @@
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "utils/list.h"
|
||||
#include "ap_config.h"
|
||||
#include "drivers/driver.h"
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
#define OCE_STA_CFON_ENABLED(hapd) \
|
||||
((hapd->conf->oce & OCE_STA_CFON) && \
|
||||
@@ -80,7 +81,7 @@ struct hapd_interfaces {
|
||||
@@ -92,7 +93,7 @@ struct hapd_interfaces {
|
||||
#ifdef CONFIG_CTRL_IFACE_UDP
|
||||
unsigned char ctrl_iface_cookie[CTRL_IFACE_COOKIE_LEN];
|
||||
#endif /* CONFIG_CTRL_IFACE_UDP */
|
||||
@ -31,7 +31,7 @@
|
||||
};
|
||||
|
||||
enum hostapd_chan_status {
|
||||
@@ -171,6 +172,7 @@ struct hostapd_data {
|
||||
@@ -183,6 +184,7 @@ struct hostapd_data {
|
||||
struct hostapd_iface *iface;
|
||||
struct hostapd_config *iconf;
|
||||
struct hostapd_bss_config *conf;
|
||||
@ -39,7 +39,7 @@
|
||||
int interface_added; /* virtual interface added for this BSS */
|
||||
unsigned int started:1;
|
||||
unsigned int disabled:1;
|
||||
@@ -630,6 +632,7 @@ hostapd_alloc_bss_data(struct hostapd_if
|
||||
@@ -673,6 +675,7 @@ hostapd_alloc_bss_data(struct hostapd_if
|
||||
struct hostapd_bss_config *bss);
|
||||
int hostapd_setup_interface(struct hostapd_iface *iface);
|
||||
int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
|
||||
@ -49,7 +49,7 @@
|
||||
struct hostapd_iface * hostapd_alloc_iface(void);
|
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -396,6 +396,7 @@ void hostapd_free_hapd_data(struct hosta
|
||||
@@ -401,6 +401,7 @@ void hostapd_free_hapd_data(struct hosta
|
||||
hapd->beacon_set_done = 0;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface);
|
||||
@ -57,7 +57,7 @@
|
||||
accounting_deinit(hapd);
|
||||
hostapd_deinit_wpa(hapd);
|
||||
vlan_deinit(hapd);
|
||||
@@ -1422,6 +1423,8 @@ static int hostapd_setup_bss(struct host
|
||||
@@ -1431,6 +1432,8 @@ static int hostapd_setup_bss(struct host
|
||||
if (hapd->driver && hapd->driver->set_operstate)
|
||||
hapd->driver->set_operstate(hapd->drv_priv, 1);
|
||||
|
||||
@ -66,7 +66,7 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2028,6 +2031,7 @@ static int hostapd_setup_interface_compl
|
||||
@@ -2050,6 +2053,7 @@ static int hostapd_setup_interface_compl
|
||||
if (err)
|
||||
goto fail;
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
wpa_printf(MSG_DEBUG, "Completing interface initialization");
|
||||
if (iface->freq) {
|
||||
#ifdef NEED_AP_MLME
|
||||
@@ -2225,6 +2229,7 @@ dfs_offload:
|
||||
@@ -2248,6 +2252,7 @@ dfs_offload:
|
||||
|
||||
fail:
|
||||
wpa_printf(MSG_ERROR, "Interface initialization failed");
|
||||
@ -82,7 +82,7 @@
|
||||
hostapd_set_state(iface, HAPD_IFACE_DISABLED);
|
||||
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED);
|
||||
#ifdef CONFIG_FST
|
||||
@@ -2700,6 +2705,7 @@ void hostapd_interface_deinit_free(struc
|
||||
@@ -2723,6 +2728,7 @@ void hostapd_interface_deinit_free(struc
|
||||
(unsigned int) iface->conf->num_bss);
|
||||
driver = iface->bss[0]->driver;
|
||||
drv_priv = iface->bss[0]->drv_priv;
|
||||
@ -92,7 +92,7 @@
|
||||
__func__, driver, drv_priv);
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -3553,13 +3553,18 @@ static void handle_auth(struct hostapd_d
|
||||
@@ -3573,13 +3573,18 @@ static void handle_auth(struct hostapd_d
|
||||
u16 auth_alg, auth_transaction, status_code;
|
||||
u16 resp = WLAN_STATUS_SUCCESS;
|
||||
struct sta_info *sta = NULL;
|
||||
@ -112,7 +112,7 @@
|
||||
|
||||
if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) {
|
||||
wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)",
|
||||
@@ -3727,6 +3732,13 @@ static void handle_auth(struct hostapd_d
|
||||
@@ -3747,6 +3752,13 @@ static void handle_auth(struct hostapd_d
|
||||
resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
|
||||
goto fail;
|
||||
}
|
||||
@ -126,7 +126,7 @@
|
||||
if (res == HOSTAPD_ACL_PENDING)
|
||||
return;
|
||||
|
||||
@@ -5447,7 +5459,7 @@ static void handle_assoc(struct hostapd_
|
||||
@@ -5488,7 +5500,7 @@ static void handle_assoc(struct hostapd_
|
||||
int resp = WLAN_STATUS_SUCCESS;
|
||||
u16 reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE;
|
||||
const u8 *pos;
|
||||
@ -135,7 +135,7 @@
|
||||
struct sta_info *sta;
|
||||
u8 *tmp = NULL;
|
||||
#ifdef CONFIG_FILS
|
||||
@@ -5660,6 +5672,11 @@ static void handle_assoc(struct hostapd_
|
||||
@@ -5701,6 +5713,11 @@ static void handle_assoc(struct hostapd_
|
||||
left = res;
|
||||
}
|
||||
#endif /* CONFIG_FILS */
|
||||
@ -147,7 +147,7 @@
|
||||
|
||||
/* followed by SSID and Supported rates; and HT capabilities if 802.11n
|
||||
* is used */
|
||||
@@ -5758,6 +5775,13 @@ static void handle_assoc(struct hostapd_
|
||||
@@ -5799,6 +5816,13 @@ static void handle_assoc(struct hostapd_
|
||||
}
|
||||
#endif /* CONFIG_FILS */
|
||||
|
||||
@ -161,7 +161,7 @@
|
||||
fail:
|
||||
|
||||
/*
|
||||
@@ -5851,6 +5875,7 @@ static void handle_disassoc(struct hosta
|
||||
@@ -5892,6 +5916,7 @@ static void handle_disassoc(struct hosta
|
||||
wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d",
|
||||
MAC2STR(mgmt->sa),
|
||||
le_to_host16(mgmt->u.disassoc.reason_code));
|
||||
@ -169,7 +169,7 @@
|
||||
|
||||
sta = ap_get_sta(hapd, mgmt->sa);
|
||||
if (sta == NULL) {
|
||||
@@ -5920,6 +5945,8 @@ static void handle_deauth(struct hostapd
|
||||
@@ -5961,6 +5986,8 @@ static void handle_deauth(struct hostapd
|
||||
/* Clear the PTKSA cache entries for PASN */
|
||||
ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE);
|
||||
|
||||
@ -180,7 +180,7 @@
|
||||
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying "
|
||||
--- a/src/ap/beacon.c
|
||||
+++ b/src/ap/beacon.c
|
||||
@@ -852,6 +852,12 @@ void handle_probe_req(struct hostapd_dat
|
||||
@@ -919,6 +919,12 @@ void handle_probe_req(struct hostapd_dat
|
||||
u16 csa_offs[2];
|
||||
size_t csa_offs_len;
|
||||
struct radius_sta rad_info;
|
||||
@ -193,7 +193,7 @@
|
||||
|
||||
if (hapd->iconf->rssi_ignore_probe_request && ssi_signal &&
|
||||
ssi_signal < hapd->iconf->rssi_ignore_probe_request)
|
||||
@@ -1038,6 +1044,12 @@ void handle_probe_req(struct hostapd_dat
|
||||
@@ -1105,6 +1111,12 @@ void handle_probe_req(struct hostapd_dat
|
||||
}
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
@ -234,7 +234,7 @@
|
||||
wpabuf_free(sta->p2p_ie);
|
||||
--- a/src/ap/sta_info.c
|
||||
+++ b/src/ap/sta_info.c
|
||||
@@ -458,6 +458,7 @@ void ap_handle_timer(void *eloop_ctx, vo
|
||||
@@ -460,6 +460,7 @@ void ap_handle_timer(void *eloop_ctx, vo
|
||||
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
|
||||
HOSTAPD_LEVEL_INFO, "deauthenticated due to "
|
||||
"local deauth request");
|
||||
@ -242,7 +242,7 @@
|
||||
ap_free_sta(hapd, sta);
|
||||
return;
|
||||
}
|
||||
@@ -613,6 +614,7 @@ skip_poll:
|
||||
@@ -615,6 +616,7 @@ skip_poll:
|
||||
mlme_deauthenticate_indication(
|
||||
hapd, sta,
|
||||
WLAN_REASON_PREV_AUTH_NOT_VALID);
|
||||
@ -260,7 +260,7 @@
|
||||
hapd->msg_ctx_parent != hapd->msg_ctx)
|
||||
--- a/src/ap/wpa_auth_glue.c
|
||||
+++ b/src/ap/wpa_auth_glue.c
|
||||
@@ -265,6 +265,7 @@ static void hostapd_wpa_auth_psk_failure
|
||||
@@ -268,6 +268,7 @@ static void hostapd_wpa_auth_psk_failure
|
||||
struct hostapd_data *hapd = ctx;
|
||||
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR,
|
||||
MAC2STR(addr));
|
||||
@ -270,7 +270,7 @@
|
||||
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -176,6 +176,12 @@ ifdef CONFIG_EAPOL_TEST
|
||||
@@ -183,6 +183,12 @@ ifdef CONFIG_EAPOL_TEST
|
||||
CFLAGS += -Werror -DEAPOL_TEST
|
||||
endif
|
||||
|
||||
@ -283,7 +283,7 @@
|
||||
ifdef CONFIG_CODE_COVERAGE
|
||||
CFLAGS += -O0 -fprofile-arcs -ftest-coverage
|
||||
LIBS += -lgcov
|
||||
@@ -962,6 +968,9 @@ ifdef CONFIG_CTRL_IFACE_MIB
|
||||
@@ -977,6 +983,9 @@ ifdef CONFIG_CTRL_IFACE_MIB
|
||||
CFLAGS += -DCONFIG_CTRL_IFACE_MIB
|
||||
endif
|
||||
OBJS += ../src/ap/ctrl_iface_ap.o
|
||||
@ -295,7 +295,7 @@
|
||||
CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -7241,6 +7241,8 @@ struct wpa_supplicant * wpa_supplicant_a
|
||||
@@ -7285,6 +7285,8 @@ struct wpa_supplicant * wpa_supplicant_a
|
||||
}
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
@ -304,7 +304,7 @@
|
||||
return wpa_s;
|
||||
}
|
||||
|
||||
@@ -7267,6 +7269,8 @@ int wpa_supplicant_remove_iface(struct w
|
||||
@@ -7311,6 +7313,8 @@ int wpa_supplicant_remove_iface(struct w
|
||||
struct wpa_supplicant *parent = wpa_s->parent;
|
||||
#endif /* CONFIG_MESH */
|
||||
|
||||
@ -313,7 +313,7 @@
|
||||
/* Remove interface from the global list of interfaces */
|
||||
prev = global->ifaces;
|
||||
if (prev == wpa_s) {
|
||||
@@ -7570,8 +7574,12 @@ int wpa_supplicant_run(struct wpa_global
|
||||
@@ -7614,8 +7618,12 @@ int wpa_supplicant_run(struct wpa_global
|
||||
eloop_register_signal_terminate(wpa_supplicant_terminate, global);
|
||||
eloop_register_signal_reconfig(wpa_supplicant_reconfig, global);
|
||||
|
||||
@ -328,7 +328,7 @@
|
||||
|
||||
--- a/wpa_supplicant/wpa_supplicant_i.h
|
||||
+++ b/wpa_supplicant/wpa_supplicant_i.h
|
||||
@@ -19,6 +19,7 @@
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "wps/wps_defs.h"
|
||||
#include "config_ssid.h"
|
||||
#include "wmm_ac.h"
|
||||
@ -336,7 +336,7 @@
|
||||
|
||||
extern const char *const wpa_supplicant_version;
|
||||
extern const char *const wpa_supplicant_license;
|
||||
@@ -322,6 +323,8 @@ struct wpa_global {
|
||||
@@ -323,6 +324,8 @@ struct wpa_global {
|
||||
#endif /* CONFIG_WIFI_DISPLAY */
|
||||
|
||||
struct psk_list_entry *add_psk; /* From group formation */
|
||||
@ -345,7 +345,7 @@
|
||||
};
|
||||
|
||||
|
||||
@@ -708,6 +711,7 @@ struct wpa_supplicant {
|
||||
@@ -707,6 +710,7 @@ struct wpa_supplicant {
|
||||
unsigned char own_addr[ETH_ALEN];
|
||||
unsigned char perm_addr[ETH_ALEN];
|
||||
char ifname[100];
|
||||
@ -363,7 +363,7 @@
|
||||
|
||||
|
||||
#ifndef WPS_PIN_SCAN_IGNORE_SEL_REG
|
||||
@@ -393,6 +394,8 @@ static int wpa_supplicant_wps_cred(void
|
||||
@@ -391,6 +392,8 @@ static int wpa_supplicant_wps_cred(void
|
||||
wpa_hexdump_key(MSG_DEBUG, "WPS: Received Credential attribute",
|
||||
cred->cred_attr, cred->cred_attr_len);
|
||||
|
||||
@ -374,7 +374,7 @@
|
||||
|
||||
--- a/hostapd/main.c
|
||||
+++ b/hostapd/main.c
|
||||
@@ -895,6 +895,7 @@ int main(int argc, char *argv[])
|
||||
@@ -897,6 +897,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
hostapd_global_ctrl_iface_init(&interfaces);
|
||||
@ -382,7 +382,7 @@
|
||||
|
||||
if (hostapd_global_run(&interfaces, daemonize, pid_file)) {
|
||||
wpa_printf(MSG_ERROR, "Failed to start eloop");
|
||||
@@ -904,6 +905,7 @@ int main(int argc, char *argv[])
|
||||
@@ -906,6 +907,7 @@ int main(int argc, char *argv[])
|
||||
ret = 0;
|
||||
|
||||
out:
|
||||
@ -392,7 +392,7 @@
|
||||
for (i = 0; i < interfaces.count; i++) {
|
||||
--- a/wpa_supplicant/main.c
|
||||
+++ b/wpa_supplicant/main.c
|
||||
@@ -203,7 +203,7 @@ int main(int argc, char *argv[])
|
||||
@@ -204,7 +204,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (;;) {
|
||||
c = getopt(argc, argv,
|
||||
@ -401,7 +401,7 @@
|
||||
if (c < 0)
|
||||
break;
|
||||
switch (c) {
|
||||
@@ -271,6 +271,9 @@ int main(int argc, char *argv[])
|
||||
@@ -272,6 +272,9 @@ int main(int argc, char *argv[])
|
||||
params.conf_p2p_dev = optarg;
|
||||
break;
|
||||
#endif /* CONFIG_P2P */
|
||||
@ -473,7 +473,7 @@
|
||||
|
||||
--- a/src/ap/dfs.c
|
||||
+++ b/src/ap/dfs.c
|
||||
@@ -1196,6 +1196,8 @@ int hostapd_dfs_radar_detected(struct ho
|
||||
@@ -1203,6 +1203,8 @@ int hostapd_dfs_pre_cac_expired(struct h
|
||||
"freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d",
|
||||
freq, ht_enabled, chan_offset, chan_width, cf1, cf2);
|
||||
|
||||
@ -515,7 +515,7 @@
|
||||
}
|
||||
--- a/src/ap/sta_info.h
|
||||
+++ b/src/ap/sta_info.h
|
||||
@@ -324,6 +324,7 @@ struct sta_info {
|
||||
@@ -328,6 +328,7 @@ struct sta_info {
|
||||
#endif /* CONFIG_TESTING_OPTIONS */
|
||||
#ifdef CONFIG_AIRTIME_POLICY
|
||||
unsigned int airtime_weight;
|
||||
@ -525,9 +525,9 @@
|
||||
|
||||
--- a/src/ap/wnm_ap.c
|
||||
+++ b/src/ap/wnm_ap.c
|
||||
@@ -442,7 +442,8 @@ static void ieee802_11_rx_bss_trans_mgmt
|
||||
wpa_hexdump(MSG_DEBUG, "WNM: BSS Transition Candidate List Entries",
|
||||
pos, end - pos);
|
||||
@@ -455,7 +455,8 @@ static void ieee802_11_rx_bss_trans_mgmt
|
||||
MAC2STR(addr), reason, hex ? " neighbor=" : "", hex);
|
||||
os_free(hex);
|
||||
|
||||
- ieee802_11_send_bss_trans_mgmt_request(hapd, addr, dialog_token);
|
||||
+ if (!hostapd_ubus_notify_bss_transition_query(hapd, addr, dialog_token, reason, pos, end - pos))
|
||||
@ -535,7 +535,7 @@
|
||||
}
|
||||
|
||||
|
||||
@@ -464,7 +465,7 @@ static void ieee802_11_rx_bss_trans_mgmt
|
||||
@@ -477,7 +478,7 @@ static void ieee802_11_rx_bss_trans_mgmt
|
||||
size_t len)
|
||||
{
|
||||
u8 dialog_token, status_code, bss_termination_delay;
|
||||
@ -544,7 +544,7 @@
|
||||
int enabled = hapd->conf->bss_transition;
|
||||
struct sta_info *sta;
|
||||
|
||||
@@ -511,6 +512,7 @@ static void ieee802_11_rx_bss_trans_mgmt
|
||||
@@ -524,6 +525,7 @@ static void ieee802_11_rx_bss_trans_mgmt
|
||||
wpa_printf(MSG_DEBUG, "WNM: not enough room for Target BSSID field");
|
||||
return;
|
||||
}
|
||||
@ -552,7 +552,7 @@
|
||||
sta->agreed_to_steer = 1;
|
||||
eloop_cancel_timeout(ap_sta_reset_steer_flag_timer, hapd, sta);
|
||||
eloop_register_timeout(2, 0, ap_sta_reset_steer_flag_timer,
|
||||
@@ -530,6 +532,10 @@ static void ieee802_11_rx_bss_trans_mgmt
|
||||
@@ -543,6 +545,10 @@ static void ieee802_11_rx_bss_trans_mgmt
|
||||
MAC2STR(addr), status_code, bss_termination_delay);
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -2458,6 +2458,8 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -2416,6 +2416,8 @@ static int hostapd_config_fill(struct ho
|
||||
bss->isolate = atoi(pos);
|
||||
} else if (os_strcmp(buf, "ap_max_inactivity") == 0) {
|
||||
bss->ap_max_inactivity = atoi(pos);
|
||||
@ -9,7 +9,7 @@
|
||||
} else if (os_strcmp(buf, "skip_inactivity_poll") == 0) {
|
||||
bss->skip_inactivity_poll = atoi(pos);
|
||||
} else if (os_strcmp(buf, "country_code") == 0) {
|
||||
@@ -3158,6 +3160,8 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -3121,6 +3123,8 @@ static int hostapd_config_fill(struct ho
|
||||
}
|
||||
} else if (os_strcmp(buf, "acs_exclude_dfs") == 0) {
|
||||
conf->acs_exclude_dfs = atoi(pos);
|
||||
@ -20,7 +20,7 @@
|
||||
} else if (os_strcmp(buf, "channel") == 0) {
|
||||
--- a/src/ap/ap_config.c
|
||||
+++ b/src/ap/ap_config.c
|
||||
@@ -792,6 +792,7 @@ void hostapd_config_free_bss(struct host
|
||||
@@ -796,6 +796,7 @@ void hostapd_config_free_bss(struct host
|
||||
os_free(conf->radius_req_attr_sqlite);
|
||||
os_free(conf->rsn_preauth_interfaces);
|
||||
os_free(conf->ctrl_interface);
|
||||
@ -28,7 +28,7 @@
|
||||
os_free(conf->ca_cert);
|
||||
os_free(conf->server_cert);
|
||||
os_free(conf->server_cert2);
|
||||
@@ -988,6 +989,7 @@ void hostapd_config_free(struct hostapd_
|
||||
@@ -995,6 +996,7 @@ void hostapd_config_free(struct hostapd_
|
||||
|
||||
for (i = 0; i < conf->num_bss; i++)
|
||||
hostapd_config_free_bss(conf->bss[i]);
|
||||
@ -38,7 +38,7 @@
|
||||
os_free(conf->basic_rates);
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -279,6 +279,8 @@ struct hostapd_bss_config {
|
||||
@@ -285,6 +285,8 @@ struct hostapd_bss_config {
|
||||
char vlan_bridge[IFNAMSIZ + 1];
|
||||
char wds_bridge[IFNAMSIZ + 1];
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
|
||||
|
||||
unsigned int logger_syslog; /* module bitfield */
|
||||
@@ -942,6 +944,7 @@ struct spatial_reuse {
|
||||
@@ -969,6 +971,7 @@ struct eht_phy_capabilities_info {
|
||||
struct hostapd_config {
|
||||
struct hostapd_bss_config **bss, *last_bss;
|
||||
size_t num_bss;
|
||||
@ -57,7 +57,7 @@
|
||||
int rts_threshold;
|
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -219,6 +219,10 @@ static int hostapd_iface_conf_changed(st
|
||||
@@ -224,6 +224,10 @@ static int hostapd_iface_conf_changed(st
|
||||
{
|
||||
size_t i;
|
||||
|
||||
@ -68,7 +68,7 @@
|
||||
if (newconf->num_bss != oldconf->num_bss)
|
||||
return 1;
|
||||
|
||||
@@ -232,7 +236,7 @@ static int hostapd_iface_conf_changed(st
|
||||
@@ -237,7 +241,7 @@ static int hostapd_iface_conf_changed(st
|
||||
}
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
{
|
||||
struct hapd_interfaces *interfaces = iface->interfaces;
|
||||
struct hostapd_data *hapd = iface->bss[0];
|
||||
@@ -255,13 +259,16 @@ int hostapd_reload_config(struct hostapd
|
||||
@@ -260,13 +264,16 @@ int hostapd_reload_config(struct hostapd
|
||||
if (newconf == NULL)
|
||||
return -1;
|
||||
|
||||
@ -96,7 +96,7 @@
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"Configuration changes include interface/BSS modification - force full disable+enable sequence");
|
||||
fname = os_strdup(iface->config_fname);
|
||||
@@ -286,6 +293,24 @@ int hostapd_reload_config(struct hostapd
|
||||
@@ -291,6 +298,24 @@ int hostapd_reload_config(struct hostapd
|
||||
wpa_printf(MSG_ERROR,
|
||||
"Failed to enable interface on config reload");
|
||||
return res;
|
||||
@ -121,7 +121,7 @@
|
||||
}
|
||||
iface->conf = newconf;
|
||||
|
||||
@@ -302,6 +327,12 @@ int hostapd_reload_config(struct hostapd
|
||||
@@ -307,6 +332,12 @@ int hostapd_reload_config(struct hostapd
|
||||
|
||||
for (j = 0; j < iface->num_bss; j++) {
|
||||
hapd = iface->bss[j];
|
||||
@ -134,7 +134,7 @@
|
||||
hapd->iconf = newconf;
|
||||
hapd->conf = newconf->bss[j];
|
||||
hostapd_reload_bss(hapd);
|
||||
@@ -2397,6 +2428,10 @@ hostapd_alloc_bss_data(struct hostapd_if
|
||||
@@ -2420,6 +2451,10 @@ hostapd_alloc_bss_data(struct hostapd_if
|
||||
hapd->iconf = conf;
|
||||
hapd->conf = bss;
|
||||
hapd->iface = hapd_iface;
|
||||
@ -147,7 +147,7 @@
|
||||
hapd->ctrl_sock = -1;
|
||||
--- a/src/ap/hostapd.h
|
||||
+++ b/src/ap/hostapd.h
|
||||
@@ -46,7 +46,7 @@ struct mesh_conf;
|
||||
@@ -47,7 +47,7 @@ struct mesh_conf;
|
||||
struct hostapd_iface;
|
||||
|
||||
struct hapd_interfaces {
|
||||
@ -156,7 +156,7 @@
|
||||
struct hostapd_config * (*config_read_cb)(const char *config_fname);
|
||||
int (*ctrl_iface_init)(struct hostapd_data *hapd);
|
||||
void (*ctrl_iface_deinit)(struct hostapd_data *hapd);
|
||||
@@ -173,6 +173,7 @@ struct hostapd_data {
|
||||
@@ -185,6 +185,7 @@ struct hostapd_data {
|
||||
struct hostapd_config *iconf;
|
||||
struct hostapd_bss_config *conf;
|
||||
struct hostapd_ubus_bss ubus;
|
||||
@ -164,7 +164,7 @@
|
||||
int interface_added; /* virtual interface added for this BSS */
|
||||
unsigned int started:1;
|
||||
unsigned int disabled:1;
|
||||
@@ -624,7 +625,7 @@ struct hostapd_iface {
|
||||
@@ -667,7 +668,7 @@ struct hostapd_iface {
|
||||
int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
|
||||
int (*cb)(struct hostapd_iface *iface,
|
||||
void *ctx), void *ctx);
|
||||
@ -175,7 +175,7 @@
|
||||
hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -4833,6 +4833,9 @@ static int wpa_driver_nl80211_set_ap(voi
|
||||
@@ -4852,6 +4852,9 @@ static int wpa_driver_nl80211_set_ap(voi
|
||||
if (ret) {
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)",
|
||||
ret, strerror(-ret));
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -115,6 +115,7 @@ struct hostapd_ssid {
|
||||
@@ -121,6 +121,7 @@ struct hostapd_ssid {
|
||||
#define DYNAMIC_VLAN_OPTIONAL 1
|
||||
#define DYNAMIC_VLAN_REQUIRED 2
|
||||
int dynamic_vlan;
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -3381,6 +3381,8 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -3346,6 +3346,8 @@ static int hostapd_config_fill(struct ho
|
||||
#ifndef CONFIG_NO_VLAN
|
||||
} else if (os_strcmp(buf, "dynamic_vlan") == 0) {
|
||||
bss->ssid.dynamic_vlan = atoi(pos);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -2358,6 +2358,8 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -2316,6 +2316,8 @@ static int hostapd_config_fill(struct ho
|
||||
sizeof(conf->bss[0]->iface));
|
||||
} else if (os_strcmp(buf, "bridge") == 0) {
|
||||
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -2880,6 +2880,14 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -2841,6 +2841,14 @@ static int hostapd_config_fill(struct ho
|
||||
line, bss->max_num_sta, MAX_STA_COUNT);
|
||||
return 1;
|
||||
}
|
||||
@ -17,17 +17,17 @@
|
||||
} else if (os_strcmp(buf, "extended_key_id") == 0) {
|
||||
--- a/src/ap/hostapd.h
|
||||
+++ b/src/ap/hostapd.h
|
||||
@@ -668,6 +668,7 @@ void hostapd_cleanup_cs_params(struct ho
|
||||
@@ -711,6 +711,7 @@ void hostapd_cleanup_cs_params(struct ho
|
||||
void hostapd_periodic_iface(struct hostapd_iface *iface);
|
||||
int hostapd_owe_trans_get_info(struct hostapd_data *hapd);
|
||||
void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx);
|
||||
+int hostapd_check_max_sta(struct hostapd_data *hapd);
|
||||
|
||||
/* utils.c */
|
||||
int hostapd_register_probereq_cb(struct hostapd_data *hapd,
|
||||
void hostapd_switch_color(struct hostapd_data *hapd, u64 bitmap);
|
||||
void hostapd_cleanup_cca_params(struct hostapd_data *hapd);
|
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -236,6 +236,30 @@ static int hostapd_iface_conf_changed(st
|
||||
@@ -241,6 +241,30 @@ static int hostapd_iface_conf_changed(st
|
||||
}
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
struct hapd_interfaces *interfaces = iface->interfaces;
|
||||
--- a/src/ap/beacon.c
|
||||
+++ b/src/ap/beacon.c
|
||||
@@ -1068,7 +1068,7 @@ void handle_probe_req(struct hostapd_dat
|
||||
@@ -1135,7 +1135,7 @@ void handle_probe_req(struct hostapd_dat
|
||||
if (hapd->conf->no_probe_resp_if_max_sta &&
|
||||
is_multicast_ether_addr(mgmt->da) &&
|
||||
is_multicast_ether_addr(mgmt->bssid) &&
|
||||
@ -71,7 +71,7 @@
|
||||
" since no room for additional STA",
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -981,6 +981,8 @@ struct hostapd_config {
|
||||
@@ -1010,6 +1010,8 @@ struct hostapd_config {
|
||||
unsigned int track_sta_max_num;
|
||||
unsigned int track_sta_max_age;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -3038,6 +3038,8 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -3000,6 +3000,8 @@ static int hostapd_config_fill(struct ho
|
||||
wpa_printf(MSG_INFO,
|
||||
"Line %d: Obsolete peerkey parameter ignored", line);
|
||||
#ifdef CONFIG_IEEE80211R_AP
|
||||
@ -11,7 +11,7 @@
|
||||
hexstr2bin(pos, bss->mobility_domain,
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -277,6 +277,7 @@ struct airtime_sta_weight {
|
||||
@@ -283,6 +283,7 @@ struct airtime_sta_weight {
|
||||
struct hostapd_bss_config {
|
||||
char iface[IFNAMSIZ + 1];
|
||||
char bridge[IFNAMSIZ + 1];
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
--- a/src/ap/wpa_auth_glue.c
|
||||
+++ b/src/ap/wpa_auth_glue.c
|
||||
@@ -1566,8 +1566,12 @@ int hostapd_setup_wpa(struct hostapd_dat
|
||||
@@ -1595,8 +1595,12 @@ int hostapd_setup_wpa(struct hostapd_dat
|
||||
wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) {
|
||||
const char *ft_iface;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/src/ap/ap_config.h
|
||||
+++ b/src/ap/ap_config.h
|
||||
@@ -278,6 +278,7 @@ struct hostapd_bss_config {
|
||||
@@ -284,6 +284,7 @@ struct hostapd_bss_config {
|
||||
char iface[IFNAMSIZ + 1];
|
||||
char bridge[IFNAMSIZ + 1];
|
||||
char ft_iface[IFNAMSIZ + 1];
|
||||
@ -10,9 +10,9 @@
|
||||
|
||||
--- a/src/ap/x_snoop.c
|
||||
+++ b/src/ap/x_snoop.c
|
||||
@@ -31,14 +31,16 @@ int x_snoop_init(struct hostapd_data *ha
|
||||
return -1;
|
||||
}
|
||||
@@ -33,14 +33,16 @@ int x_snoop_init(struct hostapd_data *ha
|
||||
|
||||
hapd->x_snoop_initialized = true;
|
||||
|
||||
- if (hostapd_drv_br_port_set_attr(hapd, DRV_BR_PORT_ATTR_HAIRPIN_MODE,
|
||||
+ if (!conf->snoop_iface[0] &&
|
||||
@ -29,7 +29,7 @@
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"x_snoop: Failed to enable proxyarp on the bridge port");
|
||||
return -1;
|
||||
@@ -52,7 +54,8 @@ int x_snoop_init(struct hostapd_data *ha
|
||||
@@ -54,7 +56,8 @@ int x_snoop_init(struct hostapd_data *ha
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IPV6
|
||||
@ -39,7 +39,7 @@
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"x_snoop: Failed to enable multicast snooping on the bridge");
|
||||
return -1;
|
||||
@@ -71,8 +74,12 @@ x_snoop_get_l2_packet(struct hostapd_dat
|
||||
@@ -73,8 +76,12 @@ x_snoop_get_l2_packet(struct hostapd_dat
|
||||
{
|
||||
struct hostapd_bss_config *conf = hapd->conf;
|
||||
struct l2_packet_data *l2;
|
||||
@ -55,7 +55,7 @@
|
||||
"x_snoop: Failed to initialize L2 packet processing %s",
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -2360,6 +2360,8 @@ static int hostapd_config_fill(struct ho
|
||||
@@ -2318,6 +2318,8 @@ static int hostapd_config_fill(struct ho
|
||||
os_strlcpy(bss->bridge, pos, sizeof(bss->bridge));
|
||||
if (!bss->wds_bridge[0])
|
||||
os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user