Lines Matching refs:rc
75 int rc = -1; in read_sge_ctxt() local
78 rc = begin_synchronized_op(padap, NULL, SLEEP_OK | INTR_OK, in read_sge_ctxt()
80 if (rc != 0) in read_sge_ctxt()
82 rc = t4_sge_ctxt_rd(padap, padap->mbox, cid, ctype, in read_sge_ctxt()
88 if (rc) in read_sge_ctxt()
97 int rc = 0; in get_next_ext_entity_hdr() local
103 rc = CUDBG_STATUS_BUFFER_SHORT; in get_next_ext_entity_hdr()
121 rc = CUDBG_STATUS_BUFFER_SHORT; in get_next_ext_entity_hdr()
141 return rc; in get_next_ext_entity_hdr()
157 int rc = -1; in wr_entity_to_flash() local
171 return rc; in wr_entity_to_flash()
187 rc = cudbg_write_flash(handle, timestamp, dbg_buff, in wr_entity_to_flash()
192 if (rc == CUDBG_STATUS_FLASH_FULL && cudbg_init->verbose) in wr_entity_to_flash()
197 return rc; in wr_entity_to_flash()
215 int index, bit, i, rc = -1; in cudbg_collect() local
238 rc = t4_get_flash_params(padap); in cudbg_collect()
239 if (rc) { in cudbg_collect()
261 rc = CUDBG_STATUS_SMALL_BUFF; in cudbg_collect()
299 rc = get_entity_hdr(outbuf, i, dbg_buff.size, in cudbg_collect()
301 if (rc) in cudbg_collect()
302 cudbg_hdr->hdr_flags = rc; in cudbg_collect()
304 rc = get_next_ext_entity_hdr(outbuf, &ext_size, in cudbg_collect()
307 if (rc) in cudbg_collect()
349 rc = process_entity[i-1](cudbg_init, &dbg_buff, in cudbg_collect()
353 if (rc) { in cudbg_collect()
360 rc = CUDBG_SYSTEM_ERROR; in cudbg_collect()
362 entity_hdr->hdr_flags = rc; in cudbg_collect()
414 rc = get_entity_hdr(outbuf, large_entity_code, in cudbg_collect()
416 if (rc) in cudbg_collect()
417 cudbg_hdr->hdr_flags = rc; in cudbg_collect()
419 rc = get_next_ext_entity_hdr(outbuf, &ext_size, in cudbg_collect()
422 if (rc) in cudbg_collect()
451 rc = process_entity[large_entity_code - 1](cudbg_init, in cudbg_collect()
454 if (rc) { in cudbg_collect()
461 rc = CUDBG_SYSTEM_ERROR; in cudbg_collect()
463 entity_hdr->hdr_flags = rc; in cudbg_collect()
519 return rc; in cudbg_collect()
555 int rc = 0; in get_entity_hdr() local
564 return rc; in get_entity_hdr()
574 int rc = 0; in collect_rss() local
577 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_rss()
578 if (rc) in collect_rss()
581 rc = t4_read_rss(padap, (u16 *)scratch_buff.data); in collect_rss()
582 if (rc) { in collect_rss()
585 __func__, rc); in collect_rss()
586 cudbg_err->sys_err = rc; in collect_rss()
590 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_rss()
591 if (rc) in collect_rss()
594 rc = compress_buff(&scratch_buff, dbg_buff); in collect_rss()
599 return rc; in collect_rss()
610 int rc = 0; in collect_sw_state() local
614 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_sw_state()
615 if (rc) in collect_sw_state()
625 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_sw_state()
626 if (rc) in collect_sw_state()
629 rc = compress_buff(&scratch_buff, dbg_buff); in collect_sw_state()
634 return rc; in collect_sw_state()
645 int rc = 0; in collect_ddp_stats() local
649 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_ddp_stats()
650 if (rc) in collect_ddp_stats()
659 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_ddp_stats()
660 if (rc) in collect_ddp_stats()
663 rc = compress_buff(&scratch_buff, dbg_buff); in collect_ddp_stats()
668 return rc; in collect_ddp_stats()
679 int rc = 0; in collect_ulptx_la() local
683 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_ulptx_la()
684 if (rc) in collect_ulptx_la()
706 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_ulptx_la()
707 if (rc) in collect_ulptx_la()
710 rc = compress_buff(&scratch_buff, dbg_buff); in collect_ulptx_la()
715 return rc; in collect_ulptx_la()
727 int rc = 0; in collect_ulprx_la() local
731 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_ulprx_la()
732 if (rc) in collect_ulprx_la()
739 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_ulprx_la()
740 if (rc) in collect_ulprx_la()
743 rc = compress_buff(&scratch_buff, dbg_buff); in collect_ulprx_la()
748 return rc; in collect_ulprx_la()
759 int rc = 0; in collect_cpl_stats() local
763 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_cpl_stats()
764 if (rc) in collect_cpl_stats()
774 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_cpl_stats()
775 if (rc) in collect_cpl_stats()
778 rc = compress_buff(&scratch_buff, dbg_buff); in collect_cpl_stats()
783 return rc; in collect_cpl_stats()
797 int rc = 0; in collect_wc_stats() local
801 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_wc_stats()
802 if (rc) in collect_wc_stats()
817 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_wc_stats()
818 if (rc) in collect_wc_stats()
821 rc = compress_buff(&scratch_buff, dbg_buff); in collect_wc_stats()
825 return rc; in collect_wc_stats()
840 int n, i, rc = 0; in fill_meminfo() local
911 rc = CUDBG_STATUS_ENTITY_NOT_FOUND; in fill_meminfo()
1085 return rc; in fill_meminfo()
1095 int rc = 0; in collect_meminfo() local
1100 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_meminfo()
1101 if (rc) in collect_meminfo()
1106 rc = fill_meminfo(padap, meminfo_buff); in collect_meminfo()
1107 if (rc) in collect_meminfo()
1110 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_meminfo()
1111 if (rc) in collect_meminfo()
1114 rc = compress_buff(&scratch_buff, dbg_buff); in collect_meminfo()
1118 return rc; in collect_meminfo()
1130 int rc = 0; in collect_lb_stats() local
1132 rc = padap->params.nports; in collect_lb_stats()
1133 if (rc < 0) in collect_lb_stats()
1136 n = rc; in collect_lb_stats()
1140 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_lb_stats()
1141 if (rc) in collect_lb_stats()
1154 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_lb_stats()
1155 if (rc) in collect_lb_stats()
1158 rc = compress_buff(&scratch_buff, dbg_buff); in collect_lb_stats()
1162 return rc; in collect_lb_stats()
1173 int rc = 0; in collect_rdma_stats() local
1177 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_rdma_stats()
1178 if (rc) in collect_rdma_stats()
1187 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_rdma_stats()
1188 if (rc) in collect_rdma_stats()
1191 rc = compress_buff(&scratch_buff, dbg_buff); in collect_rdma_stats()
1195 return rc; in collect_rdma_stats()
1207 int rc = 0; in collect_clk_info() local
1210 rc = CUDBG_STATUS_CCLK_NOT_DEFINED; in collect_clk_info()
1215 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_clk_info()
1216 if (rc) in collect_clk_info()
1252 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_clk_info()
1254 if (rc) in collect_clk_info()
1257 rc = compress_buff(&scratch_buff, dbg_buff); in collect_clk_info()
1261 return rc; in collect_clk_info()
1273 int rc = 0; in collect_macstats() local
1275 rc = padap->params.nports; in collect_macstats()
1276 if (rc < 0) in collect_macstats()
1279 n = rc; in collect_macstats()
1282 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_macstats()
1283 if (rc) in collect_macstats()
1297 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_macstats()
1298 if (rc) in collect_macstats()
1301 rc = compress_buff(&scratch_buff, dbg_buff); in collect_macstats()
1305 return rc; in collect_macstats()
1316 int rc = 0; in collect_cim_pif_la() local
1321 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_cim_pif_la()
1322 if (rc) in collect_cim_pif_la()
1332 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_cim_pif_la()
1333 if (rc) in collect_cim_pif_la()
1336 rc = compress_buff(&scratch_buff, dbg_buff); in collect_cim_pif_la()
1340 return rc; in collect_cim_pif_la()
1351 int rc = 0; in collect_tp_la() local
1355 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_tp_la()
1356 if (rc) in collect_tp_la()
1364 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_tp_la()
1365 if (rc) in collect_tp_la()
1368 rc = compress_buff(&scratch_buff, dbg_buff); in collect_tp_la()
1372 return rc; in collect_tp_la()
1383 int rc = 0; in collect_fcoe_stats() local
1387 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_fcoe_stats()
1388 if (rc) in collect_fcoe_stats()
1402 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_fcoe_stats()
1403 if (rc) in collect_fcoe_stats()
1406 rc = compress_buff(&scratch_buff, dbg_buff); in collect_fcoe_stats()
1410 return rc; in collect_fcoe_stats()
1421 int rc = 0; in collect_tp_err_stats() local
1425 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_tp_err_stats()
1426 if (rc) in collect_tp_err_stats()
1436 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_tp_err_stats()
1437 if (rc) in collect_tp_err_stats()
1440 rc = compress_buff(&scratch_buff, dbg_buff); in collect_tp_err_stats()
1444 return rc; in collect_tp_err_stats()
1455 int rc = 0; in collect_tcp_stats() local
1459 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_tcp_stats()
1460 if (rc) in collect_tcp_stats()
1469 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_tcp_stats()
1470 if (rc) in collect_tcp_stats()
1473 rc = compress_buff(&scratch_buff, dbg_buff); in collect_tcp_stats()
1477 return rc; in collect_tcp_stats()
1488 int i, rc = 0; in collect_hw_sched() local
1491 rc = CUDBG_STATUS_CCLK_NOT_DEFINED; in collect_hw_sched()
1496 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_hw_sched()
1497 if (rc) in collect_hw_sched()
1511 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_hw_sched()
1512 if (rc) in collect_hw_sched()
1515 rc = compress_buff(&scratch_buff, dbg_buff); in collect_hw_sched()
1519 return rc; in collect_hw_sched()
1530 int rc = 0; in collect_pm_stats() local
1534 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_pm_stats()
1535 if (rc) in collect_pm_stats()
1543 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_pm_stats()
1544 if (rc) in collect_pm_stats()
1547 rc = compress_buff(&scratch_buff, dbg_buff); in collect_pm_stats()
1551 return rc; in collect_pm_stats()
1561 int rc = 0; in collect_path_mtu() local
1565 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_path_mtu()
1566 if (rc) in collect_path_mtu()
1571 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_path_mtu()
1572 if (rc) in collect_path_mtu()
1575 rc = compress_buff(&scratch_buff, dbg_buff); in collect_path_mtu()
1579 return rc; in collect_path_mtu()
1590 int rc = 0; in collect_rss_key() local
1593 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_rss_key()
1594 if (rc) in collect_rss_key()
1599 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_rss_key()
1600 if (rc) in collect_rss_key()
1603 rc = compress_buff(&scratch_buff, dbg_buff); in collect_rss_key()
1607 return rc; in collect_rss_key()
1617 int rc; in collect_rss_config() local
1622 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_rss_config()
1623 if (rc) in collect_rss_config()
1636 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_rss_config()
1637 if (rc) in collect_rss_config()
1640 rc = compress_buff(&scratch_buff, dbg_buff); in collect_rss_config()
1645 return rc; in collect_rss_config()
1655 int vf, rc, vf_count; in collect_rss_vf_config() local
1661 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_rss_vf_config()
1662 if (rc) in collect_rss_vf_config()
1672 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_rss_vf_config()
1673 if (rc) in collect_rss_vf_config()
1676 rc = compress_buff(&scratch_buff, dbg_buff); in collect_rss_vf_config()
1681 return rc; in collect_rss_vf_config()
1692 int pf, rc; in collect_rss_pf_config() local
1696 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_rss_pf_config()
1697 if (rc) in collect_rss_pf_config()
1712 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_rss_pf_config()
1713 if (rc) in collect_rss_pf_config()
1716 rc = compress_buff(&scratch_buff, dbg_buff); in collect_rss_pf_config()
1720 return rc; in collect_rss_pf_config()
1856 int rc = 0; in collect_dump_context() local
1862 rc = fill_meminfo(padap, &meminfo); in collect_dump_context()
1863 if (rc) in collect_dump_context()
1867 rc = get_max_ctxt_qid(padap, &meminfo, max_ctx_qid, CTXT_CNM + 1); in collect_dump_context()
1868 if (rc) in collect_dump_context()
1877 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_dump_context()
1878 if (rc == CUDBG_STATUS_NO_SCRATCH_MEM) { in collect_dump_context()
1889 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_dump_context()
1890 if (rc) in collect_dump_context()
1902 rc = check_valid(buff->data, i); in collect_dump_context()
1903 if (rc) { in collect_dump_context()
1931 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_dump_context()
1932 if (rc) in collect_dump_context()
1943 rc = compress_buff(&temp_buff, dbg_buff); in collect_dump_context()
1944 if (rc) in collect_dump_context()
1955 return rc; in collect_dump_context()
1968 int rc = 0, i; in collect_fw_devlog() local
1970 rc = t4_init_devlog_params(padap, 1); in collect_fw_devlog()
1972 if (rc < 0) { in collect_fw_devlog()
1974 "%d\n", __func__, rc); in collect_fw_devlog()
1988 cudbg_err->sys_err = rc; in collect_fw_devlog()
1993 rc = get_scratch_buff(dbg_buff, dparams->size, &scratch_buff); in collect_fw_devlog()
1995 if (rc) in collect_fw_devlog()
2001 rc = t4_memory_rw(padap, padap->params.drv_memwin, in collect_fw_devlog()
2007 if (rc) { in collect_fw_devlog()
2009 "%d\n", __func__, rc); in collect_fw_devlog()
2010 cudbg_err->sys_err = rc; in collect_fw_devlog()
2015 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_fw_devlog()
2017 if (rc) in collect_fw_devlog()
2020 rc = compress_buff(&scratch_buff, dbg_buff); in collect_fw_devlog()
2025 return rc; in collect_fw_devlog()
2035 int rc = 0, qid = 0; in collect_cim_obq_ulp0() local
2037 rc = read_cim_obq(pdbg_init, dbg_buff, cudbg_err, qid); in collect_cim_obq_ulp0()
2039 return rc; in collect_cim_obq_ulp0()
2046 int rc = 0, qid = 1; in collect_cim_obq_ulp1() local
2048 rc = read_cim_obq(pdbg_init, dbg_buff, cudbg_err, qid); in collect_cim_obq_ulp1()
2050 return rc; in collect_cim_obq_ulp1()
2057 int rc = 0, qid = 2; in collect_cim_obq_ulp2() local
2059 rc = read_cim_obq(pdbg_init, dbg_buff, cudbg_err, qid); in collect_cim_obq_ulp2()
2061 return rc; in collect_cim_obq_ulp2()
2068 int rc = 0, qid = 3; in collect_cim_obq_ulp3() local
2070 rc = read_cim_obq(pdbg_init, dbg_buff, cudbg_err, qid); in collect_cim_obq_ulp3()
2072 return rc; in collect_cim_obq_ulp3()
2079 int rc = 0, qid = 4; in collect_cim_obq_sge() local
2081 rc = read_cim_obq(pdbg_init, dbg_buff, cudbg_err, qid); in collect_cim_obq_sge()
2083 return rc; in collect_cim_obq_sge()
2090 int rc = 0, qid = 5; in collect_cim_obq_ncsi() local
2092 rc = read_cim_obq(pdbg_init, dbg_buff, cudbg_err, qid); in collect_cim_obq_ncsi()
2094 return rc; in collect_cim_obq_ncsi()
2101 int rc = 0, qid = 6; in collect_obq_sge_rx_q0() local
2103 rc = read_cim_obq(pdbg_init, dbg_buff, cudbg_err, qid); in collect_obq_sge_rx_q0()
2105 return rc; in collect_obq_sge_rx_q0()
2112 int rc = 0, qid = 7; in collect_obq_sge_rx_q1() local
2114 rc = read_cim_obq(pdbg_init, dbg_buff, cudbg_err, qid); in collect_obq_sge_rx_q1()
2116 return rc; in collect_obq_sge_rx_q1()
2126 int rc; in read_cim_obq() local
2131 rc = get_scratch_buff(dbg_buff, qsize, &scratch_buff); in read_cim_obq()
2132 if (rc) in read_cim_obq()
2143 rc = CUDBG_SYSTEM_ERROR; in read_cim_obq()
2145 rc = no_of_read_words; in read_cim_obq()
2148 __func__, rc); in read_cim_obq()
2149 cudbg_err->sys_err = rc; in read_cim_obq()
2155 rc = write_compression_hdr(&scratch_buff, dbg_buff); in read_cim_obq()
2157 if (rc) in read_cim_obq()
2160 rc = compress_buff(&scratch_buff, dbg_buff); in read_cim_obq()
2162 if (rc) in read_cim_obq()
2168 return rc; in read_cim_obq()
2177 int rc = 0, qid = 0; in collect_cim_ibq_tp0() local
2179 rc = read_cim_ibq(pdbg_init, dbg_buff, cudbg_err, qid); in collect_cim_ibq_tp0()
2180 return rc; in collect_cim_ibq_tp0()
2187 int rc = 0, qid = 1; in collect_cim_ibq_tp1() local
2189 rc = read_cim_ibq(pdbg_init, dbg_buff, cudbg_err, qid); in collect_cim_ibq_tp1()
2190 return rc; in collect_cim_ibq_tp1()
2197 int rc = 0, qid = 2; in collect_cim_ibq_ulp() local
2199 rc = read_cim_ibq(pdbg_init, dbg_buff, cudbg_err, qid); in collect_cim_ibq_ulp()
2200 return rc; in collect_cim_ibq_ulp()
2207 int rc = 0, qid = 3; in collect_cim_ibq_sge0() local
2209 rc = read_cim_ibq(pdbg_init, dbg_buff, cudbg_err, qid); in collect_cim_ibq_sge0()
2210 return rc; in collect_cim_ibq_sge0()
2217 int rc = 0, qid = 4; in collect_cim_ibq_sge1() local
2219 rc = read_cim_ibq(pdbg_init, dbg_buff, cudbg_err, qid); in collect_cim_ibq_sge1()
2220 return rc; in collect_cim_ibq_sge1()
2227 int rc, qid = 5; in collect_cim_ibq_ncsi() local
2229 rc = read_cim_ibq(pdbg_init, dbg_buff, cudbg_err, qid); in collect_cim_ibq_ncsi()
2230 return rc; in collect_cim_ibq_ncsi()
2240 int rc; in read_cim_ibq() local
2245 rc = get_scratch_buff(dbg_buff, qsize, &scratch_buff); in read_cim_ibq()
2247 if (rc) in read_cim_ibq()
2257 rc = CUDBG_SYSTEM_ERROR; in read_cim_ibq()
2259 rc = no_of_read_words; in read_cim_ibq()
2262 __func__, rc); in read_cim_ibq()
2263 cudbg_err->sys_err = rc; in read_cim_ibq()
2267 rc = write_compression_hdr(&scratch_buff, dbg_buff); in read_cim_ibq()
2268 if (rc) in read_cim_ibq()
2271 rc = compress_buff(&scratch_buff, dbg_buff); in read_cim_ibq()
2272 if (rc) in read_cim_ibq()
2279 return rc; in read_cim_ibq()
2288 u32 rc = 0; in collect_cim_ma_la() local
2292 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_cim_ma_la()
2293 if (rc) in collect_cim_ma_la()
2303 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_cim_ma_la()
2304 if (rc) in collect_cim_ma_la()
2307 rc = compress_buff(&scratch_buff, dbg_buff); in collect_cim_ma_la()
2312 return rc; in collect_cim_ma_la()
2322 int rc; in collect_cim_la() local
2337 rc = get_scratch_buff(dbg_buff, size, &scratch_buff); in collect_cim_la()
2338 if (rc) in collect_cim_la()
2341 rc = t4_cim_read(padap, A_UP_UP_DBG_LA_CFG, 1, &cfg); in collect_cim_la()
2343 if (rc) { in collect_cim_la()
2346 __func__, rc); in collect_cim_la()
2347 cudbg_err->sys_err = rc; in collect_cim_la()
2354 rc = t4_cim_read_la(padap, in collect_cim_la()
2357 if (rc < 0) { in collect_cim_la()
2360 __func__, rc); in collect_cim_la()
2361 cudbg_err->sys_err = rc; in collect_cim_la()
2365 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_cim_la()
2366 if (rc) in collect_cim_la()
2369 rc = compress_buff(&scratch_buff, dbg_buff); in collect_cim_la()
2370 if (rc) in collect_cim_la()
2376 return rc; in collect_cim_la()
2386 int rc = 0; in collect_cim_qcfg() local
2390 rc = get_scratch_buff(dbg_buff, sizeof(struct struct_cim_qcfg), in collect_cim_qcfg()
2393 if (rc) in collect_cim_qcfg()
2402 rc = t4_cim_read(padap, A_UP_IBQ_0_RDADDR, in collect_cim_qcfg()
2405 if (rc) { in collect_cim_qcfg()
2408 __func__, rc); in collect_cim_qcfg()
2409 cudbg_err->sys_err = rc; in collect_cim_qcfg()
2413 rc = t4_cim_read(padap, A_UP_OBQ_0_REALADDR, in collect_cim_qcfg()
2417 if (rc) { in collect_cim_qcfg()
2420 __func__, rc); in collect_cim_qcfg()
2421 cudbg_err->sys_err = rc; in collect_cim_qcfg()
2431 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_cim_qcfg()
2432 if (rc) in collect_cim_qcfg()
2435 rc = compress_buff(&scratch_buff, dbg_buff); in collect_cim_qcfg()
2436 if (rc) in collect_cim_qcfg()
2442 return rc; in collect_cim_qcfg()
2471 int rc; in get_payload_range() local
2474 rc = fill_meminfo(padap, &meminfo); in get_payload_range()
2475 if (rc) in get_payload_range()
2476 return rc; in get_payload_range()
2555 int rc; in read_fw_mem() local
2585 rc = get_payload_range(padap, mem_type, tot_len, in read_fw_mem()
2588 if (rc) in read_fw_mem()
2605 rc = write_compression_hdr(&scratch_buff, dbg_buff); in read_fw_mem()
2606 if (rc) in read_fw_mem()
2611 rc = get_scratch_buff(dbg_buff, bytes, &scratch_buff); in read_fw_mem()
2613 if (rc) { in read_fw_mem()
2614 rc = CUDBG_STATUS_NO_SCRATCH_MEM; in read_fw_mem()
2634 rc = t4_memory_rw(padap, MEMWIN_NIC, mem_type, bytes_read, in read_fw_mem()
2637 if (rc) { in read_fw_mem()
2640 __func__, rc); in read_fw_mem()
2641 cudbg_err->sys_err = rc; in read_fw_mem()
2646 rc = compress_buff(&scratch_buff, dbg_buff); in read_fw_mem()
2647 if (rc) in read_fw_mem()
2656 if (rc) in read_fw_mem()
2660 return rc; in read_fw_mem()
2720 int rc; in cudbg_t4_fwcache() local
2725 rc = begin_synchronized_op(padap, NULL, SLEEP_OK | INTR_OK, in cudbg_t4_fwcache()
2727 if (rc == 0) { in cudbg_t4_fwcache()
2728 rc = t4_fwcache(padap, FW_PARAM_DEV_FWCACHE_FLUSH); in cudbg_t4_fwcache()
2732 if (rc) { in cudbg_t4_fwcache()
2735 __func__, rc); in cudbg_t4_fwcache()
2736 cudbg_err->sys_warn = rc; in cudbg_t4_fwcache()
2747 int rc; in collect_edc0_meminfo() local
2755 rc = read_fw_mem(pdbg_init, dbg_buff, MEM_EDC0, in collect_edc0_meminfo()
2757 if (rc) in collect_edc0_meminfo()
2761 rc = CUDBG_STATUS_ENTITY_NOT_FOUND; in collect_edc0_meminfo()
2764 __func__, err_msg[-rc]); in collect_edc0_meminfo()
2769 return rc; in collect_edc0_meminfo()
2778 int rc; in collect_edc1_meminfo() local
2786 rc = read_fw_mem(pdbg_init, dbg_buff, MEM_EDC1, in collect_edc1_meminfo()
2788 if (rc) in collect_edc1_meminfo()
2791 rc = CUDBG_STATUS_ENTITY_NOT_FOUND; in collect_edc1_meminfo()
2794 __func__, err_msg[-rc]); in collect_edc1_meminfo()
2800 return rc; in collect_edc1_meminfo()
2809 int rc; in collect_mc0_meminfo() local
2817 rc = read_fw_mem(pdbg_init, dbg_buff, MEM_MC0, in collect_mc0_meminfo()
2819 if (rc) in collect_mc0_meminfo()
2822 rc = CUDBG_STATUS_ENTITY_NOT_FOUND; in collect_mc0_meminfo()
2825 __func__, err_msg[-rc]); in collect_mc0_meminfo()
2830 return rc; in collect_mc0_meminfo()
2839 int rc; in collect_mc1_meminfo() local
2847 rc = read_fw_mem(pdbg_init, dbg_buff, MEM_MC1, in collect_mc1_meminfo()
2849 if (rc) in collect_mc1_meminfo()
2852 rc = CUDBG_STATUS_ENTITY_NOT_FOUND; in collect_mc1_meminfo()
2856 __func__, err_msg[-rc]); in collect_mc1_meminfo()
2860 return rc; in collect_mc1_meminfo()
2873 int rc = 0; in collect_reg_dump() local
2884 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_reg_dump()
2885 if (rc) in collect_reg_dump()
2892 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_reg_dump()
2893 if (rc) in collect_reg_dump()
2909 return rc; in collect_reg_dump()
2919 int rc; in collect_cctrl() local
2924 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_cctrl()
2925 if (rc) in collect_cctrl()
2930 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_cctrl()
2931 if (rc) in collect_cctrl()
2934 rc = compress_buff(&scratch_buff, dbg_buff); in collect_cctrl()
2939 return rc; in collect_cctrl()
2964 int rc = 0; in cim_ha_rreg() local
2970 rc = check_busy_bit(padap); in cim_ha_rreg()
2971 if (rc) in cim_ha_rreg()
2978 return rc; in cim_ha_rreg()
2985 int rc = 0; in dump_up_cim() local
2988 rc = cim_ha_rreg(padap, in dump_up_cim()
2991 if (rc) { in dump_up_cim()
3002 return rc; in dump_up_cim()
3013 int i, rc, n; in collect_up_cim_indirect() local
3019 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_up_cim_indirect()
3020 if (rc) in collect_up_cim_indirect()
3045 rc = dump_up_cim(padap, pdbg_init, up_cim_reg, buff); in collect_up_cim_indirect()
3050 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_up_cim_indirect()
3051 if (rc) in collect_up_cim_indirect()
3054 rc = compress_buff(&scratch_buff, dbg_buff); in collect_up_cim_indirect()
3059 return rc; in collect_up_cim_indirect()
3074 int i, k, rc; in collect_mbox_log() local
3090 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_mbox_log()
3091 if (rc) in collect_mbox_log()
3117 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_mbox_log()
3118 if (rc) in collect_mbox_log()
3121 rc = compress_buff(&scratch_buff, dbg_buff); in collect_mbox_log()
3126 return rc; in collect_mbox_log()
3140 int i, rc; in collect_pbt_tables() local
3145 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_pbt_tables()
3146 if (rc) in collect_pbt_tables()
3154 rc = cim_ha_rreg(padap, addr + (i * 4), &pbt->pbt_dynamic[i]); in collect_pbt_tables()
3155 if (rc) { in collect_pbt_tables()
3168 rc = cim_ha_rreg(padap, addr + (i * 4), &pbt->pbt_static[i]); in collect_pbt_tables()
3169 if (rc) { in collect_pbt_tables()
3180 rc = cim_ha_rreg(padap, addr + (i * 4), &pbt->lrf_table[i]); in collect_pbt_tables()
3181 if (rc) { in collect_pbt_tables()
3192 rc = cim_ha_rreg(padap, addr + (i * 4), &pbt->pbt_data[i]); in collect_pbt_tables()
3193 if (rc) { in collect_pbt_tables()
3201 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_pbt_tables()
3202 if (rc) in collect_pbt_tables()
3205 rc = compress_buff(&scratch_buff, dbg_buff); in collect_pbt_tables()
3210 return rc; in collect_pbt_tables()
3221 int i, rc, n; in collect_pm_indirect() local
3227 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_pm_indirect()
3228 if (rc) in collect_pm_indirect()
3274 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_pm_indirect()
3275 if (rc) in collect_pm_indirect()
3278 rc = compress_buff(&scratch_buff, dbg_buff); in collect_pm_indirect()
3283 return rc; in collect_pm_indirect()
3298 int rc; in collect_tid() local
3302 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_tid()
3303 if (rc) in collect_tid()
3341 rc = begin_synchronized_op(padap, NULL, SLEEP_OK | INTR_OK, "t4cudq"); in collect_tid()
3342 if (rc) in collect_tid()
3346 rc = t4_query_params(padap, mbox, pf, 0, 7, para, val); in collect_tid()
3347 if (rc < 0) { in collect_tid()
3348 if (rc == -FW_EPERM) { in collect_tid()
3358 rc = t4_query_params(padap, mbox, pf, 0, 7, para, val); in collect_tid()
3359 if (rc < 0) { in collect_tid()
3360 cudbg_err->sys_err = rc; in collect_tid()
3364 cudbg_err->sys_err = rc; in collect_tid()
3387 rc = t4_query_params(padap, mbox, pf, 0, 2, para, val); in collect_tid()
3388 if (rc < 0) { in collect_tid()
3389 cudbg_err->sys_err = rc; in collect_tid()
3407 rc = t4_query_params(padap, mbox, pf, 0, 2, para, val); in collect_tid()
3408 if (rc < 0) { in collect_tid()
3409 cudbg_err->sys_err = rc; in collect_tid()
3424 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_tid()
3425 if (rc) in collect_tid()
3427 rc = compress_buff(&scratch_buff, dbg_buff); in collect_tid()
3433 return rc; in collect_tid()
3444 int rc; in collect_tx_rate() local
3449 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_tx_rate()
3450 if (rc) in collect_tx_rate()
3457 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_tx_rate()
3458 if (rc) in collect_tx_rate()
3461 rc = compress_buff(&scratch_buff, dbg_buff); in collect_tx_rate()
3466 return rc; in collect_tx_rate()
3513 int rc; in collect_mps_tcam() local
3519 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_mps_tcam()
3520 if (rc) in collect_mps_tcam()
3616 rc = begin_synchronized_op(padap, NULL, in collect_mps_tcam()
3618 if (rc == 0) { in collect_mps_tcam()
3619 rc = t4_wr_mbox(padap, padap->mbox, &ldst_cmd, in collect_mps_tcam()
3624 if (rc) in collect_mps_tcam()
3652 rc = CUDBG_SYSTEM_ERROR; in collect_mps_tcam()
3657 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_mps_tcam()
3658 if (rc) in collect_mps_tcam()
3661 rc = compress_buff(&scratch_buff, dbg_buff); in collect_mps_tcam()
3667 return rc; in collect_mps_tcam()
3677 int i, rc, n; in collect_pcie_config() local
3683 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_pcie_config()
3684 if (rc) in collect_pcie_config()
3695 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_pcie_config()
3696 if (rc) in collect_pcie_config()
3699 rc = compress_buff(&scratch_buff, dbg_buff); in collect_pcie_config()
3704 return rc; in collect_pcie_config()
3774 int rc, size; in collect_le_tcam() local
3817 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_le_tcam()
3818 if (rc) in collect_le_tcam()
3821 rc = get_scratch_buff(dbg_buff, CUDBG_CHUNK_SIZE, &scratch_buff); in collect_le_tcam()
3822 if (rc) in collect_le_tcam()
3836 rc = compress_buff(&scratch_buff, dbg_buff); in collect_le_tcam()
3837 if (rc) in collect_le_tcam()
3843 rc = get_scratch_buff(dbg_buff, CUDBG_CHUNK_SIZE, in collect_le_tcam()
3845 if (rc) in collect_le_tcam()
3853 rc = cudbg_read_tid(pdbg_init, i, tid_data); in collect_le_tcam()
3855 if (rc) { in collect_le_tcam()
3856 cudbg_err->sys_err = rc; in collect_le_tcam()
3867 rc = compress_buff(&scratch_buff, dbg_buff); in collect_le_tcam()
3874 return rc; in collect_le_tcam()
3885 int i, rc, n; in collect_ma_indirect() local
3890 rc = CUDBG_STATUS_ENTITY_NOT_FOUND; in collect_ma_indirect()
3898 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_ma_indirect()
3899 if (rc) in collect_ma_indirect()
3941 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_ma_indirect()
3942 if (rc) in collect_ma_indirect()
3945 rc = compress_buff(&scratch_buff, dbg_buff); in collect_ma_indirect()
3950 return rc; in collect_ma_indirect()
3961 int i, rc, n; in collect_hma_indirect() local
3966 rc = CUDBG_STATUS_ENTITY_NOT_FOUND; in collect_hma_indirect()
3974 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_hma_indirect()
3975 if (rc) in collect_hma_indirect()
3997 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_hma_indirect()
3998 if (rc) in collect_hma_indirect()
4001 rc = compress_buff(&scratch_buff, dbg_buff); in collect_hma_indirect()
4006 return rc; in collect_hma_indirect()
4017 int i, rc, n; in collect_pcie_indirect() local
4023 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_pcie_indirect()
4024 if (rc) in collect_pcie_indirect()
4070 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_pcie_indirect()
4071 if (rc) in collect_pcie_indirect()
4074 rc = compress_buff(&scratch_buff, dbg_buff); in collect_pcie_indirect()
4079 return rc; in collect_pcie_indirect()
4091 int i, rc, n = 0; in collect_tp_indirect() local
4101 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_tp_indirect()
4102 if (rc) in collect_tp_indirect()
4190 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_tp_indirect()
4191 if (rc) in collect_tp_indirect()
4194 rc = compress_buff(&scratch_buff, dbg_buff); in collect_tp_indirect()
4199 return rc; in collect_tp_indirect()
4210 int i, rc; in collect_sge_indirect() local
4215 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_sge_indirect()
4216 if (rc) in collect_sge_indirect()
4240 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_sge_indirect()
4241 if (rc) in collect_sge_indirect()
4244 rc = compress_buff(&scratch_buff, dbg_buff); in collect_sge_indirect()
4249 return rc; in collect_sge_indirect()
4260 int rc; in collect_full() local
4280 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_full()
4281 if (rc) in collect_full()
4345 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_full()
4346 if (rc) in collect_full()
4349 rc = compress_buff(&scratch_buff, dbg_buff); in collect_full()
4354 return rc; in collect_full()
4368 int rc; in collect_vpd_data() local
4373 rc = get_scratch_buff(dbg_buff, scratch_buff.size, &scratch_buff); in collect_vpd_data()
4374 if (rc) in collect_vpd_data()
4392 rc = t4_get_scfg_version(padap, &vpd_data->scfg_vers); in collect_vpd_data()
4394 rc = 1; in collect_vpd_data()
4397 if (rc) { in collect_vpd_data()
4399 rc = read_vpd_reg(padap, SCFG_VER_ADDR, SCFG_VER_LEN, in collect_vpd_data()
4401 if (rc) in collect_vpd_data()
4406 rc = t4_get_vpd_version(padap, &vpd_data->vpd_vers); in collect_vpd_data()
4408 rc = 1; in collect_vpd_data()
4411 if (rc) { in collect_vpd_data()
4413 rc = read_vpd_reg(padap, VPD_VER_ADDR, VPD_VER_LEN, in collect_vpd_data()
4415 if (rc) in collect_vpd_data()
4427 rc = t4_get_fw_version(padap, &fw_vers); in collect_vpd_data()
4428 if (rc) in collect_vpd_data()
4437 rc = write_compression_hdr(&scratch_buff, dbg_buff); in collect_vpd_data()
4438 if (rc) in collect_vpd_data()
4441 rc = compress_buff(&scratch_buff, dbg_buff); in collect_vpd_data()
4446 return rc; in collect_vpd_data()