Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/halrf/halrf_debug.h
1308 views
/******************************************************************************1*2* Copyright(c) 2007 - 2017 Realtek Corporation.3*4* This program is free software; you can redistribute it and/or modify it5* under the terms of version 2 of the GNU General Public License as6* published by the Free Software Foundation.7*8* This program is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for11* more details.12*13* The full GNU General Public License is included in this distribution in the14* file called LICENSE.15*16* Contact Information:17* wlanfae <[email protected]>18* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,19* Hsinchu 300, Taiwan.20*21* Larry Finger <[email protected]>22*23*****************************************************************************/2425#ifndef __HALRF_DEBUG_H__26#define __HALRF_DEBUG_H__2728/*@============================================================*/29/*@include files*/30/*@============================================================*/3132/*@============================================================*/33/*@Definition */34/*@============================================================*/3536#if DBG3738#if (DM_ODM_SUPPORT_TYPE == ODM_AP)39#define RF_DBG(dm, comp, fmt, args...) \40do { \41if ((comp) & dm->rf_table.rf_dbg_comp) { \42pr_debug("[RF] "); \43RT_PRINTK(fmt, ##args); \44} \45} while (0)4647#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN)4849static __inline void RF_DBG(PDM_ODM_T dm, int comp, char *fmt, ...)50{51RT_STATUS rt_status;52va_list args;53char buf[PRINT_MAX_SIZE] = {0};5455if ((comp & dm->rf_table.rf_dbg_comp) == 0)56return;5758if (fmt == NULL)59return;6061va_start(args, fmt);62rt_status = (RT_STATUS)RtlStringCbVPrintfA(buf, PRINT_MAX_SIZE, fmt, args);63va_end(args);6465if (rt_status != RT_STATUS_SUCCESS) {66DbgPrint("Failed (%d) to print message to buffer\n", rt_status);67return;68}6970DbgPrint("[RF] %s", buf);71}7273#elif (DM_ODM_SUPPORT_TYPE == ODM_IOT)7475#define RF_DBG(dm, comp, fmt, args...) \76do { \77if ((comp) & dm->rf_table.rf_dbg_comp) { \78RT_DEBUG(COMP_PHYDM, DBG_DMESG, "[RF] " fmt, ##args); \79} \80} while (0)8182#else83#define RF_DBG(dm, comp, fmt, args...) \84do { \85struct dm_struct *__dm = dm; \86if ((comp) & __dm->rf_table.rf_dbg_comp) { \87RT_TRACE(((struct rtl_priv *)__dm->adapter), \88COMP_PHYDM, DBG_DMESG, "[RF] " fmt, ##args); \89} \90} while (0)91#endif9293#else /*#if DBG*/9495#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)96static __inline void RF_DBG(struct dm_struct *dm, int comp, char *fmt, ...)97{98}99#else100#define RF_DBG(dm, comp, fmt, args...)101#endif102103#endif /*#if DBG*/104105/*@============================================================*/106/*@ enumeration */107/*@============================================================*/108109/*@============================================================*/110/*@ structure */111/*@============================================================*/112113/*@============================================================*/114/*@ function prototype */115/*@============================================================*/116117void halrf_cmd_parser(void *dm_void, char input[][16], u32 *_used, char *output,118u32 *_out_len, u32 input_num);119120void halrf_init_debug_setting(void *dm_void);121122#endif /*__HALRF_H__*/123124125