Move RECOVERY_MODE feature test code for readability. No functional change.

ixgbe.c rev. 1.169 inserted RECOVERY_MODE feature test in between
 MSI-X allocation and legacy allocation. To improve code readability,
move it to earlier location.
This commit is contained in:
msaitoh 2024-05-30 08:55:02 +00:00
parent f6e78d1295
commit 588e74af68
1 changed files with 17 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixgbe.c,v 1.350 2024/05/13 03:15:33 msaitoh Exp $ */
/* $NetBSD: ixgbe.c,v 1.351 2024/05/30 08:55:02 msaitoh Exp $ */
/******************************************************************************
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.350 2024/05/13 03:15:33 msaitoh Exp $");
__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.351 2024/05/30 08:55:02 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -1136,6 +1136,21 @@ ixgbe_attach(device_t parent, device_t dev, void *aux)
error = ixgbe_read_pba_string(hw, buf, IXGBE_PBANUM_LENGTH);
aprint_normal_dev(dev, "PBA number %s\n", error ? "unknown" : buf);
/* Recovery mode */
switch (sc->hw.mac.type) {
case ixgbe_mac_X550:
case ixgbe_mac_X550EM_x:
case ixgbe_mac_X550EM_a:
/* >= 2.00 */
if (hw->eeprom.nvm_image_ver_high >= 2) {
sc->feat_cap |= IXGBE_FEATURE_RECOVERY_MODE;
sc->feat_en |= IXGBE_FEATURE_RECOVERY_MODE;
}
break;
default:
break;
}
if (sc->feat_en & IXGBE_FEATURE_MSIX) {
error = ixgbe_allocate_msix(sc, pa);
if (error) {
@ -1155,21 +1170,6 @@ ixgbe_attach(device_t parent, device_t dev, void *aux)
}
}
/* Recovery mode */
switch (sc->hw.mac.type) {
case ixgbe_mac_X550:
case ixgbe_mac_X550EM_x:
case ixgbe_mac_X550EM_a:
/* >= 2.00 */
if (hw->eeprom.nvm_image_ver_high >= 2) {
sc->feat_cap |= IXGBE_FEATURE_RECOVERY_MODE;
sc->feat_en |= IXGBE_FEATURE_RECOVERY_MODE;
}
break;
default:
break;
}
if ((sc->feat_en & IXGBE_FEATURE_MSIX) == 0)
error = ixgbe_allocate_legacy(sc, pa);
if (error)