Home | History | Annotate | Download | only in include
      1 /******************************************************************************
      2  *
      3  *  Copyright (C) 1999-2012 Broadcom Corporation
      4  *
      5  *  Licensed under the Apache License, Version 2.0 (the "License");
      6  *  you may not use this file except in compliance with the License.
      7  *  You may obtain a copy of the License at:
      8  *
      9  *  http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  *  Unless required by applicable law or agreed to in writing, software
     12  *  distributed under the License is distributed on an "AS IS" BASIS,
     13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  *  See the License for the specific language governing permissions and
     15  *  limitations under the License.
     16  *
     17  ******************************************************************************/
     18 #ifndef BT_TRACE_H
     19 #define BT_TRACE_H
     20 
     21 #ifndef BTTRC_INCLUDED
     22 #define BTTRC_INCLUDED  FALSE
     23 #endif
     24 #ifndef BTTRC_PARSER_INCLUDED
     25 #define BTTRC_PARSER_INCLUDED FALSE
     26 #endif
     27 #ifndef MAX_TRACE_RAM_SIZE
     28 #define MAX_TRACE_RAM_SIZE 10000
     29 #endif
     30 
     31 /* BTE tracing IDs for debug purposes */
     32 /* LayerIDs for stack */
     33 #define BTTRC_ID_STK_GKI                   1
     34 #define BTTRC_ID_STK_BTU                   2
     35 #define BTTRC_ID_STK_HCI                   3
     36 #define BTTRC_ID_STK_L2CAP                 4
     37 #define BTTRC_ID_STK_RFCM_MX               5
     38 #define BTTRC_ID_STK_RFCM_PRT              6
     39 #define BTTRC_ID_STK_OBEX_C                7
     40 #define BTTRC_ID_STK_OBEX_S                8
     41 #define BTTRC_ID_STK_AVCT                  9
     42 #define BTTRC_ID_STK_AVDT                  10
     43 #define BTTRC_ID_STK_AVRC                  11
     44 #define BTTRC_ID_STK_BIC                   12
     45 #define BTTRC_ID_STK_BIS                   13
     46 #define BTTRC_ID_STK_BNEP                  14
     47 #define BTTRC_ID_STK_BPP                   15
     48 #define BTTRC_ID_STK_BTM_ACL               16
     49 #define BTTRC_ID_STK_BTM_PM                17
     50 #define BTTRC_ID_STK_BTM_DEV_CTRL          18
     51 #define BTTRC_ID_STK_BTM_SVC_DSC           19
     52 #define BTTRC_ID_STK_BTM_INQ               20
     53 #define BTTRC_ID_STK_BTM_SCO               21
     54 #define BTTRC_ID_STK_BTM_SEC               22
     55 #define BTTRC_ID_STK_DUN                   23
     56 #define BTTRC_ID_STK_HID                   24
     57 #define BTTRC_ID_STK_HSP2                  25
     58 #define BTTRC_ID_STK_CTP                   26
     59 #define BTTRC_ID_STK_FTC                   27
     60 #define BTTRC_ID_STK_FTS                   28
     61 #define BTTRC_ID_STK_GAP                   29
     62 #define BTTRC_ID_STK_GOEP                  30
     63 #define BTTRC_ID_STK_HCRP                  31
     64 #define BTTRC_ID_STK_ICP                   32
     65 #define BTTRC_ID_STK_OPC                   33
     66 #define BTTRC_ID_STK_OPS                   34
     67 #define BTTRC_ID_STK_PAN                   35
     68 #define BTTRC_ID_STK_SAP                   36
     69 #define BTTRC_ID_STK_SDP                   37
     70 #define BTTRC_ID_STK_SLIP                  38
     71 #define BTTRC_ID_STK_SPP                   39
     72 #define BTTRC_ID_STK_TCS                   40
     73 #define BTTRC_ID_STK_VDP                   41
     74 #define BTTRC_ID_STK_AMP                   42
     75 #define BTTRC_ID_STK_MCAP                  43
     76 #define BTTRC_ID_STK_GATT                  44
     77 #define BTTRC_ID_STK_SMP                   45
     78 #define BTTRC_ID_STK_NFC                   46
     79 #define BTTRC_ID_STK_NCI                   47
     80 #define BTTRC_ID_STK_IDEP                  48
     81 #define BTTRC_ID_STK_NDEP                  49
     82 #define BTTRC_ID_STK_LLCP                  50
     83 #define BTTRC_ID_STK_RW                    51
     84 #define BTTRC_ID_STK_CE                    52
     85 #define BTTRC_ID_STK_SNEP                  53
     86 #define BTTRC_ID_STK_NDEF                  54
     87 
     88 
     89 /* LayerIDs for BTA */
     90 #define BTTRC_ID_BTA_ACC                   55         /* Advanced Camera Client */
     91 #define BTTRC_ID_BTA_AG                    56         /* audio gateway */
     92 #define BTTRC_ID_BTA_AV                    57         /* Advanced audio */
     93 #define BTTRC_ID_BTA_BIC                   58         /* Basic Imaging Client */
     94 #define BTTRC_ID_BTA_BIS                   59         /* Basic Imaging Server */
     95 #define BTTRC_ID_BTA_BP                    60         /* Basic Printing Client */
     96 #define BTTRC_ID_BTA_CG                    61
     97 #define BTTRC_ID_BTA_CT                    62         /* cordless telephony terminal */
     98 #define BTTRC_ID_BTA_DG                    63         /* data gateway */
     99 #define BTTRC_ID_BTA_DM                    64         /* device manager */
    100 #define BTTRC_ID_BTA_DM_SRCH               65         /* device manager search */
    101 #define BTTRC_ID_BTA_DM_SEC                66         /* device manager security */
    102 #define BTTRC_ID_BTA_FM                    67
    103 #define BTTRC_ID_BTA_FTC                   68         /* file transfer client */
    104 #define BTTRC_ID_BTA_FTS                   69         /* file transfer server */
    105 #define BTTRC_ID_BTA_HIDH                  70
    106 #define BTTRC_ID_BTA_HIDD                  71
    107 #define BTTRC_ID_BTA_JV                    72
    108 #define BTTRC_ID_BTA_OPC                   73         /* object push client */
    109 #define BTTRC_ID_BTA_OPS                   74         /* object push server */
    110 #define BTTRC_ID_BTA_PAN                   75         /* Personal Area Networking */
    111 #define BTTRC_ID_BTA_PR                    76         /* Printer client */
    112 #define BTTRC_ID_BTA_SC                    77         /* SIM Card Access server */
    113 #define BTTRC_ID_BTA_SS                    78         /* synchronization server */
    114 #define BTTRC_ID_BTA_SYS                   79         /* system manager */
    115 #define BTTRC_ID_AVDT_SCB                  80         /* avdt scb */
    116 #define BTTRC_ID_AVDT_CCB                  81         /* avdt ccb */
    117 
    118 /* LayerIDs for BT APP */
    119 #define BTTRC_ID_BTAPP                     82
    120 #define BTTRC_ID_MAX_ID                    BTTRC_ID_BTAPP
    121 #define BTTRC_ID_ALL_LAYERS                0xFF       /* all trace layers */
    122 typedef UINT8 tBTTRC_LAYER_ID;
    123 
    124 /* Trace type definitions. Note that these are mutually exclusive in a trace. This
    125 means that any trace can be either error,warning,api,event or dbg */
    126 #if (BTU_STACK_LITE_ENABLED == TRUE)
    127 #define BTTRC_TYPE_ERROR                   0x81
    128 #define BTTRC_TYPE_WARNING                 0x82
    129 #define BTTRC_TYPE_API                     0x84
    130 #define BTTRC_TYPE_EVENT                   0x88
    131 #define BTTRC_TYPE_ACTION                  0x90
    132 #define BTTRC_TYPE_DBG                     0xA0
    133 #else
    134 #define BTTRC_TYPE_ERROR                   0x01       /* Traces for error situation */
    135 #define BTTRC_TYPE_WARNING	               0x02       /* Traces for warning situation */
    136 #define BTTRC_TYPE_API                     0x04       /* Traces for API */
    137 #define BTTRC_TYPE_EVENT                   0x08       /* Traces for EVENT */
    138 #define BTTRC_TYPE_ACTION                  0x10       /* Traces for Action functions */
    139 #define BTTRC_TYPE_DBG                     0x20       /* Traces for debugging purpose */
    140 #endif
    141 typedef UINT8 tBTTRC_TYPE;
    142 
    143 /* Masks to identify the stack that originated the trace */
    144 #define BTTRC_TRACE_LITE                   0x80       /* MM Lite stack */
    145 #define BTTRC_TRACE_EMBD                   0x40       /* Embedded host stack */
    146 
    147 /* Parameter datatypes used in Trace APIs */
    148 #define BTTRC_PARAM_UINT8                  1
    149 #define BTTRC_PARAM_UINT16                 2
    150 #define BTTRC_PARAM_UINT32                 3
    151 typedef UINT8 tBTTRC_PARAM_TYPE;
    152 
    153 /* Special token definitions */
    154 #define BTTRC_TOKEN_SM_STATE               0xFFFF     /* Token indicating the State of a State m/c */
    155 
    156 
    157 #ifdef __cplusplus
    158 extern "C" {
    159 #endif
    160 
    161 /* External declaration for appl_trace_level here to avoid to add the declaration in all the files using APPL_TRACExxx macros */
    162 extern UINT8 appl_trace_level ;
    163 
    164 /* Prototype for message logging function. */
    165 EXPORT_API extern void LogMsg (UINT32 trace_set_mask, const char *fmt_str, ...);
    166 extern void LogMsg_0 (UINT32 trace_set_mask, const char *p_str);
    167 extern void LogMsg_1 (UINT32 trace_set_mask, const char *fmt_str, UINT32 p1);
    168 extern void LogMsg_2 (UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2);
    169 extern void LogMsg_3 (UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2,
    170                       UINT32 p3);
    171 extern void LogMsg_4 (UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2,
    172                       UINT32 p3, UINT32 p4);
    173 extern void LogMsg_5 (UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2,
    174                       UINT32 p3, UINT32 p4, UINT32 p5);
    175 extern void LogMsg_6 (UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2,
    176                       UINT32 p3, UINT32 p4, UINT32 p5, UINT32 p6);
    177 
    178 /* Prototype for stack tracing function. */
    179 EXPORT_API extern void BTTRC_StackTrace0(tBTTRC_LAYER_ID layer_id,
    180                                    tBTTRC_TYPE type,
    181                                    UINT16 token);
    182 EXPORT_API extern void BTTRC_StackTrace1(tBTTRC_LAYER_ID layer_id,
    183                                    tBTTRC_TYPE type,
    184                                    UINT16 token,
    185                                    tBTTRC_PARAM_TYPE p1_type, UINT32 p1_val);
    186 EXPORT_API extern void BTTRC_StackTrace2(tBTTRC_LAYER_ID layer_id,
    187                                    tBTTRC_TYPE type,
    188                                    UINT16 token,
    189                                    tBTTRC_PARAM_TYPE p1_type, UINT32 p1_val,
    190                                    tBTTRC_PARAM_TYPE p2_type, UINT32 p2_val);
    191 EXPORT_API extern void BTTRC_StackTrace3(tBTTRC_LAYER_ID layer_id,
    192                                    tBTTRC_TYPE type,
    193                                    UINT16 token,
    194                                    tBTTRC_PARAM_TYPE p1_type, UINT32 p1_val,
    195                                    tBTTRC_PARAM_TYPE p2_type, UINT32 p2_val,
    196                                    tBTTRC_PARAM_TYPE p3_type, UINT32 p3_val);
    197 EXPORT_API extern void BTTRC_StackTrace4(tBTTRC_LAYER_ID layer_id,
    198                                    tBTTRC_TYPE type,
    199                                    UINT16 token,
    200                                    tBTTRC_PARAM_TYPE p1_type, UINT32 p1_val,
    201                                    tBTTRC_PARAM_TYPE p2_type, UINT32 p2_val,
    202                                    tBTTRC_PARAM_TYPE p3_type, UINT32 p3_val,
    203                                    tBTTRC_PARAM_TYPE p4_type, UINT32 p4_val);
    204 EXPORT_API extern void BTTRC_StackTrace5(tBTTRC_LAYER_ID layer_id,
    205                                    tBTTRC_TYPE type,
    206                                    UINT16 token,
    207                                    tBTTRC_PARAM_TYPE p1_type, UINT32 p1_val,
    208                                    tBTTRC_PARAM_TYPE p2_type, UINT32 p2_val,
    209                                    tBTTRC_PARAM_TYPE p3_type, UINT32 p3_val,
    210                                    tBTTRC_PARAM_TYPE p4_type, UINT32 p4_val,
    211                                    tBTTRC_PARAM_TYPE p5_type, UINT32 p5_val);
    212 EXPORT_API extern void BTTRC_StackTrace6(tBTTRC_LAYER_ID layer_id,
    213                                    tBTTRC_TYPE type,
    214                                    UINT16 token,
    215                                    tBTTRC_PARAM_TYPE p1_type, UINT32 p1_val,
    216                                    tBTTRC_PARAM_TYPE p2_type, UINT32 p2_val,
    217                                    tBTTRC_PARAM_TYPE p3_type, UINT32 p3_val,
    218                                    tBTTRC_PARAM_TYPE p4_type, UINT32 p4_val,
    219                                    tBTTRC_PARAM_TYPE p5_type, UINT32 p5_val,
    220                                    tBTTRC_PARAM_TYPE p6_type, UINT32 p6_val);
    221 
    222 #ifdef __cplusplus
    223 }
    224 #endif
    225 
    226 /******************************************************************************
    227 **
    228 ** Trace configurable parameters
    229 **
    230 ******************************************************************************/
    231 
    232 /* Enables or disables verbose trace information. */
    233 #ifndef BT_TRACE_VERBOSE
    234 #define BT_TRACE_VERBOSE    FALSE
    235 #endif
    236 
    237 /* Enables or disables all trace messages. */
    238 #ifndef BT_USE_TRACES
    239 #define BT_USE_TRACES       TRUE
    240 #endif
    241 
    242 /* Enables or disables protocol trace information. */
    243 #ifndef BT_TRACE_PROTOCOL
    244 #define BT_TRACE_PROTOCOL   FALSE  /* Android requires FALSE */
    245 #endif
    246 
    247 /******************************************************************************
    248 **
    249 ** Trace Levels
    250 **
    251 ** The following values may be used for different levels:
    252 **      BT_TRACE_LEVEL_NONE    0        * No trace messages to be generated
    253 **      BT_TRACE_LEVEL_ERROR   1        * Error condition trace messages
    254 **      BT_TRACE_LEVEL_WARNING 2        * Warning condition trace messages
    255 **      BT_TRACE_LEVEL_API     3        * API traces
    256 **      BT_TRACE_LEVEL_EVENT   4        * Debug messages for events
    257 **      BT_TRACE_LEVEL_DEBUG   5        * Debug messages (general)
    258 ******************************************************************************/
    259 
    260 /* Core Stack default trace levels */
    261 #ifndef HCI_INITIAL_TRACE_LEVEL
    262 #define HCI_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    263 #endif
    264 
    265 #ifndef BTM_INITIAL_TRACE_LEVEL
    266 #define BTM_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    267 #endif
    268 
    269 #ifndef L2CAP_INITIAL_TRACE_LEVEL
    270 #define L2CAP_INITIAL_TRACE_LEVEL           BT_TRACE_LEVEL_DEBUG
    271 #endif
    272 
    273 #ifndef LLCP_INITIAL_TRACE_LEVEL
    274 #define LLCP_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_DEBUG
    275 #endif
    276 
    277 #ifndef AMP_INITIAL_TRACE_LEVEL
    278 #define AMP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    279 #endif
    280 
    281 #ifndef RFCOMM_INITIAL_TRACE_LEVEL
    282 #define RFCOMM_INITIAL_TRACE_LEVEL          BT_TRACE_LEVEL_DEBUG
    283 #endif
    284 
    285 #ifndef OBX_INITIAL_TRACE_LEVEL
    286 #define OBX_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    287 #endif
    288 
    289 #ifndef SDP_INITIAL_TRACE_LEVEL
    290 #define SDP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    291 #endif
    292 
    293 #ifndef TCS_INITIAL_TRACE_LEVEL
    294 #define TCS_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    295 #endif
    296 
    297 /* Profile default trace levels */
    298 #ifndef DUN_INITIAL_TRACE_LEVEL
    299 #define DUN_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    300 #endif
    301 
    302 #ifndef GAP_INITIAL_TRACE_LEVEL
    303 #define GAP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    304 #endif
    305 
    306 #ifndef GOEP_INITIAL_TRACE_LEVEL
    307 #define GOEP_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_DEBUG
    308 #endif
    309 
    310 #ifndef HSP2_INITIAL_TRACE_LEVEL
    311 #define HSP2_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_DEBUG
    312 #endif
    313 
    314 #ifndef SPP_INITIAL_TRACE_LEVEL
    315 #define SPP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    316 #endif
    317 
    318 #ifndef ICP_INITIAL_TRACE_LEVEL
    319 #define ICP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    320 #endif
    321 
    322 #ifndef CTP_INITIAL_TRACE_LEVEL
    323 #define CTP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    324 #endif
    325 
    326 #ifndef HCRP_INITIAL_TRACE_LEVEL
    327 #define HCRP_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_DEBUG
    328 #endif
    329 
    330 #ifndef HCRPM_INITIAL_TRACE_LEVEL
    331 #define HCRPM_INITIAL_TRACE_LEVEL           BT_TRACE_LEVEL_DEBUG
    332 #endif
    333 
    334 #ifndef BPP_INITIAL_TRACE_LEVEL
    335 #define BPP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    336 #endif
    337 
    338 #ifndef BIP_INITIAL_TRACE_LEVEL
    339 #define BIP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    340 #endif
    341 
    342 #ifndef BNEP_INITIAL_TRACE_LEVEL
    343 #define BNEP_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_DEBUG
    344 #endif
    345 
    346 #ifndef PAN_INITIAL_TRACE_LEVEL
    347 #define PAN_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    348 #endif
    349 
    350 #ifndef SAP_INITIAL_TRACE_LEVEL
    351 #define SAP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    352 #endif
    353 
    354 #ifndef FTP_INITIAL_TRACE_LEVEL
    355 #define FTP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    356 #endif
    357 
    358 #ifndef OPP_INITIAL_TRACE_LEVEL
    359 #define OPP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    360 #endif
    361 
    362 #ifndef HFP_INITIAL_TRACE_LEVEL
    363 #define HFP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    364 #endif
    365 
    366 #ifndef A2D_INITIAL_TRACE_LEVEL
    367 #define A2D_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    368 #endif
    369 
    370 #ifndef VDP_INITIAL_TRACE_LEVEL
    371 #define VDP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    372 #endif
    373 
    374 #ifndef AVDT_INITIAL_TRACE_LEVEL
    375 #define AVDT_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_DEBUG
    376 #endif
    377 
    378 #ifndef AVCT_INITIAL_TRACE_LEVEL
    379 #define AVCT_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_DEBUG
    380 #endif
    381 
    382 #ifndef AVRC_INITIAL_TRACE_LEVEL
    383 #define AVRC_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_DEBUG
    384 #endif
    385 
    386 #ifndef MCA_INITIAL_TRACE_LEVEL
    387 #define MCA_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    388 #endif
    389 
    390 #ifndef HID_INITIAL_TRACE_LEVEL
    391 #define HID_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    392 #endif
    393 
    394 /* Application and other default trace levels */
    395 #ifndef RPC_INITIAL_TRACE_LEVEL
    396 #define RPC_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    397 #endif
    398 
    399 #ifndef APPL_INITIAL_TRACE_LEVEL
    400 #define APPL_INITIAL_TRACE_LEVEL            BT_TRACE_LEVEL_DEBUG
    401 #endif
    402 
    403 #ifndef BT_TRACE_APPL
    404 #define BT_TRACE_APPL   BT_USE_TRACES
    405 #endif
    406 
    407 #ifndef NFC_INITIAL_TRACE_LEVEL
    408 #define NFC_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    409 #endif
    410 
    411 #ifndef GATT_INITIAL_TRACE_LEVEL
    412 #define GATT_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    413 #endif
    414 
    415 #ifndef SMP_INITIAL_TRACE_LEVEL
    416 #define SMP_INITIAL_TRACE_LEVEL             BT_TRACE_LEVEL_DEBUG
    417 #endif
    418 
    419 
    420 #if (BTTRC_INCLUDED == TRUE)
    421 /***************************************************************************************/
    422 /* BTTRC MACROS */
    423 
    424 #define BTTRC_EVENT(lid, event, state)   \
    425             {BTTRC_StackTrace1(lid, BTTRC_TYPE_EVENT, event, BTTRC_PARAM_UINT8, state);}
    426 #define BTTRC_ACTION(lid, action)  \
    427             {BTTRC_StackTrace0(lid, BTTRC_TYPE_ACTION, action);}
    428 #define BTTRC_STATE(lid, state)   \
    429             {BTTRC_StackTrace1(lid, BTTRC_TYPE_EVENT, BTTRC_TOKEN_SM_STATE, BTTRC_PARAM_UINT8, state);}
    430 
    431 #define BTTRC_API0(lid, api)  \
    432             {BTTRC_StackTrace0(lid, BTTRC_TYPE_API, api);}
    433 #define BTTRC_API1(lid, api, p1_t,p1_v)  \
    434             {BTTRC_StackTrace1(lid, BTTRC_TYPE_API, api, p1_t,p1_v);}
    435 #define BTTRC_API2(lid, api, p1_t,p1_v,p2_t,p2_v)  \
    436             {BTTRC_StackTrace2(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v);}
    437 #define BTTRC_API3(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)  \
    438             {BTTRC_StackTrace3(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v);}
    439 #define BTTRC_API4(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)  \
    440             {BTTRC_StackTrace4(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v);}
    441 #define BTTRC_API5(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)  \
    442             {BTTRC_StackTrace5(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v);}
    443 #define BTTRC_API6(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)  \
    444             {BTTRC_StackTrace6(lid, BTTRC_TYPE_API, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v);}
    445 
    446 
    447 #define BTTRC_DBG0(lid, dbg)  \
    448             {BTTRC_StackTrace0(lid, BTTRC_TYPE_DBG, dbg);}
    449 #define BTTRC_DBG1(lid, dbg, p1_t,p1_v)  \
    450             {BTTRC_StackTrace1(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v);}
    451 #define BTTRC_DBG2(lid, dbg, p1_t,p1_v,p2_t,p2_v)  \
    452             {BTTRC_StackTrace2(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v);}
    453 #define BTTRC_DBG3(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)  \
    454             {BTTRC_StackTrace3(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v);}
    455 #define BTTRC_DBG4(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)  \
    456             {BTTRC_StackTrace4(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v);}
    457 #define BTTRC_DBG5(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)  \
    458             {BTTRC_StackTrace5(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v);}
    459 #define BTTRC_DBG6(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)  \
    460             {BTTRC_StackTrace6(lid, BTTRC_TYPE_DBG, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v);}
    461 
    462 /***************************************************************************************/
    463 /*AVDT MACROS */
    464 
    465 #define BTTRC_AVDT_API0(api)   \
    466         BTTRC_API0(BTTRC_ID_STK_AVDT, api)
    467 #define BTTRC_AVDT_API1(api, p1_t, p1_v) \
    468         BTTRC_API1(BTTRC_ID_STK_AVDT, api, p1_t, p1_v)
    469 #define BTTRC_AVDT_API2(api, p1_t, p1_v, p2_t, p2_v) \
    470         BTTRC_API2(BTTRC_ID_STK_AVDT, api, p1_t, p1_v, p2_t, p2_v)
    471 /***************************************************************************************/
    472 /*AVDT_SCB MACROS */
    473 
    474 #define BTTRC_AVDT_SCB_EVENT(event, state)   \
    475             BTTRC_EVENT(BTTRC_ID_AVDT_SCB, event, state)
    476 #define BTTRC_AVDT_SCB_ACTION(action)  \
    477             BTTRC_ACTION(BTTRC_ID_AVDT_SCB, action)
    478 #define BTTRC_AVDT_SCB_STATE(next_state)   \
    479             BTTRC_STATE(BTTRC_ID_AVDT_SCB, next_state)
    480 
    481 #define BTTRC_AVDT_SCB_DBG0(dbg)  \
    482             BTTRC_DBG0(BTTRC_ID_AVDT_SCB, dbg)
    483 #define BTTRC_AVDT_SCB_DBG1(dbg, p1_t,p1_v)  \
    484             BTTRC_DBG1(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v)
    485 #define BTTRC_AVDT_SCB_DBG2(dbg, p1_t,p1_v,p2_t,p2_v)  \
    486             BTTRC_DBG2(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v)
    487 #define BTTRC_AVDT_SCB_DBG3(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)  \
    488             BTTRC_DBG3(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)
    489 #define BTTRC_AVDT_SCB_DBG4(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)  \
    490             BTTRC_DBG4(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)
    491 #define BTTRC_AVDT_SCB_DBG5(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)  \
    492             BTTRC_DBG5(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)
    493 #define BTTRC_AVDT_SCB_DBG6(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)  \
    494             BTTRC_DBG6(BTTRC_ID_AVDT_SCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)
    495 /***************************************************************************************/
    496 /*AVDT_CCB MACROS */
    497 
    498 #define BTTRC_AVDT_CCB_EVENT(event, state)   \
    499             BTTRC_EVENT(BTTRC_ID_AVDT_CCB, event, state)
    500 #define BTTRC_AVDT_CCB_ACTION(action)  \
    501             BTTRC_ACTION(BTTRC_ID_AVDT_CCB, action)
    502 #define BTTRC_AVDT_CCB_STATE(next_state)   \
    503             BTTRC_STATE(BTTRC_ID_AVDT_CCB, next_state)
    504 
    505 #define BTTRC_AVDT_CCB_DBG0(dbg)  \
    506             BTTRC_DBG0(BTTRC_ID_AVDT_CCB, dbg)
    507 #define BTTRC_AVDT_CCB_DBG1(dbg, p1_t,p1_v)  \
    508             BTTRC_DBG1(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v)
    509 #define BTTRC_AVDT_CCB_DBG2(dbg, p1_t,p1_v,p2_t,p2_v)  \
    510             BTTRC_DBG2(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v)
    511 #define BTTRC_AVDT_CCB_DBG3(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)  \
    512             BTTRC_DBG3(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)
    513 #define BTTRC_AVDT_CCB_DBG4(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)  \
    514             BTTRC_DBG4(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)
    515 #define BTTRC_AVDT_CCB_DBG5(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)  \
    516             BTTRC_DBG5(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)
    517 #define BTTRC_AVDT_CCB_DBG6(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)  \
    518             BTTRC_DBG6(BTTRC_ID_AVDT_CCB, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)
    519 /***************************************************************************************/
    520 
    521 #else /*BTTRC_INCLUDED*/
    522 
    523 /***************************************************************************************/
    524 /* BTTRC MACROS */
    525 
    526 #define BTTRC_EVENT(lid, event, state)
    527 #define BTTRC_ACTION(lid, action)
    528 #define BTTRC_STATE(lid, state)
    529 
    530 #define BTTRC_API0(lid, api)
    531 #define BTTRC_API1(lid, api, p1_t, p1_v)
    532 #define BTTRC_API2(lid, api, p1_t, p1_v, p2_t, p2_v)
    533 #define BTTRC_API3(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)
    534 #define BTTRC_API4(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)
    535 #define BTTRC_API5(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)
    536 #define BTTRC_API6(lid, api, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)
    537 
    538 
    539 #define BTTRC_DBG0(lid, dbg)
    540 #define BTTRC_DBG1(lid, dbg, p1_t,p1_v)
    541 #define BTTRC_DBG2(lid, dbg, p1_t,p1_v,p2_t,p2_v)
    542 #define BTTRC_DBG3(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)
    543 #define BTTRC_DBG4(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)
    544 #define BTTRC_DBG5(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)
    545 #define BTTRC_DBG6(lid, dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)
    546 
    547 /***************************************************************************************/
    548 /*AVDT MACROS */
    549 #define BTTRC_AVDT_API0(api)
    550 #define BTTRC_AVDT_API1(api, p1_t,p1_v)
    551 #define BTTRC_AVDT_API2(api, p1_t,p1_v,p2_t,p2_v)
    552 /***************************************************************************************/
    553 /*AVDT_SCB MACROS */
    554 
    555 #define BTTRC_AVDT_SCB_EVENT(event, state)
    556 #define BTTRC_AVDT_SCB_ACTION(action)
    557 #define BTTRC_AVDT_SCB_STATE(next_state)
    558 
    559 #define BTTRC_AVDT_SCB_DBG0(dbg)
    560 #define BTTRC_AVDT_SCB_DBG1(dbg, p1_t,p1_v)
    561 #define BTTRC_AVDT_SCB_DBG2(dbg, p1_t,p1_v,p2_t,p2_v)
    562 #define BTTRC_AVDT_SCB_DBG3(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)
    563 #define BTTRC_AVDT_SCB_DBG4(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)
    564 #define BTTRC_AVDT_SCB_DBG5(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)
    565 #define BTTRC_AVDT_SCB_DBG6(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)
    566 
    567 /***************************************************************************************/
    568 /*AVDT_CCB MACROS */
    569 
    570 #define BTTRC_AVDT_CCB_EVENT(event, state)
    571 #define BTTRC_AVDT_CCB_ACTION(action)
    572 #define BTTRC_AVDT_CCB_STATE(next_state)
    573 
    574 #define BTTRC_AVDT_CCB_DBG0(dbg)
    575 #define BTTRC_AVDT_CCB_DBG1(dbg, p1_t,p1_v)
    576 #define BTTRC_AVDT_CCB_DBG2(dbg, p1_t,p1_v,p2_t,p2_v)
    577 #define BTTRC_AVDT_CCB_DBG3(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v)
    578 #define BTTRC_AVDT_CCB_DBG4(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v)
    579 #define BTTRC_AVDT_CCB_DBG5(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v)
    580 #define BTTRC_AVDT_CCB_DBG6(dbg, p1_t,p1_v,p2_t,p2_v,p3_t,p3_v,p4_t,p4_v,p5_t,p5_v,p6_t,p6_v)
    581 
    582 /***************************************************************************************/
    583 
    584 #endif /*BTTRC_INCLUDED*/
    585 
    586 
    587 #if (BT_USE_TRACES == TRUE)
    588 
    589 #define BT_TRACE_0(l,t,m)                           LogMsg_0((TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | (t)),(m))
    590 #define BT_TRACE_1(l,t,m,p1)                        LogMsg_1(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | (t),(m),(UINT32)(p1))
    591 #define BT_TRACE_2(l,t,m,p1,p2)                     LogMsg_2(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | (t),(m),(UINT32)(p1),   \
    592                                                         (UINT32)(p2))
    593 #define BT_TRACE_3(l,t,m,p1,p2,p3)                  LogMsg_3(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | (t),(m),(UINT32)(p1),   \
    594                                                         (UINT32)(p2),(UINT32)(p3))
    595 #define BT_TRACE_4(l,t,m,p1,p2,p3,p4)               LogMsg_4(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | (t),(m),(UINT32)(p1),   \
    596                                                         (UINT32)(p2),(UINT32)(p3),(UINT32)(p4))
    597 #define BT_TRACE_5(l,t,m,p1,p2,p3,p4,p5)            LogMsg_5(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | (t),(m),(UINT32)(p1),   \
    598                                                         (UINT32)(p2),(UINT32)(p3),(UINT32)(p4), \
    599                                                         (UINT32)(p5))
    600 #define BT_TRACE_6(l,t,m,p1,p2,p3,p4,p5,p6)         LogMsg_6(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | (t),(m),(UINT32)(p1),   \
    601                                                         (UINT32)(p2),(UINT32)(p3),(UINT32)(p4), \
    602                                                         (UINT32)(p5),(UINT32)(p6))
    603 
    604 #define BT_ERROR_TRACE_0(l,m)                     LogMsg_0(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | TRACE_TYPE_ERROR,(m))
    605 #define BT_ERROR_TRACE_1(l,m,p1)                  LogMsg_1(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | TRACE_TYPE_ERROR,(m),(UINT32)(p1))
    606 #define BT_ERROR_TRACE_2(l,m,p1,p2)               LogMsg_2(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | TRACE_TYPE_ERROR,(m),(UINT32)(p1),(UINT32)(p2))
    607 #define BT_ERROR_TRACE_3(l,m,p1,p2,p3)            LogMsg_3(TRACE_CTRL_GENERAL | (l) | TRACE_ORG_STACK | TRACE_TYPE_ERROR,(m),(UINT32)(p1),(UINT32)(p2),(UINT32)(p3))
    608 
    609 /* Define tracing for the HCI unit
    610 */
    611 #define HCI_TRACE_ERROR0(m)                     {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, m);}
    612 #define HCI_TRACE_ERROR1(m,p1)                  {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, m,p1);}
    613 #define HCI_TRACE_ERROR2(m,p1,p2)               {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, m,p1,p2);}
    614 #define HCI_TRACE_ERROR3(m,p1,p2,p3)            {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, m,p1,p2,p3);}
    615 #define HCI_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
    616 #define HCI_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
    617 #define HCI_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_HCI, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
    618 
    619 #define HCI_TRACE_WARNING0(m)                   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, m);}
    620 #define HCI_TRACE_WARNING1(m,p1)                {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, m,p1);}
    621 #define HCI_TRACE_WARNING2(m,p1,p2)             {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, m,p1,p2);}
    622 #define HCI_TRACE_WARNING3(m,p1,p2,p3)          {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, m,p1,p2,p3);}
    623 #define HCI_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
    624 #define HCI_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
    625 #define HCI_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (btu_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_HCI, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
    626 
    627 #define HCI_TRACE_EVENT0(m)                     {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, m);}
    628 #define HCI_TRACE_EVENT1(m,p1)                  {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, m, p1);}
    629 #define HCI_TRACE_EVENT2(m,p1,p2)               {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, m,p1,p2);}
    630 #define HCI_TRACE_EVENT3(m,p1,p2,p3)            {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, m,p1,p2,p3);}
    631 #define HCI_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
    632 #define HCI_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
    633 #define HCI_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
    634 
    635 #define HCI_TRACE_DEBUG0(m)                     {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, m);}
    636 #define HCI_TRACE_DEBUG1(m,p1)                  {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, m,p1);}
    637 #define HCI_TRACE_DEBUG2(m,p1,p2)               {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, m,p1,p2);}
    638 #define HCI_TRACE_DEBUG3(m,p1,p2,p3)            {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
    639 #define HCI_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
    640 #define HCI_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
    641 #define HCI_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (btu_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_HCI, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
    642 
    643 
    644 /* Define tracing for BTM
    645 */
    646 #define BTM_TRACE_ERROR0(m)                     {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, m);}
    647 #define BTM_TRACE_ERROR1(m,p1)                  {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, m,p1);}
    648 #define BTM_TRACE_ERROR2(m,p1,p2)               {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, m,p1,p2);}
    649 #define BTM_TRACE_ERROR3(m,p1,p2,p3)            {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, m,p1,p2,p3);}
    650 #define BTM_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
    651 #define BTM_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
    652 #define BTM_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_BTM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
    653 
    654 #define BTM_TRACE_WARNING0(m)                   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, m);}
    655 #define BTM_TRACE_WARNING1(m,p1)                {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, m,p1);}
    656 #define BTM_TRACE_WARNING2(m,p1,p2)             {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, m,p1,p2);}
    657 #define BTM_TRACE_WARNING3(m,p1,p2,p3)          {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, m,p1,p2,p3);}
    658 #define BTM_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
    659 #define BTM_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
    660 #define BTM_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_BTM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
    661 
    662 #define BTM_TRACE_API0(m)                       {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_BTM, TRACE_TYPE_API, m);}
    663 #define BTM_TRACE_API1(m,p1)                    {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_BTM, TRACE_TYPE_API, m, p1);}
    664 #define BTM_TRACE_API2(m,p1,p2)                 {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_BTM, TRACE_TYPE_API, m,p1,p2);}
    665 #define BTM_TRACE_API3(m,p1,p2,p3)              {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_BTM, TRACE_TYPE_API, m,p1,p2,p3);}
    666 #define BTM_TRACE_API4(m,p1,p2,p3,p4)           {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_BTM, TRACE_TYPE_API, m,p1,p2,p3,p4);}
    667 #define BTM_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_BTM, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
    668 #define BTM_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (btm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_BTM, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
    669 
    670 #define BTM_TRACE_EVENT0(m)                     {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, m);}
    671 #define BTM_TRACE_EVENT1(m,p1)                  {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, m, p1);}
    672 #define BTM_TRACE_EVENT2(m,p1,p2)               {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, m,p1,p2);}
    673 #define BTM_TRACE_EVENT3(m,p1,p2,p3)            {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, m,p1,p2,p3);}
    674 #define BTM_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
    675 #define BTM_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
    676 #define BTM_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_BTM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
    677 
    678 #define BTM_TRACE_DEBUG0(m)                     {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, m);}
    679 #define BTM_TRACE_DEBUG1(m,p1)                  {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, m,p1);}
    680 #define BTM_TRACE_DEBUG2(m,p1,p2)               {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, m,p1,p2);}
    681 #define BTM_TRACE_DEBUG3(m,p1,p2,p3)            {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
    682 #define BTM_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
    683 #define BTM_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
    684 #define BTM_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_BTM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
    685 
    686 
    687 /* Define tracing for the L2CAP unit
    688 */
    689 #define L2CAP_TRACE_ERROR0(m)                     {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, m);}
    690 #define L2CAP_TRACE_ERROR1(m,p1)                  {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, m,p1);}
    691 #define L2CAP_TRACE_ERROR2(m,p1,p2)               {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, m,p1,p2);}
    692 #define L2CAP_TRACE_ERROR3(m,p1,p2,p3)            {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
    693 #define L2CAP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
    694 #define L2CAP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
    695 #define L2CAP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_L2CAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
    696 
    697 #define L2CAP_TRACE_WARNING0(m)                   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, m);}
    698 #define L2CAP_TRACE_WARNING1(m,p1)                {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, m,p1);}
    699 #define L2CAP_TRACE_WARNING2(m,p1,p2)             {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, m,p1,p2);}
    700 #define L2CAP_TRACE_WARNING3(m,p1,p2,p3)          {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
    701 #define L2CAP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
    702 #define L2CAP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
    703 #define L2CAP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_L2CAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
    704 
    705 #define L2CAP_TRACE_API0(m)                       {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_L2CAP, TRACE_TYPE_API, m);}
    706 #define L2CAP_TRACE_API1(m,p1)                    {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_L2CAP, TRACE_TYPE_API, m,p1);}
    707 #define L2CAP_TRACE_API2(m,p1,p2)                 {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_L2CAP, TRACE_TYPE_API, m,p1,p2);}
    708 #define L2CAP_TRACE_API3(m,p1,p2,p3)              {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_L2CAP, TRACE_TYPE_API, m,p1,p2,p3);}
    709 #define L2CAP_TRACE_API4(m,p1,p2,p3,p4)           {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_L2CAP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
    710 #define L2CAP_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_L2CAP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
    711 #define L2CAP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_L2CAP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
    712 
    713 #define L2CAP_TRACE_EVENT0(m)                     {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, m);}
    714 #define L2CAP_TRACE_EVENT1(m,p1)                  {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, m, p1);}
    715 #define L2CAP_TRACE_EVENT2(m,p1,p2)               {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, m,p1,p2);}
    716 #define L2CAP_TRACE_EVENT3(m,p1,p2,p3)            {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
    717 #define L2CAP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
    718 #define L2CAP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
    719 #define L2CAP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_L2CAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
    720 
    721 #define L2CAP_TRACE_DEBUG0(m)                     {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, m);}
    722 #define L2CAP_TRACE_DEBUG1(m,p1)                  {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, m,p1);}
    723 #define L2CAP_TRACE_DEBUG2(m,p1,p2)               {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, m,p1,p2);}
    724 #define L2CAP_TRACE_DEBUG3(m,p1,p2,p3)            {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
    725 #define L2CAP_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
    726 #define L2CAP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
    727 #define L2CAP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_L2CAP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
    728 
    729 /* Define tracing for the LLCP unit
    730 */
    731 #define LLCP_TRACE_ERROR0(m)                     {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_LLCP, TRACE_TYPE_ERROR, m);}
    732 #define LLCP_TRACE_ERROR1(m,p1)                  {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_LLCP, TRACE_TYPE_ERROR, m,p1);}
    733 #define LLCP_TRACE_ERROR2(m,p1,p2)               {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_LLCP, TRACE_TYPE_ERROR, m,p1,p2);}
    734 #define LLCP_TRACE_ERROR3(m,p1,p2,p3)            {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_LLCP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
    735 #define LLCP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_LLCP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
    736 #define LLCP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_LLCP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
    737 #define LLCP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_LLCP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
    738 
    739 #define LLCP_TRACE_WARNING0(m)                   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_LLCP, TRACE_TYPE_WARNING, m);}
    740 #define LLCP_TRACE_WARNING1(m,p1)                {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_LLCP, TRACE_TYPE_WARNING, m,p1);}
    741 #define LLCP_TRACE_WARNING2(m,p1,p2)             {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_LLCP, TRACE_TYPE_WARNING, m,p1,p2);}
    742 #define LLCP_TRACE_WARNING3(m,p1,p2,p3)          {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_LLCP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
    743 #define LLCP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_LLCP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
    744 #define LLCP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_LLCP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
    745 #define LLCP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_LLCP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
    746 
    747 #define LLCP_TRACE_API0(m)                       {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_LLCP, TRACE_TYPE_API, m);}
    748 #define LLCP_TRACE_API1(m,p1)                    {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_LLCP, TRACE_TYPE_API, m,p1);}
    749 #define LLCP_TRACE_API2(m,p1,p2)                 {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_LLCP, TRACE_TYPE_API, m,p1,p2);}
    750 #define LLCP_TRACE_API3(m,p1,p2,p3)              {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_LLCP, TRACE_TYPE_API, m,p1,p2,p3);}
    751 #define LLCP_TRACE_API4(m,p1,p2,p3,p4)           {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_LLCP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
    752 #define LLCP_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_LLCP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
    753 #define LLCP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_LLCP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
    754 
    755 #define LLCP_TRACE_EVENT0(m)                     {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_LLCP, TRACE_TYPE_EVENT, m);}
    756 #define LLCP_TRACE_EVENT1(m,p1)                  {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_LLCP, TRACE_TYPE_EVENT, m, p1);}
    757 #define LLCP_TRACE_EVENT2(m,p1,p2)               {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_LLCP, TRACE_TYPE_EVENT, m,p1,p2);}
    758 #define LLCP_TRACE_EVENT3(m,p1,p2,p3)            {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_LLCP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
    759 #define LLCP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_LLCP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
    760 #define LLCP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_LLCP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
    761 #define LLCP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_LLCP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
    762 
    763 #define LLCP_TRACE_DEBUG0(m)                     {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_LLCP, TRACE_TYPE_DEBUG, m);}
    764 #define LLCP_TRACE_DEBUG1(m,p1)                  {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_LLCP, TRACE_TYPE_DEBUG, m,p1);}
    765 #define LLCP_TRACE_DEBUG2(m,p1,p2)               {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_LLCP, TRACE_TYPE_DEBUG, m,p1,p2);}
    766 #define LLCP_TRACE_DEBUG3(m,p1,p2,p3)            {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_LLCP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
    767 #define LLCP_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_LLCP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
    768 #define LLCP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_LLCP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
    769 #define LLCP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (llcp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_LLCP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
    770 
    771 /* Define tracing for the SDP unit
    772 */
    773 #define SDP_TRACE_ERROR0(m)                     {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, m);}
    774 #define SDP_TRACE_ERROR1(m,p1)                  {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, m,p1);}
    775 #define SDP_TRACE_ERROR2(m,p1,p2)               {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, m,p1,p2);}
    776 #define SDP_TRACE_ERROR3(m,p1,p2,p3)            {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
    777 #define SDP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
    778 #define SDP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
    779 #define SDP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_SDP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
    780 
    781 #define SDP_TRACE_WARNING0(m)                   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, m);}
    782 #define SDP_TRACE_WARNING1(m,p1)                {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, m,p1);}
    783 #define SDP_TRACE_WARNING2(m,p1,p2)             {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, m,p1,p2);}
    784 #define SDP_TRACE_WARNING3(m,p1,p2,p3)          {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
    785 #define SDP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
    786 #define SDP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
    787 #define SDP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_SDP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
    788 
    789 #define SDP_TRACE_API0(m)                       {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_SDP, TRACE_TYPE_API, m);}
    790 #define SDP_TRACE_API1(m,p1)                    {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_SDP, TRACE_TYPE_API, m,p1);}
    791 #define SDP_TRACE_API2(m,p1,p2)                 {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_SDP, TRACE_TYPE_API, m,p1,p2);}
    792 #define SDP_TRACE_API3(m,p1,p2,p3)              {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_SDP, TRACE_TYPE_API, m,p1,p2,p3);}
    793 #define SDP_TRACE_API4(m,p1,p2,p3,p4)           {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_SDP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
    794 #define SDP_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_SDP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
    795 #define SDP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_SDP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
    796 
    797 #define SDP_TRACE_EVENT0(m)                     {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, m);}
    798 #define SDP_TRACE_EVENT1(m,p1)                  {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, m, p1);}
    799 #define SDP_TRACE_EVENT2(m,p1,p2)               {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, m,p1,p2);}
    800 #define SDP_TRACE_EVENT3(m,p1,p2,p3)            {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
    801 #define SDP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
    802 #define SDP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
    803 #define SDP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_SDP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
    804 
    805 #define SDP_TRACE_DEBUG0(m)                     {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, m);}
    806 #define SDP_TRACE_DEBUG1(m,p1)                  {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, m,p1);}
    807 #define SDP_TRACE_DEBUG2(m,p1,p2)               {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, m,p1,p2);}
    808 #define SDP_TRACE_DEBUG3(m,p1,p2,p3)            {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
    809 #define SDP_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
    810 #define SDP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
    811 #define SDP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (sdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_SDP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
    812 
    813 /* Define tracing for the RFCOMM unit
    814 */
    815 #define RFCOMM_TRACE_ERROR0(m)                     {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, m);}
    816 #define RFCOMM_TRACE_ERROR1(m,p1)                  {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, m,p1);}
    817 #define RFCOMM_TRACE_ERROR2(m,p1,p2)               {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, m,p1,p2);}
    818 #define RFCOMM_TRACE_ERROR3(m,p1,p2,p3)            {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, m,p1,p2,p3);}
    819 #define RFCOMM_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
    820 #define RFCOMM_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
    821 #define RFCOMM_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_RFCOMM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
    822 
    823 #define RFCOMM_TRACE_WARNING0(m)                   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, m);}
    824 #define RFCOMM_TRACE_WARNING1(m,p1)                {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, m,p1);}
    825 #define RFCOMM_TRACE_WARNING2(m,p1,p2)             {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, m,p1,p2);}
    826 #define RFCOMM_TRACE_WARNING3(m,p1,p2,p3)          {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, m,p1,p2,p3);}
    827 #define RFCOMM_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
    828 #define RFCOMM_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
    829 #define RFCOMM_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_RFCOMM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
    830 
    831 #define RFCOMM_TRACE_API0(m)                       {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, m);}
    832 #define RFCOMM_TRACE_API1(m,p1)                    {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, m,p1);}
    833 #define RFCOMM_TRACE_API2(m,p1,p2)                 {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, m,p1,p2);}
    834 #define RFCOMM_TRACE_API3(m,p1,p2,p3)              {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, m,p1,p2,p3);}
    835 #define RFCOMM_TRACE_API4(m,p1,p2,p3,p4)           {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, m,p1,p2,p3,p4);}
    836 #define RFCOMM_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
    837 #define RFCOMM_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_RFCOMM, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
    838 
    839 #define RFCOMM_TRACE_EVENT0(m)                     {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, m);}
    840 #define RFCOMM_TRACE_EVENT1(m,p1)                  {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, m, p1);}
    841 #define RFCOMM_TRACE_EVENT2(m,p1,p2)               {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, m,p1,p2);}
    842 #define RFCOMM_TRACE_EVENT3(m,p1,p2,p3)            {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, m,p1,p2,p3);}
    843 #define RFCOMM_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
    844 #define RFCOMM_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
    845 #define RFCOMM_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_RFCOMM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
    846 
    847 #define RFCOMM_TRACE_DEBUG0(m)                     {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, m);}
    848 #define RFCOMM_TRACE_DEBUG1(m,p1)                  {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, m,p1);}
    849 #define RFCOMM_TRACE_DEBUG2(m,p1,p2)               {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, m,p1,p2);}
    850 #define RFCOMM_TRACE_DEBUG3(m,p1,p2,p3)            {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
    851 #define RFCOMM_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
    852 #define RFCOMM_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
    853 #define RFCOMM_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (rfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_RFCOMM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
    854 
    855 /* Define tracing for Serial Port Profile
    856 */
    857 #define SPP_TRACE_ERROR0(m)                     {if (spp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_SPP, TRACE_TYPE_ERROR, m);}
    858 #define SPP_TRACE_ERROR1(m,p1)                  {if (spp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_SPP, TRACE_TYPE_ERROR, m,p1);}
    859 #define SPP_TRACE_ERROR2(m,p1,p2)               {if (spp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_SPP, TRACE_TYPE_ERROR, m,p1,p2);}
    860 #define SPP_TRACE_ERROR3(m,p1,p2,p3)            {if (spp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_SPP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
    861 #define SPP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (spp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_SPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
    862 #define SPP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (spp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_SPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
    863 #define SPP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_SPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
    864 
    865 #define SPP_TRACE_WARNING0(m)                   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_SPP, TRACE_TYPE_WARNING, m);}
    866 #define SPP_TRACE_WARNING1(m,p1)                {if (spp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_SPP, TRACE_TYPE_WARNING, m,p1);}
    867 #define SPP_TRACE_WARNING2(m,p1,p2)             {if (spp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_SPP, TRACE_TYPE_WARNING, m,p1,p2);}
    868 #define SPP_TRACE_WARNING3(m,p1,p2,p3)          {if (spp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_SPP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
    869 #define SPP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (spp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_SPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
    870 #define SPP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (spp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_SPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
    871 #define SPP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (spp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_SPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
    872 
    873 #define SPP_TRACE_EVENT0(m)                     {if (spp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_SPP, TRACE_TYPE_EVENT, m);}
    874 #define SPP_TRACE_EVENT1(m,p1)                  {if (spp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_SPP, TRACE_TYPE_EVENT, m, p1);}
    875 #define SPP_TRACE_EVENT2(m,p1,p2)               {if (spp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_SPP, TRACE_TYPE_EVENT, m,p1,p2);}
    876 #define SPP_TRACE_EVENT3(m,p1,p2,p3)            {if (spp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_SPP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
    877 #define SPP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (spp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_SPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
    878 #define SPP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (spp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_SPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
    879 #define SPP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_SPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
    880 
    881 #define SPP_TRACE_API0(m)                       {if (spp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_SPP, TRACE_TYPE_API, m);}
    882 #define SPP_TRACE_API1(m,p1)                    {if (spp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_SPP, TRACE_TYPE_API, m, p1);}
    883 #define SPP_TRACE_API2(m,p1,p2)                 {if (spp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_SPP, TRACE_TYPE_API, m,p1,p2);}
    884 #define SPP_TRACE_API3(m,p1,p2,p3)              {if (spp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_SPP, TRACE_TYPE_API, m,p1,p2,p3);}
    885 #define SPP_TRACE_API4(m,p1,p2,p3,p4)           {if (spp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_SPP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
    886 #define SPP_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (spp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_SPP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
    887 #define SPP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (spp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_SPP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
    888 
    889 #define SPP_TRACE_DEBUG0(m)                     {if (spp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_SPP, TRACE_TYPE_DEBUG, m);}
    890 #define SPP_TRACE_DEBUG1(m,p1)                  {if (spp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_SPP, TRACE_TYPE_DEBUG, m,p1);}
    891 #define SPP_TRACE_DEBUG2(m,p1,p2)               {if (spp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_SPP, TRACE_TYPE_DEBUG, m,p1,p2);}
    892 #define SPP_TRACE_DEBUG3(m,p1,p2,p3)            {if (spp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_SPP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
    893 #define SPP_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (spp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_SPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
    894 #define SPP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (spp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_SPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
    895 #define SPP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (spp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_SPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
    896 
    897 /* Generic Access Profile traces */
    898 #define GAP_TRACE_ERROR0(m)                     {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, m);}
    899 #define GAP_TRACE_ERROR1(m,p1)                  {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, m, p1);}
    900 #define GAP_TRACE_ERROR2(m,p1,p2)               {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, m,p1,p2);}
    901 #define GAP_TRACE_ERROR3(m,p1,p2,p3)            {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
    902 #define GAP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
    903 #define GAP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
    904 #define GAP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_GAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
    905 
    906 #define GAP_TRACE_EVENT0(m)                     {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, m);}
    907 #define GAP_TRACE_EVENT1(m,p1)                  {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, m, p1);}
    908 #define GAP_TRACE_EVENT2(m,p1,p2)               {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, m,p1,p2);}
    909 #define GAP_TRACE_EVENT3(m,p1,p2,p3)            {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
    910 #define GAP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
    911 #define GAP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
    912 #define GAP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_GAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
    913 
    914 #define GAP_TRACE_API0(m)                       {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_GAP, TRACE_TYPE_API, m);}
    915 #define GAP_TRACE_API1(m,p1)                    {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_GAP, TRACE_TYPE_API, m, p1);}
    916 #define GAP_TRACE_API2(m,p1,p2)                 {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_GAP, TRACE_TYPE_API, m,p1,p2);}
    917 #define GAP_TRACE_API3(m,p1,p2,p3)              {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_GAP, TRACE_TYPE_API, m,p1,p2,p3);}
    918 #define GAP_TRACE_API4(m,p1,p2,p3,p4)           {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_GAP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
    919 #define GAP_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_GAP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
    920 #define GAP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (gap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_GAP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
    921 
    922 #define GAP_TRACE_WARNING0(m)                   {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, m);}
    923 #define GAP_TRACE_WARNING1(m,p1)                {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, m, p1);}
    924 #define GAP_TRACE_WARNING2(m,p1,p2)             {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, m,p1,p2);}
    925 #define GAP_TRACE_WARNING3(m,p1,p2,p3)          {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
    926 #define GAP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
    927 #define GAP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
    928 #define GAP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_GAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
    929 
    930 
    931 /* Define tracing for OBX
    932 */
    933 #define OBX_TRACE_ERROR0(m)                      {if (obx_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_OBEX, TRACE_TYPE_ERROR, m);}
    934 #define OBX_TRACE_ERROR1(m,p1)                   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_OBEX, TRACE_TYPE_ERROR, m,p1);}
    935 #define OBX_TRACE_ERROR2(m,p1,p2)                {if (obx_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_OBEX, TRACE_TYPE_ERROR, m,p1,p2);}
    936 #define OBX_TRACE_ERROR3(m,p1,p2,p3)             {if (obx_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_OBEX, TRACE_TYPE_ERROR, m,p1,p2,p3);}
    937 #define OBX_TRACE_ERROR4(m,p1,p2,p3,p4)          {if (obx_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_OBEX, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
    938 #define OBX_TRACE_ERROR5(m,p1,p2,p3,p4,p5)       {if (obx_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_OBEX, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
    939 #define OBX_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)    {if (obx_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_OBEX, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
    940 
    941 #define OBX_TRACE_WARNING0(m)                    {if (obx_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_OBEX, TRACE_TYPE_WARNING, m);}
    942 #define OBX_TRACE_WARNING1(m,p1)                 {if (obx_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_OBEX, TRACE_TYPE_WARNING, m,p1);}
    943 #define OBX_TRACE_WARNING2(m,p1,p2)              {if (obx_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_OBEX, TRACE_TYPE_WARNING, m,p1,p2);}
    944 #define OBX_TRACE_WARNING3(m,p1,p2,p3)           {if (obx_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_OBEX, TRACE_TYPE_WARNING, m,p1,p2,p3);}
    945 #define OBX_TRACE_WARNING4(m,p1,p2,p3,p4)        {if (obx_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_OBEX, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
    946 #define OBX_TRACE_WARNING5(m,p1,p2,p3,p4,p5)     {if (obx_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_OBEX, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
    947 #define OBX_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)  {if (obx_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_OBEX, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
    948 
    949 #define OBX_TRACE_EVENT0(m)                      {if (obx_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_OBEX, TRACE_TYPE_EVENT, m);}
    950 #define OBX_TRACE_EVENT1(m,p1)                   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_OBEX, TRACE_TYPE_EVENT, m, p1);}
    951 #define OBX_TRACE_EVENT2(m,p1,p2)                {if (obx_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_OBEX, TRACE_TYPE_EVENT, m,p1,p2);}
    952 #define OBX_TRACE_EVENT3(m,p1,p2,p3)             {if (obx_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_OBEX, TRACE_TYPE_EVENT, m,p1,p2,p3);}
    953 #define OBX_TRACE_EVENT4(m,p1,p2,p3,p4)          {if (obx_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_OBEX, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
    954 #define OBX_TRACE_EVENT5(m,p1,p2,p3,p4,p5)       {if (obx_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_OBEX, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
    955 #define OBX_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)    {if (obx_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_OBEX, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
    956 
    957 #define OBX_TRACE_DEBUG0(m)                      {if (obx_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_OBEX, TRACE_TYPE_DEBUG, m);}
    958 #define OBX_TRACE_DEBUG1(m,p1)                   {if (obx_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_OBEX, TRACE_TYPE_DEBUG, m,p1);}
    959 #define OBX_TRACE_DEBUG2(m,p1,p2)                {if (obx_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_OBEX, TRACE_TYPE_DEBUG, m,p1,p2);}
    960 #define OBX_TRACE_DEBUG3(m,p1,p2,p3)             {if (obx_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_OBEX, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
    961 #define OBX_TRACE_DEBUG4(m,p1,p2,p3,p4)          {if (obx_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_OBEX, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
    962 #define OBX_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)       {if (obx_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_OBEX, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
    963 #define OBX_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)    {if (obx_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_OBEX, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
    964 
    965 #define OBX_TRACE_API0(m)                        {if (obx_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_OBEX, TRACE_TYPE_API, m);}
    966 #define OBX_TRACE_API1(m,p1)                     {if (obx_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_OBEX, TRACE_TYPE_API, m, p1);}
    967 #define OBX_TRACE_API2(m,p1,p2)                  {if (obx_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_OBEX, TRACE_TYPE_API, m,p1,p2);}
    968 #define OBX_TRACE_API3(m,p1,p2,p3)               {if (obx_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_OBEX, TRACE_TYPE_API, m,p1,p2,p3);}
    969 #define OBX_TRACE_API4(m,p1,p2,p3,p4)            {if (obx_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_OBEX, TRACE_TYPE_API, m,p1,p2,p3,p4);}
    970 #define OBX_TRACE_API5(m,p1,p2,p3,p4,p5)         {if (obx_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_OBEX, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
    971 #define OBX_TRACE_API6(m,p1,p2,p3,p4,p5,p6)      {if (obx_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_OBEX, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
    972 
    973 /* Define tracing for OBEX application profiles
    974 */
    975 #define GOEP_TRACE_ERROR0(m)                     {if (goep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_GOEP, TRACE_TYPE_ERROR, m);}
    976 #define GOEP_TRACE_ERROR1(m,p1)                  {if (goep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_GOEP, TRACE_TYPE_ERROR, m,p1);}
    977 #define GOEP_TRACE_ERROR2(m,p1,p2)               {if (goep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_GOEP, TRACE_TYPE_ERROR, m,p1,p2);}
    978 #define GOEP_TRACE_ERROR3(m,p1,p2,p3)            {if (goep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_GOEP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
    979 #define GOEP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (goep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_GOEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
    980 #define GOEP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (goep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_GOEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
    981 #define GOEP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_GOEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
    982 
    983 #define GOEP_TRACE_WARNING0(m)                   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_GOEP, TRACE_TYPE_WARNING, m);}
    984 #define GOEP_TRACE_WARNING1(m,p1)                {if (goep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_GOEP, TRACE_TYPE_WARNING, m,p1);}
    985 #define GOEP_TRACE_WARNING2(m,p1,p2)             {if (goep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_GOEP, TRACE_TYPE_WARNING, m,p1,p2);}
    986 #define GOEP_TRACE_WARNING3(m,p1,p2,p3)          {if (goep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_GOEP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
    987 #define GOEP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (goep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_GOEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
    988 #define GOEP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (goep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_GOEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
    989 #define GOEP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (goep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_GOEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
    990 
    991 #define GOEP_TRACE_EVENT0(m)                     {if (goep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_GOEP, TRACE_TYPE_EVENT, m);}
    992 #define GOEP_TRACE_EVENT1(m,p1)                  {if (goep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_GOEP, TRACE_TYPE_EVENT, m, p1);}
    993 #define GOEP_TRACE_EVENT2(m,p1,p2)               {if (goep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_GOEP, TRACE_TYPE_EVENT, m,p1,p2);}
    994 #define GOEP_TRACE_EVENT3(m,p1,p2,p3)            {if (goep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_GOEP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
    995 #define GOEP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (goep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_GOEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
    996 #define GOEP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (goep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_GOEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
    997 #define GOEP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_GOEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
    998 
    999 #define GOEP_TRACE_DEBUG0(m)                     {if (goep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_GOEP, TRACE_TYPE_DEBUG, m);}
   1000 #define GOEP_TRACE_DEBUG1(m,p1)                  {if (goep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_GOEP, TRACE_TYPE_DEBUG, m,p1);}
   1001 #define GOEP_TRACE_DEBUG2(m,p1,p2)               {if (goep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_GOEP, TRACE_TYPE_DEBUG, m,p1,p2);}
   1002 #define GOEP_TRACE_DEBUG3(m,p1,p2,p3)            {if (goep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_GOEP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1003 #define GOEP_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (goep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_GOEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1004 #define GOEP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (goep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_GOEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1005 #define GOEP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (goep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_GOEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1006 
   1007 #define GOEP_TRACE_API0(m)                       {if (goep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_GOEP, TRACE_TYPE_API, m);}
   1008 #define GOEP_TRACE_API1(m,p1)                    {if (goep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_GOEP, TRACE_TYPE_API, m, p1);}
   1009 #define GOEP_TRACE_API2(m,p1,p2)                 {if (goep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_GOEP, TRACE_TYPE_API, m,p1,p2);}
   1010 #define GOEP_TRACE_API3(m,p1,p2,p3)              {if (goep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_GOEP, TRACE_TYPE_API, m,p1,p2,p3);}
   1011 #define GOEP_TRACE_API4(m,p1,p2,p3,p4)           {if (goep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_GOEP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1012 #define GOEP_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (goep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_GOEP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1013 #define GOEP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (goep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_GOEP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1014 
   1015 /* Define tracing for the BPP profile
   1016 */
   1017 #define BPP_TRACE_ERROR0(m)                      {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_BPP, TRACE_TYPE_ERROR, m);}
   1018 #define BPP_TRACE_ERROR1(m,p1)                   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_BPP, TRACE_TYPE_ERROR, m,p1);}
   1019 #define BPP_TRACE_ERROR2(m,p1,p2)                {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_BPP, TRACE_TYPE_ERROR, m,p1,p2);}
   1020 #define BPP_TRACE_ERROR3(m,p1,p2,p3)             {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_BPP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1021 #define BPP_TRACE_ERROR4(m,p1,p2,p3,p4)          {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_BPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1022 #define BPP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)       {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_BPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1023 #define BPP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)    {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_BPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1024 
   1025 #define BPP_TRACE_WARNING0(m)                    {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_BPP, TRACE_TYPE_WARNING, m);}
   1026 #define BPP_TRACE_WARNING1(m,p1)                 {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_BPP, TRACE_TYPE_WARNING, m,p1);}
   1027 #define BPP_TRACE_WARNING2(m,p1,p2)              {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_BPP, TRACE_TYPE_WARNING, m,p1,p2);}
   1028 #define BPP_TRACE_WARNING3(m,p1,p2,p3)           {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_BPP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1029 #define BPP_TRACE_WARNING4(m,p1,p2,p3,p4)        {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_BPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1030 #define BPP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)     {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_BPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1031 #define BPP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)  {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_BPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1032 
   1033 #define BPP_TRACE_EVENT0(m)                      {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_BPP, TRACE_TYPE_EVENT, m);}
   1034 #define BPP_TRACE_EVENT1(m,p1)                   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_BPP, TRACE_TYPE_EVENT, m, p1);}
   1035 #define BPP_TRACE_EVENT2(m,p1,p2)                {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_BPP, TRACE_TYPE_EVENT, m,p1,p2);}
   1036 #define BPP_TRACE_EVENT3(m,p1,p2,p3)             {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_BPP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1037 #define BPP_TRACE_EVENT4(m,p1,p2,p3,p4)          {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_BPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1038 #define BPP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)       {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_BPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1039 #define BPP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)    {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_BPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1040 
   1041 #define BPP_TRACE_DEBUG0(m)                      {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_BPP, TRACE_TYPE_DEBUG, m);}
   1042 #define BPP_TRACE_DEBUG1(m,p1)                   {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_BPP, TRACE_TYPE_DEBUG, m,p1);}
   1043 #define BPP_TRACE_DEBUG2(m,p1,p2)                {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_BPP, TRACE_TYPE_DEBUG, m,p1,p2);}
   1044 #define BPP_TRACE_DEBUG3(m,p1,p2,p3)             {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_BPP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1045 #define BPP_TRACE_DEBUG4(m,p1,p2,p3,p4)          {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_BPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1046 #define BPP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)       {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_BPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1047 #define BPP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)    {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_BPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1048 
   1049 #define BPP_TRACE_API0(m)                        {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_BPP, TRACE_TYPE_API, m);}
   1050 #define BPP_TRACE_API1(m,p1)                     {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_BPP, TRACE_TYPE_API, m, p1);}
   1051 #define BPP_TRACE_API2(m,p1,p2)                  {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_BPP, TRACE_TYPE_API, m,p1,p2);}
   1052 #define BPP_TRACE_API3(m,p1,p2,p3)               {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_BPP, TRACE_TYPE_API, m,p1,p2,p3);}
   1053 #define BPP_TRACE_API4(m,p1,p2,p3,p4)            {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_BPP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1054 #define BPP_TRACE_API5(m,p1,p2,p3,p4,p5)         {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_BPP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1055 #define BPP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)      {if (bpp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_BPP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1056 
   1057 /* Define tracing for the BIP profile
   1058 */
   1059 #define BIP_TRACE_ERROR0(m)                      {if (bip_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_BIP, TRACE_TYPE_ERROR, m);}
   1060 #define BIP_TRACE_ERROR1(m,p1)                   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_BIP, TRACE_TYPE_ERROR, m,p1);}
   1061 #define BIP_TRACE_ERROR2(m,p1,p2)                {if (bip_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_BIP, TRACE_TYPE_ERROR, m,p1,p2);}
   1062 #define BIP_TRACE_ERROR3(m,p1,p2,p3)             {if (bip_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_BIP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1063 #define BIP_TRACE_ERROR4(m,p1,p2,p3,p4)          {if (bip_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_BIP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1064 #define BIP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)       {if (bip_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_BIP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1065 #define BIP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)    {if (bip_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_BIP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1066 
   1067 #define BIP_TRACE_WARNING0(m)                    {if (bip_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_BIP, TRACE_TYPE_WARNING, m);}
   1068 #define BIP_TRACE_WARNING1(m,p1)                 {if (bip_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_BIP, TRACE_TYPE_WARNING, m,p1);}
   1069 #define BIP_TRACE_WARNING2(m,p1,p2)              {if (bip_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_BIP, TRACE_TYPE_WARNING, m,p1,p2);}
   1070 #define BIP_TRACE_WARNING3(m,p1,p2,p3)           {if (bip_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_BIP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1071 #define BIP_TRACE_WARNING4(m,p1,p2,p3,p4)        {if (bip_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_BIP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1072 #define BIP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)     {if (bip_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_BIP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1073 #define BIP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)  {if (bip_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_BIP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1074 
   1075 #define BIP_TRACE_EVENT0(m)                      {if (bip_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_BIP, TRACE_TYPE_EVENT, m);}
   1076 #define BIP_TRACE_EVENT1(m,p1)                   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_BIP, TRACE_TYPE_EVENT, m, p1);}
   1077 #define BIP_TRACE_EVENT2(m,p1,p2)                {if (bip_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_BIP, TRACE_TYPE_EVENT, m,p1,p2);}
   1078 #define BIP_TRACE_EVENT3(m,p1,p2,p3)             {if (bip_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_BIP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1079 #define BIP_TRACE_EVENT4(m,p1,p2,p3,p4)          {if (bip_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_BIP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1080 #define BIP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)       {if (bip_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_BIP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1081 #define BIP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)    {if (bip_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_BIP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1082 
   1083 #define BIP_TRACE_DEBUG0(m)                      {if (bip_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_BIP, TRACE_TYPE_DEBUG, m);}
   1084 #define BIP_TRACE_DEBUG1(m,p1)                   {if (bip_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_BIP, TRACE_TYPE_DEBUG, m,p1);}
   1085 #define BIP_TRACE_DEBUG2(m,p1,p2)                {if (bip_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_BIP, TRACE_TYPE_DEBUG, m,p1,p2);}
   1086 #define BIP_TRACE_DEBUG3(m,p1,p2,p3)             {if (bip_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_BIP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1087 #define BIP_TRACE_DEBUG4(m,p1,p2,p3,p4)          {if (bip_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_BIP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1088 #define BIP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)       {if (bip_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_BIP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1089 #define BIP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)    {if (bip_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_BIP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1090 
   1091 #define BIP_TRACE_API0(m)                        {if (bip_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_BIP, TRACE_TYPE_API, m);}
   1092 #define BIP_TRACE_API1(m,p1)                     {if (bip_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_BIP, TRACE_TYPE_API, m, p1);}
   1093 #define BIP_TRACE_API2(m,p1,p2)                  {if (bip_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_BIP, TRACE_TYPE_API, m,p1,p2);}
   1094 #define BIP_TRACE_API3(m,p1,p2,p3)               {if (bip_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_BIP, TRACE_TYPE_API, m,p1,p2,p3);}
   1095 #define BIP_TRACE_API4(m,p1,p2,p3,p4)            {if (bip_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_BIP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1096 #define BIP_TRACE_API5(m,p1,p2,p3,p4,p5)         {if (bip_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_BIP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1097 #define BIP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)      {if (bip_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_BIP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1098 
   1099 /* Define tracing for TCS
   1100 */
   1101 #define TCS_TRACE_ERROR0(m)                     {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_TCS, TRACE_TYPE_ERROR, m);}
   1102 #define TCS_TRACE_ERROR1(m,p1)                  {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_TCS, TRACE_TYPE_ERROR, m,p1);}
   1103 #define TCS_TRACE_ERROR2(m,p1,p2)               {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_TCS, TRACE_TYPE_ERROR, m,p1,p2);}
   1104 #define TCS_TRACE_ERROR3(m,p1,p2,p3)            {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_TCS, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1105 #define TCS_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_TCS, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1106 #define TCS_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_TCS, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1107 #define TCS_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_TCS, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1108 
   1109 #define TCS_TRACE_WARNING0(m)                   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_TCS, TRACE_TYPE_WARNING, m);}
   1110 #define TCS_TRACE_WARNING1(m,p1)                {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_TCS, TRACE_TYPE_WARNING, m,p1);}
   1111 #define TCS_TRACE_WARNING2(m,p1,p2)             {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_TCS, TRACE_TYPE_WARNING, m,p1,p2);}
   1112 #define TCS_TRACE_WARNING3(m,p1,p2,p3)          {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_TCS, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1113 #define TCS_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_TCS, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1114 #define TCS_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_TCS, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1115 #define TCS_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_TCS, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1116 
   1117 #define TCS_TRACE_EVENT0(m)                     {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_TCS, TRACE_TYPE_EVENT, m);}
   1118 #define TCS_TRACE_EVENT1(m,p1)                  {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_TCS, TRACE_TYPE_EVENT, m, p1);}
   1119 #define TCS_TRACE_EVENT2(m,p1,p2)               {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_TCS, TRACE_TYPE_EVENT, m,p1,p2);}
   1120 #define TCS_TRACE_EVENT3(m,p1,p2,p3)            {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_TCS, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1121 #define TCS_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_TCS, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1122 #define TCS_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_TCS, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1123 #define TCS_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_TCS, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1124 
   1125 #define TCS_TRACE_DEBUG0(m)                     {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_TCS, TRACE_TYPE_DEBUG, m);}
   1126 #define TCS_TRACE_DEBUG1(m,p1)                  {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_TCS, TRACE_TYPE_DEBUG, m,p1);}
   1127 #define TCS_TRACE_DEBUG2(m,p1,p2)               {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_TCS, TRACE_TYPE_DEBUG, m,p1,p2);}
   1128 #define TCS_TRACE_DEBUG3(m,p1,p2,p3)            {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_TCS, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1129 #define TCS_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_TCS, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1130 #define TCS_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_TCS, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1131 #define TCS_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_TCS, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1132 
   1133 #define TCS_TRACE_API0(m)                       {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_TCS, TRACE_TYPE_API, m);}
   1134 #define TCS_TRACE_API1(m,p1)                    {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_TCS, TRACE_TYPE_API, m, p1);}
   1135 #define TCS_TRACE_API2(m,p1,p2)                 {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_TCS, TRACE_TYPE_API, m,p1,p2);}
   1136 #define TCS_TRACE_API3(m,p1,p2,p3)              {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_TCS, TRACE_TYPE_API, m,p1,p2,p3);}
   1137 #define TCS_TRACE_API4(m,p1,p2,p3,p4)           {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_TCS, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1138 #define TCS_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_TCS, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1139 #define TCS_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (tcs_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_TCS, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1140 
   1141 /* Define tracing for ICP
   1142 */
   1143 #define ICP_TRACE_ERROR0(m)                     {if (icp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_ICP, TRACE_TYPE_ERROR, m);}
   1144 #define ICP_TRACE_ERROR1(m,p1)                  {if (icp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_ICP, TRACE_TYPE_ERROR, m,p1);}
   1145 #define ICP_TRACE_ERROR2(m,p1,p2)               {if (icp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_ICP, TRACE_TYPE_ERROR, m,p1,p2);}
   1146 #define ICP_TRACE_ERROR3(m,p1,p2,p3)            {if (icp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_ICP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1147 #define ICP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (icp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_ICP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1148 #define ICP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (icp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_ICP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1149 #define ICP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_ICP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1150 
   1151 #define ICP_TRACE_WARNING0(m)                   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_ICP, TRACE_TYPE_WARNING, m);}
   1152 #define ICP_TRACE_WARNING1(m,p1)                {if (icp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_ICP, TRACE_TYPE_WARNING, m,p1);}
   1153 #define ICP_TRACE_WARNING2(m,p1,p2)             {if (icp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_ICP, TRACE_TYPE_WARNING, m,p1,p2);}
   1154 #define ICP_TRACE_WARNING3(m,p1,p2,p3)          {if (icp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_ICP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1155 #define ICP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (icp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_ICP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1156 #define ICP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (icp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_ICP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1157 #define ICP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (icp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_ICP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1158 
   1159 #define ICP_TRACE_EVENT0(m)                     {if (icp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_ICP, TRACE_TYPE_EVENT, m);}
   1160 #define ICP_TRACE_EVENT1(m,p1)                  {if (icp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_ICP, TRACE_TYPE_EVENT, m, p1);}
   1161 #define ICP_TRACE_EVENT2(m,p1,p2)               {if (icp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_ICP, TRACE_TYPE_EVENT, m,p1,p2);}
   1162 #define ICP_TRACE_EVENT3(m,p1,p2,p3)            {if (icp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_ICP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1163 #define ICP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (icp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_ICP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1164 #define ICP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (icp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_ICP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1165 #define ICP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_ICP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1166 
   1167 #define ICP_TRACE_DEBUG0(m)                     {if (icp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_ICP, TRACE_TYPE_DEBUG, m);}
   1168 #define ICP_TRACE_DEBUG1(m,p1)                  {if (icp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_ICP, TRACE_TYPE_DEBUG, m,p1);}
   1169 #define ICP_TRACE_DEBUG2(m,p1,p2)               {if (icp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_ICP, TRACE_TYPE_DEBUG, m,p1,p2);}
   1170 #define ICP_TRACE_DEBUG3(m,p1,p2,p3)            {if (icp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_ICP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1171 #define ICP_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (icp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_ICP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1172 #define ICP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (icp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_ICP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1173 #define ICP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (icp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_ICP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1174 
   1175 #define ICP_TRACE_API0(m)                       {if (icp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_ICP, TRACE_TYPE_API, m);}
   1176 #define ICP_TRACE_API1(m,p1)                    {if (icp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_ICP, TRACE_TYPE_API, m, p1);}
   1177 #define ICP_TRACE_API2(m,p1,p2)                 {if (icp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_ICP, TRACE_TYPE_API, m,p1,p2);}
   1178 #define ICP_TRACE_API3(m,p1,p2,p3)              {if (icp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_ICP, TRACE_TYPE_API, m,p1,p2,p3);}
   1179 #define ICP_TRACE_API4(m,p1,p2,p3,p4)           {if (icp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_ICP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1180 #define ICP_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (icp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_ICP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1181 #define ICP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (icp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_ICP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1182 
   1183 /* CTP */
   1184 #define CTP_TRACE_ERROR0(m)                     {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_CTP, TRACE_TYPE_ERROR, m);}
   1185 #define CTP_TRACE_ERROR1(m,p1)                  {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_CTP, TRACE_TYPE_ERROR, m,p1);}
   1186 #define CTP_TRACE_ERROR2(m,p1,p2)               {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_CTP, TRACE_TYPE_ERROR, m,p1,p2);}
   1187 #define CTP_TRACE_ERROR3(m,p1,p2,p3)            {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_CTP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1188 #define CTP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_CTP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1189 #define CTP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_CTP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1190 #define CTP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_CTP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1191 
   1192 #define CTP_TRACE_WARNING0(m)                   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_CTP, TRACE_TYPE_WARNING, m);}
   1193 #define CTP_TRACE_WARNING1(m,p1)                {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_CTP, TRACE_TYPE_WARNING, m,p1);}
   1194 #define CTP_TRACE_WARNING2(m,p1,p2)             {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_CTP, TRACE_TYPE_WARNING, m,p1,p2);}
   1195 #define CTP_TRACE_WARNING3(m,p1,p2,p3)          {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_CTP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1196 #define CTP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_CTP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1197 #define CTP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_CTP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1198 #define CTP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_CTP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1199 
   1200 #define CTP_TRACE_EVENT0(m)                     {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_CTP, TRACE_TYPE_EVENT, m);}
   1201 #define CTP_TRACE_EVENT1(m,p1)                  {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_CTP, TRACE_TYPE_EVENT, m, p1);}
   1202 #define CTP_TRACE_EVENT2(m,p1,p2)               {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_CTP, TRACE_TYPE_EVENT, m,p1,p2);}
   1203 #define CTP_TRACE_EVENT3(m,p1,p2,p3)            {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_CTP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1204 #define CTP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_CTP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1205 #define CTP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_CTP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1206 #define CTP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_CTP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1207 
   1208 #define CTP_TRACE_DEBUG0(m)                     {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_CTP, TRACE_TYPE_DEBUG, m);}
   1209 #define CTP_TRACE_DEBUG1(m,p1)                  {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_CTP, TRACE_TYPE_DEBUG, m,p1);}
   1210 #define CTP_TRACE_DEBUG2(m,p1,p2)               {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_CTP, TRACE_TYPE_DEBUG, m,p1,p2);}
   1211 #define CTP_TRACE_DEBUG3(m,p1,p2,p3)            {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_CTP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1212 #define CTP_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_CTP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1213 #define CTP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_CTP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1214 #define CTP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (ctp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_CTP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1215 
   1216 
   1217 /* define traces for HID Host */
   1218 #define HIDH_TRACE_ERROR0(m)                     {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m);}
   1219 #define HIDH_TRACE_ERROR1(m,p1)                  {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m, p1);}
   1220 #define HIDH_TRACE_ERROR2(m,p1,p2)               {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2);}
   1221 #define HIDH_TRACE_ERROR3(m,p1,p2,p3)            {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1222 #define HIDH_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1223 #define HIDH_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1224 #define HIDH_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1225 
   1226 #define HIDH_TRACE_WARNING0(m)                   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m);}
   1227 #define HIDH_TRACE_WARNING1(m,p1)                {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1);}
   1228 #define HIDH_TRACE_WARNING2(m,p1,p2)             {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2);}
   1229 #define HIDH_TRACE_WARNING3(m,p1,p2,p3)          {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1230 #define HIDH_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1231 #define HIDH_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1232 #define HIDH_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (hh_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1233 
   1234 #define HIDH_TRACE_API0(m)                       {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_API, m);}
   1235 #define HIDH_TRACE_API1(m,p1)                    {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_API, m, p1);}
   1236 #define HIDH_TRACE_API2(m,p1,p2)                 {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2);}
   1237 #define HIDH_TRACE_API3(m,p1,p2,p3)              {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3);}
   1238 #define HIDH_TRACE_API4(m,p1,p2,p3,p4)           {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1239 #define HIDH_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1240 #define HIDH_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (hh_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1241 
   1242 #define HIDH_TRACE_EVENT0(m)                     {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m);}
   1243 #define HIDH_TRACE_EVENT1(m,p1)                  {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m, p1);}
   1244 #define HIDH_TRACE_EVENT2(m,p1,p2)               {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2);}
   1245 #define HIDH_TRACE_EVENT3(m,p1,p2,p3)            {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1246 #define HIDH_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1247 #define HIDH_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1248 #define HIDH_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1249 
   1250 #define HIDH_TRACE_DEBUG0(m)                     {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m);}
   1251 #define HIDH_TRACE_DEBUG1(m,p1)                  {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1);}
   1252 #define HIDH_TRACE_DEBUG2(m,p1,p2)               {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2);}
   1253 #define HIDH_TRACE_DEBUG3(m,p1,p2,p3)            {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1254 #define HIDH_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1255 #define HIDH_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1256 #define HIDH_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (hh_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1257 
   1258 /* define traces for HID Device */
   1259 #define HIDD_TRACE_ERROR0(m)                     {if (hd_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m);}
   1260 #define HIDD_TRACE_ERROR1(m,p1)                  {if (hd_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m, p1);}
   1261 #define HIDD_TRACE_ERROR2(m,p1,p2)               {if (hd_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2);}
   1262 #define HIDD_TRACE_ERROR3(m,p1,p2,p3)            {if (hd_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1263 #define HIDD_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (hd_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1264 #define HIDD_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (hd_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1265 #define HIDD_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1266 
   1267 #define HIDD_TRACE_WARNING0(m)                   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m);}
   1268 #define HIDD_TRACE_WARNING1(m,p1)                {if (hd_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1);}
   1269 #define HIDD_TRACE_WARNING2(m,p1,p2)             {if (hd_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2);}
   1270 #define HIDD_TRACE_WARNING3(m,p1,p2,p3)          {if (hd_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1271 #define HIDD_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (hd_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1272 #define HIDD_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (hd_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1273 #define HIDD_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (hd_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1274 
   1275 #define HIDD_TRACE_API0(m)                       {if (hd_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_API, m);}
   1276 #define HIDD_TRACE_API1(m,p1)                    {if (hd_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_API, m, p1);}
   1277 #define HIDD_TRACE_API2(m,p1,p2)                 {if (hd_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2);}
   1278 #define HIDD_TRACE_API3(m,p1,p2,p3)              {if (hd_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3);}
   1279 #define HIDD_TRACE_API4(m,p1,p2,p3,p4)           {if (hd_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1280 #define HIDD_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (hd_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1281 #define HIDD_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (hd_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1282 
   1283 #define HIDD_TRACE_EVENT0(m)                     {if (hd_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m);}
   1284 #define HIDD_TRACE_EVENT1(m,p1)                  {if (hd_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m, p1);}
   1285 #define HIDD_TRACE_EVENT2(m,p1,p2)               {if (hd_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2);}
   1286 #define HIDD_TRACE_EVENT3(m,p1,p2,p3)            {if (hd_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1287 #define HIDD_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (hd_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1288 #define HIDD_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (hd_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1289 #define HIDD_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1290 
   1291 #define HIDD_TRACE_DEBUG0(m)                     {if (hd_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m);}
   1292 #define HIDD_TRACE_DEBUG1(m,p1)                  {if (hd_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1);}
   1293 #define HIDD_TRACE_DEBUG2(m,p1,p2)               {if (hd_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2);}
   1294 #define HIDD_TRACE_DEBUG3(m,p1,p2,p3)            {if (hd_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1295 #define HIDD_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (hd_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1296 #define HIDD_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (hd_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1297 #define HIDD_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (hd_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1298 
   1299 /* define traces for headset profile */
   1300 #define HSP2_TRACE_ERROR0(pcb,m)                     {if (pcb->trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_HSP2, TRACE_TYPE_ERROR, m);}
   1301 #define HSP2_TRACE_ERROR1(pcb,m,p1)                  {if (pcb->trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_HSP2, TRACE_TYPE_ERROR, m, p1);}
   1302 #define HSP2_TRACE_ERROR2(pcb,m,p1,p2)               {if (pcb->trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_HSP2, TRACE_TYPE_ERROR, m,p1,p2);}
   1303 #define HSP2_TRACE_ERROR3(pcb,m,p1,p2,p3)            {if (pcb->trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_HSP2, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1304 #define HSP2_TRACE_ERROR4(pcb,m,p1,p2,p3,p4)         {if (pcb->trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_HSP2, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1305 #define HSP2_TRACE_ERROR5(pcb,m,p1,p2,p3,p4,p5)      {if (pcb->trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_HSP2, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1306 #define HSP2_TRACE_ERROR6(pcb,m,p1,p2,p3,p4,p5,p6)   {if (pcb->trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_HSP2, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1307 
   1308 #define HSP2_TRACE_WARNING0(pcb,m)                   {if (pcb->trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_HSP2, TRACE_TYPE_WARNING, m);}
   1309 #define HSP2_TRACE_WARNING1(pcb,m,p1)                {if (pcb->trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_HSP2, TRACE_TYPE_WARNING, m,p1);}
   1310 #define HSP2_TRACE_WARNING2(pcb,m,p1,p2)             {if (pcb->trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_HSP2, TRACE_TYPE_WARNING, m,p1,p2);}
   1311 #define HSP2_TRACE_WARNING3(pcb,m,p1,p2,p3)          {if (pcb->trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_HSP2, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1312 #define HSP2_TRACE_WARNING4(pcb,m,p1,p2,p3,p4)       {if (pcb->trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_HSP2, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1313 #define HSP2_TRACE_WARNING5(pcb,m,p1,p2,p3,p4,p5)    {if (pcb->trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_HSP2, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1314 #define HSP2_TRACE_WARNING6(pcb,m,p1,p2,p3,p4,p5,p6) {if (pcb->trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_HSP2, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1315 
   1316 #define HSP2_TRACE_API0(pcb,m)                       {if (pcb->trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_HSP2, TRACE_TYPE_API, m);}
   1317 #define HSP2_TRACE_API1(pcb,m,p1)                    {if (pcb->trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_HSP2, TRACE_TYPE_API, m, p1);}
   1318 #define HSP2_TRACE_API2(pcb,m,p1,p2)                 {if (pcb->trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_HSP2, TRACE_TYPE_API, m,p1,p2);}
   1319 #define HSP2_TRACE_API3(pcb,m,p1,p2,p3)              {if (pcb->trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_HSP2, TRACE_TYPE_API, m,p1,p2,p3);}
   1320 #define HSP2_TRACE_API4(pcb,m,p1,p2,p3,p4)           {if (pcb->trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_HSP2, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1321 #define HSP2_TRACE_API5(pcb,m,p1,p2,p3,p4,p5)        {if (pcb->trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_HSP2, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1322 #define HSP2_TRACE_API6(pcb,m,p1,p2,p3,p4,p5,p6)     {if (pcb->trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_HSP2, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1323 
   1324 #define HSP2_TRACE_EVENT0(pcb,m)                     {if (pcb->trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_HSP2, TRACE_TYPE_EVENT, m);}
   1325 #define HSP2_TRACE_EVENT1(pcb,m,p1)                  {if (pcb->trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_HSP2, TRACE_TYPE_EVENT, m, p1);}
   1326 #define HSP2_TRACE_EVENT2(pcb,m,p1,p2)               {if (pcb->trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_HSP2, TRACE_TYPE_EVENT, m,p1,p2);}
   1327 #define HSP2_TRACE_EVENT3(pcb,m,p1,p2,p3)            {if (pcb->trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_HSP2, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1328 #define HSP2_TRACE_EVENT4(pcb,m,p1,p2,p3,p4)         {if (pcb->trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_HSP2, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1329 #define HSP2_TRACE_EVENT5(pcb,m,p1,p2,p3,p4,p5)      {if (pcb->trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_HSP2, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1330 #define HSP2_TRACE_EVENT6(pcb,m,p1,p2,p3,p4,p5,p6)   {if (pcb->trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_HSP2, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1331 
   1332 #define HSP2_TRACE_DEBUG0(pcb,m)                     {if (pcb->trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_HSP2, TRACE_TYPE_DEBUG, m);}
   1333 #define HSP2_TRACE_DEBUG1(pcb,m,p1)                  {if (pcb->trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_HSP2, TRACE_TYPE_DEBUG, m,p1);}
   1334 #define HSP2_TRACE_DEBUG2(pcb,m,p1,p2)               {if (pcb->trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_HSP2, TRACE_TYPE_DEBUG, m,p1,p2);}
   1335 #define HSP2_TRACE_DEBUG3(pcb,m,p1,p2,p3)            {if (pcb->trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_HSP2, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1336 #define HSP2_TRACE_DEBUG4(pcb,m,p1,p2,p3,p4)         {if (pcb->trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_HSP2, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1337 #define HSP2_TRACE_DEBUG5(pcb,m,p1,p2,p3,p4,p5)      {if (pcb->trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_HSP2, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1338 #define HSP2_TRACE_DEBUG6(pcb,m,p1,p2,p3,p4,p5,p6)   {if (pcb->trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_HSP2, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1339 
   1340 /* Define tracing for the NFC unit
   1341 */
   1342 #define NFC_TRACE_ERROR0(m)                     {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_NFC, TRACE_TYPE_ERROR, m);}
   1343 #define NFC_TRACE_ERROR1(m,p1)                  {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_NFC, TRACE_TYPE_ERROR, m,p1);}
   1344 #define NFC_TRACE_ERROR2(m,p1,p2)               {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_NFC, TRACE_TYPE_ERROR, m,p1,p2);}
   1345 #define NFC_TRACE_ERROR3(m,p1,p2,p3)            {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_NFC, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1346 #define NFC_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_NFC, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1347 #define NFC_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_NFC, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1348 #define NFC_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_NFC, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1349 
   1350 #define NFC_TRACE_WARNING0(m)                   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_NFC, TRACE_TYPE_WARNING, m);}
   1351 #define NFC_TRACE_WARNING1(m,p1)                {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_NFC, TRACE_TYPE_WARNING, m,p1);}
   1352 #define NFC_TRACE_WARNING2(m,p1,p2)             {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_NFC, TRACE_TYPE_WARNING, m,p1,p2);}
   1353 #define NFC_TRACE_WARNING3(m,p1,p2,p3)          {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_NFC, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1354 #define NFC_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_NFC, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1355 #define NFC_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_NFC, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1356 #define NFC_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_NFC, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1357 
   1358 #define NFC_TRACE_API0(m)                       {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_NFC, TRACE_TYPE_API, m);}
   1359 #define NFC_TRACE_API1(m,p1)                    {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_NFC, TRACE_TYPE_API, m,p1);}
   1360 #define NFC_TRACE_API2(m,p1,p2)                 {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_NFC, TRACE_TYPE_API, m,p1,p2);}
   1361 #define NFC_TRACE_API3(m,p1,p2,p3)              {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_NFC, TRACE_TYPE_API, m,p1,p2,p3);}
   1362 #define NFC_TRACE_API4(m,p1,p2,p3,p4)           {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_NFC, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1363 #define NFC_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_NFC, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1364 #define NFC_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_NFC, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1365 
   1366 #define NFC_TRACE_EVENT0(m)                     {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_NFC, TRACE_TYPE_EVENT, m);}
   1367 #define NFC_TRACE_EVENT1(m,p1)                  {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_NFC, TRACE_TYPE_EVENT, m, p1);}
   1368 #define NFC_TRACE_EVENT2(m,p1,p2)               {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_NFC, TRACE_TYPE_EVENT, m,p1,p2);}
   1369 #define NFC_TRACE_EVENT3(m,p1,p2,p3)            {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_NFC, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1370 #define NFC_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_NFC, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1371 #define NFC_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_NFC, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1372 #define NFC_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_NFC, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1373 
   1374 #define NFC_TRACE_DEBUG0(m)                     {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_NFC, TRACE_TYPE_DEBUG, m);}
   1375 #define NFC_TRACE_DEBUG1(m,p1)                  {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_NFC, TRACE_TYPE_DEBUG, m,p1);}
   1376 #define NFC_TRACE_DEBUG2(m,p1,p2)               {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_NFC, TRACE_TYPE_DEBUG, m,p1,p2);}
   1377 #define NFC_TRACE_DEBUG3(m,p1,p2,p3)            {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_NFC, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1378 #define NFC_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_NFC, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1379 #define NFC_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_NFC, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1380 #define NFC_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (nfc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_NFC, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1381 
   1382 #define NCI_TRACE_ERROR0(m)                     {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_NCI, TRACE_TYPE_ERROR, m);}
   1383 #define NCI_TRACE_ERROR1(m,p1)                  {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_NCI, TRACE_TYPE_ERROR, m,p1);}
   1384 #define NCI_TRACE_ERROR2(m,p1,p2)               {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_NCI, TRACE_TYPE_ERROR, m,p1,p2);}
   1385 #define NCI_TRACE_ERROR3(m,p1,p2,p3)            {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_NCI, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1386 #define NCI_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_NCI, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1387 #define NCI_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_NCI, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1388 #define NCI_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_NCI, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1389 
   1390 #define NCI_TRACE_WARNING0(m)                   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_NCI, TRACE_TYPE_WARNING, m);}
   1391 #define NCI_TRACE_WARNING1(m,p1)                {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_NCI, TRACE_TYPE_WARNING, m,p1);}
   1392 #define NCI_TRACE_WARNING2(m,p1,p2)             {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_NCI, TRACE_TYPE_WARNING, m,p1,p2);}
   1393 #define NCI_TRACE_WARNING3(m,p1,p2,p3)          {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_NCI, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1394 #define NCI_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_NCI, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1395 #define NCI_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_NCI, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1396 #define NCI_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_NCI, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1397 
   1398 #define NCI_TRACE_API0(m)                       {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_NCI, TRACE_TYPE_API, m);}
   1399 #define NCI_TRACE_API1(m,p1)                    {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_NCI, TRACE_TYPE_API, m,p1);}
   1400 #define NCI_TRACE_API2(m,p1,p2)                 {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_NCI, TRACE_TYPE_API, m,p1,p2);}
   1401 #define NCI_TRACE_API3(m,p1,p2,p3)              {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_NCI, TRACE_TYPE_API, m,p1,p2,p3);}
   1402 #define NCI_TRACE_API4(m,p1,p2,p3,p4)           {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_NCI, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1403 #define NCI_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_NCI, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1404 #define NCI_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_NCI, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1405 
   1406 #define NCI_TRACE_EVENT0(m)                     {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_NCI, TRACE_TYPE_EVENT, m);}
   1407 #define NCI_TRACE_EVENT1(m,p1)                  {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_NCI, TRACE_TYPE_EVENT, m, p1);}
   1408 #define NCI_TRACE_EVENT2(m,p1,p2)               {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_NCI, TRACE_TYPE_EVENT, m,p1,p2);}
   1409 #define NCI_TRACE_EVENT3(m,p1,p2,p3)            {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_NCI, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1410 #define NCI_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_NCI, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1411 #define NCI_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_NCI, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1412 #define NCI_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_NCI, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1413 
   1414 #define NCI_TRACE_DEBUG0(m)                     {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_NCI, TRACE_TYPE_DEBUG, m);}
   1415 #define NCI_TRACE_DEBUG1(m,p1)                  {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_NCI, TRACE_TYPE_DEBUG, m,p1);}
   1416 #define NCI_TRACE_DEBUG2(m,p1,p2)               {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_NCI, TRACE_TYPE_DEBUG, m,p1,p2);}
   1417 #define NCI_TRACE_DEBUG3(m,p1,p2,p3)            {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_NCI, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1418 #define NCI_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_NCI, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1419 #define NCI_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_NCI, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1420 #define NCI_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (ncit_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_NCI, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1421 
   1422 #define RW_TRACE_ERROR0(m)                     {if (rw_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_RW, TRACE_TYPE_ERROR, m);}
   1423 #define RW_TRACE_ERROR1(m,p1)                  {if (rw_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_RW, TRACE_TYPE_ERROR, m,p1);}
   1424 #define RW_TRACE_ERROR2(m,p1,p2)               {if (rw_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_RW, TRACE_TYPE_ERROR, m,p1,p2);}
   1425 #define RW_TRACE_ERROR3(m,p1,p2,p3)            {if (rw_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_RW, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1426 #define RW_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (rw_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_RW, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1427 #define RW_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (rw_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_RW, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1428 #define RW_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_RW, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1429 
   1430 #define RW_TRACE_WARNING0(m)                   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_RW, TRACE_TYPE_WARNING, m);}
   1431 #define RW_TRACE_WARNING1(m,p1)                {if (rw_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_RW, TRACE_TYPE_WARNING, m,p1);}
   1432 #define RW_TRACE_WARNING2(m,p1,p2)             {if (rw_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_RW, TRACE_TYPE_WARNING, m,p1,p2);}
   1433 #define RW_TRACE_WARNING3(m,p1,p2,p3)          {if (rw_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_RW, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1434 #define RW_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (rw_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_RW, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1435 #define RW_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (rw_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_RW, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1436 #define RW_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (rw_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_RW, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1437 
   1438 #define RW_TRACE_API0(m)                       {if (rw_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_RW, TRACE_TYPE_API, m);}
   1439 #define RW_TRACE_API1(m,p1)                    {if (rw_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_RW, TRACE_TYPE_API, m,p1);}
   1440 #define RW_TRACE_API2(m,p1,p2)                 {if (rw_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_RW, TRACE_TYPE_API, m,p1,p2);}
   1441 #define RW_TRACE_API3(m,p1,p2,p3)              {if (rw_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_RW, TRACE_TYPE_API, m,p1,p2,p3);}
   1442 #define RW_TRACE_API4(m,p1,p2,p3,p4)           {if (rw_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_RW, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1443 #define RW_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (rw_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_RW, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1444 #define RW_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (rw_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_RW, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1445 
   1446 #define RW_TRACE_EVENT0(m)                     {if (rw_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_RW, TRACE_TYPE_EVENT, m);}
   1447 #define RW_TRACE_EVENT1(m,p1)                  {if (rw_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_RW, TRACE_TYPE_EVENT, m, p1);}
   1448 #define RW_TRACE_EVENT2(m,p1,p2)               {if (rw_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_RW, TRACE_TYPE_EVENT, m,p1,p2);}
   1449 #define RW_TRACE_EVENT3(m,p1,p2,p3)            {if (rw_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_RW, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1450 #define RW_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (rw_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_RW, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1451 #define RW_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (rw_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_RW, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1452 #define RW_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_RW, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1453 
   1454 #define RW_TRACE_DEBUG0(m)                     {if (rw_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_RW, TRACE_TYPE_DEBUG, m);}
   1455 #define RW_TRACE_DEBUG1(m,p1)                  {if (rw_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_RW, TRACE_TYPE_DEBUG, m,p1);}
   1456 #define RW_TRACE_DEBUG2(m,p1,p2)               {if (rw_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_RW, TRACE_TYPE_DEBUG, m,p1,p2);}
   1457 #define RW_TRACE_DEBUG3(m,p1,p2,p3)            {if (rw_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_RW, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1458 #define RW_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (rw_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_RW, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1459 #define RW_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (rw_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_RW, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1460 #define RW_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (rw_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_RW, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1461 
   1462 #define CE_TRACE_ERROR0(m)                     {if (ce_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_CE, TRACE_TYPE_ERROR, m);}
   1463 #define CE_TRACE_ERROR1(m,p1)                  {if (ce_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_CE, TRACE_TYPE_ERROR, m,p1);}
   1464 #define CE_TRACE_ERROR2(m,p1,p2)               {if (ce_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_CE, TRACE_TYPE_ERROR, m,p1,p2);}
   1465 #define CE_TRACE_ERROR3(m,p1,p2,p3)            {if (ce_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_CE, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1466 #define CE_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (ce_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_CE, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1467 #define CE_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (ce_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_CE, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1468 #define CE_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_CE, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1469 
   1470 #define CE_TRACE_WARNING0(m)                   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_CE, TRACE_TYPE_WARNING, m);}
   1471 #define CE_TRACE_WARNING1(m,p1)                {if (ce_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_CE, TRACE_TYPE_WARNING, m,p1);}
   1472 #define CE_TRACE_WARNING2(m,p1,p2)             {if (ce_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_CE, TRACE_TYPE_WARNING, m,p1,p2);}
   1473 #define CE_TRACE_WARNING3(m,p1,p2,p3)          {if (ce_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_CE, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1474 #define CE_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (ce_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_CE, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1475 #define CE_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (ce_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_CE, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1476 #define CE_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (ce_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_CE, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1477 
   1478 #define CE_TRACE_API0(m)                       {if (ce_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_CE, TRACE_TYPE_API, m);}
   1479 #define CE_TRACE_API1(m,p1)                    {if (ce_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_CE, TRACE_TYPE_API, m,p1);}
   1480 #define CE_TRACE_API2(m,p1,p2)                 {if (ce_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_CE, TRACE_TYPE_API, m,p1,p2);}
   1481 #define CE_TRACE_API3(m,p1,p2,p3)              {if (ce_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_CE, TRACE_TYPE_API, m,p1,p2,p3);}
   1482 #define CE_TRACE_API4(m,p1,p2,p3,p4)           {if (ce_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_CE, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1483 #define CE_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (ce_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_CE, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1484 #define CE_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (ce_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_CE, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1485 
   1486 #define CE_TRACE_EVENT0(m)                     {if (ce_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_CE, TRACE_TYPE_EVENT, m);}
   1487 #define CE_TRACE_EVENT1(m,p1)                  {if (ce_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_CE, TRACE_TYPE_EVENT, m, p1);}
   1488 #define CE_TRACE_EVENT2(m,p1,p2)               {if (ce_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_CE, TRACE_TYPE_EVENT, m,p1,p2);}
   1489 #define CE_TRACE_EVENT3(m,p1,p2,p3)            {if (ce_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_CE, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1490 #define CE_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (ce_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_CE, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1491 #define CE_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (ce_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_CE, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1492 #define CE_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_CE, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1493 
   1494 #define CE_TRACE_DEBUG0(m)                     {if (ce_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_CE, TRACE_TYPE_DEBUG, m);}
   1495 #define CE_TRACE_DEBUG1(m,p1)                  {if (ce_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_CE, TRACE_TYPE_DEBUG, m,p1);}
   1496 #define CE_TRACE_DEBUG2(m,p1,p2)               {if (ce_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_CE, TRACE_TYPE_DEBUG, m,p1,p2);}
   1497 #define CE_TRACE_DEBUG3(m,p1,p2,p3)            {if (ce_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_CE, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1498 #define CE_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (ce_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_CE, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1499 #define CE_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (ce_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_CE, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1500 #define CE_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (ce_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_CE, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1501 
   1502 #define NDEF_TRACE_ERROR0(m)                     {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_NDEF, TRACE_TYPE_ERROR, m);}
   1503 #define NDEF_TRACE_ERROR1(m,p1)                  {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_NDEF, TRACE_TYPE_ERROR, m,p1);}
   1504 #define NDEF_TRACE_ERROR2(m,p1,p2)               {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_NDEF, TRACE_TYPE_ERROR, m,p1,p2);}
   1505 #define NDEF_TRACE_ERROR3(m,p1,p2,p3)            {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_NDEF, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1506 #define NDEF_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_NDEF, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1507 #define NDEF_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_NDEF, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1508 #define NDEF_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_NDEF, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1509 
   1510 #define NDEF_TRACE_WARNING0(m)                   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_NDEF, TRACE_TYPE_WARNING, m);}
   1511 #define NDEF_TRACE_WARNING1(m,p1)                {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_NDEF, TRACE_TYPE_WARNING, m,p1);}
   1512 #define NDEF_TRACE_WARNING2(m,p1,p2)             {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_NDEF, TRACE_TYPE_WARNING, m,p1,p2);}
   1513 #define NDEF_TRACE_WARNING3(m,p1,p2,p3)          {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_NDEF, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1514 #define NDEF_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_NDEF, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1515 #define NDEF_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_NDEF, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1516 #define NDEF_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_NDEF, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1517 
   1518 #define NDEF_TRACE_API0(m)                       {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_NDEF, TRACE_TYPE_API, m);}
   1519 #define NDEF_TRACE_API1(m,p1)                    {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_NDEF, TRACE_TYPE_API, m,p1);}
   1520 #define NDEF_TRACE_API2(m,p1,p2)                 {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_NDEF, TRACE_TYPE_API, m,p1,p2);}
   1521 #define NDEF_TRACE_API3(m,p1,p2,p3)              {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_NDEF, TRACE_TYPE_API, m,p1,p2,p3);}
   1522 #define NDEF_TRACE_API4(m,p1,p2,p3,p4)           {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_NDEF, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1523 #define NDEF_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_NDEF, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1524 #define NDEF_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_NDEF, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1525 
   1526 #define NDEF_TRACE_EVENT0(m)                     {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_NDEF, TRACE_TYPE_EVENT, m);}
   1527 #define NDEF_TRACE_EVENT1(m,p1)                  {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_NDEF, TRACE_TYPE_EVENT, m, p1);}
   1528 #define NDEF_TRACE_EVENT2(m,p1,p2)               {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_NDEF, TRACE_TYPE_EVENT, m,p1,p2);}
   1529 #define NDEF_TRACE_EVENT3(m,p1,p2,p3)            {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_NDEF, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1530 #define NDEF_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_NDEF, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1531 #define NDEF_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_NDEF, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1532 #define NDEF_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_NDEF, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1533 
   1534 #define NDEF_TRACE_DEBUG0(m)                     {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_NDEF, TRACE_TYPE_DEBUG, m);}
   1535 #define NDEF_TRACE_DEBUG1(m,p1)                  {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_NDEF, TRACE_TYPE_DEBUG, m,p1);}
   1536 #define NDEF_TRACE_DEBUG2(m,p1,p2)               {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_NDEF, TRACE_TYPE_DEBUG, m,p1,p2);}
   1537 #define NDEF_TRACE_DEBUG3(m,p1,p2,p3)            {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_NDEF, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1538 #define NDEF_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_NDEF, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1539 #define NDEF_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_NDEF, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1540 #define NDEF_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (ndef_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_NDEF, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1541 
   1542 /* Define tracing for the NFA unit
   1543 */
   1544 #define NFA_TRACE_ERROR0(m)                     {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_NFA, TRACE_TYPE_ERROR, m);}
   1545 #define NFA_TRACE_ERROR1(m,p1)                  {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_NFA, TRACE_TYPE_ERROR, m,p1);}
   1546 #define NFA_TRACE_ERROR2(m,p1,p2)               {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_NFA, TRACE_TYPE_ERROR, m,p1,p2);}
   1547 #define NFA_TRACE_ERROR3(m,p1,p2,p3)            {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_NFA, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1548 #define NFA_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_NFA, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1549 #define NFA_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_NFA, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1550 #define NFA_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_NFA, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1551 
   1552 #define NFA_TRACE_WARNING0(m)                   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_NFA, TRACE_TYPE_WARNING, m);}
   1553 #define NFA_TRACE_WARNING1(m,p1)                {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_NFA, TRACE_TYPE_WARNING, m,p1);}
   1554 #define NFA_TRACE_WARNING2(m,p1,p2)             {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_NFA, TRACE_TYPE_WARNING, m,p1,p2);}
   1555 #define NFA_TRACE_WARNING3(m,p1,p2,p3)          {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_NFA, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1556 #define NFA_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_NFA, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1557 #define NFA_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_NFA, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1558 #define NFA_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_NFA, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1559 
   1560 #define NFA_TRACE_API0(m)                       {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_NFA, TRACE_TYPE_API, m);}
   1561 #define NFA_TRACE_API1(m,p1)                    {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_NFA, TRACE_TYPE_API, m,p1);}
   1562 #define NFA_TRACE_API2(m,p1,p2)                 {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_NFA, TRACE_TYPE_API, m,p1,p2);}
   1563 #define NFA_TRACE_API3(m,p1,p2,p3)              {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_NFA, TRACE_TYPE_API, m,p1,p2,p3);}
   1564 #define NFA_TRACE_API4(m,p1,p2,p3,p4)           {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_NFA, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1565 #define NFA_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_NFA, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1566 #define NFA_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_NFA, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1567 
   1568 #define NFA_TRACE_EVENT0(m)                     {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_NFA, TRACE_TYPE_EVENT, m);}
   1569 #define NFA_TRACE_EVENT1(m,p1)                  {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_NFA, TRACE_TYPE_EVENT, m, p1);}
   1570 #define NFA_TRACE_EVENT2(m,p1,p2)               {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_NFA, TRACE_TYPE_EVENT, m,p1,p2);}
   1571 #define NFA_TRACE_EVENT3(m,p1,p2,p3)            {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_NFA, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1572 #define NFA_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_NFA, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1573 #define NFA_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_NFA, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1574 #define NFA_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_NFA, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1575 
   1576 #define NFA_TRACE_DEBUG0(m)                     {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_NFA, TRACE_TYPE_DEBUG, m);}
   1577 #define NFA_TRACE_DEBUG1(m,p1)                  {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_NFA, TRACE_TYPE_DEBUG, m,p1);}
   1578 #define NFA_TRACE_DEBUG2(m,p1,p2)               {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_NFA, TRACE_TYPE_DEBUG, m,p1,p2);}
   1579 #define NFA_TRACE_DEBUG3(m,p1,p2,p3)            {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_NFA, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1580 #define NFA_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_NFA, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1581 #define NFA_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_NFA, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1582 #define NFA_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (nfa_sys_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_NFA, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1583 
   1584 /* Define tracing for the NFA P2P unit
   1585 */
   1586 #define P2P_TRACE_ERROR0(m)                     {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_P2P, TRACE_TYPE_ERROR, m);}
   1587 #define P2P_TRACE_ERROR1(m,p1)                  {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_P2P, TRACE_TYPE_ERROR, m,p1);}
   1588 #define P2P_TRACE_ERROR2(m,p1,p2)               {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_P2P, TRACE_TYPE_ERROR, m,p1,p2);}
   1589 #define P2P_TRACE_ERROR3(m,p1,p2,p3)            {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_P2P, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1590 #define P2P_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_P2P, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1591 #define P2P_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_P2P, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1592 #define P2P_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_P2P, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1593 
   1594 #define P2P_TRACE_WARNING0(m)                   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_P2P, TRACE_TYPE_WARNING, m);}
   1595 #define P2P_TRACE_WARNING1(m,p1)                {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_P2P, TRACE_TYPE_WARNING, m,p1);}
   1596 #define P2P_TRACE_WARNING2(m,p1,p2)             {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_P2P, TRACE_TYPE_WARNING, m,p1,p2);}
   1597 #define P2P_TRACE_WARNING3(m,p1,p2,p3)          {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_P2P, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1598 #define P2P_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_P2P, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1599 #define P2P_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_P2P, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1600 #define P2P_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_P2P, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1601 
   1602 #define P2P_TRACE_API0(m)                       {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_P2P, TRACE_TYPE_API, m);}
   1603 #define P2P_TRACE_API1(m,p1)                    {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_P2P, TRACE_TYPE_API, m,p1);}
   1604 #define P2P_TRACE_API2(m,p1,p2)                 {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_P2P, TRACE_TYPE_API, m,p1,p2);}
   1605 #define P2P_TRACE_API3(m,p1,p2,p3)              {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_P2P, TRACE_TYPE_API, m,p1,p2,p3);}
   1606 #define P2P_TRACE_API4(m,p1,p2,p3,p4)           {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_P2P, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1607 #define P2P_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_P2P, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1608 #define P2P_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_P2P, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1609 
   1610 #define P2P_TRACE_EVENT0(m)                     {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_P2P, TRACE_TYPE_EVENT, m);}
   1611 #define P2P_TRACE_EVENT1(m,p1)                  {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_P2P, TRACE_TYPE_EVENT, m, p1);}
   1612 #define P2P_TRACE_EVENT2(m,p1,p2)               {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_P2P, TRACE_TYPE_EVENT, m,p1,p2);}
   1613 #define P2P_TRACE_EVENT3(m,p1,p2,p3)            {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_P2P, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1614 #define P2P_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_P2P, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1615 #define P2P_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_P2P, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1616 #define P2P_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_P2P, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1617 
   1618 #define P2P_TRACE_DEBUG0(m)                     {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_P2P, TRACE_TYPE_DEBUG, m);}
   1619 #define P2P_TRACE_DEBUG1(m,p1)                  {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_P2P, TRACE_TYPE_DEBUG, m,p1);}
   1620 #define P2P_TRACE_DEBUG2(m,p1,p2)               {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_P2P, TRACE_TYPE_DEBUG, m,p1,p2);}
   1621 #define P2P_TRACE_DEBUG3(m,p1,p2,p3)            {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_P2P, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1622 #define P2P_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_P2P, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1623 #define P2P_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_P2P, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1624 #define P2P_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (nfa_p2p_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_P2P, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1625 
   1626 /* Define tracing for the NFA CHO unit
   1627 */
   1628 #define CHO_TRACE_ERROR0(m)                     {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_CHO, TRACE_TYPE_ERROR, m);}
   1629 #define CHO_TRACE_ERROR1(m,p1)                  {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_CHO, TRACE_TYPE_ERROR, m,p1);}
   1630 #define CHO_TRACE_ERROR2(m,p1,p2)               {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_CHO, TRACE_TYPE_ERROR, m,p1,p2);}
   1631 #define CHO_TRACE_ERROR3(m,p1,p2,p3)            {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_CHO, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1632 #define CHO_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_CHO, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1633 #define CHO_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_CHO, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1634 #define CHO_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_CHO, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1635 
   1636 #define CHO_TRACE_WARNING0(m)                   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_CHO, TRACE_TYPE_WARNING, m);}
   1637 #define CHO_TRACE_WARNING1(m,p1)                {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_CHO, TRACE_TYPE_WARNING, m,p1);}
   1638 #define CHO_TRACE_WARNING2(m,p1,p2)             {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_CHO, TRACE_TYPE_WARNING, m,p1,p2);}
   1639 #define CHO_TRACE_WARNING3(m,p1,p2,p3)          {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_CHO, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1640 #define CHO_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_CHO, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1641 #define CHO_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_CHO, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1642 #define CHO_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_CHO, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1643 
   1644 #define CHO_TRACE_API0(m)                       {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_CHO, TRACE_TYPE_API, m);}
   1645 #define CHO_TRACE_API1(m,p1)                    {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_CHO, TRACE_TYPE_API, m,p1);}
   1646 #define CHO_TRACE_API2(m,p1,p2)                 {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_CHO, TRACE_TYPE_API, m,p1,p2);}
   1647 #define CHO_TRACE_API3(m,p1,p2,p3)              {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_CHO, TRACE_TYPE_API, m,p1,p2,p3);}
   1648 #define CHO_TRACE_API4(m,p1,p2,p3,p4)           {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_CHO, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1649 #define CHO_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_CHO, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1650 #define CHO_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_CHO, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1651 
   1652 #define CHO_TRACE_EVENT0(m)                     {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_CHO, TRACE_TYPE_EVENT, m);}
   1653 #define CHO_TRACE_EVENT1(m,p1)                  {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_CHO, TRACE_TYPE_EVENT, m, p1);}
   1654 #define CHO_TRACE_EVENT2(m,p1,p2)               {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_CHO, TRACE_TYPE_EVENT, m,p1,p2);}
   1655 #define CHO_TRACE_EVENT3(m,p1,p2,p3)            {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_CHO, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1656 #define CHO_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_CHO, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1657 #define CHO_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_CHO, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1658 #define CHO_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_CHO, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1659 
   1660 #define CHO_TRACE_DEBUG0(m)                     {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_CHO, TRACE_TYPE_DEBUG, m);}
   1661 #define CHO_TRACE_DEBUG1(m,p1)                  {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_CHO, TRACE_TYPE_DEBUG, m,p1);}
   1662 #define CHO_TRACE_DEBUG2(m,p1,p2)               {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_CHO, TRACE_TYPE_DEBUG, m,p1,p2);}
   1663 #define CHO_TRACE_DEBUG3(m,p1,p2,p3)            {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_CHO, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1664 #define CHO_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_CHO, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1665 #define CHO_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_CHO, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1666 #define CHO_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (nfa_cho_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_CHO, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1667 
   1668 /* Define tracing for the NFA SNEP unit
   1669 */
   1670 #define SNEP_TRACE_ERROR0(m)                     {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_SNEP, TRACE_TYPE_ERROR, m);}
   1671 #define SNEP_TRACE_ERROR1(m,p1)                  {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_SNEP, TRACE_TYPE_ERROR, m,p1);}
   1672 #define SNEP_TRACE_ERROR2(m,p1,p2)               {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_SNEP, TRACE_TYPE_ERROR, m,p1,p2);}
   1673 #define SNEP_TRACE_ERROR3(m,p1,p2,p3)            {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_SNEP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1674 #define SNEP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_SNEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1675 #define SNEP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_SNEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1676 #define SNEP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_SNEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1677 
   1678 #define SNEP_TRACE_WARNING0(m)                   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_SNEP, TRACE_TYPE_WARNING, m);}
   1679 #define SNEP_TRACE_WARNING1(m,p1)                {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_SNEP, TRACE_TYPE_WARNING, m,p1);}
   1680 #define SNEP_TRACE_WARNING2(m,p1,p2)             {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_SNEP, TRACE_TYPE_WARNING, m,p1,p2);}
   1681 #define SNEP_TRACE_WARNING3(m,p1,p2,p3)          {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_SNEP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1682 #define SNEP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_SNEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1683 #define SNEP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_SNEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1684 #define SNEP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_SNEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1685 
   1686 #define SNEP_TRACE_API0(m)                       {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_SNEP, TRACE_TYPE_API, m);}
   1687 #define SNEP_TRACE_API1(m,p1)                    {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_SNEP, TRACE_TYPE_API, m,p1);}
   1688 #define SNEP_TRACE_API2(m,p1,p2)                 {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_SNEP, TRACE_TYPE_API, m,p1,p2);}
   1689 #define SNEP_TRACE_API3(m,p1,p2,p3)              {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_SNEP, TRACE_TYPE_API, m,p1,p2,p3);}
   1690 #define SNEP_TRACE_API4(m,p1,p2,p3,p4)           {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_SNEP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1691 #define SNEP_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_SNEP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1692 #define SNEP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_SNEP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1693 
   1694 #define SNEP_TRACE_EVENT0(m)                     {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_SNEP, TRACE_TYPE_EVENT, m);}
   1695 #define SNEP_TRACE_EVENT1(m,p1)                  {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_SNEP, TRACE_TYPE_EVENT, m, p1);}
   1696 #define SNEP_TRACE_EVENT2(m,p1,p2)               {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_SNEP, TRACE_TYPE_EVENT, m,p1,p2);}
   1697 #define SNEP_TRACE_EVENT3(m,p1,p2,p3)            {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_SNEP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1698 #define SNEP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_SNEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1699 #define SNEP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_SNEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1700 #define SNEP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_SNEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1701 
   1702 #define SNEP_TRACE_DEBUG0(m)                     {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_SNEP, TRACE_TYPE_DEBUG, m);}
   1703 #define SNEP_TRACE_DEBUG1(m,p1)                  {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_SNEP, TRACE_TYPE_DEBUG, m,p1);}
   1704 #define SNEP_TRACE_DEBUG2(m,p1,p2)               {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_SNEP, TRACE_TYPE_DEBUG, m,p1,p2);}
   1705 #define SNEP_TRACE_DEBUG3(m,p1,p2,p3)            {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_SNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1706 #define SNEP_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_SNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1707 #define SNEP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_SNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1708 #define SNEP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (nfa_snep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_SNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1709 
   1710 #define MMI_TRACE_0(m)
   1711 #define MMI_TRACE_1(m,p1)
   1712 #define MMI_TRACE_2(m,p1,p2)
   1713 #define MMI_TRACE_3(m,p1,p2,p3)
   1714 #define MMI_TRACE_4(m,p1,p2,p3,p4)
   1715 #define MMI_TRACE_5(m,p1,p2,p3,p4,p5)
   1716 #define MMI_TRACE_6(m,p1,p2,p3,p4,p5,p6)
   1717 
   1718 #define MMI_DEBUG_0(m)                           BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m)
   1719 #define MMI_DEBUG_1(m,p1)                        BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1)
   1720 #define MMI_DEBUG_2(m,p1,p2)                     BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2)
   1721 #define MMI_DEBUG_3(m,p1,p2,p3)                  BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3)
   1722 #define MMI_DEBUG_4(m,p1,p2,p3,p4)               BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4)
   1723 #define MMI_DEBUG_5(m,p1,p2,p3,p4,p5)            BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5)
   1724 #define MMI_DEBUG_6(m,p1,p2,p3,p4,p5,p6)         BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6)
   1725 
   1726 #define MMI_WARNING_0(m)                         BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m)
   1727 #define MMI_WARNING_1(m,p1)                      BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1)
   1728 #define MMI_WARNING_2(m,p1,p2)                   BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2)
   1729 #define MMI_WARNING_3(m,p1,p2,p3)                BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3)
   1730 #define MMI_WARNING_4(m,p1,p2,p3,p4)             BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4)
   1731 #define MMI_WARNING_5(m,p1,p2,p3,p4,p5)          BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5)
   1732 #define MMI_WARNING_6(m,p1,p2,p3,p4,p5,p6)       BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6)
   1733 
   1734 #define MMI_ERROR_0(m)                           BT_TRACE_0(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m)
   1735 #define MMI_ERROR_1(m,p1)                        BT_TRACE_1(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1)
   1736 #define MMI_ERROR_2(m,p1,p2)                     BT_TRACE_2(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2)
   1737 #define MMI_ERROR_3(m,p1,p2,p3)                  BT_TRACE_3(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3)
   1738 #define MMI_ERROR_4(m,p1,p2,p3,p4)               BT_TRACE_4(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4)
   1739 #define MMI_ERROR_5(m,p1,p2,p3,p4,p5)            BT_TRACE_5(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5)
   1740 #define MMI_ERROR_6(m,p1,p2,p3,p4,p5,p6)         BT_TRACE_6(TRACE_LAYER_HID, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6)
   1741 
   1742 #define TAK_TRACE_0(m)                            MMI_Echo(m)
   1743 
   1744 /* hid mouse module traces */
   1745 
   1746 #define MSKB_TRACE_0(m)                         MMI_Echo(m)
   1747 #define MSKB_TRACE_1(m,p1)                      MMI_Echo(m,p1)
   1748 #define MSKB_TRACE_2(m,p1,p2)                   MMI_Echo(m,p1,p2)
   1749 #define MSKB_TRACE_3(m,p1,p2,p3)                MMI_Echo(m,p1,p2,p3)
   1750 #define MSKB_TRACE_4(m,p1,p2,p3,p4)             MMI_Echo(m,p1,p2,p3,p4)
   1751 #define MSKB_TRACE_5(m,p1,p2,p3,p4,p5)          MMI_Echo(m,p1,p2,p3,p4,p5)
   1752 #define MSKB_TRACE_6(m,p1,p2,p3,p4,p5,p6)       MMI_Echo(m,p1,p2,p3,p4,p5,p6)
   1753 
   1754 #define MSKB_DEBUG_0(m)                         MMI_Echo(m)
   1755 #define MSKB_DEBUG_1(m,p1)                      MMI_Echo(m,p1)
   1756 #define MSKB_DEBUG_2(m,p1,p2)                   MMI_Echo(m,p1,p2)
   1757 #define MSKB_DEBUG_3(m,p1,p2,p3)                MMI_Echo(m,p1,p2,p3)
   1758 #define MSKB_DEBUG_4(m,p1,p2,p3,p4)             MMI_Echo(m,p1,p2,p3,p4)
   1759 #define MSKB_DEBUG_5(m,p1,p2,p3,p4,p5)          MMI_Echo(m,p1,p2,p3,p4,p5)
   1760 #define MSKB_DEBUG_6(m,p1,p2,p3,p4,p5,p6)       MMI_Echo(m,p1,p2,p3,p4,p5,p6)
   1761 
   1762 #define MSKB_ERROR_0(m)                         MMI_Echo(m)
   1763 #define MSKB_ERROR_1(m,p1)                      MMI_Echo(m,p1)
   1764 #define MSKB_ERROR_2(m,p1,p2)                   MMI_Echo(m,p1,p2)
   1765 #define MSKB_ERROR_3(m,p1,p2,p3)                MMI_Echo(m,p1,p2,p3)
   1766 #define MSKB_ERROR_4(m,p1,p2,p3,p4)             MMI_Echo(m,p1,p2,p3,p4)
   1767 #define MSKB_ERROR_5(m,p1,p2,p3,p4,p5)          MMI_Echo(m,p1,p2,p3,p4,p5)
   1768 #define MSKB_ERROR_6(m,p1,p2,p3,p4,p5,p6)       MMI_Echo(m,p1,p2,p3,p4,p5,p6)
   1769 
   1770 /* define traces for DUN */
   1771 
   1772 #define DUN_TRACE_ERROR0(m)                     {if (dun_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_DUN, TRACE_TYPE_ERROR, m);}
   1773 #define DUN_TRACE_ERROR1(m,p1)                  {if (dun_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_DUN, TRACE_TYPE_ERROR, m, p1);}
   1774 #define DUN_TRACE_ERROR2(m,p1,p2)               {if (dun_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_DUN, TRACE_TYPE_ERROR, m,p1,p2);}
   1775 #define DUN_TRACE_ERROR3(m,p1,p2,p3)            {if (dun_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_DUN, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1776 #define DUN_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (dun_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_DUN, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1777 #define DUN_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (dun_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_DUN, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1778 #define DUN_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_DUN, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1779 
   1780 #define DUN_TRACE_WARNING0(m)                   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_DUN, TRACE_TYPE_WARNING, m);}
   1781 #define DUN_TRACE_WARNING1(m,p1)                {if (dun_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_DUN, TRACE_TYPE_WARNING, m,p1);}
   1782 #define DUN_TRACE_WARNING2(m,p1,p2)             {if (dun_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_DUN, TRACE_TYPE_WARNING, m,p1,p2);}
   1783 #define DUN_TRACE_WARNING3(m,p1,p2,p3)          {if (dun_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_DUN, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1784 #define DUN_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (dun_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_DUN, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1785 #define DUN_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (dun_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_DUN, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1786 #define DUN_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (dun_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_DUN, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1787 
   1788 #define DUN_TRACE_API0(m)                       {if (dun_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_DUN, TRACE_TYPE_API, m);}
   1789 #define DUN_TRACE_API1(m,p1)                    {if (dun_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_DUN, TRACE_TYPE_API, m, p1);}
   1790 #define DUN_TRACE_API2(m,p1,p2)                 {if (dun_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_DUN, TRACE_TYPE_API, m,p1,p2);}
   1791 #define DUN_TRACE_API3(m,p1,p2,p3)              {if (dun_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_DUN, TRACE_TYPE_API, m,p1,p2,p3);}
   1792 #define DUN_TRACE_API4(m,p1,p2,p3,p4)           {if (dun_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_DUN, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1793 #define DUN_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (dun_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_DUN, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1794 #define DUN_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (dun_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_DUN, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1795 
   1796 #define DUN_TRACE_EVENT0(m)                     {if (dun_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_DUN, TRACE_TYPE_EVENT, m);}
   1797 #define DUN_TRACE_EVENT1(m,p1)                  {if (dun_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_DUN, TRACE_TYPE_EVENT, m, p1);}
   1798 #define DUN_TRACE_EVENT2(m,p1,p2)               {if (dun_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_DUN, TRACE_TYPE_EVENT, m,p1,p2);}
   1799 #define DUN_TRACE_EVENT3(m,p1,p2,p3)            {if (dun_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_DUN, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1800 #define DUN_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (dun_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_DUN, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1801 #define DUN_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (dun_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_DUN, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1802 #define DUN_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_DUN, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1803 
   1804 #define DUN_TRACE_DEBUG0(m)                     {if (dun_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_DUN, TRACE_TYPE_DEBUG, m);}
   1805 #define DUN_TRACE_DEBUG1(m,p1)                  {if (dun_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_DUN, TRACE_TYPE_DEBUG, m,p1);}
   1806 #define DUN_TRACE_DEBUG2(m,p1,p2)               {if (dun_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_DUN, TRACE_TYPE_DEBUG, m,p1,p2);}
   1807 #define DUN_TRACE_DEBUG3(m,p1,p2,p3)            {if (dun_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_DUN, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1808 #define DUN_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (dun_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_DUN, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1809 #define DUN_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (dun_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_DUN, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1810 #define DUN_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (dun_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_DUN, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1811 
   1812 /* define traces for hardcopy cable replacement profile */
   1813 
   1814 #define HCRP_TRACE_ERROR0(m)                     {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m);}
   1815 #define HCRP_TRACE_ERROR1(m,p1)                  {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m, p1);}
   1816 #define HCRP_TRACE_ERROR2(m,p1,p2)               {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2);}
   1817 #define HCRP_TRACE_ERROR3(m,p1,p2,p3)            {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1818 #define HCRP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1819 #define HCRP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1820 #define HCRP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1821 
   1822 #define HCRP_TRACE_WARNING0(m)                   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m);}
   1823 #define HCRP_TRACE_WARNING1(m,p1)                {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1);}
   1824 #define HCRP_TRACE_WARNING2(m,p1,p2)             {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2);}
   1825 #define HCRP_TRACE_WARNING3(m,p1,p2,p3)          {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1826 #define HCRP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1827 #define HCRP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1828 #define HCRP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1829 
   1830 #define HCRP_TRACE_API0(m)                       {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_API, m);}
   1831 #define HCRP_TRACE_API1(m,p1)                    {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_API, m, p1);}
   1832 #define HCRP_TRACE_API2(m,p1,p2)                 {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2);}
   1833 #define HCRP_TRACE_API3(m,p1,p2,p3)              {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3);}
   1834 #define HCRP_TRACE_API4(m,p1,p2,p3,p4)           {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1835 #define HCRP_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1836 #define HCRP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1837 
   1838 #define HCRP_TRACE_EVENT0(m)                     {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m);}
   1839 #define HCRP_TRACE_EVENT1(m,p1)                  {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m, p1);}
   1840 #define HCRP_TRACE_EVENT2(m,p1,p2)               {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2);}
   1841 #define HCRP_TRACE_EVENT3(m,p1,p2,p3)            {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1842 #define HCRP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1843 #define HCRP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1844 #define HCRP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1845 
   1846 #define HCRP_TRACE_DEBUG0(m)                     {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m);}
   1847 #define HCRP_TRACE_DEBUG1(m,p1)                  {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1);}
   1848 #define HCRP_TRACE_DEBUG2(m,p1,p2)               {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2);}
   1849 #define HCRP_TRACE_DEBUG3(m,p1,p2,p3)            {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1850 #define HCRP_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1851 #define HCRP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1852 #define HCRP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (hcrp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1853 
   1854 /* define traces for multi-client server hardcopy cable replacement profile */
   1855 
   1856 #define HCRPM_TRACE_ERROR0(m)                     {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m);}
   1857 #define HCRPM_TRACE_ERROR1(m,p1)                  {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m, p1);}
   1858 #define HCRPM_TRACE_ERROR2(m,p1,p2)               {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2);}
   1859 #define HCRPM_TRACE_ERROR3(m,p1,p2,p3)            {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1860 #define HCRPM_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1861 #define HCRPM_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1862 #define HCRPM_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1863 
   1864 #define HCRPM_TRACE_WARNING0(m)                   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m);}
   1865 #define HCRPM_TRACE_WARNING1(m,p1)                {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1);}
   1866 #define HCRPM_TRACE_WARNING2(m,p1,p2)             {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2);}
   1867 #define HCRPM_TRACE_WARNING3(m,p1,p2,p3)          {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1868 #define HCRPM_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1869 #define HCRPM_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1870 #define HCRPM_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1871 
   1872 #define HCRPM_TRACE_API0(m)                       {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_API, m);}
   1873 #define HCRPM_TRACE_API1(m,p1)                    {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_API, m, p1);}
   1874 #define HCRPM_TRACE_API2(m,p1,p2)                 {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2);}
   1875 #define HCRPM_TRACE_API3(m,p1,p2,p3)              {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3);}
   1876 #define HCRPM_TRACE_API4(m,p1,p2,p3,p4)           {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1877 #define HCRPM_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1878 #define HCRPM_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1879 
   1880 #define HCRPM_TRACE_EVENT0(m)                     {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m);}
   1881 #define HCRPM_TRACE_EVENT1(m,p1)                  {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m, p1);}
   1882 #define HCRPM_TRACE_EVENT2(m,p1,p2)               {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2);}
   1883 #define HCRPM_TRACE_EVENT3(m,p1,p2,p3)            {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1884 #define HCRPM_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1885 #define HCRPM_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   1886 #define HCRPM_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   1887 
   1888 #define HCRPM_TRACE_DEBUG0(m)                     {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m);}
   1889 #define HCRPM_TRACE_DEBUG1(m,p1)                  {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1);}
   1890 #define HCRPM_TRACE_DEBUG2(m,p1,p2)               {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2);}
   1891 #define HCRPM_TRACE_DEBUG3(m,p1,p2,p3)            {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   1892 #define HCRPM_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   1893 #define HCRPM_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   1894 #define HCRPM_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (hcrpm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_HCRP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   1895 
   1896 /* define traces for RPC */
   1897 
   1898 #define RPC_TRACE_ERROR0(m)                      {if (rpc_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_ERROR, (m));}
   1899 #define RPC_TRACE_ERROR1(m,p1)                   {if (rpc_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_1(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_ERROR, \
   1900                                                         (m), (UINT32)(p1));}
   1901 #define RPC_TRACE_ERROR2(m,p1,p2)                {if (rpc_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_2(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_ERROR, \
   1902                                                         (m), (UINT32)(p1), (UINT32)(p2));}
   1903 #define RPC_TRACE_ERROR3(m,p1,p2,p3)             {if (rpc_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_3(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_ERROR, \
   1904                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
   1905 #define RPC_TRACE_ERROR4(m,p1,p2,p3,p4)          {if (rpc_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_4(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_ERROR, \
   1906                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
   1907 #define RPC_TRACE_ERROR5(m,p1,p2,p3,p4,p5)       {if (rpc_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_5(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_ERROR, \
   1908                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
   1909 #define RPC_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)    {if (rpc_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_6(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_ERROR, \
   1910                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
   1911 
   1912 #define RPC_TRACE_WARNING0(m)                    {if (rpc_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_WARNING, (m));}
   1913 #define RPC_TRACE_WARNING1(m,p1)                 {if (rpc_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_1(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_WARNING, \
   1914                                                         (m), (UINT32)(p1));}
   1915 #define RPC_TRACE_WARNING2(m,p1,p2)              {if (rpc_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_2(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_WARNING, \
   1916                                                         (m), (UINT32)(p1), (UINT32)(p2));}
   1917 #define RPC_TRACE_WARNING3(m,p1,p2,p3)           {if (rpc_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_3(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_WARNING, \
   1918                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
   1919 #define RPC_TRACE_WARNING4(m,p1,p2,p3,p4)        {if (rpc_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_4(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_WARNING, \
   1920                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
   1921 #define RPC_TRACE_WARNING5(m,p1,p2,p3,p4,p5)     {if (rpc_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_5(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_WARNING, \
   1922                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
   1923 #define RPC_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)  {if (rpc_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_6(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_WARNING, \
   1924                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
   1925 
   1926 #define RPC_TRACE_API0(m)                        {if (rpc_trace_level >= BT_TRACE_LEVEL_API) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_API, (m));}
   1927 #define RPC_TRACE_API1(m,p1)                     {if (rpc_trace_level >= BT_TRACE_LEVEL_API) LogMsg_1(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_API, \
   1928                                                         (m), (UINT32)(p1));}
   1929 #define RPC_TRACE_API2(m,p1,p2)                  {if (rpc_trace_level >= BT_TRACE_LEVEL_API) LogMsg_2(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_API, \
   1930                                                         (m), (UINT32)(p1), (UINT32)(p2));}
   1931 #define RPC_TRACE_API3(m,p1,p2,p3)               {if (rpc_trace_level >= BT_TRACE_LEVEL_API) LogMsg_3(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_API, \
   1932                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
   1933 #define RPC_TRACE_API4(m,p1,p2,p3,p4)            {if (rpc_trace_level >= BT_TRACE_LEVEL_API) LogMsg_4(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_API, \
   1934                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
   1935 #define RPC_TRACE_API5(m,p1,p2,p3,p4,p5)         {if (rpc_trace_level >= BT_TRACE_LEVEL_API) LogMsg_5(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_API, \
   1936                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
   1937 #define RPC_TRACE_API6(m,p1,p2,p3,p4,p5,p6)      {if (rpc_trace_level >= BT_TRACE_LEVEL_API) LogMsg_6(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_API, \
   1938                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
   1939 
   1940 #define RPC_TRACE_EVENT0(m)                      {if (rpc_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_EVENT, (m));}
   1941 #define RPC_TRACE_EVENT1(m,p1)                   {if (rpc_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_1(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_EVENT, \
   1942                                                         (m), (UINT32)(p1));}
   1943 #define RPC_TRACE_EVENT2(m,p1,p2)                {if (rpc_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_2(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_EVENT, \
   1944                                                         (m), (UINT32)(p1), (UINT32)(p2));}
   1945 #define RPC_TRACE_EVENT3(m,p1,p2,p3)             {if (rpc_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_3(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_EVENT, \
   1946                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
   1947 #define RPC_TRACE_EVENT4(m,p1,p2,p3,p4)          {if (rpc_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_4(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_EVENT, \
   1948                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
   1949 #define RPC_TRACE_EVENT5(m,p1,p2,p3,p4,p5)       {if (rpc_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_5(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_EVENT, \
   1950                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
   1951 #define RPC_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)    {if (rpc_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_6(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_EVENT, \
   1952                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
   1953 
   1954 #define RPC_TRACE_DEBUG0(m)                      {if (rpc_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_DEBUG, (m));}
   1955 #define RPC_TRACE_DEBUG1(m,p1)                   {if (rpc_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_1(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_DEBUG, \
   1956                                                         (m), (UINT32)(p1));}
   1957 #define RPC_TRACE_DEBUG2(m,p1,p2)                {if (rpc_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_2(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_DEBUG, \
   1958                                                         (m), (UINT32)(p1), (UINT32)(p2));}
   1959 #define RPC_TRACE_DEBUG3(m,p1,p2,p3)             {if (rpc_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_3(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_DEBUG, \
   1960                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
   1961 #define RPC_TRACE_DEBUG4(m,p1,p2,p3,p4)          {if (rpc_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_4(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_DEBUG, \
   1962                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
   1963 #define RPC_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)       {if (rpc_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_5(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_DEBUG, \
   1964                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
   1965 #define RPC_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)    {if (rpc_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_6(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_RPC | TRACE_TYPE_DEBUG, \
   1966                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
   1967 
   1968 /* define traces for BNEP */
   1969 
   1970 #define BNEP_TRACE_ERROR0(m)                     {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, m);}
   1971 #define BNEP_TRACE_ERROR1(m,p1)                  {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, m, p1);}
   1972 #define BNEP_TRACE_ERROR2(m,p1,p2)               {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, m,p1,p2);}
   1973 #define BNEP_TRACE_ERROR3(m,p1,p2,p3)            {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   1974 #define BNEP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   1975 #define BNEP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   1976 #define BNEP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_BNEP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   1977 
   1978 #define BNEP_TRACE_WARNING0(m)                   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, m);}
   1979 #define BNEP_TRACE_WARNING1(m,p1)                {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, m,p1);}
   1980 #define BNEP_TRACE_WARNING2(m,p1,p2)             {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, m,p1,p2);}
   1981 #define BNEP_TRACE_WARNING3(m,p1,p2,p3)          {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   1982 #define BNEP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   1983 #define BNEP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   1984 #define BNEP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_BNEP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   1985 
   1986 #define BNEP_TRACE_API0(m)                       {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_BNEP, TRACE_TYPE_API, m);}
   1987 #define BNEP_TRACE_API1(m,p1)                    {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_BNEP, TRACE_TYPE_API, m, p1);}
   1988 #define BNEP_TRACE_API2(m,p1,p2)                 {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_BNEP, TRACE_TYPE_API, m,p1,p2);}
   1989 #define BNEP_TRACE_API3(m,p1,p2,p3)              {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_BNEP, TRACE_TYPE_API, m,p1,p2,p3);}
   1990 #define BNEP_TRACE_API4(m,p1,p2,p3,p4)           {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_BNEP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   1991 #define BNEP_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_BNEP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   1992 #define BNEP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_BNEP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   1993 
   1994 #define BNEP_TRACE_EVENT0(m)                     {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, m);}
   1995 #define BNEP_TRACE_EVENT1(m,p1)                  {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, m, p1);}
   1996 #define BNEP_TRACE_EVENT2(m,p1,p2)               {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, m,p1,p2);}
   1997 #define BNEP_TRACE_EVENT3(m,p1,p2,p3)            {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   1998 #define BNEP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   1999 #define BNEP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   2000 #define BNEP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_BNEP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   2001 
   2002 #define BNEP_TRACE_DEBUG0(m)                     {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, m);}
   2003 #define BNEP_TRACE_DEBUG1(m,p1)                  {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, m,p1);}
   2004 #define BNEP_TRACE_DEBUG2(m,p1,p2)               {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, m,p1,p2);}
   2005 #define BNEP_TRACE_DEBUG3(m,p1,p2,p3)            {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   2006 #define BNEP_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   2007 #define BNEP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   2008 #define BNEP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (bnep_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_BNEP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   2009 
   2010 /* define traces for PAN */
   2011 
   2012 #define PAN_TRACE_ERROR0(m)                     {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, m);}
   2013 #define PAN_TRACE_ERROR1(m,p1)                  {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, m, p1);}
   2014 #define PAN_TRACE_ERROR2(m,p1,p2)               {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, m,p1,p2);}
   2015 #define PAN_TRACE_ERROR3(m,p1,p2,p3)            {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   2016 #define PAN_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   2017 #define PAN_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   2018 #define PAN_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_PAN, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   2019 
   2020 #define PAN_TRACE_WARNING0(m)                   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, m);}
   2021 #define PAN_TRACE_WARNING1(m,p1)                {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, m,p1);}
   2022 #define PAN_TRACE_WARNING2(m,p1,p2)             {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, m,p1,p2);}
   2023 #define PAN_TRACE_WARNING3(m,p1,p2,p3)          {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   2024 #define PAN_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   2025 #define PAN_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   2026 #define PAN_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (pan_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_PAN, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   2027 
   2028 #define PAN_TRACE_API0(m)                       {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_PAN, TRACE_TYPE_API, m);}
   2029 #define PAN_TRACE_API1(m,p1)                    {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_PAN, TRACE_TYPE_API, m, p1);}
   2030 #define PAN_TRACE_API2(m,p1,p2)                 {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_PAN, TRACE_TYPE_API, m,p1,p2);}
   2031 #define PAN_TRACE_API3(m,p1,p2,p3)              {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_PAN, TRACE_TYPE_API, m,p1,p2,p3);}
   2032 #define PAN_TRACE_API4(m,p1,p2,p3,p4)           {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_PAN, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   2033 #define PAN_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_PAN, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   2034 #define PAN_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (pan_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_PAN, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   2035 
   2036 #define PAN_TRACE_EVENT0(m)                     {if (pan_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_PAN, TRACE_TYPE_EVENT, m);}
   2037 #define PAN_TRACE_EVENT1(m,p1)                  {if (pan_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_PAN, TRACE_TYPE_EVENT, m, p1);}
   2038 #define PAN_TRACE_EVENT2(m,p1,p2)               {if (pan_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_PAN, TRACE_TYPE_EVENT, m,p1,p2);}
   2039 #define PAN_TRACE_EVENT3(m,p1,p2,p3)            {if (pan_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_PAN, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   2040 #define PAN_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (pan_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_PAN, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   2041 #define PAN_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (pan_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_PAN, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   2042 #define PAN_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_PAN, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   2043 
   2044 #define PAN_TRACE_DEBUG0(m)                     {if (pan_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_PAN, TRACE_TYPE_DEBUG, m);}
   2045 #define PAN_TRACE_DEBUG1(m,p1)                  {if (pan_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_PAN, TRACE_TYPE_DEBUG, m,p1);}
   2046 #define PAN_TRACE_DEBUG2(m,p1,p2)               {if (pan_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_PAN, TRACE_TYPE_DEBUG, m,p1,p2);}
   2047 #define PAN_TRACE_DEBUG3(m,p1,p2,p3)            {if (pan_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_PAN, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   2048 #define PAN_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (pan_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_PAN, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   2049 #define PAN_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (pan_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_PAN, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   2050 #define PAN_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (pan_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_PAN, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   2051 
   2052 /* define traces for SIM */
   2053 
   2054 #define SAP_TRACE_ERROR0(m)                     {if (sap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_SAP, TRACE_TYPE_ERROR, m);}
   2055 #define SAP_TRACE_ERROR1(m,p1)                  {if (sap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_SAP, TRACE_TYPE_ERROR, m, p1);}
   2056 #define SAP_TRACE_ERROR2(m,p1,p2)               {if (sap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_SAP, TRACE_TYPE_ERROR, m,p1,p2);}
   2057 #define SAP_TRACE_ERROR3(m,p1,p2,p3)            {if (sap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_SAP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   2058 #define SAP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (sap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_SAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   2059 #define SAP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (sap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_SAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   2060 #define SAP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (sap_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_SAP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   2061 
   2062 #define SAP_TRACE_WARNING0(m)                   {if (sap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_SAP, TRACE_TYPE_WARNING, m);}
   2063 #define SAP_TRACE_WARNING1(m,p1)                {if (sap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_SAP, TRACE_TYPE_WARNING, m,p1);}
   2064 #define SAP_TRACE_WARNING2(m,p1,p2)             {if (sap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_SAP, TRACE_TYPE_WARNING, m,p1,p2);}
   2065 #define SAP_TRACE_WARNING3(m,p1,p2,p3)          {if (sap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_SAP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   2066 #define SAP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (sap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_SAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   2067 #define SAP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (sap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_SAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   2068 #define SAP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (sap_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_SAP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   2069 
   2070 #define SAP_TRACE_API0(m)                       {if (sap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_SAP, TRACE_TYPE_API, m);}
   2071 #define SAP_TRACE_API1(m,p1)                    {if (sap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_SAP, TRACE_TYPE_API, m, p1);}
   2072 #define SAP_TRACE_API2(m,p1,p2)                 {if (sap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_SAP, TRACE_TYPE_API, m,p1,p2);}
   2073 #define SAP_TRACE_API3(m,p1,p2,p3)              {if (sap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_SAP, TRACE_TYPE_API, m,p1,p2,p3);}
   2074 #define SAP_TRACE_API4(m,p1,p2,p3,p4)           {if (sap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_SAP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   2075 #define SAP_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (sap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_SAP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   2076 #define SAP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (sap_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_SAP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   2077 
   2078 #define SAP_TRACE_EVENT0(m)                     {if (sap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_SAP, TRACE_TYPE_EVENT, m);}
   2079 #define SAP_TRACE_EVENT1(m,p1)                  {if (sap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_SAP, TRACE_TYPE_EVENT, m, p1);}
   2080 #define SAP_TRACE_EVENT2(m,p1,p2)               {if (sap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_SAP, TRACE_TYPE_EVENT, m,p1,p2);}
   2081 #define SAP_TRACE_EVENT3(m,p1,p2,p3)            {if (sap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_SAP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   2082 #define SAP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (sap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_SAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   2083 #define SAP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (sap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_SAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   2084 #define SAP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (sap_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_SAP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   2085 
   2086 #define SAP_TRACE_DEBUG0(m)                     {if (sap_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_SAP, TRACE_TYPE_DEBUG, m);}
   2087 #define SAP_TRACE_DEBUG1(m,p1)                  {if (sap_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_SAP, TRACE_TYPE_DEBUG, m,p1);}
   2088 #define SAP_TRACE_DEBUG2(m,p1,p2)               {if (sap_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_SAP, TRACE_TYPE_DEBUG, m,p1,p2);}
   2089 #define SAP_TRACE_DEBUG3(m,p1,p2,p3)            {if (sap_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_SAP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   2090 #define SAP_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (sap_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_SAP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   2091 #define SAP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (sap_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_SAP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   2092 #define SAP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (sap_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_SAP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   2093 
   2094 /* Define tracing for OPP profile
   2095 */
   2096 #define OPP_TRACE_ERROR0(m)                      {if (opp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_OPP, TRACE_TYPE_ERROR, m);}
   2097 #define OPP_TRACE_ERROR1(m,p1)                   {if (opp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_OPP, TRACE_TYPE_ERROR, m,p1);}
   2098 #define OPP_TRACE_ERROR2(m,p1,p2)                {if (opp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_OPP, TRACE_TYPE_ERROR, m,p1,p2);}
   2099 #define OPP_TRACE_ERROR3(m,p1,p2,p3)             {if (opp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_OPP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   2100 #define OPP_TRACE_ERROR4(m,p1,p2,p3,p4)          {if (opp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_OPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   2101 #define OPP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)       {if (opp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_OPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   2102 #define OPP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)    {if (opp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_OPP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   2103 
   2104 #define OPP_TRACE_WARNING0(m)                    {if (opp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_OPP, TRACE_TYPE_WARNING, m);}
   2105 #define OPP_TRACE_WARNING1(m,p1)                 {if (opp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_OPP, TRACE_TYPE_WARNING, m,p1);}
   2106 #define OPP_TRACE_WARNING2(m,p1,p2)              {if (opp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_OPP, TRACE_TYPE_WARNING, m,p1,p2);}
   2107 #define OPP_TRACE_WARNING3(m,p1,p2,p3)           {if (opp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_OPP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   2108 #define OPP_TRACE_WARNING4(m,p1,p2,p3,p4)        {if (opp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_OPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   2109 #define OPP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)     {if (opp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_OPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   2110 #define OPP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)  {if (opp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_OPP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   2111 
   2112 #define OPP_TRACE_EVENT0(m)                      {if (opp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_OPP, TRACE_TYPE_EVENT, m);}
   2113 #define OPP_TRACE_EVENT1(m,p1)                   {if (opp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_OPP, TRACE_TYPE_EVENT, m, p1);}
   2114 #define OPP_TRACE_EVENT2(m,p1,p2)                {if (opp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_OPP, TRACE_TYPE_EVENT, m,p1,p2);}
   2115 #define OPP_TRACE_EVENT3(m,p1,p2,p3)             {if (opp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_OPP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   2116 #define OPP_TRACE_EVENT4(m,p1,p2,p3,p4)          {if (opp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_OPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   2117 #define OPP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)       {if (opp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_OPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   2118 #define OPP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)    {if (opp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_OPP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   2119 
   2120 #define OPP_TRACE_DEBUG0(m)                      {if (opp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_OPP, TRACE_TYPE_DEBUG, m);}
   2121 #define OPP_TRACE_DEBUG1(m,p1)                   {if (opp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_OPP, TRACE_TYPE_DEBUG, m,p1);}
   2122 #define OPP_TRACE_DEBUG2(m,p1,p2)                {if (opp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_OPP, TRACE_TYPE_DEBUG, m,p1,p2);}
   2123 #define OPP_TRACE_DEBUG3(m,p1,p2,p3)             {if (opp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_OPP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   2124 #define OPP_TRACE_DEBUG4(m,p1,p2,p3,p4)          {if (opp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_OPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   2125 #define OPP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)       {if (opp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_OPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   2126 #define OPP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)    {if (opp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_OPP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   2127 
   2128 /* Define tracing for FTP profile
   2129 */
   2130 #define FTP_TRACE_ERROR0(m)                      {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_FTP, TRACE_TYPE_ERROR, m);}
   2131 #define FTP_TRACE_ERROR1(m,p1)                   {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_FTP, TRACE_TYPE_ERROR, m,p1);}
   2132 #define FTP_TRACE_ERROR2(m,p1,p2)                {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_FTP, TRACE_TYPE_ERROR, m,p1,p2);}
   2133 #define FTP_TRACE_ERROR3(m,p1,p2,p3)             {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_FTP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   2134 #define FTP_TRACE_ERROR4(m,p1,p2,p3,p4)          {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_FTP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   2135 #define FTP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)       {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_FTP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   2136 #define FTP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)    {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_FTP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   2137 
   2138 #define FTP_TRACE_WARNING0(m)                    {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_FTP, TRACE_TYPE_WARNING, m);}
   2139 #define FTP_TRACE_WARNING1(m,p1)                 {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_FTP, TRACE_TYPE_WARNING, m,p1);}
   2140 #define FTP_TRACE_WARNING2(m,p1,p2)              {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_FTP, TRACE_TYPE_WARNING, m,p1,p2);}
   2141 #define FTP_TRACE_WARNING3(m,p1,p2,p3)           {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_FTP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   2142 #define FTP_TRACE_WARNING4(m,p1,p2,p3,p4)        {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_FTP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   2143 #define FTP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)     {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_FTP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   2144 #define FTP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)  {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_FTP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   2145 
   2146 #define FTP_TRACE_EVENT0(m)                      {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_FTP, TRACE_TYPE_EVENT, m);}
   2147 #define FTP_TRACE_EVENT1(m,p1)                   {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_FTP, TRACE_TYPE_EVENT, m, p1);}
   2148 #define FTP_TRACE_EVENT2(m,p1,p2)                {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_FTP, TRACE_TYPE_EVENT, m,p1,p2);}
   2149 #define FTP_TRACE_EVENT3(m,p1,p2,p3)             {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_FTP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   2150 #define FTP_TRACE_EVENT4(m,p1,p2,p3,p4)          {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_FTP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   2151 #define FTP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)       {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_FTP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   2152 #define FTP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)    {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_FTP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   2153 
   2154 #define FTP_TRACE_DEBUG0(m)                      {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_FTP, TRACE_TYPE_DEBUG, m);}
   2155 #define FTP_TRACE_DEBUG1(m,p1)                   {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_FTP, TRACE_TYPE_DEBUG, m,p1);}
   2156 #define FTP_TRACE_DEBUG2(m,p1,p2)                {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_FTP, TRACE_TYPE_DEBUG, m,p1,p2);}
   2157 #define FTP_TRACE_DEBUG3(m,p1,p2,p3)             {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_FTP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   2158 #define FTP_TRACE_DEBUG4(m,p1,p2,p3,p4)          {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_FTP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   2159 #define FTP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)       {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_FTP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   2160 #define FTP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)    {if (ftp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_FTP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   2161 
   2162 /* Define tracing for the A2DP profile
   2163 */
   2164 #define A2D_TRACE_ERROR0(m)                      {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_A2D, TRACE_TYPE_ERROR,m);}
   2165 #define A2D_TRACE_ERROR1(m,p1)                   {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_A2D, TRACE_TYPE_ERROR,m,p1);}
   2166 #define A2D_TRACE_ERROR2(m,p1,p2)                {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_A2D, TRACE_TYPE_ERROR,m,p1,p2);}
   2167 #define A2D_TRACE_ERROR3(m,p1,p2,p3)             {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_A2D, TRACE_TYPE_ERROR,m,p1,p2,p3);}
   2168 #define A2D_TRACE_ERROR4(m,p1,p2,p3,p4)          {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_A2D, TRACE_TYPE_ERROR,m,p1,p2,p3,p4);}
   2169 #define A2D_TRACE_ERROR5(m,p1,p2,p3,p4,p5)       {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_A2D, TRACE_TYPE_ERROR,m,p1,p2,p3,p4,p5);}
   2170 #define A2D_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)    {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_A2D, TRACE_TYPE_ERROR,m,p1,p2,p3,p4,p5,p6);}
   2171 
   2172 #define A2D_TRACE_WARNING0(m)                    {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_A2D, TRACE_TYPE_WARNING,m);}
   2173 #define A2D_TRACE_WARNING1(m,p1)                 {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_A2D, TRACE_TYPE_WARNING,m,p1);}
   2174 #define A2D_TRACE_WARNING2(m,p1,p2)              {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_A2D, TRACE_TYPE_WARNING,m,p1,p2);}
   2175 #define A2D_TRACE_WARNING3(m,p1,p2,p3)           {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_A2D, TRACE_TYPE_WARNING,m,p1,p2,p3);}
   2176 #define A2D_TRACE_WARNING4(m,p1,p2,p3,p4)        {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_A2D, TRACE_TYPE_WARNING,m,p1,p2,p3,p4);}
   2177 #define A2D_TRACE_WARNING5(m,p1,p2,p3,p4,p5)     {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_A2D, TRACE_TYPE_WARNING,m,p1,p2,p3,p4,p5);}
   2178 #define A2D_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)  {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_A2D, TRACE_TYPE_WARNING,m,p1,p2,p3,p4,p5,p6);}
   2179 
   2180 #define A2D_TRACE_EVENT0(m)                      {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_A2D, TRACE_TYPE_EVENT,m);}
   2181 #define A2D_TRACE_EVENT1(m,p1)                   {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_A2D, TRACE_TYPE_EVENT,m, p1);}
   2182 #define A2D_TRACE_EVENT2(m,p1,p2)                {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_A2D, TRACE_TYPE_EVENT,m,p1,p2);}
   2183 #define A2D_TRACE_EVENT3(m,p1,p2,p3)             {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_A2D, TRACE_TYPE_EVENT,m,p1,p2,p3);}
   2184 #define A2D_TRACE_EVENT4(m,p1,p2,p3,p4)          {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_A2D, TRACE_TYPE_EVENT,m,p1,p2,p3,p4);}
   2185 #define A2D_TRACE_EVENT5(m,p1,p2,p3,p4,p5)       {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_A2D, TRACE_TYPE_EVENT,m,p1,p2,p3,p4,p5);}
   2186 #define A2D_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)    {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_A2D, TRACE_TYPE_EVENT,m,p1,p2,p3,p4,p5,p6);}
   2187 
   2188 #define A2D_TRACE_DEBUG0(m)                      {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_A2D, TRACE_TYPE_DEBUG,m);}
   2189 #define A2D_TRACE_DEBUG1(m,p1)                   {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_A2D, TRACE_TYPE_DEBUG,m,p1);}
   2190 #define A2D_TRACE_DEBUG2(m,p1,p2)                {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_A2D, TRACE_TYPE_DEBUG,m,p1,p2);}
   2191 #define A2D_TRACE_DEBUG3(m,p1,p2,p3)             {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_A2D, TRACE_TYPE_DEBUG,m,p1,p2,p3);}
   2192 #define A2D_TRACE_DEBUG4(m,p1,p2,p3,p4)          {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_A2D, TRACE_TYPE_DEBUG,m,p1,p2,p3,p4);}
   2193 #define A2D_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)       {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_A2D, TRACE_TYPE_DEBUG,m,p1,p2,p3,p4,p5);}
   2194 #define A2D_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)    {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_A2D, TRACE_TYPE_DEBUG,m,p1,p2,p3,p4,p5,p6);}
   2195 
   2196 #define A2D_TRACE_API0(m)                        {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_A2D, TRACE_TYPE_API,m);}
   2197 #define A2D_TRACE_API1(m,p1)                     {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_A2D, TRACE_TYPE_API,m, p1);}
   2198 #define A2D_TRACE_API2(m,p1,p2)                  {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_A2D, TRACE_TYPE_API,m,p1,p2);}
   2199 #define A2D_TRACE_API3(m,p1,p2,p3)               {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_A2D, TRACE_TYPE_API,m,p1,p2,p3);}
   2200 #define A2D_TRACE_API4(m,p1,p2,p3,p4)            {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_A2D, TRACE_TYPE_API,m,p1,p2,p3,p4);}
   2201 #define A2D_TRACE_API5(m,p1,p2,p3,p4,p5)         {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_A2D, TRACE_TYPE_API,m,p1,p2,p3,p4,p5);}
   2202 #define A2D_TRACE_API6(m,p1,p2,p3,p4,p5,p6)      {if (a2d_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_A2D, TRACE_TYPE_API,m,p1,p2,p3,p4,p5,p6);}
   2203 
   2204 /* Define tracing for the VDP profile
   2205 */
   2206 #define VDP_TRACE_ERROR0(m)                      {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m);}
   2207 #define VDP_TRACE_ERROR1(m,p1)                   {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1);}
   2208 #define VDP_TRACE_ERROR2(m,p1,p2)                {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2);}
   2209 #define VDP_TRACE_ERROR3(m,p1,p2,p3)             {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2,p3);}
   2210 #define VDP_TRACE_ERROR4(m,p1,p2,p3,p4)          {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2,p3,p4);}
   2211 #define VDP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)       {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2,p3,p4,p5);}
   2212 #define VDP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)    {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2,p3,p4,p5,p6);}
   2213 
   2214 #define VDP_TRACE_WARNING0(m)                    {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m);}
   2215 #define VDP_TRACE_WARNING1(m,p1)                 {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1);}
   2216 #define VDP_TRACE_WARNING2(m,p1,p2)              {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2);}
   2217 #define VDP_TRACE_WARNING3(m,p1,p2,p3)           {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2,p3);}
   2218 #define VDP_TRACE_WARNING4(m,p1,p2,p3,p4)        {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2,p3,p4);}
   2219 #define VDP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)     {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2,p3,p4,p5);}
   2220 #define VDP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)  {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2,p3,p4,p5,p6);}
   2221 
   2222 #define VDP_TRACE_EVENT0(m)                      {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m);}
   2223 #define VDP_TRACE_EVENT1(m,p1)                   {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m, p1);}
   2224 #define VDP_TRACE_EVENT2(m,p1,p2)                {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2);}
   2225 #define VDP_TRACE_EVENT3(m,p1,p2,p3)             {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2,p3);}
   2226 #define VDP_TRACE_EVENT4(m,p1,p2,p3,p4)          {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2,p3,p4);}
   2227 #define VDP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)       {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2,p3,p4,p5);}
   2228 #define VDP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)    {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2,p3,p4,p5,p6);}
   2229 
   2230 #define VDP_TRACE_DEBUG0(m)                      {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m);}
   2231 #define VDP_TRACE_DEBUG1(m,p1)                   {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1);}
   2232 #define VDP_TRACE_DEBUG2(m,p1,p2)                {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2);}
   2233 #define VDP_TRACE_DEBUG3(m,p1,p2,p3)             {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2,p3);}
   2234 #define VDP_TRACE_DEBUG4(m,p1,p2,p3,p4)          {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2,p3,p4);}
   2235 #define VDP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)       {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2,p3,p4,p5);}
   2236 #define VDP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)    {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2,p3,p4,p5,p6);}
   2237 
   2238 #define VDP_TRACE_API0(m)                        {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_API,m);}
   2239 #define VDP_TRACE_API1(m,p1)                     {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_API,m, p1);}
   2240 #define VDP_TRACE_API2(m,p1,p2)                  {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2);}
   2241 #define VDP_TRACE_API3(m,p1,p2,p3)               {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2,p3);}
   2242 #define VDP_TRACE_API4(m,p1,p2,p3,p4)            {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2,p3,p4);}
   2243 #define VDP_TRACE_API5(m,p1,p2,p3,p4,p5)         {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2,p3,p4,p5);}
   2244 #define VDP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)      {if (vdp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2,p3,p4,p5,p6);}
   2245 
   2246 
   2247 /* Define tracing for the LM unit
   2248 */
   2249 #define LMP_TRACE_ERROR0(m)                     {if (lmp_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_LM, TRACE_TYPE_ERROR, m);}
   2250 #define LMP_TRACE_ERROR1(m,p1)                  {if (lmp_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_LM, TRACE_TYPE_ERROR, m,p1);}
   2251 #define LMP_TRACE_ERROR2(m,p1,p2)               {if (lmp_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_LM, TRACE_TYPE_ERROR, m,p1,p2);}
   2252 #define LMP_TRACE_ERROR3(m,p1,p2,p3)            {if (lmp_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_LM, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   2253 #define LMP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (lmp_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_LM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   2254 #define LMP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (lmp_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_LM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   2255 #define LMP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (lmp_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_LM, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   2256 
   2257 #define LMP_TRACE_WARNING0(m)                   {if (lmp_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_LM, TRACE_TYPE_WARNING, m);}
   2258 #define LMP_TRACE_WARNING1(m,p1)                {if (lmp_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_LM, TRACE_TYPE_WARNING, m,p1);}
   2259 #define LMP_TRACE_WARNING2(m,p1,p2)             {if (lmp_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_LM, TRACE_TYPE_WARNING, m,p1,p2);}
   2260 #define LMP_TRACE_WARNING3(m,p1,p2,p3)          {if (lmp_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_LM, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   2261 #define LMP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (lmp_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_LM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   2262 #define LMP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (lmp_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_LM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   2263 #define LMP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (lmp_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_LM, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   2264 
   2265 #define LMP_TRACE_EVENT0(m)                     {if (lmp_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_LM, TRACE_TYPE_EVENT, m);}
   2266 #define LMP_TRACE_EVENT1(m,p1)                  {if (lmp_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_LM, TRACE_TYPE_EVENT, m, p1);}
   2267 #define LMP_TRACE_EVENT2(m,p1,p2)               {if (lmp_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_LM, TRACE_TYPE_EVENT, m,p1,p2);}
   2268 #define LMP_TRACE_EVENT3(m,p1,p2,p3)            {if (lmp_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_LM, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   2269 #define LMP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (lmp_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_LM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   2270 #define LMP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (lmp_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_LM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   2271 #define LMP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (lmp_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_LM, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   2272 
   2273 #define LMP_TRACE_DEBUG0(m)                     {if (lmp_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_LM, TRACE_TYPE_DEBUG, m);}
   2274 #define LMP_TRACE_DEBUG1(m,p1)                  {if (lmp_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_LM, TRACE_TYPE_DEBUG, m,p1);}
   2275 #define LMP_TRACE_DEBUG2(m,p1,p2)               {if (lmp_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_LM, TRACE_TYPE_DEBUG, m,p1,p2);}
   2276 #define LMP_TRACE_DEBUG3(m,p1,p2,p3)            {if (lmp_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_LM, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   2277 #define LMP_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (lmp_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_LM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   2278 #define LMP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (lmp_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_LM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   2279 #define LMP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (lmp_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_LM, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   2280 
   2281 /* Define tracing for the LC unit
   2282 */
   2283 #define LC_TRACE_ERROR0(m)                     {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_ERROR]) BT_TRACE_0(TRACE_LAYER_LC, TRACE_TYPE_ERROR, m);}
   2284 #define LC_TRACE_ERROR1(m,p1)                  {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_ERROR]) BT_TRACE_1(TRACE_LAYER_LC, TRACE_TYPE_ERROR, m,p1);}
   2285 #define LC_TRACE_ERROR2(m,p1,p2)               {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_ERROR]) BT_TRACE_2(TRACE_LAYER_LC, TRACE_TYPE_ERROR, m,p1,p2);}
   2286 #define LC_TRACE_ERROR3(m,p1,p2,p3)            {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_ERROR]) BT_TRACE_3(TRACE_LAYER_LC, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   2287 #define LC_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_ERROR]) BT_TRACE_4(TRACE_LAYER_LC, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   2288 #define LC_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_ERROR]) BT_TRACE_5(TRACE_LAYER_LC, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   2289 #define LC_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_ERROR]) BT_TRACE_6(TRACE_LAYER_LC, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   2290 
   2291 #define LC_TRACE_WARNING0(m)                   {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_WARNING]) BT_TRACE_0(TRACE_LAYER_LC, TRACE_TYPE_WARNING, m);}
   2292 #define LC_TRACE_WARNING1(m,p1)                {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_WARNING]) BT_TRACE_1(TRACE_LAYER_LC, TRACE_TYPE_WARNING, m,p1);}
   2293 #define LC_TRACE_WARNING2(m,p1,p2)             {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_WARNING]) BT_TRACE_2(TRACE_LAYER_LC, TRACE_TYPE_WARNING, m,p1,p2);}
   2294 #define LC_TRACE_WARNING3(m,p1,p2,p3)          {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_WARNING]) BT_TRACE_3(TRACE_LAYER_LC, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   2295 #define LC_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_WARNING]) BT_TRACE_4(TRACE_LAYER_LC, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   2296 #define LC_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_WARNING]) BT_TRACE_5(TRACE_LAYER_LC, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   2297 #define LC_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_WARNING]) BT_TRACE_6(TRACE_LAYER_LC, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   2298 
   2299 #define LC_TRACE_EVENT0(m)                     {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_EVENT]) BT_TRACE_0(TRACE_LAYER_LC, TRACE_TYPE_EVENT, m);}
   2300 #define LC_TRACE_EVENT1(m,p1)                  {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_EVENT]) BT_TRACE_1(TRACE_LAYER_LC, TRACE_TYPE_EVENT, m, p1);}
   2301 #define LC_TRACE_EVENT2(m,p1,p2)               {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_EVENT]) BT_TRACE_2(TRACE_LAYER_LC, TRACE_TYPE_EVENT, m,p1,p2);}
   2302 #define LC_TRACE_EVENT3(m,p1,p2,p3)            {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_EVENT]) BT_TRACE_3(TRACE_LAYER_LC, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   2303 #define LC_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_EVENT]) BT_TRACE_4(TRACE_LAYER_LC, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   2304 #define LC_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_EVENT]) BT_TRACE_5(TRACE_LAYER_LC, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   2305 #define LC_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_EVENT]) BT_TRACE_6(TRACE_LAYER_LC, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   2306 
   2307 #define LC_TRACE_DEBUG0(m)                     {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_DEBUG]) BT_TRACE_0(TRACE_LAYER_LC, TRACE_TYPE_DEBUG, m);}
   2308 #define LC_TRACE_DEBUG1(m,p1)                  {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_DEBUG]) BT_TRACE_1(TRACE_LAYER_LC, TRACE_TYPE_DEBUG, m,p1);}
   2309 #define LC_TRACE_DEBUG2(m,p1,p2)               {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_DEBUG]) BT_TRACE_2(TRACE_LAYER_LC, TRACE_TYPE_DEBUG, m,p1,p2);}
   2310 #define LC_TRACE_DEBUG3(m,p1,p2,p3)            {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_DEBUG]) BT_TRACE_3(TRACE_LAYER_LC, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   2311 #define LC_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_DEBUG]) BT_TRACE_5(TRACE_LAYER_LC, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   2312 #define LC_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (lc_trace_level & trace_map[BT_TRACE_LEVEL_DEBUG]) BT_TRACE_6(TRACE_LAYER_LC, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   2313 
   2314 /* Define tracing for the Serial Dongle Application SDA
   2315 */
   2316 #define SDA_TRACE_ERROR0(m)                     {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(m);}
   2317 #define SDA_TRACE_ERROR1(m,p1)                  {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(m,p1);}
   2318 #define SDA_TRACE_ERROR2(m,p1,p2)               {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(m,p1,p2);}
   2319 #define SDA_TRACE_ERROR3(m,p1,p2,p3)            {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(m,p1,p2,p3);}
   2320 #define SDA_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(m,p1,p2,p3,p4);}
   2321 #define SDA_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(m,p1,p2,p3,p4,p5);}
   2322 #define SDA_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(m,p1,p2,p3,p4,p5,p6);}
   2323 
   2324 #define SDA_TRACE_WARNING0(m)                   {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(m);}
   2325 #define SDA_TRACE_WARNING1(m,p1)                {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(m,p1);}
   2326 #define SDA_TRACE_WARNING2(m,p1,p2)             {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(m,p1,p2);}
   2327 #define SDA_TRACE_WARNING3(m,p1,p2,p3)          {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(m,p1,p2,p3);}
   2328 #define SDA_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(m,p1,p2,p3,p4);}
   2329 #define SDA_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(m,p1,p2,p3,p4,p5);}
   2330 #define SDA_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(m,p1,p2,p3,p4,p5,p6);}
   2331 
   2332 #define SDA_TRACE_EVENT0(m)                     {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(m);}
   2333 #define SDA_TRACE_EVENT1(m,p1)                  {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(m, p1);}
   2334 #define SDA_TRACE_EVENT2(m,p1,p2)               {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(m,p1,p2);}
   2335 #define SDA_TRACE_EVENT3(m,p1,p2,p3)            {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(m,p1,p2,p3);}
   2336 #define SDA_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(m,p1,p2,p3,p4);}
   2337 #define SDA_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(m,p1,p2,p3,p4,p5);}
   2338 #define SDA_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(m,p1,p2,p3,p4,p5,p6);}
   2339 
   2340 #define SDA_TRACE_DEBUG0(m)                     {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(m);}
   2341 #define SDA_TRACE_DEBUG1(m,p1)                  {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(m,p1);}
   2342 #define SDA_TRACE_DEBUG2(m,p1,p2)               {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(m,p1,p2);}
   2343 #define SDA_TRACE_DEBUG3(m,p1,p2,p3)            {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(m,p1,p2,p3);}
   2344 #define SDA_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(m,p1,p2,p3,p4);}
   2345 #define SDA_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(m,p1,p2,p3,p4,p5);}
   2346 #define SDA_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (sda_config_cb.sda_trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(m,p1,p2,p3,p4,p5,p6);}
   2347 
   2348 /* AVDTP
   2349 */
   2350 #define AVDT_TRACE_ERROR0(m)                     {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, m);}
   2351 #define AVDT_TRACE_ERROR1(m,p1)                  {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, m,p1);}
   2352 #define AVDT_TRACE_ERROR2(m,p1,p2)               {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, m,p1,p2);}
   2353 #define AVDT_TRACE_ERROR3(m,p1,p2,p3)            {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   2354 #define AVDT_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   2355 #define AVDT_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   2356 #define AVDT_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   2357 
   2358 #define AVDT_TRACE_WARNING0(m)                   {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, m);}
   2359 #define AVDT_TRACE_WARNING1(m,p1)                {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, m,p1);}
   2360 #define AVDT_TRACE_WARNING2(m,p1,p2)             {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, m,p1,p2);}
   2361 #define AVDT_TRACE_WARNING3(m,p1,p2,p3)          {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   2362 #define AVDT_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   2363 #define AVDT_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   2364 #define AVDT_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   2365 
   2366 #define AVDT_TRACE_EVENT0(m)                     {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, m);}
   2367 #define AVDT_TRACE_EVENT1(m,p1)                  {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, m, p1);}
   2368 #define AVDT_TRACE_EVENT2(m,p1,p2)               {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, m,p1,p2);}
   2369 #define AVDT_TRACE_EVENT3(m,p1,p2,p3)            {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   2370 #define AVDT_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   2371 #define AVDT_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   2372 #define AVDT_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   2373 
   2374 #define AVDT_TRACE_DEBUG0(m)                     {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, m);}
   2375 #define AVDT_TRACE_DEBUG1(m,p1)                  {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, m,p1);}
   2376 #define AVDT_TRACE_DEBUG2(m,p1,p2)               {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, m,p1,p2);}
   2377 #define AVDT_TRACE_DEBUG3(m,p1,p2,p3)            {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   2378 #define AVDT_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   2379 #define AVDT_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   2380 #define AVDT_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   2381 
   2382 #define AVDT_TRACE_API0(m)                     {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_API, m);}
   2383 #define AVDT_TRACE_API1(m,p1)                  {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_API, m,p1);}
   2384 #define AVDT_TRACE_API2(m,p1,p2)               {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_API, m,p1,p2);}
   2385 #define AVDT_TRACE_API3(m,p1,p2,p3)            {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_API, m,p1,p2,p3);}
   2386 #define AVDT_TRACE_API4(m,p1,p2,p3,p4)         {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   2387 #define AVDT_TRACE_API5(m,p1,p2,p3,p4,p5)      {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   2388 #define AVDT_TRACE_API6(m,p1,p2,p3,p4,p5,p6)   {if (avdt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   2389 
   2390 /* Define tracing for the AVCTP protocol
   2391 */
   2392 #define AVCT_TRACE_ERROR0(m)                     {if (avct_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, m);}
   2393 #define AVCT_TRACE_ERROR1(m,p1)                  {if (avct_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, m,p1);}
   2394 #define AVCT_TRACE_ERROR2(m,p1,p2)               {if (avct_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, m,p1,p2);}
   2395 #define AVCT_TRACE_ERROR3(m,p1,p2,p3)            {if (avct_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   2396 #define AVCT_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (avct_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   2397 #define AVCT_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (avct_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   2398 #define AVCT_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (avct_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   2399 
   2400 #define AVCT_TRACE_WARNING0(m)                   {if (avct_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, m);}
   2401 #define AVCT_TRACE_WARNING1(m,p1)                {if (avct_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, m,p1);}
   2402 #define AVCT_TRACE_WARNING2(m,p1,p2)             {if (avct_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, m,p1,p2);}
   2403 #define AVCT_TRACE_WARNING3(m,p1,p2,p3)          {if (avct_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   2404 #define AVCT_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (avct_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   2405 #define AVCT_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (avct_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   2406 #define AVCT_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (avct_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   2407 
   2408 #define AVCT_TRACE_EVENT0(m)                     {if (avct_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, m);}
   2409 #define AVCT_TRACE_EVENT1(m,p1)                  {if (avct_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, m, p1);}
   2410 #define AVCT_TRACE_EVENT2(m,p1,p2)               {if (avct_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, m,p1,p2);}
   2411 #define AVCT_TRACE_EVENT3(m,p1,p2,p3)            {if (avct_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   2412 #define AVCT_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (avct_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   2413 #define AVCT_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (avct_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   2414 #define AVCT_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (avct_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   2415 
   2416 #define AVCT_TRACE_DEBUG0(m)                     {if (avct_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, m);}
   2417 #define AVCT_TRACE_DEBUG1(m,p1)                  {if (avct_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, m,p1);}
   2418 #define AVCT_TRACE_DEBUG2(m,p1,p2)               {if (avct_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, m,p1,p2);}
   2419 #define AVCT_TRACE_DEBUG3(m,p1,p2,p3)            {if (avct_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   2420 #define AVCT_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (avct_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   2421 #define AVCT_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (avct_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   2422 #define AVCT_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (avct_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   2423 
   2424 #define AVCT_TRACE_API0(m)                     {if (avct_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_API, m);}
   2425 #define AVCT_TRACE_API1(m,p1)                  {if (avct_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_API, m,p1);}
   2426 #define AVCT_TRACE_API2(m,p1,p2)               {if (avct_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_API, m,p1,p2);}
   2427 #define AVCT_TRACE_API3(m,p1,p2,p3)            {if (avct_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_API, m,p1,p2,p3);}
   2428 #define AVCT_TRACE_API4(m,p1,p2,p3,p4)         {if (avct_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   2429 #define AVCT_TRACE_API5(m,p1,p2,p3,p4,p5)      {if (avct_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   2430 #define AVCT_TRACE_API6(m,p1,p2,p3,p4,p5,p6)   {if (avct_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   2431 
   2432 
   2433 /* Define tracing for the AVRCP profile
   2434 */
   2435 #define AVRC_TRACE_ERROR0(m)                      {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m);}
   2436 #define AVRC_TRACE_ERROR1(m,p1)                   {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1);}
   2437 #define AVRC_TRACE_ERROR2(m,p1,p2)                {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2);}
   2438 #define AVRC_TRACE_ERROR3(m,p1,p2,p3)             {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2,p3);}
   2439 #define AVRC_TRACE_ERROR4(m,p1,p2,p3,p4)          {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2,p3,p4);}
   2440 #define AVRC_TRACE_ERROR5(m,p1,p2,p3,p4,p5)       {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2,p3,p4,p5);}
   2441 #define AVRC_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)    {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_ERROR,m,p1,p2,p3,p4,p5,p6);}
   2442 
   2443 #define AVRC_TRACE_WARNING0(m)                    {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m);}
   2444 #define AVRC_TRACE_WARNING1(m,p1)                 {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1);}
   2445 #define AVRC_TRACE_WARNING2(m,p1,p2)              {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2);}
   2446 #define AVRC_TRACE_WARNING3(m,p1,p2,p3)           {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2,p3);}
   2447 #define AVRC_TRACE_WARNING4(m,p1,p2,p3,p4)        {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2,p3,p4);}
   2448 #define AVRC_TRACE_WARNING5(m,p1,p2,p3,p4,p5)     {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2,p3,p4,p5);}
   2449 #define AVRC_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)  {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_WARNING,m,p1,p2,p3,p4,p5,p6);}
   2450 
   2451 #define AVRC_TRACE_EVENT0(m)                      {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m);}
   2452 #define AVRC_TRACE_EVENT1(m,p1)                   {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m, p1);}
   2453 #define AVRC_TRACE_EVENT2(m,p1,p2)                {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2);}
   2454 #define AVRC_TRACE_EVENT3(m,p1,p2,p3)             {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2,p3);}
   2455 #define AVRC_TRACE_EVENT4(m,p1,p2,p3,p4)          {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2,p3,p4);}
   2456 #define AVRC_TRACE_EVENT5(m,p1,p2,p3,p4,p5)       {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2,p3,p4,p5);}
   2457 #define AVRC_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)    {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_EVENT,m,p1,p2,p3,p4,p5,p6);}
   2458 
   2459 #define AVRC_TRACE_DEBUG0(m)                      {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m);}
   2460 #define AVRC_TRACE_DEBUG1(m,p1)                   {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1);}
   2461 #define AVRC_TRACE_DEBUG2(m,p1,p2)                {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2);}
   2462 #define AVRC_TRACE_DEBUG3(m,p1,p2,p3)             {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2,p3);}
   2463 #define AVRC_TRACE_DEBUG4(m,p1,p2,p3,p4)          {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2,p3,p4);}
   2464 #define AVRC_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)       {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2,p3,p4,p5);}
   2465 #define AVRC_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)    {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_DEBUG,m,p1,p2,p3,p4,p5,p6);}
   2466 
   2467 #define AVRC_TRACE_API0(m)                        {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_AVP, TRACE_TYPE_API,m);}
   2468 #define AVRC_TRACE_API1(m,p1)                     {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_AVP, TRACE_TYPE_API,m, p1);}
   2469 #define AVRC_TRACE_API2(m,p1,p2)                  {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2);}
   2470 #define AVRC_TRACE_API3(m,p1,p2,p3)               {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2,p3);}
   2471 #define AVRC_TRACE_API4(m,p1,p2,p3,p4)            {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2,p3,p4);}
   2472 #define AVRC_TRACE_API5(m,p1,p2,p3,p4,p5)         {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2,p3,p4,p5);}
   2473 #define AVRC_TRACE_API6(m,p1,p2,p3,p4,p5,p6)      {if (avrc_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_AVP, TRACE_TYPE_API,m,p1,p2,p3,p4,p5,p6);}
   2474 
   2475 /* MCAP
   2476 */
   2477 #define MCA_TRACE_ERROR0(m)                     {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, m);}
   2478 #define MCA_TRACE_ERROR1(m,p1)                  {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, m,p1);}
   2479 #define MCA_TRACE_ERROR2(m,p1,p2)               {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, m,p1,p2);}
   2480 #define MCA_TRACE_ERROR3(m,p1,p2,p3)            {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   2481 #define MCA_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   2482 #define MCA_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   2483 #define MCA_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (mca_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_MCA, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   2484 
   2485 #define MCA_TRACE_WARNING0(m)                   {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, m);}
   2486 #define MCA_TRACE_WARNING1(m,p1)                {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, m,p1);}
   2487 #define MCA_TRACE_WARNING2(m,p1,p2)             {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, m,p1,p2);}
   2488 #define MCA_TRACE_WARNING3(m,p1,p2,p3)          {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   2489 #define MCA_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   2490 #define MCA_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   2491 #define MCA_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (mca_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_MCA, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   2492 
   2493 #define MCA_TRACE_EVENT0(m)                     {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, m);}
   2494 #define MCA_TRACE_EVENT1(m,p1)                  {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, m, p1);}
   2495 #define MCA_TRACE_EVENT2(m,p1,p2)               {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, m,p1,p2);}
   2496 #define MCA_TRACE_EVENT3(m,p1,p2,p3)            {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   2497 #define MCA_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   2498 #define MCA_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   2499 #define MCA_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (mca_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_MCA, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   2500 
   2501 #define MCA_TRACE_DEBUG0(m)                     {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, m);}
   2502 #define MCA_TRACE_DEBUG1(m,p1)                  {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, m,p1);}
   2503 #define MCA_TRACE_DEBUG2(m,p1,p2)               {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, m,p1,p2);}
   2504 #define MCA_TRACE_DEBUG3(m,p1,p2,p3)            {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   2505 #define MCA_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   2506 #define MCA_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   2507 #define MCA_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (mca_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_MCA, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   2508 
   2509 #define MCA_TRACE_API0(m)                     {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_MCA, TRACE_TYPE_API, m);}
   2510 #define MCA_TRACE_API1(m,p1)                  {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_MCA, TRACE_TYPE_API, m,p1);}
   2511 #define MCA_TRACE_API2(m,p1,p2)               {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_MCA, TRACE_TYPE_API, m,p1,p2);}
   2512 #define MCA_TRACE_API3(m,p1,p2,p3)            {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_MCA, TRACE_TYPE_API, m,p1,p2,p3);}
   2513 #define MCA_TRACE_API4(m,p1,p2,p3,p4)         {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_MCA, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   2514 #define MCA_TRACE_API5(m,p1,p2,p3,p4,p5)      {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_MCA, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   2515 #define MCA_TRACE_API6(m,p1,p2,p3,p4,p5,p6)   {if (mca_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_MCA, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   2516 
   2517 /* Define tracing for the AMP unit
   2518 */
   2519 #define AMP_TRACE_ERROR0(m)                     {if (amp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_AMP, TRACE_TYPE_ERROR, m);}
   2520 #define AMP_TRACE_ERROR1(m,p1)                  {if (amp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_AMP, TRACE_TYPE_ERROR, m,p1);}
   2521 #define AMP_TRACE_ERROR2(m,p1,p2)               {if (amp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_AMP, TRACE_TYPE_ERROR, m,p1,p2);}
   2522 #define AMP_TRACE_ERROR3(m,p1,p2,p3)            {if (amp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_AMP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   2523 #define AMP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (amp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_AMP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   2524 #define AMP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (amp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_AMP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   2525 #define AMP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (amp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_AMP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   2526 
   2527 #define AMP_TRACE_WARNING0(m)                   {if (amp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_AMP, TRACE_TYPE_WARNING, m);}
   2528 #define AMP_TRACE_WARNING1(m,p1)                {if (amp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_AMP, TRACE_TYPE_WARNING, m,p1);}
   2529 #define AMP_TRACE_WARNING2(m,p1,p2)             {if (amp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_AMP, TRACE_TYPE_WARNING, m,p1,p2);}
   2530 #define AMP_TRACE_WARNING3(m,p1,p2,p3)          {if (amp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_AMP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   2531 #define AMP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (amp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_AMP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   2532 #define AMP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (amp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_AMP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   2533 #define AMP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (amp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_AMP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   2534 
   2535 #define AMP_TRACE_API0(m)                       {if (amp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_AMP, TRACE_TYPE_API, m);}
   2536 #define AMP_TRACE_API1(m,p1)                    {if (amp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_AMP, TRACE_TYPE_API, m,p1);}
   2537 #define AMP_TRACE_API2(m,p1,p2)                 {if (amp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_AMP, TRACE_TYPE_API, m,p1,p2);}
   2538 #define AMP_TRACE_API3(m,p1,p2,p3)              {if (amp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_AMP, TRACE_TYPE_API, m,p1,p2,p3);}
   2539 #define AMP_TRACE_API4(m,p1,p2,p3,p4)           {if (amp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_AMP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   2540 #define AMP_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (amp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_AMP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   2541 #define AMP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (amp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_AMP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   2542 
   2543 #define AMP_TRACE_EVENT0(m)                     {if (amp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_AMP, TRACE_TYPE_EVENT, m);}
   2544 #define AMP_TRACE_EVENT1(m,p1)                  {if (amp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_AMP, TRACE_TYPE_EVENT, m, p1);}
   2545 #define AMP_TRACE_EVENT2(m,p1,p2)               {if (amp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_AMP, TRACE_TYPE_EVENT, m,p1,p2);}
   2546 #define AMP_TRACE_EVENT3(m,p1,p2,p3)            {if (amp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_AMP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   2547 #define AMP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (amp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_AMP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   2548 #define AMP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (amp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_AMP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   2549 #define AMP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (amp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_AMP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   2550 
   2551 #define AMP_TRACE_DEBUG0(m)                     {if (amp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_AMP, TRACE_TYPE_DEBUG, m);}
   2552 #define AMP_TRACE_DEBUG1(m,p1)                  {if (amp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_AMP, TRACE_TYPE_DEBUG, m,p1);}
   2553 #define AMP_TRACE_DEBUG2(m,p1,p2)               {if (amp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_AMP, TRACE_TYPE_DEBUG, m,p1,p2);}
   2554 #define AMP_TRACE_DEBUG3(m,p1,p2,p3)            {if (amp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_AMP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   2555 #define AMP_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (amp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_AMP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   2556 #define AMP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (amp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_AMP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   2557 #define AMP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (amp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_AMP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   2558 
   2559 /* Define tracing for the ATT/GATT unit
   2560 */
   2561 #define GATT_TRACE_ERROR0(m)                     {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, m);}
   2562 #define GATT_TRACE_ERROR1(m,p1)                  {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, m,p1);}
   2563 #define GATT_TRACE_ERROR2(m,p1,p2)               {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, m,p1,p2);}
   2564 #define GATT_TRACE_ERROR3(m,p1,p2,p3)            {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   2565 #define GATT_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   2566 #define GATT_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   2567 #define GATT_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_ATT, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   2568 
   2569 #define GATT_TRACE_WARNING0(m)                   {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, m);}
   2570 #define GATT_TRACE_WARNING1(m,p1)                {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, m,p1);}
   2571 #define GATT_TRACE_WARNING2(m,p1,p2)             {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, m,p1,p2);}
   2572 #define GATT_TRACE_WARNING3(m,p1,p2,p3)          {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   2573 #define GATT_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   2574 #define GATT_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   2575 #define GATT_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_ATT, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   2576 
   2577 #define GATT_TRACE_API0(m)                       {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_ATT, TRACE_TYPE_API, m);}
   2578 #define GATT_TRACE_API1(m,p1)                    {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_ATT, TRACE_TYPE_API, m,p1);}
   2579 #define GATT_TRACE_API2(m,p1,p2)                 {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_ATT, TRACE_TYPE_API, m,p1,p2);}
   2580 #define GATT_TRACE_API3(m,p1,p2,p3)              {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_ATT, TRACE_TYPE_API, m,p1,p2,p3);}
   2581 #define GATT_TRACE_API4(m,p1,p2,p3,p4)           {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_ATT, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   2582 #define GATT_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_ATT, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   2583 #define GATT_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_ATT, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   2584 
   2585 #define GATT_TRACE_EVENT0(m)                     {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, m);}
   2586 #define GATT_TRACE_EVENT1(m,p1)                  {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, m, p1);}
   2587 #define GATT_TRACE_EVENT2(m,p1,p2)               {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, m,p1,p2);}
   2588 #define GATT_TRACE_EVENT3(m,p1,p2,p3)            {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   2589 #define GATT_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   2590 #define GATT_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   2591 #define GATT_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_ATT, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   2592 
   2593 #define GATT_TRACE_DEBUG0(m)                     {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, m);}
   2594 #define GATT_TRACE_DEBUG1(m,p1)                  {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, m,p1);}
   2595 #define GATT_TRACE_DEBUG2(m,p1,p2)               {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, m,p1,p2);}
   2596 #define GATT_TRACE_DEBUG3(m,p1,p2,p3)            {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   2597 #define GATT_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   2598 #define GATT_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   2599 #define GATT_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_ATT, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   2600 
   2601 /* Define tracing for the SMP unit
   2602 */
   2603 #define SMP_TRACE_ERROR0(m)                     {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_0(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, m);}
   2604 #define SMP_TRACE_ERROR1(m,p1)                  {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_1(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, m,p1);}
   2605 #define SMP_TRACE_ERROR2(m,p1,p2)               {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_2(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, m,p1,p2);}
   2606 #define SMP_TRACE_ERROR3(m,p1,p2,p3)            {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_3(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, m,p1,p2,p3);}
   2607 #define SMP_TRACE_ERROR4(m,p1,p2,p3,p4)         {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_4(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4);}
   2608 #define SMP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)      {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_5(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5);}
   2609 #define SMP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)   {if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR) BT_TRACE_6(TRACE_LAYER_SMP, TRACE_TYPE_ERROR, m,p1,p2,p3,p4,p5,p6);}
   2610 
   2611 #define SMP_TRACE_WARNING0(m)                   {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_0(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, m);}
   2612 #define SMP_TRACE_WARNING1(m,p1)                {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_1(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, m,p1);}
   2613 #define SMP_TRACE_WARNING2(m,p1,p2)             {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_2(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, m,p1,p2);}
   2614 #define SMP_TRACE_WARNING3(m,p1,p2,p3)          {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_3(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, m,p1,p2,p3);}
   2615 #define SMP_TRACE_WARNING4(m,p1,p2,p3,p4)       {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_4(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4);}
   2616 #define SMP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)    {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_5(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5);}
   2617 #define SMP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING) BT_TRACE_6(TRACE_LAYER_SMP, TRACE_TYPE_WARNING, m,p1,p2,p3,p4,p5,p6);}
   2618 
   2619 #define SMP_TRACE_API0(m)                       {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_0(TRACE_LAYER_SMP, TRACE_TYPE_API, m);}
   2620 #define SMP_TRACE_API1(m,p1)                    {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_1(TRACE_LAYER_SMP, TRACE_TYPE_API, m,p1);}
   2621 #define SMP_TRACE_API2(m,p1,p2)                 {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_2(TRACE_LAYER_SMP, TRACE_TYPE_API, m,p1,p2);}
   2622 #define SMP_TRACE_API3(m,p1,p2,p3)              {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_3(TRACE_LAYER_SMP, TRACE_TYPE_API, m,p1,p2,p3);}
   2623 #define SMP_TRACE_API4(m,p1,p2,p3,p4)           {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_4(TRACE_LAYER_SMP, TRACE_TYPE_API, m,p1,p2,p3,p4);}
   2624 #define SMP_TRACE_API5(m,p1,p2,p3,p4,p5)        {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_5(TRACE_LAYER_SMP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5);}
   2625 #define SMP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)     {if (smp_cb.trace_level >= BT_TRACE_LEVEL_API) BT_TRACE_6(TRACE_LAYER_SMP, TRACE_TYPE_API, m,p1,p2,p3,p4,p5,p6);}
   2626 
   2627 #define SMP_TRACE_EVENT0(m)                     {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_0(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, m);}
   2628 #define SMP_TRACE_EVENT1(m,p1)                  {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_1(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, m, p1);}
   2629 #define SMP_TRACE_EVENT2(m,p1,p2)               {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_2(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, m,p1,p2);}
   2630 #define SMP_TRACE_EVENT3(m,p1,p2,p3)            {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_3(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, m,p1,p2,p3);}
   2631 #define SMP_TRACE_EVENT4(m,p1,p2,p3,p4)         {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_4(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4);}
   2632 #define SMP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)      {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_5(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5);}
   2633 #define SMP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)   {if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT) BT_TRACE_6(TRACE_LAYER_SMP, TRACE_TYPE_EVENT, m,p1,p2,p3,p4,p5,p6);}
   2634 
   2635 #define SMP_TRACE_DEBUG0(m)                     {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_0(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, m);}
   2636 #define SMP_TRACE_DEBUG1(m,p1)                  {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_1(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, m,p1);}
   2637 #define SMP_TRACE_DEBUG2(m,p1,p2)               {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_2(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, m,p1,p2);}
   2638 #define SMP_TRACE_DEBUG3(m,p1,p2,p3)            {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_3(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, m,p1,p2,p3);}
   2639 #define SMP_TRACE_DEBUG4(m,p1,p2,p3,p4)         {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_4(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4);}
   2640 #define SMP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)      {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_5(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5);}
   2641 #define SMP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)   {if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG) BT_TRACE_6(TRACE_LAYER_SMP, TRACE_TYPE_DEBUG, m,p1,p2,p3,p4,p5,p6);}
   2642 
   2643 /* END OF USE TRACES */
   2644 #else
   2645 
   2646 #define BT_TRACE_0(l,t,m)
   2647 #define BT_TRACE_1(l,t,m,p1)
   2648 #define BT_TRACE_2(l,t,m,p1,p2)
   2649 #define BT_TRACE_3(l,t,m,p1,p2,p3)
   2650 #define BT_TRACE_4(l,t,m,p1,p2,p3,p4)
   2651 #define BT_TRACE_5(l,t,m,p1,p2,p3,p4,p5)
   2652 #define BT_TRACE_6(l,t,m,p1,p2,p3,p4,p5,p6)
   2653 
   2654 #define BT_ERROR_TRACE_0(l,m)
   2655 #define BT_ERROR_TRACE_1(l,m,p1)
   2656 #define BT_ERROR_TRACE_2(l,m,p1,p2)
   2657 #define BT_ERROR_TRACE_3(l,m,p1,p2,p3)
   2658 
   2659 /* Define tracing for the HCI unit
   2660 */
   2661 #define HCI_TRACE_ERROR0(m)
   2662 #define HCI_TRACE_ERROR1(m,p1)
   2663 #define HCI_TRACE_ERROR2(m,p1,p2)
   2664 #define HCI_TRACE_ERROR3(m,p1,p2,p3)
   2665 #define HCI_TRACE_ERROR4(m,p1,p2,p3,p4)
   2666 #define HCI_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   2667 #define HCI_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   2668 
   2669 #define HCI_TRACE_WARNING0(m)
   2670 #define HCI_TRACE_WARNING1(m,p1)
   2671 #define HCI_TRACE_WARNING2(m,p1,p2)
   2672 #define HCI_TRACE_WARNING3(m,p1,p2,p3)
   2673 #define HCI_TRACE_WARNING4(m,p1,p2,p3,p4)
   2674 #define HCI_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   2675 #define HCI_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   2676 
   2677 #define HCI_TRACE_EVENT0(m)
   2678 #define HCI_TRACE_EVENT1(m,p1)
   2679 #define HCI_TRACE_EVENT2(m,p1,p2)
   2680 #define HCI_TRACE_EVENT3(m,p1,p2,p3)
   2681 #define HCI_TRACE_EVENT4(m,p1,p2,p3,p4)
   2682 #define HCI_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   2683 #define HCI_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   2684 
   2685 #define HCI_TRACE_DEBUG0(m)
   2686 #define HCI_TRACE_DEBUG1(m,p1)
   2687 #define HCI_TRACE_DEBUG2(m,p1,p2)
   2688 #define HCI_TRACE_DEBUG3(m,p1,p2,p3)
   2689 #define HCI_TRACE_DEBUG4(m,p1,p2,p3,p4)
   2690 #define HCI_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   2691 #define HCI_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   2692 
   2693 
   2694 /* Define tracing for BTM
   2695 */
   2696 #define BTM_TRACE_ERROR0(m)
   2697 #define BTM_TRACE_ERROR1(m,p1)
   2698 #define BTM_TRACE_ERROR2(m,p1,p2)
   2699 #define BTM_TRACE_ERROR3(m,p1,p2,p3)
   2700 #define BTM_TRACE_ERROR4(m,p1,p2,p3,p4)
   2701 #define BTM_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   2702 #define BTM_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   2703 
   2704 #define BTM_TRACE_WARNING0(m)
   2705 #define BTM_TRACE_WARNING1(m,p1)
   2706 #define BTM_TRACE_WARNING2(m,p1,p2)
   2707 #define BTM_TRACE_WARNING3(m,p1,p2,p3)
   2708 #define BTM_TRACE_WARNING4(m,p1,p2,p3,p4)
   2709 #define BTM_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   2710 #define BTM_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   2711 
   2712 #define BTM_TRACE_API0(m)
   2713 #define BTM_TRACE_API1(m,p1)
   2714 #define BTM_TRACE_API2(m,p1,p2)
   2715 #define BTM_TRACE_API3(m,p1,p2,p3)
   2716 #define BTM_TRACE_API4(m,p1,p2,p3,p4)
   2717 #define BTM_TRACE_API5(m,p1,p2,p3,p4,p5)
   2718 #define BTM_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   2719 
   2720 #define BTM_TRACE_EVENT0(m)
   2721 #define BTM_TRACE_EVENT1(m,p1)
   2722 #define BTM_TRACE_EVENT2(m,p1,p2)
   2723 #define BTM_TRACE_EVENT3(m,p1,p2,p3)
   2724 #define BTM_TRACE_EVENT4(m,p1,p2,p3,p4)
   2725 #define BTM_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   2726 #define BTM_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   2727 
   2728 #define BTM_TRACE_DEBUG0(m)
   2729 #define BTM_TRACE_DEBUG1(m,p1)
   2730 #define BTM_TRACE_DEBUG2(m,p1,p2)
   2731 #define BTM_TRACE_DEBUG3(m,p1,p2,p3)
   2732 #define BTM_TRACE_DEBUG4(m,p1,p2,p3,p4)
   2733 #define BTM_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   2734 #define BTM_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   2735 
   2736 
   2737 /* Define tracing for the L2CAP unit
   2738 */
   2739 #define L2CAP_TRACE_ERROR0(m)
   2740 #define L2CAP_TRACE_ERROR1(m,p1)
   2741 #define L2CAP_TRACE_ERROR2(m,p1,p2)
   2742 #define L2CAP_TRACE_ERROR3(m,p1,p2,p3)
   2743 #define L2CAP_TRACE_ERROR4(m,p1,p2,p3,p4)
   2744 #define L2CAP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   2745 #define L2CAP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   2746 
   2747 #define L2CAP_TRACE_WARNING0(m)
   2748 #define L2CAP_TRACE_WARNING1(m,p1)
   2749 #define L2CAP_TRACE_WARNING2(m,p1,p2)
   2750 #define L2CAP_TRACE_WARNING3(m,p1,p2,p3)
   2751 #define L2CAP_TRACE_WARNING4(m,p1,p2,p3,p4)
   2752 #define L2CAP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   2753 #define L2CAP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   2754 
   2755 #define L2CAP_TRACE_API0(m)
   2756 #define L2CAP_TRACE_API1(m,p1)
   2757 #define L2CAP_TRACE_API2(m,p1,p2)
   2758 #define L2CAP_TRACE_API3(m,p1,p2,p3)
   2759 #define L2CAP_TRACE_API4(m,p1,p2,p3,p4)
   2760 #define L2CAP_TRACE_API5(m,p1,p2,p3,p4,p5)
   2761 #define L2CAP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   2762 
   2763 #define L2CAP_TRACE_EVENT0(m)
   2764 #define L2CAP_TRACE_EVENT1(m,p1)
   2765 #define L2CAP_TRACE_EVENT2(m,p1,p2)
   2766 #define L2CAP_TRACE_EVENT3(m,p1,p2,p3)
   2767 #define L2CAP_TRACE_EVENT4(m,p1,p2,p3,p4)
   2768 #define L2CAP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   2769 #define L2CAP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   2770 
   2771 #define L2CAP_TRACE_DEBUG0(m)
   2772 #define L2CAP_TRACE_DEBUG1(m,p1)
   2773 #define L2CAP_TRACE_DEBUG2(m,p1,p2)
   2774 #define L2CAP_TRACE_DEBUG3(m,p1,p2,p3)
   2775 #define L2CAP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   2776 #define L2CAP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   2777 #define L2CAP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   2778 
   2779 /* Define tracing for the LLCP unit
   2780 */
   2781 #define LLCP_TRACE_ERROR0(m)
   2782 #define LLCP_TRACE_ERROR1(m,p1)
   2783 #define LLCP_TRACE_ERROR2(m,p1,p2)
   2784 #define LLCP_TRACE_ERROR3(m,p1,p2,p3)
   2785 #define LLCP_TRACE_ERROR4(m,p1,p2,p3,p4)
   2786 #define LLCP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   2787 #define LLCP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   2788 
   2789 #define LLCP_TRACE_WARNING0(m)
   2790 #define LLCP_TRACE_WARNING1(m,p1)
   2791 #define LLCP_TRACE_WARNING2(m,p1,p2)
   2792 #define LLCP_TRACE_WARNING3(m,p1,p2,p3)
   2793 #define LLCP_TRACE_WARNING4(m,p1,p2,p3,p4)
   2794 #define LLCP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   2795 #define LLCP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   2796 
   2797 #define LLCP_TRACE_API0(m)
   2798 #define LLCP_TRACE_API1(m,p1)
   2799 #define LLCP_TRACE_API2(m,p1,p2)
   2800 #define LLCP_TRACE_API3(m,p1,p2,p3)
   2801 #define LLCP_TRACE_API4(m,p1,p2,p3,p4)
   2802 #define LLCP_TRACE_API5(m,p1,p2,p3,p4,p5)
   2803 #define LLCP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   2804 
   2805 #define LLCP_TRACE_EVENT0(m)
   2806 #define LLCP_TRACE_EVENT1(m,p1)
   2807 #define LLCP_TRACE_EVENT2(m,p1,p2)
   2808 #define LLCP_TRACE_EVENT3(m,p1,p2,p3)
   2809 #define LLCP_TRACE_EVENT4(m,p1,p2,p3,p4)
   2810 #define LLCP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   2811 #define LLCP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   2812 
   2813 #define LLCP_TRACE_DEBUG0(m)
   2814 #define LLCP_TRACE_DEBUG1(m,p1)
   2815 #define LLCP_TRACE_DEBUG2(m,p1,p2)
   2816 #define LLCP_TRACE_DEBUG3(m,p1,p2,p3)
   2817 #define LLCP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   2818 #define LLCP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   2819 #define LLCP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   2820 
   2821 /* Define tracing for the SDP unit
   2822 */
   2823 #define SDP_TRACE_ERROR0(m)
   2824 #define SDP_TRACE_ERROR1(m,p1)
   2825 #define SDP_TRACE_ERROR2(m,p1,p2)
   2826 #define SDP_TRACE_ERROR3(m,p1,p2,p3)
   2827 #define SDP_TRACE_ERROR4(m,p1,p2,p3,p4)
   2828 #define SDP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   2829 #define SDP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   2830 
   2831 #define SDP_TRACE_WARNING0(m)
   2832 #define SDP_TRACE_WARNING1(m,p1)
   2833 #define SDP_TRACE_WARNING2(m,p1,p2)
   2834 #define SDP_TRACE_WARNING3(m,p1,p2,p3)
   2835 #define SDP_TRACE_WARNING4(m,p1,p2,p3,p4)
   2836 #define SDP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   2837 #define SDP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   2838 
   2839 #define SDP_TRACE_API0(m)
   2840 #define SDP_TRACE_API1(m,p1)
   2841 #define SDP_TRACE_API2(m,p1,p2)
   2842 #define SDP_TRACE_API3(m,p1,p2,p3)
   2843 #define SDP_TRACE_API4(m,p1,p2,p3,p4)
   2844 #define SDP_TRACE_API5(m,p1,p2,p3,p4,p5)
   2845 #define SDP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   2846 
   2847 #define SDP_TRACE_EVENT0(m)
   2848 #define SDP_TRACE_EVENT1(m,p1)
   2849 #define SDP_TRACE_EVENT2(m,p1,p2)
   2850 #define SDP_TRACE_EVENT3(m,p1,p2,p3)
   2851 #define SDP_TRACE_EVENT4(m,p1,p2,p3,p4)
   2852 #define SDP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   2853 #define SDP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   2854 
   2855 #define SDP_TRACE_DEBUG0(m)
   2856 #define SDP_TRACE_DEBUG1(m,p1)
   2857 #define SDP_TRACE_DEBUG2(m,p1,p2)
   2858 #define SDP_TRACE_DEBUG3(m,p1,p2,p3)
   2859 #define SDP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   2860 #define SDP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   2861 #define SDP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   2862 
   2863 /* Define tracing for the RFCOMM unit
   2864 */
   2865 #define RFCOMM_TRACE_ERROR0(m)
   2866 #define RFCOMM_TRACE_ERROR1(m,p1)
   2867 #define RFCOMM_TRACE_ERROR2(m,p1,p2)
   2868 #define RFCOMM_TRACE_ERROR3(m,p1,p2,p3)
   2869 #define RFCOMM_TRACE_ERROR4(m,p1,p2,p3,p4)
   2870 #define RFCOMM_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   2871 #define RFCOMM_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   2872 
   2873 #define RFCOMM_TRACE_WARNING0(m)
   2874 #define RFCOMM_TRACE_WARNING1(m,p1)
   2875 #define RFCOMM_TRACE_WARNING2(m,p1,p2)
   2876 #define RFCOMM_TRACE_WARNING3(m,p1,p2,p3)
   2877 #define RFCOMM_TRACE_WARNING4(m,p1,p2,p3,p4)
   2878 #define RFCOMM_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   2879 #define RFCOMM_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   2880 
   2881 #define RFCOMM_TRACE_API0(m)
   2882 #define RFCOMM_TRACE_API1(m,p1)
   2883 #define RFCOMM_TRACE_API2(m,p1,p2)
   2884 #define RFCOMM_TRACE_API3(m,p1,p2,p3)
   2885 #define RFCOMM_TRACE_API4(m,p1,p2,p3,p4)
   2886 #define RFCOMM_TRACE_API5(m,p1,p2,p3,p4,p5)
   2887 #define RFCOMM_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   2888 
   2889 #define RFCOMM_TRACE_EVENT0(m)
   2890 #define RFCOMM_TRACE_EVENT1(m,p1)
   2891 #define RFCOMM_TRACE_EVENT2(m,p1,p2)
   2892 #define RFCOMM_TRACE_EVENT3(m,p1,p2,p3)
   2893 #define RFCOMM_TRACE_EVENT4(m,p1,p2,p3,p4)
   2894 #define RFCOMM_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   2895 #define RFCOMM_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   2896 
   2897 #define RFCOMM_TRACE_DEBUG0(m)
   2898 #define RFCOMM_TRACE_DEBUG1(m,p1)
   2899 #define RFCOMM_TRACE_DEBUG2(m,p1,p2)
   2900 #define RFCOMM_TRACE_DEBUG3(m,p1,p2,p3)
   2901 #define RFCOMM_TRACE_DEBUG4(m,p1,p2,p3,p4)
   2902 #define RFCOMM_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   2903 #define RFCOMM_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   2904 
   2905 /* Define tracing for Serial Port Profile
   2906 */
   2907 #define SPP_TRACE_ERROR0(m)
   2908 #define SPP_TRACE_ERROR1(m,p1)
   2909 #define SPP_TRACE_ERROR2(m,p1,p2)
   2910 #define SPP_TRACE_ERROR3(m,p1,p2,p3)
   2911 #define SPP_TRACE_ERROR4(m,p1,p2,p3,p4)
   2912 #define SPP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   2913 #define SPP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   2914 
   2915 #define SPP_TRACE_WARNING0(m)
   2916 #define SPP_TRACE_WARNING1(m,p1)
   2917 #define SPP_TRACE_WARNING2(m,p1,p2)
   2918 #define SPP_TRACE_WARNING3(m,p1,p2,p3)
   2919 #define SPP_TRACE_WARNING4(m,p1,p2,p3,p4)
   2920 #define SPP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   2921 #define SPP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   2922 
   2923 #define SPP_TRACE_EVENT0(m)
   2924 #define SPP_TRACE_EVENT1(m,p1)
   2925 #define SPP_TRACE_EVENT2(m,p1,p2)
   2926 #define SPP_TRACE_EVENT3(m,p1,p2,p3)
   2927 #define SPP_TRACE_EVENT4(m,p1,p2,p3,p4)
   2928 #define SPP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   2929 #define SPP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   2930 
   2931 #define SPP_TRACE_API0(m)
   2932 #define SPP_TRACE_API1(m,p1)
   2933 #define SPP_TRACE_API2(m,p1,p2)
   2934 #define SPP_TRACE_API3(m,p1,p2,p3)
   2935 #define SPP_TRACE_API4(m,p1,p2,p3,p4)
   2936 #define SPP_TRACE_API5(m,p1,p2,p3,p4,p5)
   2937 #define SPP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   2938 
   2939 #define SPP_TRACE_DEBUG0(m)
   2940 #define SPP_TRACE_DEBUG1(m,p1)
   2941 #define SPP_TRACE_DEBUG2(m,p1,p2)
   2942 #define SPP_TRACE_DEBUG3(m,p1,p2,p3)
   2943 #define SPP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   2944 #define SPP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   2945 #define SPP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   2946 
   2947 
   2948 /* Generic Access Profile traces */
   2949 #define GAP_TRACE_ERROR0(m)
   2950 #define GAP_TRACE_ERROR1(m,p1)
   2951 #define GAP_TRACE_ERROR2(m,p1,p2)
   2952 #define GAP_TRACE_ERROR3(m,p1,p2,p3)
   2953 #define GAP_TRACE_ERROR4(m,p1,p2,p3,p4)
   2954 #define GAP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   2955 #define GAP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   2956 
   2957 #define GAP_TRACE_EVENT0(m)
   2958 #define GAP_TRACE_EVENT1(m,p1)
   2959 #define GAP_TRACE_EVENT2(m,p1,p2)
   2960 #define GAP_TRACE_EVENT3(m,p1,p2,p3)
   2961 #define GAP_TRACE_EVENT4(m,p1,p2,p3,p4)
   2962 #define GAP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   2963 #define GAP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   2964 
   2965 #define GAP_TRACE_API0(m)
   2966 #define GAP_TRACE_API1(m,p1)
   2967 #define GAP_TRACE_API2(m,p1,p2)
   2968 #define GAP_TRACE_API3(m,p1,p2,p3)
   2969 #define GAP_TRACE_API4(m,p1,p2,p3,p4)
   2970 #define GAP_TRACE_API5(m,p1,p2,p3,p4,p5)
   2971 #define GAP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   2972 
   2973 #define GAP_TRACE_WARNING0(m)
   2974 #define GAP_TRACE_WARNING1(m,p1)
   2975 #define GAP_TRACE_WARNING2(m,p1,p2)
   2976 #define GAP_TRACE_WARNING3(m,p1,p2,p3)
   2977 #define GAP_TRACE_WARNING4(m,p1,p2,p3,p4)
   2978 #define GAP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   2979 #define GAP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   2980 
   2981 
   2982 /* Define tracing for OBX
   2983 */
   2984 #define OBX_TRACE_ERROR0(m)
   2985 #define OBX_TRACE_ERROR1(m,p1)
   2986 #define OBX_TRACE_ERROR2(m,p1,p2)
   2987 #define OBX_TRACE_ERROR3(m,p1,p2,p3)
   2988 #define OBX_TRACE_ERROR4(m,p1,p2,p3,p4)
   2989 #define OBX_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   2990 #define OBX_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   2991 
   2992 #define OBX_TRACE_WARNING0(m)
   2993 #define OBX_TRACE_WARNING1(m,p1)
   2994 #define OBX_TRACE_WARNING2(m,p1,p2)
   2995 #define OBX_TRACE_WARNING3(m,p1,p2,p3)
   2996 #define OBX_TRACE_WARNING4(m,p1,p2,p3,p4)
   2997 #define OBX_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   2998 #define OBX_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   2999 
   3000 #define OBX_TRACE_EVENT0(m)
   3001 #define OBX_TRACE_EVENT1(m,p1)
   3002 #define OBX_TRACE_EVENT2(m,p1,p2)
   3003 #define OBX_TRACE_EVENT3(m,p1,p2,p3)
   3004 #define OBX_TRACE_EVENT4(m,p1,p2,p3,p4)
   3005 #define OBX_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3006 #define OBX_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3007 
   3008 #define OBX_TRACE_DEBUG0(m)
   3009 #define OBX_TRACE_DEBUG1(m,p1)
   3010 #define OBX_TRACE_DEBUG2(m,p1,p2)
   3011 #define OBX_TRACE_DEBUG3(m,p1,p2,p3)
   3012 #define OBX_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3013 #define OBX_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3014 #define OBX_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3015 
   3016 #define OBX_TRACE_API0(m)
   3017 #define OBX_TRACE_API1(m,p1)
   3018 #define OBX_TRACE_API2(m,p1,p2)
   3019 #define OBX_TRACE_API3(m,p1,p2,p3)
   3020 #define OBX_TRACE_API4(m,p1,p2,p3,p4)
   3021 #define OBX_TRACE_API5(m,p1,p2,p3,p4,p5)
   3022 #define OBX_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3023 
   3024 /* Define tracing for GOEP application profiles
   3025 */
   3026 #define GOEP_TRACE_ERROR0(m)
   3027 #define GOEP_TRACE_ERROR1(m,p1)
   3028 #define GOEP_TRACE_ERROR2(m,p1,p2)
   3029 #define GOEP_TRACE_ERROR3(m,p1,p2,p3)
   3030 #define GOEP_TRACE_ERROR4(m,p1,p2,p3,p4)
   3031 #define GOEP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3032 #define GOEP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3033 
   3034 #define GOEP_TRACE_WARNING0(m)
   3035 #define GOEP_TRACE_WARNING1(m,p1)
   3036 #define GOEP_TRACE_WARNING2(m,p1,p2)
   3037 #define GOEP_TRACE_WARNING3(m,p1,p2,p3)
   3038 #define GOEP_TRACE_WARNING4(m,p1,p2,p3,p4)
   3039 #define GOEP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3040 #define GOEP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3041 
   3042 #define GOEP_TRACE_EVENT0(m)
   3043 #define GOEP_TRACE_EVENT1(m,p1)
   3044 #define GOEP_TRACE_EVENT2(m,p1,p2)
   3045 #define GOEP_TRACE_EVENT3(m,p1,p2,p3)
   3046 #define GOEP_TRACE_EVENT4(m,p1,p2,p3,p4)
   3047 #define GOEP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3048 #define GOEP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3049 
   3050 #define GOEP_TRACE_DEBUG0(m)
   3051 #define GOEP_TRACE_DEBUG1(m,p1)
   3052 #define GOEP_TRACE_DEBUG2(m,p1,p2)
   3053 #define GOEP_TRACE_DEBUG3(m,p1,p2,p3)
   3054 #define GOEP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3055 #define GOEP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3056 
   3057 #define GOEP_TRACE_API0(m)
   3058 #define GOEP_TRACE_API1(m,p1)
   3059 #define GOEP_TRACE_API2(m,p1,p2)
   3060 #define GOEP_TRACE_API3(m,p1,p2,p3)
   3061 #define GOEP_TRACE_API4(m,p1,p2,p3,p4)
   3062 #define GOEP_TRACE_API5(m,p1,p2,p3,p4,p5)
   3063 #define GOEP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3064 
   3065 /* Define tracing for the BPP profile
   3066 */
   3067 #define BPP_TRACE_ERROR0(m)
   3068 #define BPP_TRACE_ERROR1(m,p1)
   3069 #define BPP_TRACE_ERROR2(m,p1,p2)
   3070 #define BPP_TRACE_ERROR3(m,p1,p2,p3)
   3071 #define BPP_TRACE_ERROR4(m,p1,p2,p3,p4)
   3072 #define BPP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3073 #define BPP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3074 
   3075 #define BPP_TRACE_WARNING0(m)
   3076 #define BPP_TRACE_WARNING1(m,p1)
   3077 #define BPP_TRACE_WARNING2(m,p1,p2)
   3078 #define BPP_TRACE_WARNING3(m,p1,p2,p3)
   3079 #define BPP_TRACE_WARNING4(m,p1,p2,p3,p4)
   3080 #define BPP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3081 #define BPP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3082 
   3083 #define BPP_TRACE_EVENT0(m)
   3084 #define BPP_TRACE_EVENT1(m,p1)
   3085 #define BPP_TRACE_EVENT2(m,p1,p2)
   3086 #define BPP_TRACE_EVENT3(m,p1,p2,p3)
   3087 #define BPP_TRACE_EVENT4(m,p1,p2,p3,p4)
   3088 #define BPP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3089 #define BPP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3090 
   3091 #define BPP_TRACE_DEBUG0(m)
   3092 #define BPP_TRACE_DEBUG1(m,p1)
   3093 #define BPP_TRACE_DEBUG2(m,p1,p2)
   3094 #define BPP_TRACE_DEBUG3(m,p1,p2,p3)
   3095 #define BPP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3096 #define BPP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3097 #define BPP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3098 
   3099 #define BPP_TRACE_API0(m)
   3100 #define BPP_TRACE_API1(m,p1)
   3101 #define BPP_TRACE_API2(m,p1,p2)
   3102 #define BPP_TRACE_API3(m,p1,p2,p3)
   3103 #define BPP_TRACE_API4(m,p1,p2,p3,p4)
   3104 #define BPP_TRACE_API5(m,p1,p2,p3,p4,p5)
   3105 #define BPP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3106 
   3107 /* Define tracing for the BIP profile
   3108 */
   3109 #define BIP_TRACE_ERROR0(m)
   3110 #define BIP_TRACE_ERROR1(m,p1)
   3111 #define BIP_TRACE_ERROR2(m,p1,p2)
   3112 #define BIP_TRACE_ERROR3(m,p1,p2,p3)
   3113 #define BIP_TRACE_ERROR4(m,p1,p2,p3,p4)
   3114 #define BIP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3115 #define BIP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3116 
   3117 #define BIP_TRACE_WARNING0(m)
   3118 #define BIP_TRACE_WARNING1(m,p1)
   3119 #define BIP_TRACE_WARNING2(m,p1,p2)
   3120 #define BIP_TRACE_WARNING3(m,p1,p2,p3)
   3121 #define BIP_TRACE_WARNING4(m,p1,p2,p3,p4)
   3122 #define BIP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3123 #define BIP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3124 
   3125 #define BIP_TRACE_EVENT0(m)
   3126 #define BIP_TRACE_EVENT1(m,p1)
   3127 #define BIP_TRACE_EVENT2(m,p1,p2)
   3128 #define BIP_TRACE_EVENT3(m,p1,p2,p3)
   3129 #define BIP_TRACE_EVENT4(m,p1,p2,p3,p4)
   3130 #define BIP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3131 #define BIP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3132 
   3133 #define BIP_TRACE_DEBUG0(m)
   3134 #define BIP_TRACE_DEBUG1(m,p1)
   3135 #define BIP_TRACE_DEBUG2(m,p1,p2)
   3136 #define BIP_TRACE_DEBUG3(m,p1,p2,p3)
   3137 #define BIP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3138 #define BIP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3139 #define BIP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3140 
   3141 #define BIP_TRACE_API0(m)
   3142 #define BIP_TRACE_API1(m,p1)
   3143 #define BIP_TRACE_API2(m,p1,p2)
   3144 #define BIP_TRACE_API3(m,p1,p2,p3)
   3145 #define BIP_TRACE_API4(m,p1,p2,p3,p4)
   3146 #define BIP_TRACE_API5(m,p1,p2,p3,p4,p5)
   3147 #define BIP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3148 
   3149 /* Define tracing for TCS
   3150 */
   3151 #define TCS_TRACE_ERROR0(m)
   3152 #define TCS_TRACE_ERROR1(m,p1)
   3153 #define TCS_TRACE_ERROR2(m,p1,p2)
   3154 #define TCS_TRACE_ERROR3(m,p1,p2,p3)
   3155 #define TCS_TRACE_ERROR4(m,p1,p2,p3,p4)
   3156 #define TCS_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3157 #define TCS_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3158 
   3159 #define TCS_TRACE_WARNING0(m)
   3160 #define TCS_TRACE_WARNING1(m,p1)
   3161 #define TCS_TRACE_WARNING2(m,p1,p2)
   3162 #define TCS_TRACE_WARNING3(m,p1,p2,p3)
   3163 #define TCS_TRACE_WARNING4(m,p1,p2,p3,p4)
   3164 #define TCS_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3165 #define TCS_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3166 
   3167 #define TCS_TRACE_EVENT0(m)
   3168 #define TCS_TRACE_EVENT1(m,p1)
   3169 #define TCS_TRACE_EVENT2(m,p1,p2)
   3170 #define TCS_TRACE_EVENT3(m,p1,p2,p3)
   3171 #define TCS_TRACE_EVENT4(m,p1,p2,p3,p4)
   3172 #define TCS_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3173 #define TCS_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3174 
   3175 #define TCS_TRACE_DEBUG0(m)
   3176 #define TCS_TRACE_DEBUG1(m,p1)
   3177 #define TCS_TRACE_DEBUG2(m,p1,p2)
   3178 #define TCS_TRACE_DEBUG3(m,p1,p2,p3)
   3179 #define TCS_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3180 #define TCS_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3181 #define TCS_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3182 
   3183 #define TCS_TRACE_API0(m)
   3184 #define TCS_TRACE_API1(m,p1)
   3185 #define TCS_TRACE_API2(m,p1,p2)
   3186 #define TCS_TRACE_API3(m,p1,p2,p3)
   3187 #define TCS_TRACE_API4(m,p1,p2,p3,p4)
   3188 #define TCS_TRACE_API5(m,p1,p2,p3,p4,p5)
   3189 #define TCS_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3190 
   3191 /* Define tracing for ICP
   3192 */
   3193 #define ICP_TRACE_ERROR0(m)
   3194 #define ICP_TRACE_ERROR1(m,p1)
   3195 #define ICP_TRACE_ERROR2(m,p1,p2)
   3196 #define ICP_TRACE_ERROR3(m,p1,p2,p3)
   3197 #define ICP_TRACE_ERROR4(m,p1,p2,p3,p4)
   3198 #define ICP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3199 #define ICP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3200 
   3201 #define ICP_TRACE_WARNING0(m)
   3202 #define ICP_TRACE_WARNING1(m,p1)
   3203 #define ICP_TRACE_WARNING2(m,p1,p2)
   3204 #define ICP_TRACE_WARNING3(m,p1,p2,p3)
   3205 #define ICP_TRACE_WARNING4(m,p1,p2,p3,p4)
   3206 #define ICP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3207 #define ICP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3208 
   3209 #define ICP_TRACE_EVENT0(m)
   3210 #define ICP_TRACE_EVENT1(m,p1)
   3211 #define ICP_TRACE_EVENT2(m,p1,p2)
   3212 #define ICP_TRACE_EVENT3(m,p1,p2,p3)
   3213 #define ICP_TRACE_EVENT4(m,p1,p2,p3,p4)
   3214 #define ICP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3215 #define ICP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3216 
   3217 #define ICP_TRACE_DEBUG0(m)
   3218 #define ICP_TRACE_DEBUG1(m,p1)
   3219 #define ICP_TRACE_DEBUG2(m,p1,p2)
   3220 #define ICP_TRACE_DEBUG3(m,p1,p2,p3)
   3221 #define ICP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3222 #define ICP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3223 #define ICP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3224 
   3225 #define ICP_TRACE_API0(m)
   3226 #define ICP_TRACE_API1(m,p1)
   3227 #define ICP_TRACE_API2(m,p1,p2)
   3228 #define ICP_TRACE_API3(m,p1,p2,p3)
   3229 #define ICP_TRACE_API4(m,p1,p2,p3,p4)
   3230 #define ICP_TRACE_API5(m,p1,p2,p3,p4,p5)
   3231 #define ICP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3232 
   3233 /* Define tracing for CTP
   3234 */
   3235 #define CTP_TRACE_ERROR0(m)
   3236 #define CTP_TRACE_ERROR1(m,p1)
   3237 #define CTP_TRACE_ERROR2(m,p1,p2)
   3238 #define CTP_TRACE_ERROR3(m,p1,p2,p3)
   3239 #define CTP_TRACE_ERROR4(m,p1,p2,p3,p4)
   3240 #define CTP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3241 #define CTP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3242 
   3243 #define CTP_TRACE_WARNING0(m)
   3244 #define CTP_TRACE_WARNING1(m,p1)
   3245 #define CTP_TRACE_WARNING2(m,p1,p2)
   3246 #define CTP_TRACE_WARNING3(m,p1,p2,p3)
   3247 #define CTP_TRACE_WARNING4(m,p1,p2,p3,p4)
   3248 #define CTP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3249 #define CTP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3250 
   3251 #define CTP_TRACE_EVENT0(m)
   3252 #define CTP_TRACE_EVENT1(m,p1)
   3253 #define CTP_TRACE_EVENT2(m,p1,p2)
   3254 #define CTP_TRACE_EVENT3(m,p1,p2,p3)
   3255 #define CTP_TRACE_EVENT4(m,p1,p2,p3,p4)
   3256 #define CTP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3257 #define CTP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3258 
   3259 #define CTP_TRACE_DEBUG0(m)
   3260 #define CTP_TRACE_DEBUG1(m,p1)
   3261 #define CTP_TRACE_DEBUG2(m,p1,p2)
   3262 #define CTP_TRACE_DEBUG3(m,p1,p2,p3)
   3263 #define CTP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3264 #define CTP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3265 #define CTP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3266 
   3267 #define CTP_TRACE_API0(m)
   3268 #define CTP_TRACE_API1(m,p1)
   3269 #define CTP_TRACE_API2(m,p1,p2)
   3270 #define CTP_TRACE_API3(m,p1,p2,p3)
   3271 #define CTP_TRACE_API4(m,p1,p2,p3,p4)
   3272 #define CTP_TRACE_API5(m,p1,p2,p3,p4,p5)
   3273 #define CTP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3274 
   3275 /* define traces for headset profile */
   3276 
   3277 #define HSP2_TRACE_ERROR0(pcb,m)
   3278 #define HSP2_TRACE_ERROR1(pcb,m,p1)
   3279 #define HSP2_TRACE_ERROR2(pcb,m,p1,p2)
   3280 #define HSP2_TRACE_ERROR3(pcb,m,p1,p2,p3)
   3281 #define HSP2_TRACE_ERROR4(pcb,m,p1,p2,p3,p4)
   3282 #define HSP2_TRACE_ERROR5(pcb,m,p1,p2,p3,p4,p5)
   3283 #define HSP2_TRACE_ERROR6(pcb,m,p1,p2,p3,p4,p5,p6)
   3284 
   3285 #define HSP2_TRACE_WARNING0(pcb,m)
   3286 #define HSP2_TRACE_WARNING1(pcb,m,p1)
   3287 #define HSP2_TRACE_WARNING2(pcb,m,p1,p2)
   3288 #define HSP2_TRACE_WARNING3(pcb,m,p1,p2,p3)
   3289 #define HSP2_TRACE_WARNING4(pcb,m,p1,p2,p3,p4)
   3290 #define HSP2_TRACE_WARNING5(pcb,m,p1,p2,p3,p4,p5)
   3291 #define HSP2_TRACE_WARNING6(pcb,m,p1,p2,p3,p4,p5,p6)
   3292 
   3293 #define HSP2_TRACE_API0(pcb,m)
   3294 #define HSP2_TRACE_API1(pcb,m,p1)
   3295 #define HSP2_TRACE_API2(pcb,m,p1,p2)
   3296 #define HSP2_TRACE_API3(pcb,m,p1,p2,p3)
   3297 #define HSP2_TRACE_API4(pcb,m,p1,p2,p3,p4)
   3298 #define HSP2_TRACE_API5(pcb,m,p1,p2,p3,p4,p5)
   3299 #define HSP2_TRACE_API6(pcb,m,p1,p2,p3,p4,p5,p6)
   3300 
   3301 #define HSP2_TRACE_EVENT0(pcb,m)
   3302 #define HSP2_TRACE_EVENT1(pcb,m,p1)
   3303 #define HSP2_TRACE_EVENT2(pcb,m,p1,p2)
   3304 #define HSP2_TRACE_EVENT3(pcb,m,p1,p2,p3)
   3305 #define HSP2_TRACE_EVENT4(pcb,m,p1,p2,p3,p4)
   3306 #define HSP2_TRACE_EVENT5(pcb,m,p1,p2,p3,p4,p5)
   3307 #define HSP2_TRACE_EVENT6(pcb,m,p1,p2,p3,p4,p5,p6)
   3308 
   3309 #define HSP2_TRACE_DEBUG0(pcb,m)
   3310 #define HSP2_TRACE_DEBUG1(pcb,m,p1)
   3311 #define HSP2_TRACE_DEBUG2(pcb,m,p1,p2)
   3312 #define HSP2_TRACE_DEBUG3(pcb,m,p1,p2,p3)
   3313 #define HSP2_TRACE_DEBUG4(pcb,m,p1,p2,p3,p4)
   3314 #define HSP2_TRACE_DEBUG5(pcb,m,p1,p2,p3,p4,p5)
   3315 #define HSP2_TRACE_DEBUG6(pcb,m,p1,p2,p3,p4,p5,p6)
   3316 
   3317 /* Define tracing for the NFC unit
   3318 */
   3319 #define NFC_TRACE_ERROR0(m)
   3320 #define NFC_TRACE_ERROR1(m,p1)
   3321 #define NFC_TRACE_ERROR2(m,p1,p2)
   3322 #define NFC_TRACE_ERROR3(m,p1,p2,p3)
   3323 #define NFC_TRACE_ERROR4(m,p1,p2,p3,p4)
   3324 #define NFC_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3325 #define NFC_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3326 
   3327 #define NFC_TRACE_WARNING0(m)
   3328 #define NFC_TRACE_WARNING1(m,p1)
   3329 #define NFC_TRACE_WARNING2(m,p1,p2)
   3330 #define NFC_TRACE_WARNING3(m,p1,p2,p3)
   3331 #define NFC_TRACE_WARNING4(m,p1,p2,p3,p4)
   3332 #define NFC_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3333 #define NFC_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3334 
   3335 #define NFC_TRACE_API0(m)
   3336 #define NFC_TRACE_API1(m,p1)
   3337 #define NFC_TRACE_API2(m,p1,p2)
   3338 #define NFC_TRACE_API3(m,p1,p2,p3)
   3339 #define NFC_TRACE_API4(m,p1,p2,p3,p4)
   3340 #define NFC_TRACE_API5(m,p1,p2,p3,p4,p5)
   3341 #define NFC_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3342 
   3343 #define NFC_TRACE_EVENT0(m)
   3344 #define NFC_TRACE_EVENT1(m,p1)
   3345 #define NFC_TRACE_EVENT2(m,p1,p2)
   3346 #define NFC_TRACE_EVENT3(m,p1,p2,p3)
   3347 #define NFC_TRACE_EVENT4(m,p1,p2,p3,p4)
   3348 #define NFC_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3349 #define NFC_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3350 
   3351 #define NFC_TRACE_DEBUG0(m)
   3352 #define NFC_TRACE_DEBUG1(m,p1)
   3353 #define NFC_TRACE_DEBUG2(m,p1,p2)
   3354 #define NFC_TRACE_DEBUG3(m,p1,p2,p3)
   3355 #define NFC_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3356 #define NFC_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3357 #define NFC_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3358 
   3359 #define NCI_TRACE_ERROR0(m)
   3360 #define NCI_TRACE_ERROR1(m,p1)
   3361 #define NCI_TRACE_ERROR2(m,p1,p2)
   3362 #define NCI_TRACE_ERROR3(m,p1,p2,p3)
   3363 #define NCI_TRACE_ERROR4(m,p1,p2,p3,p4)
   3364 #define NCI_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3365 #define NCI_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3366 
   3367 #define NCI_TRACE_WARNING0(m)
   3368 #define NCI_TRACE_WARNING1(m,p1)
   3369 #define NCI_TRACE_WARNING2(m,p1,p2)
   3370 #define NCI_TRACE_WARNING3(m,p1,p2,p3)
   3371 #define NCI_TRACE_WARNING4(m,p1,p2,p3,p4)
   3372 #define NCI_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3373 #define NCI_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3374 
   3375 #define NCI_TRACE_API0(m)
   3376 #define NCI_TRACE_API1(m,p1)
   3377 #define NCI_TRACE_API2(m,p1,p2)
   3378 #define NCI_TRACE_API3(m,p1,p2,p3)
   3379 #define NCI_TRACE_API4(m,p1,p2,p3,p4)
   3380 #define NCI_TRACE_API5(m,p1,p2,p3,p4,p5)
   3381 #define NCI_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3382 
   3383 #define NCI_TRACE_EVENT0(m)
   3384 #define NCI_TRACE_EVENT1(m,p1)
   3385 #define NCI_TRACE_EVENT2(m,p1,p2)
   3386 #define NCI_TRACE_EVENT3(m,p1,p2,p3)
   3387 #define NCI_TRACE_EVENT4(m,p1,p2,p3,p4)
   3388 #define NCI_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3389 #define NCI_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3390 
   3391 #define NCI_TRACE_DEBUG0(m)
   3392 #define NCI_TRACE_DEBUG1(m,p1)
   3393 #define NCI_TRACE_DEBUG2(m,p1,p2)
   3394 #define NCI_TRACE_DEBUG3(m,p1,p2,p3)
   3395 #define NCI_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3396 #define NCI_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3397 #define NCI_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3398 
   3399 #define RW_TRACE_ERROR0(m)
   3400 #define RW_TRACE_ERROR1(m,p1)
   3401 #define RW_TRACE_ERROR2(m,p1,p2)
   3402 #define RW_TRACE_ERROR3(m,p1,p2,p3)
   3403 #define RW_TRACE_ERROR4(m,p1,p2,p3,p4)
   3404 #define RW_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3405 #define RW_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3406 
   3407 #define RW_TRACE_WARNING0(m)
   3408 #define RW_TRACE_WARNING1(m,p1)
   3409 #define RW_TRACE_WARNING2(m,p1,p2)
   3410 #define RW_TRACE_WARNING3(m,p1,p2,p3)
   3411 #define RW_TRACE_WARNING4(m,p1,p2,p3,p4)
   3412 #define RW_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3413 #define RW_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) }
   3414 
   3415 #define RW_TRACE_API0(m)
   3416 #define RW_TRACE_API1(m,p1)
   3417 #define RW_TRACE_API2(m,p1,p2)
   3418 #define RW_TRACE_API3(m,p1,p2,p3)
   3419 #define RW_TRACE_API4(m,p1,p2,p3,p4)
   3420 #define RW_TRACE_API5(m,p1,p2,p3,p4,p5)
   3421 #define RW_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3422 
   3423 #define RW_TRACE_EVENT0(m)
   3424 #define RW_TRACE_EVENT1(m,p1)
   3425 #define RW_TRACE_EVENT2(m,p1,p2)
   3426 #define RW_TRACE_EVENT3(m,p1,p2,p3)
   3427 #define RW_TRACE_EVENT4(m,p1,p2,p3,p4)
   3428 #define RW_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3429 #define RW_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3430 
   3431 #define RW_TRACE_DEBUG0(m)
   3432 #define RW_TRACE_DEBUG1(m,p1)
   3433 #define RW_TRACE_DEBUG2(m,p1,p2)
   3434 #define RW_TRACE_DEBUG3(m,p1,p2,p3)
   3435 #define RW_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3436 #define RW_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3437 #define RW_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3438 
   3439 #define CE_TRACE_ERROR0(m)
   3440 #define CE_TRACE_ERROR1(m,p1)
   3441 #define CE_TRACE_ERROR2(m,p1,p2)
   3442 #define CE_TRACE_ERROR3(m,p1,p2,p3)
   3443 #define CE_TRACE_ERROR4(m,p1,p2,p3,p4)
   3444 #define CE_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3445 #define CE_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3446 
   3447 #define CE_TRACE_WARNING0(m)
   3448 #define CE_TRACE_WARNING1(m,p1)
   3449 #define CE_TRACE_WARNING2(m,p1,p2)
   3450 #define CE_TRACE_WARNING3(m,p1,p2,p3)
   3451 #define CE_TRACE_WARNING4(m,p1,p2,p3,p4)
   3452 #define CE_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3453 #define CE_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3454 
   3455 #define CE_TRACE_API0(m)
   3456 #define CE_TRACE_API1(m,p1)
   3457 #define CE_TRACE_API2(m,p1,p2)
   3458 #define CE_TRACE_API3(m,p1,p2,p3)
   3459 #define CE_TRACE_API4(m,p1,p2,p3,p4)
   3460 #define CE_TRACE_API5(m,p1,p2,p3,p4,p5)
   3461 #define CE_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3462 
   3463 #define CE_TRACE_EVENT0(m)
   3464 #define CE_TRACE_EVENT1(m,p1)
   3465 #define CE_TRACE_EVENT2(m,p1,p2)
   3466 #define CE_TRACE_EVENT3(m,p1,p2,p3)
   3467 #define CE_TRACE_EVENT4(m,p1,p2,p3,p4)
   3468 #define CE_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3469 #define CE_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3470 
   3471 #define CE_TRACE_DEBUG0(m)
   3472 #define CE_TRACE_DEBUG1(m,p1)
   3473 #define CE_TRACE_DEBUG2(m,p1,p2)
   3474 #define CE_TRACE_DEBUG3(m,p1,p2,p3)
   3475 #define CE_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3476 #define CE_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3477 #define CE_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3478 
   3479 #define NDEF_TRACE_ERROR0(m)
   3480 #define NDEF_TRACE_ERROR1(m,p1)
   3481 #define NDEF_TRACE_ERROR2(m,p1,p2)
   3482 #define NDEF_TRACE_ERROR3(m,p1,p2,p3)
   3483 #define NDEF_TRACE_ERROR4(m,p1,p2,p3,p4)
   3484 #define NDEF_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3485 #define NDEF_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3486 
   3487 #define NDEF_TRACE_WARNING0(m)
   3488 #define NDEF_TRACE_WARNING1(m,p1)
   3489 #define NDEF_TRACE_WARNING2(m,p1,p2)
   3490 #define NDEF_TRACE_WARNING3(m,p1,p2,p3)
   3491 #define NDEF_TRACE_WARNING4(m,p1,p2,p3,p4)
   3492 #define NDEF_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3493 #define NDEF_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3494 
   3495 #define NDEF_TRACE_API0(m)
   3496 #define NDEF_TRACE_API1(m,p1)
   3497 #define NDEF_TRACE_API2(m,p1,p2)
   3498 #define NDEF_TRACE_API3(m,p1,p2,p3)
   3499 #define NDEF_TRACE_API4(m,p1,p2,p3,p4)
   3500 #define NDEF_TRACE_API5(m,p1,p2,p3,p4,p5)
   3501 #define NDEF_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3502 
   3503 #define NDEF_TRACE_EVENT0(m)
   3504 #define NDEF_TRACE_EVENT1(m,p1)
   3505 #define NDEF_TRACE_EVENT2(m,p1,p2)
   3506 #define NDEF_TRACE_EVENT3(m,p1,p2,p3)
   3507 #define NDEF_TRACE_EVENT4(m,p1,p2,p3,p4)
   3508 #define NDEF_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3509 #define NDEF_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3510 
   3511 #define NDEF_TRACE_DEBUG0(m)
   3512 #define NDEF_TRACE_DEBUG1(m,p1)
   3513 #define NDEF_TRACE_DEBUG2(m,p1,p2)
   3514 #define NDEF_TRACE_DEBUG3(m,p1,p2,p3)
   3515 #define NDEF_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3516 #define NDEF_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3517 #define NDEF_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3518 
   3519 /* Define tracing for the NFA unit
   3520 */
   3521 #define NFA_TRACE_ERROR0(m)
   3522 #define NFA_TRACE_ERROR1(m,p1)
   3523 #define NFA_TRACE_ERROR2(m,p1,p2)
   3524 #define NFA_TRACE_ERROR3(m,p1,p2,p3)
   3525 #define NFA_TRACE_ERROR4(m,p1,p2,p3,p4)
   3526 #define NFA_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3527 #define NFA_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3528 
   3529 #define NFA_TRACE_WARNING0(m)
   3530 #define NFA_TRACE_WARNING1(m,p1)
   3531 #define NFA_TRACE_WARNING2(m,p1,p2)
   3532 #define NFA_TRACE_WARNING3(m,p1,p2,p3)
   3533 #define NFA_TRACE_WARNING4(m,p1,p2,p3,p4)
   3534 #define NFA_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3535 #define NFA_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3536 
   3537 #define NFA_TRACE_API0(m)
   3538 #define NFA_TRACE_API1(m,p1)
   3539 #define NFA_TRACE_API2(m,p1,p2)
   3540 #define NFA_TRACE_API3(m,p1,p2,p3)
   3541 #define NFA_TRACE_API4(m,p1,p2,p3,p4)
   3542 #define NFA_TRACE_API5(m,p1,p2,p3,p4,p5)
   3543 #define NFA_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3544 
   3545 #define NFA_TRACE_EVENT0(m)
   3546 #define NFA_TRACE_EVENT1(m,p1)
   3547 #define NFA_TRACE_EVENT2(m,p1,p2)
   3548 #define NFA_TRACE_EVENT3(m,p1,p2,p3)
   3549 #define NFA_TRACE_EVENT4(m,p1,p2,p3,p4)
   3550 #define NFA_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3551 #define NFA_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3552 
   3553 #define NFA_TRACE_DEBUG0(m)
   3554 #define NFA_TRACE_DEBUG1(m,p1)
   3555 #define NFA_TRACE_DEBUG2(m,p1,p2)
   3556 #define NFA_TRACE_DEBUG3(m,p1,p2,p3)
   3557 #define NFA_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3558 #define NFA_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3559 #define NFA_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3560 
   3561 /* Define tracing for the NFA P2P unit
   3562 */
   3563 #define P2P_TRACE_ERROR0(m)
   3564 #define P2P_TRACE_ERROR1(m,p1)
   3565 #define P2P_TRACE_ERROR2(m,p1,p2)
   3566 #define P2P_TRACE_ERROR3(m,p1,p2,p3)
   3567 #define P2P_TRACE_ERROR4(m,p1,p2,p3,p4)
   3568 #define P2P_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3569 #define P2P_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3570 
   3571 #define P2P_TRACE_WARNING0(m)
   3572 #define P2P_TRACE_WARNING1(m,p1)
   3573 #define P2P_TRACE_WARNING2(m,p1,p2)
   3574 #define P2P_TRACE_WARNING3(m,p1,p2,p3)
   3575 #define P2P_TRACE_WARNING4(m,p1,p2,p3,p4)
   3576 #define P2P_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3577 #define P2P_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3578 
   3579 #define P2P_TRACE_API0(m)
   3580 #define P2P_TRACE_API1(m,p1)
   3581 #define P2P_TRACE_API2(m,p1,p2)
   3582 #define P2P_TRACE_API3(m,p1,p2,p3)
   3583 #define P2P_TRACE_API4(m,p1,p2,p3,p4)
   3584 #define P2P_TRACE_API5(m,p1,p2,p3,p4,p5)
   3585 #define P2P_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3586 
   3587 #define P2P_TRACE_EVENT0(m)
   3588 #define P2P_TRACE_EVENT1(m,p1)
   3589 #define P2P_TRACE_EVENT2(m,p1,p2)
   3590 #define P2P_TRACE_EVENT3(m,p1,p2,p3)
   3591 #define P2P_TRACE_EVENT4(m,p1,p2,p3,p4)
   3592 #define P2P_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3593 #define P2P_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3594 
   3595 #define P2P_TRACE_DEBUG0(m)
   3596 #define P2P_TRACE_DEBUG1(m,p1)
   3597 #define P2P_TRACE_DEBUG2(m,p1,p2)
   3598 #define P2P_TRACE_DEBUG3(m,p1,p2,p3)
   3599 #define P2P_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3600 #define P2P_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3601 #define P2P_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3602 
   3603 /* Define tracing for the NFA CHO unit
   3604 */
   3605 #define CHO_TRACE_ERROR0(m)
   3606 #define CHO_TRACE_ERROR1(m,p1)
   3607 #define CHO_TRACE_ERROR2(m,p1,p2)
   3608 #define CHO_TRACE_ERROR3(m,p1,p2,p3)
   3609 #define CHO_TRACE_ERROR4(m,p1,p2,p3,p4)
   3610 #define CHO_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3611 #define CHO_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3612 
   3613 #define CHO_TRACE_WARNING0(m)
   3614 #define CHO_TRACE_WARNING1(m,p1)
   3615 #define CHO_TRACE_WARNING2(m,p1,p2)
   3616 #define CHO_TRACE_WARNING3(m,p1,p2,p3)
   3617 #define CHO_TRACE_WARNING4(m,p1,p2,p3,p4)
   3618 #define CHO_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3619 #define CHO_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3620 
   3621 #define CHO_TRACE_API0(m)
   3622 #define CHO_TRACE_API1(m,p1)
   3623 #define CHO_TRACE_API2(m,p1,p2)
   3624 #define CHO_TRACE_API3(m,p1,p2,p3)
   3625 #define CHO_TRACE_API4(m,p1,p2,p3,p4)
   3626 #define CHO_TRACE_API5(m,p1,p2,p3,p4,p5)
   3627 #define CHO_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3628 
   3629 #define CHO_TRACE_EVENT0(m)
   3630 #define CHO_TRACE_EVENT1(m,p1)
   3631 #define CHO_TRACE_EVENT2(m,p1,p2)
   3632 #define CHO_TRACE_EVENT3(m,p1,p2,p3)
   3633 #define CHO_TRACE_EVENT4(m,p1,p2,p3,p4)
   3634 #define CHO_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3635 #define CHO_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3636 
   3637 #define CHO_TRACE_DEBUG0(m)
   3638 #define CHO_TRACE_DEBUG1(m,p1)
   3639 #define CHO_TRACE_DEBUG2(m,p1,p2)
   3640 #define CHO_TRACE_DEBUG3(m,p1,p2,p3)
   3641 #define CHO_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3642 #define CHO_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3643 #define CHO_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3644 
   3645 /* Define tracing for the NFA SNEP unit
   3646 */
   3647 #define SNEP_TRACE_ERROR0(m)
   3648 #define SNEP_TRACE_ERROR1(m,p1)
   3649 #define SNEP_TRACE_ERROR2(m,p1,p2)
   3650 #define SNEP_TRACE_ERROR3(m,p1,p2,p3)
   3651 #define SNEP_TRACE_ERROR4(m,p1,p2,p3,p4)
   3652 #define SNEP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3653 #define SNEP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3654 
   3655 #define SNEP_TRACE_WARNING0(m)
   3656 #define SNEP_TRACE_WARNING1(m,p1)
   3657 #define SNEP_TRACE_WARNING2(m,p1,p2)
   3658 #define SNEP_TRACE_WARNING3(m,p1,p2,p3)
   3659 #define SNEP_TRACE_WARNING4(m,p1,p2,p3,p4)
   3660 #define SNEP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3661 #define SNEP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3662 
   3663 #define SNEP_TRACE_API0(m)
   3664 #define SNEP_TRACE_API1(m,p1)
   3665 #define SNEP_TRACE_API2(m,p1,p2)
   3666 #define SNEP_TRACE_API3(m,p1,p2,p3)
   3667 #define SNEP_TRACE_API4(m,p1,p2,p3,p4)
   3668 #define SNEP_TRACE_API5(m,p1,p2,p3,p4,p5)
   3669 #define SNEP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3670 
   3671 #define SNEP_TRACE_EVENT0(m)
   3672 #define SNEP_TRACE_EVENT1(m,p1)
   3673 #define SNEP_TRACE_EVENT2(m,p1,p2)
   3674 #define SNEP_TRACE_EVENT3(m,p1,p2,p3)
   3675 #define SNEP_TRACE_EVENT4(m,p1,p2,p3,p4)
   3676 #define SNEP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3677 #define SNEP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3678 
   3679 #define SNEP_TRACE_DEBUG0(m)
   3680 #define SNEP_TRACE_DEBUG1(m,p1)
   3681 #define SNEP_TRACE_DEBUG2(m,p1,p2)
   3682 #define SNEP_TRACE_DEBUG3(m,p1,p2,p3)
   3683 #define SNEP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3684 #define SNEP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3685 #define SNEP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3686 
   3687 
   3688 /* define traces for HID Host */
   3689 #define HIDH_TRACE_ERROR0(m)
   3690 #define HIDH_TRACE_ERROR1(m,p1)
   3691 #define HIDH_TRACE_ERROR2(m,p1,p2)
   3692 #define HIDH_TRACE_ERROR3(m,p1,p2,p3)
   3693 #define HIDH_TRACE_ERROR4(m,p1,p2,p3,p4)
   3694 #define HIDH_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3695 #define HIDH_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3696 
   3697 #define HIDH_TRACE_WARNING0(m)
   3698 #define HIDH_TRACE_WARNING1(m,p1)
   3699 #define HIDH_TRACE_WARNING2(m,p1,p2)
   3700 #define HIDH_TRACE_WARNING3(m,p1,p2,p3)
   3701 #define HIDH_TRACE_WARNING4(m,p1,p2,p3,p4)
   3702 #define HIDH_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3703 #define HIDH_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3704 
   3705 #define HIDH_TRACE_API0(m)
   3706 #define HIDH_TRACE_API1(m,p1)
   3707 #define HIDH_TRACE_API2(m,p1,p2)
   3708 #define HIDH_TRACE_API3(m,p1,p2,p3)
   3709 #define HIDH_TRACE_API4(m,p1,p2,p3,p4)
   3710 #define HIDH_TRACE_API5(m,p1,p2,p3,p4,p5)
   3711 #define HIDH_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3712 
   3713 #define HIDH_TRACE_EVENT0(m)
   3714 #define HIDH_TRACE_EVENT1(m,p1)
   3715 #define HIDH_TRACE_EVENT2(m,p1,p2)
   3716 #define HIDH_TRACE_EVENT3(m,p1,p2,p3)
   3717 #define HIDH_TRACE_EVENT4(m,p1,p2,p3,p4)
   3718 #define HIDH_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3719 #define HIDH_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3720 
   3721 #define HIDH_TRACE_DEBUG0(m)
   3722 #define HIDH_TRACE_DEBUG1(m,p1)
   3723 #define HIDH_TRACE_DEBUG2(m,p1,p2)
   3724 #define HIDH_TRACE_DEBUG3(m,p1,p2,p3)
   3725 #define HIDH_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3726 #define HIDH_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3727 #define HIDH_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3728 
   3729 /* define traces for HID Device */
   3730 #define HIDD_TRACE_ERROR0(m)
   3731 #define HIDD_TRACE_ERROR1(m,p1)
   3732 #define HIDD_TRACE_ERROR2(m,p1,p2)
   3733 #define HIDD_TRACE_ERROR3(m,p1,p2,p3)
   3734 #define HIDD_TRACE_ERROR4(m,p1,p2,p3,p4)
   3735 #define HIDD_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3736 #define HIDD_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3737 
   3738 #define HIDD_TRACE_WARNING0(m)
   3739 #define HIDD_TRACE_WARNING1(m,p1)
   3740 #define HIDD_TRACE_WARNING2(m,p1,p2)
   3741 #define HIDD_TRACE_WARNING3(m,p1,p2,p3)
   3742 #define HIDD_TRACE_WARNING4(m,p1,p2,p3,p4)
   3743 #define HIDD_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3744 #define HIDD_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3745 
   3746 #define HIDD_TRACE_API0(m)
   3747 #define HIDD_TRACE_API1(m,p1)
   3748 #define HIDD_TRACE_API2(m,p1,p2)
   3749 #define HIDD_TRACE_API3(m,p1,p2,p3)
   3750 #define HIDD_TRACE_API4(m,p1,p2,p3,p4)
   3751 #define HIDD_TRACE_API5(m,p1,p2,p3,p4,p5)
   3752 #define HIDD_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3753 
   3754 #define HIDD_TRACE_EVENT0(m)
   3755 #define HIDD_TRACE_EVENT1(m,p1)
   3756 #define HIDD_TRACE_EVENT2(m,p1,p2)
   3757 #define HIDD_TRACE_EVENT3(m,p1,p2,p3)
   3758 #define HIDD_TRACE_EVENT4(m,p1,p2,p3,p4)
   3759 #define HIDD_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3760 #define HIDD_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3761 
   3762 #define HIDD_TRACE_DEBUG0(m)
   3763 #define HIDD_TRACE_DEBUG1(m,p1)
   3764 #define HIDD_TRACE_DEBUG2(m,p1,p2)
   3765 #define HIDD_TRACE_DEBUG3(m,p1,p2,p3)
   3766 #define HIDD_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3767 #define HIDD_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3768 #define HIDD_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3769 
   3770 /* define traces for DUN */
   3771 
   3772 #define DUN_TRACE_ERROR0(m)
   3773 #define DUN_TRACE_ERROR1(m,p1)
   3774 #define DUN_TRACE_ERROR2(m,p1,p2)
   3775 #define DUN_TRACE_ERROR3(m,p1,p2,p3)
   3776 #define DUN_TRACE_ERROR4(m,p1,p2,p3,p4)
   3777 #define DUN_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3778 #define DUN_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3779 
   3780 #define DUN_TRACE_WARNING0(m)
   3781 #define DUN_TRACE_WARNING1(m,p1)
   3782 #define DUN_TRACE_WARNING2(m,p1,p2)
   3783 #define DUN_TRACE_WARNING3(m,p1,p2,p3)
   3784 #define DUN_TRACE_WARNING4(m,p1,p2,p3,p4)
   3785 #define DUN_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3786 #define DUN_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3787 
   3788 #define DUN_TRACE_API0(m)
   3789 #define DUN_TRACE_API1(m,p1)
   3790 #define DUN_TRACE_API2(m,p1,p2)
   3791 #define DUN_TRACE_API3(m,p1,p2,p3)
   3792 #define DUN_TRACE_API4(m,p1,p2,p3,p4)
   3793 #define DUN_TRACE_API5(m,p1,p2,p3,p4,p5)
   3794 #define DUN_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3795 
   3796 #define DUN_TRACE_EVENT0(m)
   3797 #define DUN_TRACE_EVENT1(m,p1)
   3798 #define DUN_TRACE_EVENT2(m,p1,p2)
   3799 #define DUN_TRACE_EVENT3(m,p1,p2,p3)
   3800 #define DUN_TRACE_EVENT4(m,p1,p2,p3,p4)
   3801 #define DUN_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3802 #define DUN_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3803 
   3804 #define DUN_TRACE_DEBUG0(m)
   3805 #define DUN_TRACE_DEBUG1(m,p1)
   3806 #define DUN_TRACE_DEBUG2(m,p1,p2)
   3807 #define DUN_TRACE_DEBUG3(m,p1,p2,p3)
   3808 #define DUN_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3809 #define DUN_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3810 #define DUN_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3811 
   3812 /* define traces for HCRP */
   3813 
   3814 #define HCRP_TRACE_ERROR0(m)
   3815 #define HCRP_TRACE_ERROR1(m,p1)
   3816 #define HCRP_TRACE_ERROR2(m,p1,p2)
   3817 #define HCRP_TRACE_ERROR3(m,p1,p2,p3)
   3818 #define HCRP_TRACE_ERROR4(m,p1,p2,p3,p4)
   3819 #define HCRP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3820 #define HCRP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3821 
   3822 #define HCRP_TRACE_WARNING0(m)
   3823 #define HCRP_TRACE_WARNING1(m,p1)
   3824 #define HCRP_TRACE_WARNING2(m,p1,p2)
   3825 #define HCRP_TRACE_WARNING3(m,p1,p2,p3)
   3826 #define HCRP_TRACE_WARNING4(m,p1,p2,p3,p4)
   3827 #define HCRP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3828 #define HCRP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3829 
   3830 #define HCRP_TRACE_API0(m)
   3831 #define HCRP_TRACE_API1(m,p1)
   3832 #define HCRP_TRACE_API2(m,p1,p2)
   3833 #define HCRP_TRACE_API3(m,p1,p2,p3)
   3834 #define HCRP_TRACE_API4(m,p1,p2,p3,p4)
   3835 #define HCRP_TRACE_API5(m,p1,p2,p3,p4,p5)
   3836 #define HCRP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3837 
   3838 #define HCRP_TRACE_EVENT0(m)
   3839 #define HCRP_TRACE_EVENT1(m,p1)
   3840 #define HCRP_TRACE_EVENT2(m,p1,p2)
   3841 #define HCRP_TRACE_EVENT3(m,p1,p2,p3)
   3842 #define HCRP_TRACE_EVENT4(m,p1,p2,p3,p4)
   3843 #define HCRP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3844 #define HCRP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3845 
   3846 #define HCRP_TRACE_DEBUG0(m)
   3847 #define HCRP_TRACE_DEBUG1(m,p1)
   3848 #define HCRP_TRACE_DEBUG2(m,p1,p2)
   3849 #define HCRP_TRACE_DEBUG3(m,p1,p2,p3)
   3850 #define HCRP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3851 #define HCRP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3852 #define HCRP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3853 
   3854 
   3855 /* define traces for HCRP */
   3856 
   3857 #define HCRPM_TRACE_ERROR0(m)
   3858 #define HCRPM_TRACE_ERROR1(m,p1)
   3859 #define HCRPM_TRACE_ERROR2(m,p1,p2)
   3860 #define HCRPM_TRACE_ERROR3(m,p1,p2,p3)
   3861 #define HCRPM_TRACE_ERROR4(m,p1,p2,p3,p4)
   3862 #define HCRPM_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3863 #define HCRPM_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3864 
   3865 #define HCRPM_TRACE_WARNING0(m)
   3866 #define HCRPM_TRACE_WARNING1(m,p1)
   3867 #define HCRPM_TRACE_WARNING2(m,p1,p2)
   3868 #define HCRPM_TRACE_WARNING3(m,p1,p2,p3)
   3869 #define HCRPM_TRACE_WARNING4(m,p1,p2,p3,p4)
   3870 #define HCRPM_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3871 #define HCRPM_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3872 
   3873 #define HCRPM_TRACE_API0(m)
   3874 #define HCRPM_TRACE_API1(m,p1)
   3875 #define HCRPM_TRACE_API2(m,p1,p2)
   3876 #define HCRPM_TRACE_API3(m,p1,p2,p3)
   3877 #define HCRPM_TRACE_API4(m,p1,p2,p3,p4)
   3878 #define HCRPM_TRACE_API5(m,p1,p2,p3,p4,p5)
   3879 #define HCRPM_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3880 
   3881 #define HCRPM_TRACE_EVENT0(m)
   3882 #define HCRPM_TRACE_EVENT1(m,p1)
   3883 #define HCRPM_TRACE_EVENT2(m,p1,p2)
   3884 #define HCRPM_TRACE_EVENT3(m,p1,p2,p3)
   3885 #define HCRPM_TRACE_EVENT4(m,p1,p2,p3,p4)
   3886 #define HCRPM_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3887 #define HCRPM_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3888 
   3889 #define HCRPM_TRACE_DEBUG0(m)
   3890 #define HCRPM_TRACE_DEBUG1(m,p1)
   3891 #define HCRPM_TRACE_DEBUG2(m,p1,p2)
   3892 #define HCRPM_TRACE_DEBUG3(m,p1,p2,p3)
   3893 #define HCRPM_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3894 #define HCRPM_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3895 #define HCRPM_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3896 
   3897 /* define traces for RPC */
   3898 
   3899 #define RPC_TRACE_ERROR0(m)
   3900 #define RPC_TRACE_ERROR1(m,p1)
   3901 #define RPC_TRACE_ERROR2(m,p1,p2)
   3902 #define RPC_TRACE_ERROR3(m,p1,p2,p3)
   3903 #define RPC_TRACE_ERROR4(m,p1,p2,p3,p4)
   3904 #define RPC_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3905 #define RPC_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3906 
   3907 #define RPC_TRACE_WARNING0(m)
   3908 #define RPC_TRACE_WARNING1(m,p1)
   3909 #define RPC_TRACE_WARNING2(m,p1,p2)
   3910 #define RPC_TRACE_WARNING3(m,p1,p2,p3)
   3911 #define RPC_TRACE_WARNING4(m,p1,p2,p3,p4)
   3912 #define RPC_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3913 #define RPC_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3914 
   3915 #define RPC_TRACE_API0(m)
   3916 #define RPC_TRACE_API1(m,p1)
   3917 #define RPC_TRACE_API2(m,p1,p2)
   3918 #define RPC_TRACE_API3(m,p1,p2,p3)
   3919 #define RPC_TRACE_API4(m,p1,p2,p3,p4)
   3920 #define RPC_TRACE_API5(m,p1,p2,p3,p4,p5)
   3921 #define RPC_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3922 
   3923 #define RPC_TRACE_EVENT0(m)
   3924 #define RPC_TRACE_EVENT1(m,p1)
   3925 #define RPC_TRACE_EVENT2(m,p1,p2)
   3926 #define RPC_TRACE_EVENT3(m,p1,p2,p3)
   3927 #define RPC_TRACE_EVENT4(m,p1,p2,p3,p4)
   3928 #define RPC_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3929 #define RPC_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3930 
   3931 #define RPC_TRACE_DEBUG0(m)
   3932 #define RPC_TRACE_DEBUG1(m,p1)
   3933 #define RPC_TRACE_DEBUG2(m,p1,p2)
   3934 #define RPC_TRACE_DEBUG3(m,p1,p2,p3)
   3935 #define RPC_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3936 #define RPC_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3937 #define RPC_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3938 
   3939 /* define traces for BNEP */
   3940 
   3941 #define BNEP_TRACE_ERROR0(m)
   3942 #define BNEP_TRACE_ERROR1(m,p1)
   3943 #define BNEP_TRACE_ERROR2(m,p1,p2)
   3944 #define BNEP_TRACE_ERROR3(m,p1,p2,p3)
   3945 #define BNEP_TRACE_ERROR4(m,p1,p2,p3,p4)
   3946 #define BNEP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   3947 #define BNEP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   3948 
   3949 #define BNEP_TRACE_WARNING0(m)
   3950 #define BNEP_TRACE_WARNING1(m,p1)
   3951 #define BNEP_TRACE_WARNING2(m,p1,p2)
   3952 #define BNEP_TRACE_WARNING3(m,p1,p2,p3)
   3953 #define BNEP_TRACE_WARNING4(m,p1,p2,p3,p4)
   3954 #define BNEP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   3955 #define BNEP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   3956 
   3957 #define BNEP_TRACE_API0(m)
   3958 #define BNEP_TRACE_API1(m,p1)
   3959 #define BNEP_TRACE_API2(m,p1,p2)
   3960 #define BNEP_TRACE_API3(m,p1,p2,p3)
   3961 #define BNEP_TRACE_API4(m,p1,p2,p3,p4)
   3962 #define BNEP_TRACE_API5(m,p1,p2,p3,p4,p5)
   3963 #define BNEP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   3964 
   3965 #define BNEP_TRACE_EVENT0(m)
   3966 #define BNEP_TRACE_EVENT1(m,p1)
   3967 #define BNEP_TRACE_EVENT2(m,p1,p2)
   3968 #define BNEP_TRACE_EVENT3(m,p1,p2,p3)
   3969 #define BNEP_TRACE_EVENT4(m,p1,p2,p3,p4)
   3970 #define BNEP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   3971 #define BNEP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   3972 
   3973 #define BNEP_TRACE_DEBUG0(m)
   3974 #define BNEP_TRACE_DEBUG1(m,p1)
   3975 #define BNEP_TRACE_DEBUG2(m,p1,p2)
   3976 #define BNEP_TRACE_DEBUG3(m,p1,p2,p3)
   3977 #define BNEP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   3978 #define BNEP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   3979 #define BNEP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   3980 
   3981 /* hid module traces */
   3982 
   3983 #define MSKB_TRACE_0(m)
   3984 #define MSKB_TRACE_1(m,p1)
   3985 #define MSKB_TRACE_2(m,p1,p2)
   3986 #define MSKB_TRACE_3(m,p1,p2,p3)
   3987 #define MSKB_TRACE_4(m,p1,p2,p3,p4)
   3988 #define MSKB_TRACE_5(m,p1,p2,p3,p4,p5)
   3989 #define MSKB_TRACE_6(m,p1,p2,p3,p4,p5,p6)
   3990 
   3991 #define MSKB_DEBUG_0(m)
   3992 #define MSKB_DEBUG_1(m,p1)
   3993 #define MSKB_DEBUG_2(m,p1,p2)
   3994 #define MSKB_DEBUG_3(m,p1,p2,p3)
   3995 #define MSKB_DEBUG_4(m,p1,p2,p3,p4)
   3996 #define MSKB_DEBUG_5(m,p1,p2,p3,p4,p5)
   3997 #define MSKB_DEBUG_6(m,p1,p2,p3,p4,p5,p6)
   3998 
   3999 #define MSKB_ERROR_0(m)
   4000 #define MSKB_ERROR_1(m,p1)
   4001 #define MSKB_ERROR_2(m,p1,p2)
   4002 #define MSKB_ERROR_3(m,p1,p2,p3)
   4003 #define MSKB_ERROR_4(m,p1,p2,p3,p4)
   4004 #define MSKB_ERROR_5(m,p1,p2,p3,p4,p5)
   4005 #define MSKB_ERROR_6(m,p1,p2,p3,p4,p5,p6)
   4006 
   4007 /* define traces for PAN */
   4008 
   4009 #define PAN_TRACE_ERROR0(m)
   4010 #define PAN_TRACE_ERROR1(m,p1)
   4011 #define PAN_TRACE_ERROR2(m,p1,p2)
   4012 #define PAN_TRACE_ERROR3(m,p1,p2,p3)
   4013 #define PAN_TRACE_ERROR4(m,p1,p2,p3,p4)
   4014 #define PAN_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4015 #define PAN_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4016 
   4017 #define PAN_TRACE_WARNING0(m)
   4018 #define PAN_TRACE_WARNING1(m,p1)
   4019 #define PAN_TRACE_WARNING2(m,p1,p2)
   4020 #define PAN_TRACE_WARNING3(m,p1,p2,p3)
   4021 #define PAN_TRACE_WARNING4(m,p1,p2,p3,p4)
   4022 #define PAN_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4023 #define PAN_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4024 
   4025 #define PAN_TRACE_API0(m)
   4026 #define PAN_TRACE_API1(m,p1)
   4027 #define PAN_TRACE_API2(m,p1,p2)
   4028 #define PAN_TRACE_API3(m,p1,p2,p3)
   4029 #define PAN_TRACE_API4(m,p1,p2,p3,p4)
   4030 #define PAN_TRACE_API5(m,p1,p2,p3,p4,p5)
   4031 #define PAN_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   4032 
   4033 #define PAN_TRACE_EVENT0(m)
   4034 #define PAN_TRACE_EVENT1(m,p1)
   4035 #define PAN_TRACE_EVENT2(m,p1,p2)
   4036 #define PAN_TRACE_EVENT3(m,p1,p2,p3)
   4037 #define PAN_TRACE_EVENT4(m,p1,p2,p3,p4)
   4038 #define PAN_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4039 #define PAN_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4040 
   4041 #define PAN_TRACE_DEBUG0(m)
   4042 #define PAN_TRACE_DEBUG1(m,p1)
   4043 #define PAN_TRACE_DEBUG2(m,p1,p2)
   4044 #define PAN_TRACE_DEBUG3(m,p1,p2,p3)
   4045 #define PAN_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4046 #define PAN_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4047 #define PAN_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4048 
   4049 /* define traces for SIM */
   4050 
   4051 #define SAP_TRACE_ERROR0(m)
   4052 #define SAP_TRACE_ERROR1(m,p1)
   4053 #define SAP_TRACE_ERROR2(m,p1,p2)
   4054 #define SAP_TRACE_ERROR3(m,p1,p2,p3)
   4055 #define SAP_TRACE_ERROR4(m,p1,p2,p3,p4)
   4056 #define SAP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4057 #define SAP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4058 
   4059 #define SAP_TRACE_WARNING0(m)
   4060 #define SAP_TRACE_WARNING1(m,p1)
   4061 #define SAP_TRACE_WARNING2(m,p1,p2)
   4062 #define SAP_TRACE_WARNING3(m,p1,p2,p3)
   4063 #define SAP_TRACE_WARNING4(m,p1,p2,p3,p4)
   4064 #define SAP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4065 #define SAP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4066 
   4067 #define SAP_TRACE_API0(m)
   4068 #define SAP_TRACE_API1(m,p1)
   4069 #define SAP_TRACE_API2(m,p1,p2)
   4070 #define SAP_TRACE_API3(m,p1,p2,p3)
   4071 #define SAP_TRACE_API4(m,p1,p2,p3,p4)
   4072 #define SAP_TRACE_API5(m,p1,p2,p3,p4,p5)
   4073 #define SAP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   4074 
   4075 #define SAP_TRACE_EVENT0(m)
   4076 #define SAP_TRACE_EVENT1(m,p1)
   4077 #define SAP_TRACE_EVENT2(m,p1,p2)
   4078 #define SAP_TRACE_EVENT3(m,p1,p2,p3)
   4079 #define SAP_TRACE_EVENT4(m,p1,p2,p3,p4)
   4080 #define SAP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4081 #define SAP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4082 
   4083 #define SAP_TRACE_DEBUG0(m)
   4084 #define SAP_TRACE_DEBUG1(m,p1)
   4085 #define SAP_TRACE_DEBUG2(m,p1,p2)
   4086 #define SAP_TRACE_DEBUG3(m,p1,p2,p3)
   4087 #define SAP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4088 #define SAP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4089 #define SAP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4090 
   4091 /* Define tracing for the OPP profile
   4092 */
   4093 #define OPP_TRACE_ERROR0(m)
   4094 #define OPP_TRACE_ERROR1(m,p1)
   4095 #define OPP_TRACE_ERROR2(m,p1,p2)
   4096 #define OPP_TRACE_ERROR3(m,p1,p2,p3)
   4097 #define OPP_TRACE_ERROR4(m,p1,p2,p3,p4)
   4098 #define OPP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4099 #define OPP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4100 
   4101 #define OPP_TRACE_WARNING0(m)
   4102 #define OPP_TRACE_WARNING1(m,p1)
   4103 #define OPP_TRACE_WARNING2(m,p1,p2)
   4104 #define OPP_TRACE_WARNING3(m,p1,p2,p3)
   4105 #define OPP_TRACE_WARNING4(m,p1,p2,p3,p4)
   4106 #define OPP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4107 #define OPP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4108 
   4109 #define OPP_TRACE_EVENT0(m)
   4110 #define OPP_TRACE_EVENT1(m,p1)
   4111 #define OPP_TRACE_EVENT2(m,p1,p2)
   4112 #define OPP_TRACE_EVENT3(m,p1,p2,p3)
   4113 #define OPP_TRACE_EVENT4(m,p1,p2,p3,p4)
   4114 #define OPP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4115 #define OPP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4116 
   4117 #define OPP_TRACE_DEBUG0(m)
   4118 #define OPP_TRACE_DEBUG1(m,p1)
   4119 #define OPP_TRACE_DEBUG2(m,p1,p2)
   4120 #define OPP_TRACE_DEBUG3(m,p1,p2,p3)
   4121 #define OPP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4122 #define OPP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4123 #define OPP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4124 
   4125 #define OPP_TRACE_API0(m)
   4126 #define OPP_TRACE_API1(m,p1)
   4127 #define OPP_TRACE_API2(m,p1,p2)
   4128 #define OPP_TRACE_API3(m,p1,p2,p3)
   4129 #define OPP_TRACE_API4(m,p1,p2,p3,p4)
   4130 #define OPP_TRACE_API5(m,p1,p2,p3,p4,p5)
   4131 #define OPP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   4132 
   4133 /* Define tracing for the FTP profile
   4134 */
   4135 #define FTP_TRACE_ERROR0(m)
   4136 #define FTP_TRACE_ERROR1(m,p1)
   4137 #define FTP_TRACE_ERROR2(m,p1,p2)
   4138 #define FTP_TRACE_ERROR3(m,p1,p2,p3)
   4139 #define FTP_TRACE_ERROR4(m,p1,p2,p3,p4)
   4140 #define FTP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4141 #define FTP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4142 
   4143 #define FTP_TRACE_WARNING0(m)
   4144 #define FTP_TRACE_WARNING1(m,p1)
   4145 #define FTP_TRACE_WARNING2(m,p1,p2)
   4146 #define FTP_TRACE_WARNING3(m,p1,p2,p3)
   4147 #define FTP_TRACE_WARNING4(m,p1,p2,p3,p4)
   4148 #define FTP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4149 #define FTP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4150 
   4151 #define FTP_TRACE_EVENT0(m)
   4152 #define FTP_TRACE_EVENT1(m,p1)
   4153 #define FTP_TRACE_EVENT2(m,p1,p2)
   4154 #define FTP_TRACE_EVENT3(m,p1,p2,p3)
   4155 #define FTP_TRACE_EVENT4(m,p1,p2,p3,p4)
   4156 #define FTP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4157 #define FTP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4158 
   4159 #define FTP_TRACE_DEBUG0(m)
   4160 #define FTP_TRACE_DEBUG1(m,p1)
   4161 #define FTP_TRACE_DEBUG2(m,p1,p2)
   4162 #define FTP_TRACE_DEBUG3(m,p1,p2,p3)
   4163 #define FTP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4164 #define FTP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4165 #define FTP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4166 
   4167 #define FTP_TRACE_API0(m)
   4168 #define FTP_TRACE_API1(m,p1)
   4169 #define FTP_TRACE_API2(m,p1,p2)
   4170 #define FTP_TRACE_API3(m,p1,p2,p3)
   4171 #define FTP_TRACE_API4(m,p1,p2,p3,p4)
   4172 #define FTP_TRACE_API5(m,p1,p2,p3,p4,p5)
   4173 #define FTP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   4174 
   4175 
   4176 /* Define tracing for the A2DP profile
   4177 */
   4178 #define A2D_TRACE_ERROR0(m)
   4179 #define A2D_TRACE_ERROR1(m,p1)
   4180 #define A2D_TRACE_ERROR2(m,p1,p2)
   4181 #define A2D_TRACE_ERROR3(m,p1,p2,p3)
   4182 #define A2D_TRACE_ERROR4(m,p1,p2,p3,p4)
   4183 #define A2D_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4184 #define A2D_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4185 
   4186 #define A2D_TRACE_WARNING0(m)
   4187 #define A2D_TRACE_WARNING1(m,p1)
   4188 #define A2D_TRACE_WARNING2(m,p1,p2)
   4189 #define A2D_TRACE_WARNING3(m,p1,p2,p3)
   4190 #define A2D_TRACE_WARNING4(m,p1,p2,p3,p4)
   4191 #define A2D_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4192 #define A2D_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4193 
   4194 #define A2D_TRACE_EVENT0(m)
   4195 #define A2D_TRACE_EVENT1(m,p1)
   4196 #define A2D_TRACE_EVENT2(m,p1,p2)
   4197 #define A2D_TRACE_EVENT3(m,p1,p2,p3)
   4198 #define A2D_TRACE_EVENT4(m,p1,p2,p3,p4)
   4199 #define A2D_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4200 #define A2D_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4201 
   4202 #define A2D_TRACE_DEBUG0(m)
   4203 #define A2D_TRACE_DEBUG1(m,p1)
   4204 #define A2D_TRACE_DEBUG2(m,p1,p2)
   4205 #define A2D_TRACE_DEBUG3(m,p1,p2,p3)
   4206 #define A2D_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4207 #define A2D_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4208 #define A2D_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4209 
   4210 #define A2D_TRACE_API0(m)
   4211 #define A2D_TRACE_API1(m,p1)
   4212 #define A2D_TRACE_API2(m,p1,p2)
   4213 #define A2D_TRACE_API3(m,p1,p2,p3)
   4214 #define A2D_TRACE_API4(m,p1,p2,p3,p4)
   4215 #define A2D_TRACE_API5(m,p1,p2,p3,p4,p5)
   4216 #define A2D_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   4217 
   4218 /* Define tracing for the VDP profile
   4219 */
   4220 #define VDP_TRACE_ERROR0(m)
   4221 #define VDP_TRACE_ERROR1(m,p1)
   4222 #define VDP_TRACE_ERROR2(m,p1,p2)
   4223 #define VDP_TRACE_ERROR3(m,p1,p2,p3)
   4224 #define VDP_TRACE_ERROR4(m,p1,p2,p3,p4)
   4225 #define VDP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4226 #define VDP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4227 
   4228 #define VDP_TRACE_WARNING0(m)
   4229 #define VDP_TRACE_WARNING1(m,p1)
   4230 #define VDP_TRACE_WARNING2(m,p1,p2)
   4231 #define VDP_TRACE_WARNING3(m,p1,p2,p3)
   4232 #define VDP_TRACE_WARNING4(m,p1,p2,p3,p4)
   4233 #define VDP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4234 #define VDP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4235 
   4236 #define VDP_TRACE_EVENT0(m)
   4237 #define VDP_TRACE_EVENT1(m,p1)
   4238 #define VDP_TRACE_EVENT2(m,p1,p2)
   4239 #define VDP_TRACE_EVENT3(m,p1,p2,p3)
   4240 #define VDP_TRACE_EVENT4(m,p1,p2,p3,p4)
   4241 #define VDP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4242 #define VDP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4243 
   4244 #define VDP_TRACE_DEBUG0(m)
   4245 #define VDP_TRACE_DEBUG1(m,p1)
   4246 #define VDP_TRACE_DEBUG2(m,p1,p2)
   4247 #define VDP_TRACE_DEBUG3(m,p1,p2,p3)
   4248 #define VDP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4249 #define VDP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4250 #define VDP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4251 
   4252 #define VDP_TRACE_API0(m)
   4253 #define VDP_TRACE_API1(m,p1)
   4254 #define VDP_TRACE_API2(m,p1,p2)
   4255 #define VDP_TRACE_API3(m,p1,p2,p3)
   4256 #define VDP_TRACE_API4(m,p1,p2,p3,p4)
   4257 #define VDP_TRACE_API5(m,p1,p2,p3,p4,p5)
   4258 #define VDP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   4259 
   4260 
   4261 /* Define tracing for the LM unit
   4262 */
   4263 #define LMP_TRACE_ERROR0(m)
   4264 #define LMP_TRACE_ERROR1(m,p1)
   4265 #define LMP_TRACE_ERROR2(m,p1,p2)
   4266 #define LMP_TRACE_ERROR3(m,p1,p2,p3)
   4267 #define LMP_TRACE_ERROR4(m,p1,p2,p3,p4)
   4268 #define LMP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4269 #define LMP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4270 
   4271 #define LMP_TRACE_WARNING0(m)
   4272 #define LMP_TRACE_WARNING1(m,p1)
   4273 #define LMP_TRACE_WARNING2(m,p1,p2)
   4274 #define LMP_TRACE_WARNING3(m,p1,p2,p3)
   4275 #define LMP_TRACE_WARNING4(m,p1,p2,p3,p4)
   4276 #define LMP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4277 #define LMP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4278 
   4279 #define LMP_TRACE_EVENT0(m)
   4280 #define LMP_TRACE_EVENT1(m,p1)
   4281 #define LMP_TRACE_EVENT2(m,p1,p2)
   4282 #define LMP_TRACE_EVENT3(m,p1,p2,p3)
   4283 #define LMP_TRACE_EVENT4(m,p1,p2,p3,p4)
   4284 #define LMP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4285 #define LMP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4286 
   4287 #define LMP_TRACE_DEBUG0(m)
   4288 #define LMP_TRACE_DEBUG1(m,p1)
   4289 #define LMP_TRACE_DEBUG2(m,p1,p2)
   4290 #define LMP_TRACE_DEBUG3(m,p1,p2,p3)
   4291 #define LMP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4292 #define LMP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4293 #define LMP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4294 
   4295 /* Define tracing for the LC unit
   4296 */
   4297 #define LC_TRACE_ERROR0(m)
   4298 #define LC_TRACE_ERROR1(m,p1)
   4299 #define LC_TRACE_ERROR2(m,p1,p2)
   4300 #define LC_TRACE_ERROR3(m,p1,p2,p3)
   4301 #define LC_TRACE_ERROR4(m,p1,p2,p3,p4)
   4302 #define LC_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4303 #define LC_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4304 
   4305 #define LC_TRACE_WARNING0(m)
   4306 #define LC_TRACE_WARNING1(m,p1)
   4307 #define LC_TRACE_WARNING2(m,p1,p2)
   4308 #define LC_TRACE_WARNING3(m,p1,p2,p3)
   4309 #define LC_TRACE_WARNING4(m,p1,p2,p3,p4)
   4310 #define LC_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4311 #define LC_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4312 
   4313 #define LC_TRACE_EVENT0(m)
   4314 #define LC_TRACE_EVENT1(m,p1)
   4315 #define LC_TRACE_EVENT2(m,p1,p2)
   4316 #define LC_TRACE_EVENT3(m,p1,p2,p3)
   4317 #define LC_TRACE_EVENT4(m,p1,p2,p3,p4)
   4318 #define LC_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4319 #define LC_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4320 
   4321 #define LC_TRACE_DEBUG0(m)
   4322 #define LC_TRACE_DEBUG1(m,p1)
   4323 #define LC_TRACE_DEBUG2(m,p1,p2)
   4324 #define LC_TRACE_DEBUG3(m,p1,p2,p3)
   4325 #define LC_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4326 #define LC_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4327 #define LC_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4328 
   4329 #define SDA_TRACE_ERROR0(m)
   4330 #define SDA_TRACE_ERROR1(m,p1)
   4331 #define SDA_TRACE_ERROR2(m,p1,p2)
   4332 #define SDA_TRACE_ERROR3(m,p1,p2,p3)
   4333 #define SDA_TRACE_ERROR4(m,p1,p2,p3,p4)
   4334 #define SDA_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4335 #define SDA_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4336 
   4337 #define SDA_TRACE_WARNING0(m)
   4338 #define SDA_TRACE_WARNING1(m,p1)
   4339 #define SDA_TRACE_WARNING2(m,p1,p2)
   4340 #define SDA_TRACE_WARNING3(m,p1,p2,p3)
   4341 #define SDA_TRACE_WARNING4(m,p1,p2,p3,p4)
   4342 #define SDA_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4343 #define SDA_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4344 
   4345 #define SDA_TRACE_EVENT0(m)
   4346 #define SDA_TRACE_EVENT1(m,p1)
   4347 #define SDA_TRACE_EVENT2(m,p1,p2)
   4348 #define SDA_TRACE_EVENT3(m,p1,p2,p3)
   4349 #define SDA_TRACE_EVENT4(m,p1,p2,p3,p4)
   4350 #define SDA_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4351 #define SDA_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4352 
   4353 #define SDA_TRACE_DEBUG0(m)
   4354 #define SDA_TRACE_DEBUG1(m,p1)
   4355 #define SDA_TRACE_DEBUG2(m,p1,p2)
   4356 #define SDA_TRACE_DEBUG3(m,p1,p2,p3)
   4357 #define SDA_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4358 #define SDA_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4359 #define SDA_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4360 
   4361 /* AVDTP
   4362 */
   4363 #define AVDT_TRACE_ERROR0(m)
   4364 #define AVDT_TRACE_ERROR1(m,p1)
   4365 #define AVDT_TRACE_ERROR2(m,p1,p2)
   4366 #define AVDT_TRACE_ERROR3(m,p1,p2,p3)
   4367 #define AVDT_TRACE_ERROR4(m,p1,p2,p3,p4)
   4368 #define AVDT_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4369 #define AVDT_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4370 
   4371 #define AVDT_TRACE_WARNING0(m)
   4372 #define AVDT_TRACE_WARNING1(m,p1)
   4373 #define AVDT_TRACE_WARNING2(m,p1,p2)
   4374 #define AVDT_TRACE_WARNING3(m,p1,p2,p3)
   4375 #define AVDT_TRACE_WARNING4(m,p1,p2,p3,p4)
   4376 #define AVDT_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4377 #define AVDT_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4378 
   4379 #define AVDT_TRACE_EVENT0(m)
   4380 #define AVDT_TRACE_EVENT1(m,p1)
   4381 #define AVDT_TRACE_EVENT2(m,p1,p2)
   4382 #define AVDT_TRACE_EVENT3(m,p1,p2,p3)
   4383 #define AVDT_TRACE_EVENT4(m,p1,p2,p3,p4)
   4384 #define AVDT_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4385 #define AVDT_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4386 
   4387 #define AVDT_TRACE_DEBUG0(m)
   4388 #define AVDT_TRACE_DEBUG1(m,p1)
   4389 #define AVDT_TRACE_DEBUG2(m,p1,p2)
   4390 #define AVDT_TRACE_DEBUG3(m,p1,p2,p3)
   4391 #define AVDT_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4392 #define AVDT_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4393 #define AVDT_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4394 
   4395 #define AVDT_TRACE_API0(m)
   4396 #define AVDT_TRACE_API1(m,p1)
   4397 #define AVDT_TRACE_API2(m,p1,p2)
   4398 #define AVDT_TRACE_API3(m,p1,p2,p3)
   4399 #define AVDT_TRACE_API4(m,p1,p2,p3,p4)
   4400 #define AVDT_TRACE_API5(m,p1,p2,p3,p4,p5)
   4401 #define AVDT_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   4402 
   4403 /* Define tracing for the AVCTP protocol
   4404 */
   4405 #define AVCT_TRACE_ERROR0(m)
   4406 #define AVCT_TRACE_ERROR1(m,p1)
   4407 #define AVCT_TRACE_ERROR2(m,p1,p2)
   4408 #define AVCT_TRACE_ERROR3(m,p1,p2,p3)
   4409 #define AVCT_TRACE_ERROR4(m,p1,p2,p3,p4)
   4410 #define AVCT_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4411 #define AVCT_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4412 
   4413 #define AVCT_TRACE_WARNING0(m)
   4414 #define AVCT_TRACE_WARNING1(m,p1)
   4415 #define AVCT_TRACE_WARNING2(m,p1,p2)
   4416 #define AVCT_TRACE_WARNING3(m,p1,p2,p3)
   4417 #define AVCT_TRACE_WARNING4(m,p1,p2,p3,p4)
   4418 #define AVCT_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4419 #define AVCT_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4420 
   4421 #define AVCT_TRACE_EVENT0(m)
   4422 #define AVCT_TRACE_EVENT1(m,p1)
   4423 #define AVCT_TRACE_EVENT2(m,p1,p2)
   4424 #define AVCT_TRACE_EVENT3(m,p1,p2,p3)
   4425 #define AVCT_TRACE_EVENT4(m,p1,p2,p3,p4)
   4426 #define AVCT_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4427 #define AVCT_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4428 
   4429 #define AVCT_TRACE_DEBUG0(m)
   4430 #define AVCT_TRACE_DEBUG1(m,p1)
   4431 #define AVCT_TRACE_DEBUG2(m,p1,p2)
   4432 #define AVCT_TRACE_DEBUG3(m,p1,p2,p3)
   4433 #define AVCT_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4434 #define AVCT_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4435 #define AVCT_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4436 
   4437 #define AVCT_TRACE_API0(m)
   4438 #define AVCT_TRACE_API1(m,p1)
   4439 #define AVCT_TRACE_API2(m,p1,p2)
   4440 #define AVCT_TRACE_API3(m,p1,p2,p3)
   4441 #define AVCT_TRACE_API4(m,p1,p2,p3,p4)
   4442 #define AVCT_TRACE_API5(m,p1,p2,p3,p4,p5)
   4443 #define AVCT_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   4444 
   4445 
   4446 /* Define tracing for the AVRCP profile
   4447 */
   4448 #define AVRC_TRACE_ERROR0(m)
   4449 #define AVRC_TRACE_ERROR1(m,p1)
   4450 #define AVRC_TRACE_ERROR2(m,p1,p2)
   4451 #define AVRC_TRACE_ERROR3(m,p1,p2,p3)
   4452 #define AVRC_TRACE_ERROR4(m,p1,p2,p3,p4)
   4453 #define AVRC_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4454 #define AVRC_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4455 
   4456 #define AVRC_TRACE_WARNING0(m)
   4457 #define AVRC_TRACE_WARNING1(m,p1)
   4458 #define AVRC_TRACE_WARNING2(m,p1,p2)
   4459 #define AVRC_TRACE_WARNING3(m,p1,p2,p3)
   4460 #define AVRC_TRACE_WARNING4(m,p1,p2,p3,p4)
   4461 #define AVRC_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4462 #define AVRC_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4463 
   4464 #define AVRC_TRACE_EVENT0(m)
   4465 #define AVRC_TRACE_EVENT1(m,p1)
   4466 #define AVRC_TRACE_EVENT2(m,p1,p2)
   4467 #define AVRC_TRACE_EVENT3(m,p1,p2,p3)
   4468 #define AVRC_TRACE_EVENT4(m,p1,p2,p3,p4)
   4469 #define AVRC_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4470 #define AVRC_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4471 
   4472 #define AVRC_TRACE_DEBUG0(m)
   4473 #define AVRC_TRACE_DEBUG1(m,p1)
   4474 #define AVRC_TRACE_DEBUG2(m,p1,p2)
   4475 #define AVRC_TRACE_DEBUG3(m,p1,p2,p3)
   4476 #define AVRC_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4477 #define AVRC_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4478 #define AVRC_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4479 
   4480 #define AVRC_TRACE_API0(m)
   4481 #define AVRC_TRACE_API1(m,p1)
   4482 #define AVRC_TRACE_API2(m,p1,p2)
   4483 #define AVRC_TRACE_API3(m,p1,p2,p3)
   4484 #define AVRC_TRACE_API4(m,p1,p2,p3,p4)
   4485 #define AVRC_TRACE_API5(m,p1,p2,p3,p4,p5)
   4486 #define AVRC_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   4487 
   4488 /* MCAP
   4489 */
   4490 #define MCA_TRACE_ERROR0(m)
   4491 #define MCA_TRACE_ERROR1(m,p1)
   4492 #define MCA_TRACE_ERROR2(m,p1,p2)
   4493 #define MCA_TRACE_ERROR3(m,p1,p2,p3)
   4494 #define MCA_TRACE_ERROR4(m,p1,p2,p3,p4)
   4495 #define MCA_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4496 #define MCA_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4497 
   4498 #define MCA_TRACE_WARNING0(m)
   4499 #define MCA_TRACE_WARNING1(m,p1)
   4500 #define MCA_TRACE_WARNING2(m,p1,p2)
   4501 #define MCA_TRACE_WARNING3(m,p1,p2,p3)
   4502 #define MCA_TRACE_WARNING4(m,p1,p2,p3,p4)
   4503 #define MCA_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4504 #define MCA_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4505 
   4506 #define MCA_TRACE_EVENT0(m)
   4507 #define MCA_TRACE_EVENT1(m,p1)
   4508 #define MCA_TRACE_EVENT2(m,p1,p2)
   4509 #define MCA_TRACE_EVENT3(m,p1,p2,p3)
   4510 #define MCA_TRACE_EVENT4(m,p1,p2,p3,p4)
   4511 #define MCA_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4512 #define MCA_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4513 
   4514 #define MCA_TRACE_DEBUG0(m)
   4515 #define MCA_TRACE_DEBUG1(m,p1)
   4516 #define MCA_TRACE_DEBUG2(m,p1,p2)
   4517 #define MCA_TRACE_DEBUG3(m,p1,p2,p3)
   4518 #define MCA_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4519 #define MCA_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4520 #define MCA_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4521 
   4522 #define MCA_TRACE_API0(m)
   4523 #define MCA_TRACE_API1(m,p1)
   4524 #define MCA_TRACE_API2(m,p1,p2)
   4525 #define MCA_TRACE_API3(m,p1,p2,p3)
   4526 #define MCA_TRACE_API4(m,p1,p2,p3,p4)
   4527 #define MCA_TRACE_API5(m,p1,p2,p3,p4,p5)
   4528 #define MCA_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   4529 
   4530 /* Define tracing for the AMP unit
   4531 */
   4532 #define AMP_TRACE_ERROR0(m)
   4533 #define AMP_TRACE_ERROR1(m,p1)
   4534 #define AMP_TRACE_ERROR2(m,p1,p2)
   4535 #define AMP_TRACE_ERROR3(m,p1,p2,p3)
   4536 #define AMP_TRACE_ERROR4(m,p1,p2,p3,p4)
   4537 #define AMP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4538 #define AMP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4539 
   4540 #define AMP_TRACE_WARNING0(m)
   4541 #define AMP_TRACE_WARNING1(m,p1)
   4542 #define AMP_TRACE_WARNING2(m,p1,p2)
   4543 #define AMP_TRACE_WARNING3(m,p1,p2,p3)
   4544 #define AMP_TRACE_WARNING4(m,p1,p2,p3,p4)
   4545 #define AMP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4546 #define AMP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4547 
   4548 #define AMP_TRACE_API0(m)
   4549 #define AMP_TRACE_API1(m,p1)
   4550 #define AMP_TRACE_API2(m,p1,p2)
   4551 #define AMP_TRACE_API3(m,p1,p2,p3)
   4552 #define AMP_TRACE_API4(m,p1,p2,p3,p4)
   4553 #define AMP_TRACE_API5(m,p1,p2,p3,p4,p5)
   4554 #define AMP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   4555 
   4556 #define AMP_TRACE_EVENT0(m)
   4557 #define AMP_TRACE_EVENT1(m,p1)
   4558 #define AMP_TRACE_EVENT2(m,p1,p2)
   4559 #define AMP_TRACE_EVENT3(m,p1,p2,p3)
   4560 #define AMP_TRACE_EVENT4(m,p1,p2,p3,p4)
   4561 #define AMP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4562 #define AMP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4563 
   4564 #define AMP_TRACE_DEBUG0(m)
   4565 #define AMP_TRACE_DEBUG1(m,p1)
   4566 #define AMP_TRACE_DEBUG2(m,p1,p2)
   4567 #define AMP_TRACE_DEBUG3(m,p1,p2,p3)
   4568 #define AMP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4569 #define AMP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4570 #define AMP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4571 
   4572 /* Define tracing for the GATT
   4573 */
   4574 #define GATT_TRACE_ERROR0(m)
   4575 #define GATT_TRACE_ERROR1(m,p1)
   4576 #define GATT_TRACE_ERROR2(m,p1,p2)
   4577 #define GATT_TRACE_ERROR3(m,p1,p2,p3)
   4578 #define GATT_TRACE_ERROR4(m,p1,p2,p3,p4)
   4579 #define GATT_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4580 #define GATT_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4581 
   4582 #define GATT_TRACE_WARNING0(m)
   4583 #define GATT_TRACE_WARNING1(m,p1)
   4584 #define GATT_TRACE_WARNING2(m,p1,p2)
   4585 #define GATT_TRACE_WARNING3(m,p1,p2,p3)
   4586 #define GATT_TRACE_WARNING4(m,p1,p2,p3,p4)
   4587 #define GATT_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4588 #define GATT_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4589 
   4590 #define GATT_TRACE_API0(m)
   4591 #define GATT_TRACE_API1(m,p1)
   4592 #define GATT_TRACE_API2(m,p1,p2)
   4593 #define GATT_TRACE_API3(m,p1,p2,p3)
   4594 #define GATT_TRACE_API4(m,p1,p2,p3,p4)
   4595 #define GATT_TRACE_API5(m,p1,p2,p3,p4,p5)
   4596 #define GATT_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   4597 
   4598 #define GATT_TRACE_EVENT0(m)
   4599 #define GATT_TRACE_EVENT1(m,p1)
   4600 #define GATT_TRACE_EVENT2(m,p1,p2)
   4601 #define GATT_TRACE_EVENT3(m,p1,p2,p3)
   4602 #define GATT_TRACE_EVENT4(m,p1,p2,p3,p4)
   4603 #define GATT_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4604 #define GATT_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4605 
   4606 #define GATT_TRACE_DEBUG0(m)
   4607 #define GATT_TRACE_DEBUG1(m,p1)
   4608 #define GATT_TRACE_DEBUG2(m,p1,p2)
   4609 #define GATT_TRACE_DEBUG3(m,p1,p2,p3)
   4610 #define GATT_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4611 #define GATT_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4612 #define GATT_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4613 
   4614 /* Define tracing for the SMP unit
   4615 */
   4616 #define SMP_TRACE_ERROR0(m)
   4617 #define SMP_TRACE_ERROR1(m,p1)
   4618 #define SMP_TRACE_ERROR2(m,p1,p2)
   4619 #define SMP_TRACE_ERROR3(m,p1,p2,p3)
   4620 #define SMP_TRACE_ERROR4(m,p1,p2,p3,p4)
   4621 #define SMP_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4622 #define SMP_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4623 
   4624 #define SMP_TRACE_WARNING0(m)
   4625 #define SMP_TRACE_WARNING1(m,p1)
   4626 #define SMP_TRACE_WARNING2(m,p1,p2)
   4627 #define SMP_TRACE_WARNING3(m,p1,p2,p3)
   4628 #define SMP_TRACE_WARNING4(m,p1,p2,p3,p4)
   4629 #define SMP_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4630 #define SMP_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4631 
   4632 #define SMP_TRACE_API0(m)
   4633 #define SMP_TRACE_API1(m,p1)
   4634 #define SMP_TRACE_API2(m,p1,p2)
   4635 #define SMP_TRACE_API3(m,p1,p2,p3)
   4636 #define SMP_TRACE_API4(m,p1,p2,p3,p4)
   4637 #define SMP_TRACE_API5(m,p1,p2,p3,p4,p5)
   4638 #define SMP_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   4639 
   4640 #define SMP_TRACE_EVENT0(m)
   4641 #define SMP_TRACE_EVENT1(m,p1)
   4642 #define SMP_TRACE_EVENT2(m,p1,p2)
   4643 #define SMP_TRACE_EVENT3(m,p1,p2,p3)
   4644 #define SMP_TRACE_EVENT4(m,p1,p2,p3,p4)
   4645 #define SMP_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4646 #define SMP_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4647 
   4648 #define SMP_TRACE_DEBUG0(m)
   4649 #define SMP_TRACE_DEBUG1(m,p1)
   4650 #define SMP_TRACE_DEBUG2(m,p1,p2)
   4651 #define SMP_TRACE_DEBUG3(m,p1,p2,p3)
   4652 #define SMP_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4653 #define SMP_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4654 #define SMP_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4655 
   4656 #endif
   4657 
   4658 #if (BT_USE_TRACES == TRUE || BT_TRACE_APPL == TRUE)
   4659 
   4660 /* define traces for application */
   4661 #define APPL_TRACE_ERROR0(m)                    {if (appl_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, (m));}
   4662 #define APPL_TRACE_ERROR1(m,p1)                 {if (appl_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_1(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
   4663                                                         (m), (UINT32)(p1));}
   4664 #define APPL_TRACE_ERROR2(m,p1,p2)              {if (appl_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_2(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
   4665                                                         (m), (UINT32)(p1), (UINT32)(p2));}
   4666 #define APPL_TRACE_ERROR3(m,p1,p2,p3)           {if (appl_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_3(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
   4667                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
   4668 #define APPL_TRACE_ERROR4(m,p1,p2,p3,p4)        {if (appl_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_4(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
   4669                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
   4670 #define APPL_TRACE_ERROR5(m,p1,p2,p3,p4,p5)     {if (appl_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_5(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
   4671                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
   4672 #define APPL_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)  {if (appl_trace_level >= BT_TRACE_LEVEL_ERROR) LogMsg_6(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_ERROR, \
   4673                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
   4674 
   4675 #define APPL_TRACE_WARNING0(m)                  {if (appl_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, (m));}
   4676 #define APPL_TRACE_WARNING1(m,p1)               {if (appl_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_1(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
   4677                                                         (m), (UINT32)(p1));}
   4678 #define APPL_TRACE_WARNING2(m,p1,p2)            {if (appl_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_2(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
   4679                                                         (m), (UINT32)(p1), (UINT32)(p2));}
   4680 #define APPL_TRACE_WARNING3(m,p1,p2,p3)         {if (appl_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_3(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
   4681                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
   4682 #define APPL_TRACE_WARNING4(m,p1,p2,p3,p4)      {if (appl_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_4(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
   4683                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
   4684 #define APPL_TRACE_WARNING5(m,p1,p2,p3,p4,p5)   {if (appl_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_5(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
   4685                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
   4686 #define APPL_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6) {if (appl_trace_level >= BT_TRACE_LEVEL_WARNING) LogMsg_6(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_WARNING, \
   4687                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
   4688 
   4689 #define APPL_TRACE_API0(m)                      {if (appl_trace_level >= BT_TRACE_LEVEL_API) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, (m));}
   4690 #define APPL_TRACE_API1(m,p1)                   {if (appl_trace_level >= BT_TRACE_LEVEL_API) LogMsg_1(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
   4691                                                         (m), (UINT32)(p1));}
   4692 #define APPL_TRACE_API2(m,p1,p2)                {if (appl_trace_level >= BT_TRACE_LEVEL_API) LogMsg_2(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
   4693                                                         (m), (UINT32)(p1), (UINT32)(p2));}
   4694 #define APPL_TRACE_API3(m,p1,p2,p3)             {if (appl_trace_level >= BT_TRACE_LEVEL_API) LogMsg_3(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
   4695                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
   4696 #define APPL_TRACE_API4(m,p1,p2,p3,p4)          {if (appl_trace_level >= BT_TRACE_LEVEL_API) LogMsg_4(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
   4697                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
   4698 #define APPL_TRACE_API5(m,p1,p2,p3,p4,p5)       {if (appl_trace_level >= BT_TRACE_LEVEL_API) LogMsg_5(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
   4699                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
   4700 #define APPL_TRACE_API6(m,p1,p2,p3,p4,p5,p6)    {if (appl_trace_level >= BT_TRACE_LEVEL_API) LogMsg_6(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_API, \
   4701                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
   4702 
   4703 #define APPL_TRACE_EVENT0(m)                    {if (appl_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, (m));}
   4704 #define APPL_TRACE_EVENT1(m,p1)                 {if (appl_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_1(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
   4705                                                         (m), (UINT32)(p1));}
   4706 #define APPL_TRACE_EVENT2(m,p1,p2)              {if (appl_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_2(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
   4707                                                         (m), (UINT32)(p1), (UINT32)(p2));}
   4708 #define APPL_TRACE_EVENT3(m,p1,p2,p3)           {if (appl_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_3(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
   4709                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
   4710 #define APPL_TRACE_EVENT4(m,p1,p2,p3,p4)        {if (appl_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_4(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
   4711                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
   4712 #define APPL_TRACE_EVENT5(m,p1,p2,p3,p4,p5)     {if (appl_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_5(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
   4713                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
   4714 #define APPL_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)  {if (appl_trace_level >= BT_TRACE_LEVEL_EVENT) LogMsg_6(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_EVENT, \
   4715                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
   4716 
   4717 #define APPL_TRACE_DEBUG0(m)                    {if (appl_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_0(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, (m));}
   4718 #define APPL_TRACE_DEBUG1(m,p1)                 {if (appl_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_1(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
   4719                                                         (m), (UINT32)(p1));}
   4720 #define APPL_TRACE_DEBUG2(m,p1,p2)              {if (appl_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_2(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
   4721                                                         (m), (UINT32)(p1), (UINT32)(p2));}
   4722 #define APPL_TRACE_DEBUG3(m,p1,p2,p3)           {if (appl_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_3(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
   4723                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3));}
   4724 #define APPL_TRACE_DEBUG4(m,p1,p2,p3,p4)        {if (appl_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_4(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
   4725                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4));}
   4726 #define APPL_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)     {if (appl_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_5(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
   4727                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5));}
   4728 #define APPL_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)  {if (appl_trace_level >= BT_TRACE_LEVEL_DEBUG) LogMsg_6(TRACE_CTRL_GENERAL | TRACE_LAYER_NONE | TRACE_ORG_APPL | TRACE_TYPE_DEBUG, \
   4729                                                         (m), (UINT32)(p1), (UINT32)(p2), (UINT32)(p3), (UINT32)(p4), (UINT32)(p5), (UINT32)(p6));}
   4730 #else
   4731 /* define traces for Application */
   4732 
   4733 #define APPL_TRACE_ERROR0(m)
   4734 #define APPL_TRACE_ERROR1(m,p1)
   4735 #define APPL_TRACE_ERROR2(m,p1,p2)
   4736 #define APPL_TRACE_ERROR3(m,p1,p2,p3)
   4737 #define APPL_TRACE_ERROR4(m,p1,p2,p3,p4)
   4738 #define APPL_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4739 #define APPL_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4740 
   4741 #define APPL_TRACE_WARNING0(m)
   4742 #define APPL_TRACE_WARNING1(m,p1)
   4743 #define APPL_TRACE_WARNING2(m,p1,p2)
   4744 #define APPL_TRACE_WARNING3(m,p1,p2,p3)
   4745 #define APPL_TRACE_WARNING4(m,p1,p2,p3,p4)
   4746 #define APPL_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4747 #define APPL_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4748 
   4749 #define APPL_TRACE_API0(m)
   4750 #define APPL_TRACE_API1(m,p1)
   4751 #define APPL_TRACE_API2(m,p1,p2)
   4752 #define APPL_TRACE_API3(m,p1,p2,p3)
   4753 #define APPL_TRACE_API4(m,p1,p2,p3,p4)
   4754 #define APPL_TRACE_API5(m,p1,p2,p3,p4,p5)
   4755 #define APPL_TRACE_API6(m,p1,p2,p3,p4,p5,p6)
   4756 
   4757 #define APPL_TRACE_EVENT0(m)
   4758 #define APPL_TRACE_EVENT1(m,p1)
   4759 #define APPL_TRACE_EVENT2(m,p1,p2)
   4760 #define APPL_TRACE_EVENT3(m,p1,p2,p3)
   4761 #define APPL_TRACE_EVENT4(m,p1,p2,p3,p4)
   4762 #define APPL_TRACE_EVENT5(m,p1,p2,p3,p4,p5)
   4763 #define APPL_TRACE_EVENT6(m,p1,p2,p3,p4,p5,p6)
   4764 
   4765 #define APPL_TRACE_DEBUG0(m)
   4766 #define APPL_TRACE_DEBUG1(m,p1)
   4767 #define APPL_TRACE_DEBUG2(m,p1,p2)
   4768 #define APPL_TRACE_DEBUG3(m,p1,p2,p3)
   4769 #define APPL_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4770 #define APPL_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4771 #define APPL_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4772 
   4773 #endif
   4774 
   4775 #if ((MMI_INCLUDED == TRUE) && (!defined(HID_MSKB_INCLUDED) || (HID_MSKB_INCLUDED == FALSE)))
   4776 /* UI for sample applications */
   4777 #define SAP_TRACE_0(m)                            MMI_Echo(m)
   4778 #define SAP_TRACE_1(m,p1)                         MMI_Echo(m,p1)
   4779 #define SAP_TRACE_2(m,p1,p2)                      MMI_Echo(m,p1,p2)
   4780 #define SAP_TRACE_3(m,p1,p2,p3)                   MMI_Echo(m,p1,p2,p3)
   4781 #define SAP_TRACE_4(m,p1,p2,p3,p4)                MMI_Echo(m,p1,p2,p3,p4)
   4782 #define SAP_TRACE_5(m,p1,p2,p3,p4,p5)             MMI_Echo(m,p1,p2,p3,p4,p5)
   4783 #define SAP_TRACE_6(m,p1,p2,p3,p4,p5,p6)          MMI_Echo(m,p1,p2,p3,p4,p5,p6)
   4784 #else
   4785 #define SAP_TRACE_0(m)
   4786 #define SAP_TRACE_1(m,p1)
   4787 #define SAP_TRACE_2(m,p1,p2)
   4788 #define SAP_TRACE_3(m,p1,p2,p3)
   4789 #define SAP_TRACE_4(m,p1,p2,p3,p4)
   4790 #define SAP_TRACE_5(m,p1,p2,p3,p4,p5)
   4791 #define SAP_TRACE_6(m,p1,p2,p3,p4,p5,p6)
   4792 
   4793 #endif  /* End of MMI_INCLUDED */
   4794 #if defined(DRV_DEBUG_MSG) && (DRV_DEBUG_MSG == TRUE)
   4795 /* Driver Trace macros
   4796 */
   4797 #define DRV_TRACE_WARNING0(m)                      APPL_TRACE_WARNING0(m)
   4798 #define DRV_TRACE_WARNING1(m,p1)                   APPL_TRACE_WARNING1(m,p1)
   4799 #define DRV_TRACE_WARNING2(m,p1,p2)                APPL_TRACE_WARNING2(m,p1,p2)
   4800 #define DRV_TRACE_WARNING3(m,p1,p2,p3)             APPL_TRACE_WARNING3(m,p1,p2,p3)
   4801 #define DRV_TRACE_WARNING4(m,p1,p2,p3,p4)          APPL_TRACE_WARNING4(m,p1,p2,p3,p4)
   4802 #define DRV_TRACE_WARNING5(m,p1,p2,p3,p4,p5)       APPL_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4803 #define DRV_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)    APPL_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4804 #else
   4805 /* Driver Trace macros
   4806 */
   4807 #define DRV_TRACE_WARNING0(m)
   4808 #define DRV_TRACE_WARNING1(m,p1)
   4809 #define DRV_TRACE_WARNING2(m,p1,p2)
   4810 #define DRV_TRACE_WARNING3(m,p1,p2,p3)
   4811 #define DRV_TRACE_WARNING4(m,p1,p2,p3,p4)
   4812 #define DRV_TRACE_WARNING5(m,p1,p2,p3,p4,p5)
   4813 #define DRV_TRACE_WARNING6(m,p1,p2,p3,p4,p5,p6)
   4814 #endif
   4815 
   4816 #define DRV_TRACE_ERROR0(m)                      APPL_TRACE_ERROR0(m)
   4817 #define DRV_TRACE_ERROR1(m,p1)                   APPL_TRACE_ERROR1(m,p1)
   4818 #define DRV_TRACE_ERROR2(m,p1,p2)                APPL_TRACE_ERROR2(m,p1,p2)
   4819 #define DRV_TRACE_ERROR3(m,p1,p2,p3)             APPL_TRACE_ERROR3(m,p1,p2,p3)
   4820 #define DRV_TRACE_ERROR4(m,p1,p2,p3,p4)          APPL_TRACE_ERROR4(m,p1,p2,p3,p4)
   4821 #define DRV_TRACE_ERROR5(m,p1,p2,p3,p4,p5)       APPL_TRACE_ERROR5(m,p1,p2,p3,p4,p5)
   4822 #define DRV_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)    APPL_TRACE_ERROR6(m,p1,p2,p3,p4,p5,p6)
   4823 
   4824 /* Driver Trace macros
   4825 */
   4826 #define DRV_TRACE_DEBUG0(m)                    APPL_TRACE_DEBUG0(m)
   4827 #define DRV_TRACE_DEBUG1(m,p1)                 APPL_TRACE_DEBUG1(m,p1)
   4828 #define DRV_TRACE_DEBUG2(m,p1,p2)              APPL_TRACE_DEBUG2(m,p1,p2)
   4829 #define DRV_TRACE_DEBUG3(m,p1,p2,p3)           APPL_TRACE_DEBUG3(m,p1,p2,p3)
   4830 #define DRV_TRACE_DEBUG4(m,p1,p2,p3,p4)        APPL_TRACE_DEBUG4(m,p1,p2,p3,p4)
   4831 #define DRV_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)     APPL_TRACE_DEBUG5(m,p1,p2,p3,p4,p5)
   4832 #define DRV_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)  APPL_TRACE_DEBUG6(m,p1,p2,p3,p4,p5,p6)
   4833 
   4834 
   4835 #endif /* BT_TRACE_H */
   4836 
   4837 
   4838