Commit 39890049 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski

net: sfp: provide a definition for the power level select bit

Provide a named definition for the power level select bit in the
extended status register, rather than using BIT(0) in the code.
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent f8810ca7
...@@ -1837,13 +1837,13 @@ static int sfp_sm_mod_hpower(struct sfp *sfp, bool enable) ...@@ -1837,13 +1837,13 @@ static int sfp_sm_mod_hpower(struct sfp *sfp, bool enable)
* all bytes 0xff) at 0x51 but does not accept writes. In any case, * all bytes 0xff) at 0x51 but does not accept writes. In any case,
* if the bit is already set, we're already in high power mode. * if the bit is already set, we're already in high power mode.
*/ */
if (!!(val & BIT(0)) == enable) if (!!(val & SFP_EXT_STATUS_PWRLVL_SELECT) == enable)
return 0; return 0;
if (enable) if (enable)
val |= BIT(0); val |= SFP_EXT_STATUS_PWRLVL_SELECT;
else else
val &= ~BIT(0); val &= ~SFP_EXT_STATUS_PWRLVL_SELECT;
err = sfp_write(sfp, true, SFP_EXT_STATUS, &val, sizeof(val)); err = sfp_write(sfp, true, SFP_EXT_STATUS, &val, sizeof(val));
if (err != sizeof(val)) { if (err != sizeof(val)) {
......
...@@ -489,6 +489,8 @@ enum { ...@@ -489,6 +489,8 @@ enum {
SFP_WARN1_RXPWR_LOW = BIT(6), SFP_WARN1_RXPWR_LOW = BIT(6),
SFP_EXT_STATUS = 0x76, SFP_EXT_STATUS = 0x76,
SFP_EXT_STATUS_PWRLVL_SELECT = BIT(0),
SFP_VSL = 0x78, SFP_VSL = 0x78,
SFP_PAGE = 0x7f, SFP_PAGE = 0x7f,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment