ad65002162e51faa22bf350c4ec9e8d997b51568
[platform/core/api/wifi.git] / include / net_wifi_private.h
1 /*
2  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd All Rights Reserved
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 __NET_WIFI_PRIVATE_H__
18 #define __NET_WIFI_PRIVATE_H__
19
20 #include <dlog.h>
21 #include <stdio.h>
22 #include <string.h>
23 #include <stdlib.h>
24
25 #include "wifi.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30
31 #undef LOG_TAG
32 #define LOG_TAG "CAPI_NETWORK_WIFI"
33
34 #define WIFI_INFO       1
35 #define WIFI_ERROR      2
36 #define WIFI_WARN       3
37
38 #define DEPRECATED_LOG(origin, substitution) \
39         do { \
40                 LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed " \
41                                 "from next release. Use %s() instead.", origin, substitution); \
42         } while (0)
43
44 #define WIFI_LOG(log_level, format, args...) \
45         do { \
46                 switch (log_level) { \
47                 case WIFI_ERROR: \
48                         LOGE(format, ## args); \
49                         break; \
50                 case WIFI_WARN: \
51                         LOGW(format, ## args); \
52                         break; \
53                 default: \
54                         LOGI(format, ## args); \
55                 } \
56         } while (0)
57
58 #define SECURE_WIFI_LOG(log_level, format, args...) \
59         do { \
60                 switch (log_level) { \
61                 case WIFI_ERROR: \
62                         SECURE_LOGE(format, ## args); \
63                         break; \
64                 case WIFI_WARN: \
65                         SECURE_LOGW(format, ## args); \
66                         break; \
67                 default: \
68                         SECURE_LOGI(format, ## args); \
69                 } \
70         } while (0)
71
72 #ifdef __cplusplus
73 }
74 #endif /* __cplusplus */
75
76 #endif