* [PATCH ethtool] ethtool: Add SFF 8636 date code parsing support
@ 2018-02-21 20:35 Saeed Mahameed
2018-02-27 19:31 ` [ethtool] " John W. Linville
0 siblings, 1 reply; 2+ messages in thread
From: Saeed Mahameed @ 2018-02-21 20:35 UTC (permalink / raw)
To: John W . Linville; +Cc: netdev, Saeed Mahameed
Parse date codes according to SFF 8636 and print them to output.
ethtool -m ethX
[...]
Date code : 160220
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Gal Pressman <galp@mellanox.com>
---
qsfp.c | 2 ++
qsfp.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/qsfp.c b/qsfp.c
index 213802e..aecd5bb 100644
--- a/qsfp.c
+++ b/qsfp.c
@@ -782,6 +782,8 @@ void sff8636_show_all(const __u8 *id, __u32 eeprom_len)
SFF8636_VENDOR_REV_END_OFFSET, "Vendor rev");
sff_show_ascii(id, SFF8636_VENDOR_SN_START_OFFSET,
SFF8636_VENDOR_SN_END_OFFSET, "Vendor SN");
+ sff_show_ascii(id, SFF8636_DATE_YEAR_OFFSET,
+ SFF8636_DATE_VENDOR_LOT_OFFSET + 1, "Date code");
sff8636_show_revision_compliance(id);
sff8636_show_dom(id, eeprom_len);
}
diff --git a/qsfp.h b/qsfp.h
index 553ca5f..b623174 100644
--- a/qsfp.h
+++ b/qsfp.h
@@ -535,6 +535,8 @@
#define SFF8636_DATE_MONTH_LEN 2
#define SFF8636_DATE_DAY_OFFSET 0xD8
#define SFF8636_DATE_DAY_LEN 2
+#define SFF8636_DATE_VENDOR_LOT_OFFSET 0xDA
+#define SFF8636_DATE_VENDOR_LOT_LEN 2
/* Diagnostic Monitoring Type - 220 */
#define SFF8636_DIAG_TYPE_OFFSET 0xDC
--
2.14.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [ethtool] ethtool: Add SFF 8636 date code parsing support
2018-02-21 20:35 [PATCH ethtool] ethtool: Add SFF 8636 date code parsing support Saeed Mahameed
@ 2018-02-27 19:31 ` John W. Linville
0 siblings, 0 replies; 2+ messages in thread
From: John W. Linville @ 2018-02-27 19:31 UTC (permalink / raw)
To: Saeed Mahameed; +Cc: netdev
On Wed, Feb 21, 2018 at 12:35:09PM -0800, Saeed Mahameed wrote:
> Parse date codes according to SFF 8636 and print them to output.
>
> ethtool -m ethX
> [...]
> Date code : 160220
>
> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> Reviewed-by: Gal Pressman <galp@mellanox.com>
LGTM -- queued for ethtool-4.16...
Thanks!
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-27 19:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-21 20:35 [PATCH ethtool] ethtool: Add SFF 8636 date code parsing support Saeed Mahameed
2018-02-27 19:31 ` [ethtool] " John W. Linville
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).