2 * QLogic iSCSI Offload Driver
3 * Copyright (c) 2016 Cavium Inc.
5 * This software is available under the terms of the GNU General Public License
6 * (GPL) Version 2, available from the file COPYING in the main directory of
11 #include <linux/vmalloc.h>
14 qedi_dbg_err(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
25 if (likely(qedi) && likely(qedi->pdev))
26 pr_err("[%s]:[%s:%d]:%d: %pV", dev_name(&qedi->pdev->dev),
27 func, line, qedi->host_no, &vaf);
29 pr_err("[0000:00:00.0]:[%s:%d]: %pV", func, line, &vaf);
35 qedi_dbg_warn(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
46 if (!(qedi_dbg_log & QEDI_LOG_WARN))
49 if (likely(qedi) && likely(qedi->pdev))
50 pr_warn("[%s]:[%s:%d]:%d: %pV", dev_name(&qedi->pdev->dev),
51 func, line, qedi->host_no, &vaf);
53 pr_warn("[0000:00:00.0]:[%s:%d]: %pV", func, line, &vaf);
60 qedi_dbg_notice(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
71 if (!(qedi_dbg_log & QEDI_LOG_NOTICE))
74 if (likely(qedi) && likely(qedi->pdev))
75 pr_notice("[%s]:[%s:%d]:%d: %pV",
76 dev_name(&qedi->pdev->dev), func, line,
79 pr_notice("[0000:00:00.0]:[%s:%d]: %pV", func, line, &vaf);
86 qedi_dbg_info(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
87 u32 level, const char *fmt, ...)
97 if (!(qedi_dbg_log & level))
100 if (likely(qedi) && likely(qedi->pdev))
101 pr_info("[%s]:[%s:%d]:%d: %pV", dev_name(&qedi->pdev->dev),
102 func, line, qedi->host_no, &vaf);
104 pr_info("[0000:00:00.0]:[%s:%d]: %pV", func, line, &vaf);
111 qedi_create_sysfs_attr(struct Scsi_Host *shost, struct sysfs_bin_attrs *iter)
115 for (; iter->name; iter++) {
116 ret = sysfs_create_bin_file(&shost->shost_gendev.kobj,
119 pr_err("Unable to create sysfs %s attr, err(%d).\n",
126 qedi_remove_sysfs_attr(struct Scsi_Host *shost, struct sysfs_bin_attrs *iter)
128 for (; iter->name; iter++)
129 sysfs_remove_bin_file(&shost->shost_gendev.kobj, iter->attr);