blob: 81844c77422dd8a7fe4682a403c9259a10f38daf [file] [log] [blame]
Om Prakash Tripathi3b3cd392016-12-19 13:02:30 +05301/*
Vivek3e5a3ba2017-02-20 18:13:57 +05302 * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
Om Prakash Tripathi3b3cd392016-12-19 13:02:30 +05303 *
4 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
19/**
20 * DOC: declares driver functions interfacing with linux kernel
21 */
22
Vivek3e5a3ba2017-02-20 18:13:57 +053023
24#ifndef _WLAN_CFG80211_H_
25#define _WLAN_CFG80211_H_
26
Om Prakash Tripathi3b3cd392016-12-19 13:02:30 +053027#include <linux/version.h>
28#include <linux/netdevice.h>
Sandeep Puligilla7acd31f2017-02-25 16:35:35 -080029#include <net/netlink.h>
Om Prakash Tripathi3b3cd392016-12-19 13:02:30 +053030#include <net/cfg80211.h>
Vivek3e5a3ba2017-02-20 18:13:57 +053031#include <qca_vendor.h>
Om Prakash Tripathi3b3cd392016-12-19 13:02:30 +053032
Abhishek Singh9eb058a2017-02-17 18:21:13 +053033#define cfg80211_log(level, args...) \
34 QDF_TRACE(QDF_MODULE_ID_OS_IF, level, ## args)
35#define cfg80211_logfl(level, format, args...) \
36 cfg80211_log(level, FL(format), ## args)
37
38#define cfg80211_alert(format, args...) \
39 cfg80211_logfl(QDF_TRACE_LEVEL_FATAL, format, ## args)
40#define cfg80211_err(format, args...) \
41 cfg80211_logfl(QDF_TRACE_LEVEL_ERROR, format, ## args)
42#define cfg80211_warn(format, args...) \
43 cfg80211_logfl(QDF_TRACE_LEVEL_WARN, format, ## args)
44#define cfg80211_notice(format, args...) \
45 cfg80211_logfl(QDF_TRACE_LEVEL_INFO, format, ## args)
46#define cfg80211_info(format, args...) \
47 cfg80211_logfl(QDF_TRACE_LEVEL_INFO_HIGH, format, ## args)
48#define cfg80211_debug(format, args...) \
49 cfg80211_logfl(QDF_TRACE_LEVEL_DEBUG, format, ## args)
50
Om Prakash Tripathi3b3cd392016-12-19 13:02:30 +053051#define COMMON_VENDOR_COMMANDS \
52{ \
53 .info.vendor_id = OUI_QCA, \
54 .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION,\
55 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \
56 WIPHY_VENDOR_CMD_NEED_NETDEV, \
57 .doit = NULL \
58}, \
59{ \
60 .info.vendor_id = OUI_QCA, \
61 .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION,\
62 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \
63 WIPHY_VENDOR_CMD_NEED_NETDEV, \
64 .doit = NULL \
65},
66
Sandeep Puligilla7acd31f2017-02-25 16:35:35 -080067#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0))
68static inline int
69wlan_cfg80211_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
70{
71 return nla_put_u64(skb, attrtype, value);
72}
73#else
74static inline int
75wlan_cfg80211_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
76{
77 return nla_put_u64_64bit(skb, attrtype, value, NL80211_ATTR_PAD);
78}
79#endif
80
Om Prakash Tripathi3b3cd392016-12-19 13:02:30 +053081#endif