# HG changeset patch # Parent 7b528d8da5c9d49acd205ae06a2fe6f0685bd0af diff -r 7b528d8da5c9 -r b320ab35d09f sys/dev/cxgbe/adapter.h --- a/sys/dev/cxgbe/adapter.h Tue Oct 28 23:14:21 2014 -0700 +++ b/sys/dev/cxgbe/adapter.h Wed Oct 29 15:02:42 2014 -0700 @@ -121,6 +121,21 @@ t4_bus_space_write_8(bus_space_tag_t tag } #endif +#define CH_MSG(sc, fmt, ...) device_printf(sc->dev, fmt, ##__VA_ARGS__); +#define CH_DUMP_MBOX(sc, mbox, data_reg, size) \ + device_printf(sc->dev, \ + "mbox %u: %016llx %016llx %016llx %016llx %016llx %016llx %016llx %016llx\n", (mbox), \ + (unsigned long long)t4_read_reg64(adap, data_reg), \ + (unsigned long long)t4_read_reg64(adap, data_reg + 8), \ + (unsigned long long)t4_read_reg64(adap, data_reg + 16), \ + (unsigned long long)t4_read_reg64(adap, data_reg + 24), \ + (unsigned long long)t4_read_reg64(adap, data_reg + 32), \ + (unsigned long long)t4_read_reg64(adap, data_reg + 40), \ + (unsigned long long)t4_read_reg64(adap, data_reg + 48), \ + (unsigned long long)t4_read_reg64(adap, data_reg + 56)); + +/* Additional NETIF_MSG_* categories */ + struct adapter; typedef struct adapter adapter_t; diff -r 7b528d8da5c9 -r b320ab35d09f sys/dev/cxgbe/common/t4_hw.c --- a/sys/dev/cxgbe/common/t4_hw.c Tue Oct 28 23:14:21 2014 -0700 +++ b/sys/dev/cxgbe/common/t4_hw.c Wed Oct 29 15:02:42 2014 -0700 @@ -262,6 +262,8 @@ int t4_wr_mbox_meat(struct adapter *adap for (i = 0; i < size; i += 8, p++) t4_write_reg64(adap, data_reg + i, be64_to_cpu(*p)); + CH_DUMP_MBOX(adap, mbox, data_reg, size / 8); + t4_write_reg(adap, ctl_reg, F_MBMSGVALID | V_MBOWNER(X_MBOWNER_FW)); t4_read_reg(adap, ctl_reg); /* flush write */ @@ -287,6 +289,11 @@ int t4_wr_mbox_meat(struct adapter *adap continue; } + CH_DUMP_MBOX(adap, mbox, data_reg, size / 8); + CH_MSG(adap, + "command completed in %d ms (%ssleeping)\n", + i + ms, sleep_ok ? "" : "non-"); + res = t4_read_reg64(adap, data_reg); if (G_FW_CMD_OP(res >> 32) == FW_DEBUG_CMD) { fw_asrt(adap, data_reg);