Home | History | Annotate | Download | only in sys
      1 /*
      2  * Debug/trace/assert driver definitions for Dongle Host Driver.
      3  *
      4  * Copyright (C) 1999-2010, Broadcom Corporation
      5  *
      6  *      Unless you and Broadcom execute a separate written software license
      7  * agreement governing use of this software, this software is licensed to you
      8  * under the terms of the GNU General Public License version 2 (the "GPL"),
      9  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
     10  * following added to such license:
     11  *
     12  *      As a special exception, the copyright holders of this software give you
     13  * permission to link this software with independent modules, and to copy and
     14  * distribute the resulting executable under terms of your choice, provided that
     15  * you also meet, for each linked independent module, the terms and conditions of
     16  * the license of that module.  An independent module is a module which is not
     17  * derived from this software.  The special exception does not apply to any
     18  * modifications of the software.
     19  *
     20  *      Notwithstanding the above, under no circumstances may you combine this
     21  * software in any way with any other Broadcom software provided under a license
     22  * other than the GPL, without Broadcom's express prior written consent.
     23  *
     24  * $Id: dhd_dbg.h,v 1.5.6.2.4.2.14.4 2009/12/11 01:13:49 Exp $
     25  */
     26 
     27 #ifndef _dhd_dbg_
     28 #define _dhd_dbg_
     29 
     30 #ifdef DHD_DEBUG
     31 
     32 #define DHD_ERROR(args)	       do {if ((dhd_msg_level & DHD_ERROR_VAL) && (net_ratelimit())) \
     33 								printf args;} while (0)
     34 #define DHD_TRACE(args)		do {if (dhd_msg_level & DHD_TRACE_VAL) printf args;} while (0)
     35 #define DHD_INFO(args)		do {if (dhd_msg_level & DHD_INFO_VAL) printf args;} while (0)
     36 #define DHD_DATA(args)		do {if (dhd_msg_level & DHD_DATA_VAL) printf args;} while (0)
     37 #define DHD_CTL(args)		do {if (dhd_msg_level & DHD_CTL_VAL) printf args;} while (0)
     38 #define DHD_TIMER(args)		do {if (dhd_msg_level & DHD_TIMER_VAL) printf args;} while (0)
     39 #define DHD_HDRS(args)		do {if (dhd_msg_level & DHD_HDRS_VAL) printf args;} while (0)
     40 #define DHD_BYTES(args)		do {if (dhd_msg_level & DHD_BYTES_VAL) printf args;} while (0)
     41 #define DHD_INTR(args)		do {if (dhd_msg_level & DHD_INTR_VAL) printf args;} while (0)
     42 #define DHD_GLOM(args)		do {if (dhd_msg_level & DHD_GLOM_VAL) printf args;} while (0)
     43 #define DHD_EVENT(args)		do {if (dhd_msg_level & DHD_EVENT_VAL) printf args;} while (0)
     44 #define DHD_BTA(args)		do {if (dhd_msg_level & DHD_BTA_VAL) printf args;} while (0)
     45 
     46 #define DHD_ERROR_ON()		(dhd_msg_level & DHD_ERROR_VAL)
     47 #define DHD_TRACE_ON()		(dhd_msg_level & DHD_TRACE_VAL)
     48 #define DHD_INFO_ON()		(dhd_msg_level & DHD_INFO_VAL)
     49 #define DHD_DATA_ON()		(dhd_msg_level & DHD_DATA_VAL)
     50 #define DHD_CTL_ON()		(dhd_msg_level & DHD_CTL_VAL)
     51 #define DHD_TIMER_ON()		(dhd_msg_level & DHD_TIMER_VAL)
     52 #define DHD_HDRS_ON()		(dhd_msg_level & DHD_HDRS_VAL)
     53 #define DHD_BYTES_ON()		(dhd_msg_level & DHD_BYTES_VAL)
     54 #define DHD_INTR_ON()		(dhd_msg_level & DHD_INTR_VAL)
     55 #define DHD_GLOM_ON()		(dhd_msg_level & DHD_GLOM_VAL)
     56 #define DHD_EVENT_ON()		(dhd_msg_level & DHD_EVENT_VAL)
     57 #define DHD_BTA_ON()		(dhd_msg_level & DHD_BTA_VAL)
     58 
     59 #else /* DHD_DEBUG */
     60 
     61 #define DHD_ERROR(args)    	do {if (net_ratelimit()) printf args;} while (0)
     62 #define DHD_TRACE(args)
     63 #define DHD_INFO(args)
     64 #define DHD_DATA(args)
     65 #define DHD_CTL(args)
     66 #define DHD_TIMER(args)
     67 #define DHD_HDRS(args)
     68 #define DHD_BYTES(args)
     69 #define DHD_INTR(args)
     70 #define DHD_GLOM(args)
     71 #define DHD_EVENT(args)
     72 #define DHD_BTA(args)
     73 
     74 #define DHD_ERROR_ON()		0
     75 #define DHD_TRACE_ON()		0
     76 #define DHD_INFO_ON()		0
     77 #define DHD_DATA_ON()		0
     78 #define DHD_CTL_ON()		0
     79 #define DHD_TIMER_ON()		0
     80 #define DHD_HDRS_ON()		0
     81 #define DHD_BYTES_ON()		0
     82 #define DHD_INTR_ON()		0
     83 #define DHD_GLOM_ON()		0
     84 #define DHD_EVENT_ON()		0
     85 #define DHD_BTA_ON()		0
     86 
     87 #endif /* DHD_DEBUG */
     88 
     89 #define DHD_LOG(args)
     90 
     91 #define DHD_NONE(args)
     92 extern int dhd_msg_level;
     93 
     94 /* Defines msg bits */
     95 #include <dhdioctl.h>
     96 
     97 #endif /* _dhd_dbg_ */
     98