From: Ramachandra K <ramachandra.kuchimanchi@qlogic.com>
To: rdreier@cisco.com, general@lists.openfabrics.org, netdev@vger.kernel.org
Cc: poornima.kamath@qlogic.com, amar.mudrankit@qlogic.com
Subject: [PATCH v4 11/14] QLogic VNIC: Driver utility file - implements various utility macros
Date: Tue, 10 Jun 2008 17:07:47 -0400 [thread overview]
Message-ID: <20080610210747.11186.9892.stgit@dale> (raw)
In-Reply-To: <20080610205633.11186.45499.stgit@dale>
From: Poornima Kamath <poornima.kamath@qlogic.com>
This patch adds the driver utility file which mainly contains utility
macros for debugging of QLogic VNIC driver.
Signed-off-by: Poornima Kamath <poornima.kamath@qlogic.com>
Signed-off-by: Ramachandra K <ramachandra.kuchimanchi@qlogic.com>
Signed-off-by: Amar Mudrankit <amar.mudrankit@qlogic.com>
---
drivers/infiniband/ulp/qlgc_vnic/vnic_util.h | 236 ++++++++++++++++++++++++++
1 files changed, 236 insertions(+), 0 deletions(-)
create mode 100644 drivers/infiniband/ulp/qlgc_vnic/vnic_util.h
diff --git a/drivers/infiniband/ulp/qlgc_vnic/vnic_util.h b/drivers/infiniband/ulp/qlgc_vnic/vnic_util.h
new file mode 100644
index 0000000..095fa3a
--- /dev/null
+++ b/drivers/infiniband/ulp/qlgc_vnic/vnic_util.h
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2006 QLogic, Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef VNIC_UTIL_H_INCLUDED
+#define VNIC_UTIL_H_INCLUDED
+
+#define MODULE_NAME "QLGC_VNIC"
+
+#define VNIC_MAJORVERSION 1
+#define VNIC_MINORVERSION 1
+
+#define ALIGN_DOWN(x, a) ((x)&(~((a)-1)))
+
+extern u32 vnic_debug;
+
+enum {
+ DEBUG_IB_INFO = 0x00000001,
+ DEBUG_IB_FUNCTION = 0x00000002,
+ DEBUG_IB_FSTATUS = 0x00000004,
+ DEBUG_IB_ASSERTS = 0x00000008,
+ DEBUG_CONTROL_INFO = 0x00000010,
+ DEBUG_CONTROL_FUNCTION = 0x00000020,
+ DEBUG_CONTROL_PACKET = 0x00000040,
+ DEBUG_CONFIG_INFO = 0x00000100,
+ DEBUG_DATA_INFO = 0x00001000,
+ DEBUG_DATA_FUNCTION = 0x00002000,
+ DEBUG_NETPATH_INFO = 0x00010000,
+ DEBUG_VIPORT_INFO = 0x00100000,
+ DEBUG_VIPORT_FUNCTION = 0x00200000,
+ DEBUG_LINK_STATE = 0x00400000,
+ DEBUG_VNIC_INFO = 0x01000000,
+ DEBUG_VNIC_FUNCTION = 0x02000000,
+ DEBUG_MCAST_INFO = 0x04000000,
+ DEBUG_MCAST_FUNCTION = 0x08000000,
+ DEBUG_SYS_INFO = 0x10000000,
+ DEBUG_SYS_VERBOSE = 0x40000000
+};
+
+#define PRINT(level, x, fmt, arg...) \
+ printk(level "%s: " fmt, MODULE_NAME, ##arg)
+
+#define PRINT_CONDITIONAL(level, x, condition, fmt, arg...) \
+ do { \
+ if (condition) \
+ printk(level "%s: %s: " fmt, \
+ MODULE_NAME, x, ##arg); \
+ } while (0)
+
+#define IB_PRINT(fmt, arg...) \
+ PRINT(KERN_INFO, "IB", fmt, ##arg)
+#define IB_ERROR(fmt, arg...) \
+ PRINT(KERN_ERR, "IB", fmt, ##arg)
+
+#define IB_FUNCTION(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "IB", \
+ (vnic_debug & DEBUG_IB_FUNCTION), \
+ fmt, ##arg)
+
+#define IB_INFO(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "IB", \
+ (vnic_debug & DEBUG_IB_INFO), \
+ fmt, ##arg)
+
+#define IB_ASSERT(x) \
+ do { \
+ if ((vnic_debug & DEBUG_IB_ASSERTS) && !(x)) \
+ panic("%s assertion failed, file: %s," \
+ " line %d: ", \
+ MODULE_NAME, __FILE__, __LINE__) \
+ } while (0)
+
+#define CONTROL_PRINT(fmt, arg...) \
+ PRINT(KERN_INFO, "CONTROL", fmt, ##arg)
+#define CONTROL_ERROR(fmt, arg...) \
+ PRINT(KERN_ERR, "CONTROL", fmt, ##arg)
+
+#define CONTROL_INFO(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "CONTROL", \
+ (vnic_debug & DEBUG_CONTROL_INFO), \
+ fmt, ##arg)
+
+#define CONTROL_FUNCTION(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "CONTROL", \
+ (vnic_debug & DEBUG_CONTROL_FUNCTION), \
+ fmt, ##arg)
+
+#define CONTROL_PACKET(pkt) \
+ do { \
+ if (vnic_debug & DEBUG_CONTROL_PACKET) \
+ control_log_control_packet(pkt); \
+ } while (0)
+
+#define CONFIG_PRINT(fmt, arg...) \
+ PRINT(KERN_INFO, "CONFIG", fmt, ##arg)
+#define CONFIG_ERROR(fmt, arg...) \
+ PRINT(KERN_ERR, "CONFIG", fmt, ##arg)
+
+#define CONFIG_INFO(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "CONFIG", \
+ (vnic_debug & DEBUG_CONFIG_INFO), \
+ fmt, ##arg)
+
+#define DATA_PRINT(fmt, arg...) \
+ PRINT(KERN_INFO, "DATA", fmt, ##arg)
+#define DATA_ERROR(fmt, arg...) \
+ PRINT(KERN_ERR, "DATA", fmt, ##arg)
+
+#define DATA_INFO(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "DATA", \
+ (vnic_debug & DEBUG_DATA_INFO), \
+ fmt, ##arg)
+
+#define DATA_FUNCTION(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "DATA", \
+ (vnic_debug & DEBUG_DATA_FUNCTION), \
+ fmt, ##arg)
+
+
+#define MCAST_PRINT(fmt, arg...) \
+ PRINT(KERN_INFO, "MCAST", fmt, ##arg)
+#define MCAST_ERROR(fmt, arg...) \
+ PRINT(KERN_ERR, "MCAST", fmt, ##arg)
+
+#define MCAST_INFO(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "MCAST", \
+ (vnic_debug & DEBUG_MCAST_INFO), \
+ fmt, ##arg)
+
+#define MCAST_FUNCTION(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "MCAST", \
+ (vnic_debug & DEBUG_MCAST_FUNCTION), \
+ fmt, ##arg)
+
+#define NETPATH_PRINT(fmt, arg...) \
+ PRINT(KERN_INFO, "NETPATH", fmt, ##arg)
+#define NETPATH_ERROR(fmt, arg...) \
+ PRINT(KERN_ERR, "NETPATH", fmt, ##arg)
+
+#define NETPATH_INFO(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "NETPATH", \
+ (vnic_debug & DEBUG_NETPATH_INFO), \
+ fmt, ##arg)
+
+#define VIPORT_PRINT(fmt, arg...) \
+ PRINT(KERN_INFO, "VIPORT", fmt, ##arg)
+#define VIPORT_ERROR(fmt, arg...) \
+ PRINT(KERN_ERR, "VIPORT", fmt, ##arg)
+
+#define VIPORT_INFO(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "VIPORT", \
+ (vnic_debug & DEBUG_VIPORT_INFO), \
+ fmt, ##arg)
+
+#define VIPORT_FUNCTION(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "VIPORT", \
+ (vnic_debug & DEBUG_VIPORT_FUNCTION), \
+ fmt, ##arg)
+
+#define LINK_STATE(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "LINK", \
+ (vnic_debug & DEBUG_LINK_STATE), \
+ fmt, ##arg)
+
+#define VNIC_PRINT(fmt, arg...) \
+ PRINT(KERN_INFO, "NIC", fmt, ##arg)
+#define VNIC_ERROR(fmt, arg...) \
+ PRINT(KERN_ERR, "NIC", fmt, ##arg)
+#define VNIC_INIT(fmt, arg...) \
+ PRINT(KERN_INFO, "NIC", fmt, ##arg)
+
+#define VNIC_INFO(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "NIC", \
+ (vnic_debug & DEBUG_VNIC_INFO), \
+ fmt, ##arg)
+
+#define VNIC_FUNCTION(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "NIC", \
+ (vnic_debug & DEBUG_VNIC_FUNCTION), \
+ fmt, ##arg)
+
+#define SYS_PRINT(fmt, arg...) \
+ PRINT(KERN_INFO, "SYS", fmt, ##arg)
+#define SYS_ERROR(fmt, arg...) \
+ PRINT(KERN_ERR, "SYS", fmt, ##arg)
+
+#define SYS_INFO(fmt, arg...) \
+ PRINT_CONDITIONAL(KERN_INFO, \
+ "SYS", \
+ (vnic_debug & DEBUG_SYS_INFO), \
+ fmt, ##arg)
+
+#endif /* VNIC_UTIL_H_INCLUDED */
next prev parent reply other threads:[~2008-06-10 21:04 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-10 21:02 [ofa-general] [PATCH v4 00/14] QLogic VNIC Driver Ramachandra K
2008-06-10 21:02 ` [ofa-general] [PATCH v4 01/14] QLogic VNIC: Driver - netdev implementation Ramachandra K
2008-06-10 21:03 ` [ofa-general] [PATCH v4 02/14] QLogic VNIC: Netpath - abstraction of connection to EVIC/VEx Ramachandra K
2008-06-10 21:03 ` [ofa-general] [PATCH v4 03/14] QLogic VNIC: Implementation of communication protocol with EVIC/VEx Ramachandra K
2008-06-10 21:04 ` [ofa-general] [PATCH v4 04/14] QLogic VNIC: Implementation of Control path of communication protocol Ramachandra K
2008-06-10 22:21 ` Stephen Hemminger
2008-06-10 21:04 ` [ofa-general] [PATCH v4 05/14] QLogic VNIC: Implementation of Data " Ramachandra K
2008-06-10 21:05 ` [ofa-general] [PATCH v4 06/14] QLogic VNIC: IB core stack interaction Ramachandra K
2008-06-10 21:05 ` [ofa-general] [PATCH v4 07/14] QLogic VNIC: Handling configurable parameters of the driver Ramachandra K
2008-06-10 21:06 ` [ofa-general] [PATCH v4 08/14] QLogic VNIC: sysfs interface implementation for " Ramachandra K
2008-06-10 21:06 ` [ofa-general] [PATCH v4 09/14] QLogic VNIC: IB Multicast for Ethernet broadcast/multicast Ramachandra K
2008-06-10 21:07 ` [ofa-general] [PATCH v4 10/14] QLogic VNIC: Driver Statistics collection Ramachandra K
2008-06-10 21:07 ` Ramachandra K [this message]
2008-06-10 21:08 ` [PATCH v4 12/14] QLogic VNIC: Driver Kconfig and Makefile Ramachandra K
2008-06-10 21:08 ` [ofa-general] [PATCH v4 13/14] QLogic VNIC: Modifications to IB " Ramachandra K
2008-06-10 21:09 ` [ofa-general] [PATCH v4 14/14] QLogic VNIC: sysfs Documentation Ramachandra K
2008-06-11 6:47 ` Patrick McHardy
2008-06-12 15:13 ` [ofa-general] " Amar Mudrankit
2008-06-12 15:18 ` Patrick McHardy
2008-06-12 15:29 ` Ramachandra K
2008-06-12 15:34 ` Patrick McHardy
2008-06-12 20:22 ` Jeff Garzik
2008-06-14 18:03 ` Roland Dreier
2008-06-14 19:03 ` Jason Gunthorpe
2008-06-16 8:54 ` Patrick McHardy
2008-06-18 12:32 ` Ramachandra K
2008-06-18 12:38 ` Patrick McHardy
2008-06-18 18:21 ` Jason Gunthorpe
2008-06-19 1:19 ` Patrick McHardy
2008-06-19 1:26 ` Patrick McHardy
2008-06-12 15:50 ` Ramachandra K
2008-06-12 16:03 ` Patrick McHardy
2008-06-12 21:09 ` Amar Mudrankit
2008-06-13 15:20 ` Patrick McHardy
2008-06-13 21:47 ` Amar Mudrankit
2008-06-14 8:08 ` Patrick McHardy
2008-06-16 19:44 ` Amar Mudrankit
2008-06-16 20:39 ` Patrick McHardy
2008-06-12 16:04 ` Karen Shaeffer
2008-06-12 15:21 ` [ofa-general] [PATCH v4 00/14] QLogic VNIC Driver Ramachandra K
2008-06-12 15:35 ` Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080610210747.11186.9892.stgit@dale \
--to=ramachandra.kuchimanchi@qlogic.com \
--cc=amar.mudrankit@qlogic.com \
--cc=general@lists.openfabrics.org \
--cc=netdev@vger.kernel.org \
--cc=poornima.kamath@qlogic.com \
--cc=rdreier@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.