@@ -19,14 +19,22 @@ static void ixgbe_info_get_dsn(struct ixgbe_adapter *adapter,
1919 snprintf (ctx -> buf , sizeof (ctx -> buf ), "%8phD" , dsn );
2020}
2121
22- static void ixgbe_info_nvm_ver (struct ixgbe_adapter * adapter ,
23- struct ixgbe_info_ctx * ctx )
22+ static void ixgbe_info_orom_ver (struct ixgbe_adapter * adapter ,
23+ struct ixgbe_info_ctx * ctx )
2424{
2525 struct ixgbe_hw * hw = & adapter -> hw ;
2626 struct ixgbe_nvm_version nvm_ver ;
2727
2828 ctx -> buf [0 ] = '\0' ;
2929
30+ if (hw -> mac .type == ixgbe_mac_e610 ) {
31+ struct ixgbe_orom_info * orom = & adapter -> hw .flash .orom ;
32+
33+ snprintf (ctx -> buf , sizeof (ctx -> buf ), "%u.%u.%u" ,
34+ orom -> major , orom -> build , orom -> patch );
35+ return ;
36+ }
37+
3038 ixgbe_get_oem_prod_version (hw , & nvm_ver );
3139 if (nvm_ver .oem_valid ) {
3240 snprintf (ctx -> buf , sizeof (ctx -> buf ), "%x.%x.%x" ,
@@ -48,6 +56,12 @@ static void ixgbe_info_eetrack(struct ixgbe_adapter *adapter,
4856 struct ixgbe_hw * hw = & adapter -> hw ;
4957 struct ixgbe_nvm_version nvm_ver ;
5058
59+ if (hw -> mac .type == ixgbe_mac_e610 ) {
60+ snprintf (ctx -> buf , sizeof (ctx -> buf ), "0x%08x" ,
61+ hw -> flash .nvm .eetrack );
62+ return ;
63+ }
64+
5165 ixgbe_get_oem_prod_version (hw , & nvm_ver );
5266
5367 /* No ETRACK version for OEM */
@@ -60,6 +74,110 @@ static void ixgbe_info_eetrack(struct ixgbe_adapter *adapter,
6074 snprintf (ctx -> buf , sizeof (ctx -> buf ), "0x%08x" , nvm_ver .etk_id );
6175}
6276
77+ static void ixgbe_info_fw_api (struct ixgbe_adapter * adapter ,
78+ struct ixgbe_info_ctx * ctx )
79+ {
80+ struct ixgbe_hw * hw = & adapter -> hw ;
81+
82+ snprintf (ctx -> buf , sizeof (ctx -> buf ), "%u.%u.%u" ,
83+ hw -> api_maj_ver , hw -> api_min_ver , hw -> api_patch );
84+ }
85+
86+ static void ixgbe_info_fw_build (struct ixgbe_adapter * adapter ,
87+ struct ixgbe_info_ctx * ctx )
88+ {
89+ struct ixgbe_hw * hw = & adapter -> hw ;
90+
91+ snprintf (ctx -> buf , sizeof (ctx -> buf ), "0x%08x" , hw -> fw_build );
92+ }
93+
94+ static void ixgbe_info_fw_srev (struct ixgbe_adapter * adapter ,
95+ struct ixgbe_info_ctx * ctx )
96+ {
97+ struct ixgbe_nvm_info * nvm = & adapter -> hw .flash .nvm ;
98+
99+ snprintf (ctx -> buf , sizeof (ctx -> buf ), "%u" , nvm -> srev );
100+ }
101+
102+ static void ixgbe_info_orom_srev (struct ixgbe_adapter * adapter ,
103+ struct ixgbe_info_ctx * ctx )
104+ {
105+ struct ixgbe_orom_info * orom = & adapter -> hw .flash .orom ;
106+
107+ snprintf (ctx -> buf , sizeof (ctx -> buf ), "%u" , orom -> srev );
108+ }
109+
110+ static void ixgbe_info_nvm_ver (struct ixgbe_adapter * adapter ,
111+ struct ixgbe_info_ctx * ctx )
112+ {
113+ struct ixgbe_nvm_info * nvm = & adapter -> hw .flash .nvm ;
114+
115+ snprintf (ctx -> buf , sizeof (ctx -> buf ), "%x.%02x" , nvm -> major , nvm -> minor );
116+ }
117+
118+ static void ixgbe_info_netlist_ver (struct ixgbe_adapter * adapter ,
119+ struct ixgbe_info_ctx * ctx )
120+ {
121+ struct ixgbe_netlist_info * netlist = & adapter -> hw .flash .netlist ;
122+
123+ /* The netlist version fields are BCD formatted */
124+ snprintf (ctx -> buf , sizeof (ctx -> buf ), "%x.%x.%x-%x.%x.%x" ,
125+ netlist -> major , netlist -> minor ,
126+ netlist -> type >> 16 , netlist -> type & 0xFFFF ,
127+ netlist -> rev , netlist -> cust_ver );
128+ }
129+
130+ static void ixgbe_info_netlist_build (struct ixgbe_adapter * adapter ,
131+ struct ixgbe_info_ctx * ctx )
132+ {
133+ struct ixgbe_netlist_info * netlist = & adapter -> hw .flash .netlist ;
134+
135+ snprintf (ctx -> buf , sizeof (ctx -> buf ), "0x%08x" , netlist -> hash );
136+ }
137+
138+ static int ixgbe_devlink_info_get_e610 (struct ixgbe_adapter * adapter ,
139+ struct devlink_info_req * req ,
140+ struct ixgbe_info_ctx * ctx )
141+ {
142+ int err ;
143+
144+ ixgbe_info_fw_api (adapter , ctx );
145+ err = devlink_info_version_running_put (req ,
146+ DEVLINK_INFO_VERSION_GENERIC_FW_MGMT_API ,
147+ ctx -> buf );
148+ if (err )
149+ return err ;
150+
151+ ixgbe_info_fw_build (adapter , ctx );
152+ err = devlink_info_version_running_put (req , "fw.mgmt.build" , ctx -> buf );
153+ if (err )
154+ return err ;
155+
156+ ixgbe_info_fw_srev (adapter , ctx );
157+ err = devlink_info_version_running_put (req , "fw.mgmt.srev" , ctx -> buf );
158+ if (err )
159+ return err ;
160+
161+ ixgbe_info_orom_srev (adapter , ctx );
162+ err = devlink_info_version_running_put (req , "fw.undi.srev" , ctx -> buf );
163+ if (err )
164+ return err ;
165+
166+ ixgbe_info_nvm_ver (adapter , ctx );
167+ err = devlink_info_version_running_put (req , "fw.psid.api" , ctx -> buf );
168+ if (err )
169+ return err ;
170+
171+ ixgbe_info_netlist_ver (adapter , ctx );
172+ err = devlink_info_version_running_put (req , "fw.netlist" , ctx -> buf );
173+ if (err )
174+ return err ;
175+
176+ ixgbe_info_netlist_build (adapter , ctx );
177+ return devlink_info_version_running_put (req , "fw.netlist.build" ,
178+ ctx -> buf );
179+ }
180+
63181static int ixgbe_devlink_info_get (struct devlink * devlink ,
64182 struct devlink_info_req * req ,
65183 struct netlink_ext_ack * extack )
@@ -88,7 +206,7 @@ static int ixgbe_devlink_info_get(struct devlink *devlink,
88206 if (err )
89207 goto free_ctx ;
90208
91- ixgbe_info_nvm_ver (adapter , ctx );
209+ ixgbe_info_orom_ver (adapter , ctx );
92210 err = devlink_info_version_running_put (req ,
93211 DEVLINK_INFO_VERSION_GENERIC_FW_UNDI ,
94212 ctx -> buf );
@@ -99,6 +217,10 @@ static int ixgbe_devlink_info_get(struct devlink *devlink,
99217 err = devlink_info_version_running_put (req ,
100218 DEVLINK_INFO_VERSION_GENERIC_FW_BUNDLE_ID ,
101219 ctx -> buf );
220+ if (err || hw -> mac .type != ixgbe_mac_e610 )
221+ goto free_ctx ;
222+
223+ err = ixgbe_devlink_info_get_e610 (adapter , req , ctx );
102224free_ctx :
103225 kfree (ctx );
104226 return err ;
0 commit comments