blob: 14811b7ac846cd5ebc693aa8484f718ec20529e4 [file] [log] [blame]
Jeff Johnson2b0a7b82016-05-18 15:08:02 -07001/*
Mukul Sharma9223f232017-03-08 18:42:27 +05302 * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
Jeff Johnson2b0a7b82016-05-18 15:08:02 -07003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28#if !defined(WLAN_HDD_LPASS_H)
29#define WLAN_HDD_LPASS_H
30
Jeff Johnson9078bdc2016-09-23 17:18:11 -070031struct cds_config_info;
Jeff Johnsonc875e242016-09-23 18:12:34 -070032struct wma_tgt_cfg;
Jeff Johnson82797b62017-08-11 15:31:27 -070033struct hdd_context;
Jeff Johnson85b5c112017-08-11 15:15:23 -070034struct hdd_adapter;
Jeff Johnson9afc5012016-09-23 13:56:27 -070035
Jeff Johnson2b0a7b82016-05-18 15:08:02 -070036#ifdef WLAN_FEATURE_LPSS
Jeff Johnson71396692016-09-23 15:41:52 -070037/**
Jeff Johnsonc875e242016-09-23 18:12:34 -070038 * hdd_lpass_target_config() - Handle LPASS target configuration
39 * @hdd_ctx: HDD global context where lpass information is stored
40 * @target_config: Target configuration containing lpass info
41 *
42 * This function updates the HDD context with lpass-specific
43 * information provided by the target.
44 *
45 * Return: none
46 */
Jeff Johnson82797b62017-08-11 15:31:27 -070047void hdd_lpass_target_config(struct hdd_context *hdd_ctx,
Jeff Johnsonc875e242016-09-23 18:12:34 -070048 struct wma_tgt_cfg *target_config);
49
50/**
Jeff Johnson9078bdc2016-09-23 17:18:11 -070051 * hdd_lpass_populate_cds_config() - Populate LPASS configuration
52 * @cds_config: CDS configuration to populate with lpass info
53 * @hdd_ctx: HDD global context which contains lpass information
54 *
55 * This function seeds the CDS configuration structure with
56 * lpass-specific information gleaned from the HDD context.
57 *
58 * Return: none
59 */
60void hdd_lpass_populate_cds_config(struct cds_config_info *cds_config,
Jeff Johnson82797b62017-08-11 15:31:27 -070061 struct hdd_context *hdd_ctx);
Jeff Johnson9078bdc2016-09-23 17:18:11 -070062
63/**
Mukul Sharma9223f232017-03-08 18:42:27 +053064 * hdd_lpass_populate_pmo_config() - Populate LPASS configuration
65 * @pmo_config: PMO configuration to populate with lpass info
66 * @hdd_ctx: HDD global context which contains lpass information
67 *
68 * This function seeds the PMO configuration structure with
69 * lpass-specific information gleaned from the HDD context.
70 *
71 * Return: none
72 */
73void hdd_lpass_populate_pmo_config(struct pmo_psoc_cfg *pmo_config,
Jeff Johnson82797b62017-08-11 15:31:27 -070074 struct hdd_context *hdd_ctx);
Mukul Sharma9223f232017-03-08 18:42:27 +053075
76/**
Jeff Johnson71396692016-09-23 15:41:52 -070077 * hdd_lpass_notify_connect() - Notify LPASS of interface connect
78 * @adapter: The adapter that connected
79 *
80 * This function is used to notify the LPASS feature that an adapter
81 * has connected.
82 *
83 * Return: none
84 */
Jeff Johnson85b5c112017-08-11 15:15:23 -070085void hdd_lpass_notify_connect(struct hdd_adapter *adapter);
Jeff Johnson2ae6f712016-09-23 15:08:48 -070086
87/**
Jeff Johnsoncef59bb2016-09-23 15:28:47 -070088 * hdd_lpass_notify_disconnect() - Notify LPASS of interface disconnect
89 * @adapter: The adapter that connected
90 *
91 * This function is used to notify the LPASS feature that an adapter
92 * has disconnected.
93 *
94 * Return: none
95 */
Jeff Johnson85b5c112017-08-11 15:15:23 -070096void hdd_lpass_notify_disconnect(struct hdd_adapter *adapter);
Jeff Johnsoncef59bb2016-09-23 15:28:47 -070097
98/**
Jeff Johnson2ae6f712016-09-23 15:08:48 -070099 * hdd_lpass_notify_mode_change() - Notify LPASS of interface mode change
100 * @adapter: The adapter whose mode was changed
101 *
102 * This function is used to notify the LPASS feature that an adapter
103 * had its mode changed.
104 *
105 * Return: none
106 */
Jeff Johnson85b5c112017-08-11 15:15:23 -0700107void hdd_lpass_notify_mode_change(struct hdd_adapter *adapter);
Jeff Johnson9afc5012016-09-23 13:56:27 -0700108
109/**
110 * hdd_lpass_notify_start() - Notify LPASS of driver start
111 * @hdd_ctx: The global HDD context
112 *
113 * This function is used to notify the LPASS feature that the wlan
114 * driver has (re-)started.
115 *
116 * Return: none
117 */
Jeff Johnson82797b62017-08-11 15:31:27 -0700118void hdd_lpass_notify_start(struct hdd_context *hdd_ctx);
Jeff Johnsonf7f66f02016-09-23 14:50:11 -0700119
120/**
121 * hdd_lpass_notify_stop() - Notify LPASS of driver stop
122 * @hdd_ctx: The global HDD context
123 *
124 * This function is used to notify the LPASS feature that the wlan
125 * driver has stopped.
126 *
127 * Return: none
128 */
Jeff Johnson82797b62017-08-11 15:31:27 -0700129void hdd_lpass_notify_stop(struct hdd_context *hdd_ctx);
Jeff Johnsonb8bf9072016-09-23 17:39:27 -0700130
131/**
132 * hdd_lpass_is_supported() - Is lpass feature supported?
133 * @hdd_ctx: The global HDD context
134 *
135 * Return: true if feature is enabled and supported by firmware, false
136 * if the feature is not enabled or not supported by firmware.
137 */
Jeff Johnson82797b62017-08-11 15:31:27 -0700138bool hdd_lpass_is_supported(struct hdd_context *hdd_ctx);
Jeff Johnsonb8bf9072016-09-23 17:39:27 -0700139
Jeff Johnson2b0a7b82016-05-18 15:08:02 -0700140#else
Jeff Johnson82797b62017-08-11 15:31:27 -0700141static inline void hdd_lpass_target_config(struct hdd_context *hdd_ctx,
Jeff Johnsonc875e242016-09-23 18:12:34 -0700142 struct wma_tgt_cfg *target_config)
143{
144}
Jeff Johnson9078bdc2016-09-23 17:18:11 -0700145static inline
146void hdd_lpass_populate_cds_config(struct cds_config_info *cds_config,
Jeff Johnson82797b62017-08-11 15:31:27 -0700147 struct hdd_context *hdd_ctx)
Jeff Johnson9078bdc2016-09-23 17:18:11 -0700148{
149}
Mukul Sharma9223f232017-03-08 18:42:27 +0530150
151static inline
152void hdd_lpass_populate_pmo_config(struct pmo_psoc_cfg *pmo_config,
Jeff Johnson82797b62017-08-11 15:31:27 -0700153 struct hdd_context *hdd_ctx)
Mukul Sharma9223f232017-03-08 18:42:27 +0530154{
155}
156
Jeff Johnson85b5c112017-08-11 15:15:23 -0700157static inline void hdd_lpass_notify_connect(struct hdd_adapter *adapter)
Jeff Johnson2b0a7b82016-05-18 15:08:02 -0700158{
Jeff Johnson2b0a7b82016-05-18 15:08:02 -0700159}
Jeff Johnson85b5c112017-08-11 15:15:23 -0700160static inline void hdd_lpass_notify_disconnect(struct hdd_adapter *adapter)
Jeff Johnsoncef59bb2016-09-23 15:28:47 -0700161{
162}
Jeff Johnson85b5c112017-08-11 15:15:23 -0700163static inline void hdd_lpass_notify_mode_change(struct hdd_adapter *adapter)
Jeff Johnson2b0a7b82016-05-18 15:08:02 -0700164{
Jeff Johnson2b0a7b82016-05-18 15:08:02 -0700165}
Jeff Johnson82797b62017-08-11 15:31:27 -0700166static inline void hdd_lpass_notify_start(struct hdd_context *hdd_ctx) { }
167static inline void hdd_lpass_notify_stop(struct hdd_context *hdd_ctx) { }
168static inline bool hdd_lpass_is_supported(struct hdd_context *hdd_ctx)
Jeff Johnsonb8bf9072016-09-23 17:39:27 -0700169{
170 return false;
171}
Jeff Johnson2b0a7b82016-05-18 15:08:02 -0700172#endif
173
174#endif /* WLAN_HDD_LPASS_H */