Sat Feb 3 12:01:59 2024 UTC (120d)
Pull up following revision(s) (requested by msaitoh in ticket #564):

	sys/dev/pci/if_wm.c: revision 1.793

Add Intel I219-{LM,V}(20,21) support.


(martin)
diff -r1.767.2.5 -r1.767.2.6 src/sys/dev/pci/if_wm.c

cvs diff -r1.767.2.5 -r1.767.2.6 src/sys/dev/pci/if_wm.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_wm.c 2023/10/18 14:27:38 1.767.2.5
+++ src/sys/dev/pci/if_wm.c 2024/02/03 12:01:59 1.767.2.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_wm.c,v 1.767.2.5 2023/10/18 14:27:38 martin Exp $ */ 1/* $NetBSD: if_wm.c,v 1.767.2.6 2024/02/03 12:01:59 martin Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. 4 * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -72,27 +72,27 @@ @@ -72,27 +72,27 @@
72 * 72 *
73 * TODO (in order of importance): 73 * TODO (in order of importance):
74 * 74 *
75 * - Check XXX'ed comments 75 * - Check XXX'ed comments
76 * - TX Multi queue improvement (refine queue selection logic) 76 * - TX Multi queue improvement (refine queue selection logic)
77 * - Split header buffer for newer descriptors 77 * - Split header buffer for newer descriptors
78 * - EEE (Energy Efficiency Ethernet) for I354 78 * - EEE (Energy Efficiency Ethernet) for I354
79 * - Virtual Function 79 * - Virtual Function
80 * - Set LED correctly (based on contents in EEPROM) 80 * - Set LED correctly (based on contents in EEPROM)
81 * - Rework how parameters are loaded from the EEPROM. 81 * - Rework how parameters are loaded from the EEPROM.
82 */ 82 */
83 83
84#include <sys/cdefs.h> 84#include <sys/cdefs.h>
85__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.767.2.5 2023/10/18 14:27:38 martin Exp $"); 85__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.767.2.6 2024/02/03 12:01:59 martin Exp $");
86 86
87#ifdef _KERNEL_OPT 87#ifdef _KERNEL_OPT
88#include "opt_if_wm.h" 88#include "opt_if_wm.h"
89#endif 89#endif
90 90
91#include <sys/param.h> 91#include <sys/param.h>
92 92
93#include <sys/atomic.h> 93#include <sys/atomic.h>
94#include <sys/callout.h> 94#include <sys/callout.h>
95#include <sys/cpu.h> 95#include <sys/cpu.h>
96#include <sys/device.h> 96#include <sys/device.h>
97#include <sys/errno.h> 97#include <sys/errno.h>
98#include <sys/interrupt.h> 98#include <sys/interrupt.h>
@@ -1742,26 +1742,32 @@ static const struct wm_product { @@ -1742,26 +1742,32 @@ static const struct wm_product {
1742 WM_T_PCH_TGP, WMP_F_COPPER }, 1742 WM_T_PCH_TGP, WMP_F_COPPER },
1743 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM16, 1743 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM16,
1744 "I219 LM (16) Ethernet Connection", 1744 "I219 LM (16) Ethernet Connection",
1745 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP */ 1745 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP */
1746 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM17, 1746 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM17,
1747 "I219 LM (17) Ethernet Connection", 1747 "I219 LM (17) Ethernet Connection",
1748 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP */ 1748 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP */
1749 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM18, 1749 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM18,
1750 "I219 LM (18) Ethernet Connection", 1750 "I219 LM (18) Ethernet Connection",
1751 WM_T_PCH_TGP, WMP_F_COPPER }, /* MTP */ 1751 WM_T_PCH_TGP, WMP_F_COPPER }, /* MTP */
1752 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM19, 1752 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM19,
1753 "I219 LM (19) Ethernet Connection", 1753 "I219 LM (19) Ethernet Connection",
1754 WM_T_PCH_TGP, WMP_F_COPPER }, /* MTP */ 1754 WM_T_PCH_TGP, WMP_F_COPPER }, /* MTP */
 1755 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM20,
 1756 "I219 LM (20) Ethernet Connection",
 1757 WM_T_PCH_TGP, WMP_F_COPPER }, /* MTP */
 1758 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM21,
 1759 "I219 LM (21) Ethernet Connection",
 1760 WM_T_PCH_TGP, WMP_F_COPPER }, /* MTP */
1755 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM22, 1761 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM22,
1756 "I219 LM (22) Ethernet Connection", 1762 "I219 LM (22) Ethernet Connection",
1757 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP(RPL) */ 1763 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP(RPL) */
1758 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM23, 1764 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_LM23,
1759 "I219 LM (23) Ethernet Connection", 1765 "I219 LM (23) Ethernet Connection",
1760 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP(RPL) */ 1766 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP(RPL) */
1761 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V, 1767 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V,
1762 "I219 V Ethernet Connection", 1768 "I219 V Ethernet Connection",
1763 WM_T_PCH_SPT, WMP_F_COPPER }, 1769 WM_T_PCH_SPT, WMP_F_COPPER },
1764 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V2, 1770 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V2,
1765 "I219 V (2) Ethernet Connection", 1771 "I219 V (2) Ethernet Connection",
1766 WM_T_PCH_SPT, WMP_F_COPPER }, 1772 WM_T_PCH_SPT, WMP_F_COPPER },
1767 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V4, 1773 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V4,
@@ -1802,26 +1808,32 @@ static const struct wm_product { @@ -1802,26 +1808,32 @@ static const struct wm_product {
1802 WM_T_PCH_TGP, WMP_F_COPPER }, 1808 WM_T_PCH_TGP, WMP_F_COPPER },
1803 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V16, 1809 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V16,
1804 "I219 V (16) Ethernet Connection", 1810 "I219 V (16) Ethernet Connection",
1805 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP */ 1811 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP */
1806 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V17, 1812 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V17,
1807 "I219 V (17) Ethernet Connection", 1813 "I219 V (17) Ethernet Connection",
1808 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP */ 1814 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP */
1809 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V18, 1815 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V18,
1810 "I219 V (18) Ethernet Connection", 1816 "I219 V (18) Ethernet Connection",
1811 WM_T_PCH_TGP, WMP_F_COPPER }, /* MTP */ 1817 WM_T_PCH_TGP, WMP_F_COPPER }, /* MTP */
1812 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V19, 1818 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V19,
1813 "I219 V (19) Ethernet Connection", 1819 "I219 V (19) Ethernet Connection",
1814 WM_T_PCH_TGP, WMP_F_COPPER }, /* MTP */ 1820 WM_T_PCH_TGP, WMP_F_COPPER }, /* MTP */
 1821 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V20,
 1822 "I219 V (20) Ethernet Connection",
 1823 WM_T_PCH_TGP, WMP_F_COPPER }, /* MTP */
 1824 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V21,
 1825 "I219 V (21) Ethernet Connection",
 1826 WM_T_PCH_TGP, WMP_F_COPPER }, /* MTP */
1815 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V22, 1827 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V22,
1816 "I219 V (22) Ethernet Connection", 1828 "I219 V (22) Ethernet Connection",
1817 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP(RPL) */ 1829 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP(RPL) */
1818 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V23, 1830 { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_I219_V23,
1819 "I219 V (23) Ethernet Connection", 1831 "I219 V (23) Ethernet Connection",
1820 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP(RPL) */ 1832 WM_T_PCH_TGP, WMP_F_COPPER }, /* ADP(RPL) */
1821 { 0, 0, 1833 { 0, 0,
1822 NULL, 1834 NULL,
1823 0, 0 }, 1835 0, 0 },
1824}; 1836};
1825 1837
1826/* 1838/*
1827 * Register read/write functions. 1839 * Register read/write functions.