cxgbetool.c (c2c014f24c10f90d85126ac5fbd4d8524de32b1c) | cxgbetool.c (ae9b401786f5dc55255b46e031290ae1db937a33) |
---|---|
1/*- 2 * Copyright (c) 2011 Chelsio Communications, Inc. 3 * All rights reserved. 4 * Written by: Navdeep Parhar <np@FreeBSD.org> 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 37 unchanged lines hidden (view full) --- 46#include <limits.h> 47#include <stdint.h> 48#include <stdio.h> 49#include <stdlib.h> 50#include <string.h> 51#include <unistd.h> 52 53#include "t4_ioctl.h" | 1/*- 2 * Copyright (c) 2011 Chelsio Communications, Inc. 3 * All rights reserved. 4 * Written by: Navdeep Parhar <np@FreeBSD.org> 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 37 unchanged lines hidden (view full) --- 46#include <limits.h> 47#include <stdint.h> 48#include <stdio.h> 49#include <stdlib.h> 50#include <string.h> 51#include <unistd.h> 52 53#include "t4_ioctl.h" |
54#include "tcb_common.h" |
|
54 55#define in_range(val, lo, hi) ( val < 0 || (val <= hi && val >= lo)) 56#define max(x, y) ((x) > (y) ? (x) : (y)) 57 58static const char *progname, *nexus; 59static int chip_id; /* 4 for T4, 5 for T5 */ 60 61struct reg_info { --- 2035 unchanged lines hidden (view full) --- 2097} 2098 2099/* 2100 * Display TCB as list of 'n' 4-byte values per line. 2101 */ 2102static void 2103show_tcb(uint32_t *buf, uint32_t len) 2104{ | 55 56#define in_range(val, lo, hi) ( val < 0 || (val <= hi && val >= lo)) 57#define max(x, y) ((x) > (y) ? (x) : (y)) 58 59static const char *progname, *nexus; 60static int chip_id; /* 4 for T4, 5 for T5 */ 61 62struct reg_info { --- 2035 unchanged lines hidden (view full) --- 2098} 2099 2100/* 2101 * Display TCB as list of 'n' 4-byte values per line. 2102 */ 2103static void 2104show_tcb(uint32_t *buf, uint32_t len) 2105{ |
2106 unsigned char *tcb = (unsigned char *)buf; |
|
2105 const char *s; 2106 int i, n = 8; 2107 2108 while (len) { 2109 for (i = 0; len && i < n; i++, buf++, len -= 4) { 2110 s = i ? " " : ""; 2111 printf("%s%08x", s, htonl(*buf)); 2112 } 2113 printf("\n"); 2114 } | 2107 const char *s; 2108 int i, n = 8; 2109 2110 while (len) { 2111 for (i = 0; len && i < n; i++, buf++, len -= 4) { 2112 s = i ? " " : ""; 2113 printf("%s%08x", s, htonl(*buf)); 2114 } 2115 printf("\n"); 2116 } |
2117 set_tcb_info(TIDTYPE_TCB, chip_id); 2118 set_print_style(PRNTSTYL_COMP); 2119 swizzle_tcb(tcb); 2120 parse_n_display_xcb(tcb); |
|
2115} 2116 2117#define A_TP_CMM_TCB_BASE 0x7d10 2118#define TCB_SIZE 128 2119static int 2120read_tcb(int argc, const char *argv[]) 2121{ 2122 char *p; --- 894 unchanged lines hidden --- | 2121} 2122 2123#define A_TP_CMM_TCB_BASE 0x7d10 2124#define TCB_SIZE 128 2125static int 2126read_tcb(int argc, const char *argv[]) 2127{ 2128 char *p; --- 894 unchanged lines hidden --- |