diff mbox series

[net-next,v5,1/5] net: sfp: add SFP_PASSWORD address

Message ID 20210114044331.5073-2-kabel@kernel.org (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Support for RollBall 10G copper SFP modules | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers fail 1 maintainers not CCed: linux@armlinux.org.uk
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 1 this patch: 1
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 1 this patch: 1
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Marek Behún Jan. 14, 2021, 4:43 a.m. UTC
Add SFP_PASSWORD = 0x7b to the diagnostics enumerator. This address is
described in SFF-8436 and SFF-8636.

Signed-off-by: Marek Behún <kabel@kernel.org>
---
 include/linux/sfp.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Russell King (Oracle) Jan. 14, 2021, 2:59 p.m. UTC | #1
On Thu, Jan 14, 2021 at 05:43:27AM +0100, Marek Behún wrote:
> Add SFP_PASSWORD = 0x7b to the diagnostics enumerator. This address is
> described in SFF-8436 and SFF-8636.

However, as I mentioned previously, these are not relevant for SFPs,
but are for QSFPs, and QSFPs have a totally different layout.

The data structure for this enum is described by SFF-8472, and it lists

	Vendor Specific Locations [Address A2h, Bytes 120-126]

This is what the SFP_VSL definition covers.

SFF-8436 defines the layout for "QSFP+ 10 Gbs 4X PLUGGABLE TRANSCEIVER":

                            Table 17 - Lower Memory Map (A0h)
       Address       Description         Type         Passive Copper,     Optical
                                                      Active Copper,      Module                                                      Active Optical
       0             Identifier (1       Read-Only    R                   R
                     Byte)
       1-2           Status (2 Bytes)     Read-Only    See Table 18
       3-21          Interrupt Flags      Read-Only    See Tables 19-21
                     (19 Bytes)
...
       123-126       Password Entry       Read/Write   O                  O
                     Area (optional) 4
                     Bytes
       127           Page Select Byte     Read/Write   R                  R

So, SFF-8436 is not relevant - not only is it for a different address
but the whole format is different.

SFF-8636 is "Specification for Management Interface for Cabled
Environments" and defines:

                             2-Wire Serial Address 1010000x
                                     Lower Page 00h
                            0 Identifier
                        1- 2 Status
                        3- 21 Interrupt Flags
...
                      123-126 Password Entry Area (Optional)
                      127     Page Select Byte

So again, SFF-8636 is not relevant for the same reasons as SFF-8436.

We're left with SFF-8472, which mentions no password entry area, but
leaves the area from 120-127 open as "vendor specific", so I don't
think it is appropriate to start adding vendor specific definitions as
if they were generic to sfp.h

I would instead suggest defining this inside mdio-i2c.c as

#define ROLLERBALL_PASSWORD	(SFP_VSL + 3)

rather than trying to make this appear generic.
diff mbox series

Patch

diff --git a/include/linux/sfp.h b/include/linux/sfp.h
index 38893e4dd0f0..81b40b2d6b1b 100644
--- a/include/linux/sfp.h
+++ b/include/linux/sfp.h
@@ -490,6 +490,7 @@  enum {
 
 	SFP_EXT_STATUS			= 0x76,
 	SFP_VSL				= 0x78,
+	SFP_PASSWORD			= 0x7b,
 	SFP_PAGE			= 0x7f,
 };