xref: /illumos-gate/usr/src/cmd/cxgbetool/cudbg_view_compat.c (revision 2aeafac3612e19716bf8164f89c3c9196342979c)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright (c) 2019 by Chelsio Communications, Inc.
14  */
15 
16 #include "cudbg_view_compat.h"
17 #include "cudbg.h"
18 
19 int
20 view_ulptx_la_rev0(void *data, struct cudbg_buffer *cudbg_poutbuf)
21 {
22 	struct cudbg_ulptx_la_rev0 *ulptx_la_buff;
23 	int i, j, rc = 0;
24 
25 	ulptx_la_buff = (struct cudbg_ulptx_la_rev0 *)data;
26 
27 	for (i = 0; i < CUDBG_NUM_ULPTX; i++) {
28 		printf("==============================\n");
29 		printf("DUMPING ULP_TX_LA_%d\n", i);
30 		printf("==============================\n");
31 
32 		printf("[0x%x] %-24s %#x\n",
33 			     (A_ULP_TX_LA_RDPTR_0 + 0x10 * i),
34 			     cudbg_ulptx_rdptr[i], ulptx_la_buff->rdptr[i]);
35 		printf("[0x%x] %-24s %#x\n",
36 			     (A_ULP_TX_LA_WRPTR_0 + 0x10 * i),
37 			     cudbg_ulptx_wrptr[i], ulptx_la_buff->wrptr[i]);
38 		printf("[0x%x] %-24s %#-13x\n",
39 			     (A_ULP_TX_LA_RDDATA_0 + 0x10 * i),
40 			     cudbg_ulptx_rddata[i], ulptx_la_buff->rddata[i]);
41 
42 		for (j = 0; j < CUDBG_NUM_ULPTX_READ; j++) {
43 			printf("[%#x]   %#-16x [%u]\n",
44 				     j, ulptx_la_buff->rd_data[i][j],
45 				     ulptx_la_buff->rd_data[i][j]);
46 		}
47 	}
48 
49 	return rc;
50 }
51