^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* bnx2fc_debug.c: QLogic Linux FCoE offload driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * Handles operations such as session offload/upload etc, and manages
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * session resources such as connection id and qp resources.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (c) 2008-2013 Broadcom Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (c) 2014-2016 QLogic Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Copyright (c) 2016-2017 Cavium Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * This program is free software; you can redistribute it and/or modify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * it under the terms of the GNU General Public License as published by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * the Free Software Foundation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include "bnx2fc.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) struct va_format vaf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) va_list args;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) if (likely(!(bnx2fc_debug_level & LOG_IO)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) va_start(args, fmt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) vaf.fmt = fmt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) vaf.va = &args;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) if (io_req && io_req->port && io_req->port->lport &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) io_req->port->lport->host)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) shost_printk(KERN_INFO, io_req->port->lport->host,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) PFX "xid:0x%x %pV",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) io_req->xid, &vaf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) pr_info("NULL %pV", &vaf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) va_end(args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) struct va_format vaf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) va_list args;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) if (likely(!(bnx2fc_debug_level & LOG_TGT)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) va_start(args, fmt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) vaf.fmt = fmt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) vaf.va = &args;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) if (tgt && tgt->port && tgt->port->lport && tgt->port->lport->host &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) tgt->rport)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) shost_printk(KERN_INFO, tgt->port->lport->host,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) PFX "port:%x %pV",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) tgt->rport->port_id, &vaf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) pr_info("NULL %pV", &vaf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) va_end(args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) struct va_format vaf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) va_list args;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) if (likely(!(bnx2fc_debug_level & LOG_HBA)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) va_start(args, fmt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) vaf.fmt = fmt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) vaf.va = &args;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) if (lport && lport->host)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) shost_printk(KERN_INFO, lport->host, PFX "%pV", &vaf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) pr_info("NULL %pV", &vaf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) va_end(args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) }