From 507feeafadb20a1fae64ae76c5cb42deead7ff98 Mon Sep 17 00:00:00 2001 From: Maxime Henrion Date: Fri, 22 Apr 2005 13:05:53 +0000 Subject: [PATCH] Be more conservative when enabling extended features. There are fxp(4) NICs out there that have an utterly bogus revision ID. Reported by: Denis Shaposhnikov --- sys/dev/fxp/if_fxp.c | 6 ++++-- sys/dev/fxp/if_fxpreg.h | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 1a702de9487..57f197f5bc4 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -579,7 +579,9 @@ fxp_attach(device_t dev) * too, but that's already enabled by the code above. * Be careful to do this only on the right devices. */ - if (sc->revision >= FXP_REV_82550) { + if (sc->revision == FXP_REV_82550 || sc->revision == FXP_REV_82550_C || + sc->revision == FXP_REV_82551_E || sc->revision == FXP_REV_82551_F + || sc->revision == FXP_REV_82551_10) { sc->rfa_size = sizeof (struct fxp_rfa); sc->tx_cmd = FXP_CB_COMMAND_IPCBXMIT; sc->flags |= FXP_FLAG_EXT_RFA; @@ -2643,7 +2645,7 @@ struct ucode { D102_B_CPUSAVER_DWORD, D102_B_CPUSAVER_BUNDLE_MAX_DWORD }, { FXP_REV_82550_C, UCODE(fxp_ucode_d102c), D102_C_CPUSAVER_DWORD, D102_C_CPUSAVER_BUNDLE_MAX_DWORD }, - { FXP_REV_82551, UCODE(fxp_ucode_d102e), + { FXP_REV_82551_F, UCODE(fxp_ucode_d102e), D102_E_CPUSAVER_DWORD, D102_E_CPUSAVER_BUNDLE_MAX_DWORD }, { 0, NULL, 0, 0, 0 } }; diff --git a/sys/dev/fxp/if_fxpreg.h b/sys/dev/fxp/if_fxpreg.h index 99814757fd8..e6bb98b7f2e 100644 --- a/sys/dev/fxp/if_fxpreg.h +++ b/sys/dev/fxp/if_fxpreg.h @@ -468,4 +468,6 @@ struct fxp_stats { #define FXP_REV_82559S_A 9 /* 82559S A stepping */ #define FXP_REV_82550 12 #define FXP_REV_82550_C 13 /* 82550 C stepping */ -#define FXP_REV_82551 15 /* 82551 */ +#define FXP_REV_82551_E 14 /* 82551 */ +#define FXP_REV_82551_F 15 /* 82551 */ +#define FXP_REV_82551_10 16 /* 82551 */