From 2751e926a0621c01d2d3b04987d4d0c32b688166 Mon Sep 17 00:00:00 2001 From: lovehackintosh <92633080+lovehackintosh@users.noreply.github.com> Date: Sun, 8 Jan 2023 19:46:57 +0800 Subject: [PATCH] iwinfo: backport IPQ8074 and QCNxxxx devices support (#10743) Signed-off-by: Linhui Liu Signed-off-by: Linhui Liu --- .../utils/iwinfo/patches/001-ralink.patch | 28 +++++++------- .../patches/002-devices-add-MT7986.patch | 7 +--- .../patches/003-devices-add-IPQ8074.patch | 37 +++++++++++++++++++ .../patches/004-devices-add-QCNxxxx.patch | 23 ++++++++++++ 4 files changed, 76 insertions(+), 19 deletions(-) create mode 100644 package/network/utils/iwinfo/patches/003-devices-add-IPQ8074.patch create mode 100644 package/network/utils/iwinfo/patches/004-devices-add-QCNxxxx.patch diff --git a/package/network/utils/iwinfo/patches/001-ralink.patch b/package/network/utils/iwinfo/patches/001-ralink.patch index 5f2ae27ea..18abf8592 100644 --- a/package/network/utils/iwinfo/patches/001-ralink.patch +++ b/package/network/utils/iwinfo/patches/001-ralink.patch @@ -223,7 +223,7 @@ #endif --- a/include/iwinfo.h +++ b/include/iwinfo.h -@@ -259,6 +259,7 @@ extern const struct iwinfo_ops wext_ops; +@@ -306,6 +306,7 @@ extern const struct iwinfo_ops wext_ops; extern const struct iwinfo_ops madwifi_ops; extern const struct iwinfo_ops nl80211_ops; extern const struct iwinfo_ops wl_ops; @@ -233,7 +233,7 @@ --- a/iwinfo_lib.c +++ b/iwinfo_lib.c -@@ -334,6 +334,9 @@ static const struct iwinfo_ops *backends +@@ -339,6 +339,9 @@ static const struct iwinfo_ops *backends #ifdef USE_WL &wl_ops, #endif @@ -245,7 +245,7 @@ --- a/iwinfo_lua.c +++ b/iwinfo_lua.c -@@ -659,6 +659,35 @@ static int iwinfo_L_countrylist(lua_Stat +@@ -678,6 +678,35 @@ static int iwinfo_L_countrylist(lua_Stat return 1; } @@ -281,7 +281,7 @@ #ifdef USE_WL /* Broadcom */ -@@ -908,6 +937,41 @@ static const luaL_reg R_wext[] = { +@@ -927,6 +956,41 @@ static const luaL_reg R_wext[] = { { NULL, NULL } }; @@ -323,7 +323,7 @@ /* Common */ static const luaL_reg R_common[] = { { "type", iwinfo_L_type }, -@@ -919,6 +983,15 @@ static const luaL_reg R_common[] = { +@@ -938,6 +1002,15 @@ static const luaL_reg R_common[] = { LUALIB_API int luaopen_iwinfo(lua_State *L) { luaL_register(L, IWINFO_META, R_common); @@ -1421,7 +1421,7 @@ +#endif --- a/iwinfo_wext.c +++ b/iwinfo_wext.c -@@ -185,7 +185,7 @@ static int wext_get_channel(const char * +@@ -197,7 +197,7 @@ static int wext_get_center_chan2(const c return -1; } @@ -1430,7 +1430,7 @@ { struct iwreq wrq; struct iw_range range; -@@ -282,7 +282,7 @@ static int wext_get_noise(const char *if +@@ -294,7 +294,7 @@ static int wext_get_noise(const char *if return -1; } @@ -1439,7 +1439,7 @@ { struct iwreq wrq; struct iw_statistics stats; -@@ -300,7 +300,7 @@ static int wext_get_quality(const char * +@@ -312,7 +312,7 @@ static int wext_get_quality(const char * return -1; } @@ -1448,7 +1448,7 @@ { struct iwreq wrq; struct iw_range range; -@@ -365,7 +365,7 @@ static int wext_get_txpwrlist(const char +@@ -377,7 +377,7 @@ static int wext_get_txpwrlist(const char return -1; } @@ -1457,7 +1457,7 @@ { struct iwreq wrq; struct iw_range range; -@@ -409,7 +409,7 @@ static int wext_get_countrylist(const ch +@@ -421,7 +421,7 @@ static int wext_get_countrylist(const ch return -1; } @@ -1468,7 +1468,7 @@ struct iwinfo_freqlist_entry *e = NULL; --- a/Makefile +++ b/Makefile -@@ -32,6 +32,15 @@ ifneq ($(filter nl80211,$(IWINFO_BACKEND +@@ -34,6 +34,15 @@ ifneq ($(filter nl80211,$(IWINFO_BACKEND IWINFO_LIB_OBJ += iwinfo_nl80211.o endif @@ -1482,11 +1482,11 @@ + IWINFO_LIB_OBJ += iwinfo_ra.o +endif - %.o: %.c - $(CC) $(IWINFO_CFLAGS) $(FPIC) -c -o $@ $< + compile: clean $(IWINFO_LIB) $(IWINFO_LUA) $(IWINFO_CLI) + --- a/hardware.txt +++ b/hardware.txt -@@ -173,6 +173,36 @@ +@@ -180,6 +180,36 @@ 0x1814 0x3662 0x1814 0x000d 0 0 "Ralink" "Rt3662" 0x1814 0x3883 0x1814 0x000d 0 0 "Ralink" "Rt3883" 0x1814 0x5350 0x1814 0x000f 0 0 "Ralink" "Rt5350" diff --git a/package/network/utils/iwinfo/patches/002-devices-add-MT7986.patch b/package/network/utils/iwinfo/patches/002-devices-add-MT7986.patch index 6dcb04b53..707386354 100644 --- a/package/network/utils/iwinfo/patches/002-devices-add-MT7986.patch +++ b/package/network/utils/iwinfo/patches/002-devices-add-MT7986.patch @@ -14,17 +14,16 @@ Signed-off-by: Daniel Golle --- a/hardware.txt +++ b/hardware.txt -@@ -196,6 +196,7 @@ +@@ -225,5 +225,6 @@ 0x14c3 0x7650 0x14c3 0x7650 0 0 "MediaTek" "MT7610E" 0x14c3 0x7662 0x14c3 0x7662 0 0 "MediaTek" "MT76x2E" 0x14c3 0x7915 0x14c3 0x7915 0 0 "MediaTek" "MT7915E" +0x14c3 0x7986 0x14c3 0x7986 0 0 "MediaTek" "MT7986" 0x14e4 0xaa52 0x14e4 0xaa52 0 0 "Broadcom" "BCM43602" - 0x02d0 0xa9a6 0x0000 0x0000 0 0 "Cypress" "CYW43455" 0x1ae9 0x0310 0x1ae9 0x0000 0 0 "Wilocity" "Wil6210" --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c -@@ -3410,7 +3410,13 @@ static int nl80211_hardware_id_from_fdt(struct iwinfo_hardware_id *id, const cha +@@ -3386,7 +3386,13 @@ static int nl80211_hardware_id_from_fdt( id->device_id = 0x7622; id->subsystem_vendor_id = 0x14c3; id->subsystem_device_id = 0x7622; @@ -38,5 +37,3 @@ Signed-off-by: Daniel Golle return (id->vendor_id && id->device_id) ? 0 : -1; } --- -2.30.2 diff --git a/package/network/utils/iwinfo/patches/003-devices-add-IPQ8074.patch b/package/network/utils/iwinfo/patches/003-devices-add-IPQ8074.patch new file mode 100644 index 000000000..068416f74 --- /dev/null +++ b/package/network/utils/iwinfo/patches/003-devices-add-IPQ8074.patch @@ -0,0 +1,37 @@ +From: Robert Marko +Date: Fri, 6 Jan 2023 09:56:54 +0000 (+0100) +Subject: iwinfo: devices: add Qualcomm Atheros IPQ8074 WiSoC +X-Git-Url: http://git.openwrt.org/?p=project%2Fiwinfo.git;a=commitdiff_plain;h=5914d7113ecf77de63eb21fc233684d1a1a52ca5 + +iwinfo: devices: add Qualcomm Atheros IPQ8074 WiSoC + +Add detection of the Qualcomm Atheros IPQ8074 WiSoC using the compatible +string from device tree. + +Signed-off-by: Robert Marko +--- + +--- a/hardware.txt ++++ b/hardware.txt +@@ -167,6 +167,7 @@ + 0x168c 0x003c 0x1a56 0x1420 0 0 "Qualcomm Atheros" "QCA9862" + 0x168c 0x003c 0x19b6 0xd03c 0 0 "Mikrotik" "R11e-5HacT" + 0x168c 0x003c 0x168c 0x4019 0 0 "Qualcomm Atheros" "IPQ4019" ++0x168c 0x8074 0x168c 0x8074 0 0 "Qualcomm Atheros" "IPQ8074" + 0x168c 0x003c 0x19b6 0xd075 0 0 "Mikrotik" "R11e-5HacD" + 0x168c 0x0040 0x168c 0x0002 0 0 "Qualcomm Atheros" "QCA9990" + 0x168c 0x0046 0x168c 0xcafe 0 0 "Qualcomm Atheros" "QCA9984" +--- a/iwinfo_nl80211.c ++++ b/iwinfo_nl80211.c +@@ -3381,6 +3381,11 @@ static int nl80211_hardware_id_from_fdt( + id->device_id = 0x003c; + id->subsystem_vendor_id = 0x168c; + id->subsystem_device_id = 0x4019; ++ } else if (!strcmp(compat, "qcom,ipq8074-wifi")) { ++ id->vendor_id = 0x168c; ++ id->device_id = 0x8074; ++ id->subsystem_vendor_id = 0x168c; ++ id->subsystem_device_id = 0x8074; + } else if (!strcmp(compat, "mediatek,mt7622-wmac")) { + id->vendor_id = 0x14c3; + id->device_id = 0x7622; diff --git a/package/network/utils/iwinfo/patches/004-devices-add-QCNxxxx.patch b/package/network/utils/iwinfo/patches/004-devices-add-QCNxxxx.patch new file mode 100644 index 000000000..7cfda2a2b --- /dev/null +++ b/package/network/utils/iwinfo/patches/004-devices-add-QCNxxxx.patch @@ -0,0 +1,23 @@ +From: Robert Marko +Date: Fri, 6 Jan 2023 16:33:55 +0000 (+0100) +Subject: devices: add Qualcomm Atheros QCN6024/9024/9074 cards +X-Git-Url: http://git.openwrt.org/?p=project%2Fiwinfo.git;a=commitdiff_plain;h=c7b420a2f33c6f1034c3e2191eba0cb0374af7b6 + +devices: add Qualcomm Atheros QCN6024/9024/9074 cards + +Add Qualcomm Atheros QCN6024/9024/9074 PCI ID, they all are compatible and +use the same ID. + +Signed-off-by: Robert Marko +--- + +--- a/hardware.txt ++++ b/hardware.txt +@@ -173,6 +173,7 @@ + 0x168c 0x0046 0x168c 0xcafe 0 0 "Qualcomm Atheros" "QCA9984" + 0x168c 0x0050 0x0000 0x0000 0 0 "Qualcomm Atheros" "QCA9887" + 0x168c 0x0056 0x0000 0x0000 0 0 "Qualcomm Atheros" "QCA9886" ++0x17cb 0x1104 0x17cb 0x1104 0 0 "Qualcomm Atheros" "QCN6024/9024/9074" + 0x1814 0x3050 0x1814 0x0005 0 0 "Ralink" "Rt3050" + 0x1814 0x3051 0x1814 0x0007 0 0 "Ralink" "Rt3051" + 0x1814 0x3052 0x1814 0x0008 0 0 "Ralink" "Rt3052"