@@ -586,6 +586,51 @@ static void iwl_drv_set_dump_exclude(struct iwl_drv *drv,
586
586
excl -> size = le32_to_cpu (fw -> size );
587
587
}
588
588
589
+ static void iwl_parse_dbg_tlv_assert_tables (struct iwl_drv * drv ,
590
+ const struct iwl_ucode_tlv * tlv )
591
+ {
592
+ const struct iwl_fw_ini_region_tlv * region ;
593
+ u32 length = le32_to_cpu (tlv -> length );
594
+ u32 addr ;
595
+
596
+ if (length < offsetof(typeof (* region ), special_mem ) +
597
+ sizeof (region -> special_mem ))
598
+ return ;
599
+
600
+ region = (void * )tlv -> data ;
601
+ addr = le32_to_cpu (region -> special_mem .base_addr );
602
+ addr += le32_to_cpu (region -> special_mem .offset );
603
+ addr &= ~FW_ADDR_CACHE_CONTROL ;
604
+
605
+ if (region -> type != IWL_FW_INI_REGION_SPECIAL_DEVICE_MEMORY )
606
+ return ;
607
+
608
+ switch (region -> sub_type ) {
609
+ case IWL_FW_INI_REGION_DEVICE_MEMORY_SUBTYPE_UMAC_ERROR_TABLE :
610
+ drv -> trans -> dbg .umac_error_event_table = addr ;
611
+ drv -> trans -> dbg .error_event_table_tlv_status |=
612
+ IWL_ERROR_EVENT_TABLE_UMAC ;
613
+ break ;
614
+ case IWL_FW_INI_REGION_DEVICE_MEMORY_SUBTYPE_LMAC_1_ERROR_TABLE :
615
+ drv -> trans -> dbg .lmac_error_event_table [0 ] = addr ;
616
+ drv -> trans -> dbg .error_event_table_tlv_status |=
617
+ IWL_ERROR_EVENT_TABLE_LMAC1 ;
618
+ break ;
619
+ case IWL_FW_INI_REGION_DEVICE_MEMORY_SUBTYPE_LMAC_2_ERROR_TABLE :
620
+ drv -> trans -> dbg .lmac_error_event_table [1 ] = addr ;
621
+ drv -> trans -> dbg .error_event_table_tlv_status |=
622
+ IWL_ERROR_EVENT_TABLE_LMAC2 ;
623
+ break ;
624
+ case IWL_FW_INI_REGION_DEVICE_MEMORY_SUBTYPE_TCM_1_ERROR_TABLE :
625
+ drv -> trans -> dbg .tcm_error_event_table = addr ;
626
+ drv -> trans -> dbg .error_event_table_tlv_status |=
627
+ IWL_ERROR_EVENT_TABLE_TCM ;
628
+ break ;
629
+ default :
630
+ break ;
631
+ }
632
+ }
633
+
589
634
static int iwl_parse_tlv_firmware (struct iwl_drv * drv ,
590
635
const struct firmware * ucode_raw ,
591
636
struct iwl_firmware_pieces * pieces ,
@@ -1153,21 +1198,12 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
1153
1198
IWL_ERROR_EVENT_TABLE_LMAC1 ;
1154
1199
break ;
1155
1200
}
1156
- case IWL_UCODE_TLV_TCM_DEBUG_ADDRS : {
1157
- struct iwl_fw_tcm_error_addr * ptr = (void * )tlv_data ;
1158
-
1159
- if (tlv_len != sizeof (* ptr ))
1160
- goto invalid_tlv_len ;
1161
- drv -> trans -> dbg .tcm_error_event_table =
1162
- le32_to_cpu (ptr -> addr ) & ~FW_ADDR_CACHE_CONTROL ;
1163
- drv -> trans -> dbg .error_event_table_tlv_status |=
1164
- IWL_ERROR_EVENT_TABLE_TCM ;
1165
- break ;
1166
- }
1201
+ case IWL_UCODE_TLV_TYPE_REGIONS :
1202
+ iwl_parse_dbg_tlv_assert_tables (drv , tlv );
1203
+ fallthrough ;
1167
1204
case IWL_UCODE_TLV_TYPE_DEBUG_INFO :
1168
1205
case IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION :
1169
1206
case IWL_UCODE_TLV_TYPE_HCMD :
1170
- case IWL_UCODE_TLV_TYPE_REGIONS :
1171
1207
case IWL_UCODE_TLV_TYPE_TRIGGERS :
1172
1208
case IWL_UCODE_TLV_TYPE_CONF_SET :
1173
1209
if (iwlwifi_mod_params .enable_ini )
0 commit comments