Add QSFP-DD support
Subsystems (3)
PATCH v4 1/1 Add QSFP-DD support
The Common Management Interface Specification (CMIS) for QSFP-DD shares some similarities with other form factors such as QSFP or SFP, but due to the fact that the module memory map is different, the current ethtool version is not able to provide relevant information about an interface.
This patch adds QSFP-DD support to ethtool. The changes are similar to the ones already existing in qsfp.c, but customized to use the memory addresses and logic as defined in the specifications document.
Several functions from qsfp.c could be reused, so an additional parameter was added to each and the functions were moved to sff-common.c.
Diff from v1:
* Report cable length in meters instead of kilometers
* Fix bad value for QSFP_DD_DATE_VENDOR_LOT_OFFSET
* Fix initialization for struct qsfp_dd_diags
* Remove unrelated whitespace cleanups in qsfp.c and Makefile.am
Diff from v2:
* Remove functions assuming the existance of page 0x10 and 0x11
* Remove structs and constants related to the page 0x10 and 0x11
Diff from v3:
* Added missing Signed-off-by and Tested-by tags
--- Makefile.am | 2 +- qsfp-dd.c | 333 +++++++++++++++++++++++++++++++++++++++++++++++++++ qsfp-dd.h | 125 +++++++++++++++++++ qsfp.c | 47 ++------ qsfp.h | 8 -- sff-common.c | 51 ++++++++ sff-common.h | 26 +++- 7 files changed, 543 insertions(+), 49 deletions(-) create mode 100644 qsfp-dd.c create mode 100644 qsfp-dd.h
Makefile.am +1 -1
@@ -17,7 +17,7 @@ ethtool_SOURCES += \ smsc911x.c at76c50x-usb.c sfc.c stmmac.c \ sff-common.c sff-common.h sfpid.c sfpdiag.c \ ixgbevf.c tse.c vmxnet3.c qsfp.c qsfp.h fjes.c lan78xx.c \ - igc.c + igc.c qsfp-dd.c qsfp-dd.h endif if ENABLE_BASH_COMPLETION
qsfp-dd.c new file +333 -0
333 lines not on this page · raw message
qsfp-dd.h new file +125 -0
125 lines not on this page · raw message
qsfp.c +11 -36
81 lines not on this page · raw message
qsfp.h +0 -8
@@ -31,14 +31,6 @@#define SFF8636_ID_OFFSET 0x00#define SFF8636_REV_COMPLIANCE_OFFSET 0x01 -#define SFF8636_REV_UNSPECIFIED 0x00 -#define SFF8636_REV_8436_48 0x01 -#define SFF8636_REV_8436_8636 0x02 -#define SFF8636_REV_8636_13 0x03 -#define SFF8636_REV_8636_14 0x04 -#define SFF8636_REV_8636_15 0x05 -#define SFF8636_REV_8636_20 0x06 -#define SFF8636_REV_8636_27 0x07#define SFF8636_STATUS_2_OFFSET 0x02/* Flat Memory:0- Paging, 1- Page 0 only */
sff-common.c +51 -0
66 lines not on this page · raw message
sff-common.h +22 -4
@@ -26,7 +26,17 @@#include <stdio.h> #include "internal.h" -#define SFF8024_ID_OFFSET 0x00 +/* Revision compliance */ +#define SFF8636_REV_UNSPECIFIED 0x00 +#define SFF8636_REV_8436_48 0x01 +#define SFF8636_REV_8436_8636 0x02 +#define SFF8636_REV_8636_13 0x03 +#define SFF8636_REV_8636_14 0x04 +#define SFF8636_REV_8636_15 0x05 +#define SFF8636_REV_8636_20 0x06 +#define SFF8636_REV_8636_27 0x07 + +#define SFF8024_ID_OFFSET 0x00#define SFF8024_ID_UNKNOWN 0x00#define SFF8024_ID_GBIC 0x01#define SFF8024_ID_SOLDERED_MODULE 0x02
@@ -51,7 +61,8 @@#define SFF8024_ID_HD8X_FANOUT 0x15#define SFF8024_ID_CDFP_S3 0x16#define SFF8024_ID_MICRO_QSFP 0x17 -#define SFF8024_ID_LAST SFF8024_ID_MICRO_QSFP +#define SFF8024_ID_QSFP_DD 0x18 +#define SFF8024_ID_LAST SFF8024_ID_QSFP_DD#define SFF8024_ID_UNALLOCATED_LAST 0x7F#define SFF8024_ID_VENDOR_START 0x80#define SFF8024_ID_VENDOR_LAST 0xFF
@@ -76,8 +87,14 @@#define SFF8024_CTOR_RJ45 0x22#define SFF8024_CTOR_NO_SEPARABLE 0x23#define SFF8024_CTOR_MXC_2x16 0x24 -#define SFF8024_CTOR_LAST SFF8024_CTOR_MXC_2x16 -#define SFF8024_CTOR_UNALLOCATED_LAST 0x7F +#define SFF8024_CTOR_CS_OPTICAL 0x25 +#define SFF8024_CTOR_CS_OPTICAL_MINI 0x26 +#define SFF8024_CTOR_MPO_2X12 0x27 +#define SFF8024_CTOR_MPO_1X16 0x28 +#define SFF8024_CTOR_LAST SFF8024_CTOR_MPO_1X16 + +#define SFF8024_CTOR_NO_SEP_QSFP_DD 0x6F +#define SFF8024_CTOR_UNALLOCATED_LAST 0x7F#define SFF8024_CTOR_VENDOR_START 0x80#define SFF8024_CTOR_VENDOR_LAST 0xFF
@@ -185,5 +202,6 @@ void sff8024_show_oui(const __u8 *id, int id_offset);void sff8024_show_identifier (const __u8 *id,int id_offset);void sff8024_show_connector (const __u8 *id,int ctor_offset);void sff8024_show_encoding (const __u8 *id,int encoding_offset,int sff_type); +void sff_show_revision_compliance (const __u8 *id,int rev_offset);#endif /* SFF_COMMON_H__ */
Signature · 1 line
2.17.1