@@ -300,7 +300,6 @@ static void siwx91x_configure_network_stack(sl_si91x_boot_configuration_t *boot_
300300
301301static int siwx91x_check_nwp_version (void )
302302{
303- sl_wifi_firmware_version_t expected_version ;
304303 sl_wifi_firmware_version_t version ;
305304 int ret ;
306305
@@ -309,38 +308,29 @@ static int siwx91x_check_nwp_version(void)
309308 return - EINVAL ;
310309 }
311310
312- sscanf (SIWX91X_NWP_FW_EXPECTED_VERSION , "%hhX.%hhd.%hhd.%hhd.%hhd.%hhd.%hd" ,
313- & expected_version .rom_id ,
314- & expected_version .major ,
315- & expected_version .minor ,
316- & expected_version .security_version ,
317- & expected_version .patch_num ,
318- & expected_version .customer_id ,
319- & expected_version .build_num );
320-
321311 /* Ignore rom_id:
322- * B is parsed as an hex value and we get 11 in expected_version .rom_id
323- * We received rom_id=17 in version.rom_id, we suspect a double hex->decimal conversion
312+ * the right value is 0x0B but we received 17 in version .rom_id, we suspect a double
313+ * hex->decimal conversion
324314 */
325- if (expected_version .major != version .major ) {
315+ if (siwx91x_nwp_fw_expected_version .major != version .major ) {
326316 return - EINVAL ;
327317 }
328- if (expected_version .minor != version .minor ) {
318+ if (siwx91x_nwp_fw_expected_version .minor != version .minor ) {
329319 return - EINVAL ;
330320 }
331- if (expected_version .security_version != version .security_version ) {
321+ if (siwx91x_nwp_fw_expected_version .security_version != version .security_version ) {
332322 return - EINVAL ;
333323 }
334- if (expected_version .patch_num != version .patch_num ) {
324+ if (siwx91x_nwp_fw_expected_version .patch_num != version .patch_num ) {
335325 return - EINVAL ;
336326 }
337- if (expected_version .customer_id != version .customer_id ) {
338- LOG_DBG ("customer_id diverge: expected %d, actual %d" , expected_version . customer_id ,
339- version .customer_id );
327+ if (siwx91x_nwp_fw_expected_version .customer_id != version .customer_id ) {
328+ LOG_DBG ("customer_id diverge: expected %d, actual %d" ,
329+ siwx91x_nwp_fw_expected_version . customer_id , version .customer_id );
340330 }
341- if (expected_version .build_num != version .build_num ) {
342- LOG_DBG ("build_num diverge: expected %d, actual %d" , expected_version . build_num ,
343- version .build_num );
331+ if (siwx91x_nwp_fw_expected_version .build_num != version .build_num ) {
332+ LOG_DBG ("build_num diverge: expected %d, actual %d" ,
333+ siwx91x_nwp_fw_expected_version . build_num , version .build_num );
344334 }
345335
346336 return 0 ;
@@ -448,8 +438,15 @@ static int siwx91x_nwp_init(const struct device *dev)
448438 /* Check if the NWP firmware version is correct */
449439 ret = siwx91x_check_nwp_version ();
450440 if (ret < 0 ) {
451- LOG_ERR ("Unexpected NWP firmware version (expected: %s)" ,
452- SIWX91X_NWP_FW_EXPECTED_VERSION );
441+ LOG_ERR ("Unexpected NWP firmware version (expected: %X.%d.%d.%d.%d.%d.%d)" ,
442+ siwx91x_nwp_fw_expected_version .rom_id ,
443+ siwx91x_nwp_fw_expected_version .major ,
444+ siwx91x_nwp_fw_expected_version .minor ,
445+ siwx91x_nwp_fw_expected_version .security_version ,
446+ siwx91x_nwp_fw_expected_version .patch_num ,
447+ siwx91x_nwp_fw_expected_version .customer_id ,
448+ siwx91x_nwp_fw_expected_version .build_num );
449+ return - EINVAL ;
453450 }
454451
455452 if (IS_ENABLED (CONFIG_SOC_SIWX91X_PM_BACKEND_PMGR )) {
0 commit comments