aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Bowling <kbowling@FreeBSD.org>2024-09-24 10:12:40 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2024-09-24 10:15:58 +0000
commit2e78e568c268e4ba846ab140d9ac6b42886f8ec7 (patch)
tree5c6f4b8d6ee24f0057a305c2a966041d6272282f
parentaa7d086ad94642fa40375db9976177fc9e54a2cf (diff)
downloadsrc-2e78e568c268.tar.gz
src-2e78e568c268.zip
e1000: Handle igb EEE sysctl
MFC after: 1 week Sponsored by: Blue Box Systems
-rw-r--r--sys/dev/e1000/if_em.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index 5fb46c9f6dce..d06627bcfda1 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -1094,7 +1094,10 @@ em_if_attach_pre(if_ctx_t ctx)
" due to SOL/IDER session.\n");
/* Sysctl for setting Energy Efficient Ethernet */
- hw->dev_spec.ich8lan.eee_disable = eee_setting;
+ if (hw->mac.type < igb_mac_min)
+ hw->dev_spec.ich8lan.eee_disable = eee_setting;
+ else
+ hw->dev_spec._82575.eee_disable = eee_setting;
SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "eee_control",
CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0,
em_sysctl_eee, "I", "Disable Energy Efficient Ethernet");
@@ -4981,11 +4984,17 @@ em_sysctl_eee(SYSCTL_HANDLER_ARGS)
struct e1000_softc *sc = (struct e1000_softc *) arg1;
int error, value;
- value = sc->hw.dev_spec.ich8lan.eee_disable;
+ if (sc->hw.mac.type < igb_mac_min)
+ value = sc->hw.dev_spec.ich8lan.eee_disable;
+ else
+ value = sc->hw.dev_spec._82575.eee_disable;
error = sysctl_handle_int(oidp, &value, 0, req);
if (error || req->newptr == NULL)
return (error);
- sc->hw.dev_spec.ich8lan.eee_disable = (value != 0);
+ if (sc->hw.mac.type < igb_mac_min)
+ sc->hw.dev_spec.ich8lan.eee_disable = (value != 0);
+ else
+ sc->hw.dev_spec._82575.eee_disable = (value != 0);
em_if_init(sc->ctx);
return (0);