1*5113495bSYour Name /*
2*5113495bSYour Name * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
3*5113495bSYour Name *
4*5113495bSYour Name * Permission to use, copy, modify, and/or distribute this software for any
5*5113495bSYour Name * purpose with or without fee is hereby granted, provided that the above
6*5113495bSYour Name * copyright notice and this permission notice appear in all copies.
7*5113495bSYour Name *
8*5113495bSYour Name * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9*5113495bSYour Name * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10*5113495bSYour Name * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11*5113495bSYour Name * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12*5113495bSYour Name * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13*5113495bSYour Name * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14*5113495bSYour Name * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*5113495bSYour Name */
16*5113495bSYour Name
17*5113495bSYour Name /**
18*5113495bSYour Name * DOC: wlan_hdd_afc.h
19*5113495bSYour Name *
20*5113495bSYour Name * This file has the AFC osif interface with linux kernel.
21*5113495bSYour Name */
22*5113495bSYour Name
23*5113495bSYour Name #ifndef __WLAN_HDD_AFC_H__
24*5113495bSYour Name #define __WLAN_HDD_AFC_H__
25*5113495bSYour Name #include <wlan_cfg80211.h>
26*5113495bSYour Name #include <qca_vendor.h>
27*5113495bSYour Name #include <wlan_objmgr_cmn.h>
28*5113495bSYour Name #include <wlan_cfg80211_afc.h>
29*5113495bSYour Name
30*5113495bSYour Name #ifdef CONFIG_AFC_SUPPORT
31*5113495bSYour Name
32*5113495bSYour Name #define FEATURE_AFC_VENDOR_COMMANDS \
33*5113495bSYour Name { \
34*5113495bSYour Name .info.vendor_id = QCA_NL80211_VENDOR_ID, \
35*5113495bSYour Name .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_AFC_RESPONSE, \
36*5113495bSYour Name .doit = wlan_hdd_vendor_afc_response, \
37*5113495bSYour Name vendor_command_policy(wlan_cfg80211_afc_response_policy, \
38*5113495bSYour Name QCA_WLAN_VENDOR_ATTR_AFC_RESP_MAX) \
39*5113495bSYour Name },
40*5113495bSYour Name
41*5113495bSYour Name #define FEATURE_AFC_VENDOR_EVENTS \
42*5113495bSYour Name [QCA_NL80211_VENDOR_SUBCMD_AFC_EVENT_INDEX] = { \
43*5113495bSYour Name .vendor_id = QCA_NL80211_VENDOR_ID, \
44*5113495bSYour Name .subcmd = QCA_NL80211_VENDOR_SUBCMD_AFC_EVENT, \
45*5113495bSYour Name },
46*5113495bSYour Name
47*5113495bSYour Name /**
48*5113495bSYour Name * wlan_hdd_vendor_afc_response() - OSIF callback function of NL vendor AFC
49*5113495bSYour Name * response command.
50*5113495bSYour Name * @wiphy: Pointer to WIPHY object
51*5113495bSYour Name * @wdev: Pointer to wireless device
52*5113495bSYour Name * @data: Pointer to NL vendor command of AFC response
53*5113495bSYour Name * @data_len: Length of NL vendor command of AFC response
54*5113495bSYour Name *
55*5113495bSYour Name * Return: 0 if success, otherwise error code
56*5113495bSYour Name */
57*5113495bSYour Name int wlan_hdd_vendor_afc_response(struct wiphy *wiphy,
58*5113495bSYour Name struct wireless_dev *wdev,
59*5113495bSYour Name const void *data,
60*5113495bSYour Name int data_len);
61*5113495bSYour Name
62*5113495bSYour Name /**
63*5113495bSYour Name * wlan_hdd_register_afc_pld_cb() - API to register AFC PLD function to pass
64*5113495bSYour Name * AFC response data to target.
65*5113495bSYour Name * @psoc: Pointer to PSOC object
66*5113495bSYour Name *
67*5113495bSYour Name * Return: None
68*5113495bSYour Name */
69*5113495bSYour Name void wlan_hdd_register_afc_pld_cb(struct wlan_objmgr_psoc *psoc);
70*5113495bSYour Name #else
71*5113495bSYour Name #define FEATURE_AFC_VENDOR_COMMANDS
72*5113495bSYour Name #define FEATURE_AFC_VENDOR_EVENTS
73*5113495bSYour Name
wlan_hdd_register_afc_pld_cb(struct wlan_objmgr_psoc * psoc)74*5113495bSYour Name static inline void wlan_hdd_register_afc_pld_cb(struct wlan_objmgr_psoc *psoc)
75*5113495bSYour Name {
76*5113495bSYour Name }
77*5113495bSYour Name #endif
78*5113495bSYour Name #endif
79