Lines Matching refs:dump

31  * interpret the binary dumpspec and populate the dump data in a deterministic
52 __be32 offset; /* address to start dump */
53 __be32 dump_length; /* total bytes to dump, aligned to reg size */
104 /* to track state during debug dump creation TLV traversal */
109 void *p; /* current point in dump buffer */
177 nfp_warn(cpp, "Debug dump specification read failed.\n");
329 static int nfp_add_tlv(u32 type, u32 total_tlv_sz, struct nfp_dump_state *dump)
331 struct nfp_dump_tl *tl = dump->p;
333 if (total_tlv_sz > dump->buf_size)
336 if (dump->buf_size - total_tlv_sz < dump->dumped_size)
342 dump->dumped_size += total_tlv_sz;
343 dump->p += total_tlv_sz;
350 struct nfp_dump_state *dump)
352 struct nfp_dump_error *dump_header = dump->p;
359 err = nfp_add_tlv(NFP_DUMPSPEC_TYPE_ERROR, total_size, dump);
369 static int nfp_dump_fwname(struct nfp_pf *pf, struct nfp_dump_state *dump)
371 struct nfp_dump_tl *dump_header = dump->p;
380 err = nfp_add_tlv(NFP_DUMPSPEC_TYPE_FWNAME, total_size, dump);
391 struct nfp_dump_state *dump)
393 struct nfp_dump_tl *dump_header = dump->p;
402 err = nfp_add_tlv(NFP_DUMPSPEC_TYPE_HWINFO, total_size, dump);
412 struct nfp_dump_state *dump)
414 struct nfp_dump_tl *dump_header = dump->p;
423 return nfp_dump_error_tlv(spec, -EINVAL, dump);
428 return nfp_dump_error_tlv(spec, -ENOENT, dump);
432 err = nfp_add_tlv(NFP_DUMPSPEC_TYPE_HWINFO_FIELD, total_size, dump);
450 struct nfp_dump_state *dump)
452 struct nfp_dump_csr *dump_header = dump->p;
461 return nfp_dump_error_tlv(&spec_csr->tl, -EINVAL, dump);
467 dest = dump->p + header_size;
469 err = nfp_add_tlv(be32_to_cpu(spec_csr->tl.type), total_size, dump);
553 struct nfp_dump_state *dump)
555 struct nfp_dump_csr *dump_header = dump->p;
563 return nfp_dump_error_tlv(&spec_csr->tl, -EINVAL, dump);
570 dest = dump->p + header_size;
572 err = nfp_add_tlv(be32_to_cpu(spec_csr->tl.type), total_size, dump);
598 struct nfp_dump_state *dump)
600 struct nfp_dump_rtsym *dump_header = dump->p;
613 return nfp_dump_error_tlv(&spec->tl, -EINVAL, dump);
617 return nfp_dump_error_tlv(&spec->tl, -ENOENT, dump);
623 dest = dump->p + header_size;
625 err = nfp_add_tlv(be32_to_cpu(spec->tl.type), total_size, dump);
657 struct nfp_dump_state *dump = param;
663 err = nfp_dump_fwname(pf, dump);
671 err = nfp_dump_csr_range(pf, spec_csr, dump);
677 err = nfp_dump_indirect_csr_range(pf, spec_csr, dump);
683 err = nfp_dump_single_rtsym(pf, spec_rtsym, dump);
688 err = nfp_dump_hwinfo(pf, tl, dump);
693 err = nfp_dump_hwinfo_field(pf, tl, dump);
698 err = nfp_dump_error_tlv(tl, -EOPNOTSUPP, dump);
710 struct nfp_dump_state *dump = param;
712 if (dump_level->type != dump->requested_level)
716 be32_to_cpu(dump_level->length), dump,
720 static int nfp_dump_populate_prolog(struct nfp_dump_state *dump)
722 struct nfp_dump_prolog *prolog = dump->p;
728 err = nfp_add_tlv(NFP_DUMPSPEC_TYPE_PROLOG, total_size, dump);
732 prolog->dump_level = dump->requested_level;
740 struct nfp_dump_state dump;
743 dump.requested_level = cpu_to_be32(dump_param->flag);
744 dump.dumped_size = 0;
745 dump.p = dest;
746 dump.buf_size = dump_param->len;
748 err = nfp_dump_populate_prolog(&dump);
752 err = nfp_traverse_tlvs(pf, spec->data, spec->size, &dump,
757 /* Set size of actual dump, to trigger warning if different from
760 dump_param->len = dump.dumped_size;