|
|
2a1b01 |
From 2dcf6b9dc1c1874705b9e71e13e00dde9f7f576c Mon Sep 17 00:00:00 2001
|
|
|
2a1b01 |
From: Ido Schimmel <idosch@nvidia.com>
|
|
|
2a1b01 |
Date: Tue, 23 Nov 2021 19:40:56 +0200
|
|
|
2a1b01 |
Subject: [PATCH 28/35] sff-common: Move OFFSET_TO_U16_PTR() to common header
|
|
|
2a1b01 |
file
|
|
|
2a1b01 |
|
|
|
2a1b01 |
The define is also useful for CMIS, so move it from SFF-8636 to the
|
|
|
2a1b01 |
common header file.
|
|
|
2a1b01 |
|
|
|
2a1b01 |
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
|
|
|
2a1b01 |
---
|
|
|
2a1b01 |
qsfp.c | 1 -
|
|
|
2a1b01 |
sff-common.h | 4 ++--
|
|
|
2a1b01 |
2 files changed, 2 insertions(+), 3 deletions(-)
|
|
|
2a1b01 |
|
|
|
2a1b01 |
diff --git a/qsfp.c b/qsfp.c
|
|
|
2a1b01 |
index 58c4c4775e9b..b3c9e1516af9 100644
|
|
|
2a1b01 |
--- a/qsfp.c
|
|
|
2a1b01 |
+++ b/qsfp.c
|
|
|
2a1b01 |
@@ -700,7 +700,6 @@ sff8636_show_wavelength_or_copper_compliance(const struct sff8636_memory_map *ma
|
|
|
2a1b01 |
* Second byte are 1/256th of degree, which are added to the dec part.
|
|
|
2a1b01 |
*/
|
|
|
2a1b01 |
#define SFF8636_OFFSET_TO_TEMP(offset) ((__s16)OFFSET_TO_U16(offset))
|
|
|
2a1b01 |
-#define OFFSET_TO_U16_PTR(ptr, offset) (ptr[offset] << 8 | ptr[(offset) + 1])
|
|
|
2a1b01 |
|
|
|
2a1b01 |
static void sff8636_dom_parse(const struct sff8636_memory_map *map,
|
|
|
2a1b01 |
struct sff_diags *sd)
|
|
|
2a1b01 |
diff --git a/sff-common.h b/sff-common.h
|
|
|
2a1b01 |
index aab306e0b74f..9e323008ba19 100644
|
|
|
2a1b01 |
--- a/sff-common.h
|
|
|
2a1b01 |
+++ b/sff-common.h
|
|
|
2a1b01 |
@@ -126,8 +126,8 @@
|
|
|
2a1b01 |
#define SFF8024_ENCODING_PAM4 0x08
|
|
|
2a1b01 |
|
|
|
2a1b01 |
/* Most common case: 16-bit unsigned integer in a certain unit */
|
|
|
2a1b01 |
-#define OFFSET_TO_U16(offset) \
|
|
|
2a1b01 |
- (id[offset] << 8 | id[(offset) + 1])
|
|
|
2a1b01 |
+#define OFFSET_TO_U16_PTR(ptr, offset) (ptr[offset] << 8 | ptr[(offset) + 1])
|
|
|
2a1b01 |
+#define OFFSET_TO_U16(offset) OFFSET_TO_U16_PTR(id, offset)
|
|
|
2a1b01 |
|
|
|
2a1b01 |
# define PRINT_xX_PWR(string, var) \
|
|
|
2a1b01 |
printf("\t%-41s : %.4f mW / %.2f dBm\n", (string), \
|
|
|
2a1b01 |
--
|
|
|
2a1b01 |
2.35.1
|
|
|
2a1b01 |
|