From 49e85d35c3ebd1dd25c7f931e9f701abb87d8686 Mon Sep 17 00:00:00 2001 From: kmacy Date: Wed, 10 Sep 2008 01:10:17 +0000 Subject: - Fix regression with GETMEM - Remove gratuitous bswap macros - check for rev 3 with t3b Obtained from: Chelsio Inc. MFC after: 3 days --- usr.sbin/cxgbtool/cxgbtool.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/cxgbtool/cxgbtool.c b/usr.sbin/cxgbtool/cxgbtool.c index b7b7704..f47b972 100644 --- a/usr.sbin/cxgbtool/cxgbtool.c +++ b/usr.sbin/cxgbtool/cxgbtool.c @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define NMTUS 16 #define TCB_SIZE 128 @@ -499,7 +500,7 @@ dump_regs(int argc, char *argv[], int start_arg, const char *iff_name) if (revision == 0) return dump_regs_t3(argc, argv, start_arg, (uint32_t *)regs.data, is_pcie); - if (revision == 2) + if (revision == 2 || revision == 3) return dump_regs_t3b(argc, argv, start_arg, (uint32_t *)regs.data, is_pcie); if (revision == 4) @@ -745,11 +746,7 @@ static int get_sge_context(int argc, char *argv[], int start_arg, return 0; } -#if __BYTE_ORDER == __BIG_ENDIAN -# define ntohll(n) (n) -#else -# define ntohll(n) bswap_64(n) -#endif +#define ntohll(x) be64toh((x)) static int get_sge_desc(int argc, char *argv[], int start_arg, const char *iff_name) @@ -821,7 +818,7 @@ static int get_tcb2(int argc, char *argv[], int start_arg, const char *iff_name) if (doit(iff_name, CHELSIO_GET_MEM, &mr) < 0) err(1, "get TCB"); - for (d = (uint64_t *)&mr.buf, i = 0; i < TCB_SIZE / 32; i++) { + for (d = (uint64_t *)mr.buf, i = 0; i < TCB_SIZE / 32; i++) { printf("%2u:", i); printf(" %08x %08x %08x %08x", (uint32_t)d[1], (uint32_t)(d[1] >> 32), (uint32_t)d[0], -- cgit v1.1