| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ixgbe.c,v 1.306 2022/02/01 04:59:16 msaitoh Exp $ */ | | 1 | /* $NetBSD: ixgbe.c,v 1.307 2022/02/16 10:29:13 msaitoh Exp $ */ |
2 | | | 2 | |
3 | /****************************************************************************** | | 3 | /****************************************************************************** |
4 | | | 4 | |
5 | Copyright (c) 2001-2017, Intel Corporation | | 5 | Copyright (c) 2001-2017, Intel Corporation |
6 | All rights reserved. | | 6 | All rights reserved. |
7 | | | 7 | |
8 | Redistribution and use in source and binary forms, with or without | | 8 | Redistribution and use in source and binary forms, with or without |
9 | modification, are permitted provided that the following conditions are met: | | 9 | modification, are permitted provided that the following conditions are met: |
10 | | | 10 | |
11 | 1. Redistributions of source code must retain the above copyright notice, | | 11 | 1. Redistributions of source code must retain the above copyright notice, |
12 | this list of conditions and the following disclaimer. | | 12 | this list of conditions and the following disclaimer. |
13 | | | 13 | |
14 | 2. Redistributions in binary form must reproduce the above copyright | | 14 | 2. Redistributions in binary form must reproduce the above copyright |
| @@ -54,27 +54,27 @@ | | | @@ -54,27 +54,27 @@ |
54 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 54 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
55 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 55 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
56 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 56 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
57 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 57 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
58 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 58 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
59 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 59 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
60 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 60 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
61 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 61 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
62 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 62 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
63 | * POSSIBILITY OF SUCH DAMAGE. | | 63 | * POSSIBILITY OF SUCH DAMAGE. |
64 | */ | | 64 | */ |
65 | | | 65 | |
66 | #include <sys/cdefs.h> | | 66 | #include <sys/cdefs.h> |
67 | __KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.306 2022/02/01 04:59:16 msaitoh Exp $"); | | 67 | __KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.307 2022/02/16 10:29:13 msaitoh Exp $"); |
68 | | | 68 | |
69 | #ifdef _KERNEL_OPT | | 69 | #ifdef _KERNEL_OPT |
70 | #include "opt_inet.h" | | 70 | #include "opt_inet.h" |
71 | #include "opt_inet6.h" | | 71 | #include "opt_inet6.h" |
72 | #include "opt_net_mpsafe.h" | | 72 | #include "opt_net_mpsafe.h" |
73 | #endif | | 73 | #endif |
74 | | | 74 | |
75 | #include "ixgbe.h" | | 75 | #include "ixgbe.h" |
76 | #include "ixgbe_phy.h" | | 76 | #include "ixgbe_phy.h" |
77 | #include "ixgbe_sriov.h" | | 77 | #include "ixgbe_sriov.h" |
78 | | | 78 | |
79 | #include <sys/cprng.h> | | 79 | #include <sys/cprng.h> |
80 | #include <dev/mii/mii.h> | | 80 | #include <dev/mii/mii.h> |
| @@ -1108,45 +1108,50 @@ ixgbe_attach(device_t parent, device_t d | | | @@ -1108,45 +1108,50 @@ ixgbe_attach(device_t parent, device_t d |
1108 | aprint_verbose(" OEM NVM Image version %u.%02x,", high, | | 1108 | aprint_verbose(" OEM NVM Image version %u.%02x,", high, |
1109 | low); | | 1109 | low); |
1110 | } | | 1110 | } |
1111 | break; | | 1111 | break; |
1112 | default: | | 1112 | default: |
1113 | break; | | 1113 | break; |
1114 | } | | 1114 | } |
1115 | | | 1115 | |
1116 | /* Print the ETrackID */ | | 1116 | /* Print the ETrackID */ |
1117 | hw->eeprom.ops.read(hw, IXGBE_ETRACKID_H, &high); | | 1117 | hw->eeprom.ops.read(hw, IXGBE_ETRACKID_H, &high); |
1118 | hw->eeprom.ops.read(hw, IXGBE_ETRACKID_L, &low); | | 1118 | hw->eeprom.ops.read(hw, IXGBE_ETRACKID_L, &low); |
1119 | aprint_normal(" ETrackID %08x\n", ((uint32_t)high << 16) | low); | | 1119 | aprint_normal(" ETrackID %08x\n", ((uint32_t)high << 16) | low); |
1120 | | | 1120 | |
| | | 1121 | /* Printed Board Assembly number */ |
| | | 1122 | error = ixgbe_read_pba_string(hw, buf, IXGBE_PBANUM_LENGTH); |
| | | 1123 | aprint_normal_dev(dev, "PBA number %s\n", error ? "unknown" : buf); |
| | | 1124 | |
1121 | if (adapter->feat_en & IXGBE_FEATURE_MSIX) { | | 1125 | if (adapter->feat_en & IXGBE_FEATURE_MSIX) { |
1122 | error = ixgbe_allocate_msix(adapter, pa); | | 1126 | error = ixgbe_allocate_msix(adapter, pa); |
1123 | if (error) { | | 1127 | if (error) { |
1124 | /* Free allocated queue structures first */ | | 1128 | /* Free allocated queue structures first */ |
1125 | ixgbe_free_queues(adapter); | | 1129 | ixgbe_free_queues(adapter); |
1126 | | | 1130 | |
1127 | /* Fallback to legacy interrupt */ | | 1131 | /* Fallback to legacy interrupt */ |
1128 | adapter->feat_en &= ~IXGBE_FEATURE_MSIX; | | 1132 | adapter->feat_en &= ~IXGBE_FEATURE_MSIX; |
1129 | if (adapter->feat_cap & IXGBE_FEATURE_MSI) | | 1133 | if (adapter->feat_cap & IXGBE_FEATURE_MSI) |
1130 | adapter->feat_en |= IXGBE_FEATURE_MSI; | | 1134 | adapter->feat_en |= IXGBE_FEATURE_MSI; |
1131 | adapter->num_queues = 1; | | 1135 | adapter->num_queues = 1; |
1132 | | | 1136 | |
1133 | /* Allocate our TX/RX Queues again */ | | 1137 | /* Allocate our TX/RX Queues again */ |
1134 | if (ixgbe_allocate_queues(adapter)) { | | 1138 | if (ixgbe_allocate_queues(adapter)) { |
1135 | error = ENOMEM; | | 1139 | error = ENOMEM; |
1136 | goto err_out; | | 1140 | goto err_out; |
1137 | } | | 1141 | } |
1138 | } | | 1142 | } |
1139 | } | | 1143 | } |
| | | 1144 | |
1140 | /* Recovery mode */ | | 1145 | /* Recovery mode */ |
1141 | switch (adapter->hw.mac.type) { | | 1146 | switch (adapter->hw.mac.type) { |
1142 | case ixgbe_mac_X550: | | 1147 | case ixgbe_mac_X550: |
1143 | case ixgbe_mac_X550EM_x: | | 1148 | case ixgbe_mac_X550EM_x: |
1144 | case ixgbe_mac_X550EM_a: | | 1149 | case ixgbe_mac_X550EM_a: |
1145 | /* >= 2.00 */ | | 1150 | /* >= 2.00 */ |
1146 | if (hw->eeprom.nvm_image_ver_high >= 2) { | | 1151 | if (hw->eeprom.nvm_image_ver_high >= 2) { |
1147 | adapter->feat_cap |= IXGBE_FEATURE_RECOVERY_MODE; | | 1152 | adapter->feat_cap |= IXGBE_FEATURE_RECOVERY_MODE; |
1148 | adapter->feat_en |= IXGBE_FEATURE_RECOVERY_MODE; | | 1153 | adapter->feat_en |= IXGBE_FEATURE_RECOVERY_MODE; |
1149 | } | | 1154 | } |
1150 | break; | | 1155 | break; |
1151 | default: | | 1156 | default: |
1152 | break; | | 1157 | break; |