Back to home page

OSCL-LXR

 
 

    


0001 /* bnx2fc_debug.c: QLogic Linux FCoE offload driver.
0002  * Handles operations such as session offload/upload etc, and manages
0003  * session resources such as connection id and qp resources.
0004  *
0005  * Copyright (c) 2008-2013 Broadcom Corporation
0006  * Copyright (c) 2014-2016 QLogic Corporation
0007  * Copyright (c) 2016-2017 Cavium Inc.
0008  *
0009  * This program is free software; you can redistribute it and/or modify
0010  * it under the terms of the GNU General Public License as published by
0011  * the Free Software Foundation.
0012  *
0013  */
0014 
0015 #include "bnx2fc.h"
0016 
0017 void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...)
0018 {
0019     struct va_format vaf;
0020     va_list args;
0021 
0022     if (likely(!(bnx2fc_debug_level & LOG_IO)))
0023         return;
0024 
0025     va_start(args, fmt);
0026 
0027     vaf.fmt = fmt;
0028     vaf.va = &args;
0029 
0030     if (io_req && io_req->port && io_req->port->lport &&
0031         io_req->port->lport->host)
0032         shost_printk(KERN_INFO, io_req->port->lport->host,
0033                  PFX "xid:0x%x %pV",
0034                  io_req->xid, &vaf);
0035     else
0036         pr_info("NULL %pV", &vaf);
0037 
0038     va_end(args);
0039 }
0040 
0041 void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...)
0042 {
0043     struct va_format vaf;
0044     va_list args;
0045 
0046     if (likely(!(bnx2fc_debug_level & LOG_TGT)))
0047         return;
0048 
0049     va_start(args, fmt);
0050 
0051     vaf.fmt = fmt;
0052     vaf.va = &args;
0053 
0054     if (tgt && tgt->port && tgt->port->lport && tgt->port->lport->host &&
0055         tgt->rport)
0056         shost_printk(KERN_INFO, tgt->port->lport->host,
0057                  PFX "port:%x %pV",
0058                  tgt->rport->port_id, &vaf);
0059     else
0060         pr_info("NULL %pV", &vaf);
0061 
0062     va_end(args);
0063 }
0064 
0065 void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...)
0066 {
0067     struct va_format vaf;
0068     va_list args;
0069 
0070     if (likely(!(bnx2fc_debug_level & LOG_HBA)))
0071         return;
0072 
0073     va_start(args, fmt);
0074 
0075     vaf.fmt = fmt;
0076     vaf.va = &args;
0077 
0078     if (lport && lport->host)
0079         shost_printk(KERN_INFO, lport->host, PFX "%pV", &vaf);
0080     else
0081         pr_info("NULL %pV", &vaf);
0082 
0083     va_end(args);
0084 }