From e9e14008fa5b1ded29dcfe507aa6dc232e8b9808 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 1 Mar 2019 12:10:58 +0100 Subject: [PATCH] iwinfo: more Ralink and MediaTek WiSoC and PCIe chips Signed-off-by: Daniel Golle --- hardware.txt | 9 +++++++++ iwinfo_utils.c | 28 ++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/hardware.txt b/hardware.txt index 2b1a5d6..fa90b47 100644 --- a/hardware.txt +++ b/hardware.txt @@ -60,10 +60,19 @@ 0x168c 0x003c 0x19b6 0xd03c 0 0 "Mikrotik" "R11e-5HacT" 0x168c 0x0046 0x168c 0xcafe 0 0 "Qualcomm Atheros" "QCA9984" 0x1814 0x3050 0x1814 0x0005 0 0 "RaLink" "Rt3050" +0x1814 0x3051 0x1814 0x0007 0 0 "RaLink" "Rt3051" 0x1814 0x3052 0x1814 0x0008 0 0 "RaLink" "Rt3052" +0x1814 0x3350 0x1814 0x000b 0 0 "RaLink" "Rt3350" 0x1814 0x3352 0x1814 0x000c 0 0 "RaLink" "Rt3352" +0x1814 0x3662 0x1814 0x000d 0 0 "RaLink" "Rt3662" +0x1814 0x3883 0x1814 0x000d 0 0 "RaLink" "Rt3883" +0x1814 0x5350 0x1814 0x000f 0 0 "RaLink" "Rt5350" 0x11ab 0x2a55 0x11ab 0x0000 0 0 "Marvell" "88W8864" 0x02df 0x9135 0x0000 0x0000 0 0 "Marvell" "88W8887" 0x11ab 0x2b40 0x11ab 0x0000 0 0 "Marvell" "88W8964" 0x14c3 0x7603 0x14c3 0x7603 0 0 "MediaTek" "MT7603E" +0x14c3 0x7610 0x14c3 0x7610 0 0 "MediaTek" "MT7610E" +0x14c3 0x7620 0x14c3 0x000c 0 0 "MediaTek" "MT7620" +0x14c3 0x7628 0x14c3 0x0004 0 0 "MediaTek" "MT76x8" +0x14c3 0x7650 0x14c3 0x7650 0 0 "MediaTek" "MT7610E" 0x14c3 0x7662 0x14c3 0x7662 0 0 "MediaTek" "MT76x2E" diff --git a/iwinfo_utils.c b/iwinfo_utils.c index d024845..43e2eb7 100644 --- a/iwinfo_utils.c +++ b/iwinfo_utils.c @@ -237,17 +237,37 @@ int iwinfo_hardware_id_from_mtd(struct iwinfo_hardware_id *id) } /* Rt3xxx SoC */ - else if ((bc[off] == 0x3352) || (bc[off] == 0x5233) || + else if ((bc[off] == 0x3050) || (bc[off] == 0x5030) || + (bc[off] == 0x3051) || (bc[off] == 0x5130) || + (bc[off] == 0x3052) || (bc[off] == 0x5230) || (bc[off] == 0x3350) || (bc[off] == 0x5033) || - (bc[off] == 0x3050) || (bc[off] == 0x5030) || - (bc[off] == 0x3052) || (bc[off] == 0x5230)) + (bc[off] == 0x3352) || (bc[off] == 0x5233) || + (bc[off] == 0x3662) || (bc[off] == 0x6236) || + (bc[off] == 0x3883) || (bc[off] == 0x8338) || + (bc[off] == 0x5350) || (bc[off] == 0x5053)) { /* vendor: RaLink */ id->vendor_id = 0x1814; id->subsystem_vendor_id = 0x1814; /* device */ - if ((bc[off] & 0xf0) == 0x30) + if (((bc[off] & 0xf0) == 0x30) || + ((bc[off] & 0xff) == 0x53)) + id->device_id = (bc[off] >> 8) | (bc[off] & 0x00ff) << 8; + else + id->device_id = bc[off]; + + /* subsystem from EEPROM_NIC_CONF0_RF_TYPE */ + id->subsystem_device_id = (bc[off + 0x1a] & 0x0f00) >> 8; + } else if ((bc[off] == 0x7620) || (bc[off] == 0x2076) || + (bc[off] == 0x7628) || (bc[off] == 0x2876) || + (bc[off] == 0x7688) || (bc[off] == 0x8876)) { + /* vendor: MediaTek */ + id->vendor_id = 0x14c3; + id->subsystem_vendor_id = 0x14c3; + + /* device */ + if ((bc[off] & 0xff) == 0x76) id->device_id = (bc[off] >> 8) | (bc[off] & 0x00ff) << 8; else id->device_id = bc[off]; -- 2.25.1