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

[Credo][Ycable] Fix for displaying 'N/A' firmware version when NIC endpoint is power off #366

Merged
merged 4 commits into from
Sep 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions sonic_y_cable/credo/y_cable_credo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,12 @@ def get_firmware_version(self, target):

"""
if self.platform_chassis is not None:
read_side = self.get_read_side()

if read_side == YCable.EEPROM_ERROR:
self.log_error('Fail to get read side in get_firmware_version()')
return None

with self.rlock.acquire_timeout(RLocker.ACQUIRE_LOCK_TIMEOUT) as lock_status:
if lock_status:
vsc_req_form = [None] * (YCable.VSC_CMD_ATTRIBUTE_LENGTH)
Expand All @@ -1469,8 +1475,12 @@ def get_firmware_version(self, target):
status = self.send_vsc(vsc_req_form)

if status != YCable.MCU_EC_NO_ERROR:
self.log_error('Get firmware version error (error code:0x%04X)' % (status))
return None
''' should at least return local side fw version if nic is offline'''
if status == YCable.MCU_EC_FWUPD_UART_TIMEOUT and (read_side == target):
pass
else:
self.log_error('Get firmware version error (error code:0x%04X)' % (status))
return None

data = bytearray(YCable.FIRMWARE_INFO_PAYLOAD_SIZE)
for byte_idx in range(0, YCable.FIRMWARE_INFO_PAYLOAD_SIZE):
Expand Down
Loading