Mistake on this page?
Report an issue in GitHub or email us
wland_dbg.h
1 /* Copyright (c) 2019 Unisoc Communications Inc.
2  * SPDX-License-Identifier: Apache-2.0
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef _WLAND_DBG_H_
18 #define _WLAND_DBG_H_
19 #include <stdio.h>
20 #include "rda5991h_wland.h"
21 #include "wland_types.h"
22 
23 extern int wland_dbg_dump;
24 extern int wland_dbg_level;
25 
26 #define RDA_WLAND_DBG
27 
28 #ifdef RDA_WLAND_DBG
29 #define WLAND_DBG(level, fmt, ...) do {\
30  int dbg_level = D_##level##_LEVEL;\
31  if((dbg_level <= wland_dbg_level)){\
32  printf("%s,"fmt, __func__, ##__VA_ARGS__);\
33  } \
34  } while (0)
35 
36 //if frmae_len is zero, get len from frame header
37 static inline void wland_dump_frame(const char* msg, u8 *data, u32 frame_len)
38 {
39 
40  u32 len,i;
41 
42  if(wland_dbg_dump == 1) {
43  if(frame_len != 0) {
44  len = frame_len;
45  } else {
46  len = data[0] | ((data[1]&0x0f) << 8);
47  }
48  printf("%s : ",msg);
49  for(i=0; i<len; i++)
50  printf("%02x ", *(data+i));
51  printf("\r\nframe_len=%d\r\n", len);
52  }
53  return;
54 }
55 #else
56 #define WLAND_DBG(level, fmt, ...)
57 static inline void wland_dump_frame(const char* msg, u8 *data, u32 frame_len)
58 {}
59 #endif
60 #endif /*_WLAND_DBG_H_*/
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.