Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (c) 2012 Broadcom Corporation
0003  * Copyright (c) 2012 Canonical Ltd.
0004  *
0005  * Permission to use, copy, modify, and/or distribute this software for any
0006  * purpose with or without fee is hereby granted, provided that the above
0007  * copyright notice and this permission notice appear in all copies.
0008  *
0009  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
0010  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
0011  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
0012  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
0013  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
0014  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
0015  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0016  */
0017 #ifndef _BRCMS_DEBUG_H_
0018 #define _BRCMS_DEBUG_H_
0019 
0020 #include <linux/device.h>
0021 #include <linux/bcma/bcma.h>
0022 #include <net/cfg80211.h>
0023 #include <net/mac80211.h>
0024 #include "main.h"
0025 #include "mac80211_if.h"
0026 
0027 __printf(2, 3)
0028 void __brcms_info(struct device *dev, const char *fmt, ...);
0029 __printf(2, 3)
0030 void __brcms_warn(struct device *dev, const char *fmt, ...);
0031 __printf(2, 3)
0032 void __brcms_err(struct device *dev, const char *fmt, ...);
0033 __printf(2, 3)
0034 void __brcms_crit(struct device *dev, const char *fmt, ...);
0035 
0036 #if defined(CONFIG_BRCMDBG) || defined(CONFIG_BRCM_TRACING)
0037 __printf(4, 5)
0038 void __brcms_dbg(struct device *dev, u32 level, const char *func,
0039          const char *fmt, ...);
0040 #else
0041 static inline __printf(4, 5)
0042 void __brcms_dbg(struct device *dev, u32 level, const char *func,
0043          const char *fmt, ...)
0044 {
0045 }
0046 #endif
0047 
0048 /*
0049  * Debug macros cannot be used when wlc is uninitialized. Generally
0050  * this means any code that could run before brcms_c_attach() has
0051  * returned successfully probably shouldn't use the following macros.
0052  */
0053 
0054 #define brcms_dbg(core, l, f, a...) __brcms_dbg(&(core)->dev, l, __func__, f, ##a)
0055 #define brcms_info(core, f, a...)   __brcms_info(&(core)->dev, f, ##a)
0056 #define brcms_warn(core, f, a...)   __brcms_warn(&(core)->dev, f, ##a)
0057 #define brcms_err(core, f, a...)    __brcms_err(&(core)->dev, f, ##a)
0058 #define brcms_crit(core, f, a...)   __brcms_crit(&(core)->dev, f, ##a)
0059 
0060 #define brcms_dbg_info(core, f, a...)       brcms_dbg(core, BRCM_DL_INFO, f, ##a)
0061 #define brcms_dbg_mac80211(core, f, a...)   brcms_dbg(core, BRCM_DL_MAC80211, f, ##a)
0062 #define brcms_dbg_rx(core, f, a...)     brcms_dbg(core, BRCM_DL_RX, f, ##a)
0063 #define brcms_dbg_tx(core, f, a...)     brcms_dbg(core, BRCM_DL_TX, f, ##a)
0064 #define brcms_dbg_int(core, f, a...)        brcms_dbg(core, BRCM_DL_INT, f, ##a)
0065 #define brcms_dbg_dma(core, f, a...)        brcms_dbg(core, BRCM_DL_DMA, f, ##a)
0066 #define brcms_dbg_ht(core, f, a...)     brcms_dbg(core, BRCM_DL_HT, f, ##a)
0067 
0068 struct brcms_pub;
0069 void brcms_debugfs_init(void);
0070 void brcms_debugfs_exit(void);
0071 void brcms_debugfs_attach(struct brcms_pub *drvr);
0072 void brcms_debugfs_detach(struct brcms_pub *drvr);
0073 struct dentry *brcms_debugfs_get_devdir(struct brcms_pub *drvr);
0074 void brcms_debugfs_create_files(struct brcms_pub *drvr);
0075 
0076 #endif /* _BRCMS_DEBUG_H_ */