blob: e47554ee7aeac7a4a5768ff7d08417520ed57031 [file] [log] [blame]
Ravi Joshia063dd92016-05-25 16:43:13 -07001/*
2 * Copyright (c) 2016 The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 * Permission to use, copy, modify, and/or distribute this software for
7 * any purpose with or without fee is hereby granted, provided that the
8 * above copyright notice and this permission notice appear in all
9 * copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
12 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
13 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
14 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
16 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
17 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18 * PERFORMANCE OF THIS SOFTWARE.
19 */
20
21/**
22 * DOC: sme_nan_datapath.h
23 *
24 * SME NAN Data path API specification
25 */
26
27#ifndef __SME_NAN_DATAPATH_H
28#define __SME_NAN_DATAPATH_H
29
Abhishek Singh4fef7472016-06-06 11:36:03 -070030#include "csr_inside_api.h"
31
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -070032#ifdef WLAN_FEATURE_NAN_DATAPATH
33#include "qdf_types.h"
34#include "sir_api.h"
Ravi Joshi412f23d2016-05-26 15:09:23 -070035#include "ani_global.h"
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -070036#include "sme_inside.h"
37
38/**
39 * struct sir_sme_ndp_initiator_req - sme request struct for ndp initiator req
40 * @mesgType: SME msg type(eWNI_SME_NDP_INITIATOR_REQ)
41 * @mesgLen: lenght of message
42 * @req: actual ndp initiator request
43 *
44 */
45struct sir_sme_ndp_initiator_req {
46 uint16_t msg_type;
47 uint16_t msg_len;
48 struct ndp_initiator_req req;
49};
Ravi Joshi412f23d2016-05-26 15:09:23 -070050
Abhishek Singh4fef7472016-06-06 11:36:03 -070051/**
52 * struct sir_sme_ndp_responder_req - Wraper of responder's response
53 * to ndp create request
54 * @msg_type: SME msg type
55 * @msg_len: Length of msg
56 * @req: responder's response to ndp create request
57 *
58 */
59struct sir_sme_ndp_responder_req {
60 uint16_t msg_type;
61 uint16_t msg_len;
62 struct ndp_responder_req req;
63};
64
Naveen Rawatf28315c2016-06-29 18:06:02 -070065/*
66 * struct sir_sme_ndp_end_req - sme request struct for ndp end req
67 * @msg_type: SME msg type(sir_sme_ndp_initiator_req)
68 * @msg_len: lenght of message
69 * @req: actual ndp initiator request
70 *
71 */
72struct sir_sme_ndp_end_req {
73 uint16_t msg_type;
74 uint16_t msg_len;
75 struct ndp_end_req *req;
76};
77
Abhishek Singh4fef7472016-06-06 11:36:03 -070078/* NaN initiator request handler */
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -070079QDF_STATUS sme_ndp_initiator_req_handler(tHalHandle hal,
Ravi Joshi412f23d2016-05-26 15:09:23 -070080 struct ndp_initiator_req *req_params);
81
Abhishek Singh4fef7472016-06-06 11:36:03 -070082/* NaN responder request handler */
83QDF_STATUS sme_ndp_responder_req_handler(tHalHandle hal,
Ravi Joshi412f23d2016-05-26 15:09:23 -070084 struct ndp_responder_req *req_params);
85
86/* NAN indication response handler */
Naveen Rawatf28315c2016-06-29 18:06:02 -070087QDF_STATUS sme_ndp_end_req_handler(tHalHandle hal, struct ndp_end_req *req);
Ravi Joshi412f23d2016-05-26 15:09:23 -070088
89/* NAN schedule update request handler */
90QDF_STATUS sme_ndp_sched_req_handler(uint32_t session_id,
91 struct ndp_schedule_update_req *req_params);
92
93/* Function to handle NDP messages from lower layers */
94void sme_ndp_message_processor(tpAniSirGlobal mac_ctx, uint16_t msg_type,
95 void *msg);
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -070096
97/* Start NDI BSS */
98QDF_STATUS csr_roam_start_ndi(tpAniSirGlobal mac_ctx, uint32_t session_id,
99 tCsrRoamProfile *profile);
100
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -0700101void csr_roam_save_ndi_connected_info(tpAniSirGlobal mac_ctx,
102 uint32_t session_id,
103 tCsrRoamProfile *roam_profile,
104 tSirBssDescription *bss_desc);
105
106void csr_roam_update_ndp_return_params(tpAniSirGlobal mac_ctx,
107 uint32_t result,
108 uint32_t *roam_status,
Deepak Dhamdhere13983f22016-05-31 19:06:09 -0700109 uint32_t *roam_result,
110 struct tagCsrRoamInfo *roam_info);
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -0700111QDF_STATUS csr_process_ndp_initiator_request(tpAniSirGlobal mac_ctx,
112 tSmeCmd *cmd);
Naveen Rawatf28315c2016-06-29 18:06:02 -0700113QDF_STATUS csr_process_ndp_data_end_request(tpAniSirGlobal mac_ctx,
114 tSmeCmd *cmd);
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -0700115
116void sme_ndp_msg_processor(tpAniSirGlobal mac_ctx, cds_msg_t *msg);
117
Abhishek Singh4fef7472016-06-06 11:36:03 -0700118QDF_STATUS csr_process_ndp_responder_request(tpAniSirGlobal mac_ctx,
119 tSmeCmd *cmd);
Naveen Rawat64a9a1a2016-06-06 14:55:48 -0700120
121void csr_release_ndp_initiator_req(tpAniSirGlobal mac_ctx, tSmeCmd *cmd);
122void csr_release_ndp_responder_req(tpAniSirGlobal mac_ctx, tSmeCmd *cmd);
123void csr_release_ndp_data_end_req(tpAniSirGlobal mac_ctx, tSmeCmd *cmd);
124
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -0700125#else
126
127/* Start NDI BSS */
128static inline QDF_STATUS csr_roam_start_ndi(tpAniSirGlobal mac_ctx,
129 uint32_t session_id,
130 tCsrRoamProfile *profile)
131{
132 return QDF_STATUS_SUCCESS;
133}
134
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -0700135static inline void csr_roam_save_ndi_connected_info(tpAniSirGlobal mac_ctx,
136 uint32_t session_id,
137 tCsrRoamProfile *roam_profile,
138 tSirBssDescription *bss_desc)
139{
140}
141
142static inline void csr_roam_update_ndp_return_params(tpAniSirGlobal mac_ctx,
Deepak Dhamdhere13983f22016-05-31 19:06:09 -0700143 uint32_t result,
144 uint32_t *roam_status,
145 uint32_t *roam_result,
146 struct tagCsrRoamInfo *roam_info)
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -0700147{
148}
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -0700149
150/* NaN indication response handler */
151QDF_STATUS sme_ndp_end_req_handler(uint32_t session_id,
152 struct ndp_end_req *req_params);
153
154/* NaN schedule update request handler */
155QDF_STATUS sme_ndp_sched_req_handler(uint32_t session_id,
156 struct ndp_schedule_update_req *req_params);
157
Abhishek Singh4fef7472016-06-06 11:36:03 -0700158static inline QDF_STATUS csr_process_ndp_initiator_request(
Deepak Dhamdhere0f076bd2016-06-02 11:29:21 -0700159 tpAniSirGlobal mac_ctx, tSmeCmd *cmd)
160{
161 return QDF_STATUS_SUCCESS;
162}
163
164static inline void sme_ndp_msg_processor(tpAniSirGlobal mac_ctx, cds_msg_t *msg)
165{
166}
167
Abhishek Singh4fef7472016-06-06 11:36:03 -0700168static inline QDF_STATUS csr_process_ndp_responder_request(
169 tpAniSirGlobal mac_ctx, tSmeCmd *cmd)
170{
171 return QDF_STATUS_SUCCESS;
172}
Naveen Rawatf28315c2016-06-29 18:06:02 -0700173
174static inline QDF_STATUS csr_process_ndp_data_end_request(
175 tpAniSirGlobal mac_ctx, tSmeCmd *cmd)
176{
177 return QDF_STATUS_SUCCESS;
178}
179
Naveen Rawat64a9a1a2016-06-06 14:55:48 -0700180static inline void csr_release_ndp_initiator_req(tpAniSirGlobal mac_ctx,
181 tSmeCmd *cmd) {}
182static inline void csr_release_ndp_responder_req(tpAniSirGlobal mac_ctx,
183 tSmeCmd *cmd) {}
184static inline void csr_release_ndp_data_end_req(tpAniSirGlobal mac_ctx,
185 tSmeCmd *cmd) {}
186
Deepak Dhamdheree2dd5442016-05-27 15:05:51 -0700187#endif /* WLAN_FEATURE_NAN_DATAPATH */
Ravi Joshia063dd92016-05-25 16:43:13 -0700188#endif /* __SME_NAN_DATAPATH_H */