@@ -37,6 +37,7 @@ static int iwl_pnvm_handle_section(struct iwl_trans *trans, const u8 *data,
37
37
u32 sha1 = 0 ;
38
38
u16 mac_type = 0 , rf_id = 0 ;
39
39
u8 * pnvm_data = NULL , * tmp ;
40
+ bool hw_match = false;
40
41
u32 size = 0 ;
41
42
int ret ;
42
43
@@ -83,22 +84,19 @@ static int iwl_pnvm_handle_section(struct iwl_trans *trans, const u8 *data,
83
84
break ;
84
85
}
85
86
87
+ if (hw_match )
88
+ break ;
89
+
86
90
mac_type = le16_to_cpup ((__le16 * )data );
87
91
rf_id = le16_to_cpup ((__le16 * )(data + sizeof (__le16 )));
88
92
89
93
IWL_DEBUG_FW (trans ,
90
94
"Got IWL_UCODE_TLV_HW_TYPE mac_type 0x%0x rf_id 0x%0x\n" ,
91
95
mac_type , rf_id );
92
96
93
- if (mac_type != CSR_HW_REV_TYPE (trans -> hw_rev ) ||
94
- rf_id != CSR_HW_RFID_TYPE (trans -> hw_rf_id )) {
95
- IWL_DEBUG_FW (trans ,
96
- "HW mismatch, skipping PNVM section, mac_type 0x%0x, rf_id 0x%0x.\n" ,
97
- CSR_HW_REV_TYPE (trans -> hw_rev ), trans -> hw_rf_id );
98
- ret = - ENOENT ;
99
- goto out ;
100
- }
101
-
97
+ if (mac_type == CSR_HW_REV_TYPE (trans -> hw_rev ) &&
98
+ rf_id == CSR_HW_RFID_TYPE (trans -> hw_rf_id ))
99
+ hw_match = true;
102
100
break ;
103
101
case IWL_UCODE_TLV_SEC_RT : {
104
102
struct iwl_pnvm_section * section = (void * )data ;
@@ -149,6 +147,15 @@ static int iwl_pnvm_handle_section(struct iwl_trans *trans, const u8 *data,
149
147
}
150
148
151
149
done :
150
+ if (!hw_match ) {
151
+ IWL_DEBUG_FW (trans ,
152
+ "HW mismatch, skipping PNVM section (need mac_type 0x%x rf_id 0x%x)\n" ,
153
+ CSR_HW_REV_TYPE (trans -> hw_rev ),
154
+ CSR_HW_RFID_TYPE (trans -> hw_rf_id ));
155
+ ret = - ENOENT ;
156
+ goto out ;
157
+ }
158
+
152
159
if (!size ) {
153
160
IWL_DEBUG_FW (trans , "Empty PNVM, skipping.\n" );
154
161
ret = - ENOENT ;
0 commit comments