+
    i  c                   s>    ^ RI t ^ RIt^ RIHtHt  ! R R]]4      tR# )    N)PluginIndependentPluginc                   sF   a  ] tR t^t o RtRtR	tR
tRtR t	R t
R tRtV tR# )MellanoxFirmwarez&Nvidia(Mellanox) firmware tools outputZmellanox_firmwarezMellanox Technologiesc                sx    V P                  R4      pVR,          ^ 8H  ;'       d    V P                  VR,          9   # )z
Checks if this plugin should be executed at all.
We will only enable the plugin if there is a
Mellanox Technologies network adapter
lspci -D -d 15b3::0200statusoutput)exec_cmdMLNX_STRING)selfZlspcis   & I/usr/lib/python3.14/site-packages/sos/report/plugins/mellanox_firmware.pycheck_enabledZMellanoxFirmware.check_enabled   s9     67X!#KK(8(8E(O(KK    c                sV   V P                  R 4      '       g   V P                  R4       R# V P                  R4      pVR,          ^ 8w  d   R# V P                  R4      pVR,          ^ 8w  d   R# V P                  R4       V P                  R^
R7       V P                  R	^
R7       \        P
                  ! R
4      p. pV F  pRV9   g   K  VP                  V4       K  	  V F1  pV P                  RV R2^
R7       V P                  RV R2^
R7       K3  	  V P                  RRR7       R# )Zallow_system_changesztSkipping mst/mlx cable commands as system changeswould be made. Use --allow-system-changes toenable this collection.Nflint --versionr   z	mst startzmst cable addzmst status -vZtimeout	mlxcablesz/dev/mstZcablezmlxcables -d z --DDMz --dumpzmst stopT)Zchanges)Z
get_optionZ	_log_infor   collect_cmd_outputosZlistdirappend)r	   coutr   deviceZmlxcables   &    r
   collectZMellanoxFirmware.collect#   s1   566NN 5 6  }}./>Q&&{3>Q0<R8zz*%	F&   (  "H##mH:V$D,. $ 0##mH:W$E,. $ 0 "
 	
D9r   c           
     s^   . pV P                  R 4      pVR,          ^ 8w  d   R# VR,          P                  4        F"  pVP                  VR,          R,           4       K$  	  \        V4      p. pV P	                  R4      pVR,          ^ 8w  d   RR.R	R
.R	R.RR.RR..pMRR.RR.RR
.RR.RR.RR.RR..pV Fq  pV F,  pV P                  V^ ,           RV RV^,           2^R7       K.  	  \        ^4       F-  pV P                  RV 24       \        P                  ! ^4       K/  	  Ks  	  R# )r   r   Nr   :r    i   Nz00.0r   zmstconfig -d z -e qzmstflint -d z dcz qz
mstreg -d z --reg_name ROCE_ACCL --getzmstlink -d Z zmlxdump -d z pcie_uc --allz	flint -d z
mlxreg -d zmlxlink -d zfwtrace -d z -i all --tracer_mode FIFOZ r   zmstdump )	r   Z
splitlinesr   Zsetr   Zadd_cmd_outputZrangetimeZsleep)	r	   ZdevicesZdevice_listZlineZcommandsr   r   ZcommandZ_s	   &        r
   setupZMellanoxFirmware.setupC   sy   --.FG x A%)446D
 NN49V+, 7 g,  }}./>Q !'*'&<=#H  01 '*e$d#<=# <=H F###wqzl!F81'.qzl%4=? $ A $ 1X##hvh$78

1  r    N)ZhardwareZsystem)ZmstZmstflint)Z__name__Z
__module__Z__qualname__Z__firstlineno__Z
short_descZplugin_nameZprofilesZpackagesr   r   r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r
   r   r      s4     9J%K%H"H)KL:@9 9r   r   )r   r   Zsos.report.pluginsr   r   r   r   r   r
   <module>r      s!    
  8lv0 lr   