@@ -261,7 +261,6 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_
261261
262262static int siwx91x_check_nwp_version (void )
263263{
264- sl_wifi_firmware_version_t expected_version ;
265264 sl_wifi_firmware_version_t version ;
266265 int ret ;
267266
@@ -270,38 +269,29 @@ static int siwx91x_check_nwp_version(void)
270269 return - EINVAL ;
271270 }
272271
273- sscanf (SIWX91X_NWP_FW_EXPECTED_VERSION , "%hhX.%hhd.%hhd.%hhd.%hhd.%hhd.%hd" ,
274- & expected_version .rom_id ,
275- & expected_version .major ,
276- & expected_version .minor ,
277- & expected_version .security_version ,
278- & expected_version .patch_num ,
279- & expected_version .customer_id ,
280- & expected_version .build_num );
281-
282272 /* Ignore rom_id:
283- * B is parsed as an hex value and we get 11 in expected_version .rom_id
284- * We received rom_id=17 in version.rom_id, we suspect a double hex->decimal conversion
273+ * the right value is 0x0B but we received 17 in version .rom_id, we suspect a double
274+ * hex->decimal conversion
285275 */
286- if (expected_version .major != version .major ) {
276+ if (siwx91x_nwp_fw_expected_version .major != version .major ) {
287277 return - EINVAL ;
288278 }
289- if (expected_version .minor != version .minor ) {
279+ if (siwx91x_nwp_fw_expected_version .minor != version .minor ) {
290280 return - EINVAL ;
291281 }
292- if (expected_version .security_version != version .security_version ) {
282+ if (siwx91x_nwp_fw_expected_version .security_version != version .security_version ) {
293283 return - EINVAL ;
294284 }
295- if (expected_version .patch_num != version .patch_num ) {
285+ if (siwx91x_nwp_fw_expected_version .patch_num != version .patch_num ) {
296286 return - EINVAL ;
297287 }
298- if (expected_version .customer_id != version .customer_id ) {
299- LOG_DBG ("customer_id diverge: expected %d, actual %d" , expected_version . customer_id ,
300- version .customer_id );
288+ if (siwx91x_nwp_fw_expected_version .customer_id != version .customer_id ) {
289+ LOG_DBG ("customer_id diverge: expected %d, actual %d" ,
290+ siwx91x_nwp_fw_expected_version . customer_id , version .customer_id );
301291 }
302- if (expected_version .build_num != version .build_num ) {
303- LOG_DBG ("build_num diverge: expected %d, actual %d" , expected_version . build_num ,
304- version .build_num );
292+ if (siwx91x_nwp_fw_expected_version .build_num != version .build_num ) {
293+ LOG_DBG ("build_num diverge: expected %d, actual %d" ,
294+ siwx91x_nwp_fw_expected_version . build_num , version .build_num );
305295 }
306296
307297 return 0 ;
@@ -414,8 +404,15 @@ static int siwx91x_nwp_init(const struct device *dev)
414404 /* Check if the NWP firmware version is correct */
415405 ret = siwx91x_check_nwp_version ();
416406 if (ret < 0 ) {
417- LOG_ERR ("Unexpected NWP firmware version (expected: %s)" ,
418- SIWX91X_NWP_FW_EXPECTED_VERSION );
407+ LOG_ERR ("Unexpected NWP firmware version (expected: %X.%d.%d.%d.%d.%d.%d)" ,
408+ siwx91x_nwp_fw_expected_version .rom_id ,
409+ siwx91x_nwp_fw_expected_version .major ,
410+ siwx91x_nwp_fw_expected_version .minor ,
411+ siwx91x_nwp_fw_expected_version .security_version ,
412+ siwx91x_nwp_fw_expected_version .patch_num ,
413+ siwx91x_nwp_fw_expected_version .customer_id ,
414+ siwx91x_nwp_fw_expected_version .build_num );
415+ return - EINVAL ;
419416 }
420417
421418 if (IS_ENABLED (CONFIG_SOC_SIWX91X_PM_BACKEND_PMGR )) {
0 commit comments