[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211123174102.3242294-4-idosch@idosch.org>
Date: Tue, 23 Nov 2021 19:40:57 +0200
From: Ido Schimmel <idosch@...sch.org>
To: netdev@...r.kernel.org
Cc: mkubecek@...e.cz, popadrian1996@...il.com, andrew@...n.ch,
mlxsw@...dia.com, moshe@...dia.com,
Ido Schimmel <idosch@...dia.com>
Subject: [PATCH ethtool-next 3/8] cmis: Initialize Page 02h in memory map
From: Ido Schimmel <idosch@...dia.com>
Page 02h stores module and lane thresholds that are going to be parsed
and displayed in subsequent patches.
Request it via the 'MODULE_EEPROM_GET' netlink message and initialize it
in the memory map.
Signed-off-by: Ido Schimmel <idosch@...dia.com>
---
cmis.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/cmis.c b/cmis.c
index 4798fd4c7d68..55b9d1b959cd 100644
--- a/cmis.c
+++ b/cmis.c
@@ -17,9 +17,10 @@
struct cmis_memory_map {
const __u8 *lower_memory;
- const __u8 *upper_memory[1][2]; /* Bank, Page */
+ const __u8 *upper_memory[1][3]; /* Bank, Page */
#define page_00h upper_memory[0x0][0x0]
#define page_01h upper_memory[0x0][0x1]
+#define page_02h upper_memory[0x0][0x2]
};
#define CMIS_PAGE_SIZE 0x80
@@ -423,8 +424,8 @@ cmis_memory_map_init_pages(struct cmd_context *ctx,
return ret;
map->page_00h = request.data - CMIS_PAGE_SIZE;
- /* Page 01h is only present when the module memory model is paged and
- * not flat.
+ /* Pages 01h and 02h are only present when the module memory model is
+ * paged and not flat.
*/
if (map->lower_memory[CMIS_MEMORY_MODEL_OFFSET] &
CMIS_MEMORY_MODEL_MASK)
@@ -436,6 +437,12 @@ cmis_memory_map_init_pages(struct cmd_context *ctx,
return ret;
map->page_01h = request.data - CMIS_PAGE_SIZE;
+ cmis_request_init(&request, 0, 0x2, CMIS_PAGE_SIZE);
+ ret = nl_get_eeprom_page(ctx, &request);
+ if (ret < 0)
+ return ret;
+ map->page_02h = request.data - CMIS_PAGE_SIZE;
+
return 0;
}
--
2.31.1
Powered by blists - more mailing lists