From 562c5a582395719cb963731fc8972d6c2c437e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=B7Yep=2C=20Another=20Mike=C2=B7?= Date: Fri, 23 Jan 2026 13:52:05 -0700 Subject: [PATCH 1/2] Fixing Gen5 Eye Diagram which was only checking for dev pointer and not if the switch was not a Gen5 switch. --- lib/diag.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/diag.c b/lib/diag.c index 354ff381..7e054b3e 100644 --- a/lib/diag.c +++ b/lib/diag.c @@ -242,8 +242,8 @@ int switchtec_diag_eye_set_mode(struct switchtec_dev *dev, int switchtec_diag_eye_read(struct switchtec_dev *dev, int lane_id, int bin, int* num_phases, double* ber_data) { - if (dev) { - fprintf(stderr, "Eye read not supported on Gen 4 switches.\n"); + if !(switchtec_is_gen5(dev)) { + fprintf(stderr, "Gen5 Eye read not supported on Gen 4 switches.\n"); return -1; } struct switchtec_gen5_diag_eye_read_in in = { From 310a9bccacf373126e1c795a6d5bbd10f29fe244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=B7Yep=2C=20Another=20Mike=C2=B7?= Date: Fri, 23 Jan 2026 13:53:39 -0700 Subject: [PATCH 2/2] Fixing not statement --- lib/diag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/diag.c b/lib/diag.c index 7e054b3e..2c6a90fa 100644 --- a/lib/diag.c +++ b/lib/diag.c @@ -242,7 +242,7 @@ int switchtec_diag_eye_set_mode(struct switchtec_dev *dev, int switchtec_diag_eye_read(struct switchtec_dev *dev, int lane_id, int bin, int* num_phases, double* ber_data) { - if !(switchtec_is_gen5(dev)) { + if (!switchtec_is_gen5(dev)) { fprintf(stderr, "Gen5 Eye read not supported on Gen 4 switches.\n"); return -1; }