| dea3101 | 2005-04-17 16:05:31 -0500 | [diff] [blame] | 1 | /******************************************************************* |
| 2 | * This file is part of the Emulex Linux Device Driver for * |
James.Smart@Emulex.Com | c44ce17 | 2005-06-25 10:34:39 -0400 | [diff] [blame] | 3 | * Fibre Channel Host Bus Adapters. * |
James Smart | d8e93df | 2009-05-22 14:53:05 -0400 | [diff] [blame] | 4 | * Copyright (C) 2004-2009 Emulex. All rights reserved. * |
James.Smart@Emulex.Com | c44ce17 | 2005-06-25 10:34:39 -0400 | [diff] [blame] | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| dea3101 | 2005-04-17 16:05:31 -0500 | [diff] [blame] | 6 | * www.emulex.com * |
| 7 | * * |
| 8 | * This program is free software; you can redistribute it and/or * |
James.Smart@Emulex.Com | c44ce17 | 2005-06-25 10:34:39 -0400 | [diff] [blame] | 9 | * modify it under the terms of version 2 of the GNU General * |
| 10 | * Public License as published by the Free Software Foundation. * |
| 11 | * This program is distributed in the hope that it will be useful. * |
| 12 | * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * |
| 13 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * |
| 14 | * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * |
| 15 | * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * |
| 16 | * TO BE LEGALLY INVALID. See the GNU General Public License for * |
| 17 | * more details, a copy of which can be found in the file COPYING * |
| 18 | * included with this package. * |
| dea3101 | 2005-04-17 16:05:31 -0500 | [diff] [blame] | 19 | *******************************************************************/ |
| 20 | |
James Smart | f4b4c68 | 2009-05-22 14:53:12 -0400 | [diff] [blame] | 21 | #define LOG_ELS 0x00000001 /* ELS events */ |
| 22 | #define LOG_DISCOVERY 0x00000002 /* Link discovery events */ |
| 23 | #define LOG_MBOX 0x00000004 /* Mailbox events */ |
| 24 | #define LOG_INIT 0x00000008 /* Initialization events */ |
| 25 | #define LOG_LINK_EVENT 0x00000010 /* Link events */ |
| 26 | #define LOG_IP 0x00000020 /* IP traffic history */ |
| 27 | #define LOG_FCP 0x00000040 /* FCP traffic history */ |
| 28 | #define LOG_NODE 0x00000080 /* Node table events */ |
| 29 | #define LOG_TEMP 0x00000100 /* Temperature sensor events */ |
| 30 | #define LOG_BG 0x00000200 /* BlockGuard events */ |
| 31 | #define LOG_MISC 0x00000400 /* Miscellaneous events */ |
| 32 | #define LOG_SLI 0x00000800 /* SLI events */ |
| 33 | #define LOG_FCP_ERROR 0x00001000 /* log errors, not underruns */ |
| 34 | #define LOG_LIBDFC 0x00002000 /* Libdfc events */ |
| 35 | #define LOG_VPORT 0x00004000 /* NPIV events */ |
James Smart | 63e801c | 2010-11-20 23:14:19 -0500 | [diff] [blame] | 36 | #define LOG_SECURITY 0x00008000 /* Security events */ |
James Smart | f4b4c68 | 2009-05-22 14:53:12 -0400 | [diff] [blame] | 37 | #define LOG_EVENT 0x00010000 /* CT,TEMP,DUMP, logging */ |
James Smart | 0c9ab6f | 2010-02-26 14:15:57 -0500 | [diff] [blame] | 38 | #define LOG_FIP 0x00020000 /* FIP events */ |
James Smart | f4b4c68 | 2009-05-22 14:53:12 -0400 | [diff] [blame] | 39 | #define LOG_ALL_MSG 0xffffffff /* LOG all messages */ |
| dea3101 | 2005-04-17 16:05:31 -0500 | [diff] [blame] | 40 | |
James Smart | e8b6201 | 2007-08-02 11:10:09 -0400 | [diff] [blame] | 41 | #define lpfc_printf_vlog(vport, level, mask, fmt, arg...) \ |
James Smart | f4b4c68 | 2009-05-22 14:53:12 -0400 | [diff] [blame] | 42 | do { \ |
| 43 | { if (((mask) & (vport)->cfg_log_verbose) || (level[1] <= '3')) \ |
James Smart | e8b6201 | 2007-08-02 11:10:09 -0400 | [diff] [blame] | 44 | dev_printk(level, &((vport)->phba->pcidev)->dev, "%d:(%d):" \ |
James Smart | 7f5f3d0 | 2008-02-08 18:50:14 -0500 | [diff] [blame] | 45 | fmt, (vport)->phba->brd_no, vport->vpi, ##arg); } \ |
James Smart | f4b4c68 | 2009-05-22 14:53:12 -0400 | [diff] [blame] | 46 | } while (0) |
James Smart | e8b6201 | 2007-08-02 11:10:09 -0400 | [diff] [blame] | 47 | |
| dea3101 | 2005-04-17 16:05:31 -0500 | [diff] [blame] | 48 | #define lpfc_printf_log(phba, level, mask, fmt, arg...) \ |
James Smart | f4b4c68 | 2009-05-22 14:53:12 -0400 | [diff] [blame] | 49 | do { \ |
| 50 | { uint32_t log_verbose = (phba)->pport ? \ |
| 51 | (phba)->pport->cfg_log_verbose : \ |
| 52 | (phba)->cfg_log_verbose; \ |
| 53 | if (((mask) & log_verbose) || (level[1] <= '3')) \ |
James Smart | e8b6201 | 2007-08-02 11:10:09 -0400 | [diff] [blame] | 54 | dev_printk(level, &((phba)->pcidev)->dev, "%d:" \ |
James Smart | f4b4c68 | 2009-05-22 14:53:12 -0400 | [diff] [blame] | 55 | fmt, phba->brd_no, ##arg); \ |
| 56 | } \ |
| 57 | } while (0) |