libnm/utils: extend the product fixup phrase list

The product names are generally of rather poor quality. The product name
is no place to enumerate product capabilities, the bus it's attached on
and similar nonsense.
This commit is contained in:
Lubomir Rintel 2018-02-23 14:52:05 +01:00
parent e22b1c1d94
commit 0c151ae39d
4 changed files with 2070 additions and 41 deletions

View file

@ -1455,7 +1455,7 @@ ensure_description (NMDevice *device)
}
if ( !priv->short_vendor
|| !(short_product = nm_utils_fixup_desc_string (nm_device_get_product (device)))) {
|| !(short_product = nm_utils_fixup_product_string (nm_device_get_product (device)))) {
priv->description = g_strdup (nm_device_get_iface (device) ?: "");
return;
}

View file

@ -253,33 +253,293 @@ nm_utils_fixup_vendor_string (const char *desc)
}
char *
nm_utils_fixup_desc_string (const char *desc)
nm_utils_fixup_product_string (const char *desc)
{
static const char *const IGNORED_PHRASES[] = {
"54 Mbps Wireless PC Card",
"Communication S.p.A.",
"Mobile Broadband Minicard Composite Device",
"Mobile Communications AB",
"Multiprotocol MAC/baseband processor",
"100/10 MBit",
"10/100 Mbps",
"1.0 GbE",
"10 GbE",
"10 Gigabit",
"10 Mbps",
"1/10 Gigabit",
"150 Mbps",
"2.5 GbE",
"54 Mbps",
"Attached Port",
"+ BT",
"\"CDC Subset\"",
"CE Media Processor",
"Controller Area Network",
"Converged Network",
"DEC-Tulip compatible",
"Dish Adapter",
"Double 108 Mbps",
"Dual Band",
"Dual Port",
"Embedded UTP",
"Ethernet Connection",
"Ethernet Pro 100",
"Express Module",
"Fabric Adapter",
"Fast Ethernet",
"for 10GBASE-T" ,
"for 10GbE backplane" ,
"for 10GbE QSFP+" ,
"for 10GbE SFP+" ,
"for 1GbE",
"for 20GbE backplane" ,
"for 25GbE backplane" ,
"for 25GbE SFP28" ,
"for 40GbE backplane" ,
"for 40GbE QSFP+" ,
"G Adapter",
"Gigabit Desktop Network",
"Gigabit Ethernet",
"Gigabit or",
"Host Interface",
"Host Virtual Interface",
"IEEE 802.11a/b/g",
"IEEE 802.11g",
"IEEE 802.11G",
"IEEE 802.11n",
"MAC + PHY",
"Mini Card",
"Mini Wireless",
"multicore SoC",
"Multi Function",
"N Draft 11n Wireless",
"Network Connection",
"PC Card with XJACK(r) Antenna",
"(PC-Suite Mode)",
"Wireless Adapter",
"Wireless cardbus",
"Wireless Cardbus Adapter",
"Wireless CardBus Adapter",
"Wireless LAN Adapter",
"Wireless LAN Controller",
"Wireless LAN PC Card",
"Wireless PC",
"Wireless PC Card",
"Network Everywhere",
"N Wireless",
"N+ Wireless",
"OCT To Fast Ethernet Converter",
"PC Card",
"PCI Express",
"Platform Controller Hub",
"Plus Bluetooth",
"Quad Gigabit",
"rev 1",
"rev 17",
"rev 2",
"rev A",
"rev B",
"rev F",
"TO Ethernet",
"Turbo Wireless Adapter",
"Unified Wire",
"USB 1.1",
"USB 2.0",
"Virtual media for",
"WiFi Link",
"+ WiMAX",
"WiMAX/WiFi Link",
"Wireless G",
"Wireless G+",
"Wireless Lan",
"Wireless Mini adapter",
"Wireless Mini Adapter",
"Wireless N",
"with 1000-BASE-T interface",
"with CX4 copper interface",
"with Range Amplifier",
"with SR-XFP optical interface",
"w/ Upgradable Antenna",
NULL,
};
static const char *const IGNORED_WORDS[] = {
"1000BaseSX",
"1000BASE-T",
"1000Base-ZX",
"100/10M",
"100baseFx",
"100Base-MII",
"100Base-T",
"100BaseT4",
"100Base-TX",
"100BaseTX",
"100GbE",
"100Mbps",
"100MBps",
"10/100",
"10/100/1000",
"10/100/1000Base-T",
"10/100/1000BASE-T",
"10/100BaseT",
"10/100baseTX",
"10/100BaseTX",
"10/100/BNC",
"10/100M",
"10/20-Gigabit",
"10/25/40/50GbE",
"10/40G",
"10base-FL",
"10BaseT",
"10BASE-T",
"10G",
"10Gb",
"10Gb/25Gb",
"10Gb/25Gb/40Gb/50Gb",
"10Gbase-T",
"10GBase-T",
"10GBASE-T",
"10GbE",
"10Gbps",
"10-Giga",
"10-Gigabit",
"10mbps",
"10Mbps",
"1/10GbE",
"1/10-Gigabit",
"11b/g/n",
"11g",
"150Mbps",
"16Gbps/10Gbps",
"1GbE",
"1x2:2",
"20GbE",
"25Gb",
"25GbE",
"2-Port",
"2x3:3",
"3G",
"3G/4G",
"3x3:3",
"40GbE",
"4G",
"54g",
"54M",
"54Mbps",
"56k",
"5G",
"802.11",
"802.11a/b/g",
"802.11abg",
"802.11a/b/g/n",
"802.11abgn",
"802.11ac",
"802.11ad",
"802.11a/g",
"802.11b",
"802.11b/g",
"802.11bg",
"802.11b/g/n",
"802.11bgn",
"802.11b/g/n-draft",
"802.11g",
"802.11n",
"802.11N",
"802.11n/b/g",
"802.11ng",
"802AIN",
"802UIG-1",
"adapter",
"chipset",
"Adapter",
"adaptor",
"ADSL",
"Basic",
"CAN-Bus",
"card",
"Card",
"Cardbus",
"CardBus",
"CDMA",
"CNA",
"Composite",
"controller",
"Controller",
"Copper",
"DB",
"Desktop",
"device",
"Device",
"dongle",
"driver",
"Dual-band",
"Dual-Protocol",
"EISA",
"Enhanced",
"ethernet.",
"ethernet",
"Ethernet",
"Ethernet/RNDIS",
"ExpressModule",
"family",
"Family",
"Fast/Gigabit",
"Fiber",
"gigabit",
"Gigabit",
"G-NIC",
"Hi-Gain",
"Hi-Speed",
"HSDPA",
"HSUPA",
"integrated",
"Integrated",
"interface",
"LAN",
"LAN+Winmodem",
"Laptop",
"LTE",
"LTE/UMTS/GSM",
"MAC",
"Micro",
"Mini-Card",
"Mini-USB",
"misprogrammed",
"modem",
"Modem",
"Modem/Networkcard",
"Module",
"NDIS",
"Multimode",
"Multithreaded",
"Name:",
"net",
"network",
"Network",
"n/g/b",
"NIC",
"Notebook",
"OEM",
"PCI",
"PCI64",
"PCIe",
"PCI-E",
"PCI-Express",
"PCI-X",
"PCMCIA",
"PDA",
"PnP",
"RDMA",
"RJ-45",
"Series",
"Server",
"SoC",
"Switch",
"Technologies",
"TOE",
"USB",
"USB2.0",
"USB/Ethernet",
"UTP",
"UTP/Coax",
"v1",
"v1.1",
"v2",
"V2.0",
"v3",
"v4",
"wifi",
"Wi-Fi",
"WiFi",
"wireless",
"Wireless",
"Wireless-150N",
"Wireless-300N",
"Wireless-G",
"Wireless-N",
"WLAN",
NULL,
};
char *desc_full;

View file

@ -26,6 +26,6 @@
#endif
char *nm_utils_fixup_vendor_string (const char *desc);
char *nm_utils_fixup_desc_string (const char *desc);
char *nm_utils_fixup_product_string (const char *desc);
#endif /* __NM_LIBNM_UTILS_H__ */

File diff suppressed because it is too large Load diff