Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sfp): fix rx power conversion #479

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ishidawataru
Copy link

Description

fixes how to calculate the rx power when the external calibration is used according to the SFF-8472 Rev 12.4 section 9.3.

Motivation and Context

fixes #449

How Has This Been Tested?

No. Asking the original reporter of this bug to test this as I don't have access to a real device that uses this feature

Additional Information (Optional)

closes sonic-net#449

Signed-off-by: Wataru Ishida <wataru.ishid@gmail.com>
coeff = self.float_from_bytes(eeprom_data[off:off+size])
result += coeff * rx_pwr_ad ** i

result = result * 0.0001 # uW to mW

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the comment should make it clear that the result value is in 0.1 uW units, not uW (the formula in the documentation at section 9.3 is also misleading in that regards). Otherwise the conversion factor may be interpreted off by an order of magnitude by an unsuspecting reader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SFF-8472 Rx power conversion function incorrect
2 participants