@@ -165,11 +165,12 @@ static int bnxt_hwrm_dbg_coredump_retrieve(struct bnxt *bp, u16 component_id,
165
165
return rc ;
166
166
}
167
167
168
- static void
168
+ void
169
169
bnxt_fill_coredump_seg_hdr (struct bnxt * bp ,
170
170
struct bnxt_coredump_segment_hdr * seg_hdr ,
171
171
struct coredump_segment_record * seg_rec , u32 seg_len ,
172
- int status , u32 duration , u32 instance )
172
+ int status , u32 duration , u32 instance , u32 comp_id ,
173
+ u32 seg_id )
173
174
{
174
175
memset (seg_hdr , 0 , sizeof (* seg_hdr ));
175
176
memcpy (seg_hdr -> signature , "sEgM" , 4 );
@@ -180,11 +181,8 @@ bnxt_fill_coredump_seg_hdr(struct bnxt *bp,
180
181
seg_hdr -> high_version = seg_rec -> version_hi ;
181
182
seg_hdr -> flags = cpu_to_le32 (seg_rec -> compress_flags );
182
183
} else {
183
- /* For hwrm_ver_get response Component id = 2
184
- * and Segment id = 0
185
- */
186
- seg_hdr -> component_id = cpu_to_le32 (2 );
187
- seg_hdr -> segment_id = 0 ;
184
+ seg_hdr -> component_id = cpu_to_le32 (comp_id );
185
+ seg_hdr -> segment_id = cpu_to_le32 (seg_id );
188
186
}
189
187
seg_hdr -> function_id = cpu_to_le16 (bp -> pdev -> devfn );
190
188
seg_hdr -> length = cpu_to_le32 (seg_len );
@@ -287,11 +285,13 @@ static int __bnxt_get_coredump(struct bnxt *bp, void *buf, u32 *dump_len)
287
285
start_utc = sys_tz .tz_minuteswest * 60 ;
288
286
seg_hdr_len = sizeof (seg_hdr );
289
287
290
- /* First segment should be hwrm_ver_get response */
288
+ /* First segment should be hwrm_ver_get response.
289
+ * For hwrm_ver_get response Component id = 2 and Segment id = 0.
290
+ */
291
291
* dump_len = seg_hdr_len + ver_get_resp_len ;
292
292
if (buf ) {
293
293
bnxt_fill_coredump_seg_hdr (bp , & seg_hdr , NULL , ver_get_resp_len ,
294
- 0 , 0 , 0 );
294
+ 0 , 0 , 0 , BNXT_VER_GET_COMP_ID , 0 );
295
295
memcpy (buf + offset , & seg_hdr , seg_hdr_len );
296
296
offset += seg_hdr_len ;
297
297
memcpy (buf + offset , & bp -> ver_resp , ver_get_resp_len );
@@ -346,7 +346,7 @@ static int __bnxt_get_coredump(struct bnxt *bp, void *buf, u32 *dump_len)
346
346
end = jiffies ;
347
347
duration = jiffies_to_msecs (end - start );
348
348
bnxt_fill_coredump_seg_hdr (bp , & seg_hdr , seg_record , seg_len ,
349
- rc , duration , 0 );
349
+ rc , duration , 0 , 0 , 0 );
350
350
351
351
if (buf ) {
352
352
/* Write segment header into the buffer */
0 commit comments