From 7cdc2d80754dbc081b5ec6564fdd871d9a77733c Mon Sep 17 00:00:00 2001
From: Alessandro Rubini <rubini@gnudd.com>
Date: Wed, 17 Dec 2014 17:59:58 +0100
Subject: [PATCH] userspace: port_state: rename a field, unused up to now

Rename "index" to "fiber_index", because it was never used, and it will
be the fiber index (enumerating fiber type 0..3). By reusing a field
of the same size, I don't need to change version number nor ppsi
(that uses the structure, but doesn't care about this value).q

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
---
 userspace/libwr/include/libwr/hal_shmem.h | 4 ++--
 userspace/tools/wrs_dump_shmem.c          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/userspace/libwr/include/libwr/hal_shmem.h b/userspace/libwr/include/libwr/hal_shmem.h
index f67a86e85..b3105946f 100644
--- a/userspace/libwr/include/libwr/hal_shmem.h
+++ b/userspace/libwr/include/libwr/hal_shmem.h
@@ -71,8 +71,8 @@ struct hal_port_state {
 	/* port FSM state (HAL_PORT_STATE_xxxx) */
 	int state;
 
-	/* unused */
-	int index;
+	/* fiber type, used to get alpha for SFP frequency */
+	int fiber_index;
 
 	/* 1: PLL is locked to this port */
 	int locked;
diff --git a/userspace/tools/wrs_dump_shmem.c b/userspace/tools/wrs_dump_shmem.c
index fe4b77823..cfdfaca98 100644
--- a/userspace/tools/wrs_dump_shmem.c
+++ b/userspace/tools/wrs_dump_shmem.c
@@ -188,7 +188,7 @@ struct dump_info hal_port_info [] = {
 	DUMP_FIELD(int, hw_addr_auto),
 	DUMP_FIELD(int, mode),
 	DUMP_FIELD(int, state),
-	DUMP_FIELD(int, index),
+	DUMP_FIELD(int, fiber_index),
 	DUMP_FIELD(int, locked),
 	/* these fields are defined as uint32_t but we prefer %i to %x */
 	DUMP_FIELD(int, calib.phy_rx_min),
-- 
GitLab