• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Broadcom Dongle Host Driver (DHD), RTT
4  *
5  * Copyright (C) 1999-2019, Broadcom.
6  *
7  *      Unless you and Broadcom execute a separate written software license
8  * agreement governing use of this software, this software is licensed to you
9  * under the terms of the GNU General Public License version 2 (the "GPL"),
10  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
11  * following added to such license:
12  *
13  *      As a special exception, the copyright holders of this software give you
14  * permission to link this software with independent modules, and to copy and
15  * distribute the resulting executable under terms of your choice, provided that
16  * you also meet, for each linked independent module, the terms and conditions of
17  * the license of that module.  An independent module is a module which is not
18  * derived from this software.  The special exception does not apply to any
19  * modifications of the software.
20  *
21  *      Notwithstanding the above, under no circumstances may you combine this
22  * software in any way with any other Broadcom software provided under a license
23  * other than the GPL, without Broadcom's express prior written consent.
24  *
25  *
26  * <<Broadcom-WL-IPTag/Open:>>
27  *
28  * $Id$
29  */
30 #ifndef __DHD_RTT_H__
31 #define __DHD_RTT_H__
32 
33 #include "dngl_stats.h"
34 
35 #define RTT_MAX_TARGET_CNT 50
36 #define RTT_MAX_FRAME_CNT 25
37 #define RTT_MAX_RETRY_CNT 10
38 #define DEFAULT_FTM_CNT 6
39 #define DEFAULT_RETRY_CNT 6
40 #define DEFAULT_FTM_FREQ 5180
41 #define DEFAULT_FTM_CNTR_FREQ0 5210
42 #define RTT_MAX_GEOFENCE_TARGET_CNT 8
43 
44 #define TARGET_INFO_SIZE(count) (sizeof(rtt_target_info_t) * count)
45 
46 #define TARGET_TYPE(target) (target->type)
47 
48 #define RTT_IS_ENABLED(rtt_status) (rtt_status->status == RTT_ENABLED)
49 #define RTT_IS_STOPPED(rtt_status) (rtt_status->status == RTT_STOPPED)
50 
51 #define GEOFENCE_RTT_LOCK(rtt_status) mutex_lock(&(rtt_status)->geofence_mutex)
52 #define GEOFENCE_RTT_UNLOCK(rtt_status) mutex_unlock(&(rtt_status)->geofence_mutex)
53 
54 #ifndef BIT
55 #define BIT(x) (1 << (x))
56 #endif // endif
57 
58 /* DSSS, CCK and 802.11n rates in [500kbps] units */
59 #define WL_MAXRATE	108	/* in 500kbps units */
60 #define WL_RATE_1M	2	/* in 500kbps units */
61 #define WL_RATE_2M	4	/* in 500kbps units */
62 #define WL_RATE_5M5	11	/* in 500kbps units */
63 #define WL_RATE_11M	22	/* in 500kbps units */
64 #define WL_RATE_6M	12	/* in 500kbps units */
65 #define WL_RATE_9M	18	/* in 500kbps units */
66 #define WL_RATE_12M	24	/* in 500kbps units */
67 #define WL_RATE_18M	36	/* in 500kbps units */
68 #define WL_RATE_24M	48	/* in 500kbps units */
69 #define WL_RATE_36M	72	/* in 500kbps units */
70 #define WL_RATE_48M	96	/* in 500kbps units */
71 #define WL_RATE_54M	108	/* in 500kbps units */
72 #define GET_RTTSTATE(dhd) ((rtt_status_info_t *)dhd->rtt_state)
73 
74 #ifdef WL_NAN
75 /* RTT Retry Timer Interval */
76 #define DHD_RTT_RETRY_TIMER_INTERVAL_MS		3000u
77 #endif /* WL_NAN */
78 
79 #define DHD_RTT_INVALID_TARGET_INDEX		-1
80 
81 enum rtt_role {
82 	RTT_INITIATOR = 0,
83 	RTT_TARGET = 1
84 };
85 enum rtt_status {
86 	RTT_STOPPED = 0,
87 	RTT_STARTED = 1,
88 	RTT_ENABLED = 2
89 };
90 typedef int64_t wifi_timestamp; /* In microseconds (us) */
91 typedef int64_t wifi_timespan;
92 typedef int32 wifi_rssi_rtt;
93 
94 typedef enum {
95 	RTT_INVALID,
96 	RTT_ONE_WAY,
97 	RTT_TWO_WAY,
98 	RTT_AUTO
99 } rtt_type_t;
100 
101 /* RTT peer type */
102 typedef enum {
103 	RTT_PEER_AP         = 0x1,
104 	RTT_PEER_STA        = 0x2,
105 	RTT_PEER_P2P_GO     = 0x3,
106 	RTT_PEER_P2P_CLIENT = 0x4,
107 	RTT_PEER_NAN        = 0x5,
108 	RTT_PEER_INVALID    = 0x6
109 } rtt_peer_type_t;
110 
111 /* Ranging status */
112 typedef enum rtt_reason {
113 	RTT_STATUS_SUCCESS       = 0,
114 	RTT_STATUS_FAILURE       = 1,           // general failure status
115 	RTT_STATUS_FAIL_NO_RSP   = 2,           // target STA does not respond to request
116 	RTT_STATUS_FAIL_REJECTED = 3,           // request rejected. Applies to 2-sided RTT only
117 	RTT_STATUS_FAIL_NOT_SCHEDULED_YET  = 4,
118 	RTT_STATUS_FAIL_TM_TIMEOUT         = 5, // timing measurement times out
119 	RTT_STATUS_FAIL_AP_ON_DIFF_CHANNEL = 6, // Target on different channel, cannot range
120 	RTT_STATUS_FAIL_NO_CAPABILITY  = 7,     // ranging not supported
121 	RTT_STATUS_ABORTED             = 8,     // request aborted for unknown reason
122 	RTT_STATUS_FAIL_INVALID_TS     = 9,     // Invalid T1-T4 timestamp
123 	RTT_STATUS_FAIL_PROTOCOL       = 10,    // 11mc protocol failed
124 	RTT_STATUS_FAIL_SCHEDULE       = 11,    // request could not be scheduled
125 	RTT_STATUS_FAIL_BUSY_TRY_LATER = 12,    // responder cannot collaborate at time of request
126 	RTT_STATUS_INVALID_REQ         = 13,    // bad request args
127 	RTT_STATUS_NO_WIFI             = 14,    // WiFi not enabled Responder overrides param info
128 						// cannot range with new params
129 	RTT_STATUS_FAIL_FTM_PARAM_OVERRIDE = 15
130 } rtt_reason_t;
131 
132 enum {
133 	RTT_CAP_ONE_WAY	 = BIT(0),
134 	/* IEEE802.11mc */
135 	RTT_CAP_FTM_WAY  = BIT(1)
136 };
137 
138 enum {
139 	RTT_FEATURE_LCI = BIT(0),
140 	RTT_FEATURE_LCR = BIT(1),
141 	RTT_FEATURE_PREAMBLE = BIT(2),
142 	RTT_FEATURE_BW = BIT(3)
143 };
144 
145 enum {
146 	RTT_PREAMBLE_LEGACY = BIT(0),
147 	RTT_PREAMBLE_HT = BIT(1),
148 	RTT_PREAMBLE_VHT = BIT(2)
149 };
150 
151 enum {
152 	RTT_BW_5 = BIT(0),
153 	RTT_BW_10 = BIT(1),
154 	RTT_BW_20 = BIT(2),
155 	RTT_BW_40 = BIT(3),
156 	RTT_BW_80 = BIT(4),
157 	RTT_BW_160 = BIT(5)
158 };
159 
160 enum rtt_rate_bw {
161 	RTT_RATE_20M,
162 	RTT_RATE_40M,
163 	RTT_RATE_80M,
164 	RTT_RATE_160M
165 };
166 
167 typedef enum ranging_type {
168 	RTT_TYPE_INVALID	=	0,
169 	RTT_TYPE_LEGACY		=	1,
170 	RTT_TYPE_NAN_DIRECTED	=	2,
171 	RTT_TYPE_NAN_GEOFENCE	=	3
172 } ranging_type_t;
173 
174 #define FTM_MAX_NUM_BURST_EXP	14
175 #define HAS_11MC_CAP(cap) (cap & RTT_CAP_FTM_WAY)
176 #define HAS_ONEWAY_CAP(cap) (cap & RTT_CAP_ONE_WAY)
177 #define HAS_RTT_CAP(cap) (HAS_ONEWAY_CAP(cap) || HAS_11MC_CAP(cap))
178 
179 typedef struct wifi_channel_info {
180 	wifi_channel_width_t width;
181 	wifi_channel center_freq; /* primary 20 MHz channel */
182 	wifi_channel center_freq0; /* center freq (MHz) first segment */
183 	wifi_channel center_freq1; /* center freq (MHz) second segment valid for 80 + 80 */
184 } wifi_channel_info_t;
185 
186 typedef struct wifi_rate {
187 	uint32 preamble :3; /* 0: OFDM, 1: CCK, 2 : HT, 3: VHT, 4..7 reserved */
188 	uint32 nss		:2; /* 1 : 1x1, 2: 2x2, 3: 3x3, 4: 4x4 */
189 	uint32 bw		:3; /* 0: 20Mhz, 1: 40Mhz, 2: 80Mhz, 3: 160Mhz */
190 	/* OFDM/CCK rate code would be as per IEEE std in the unit of 0.5 mb
191 	* HT/VHT it would be mcs index
192 	*/
193 	uint32 rateMcsIdx :8;
194 	uint32 reserved :16; /* reserved */
195 	uint32 bitrate;	/* unit of 100 Kbps */
196 } wifi_rate_t;
197 
198 typedef struct rtt_target_info {
199 	struct ether_addr addr;
200 	struct ether_addr local_addr;
201 	rtt_type_t type; /* rtt_type */
202 	rtt_peer_type_t peer; /* peer type */
203 	wifi_channel_info_t channel; /* channel information */
204 	chanspec_t chanspec; /* chanspec for channel */
205 	bool	disable; /* disable for RTT measurement */
206 	/*
207 	* Time interval between bursts (units: 100 ms).
208 	* Applies to 1-sided and 2-sided RTT multi-burst requests.
209 	* Range: 0-31, 0: no preference by initiator (2-sided RTT)
210 	*/
211 	uint32	burst_period;
212 	/*
213 	* Total number of RTT bursts to be executed. It will be
214 	* specified in the same way as the parameter "Number of
215 	* Burst Exponent" found in the FTM frame format. It
216 	* applies to both: 1-sided RTT and 2-sided RTT. Valid
217 	* values are 0 to 15 as defined in 802.11mc std.
218 	* 0 means single shot
219 	* The implication of this parameter on the maximum
220 	* number of RTT results is the following:
221 	* for 1-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst)
222 	* for 2-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst - 1)
223 	*/
224 	uint16 num_burst;
225 	/*
226 	* num of frames per burst.
227 	* Minimum value = 1, Maximum value = 31
228 	* For 2-sided this equals the number of FTM frames
229 	* to be attempted in a single burst. This also
230 	* equals the number of FTM frames that the
231 	* initiator will request that the responder send
232 	* in a single frame
233 	*/
234 	uint32 num_frames_per_burst;
235 	/*
236 	 * num of frames in each RTT burst
237 	 * for single side, measurement result num = frame number
238 	 * for 2 side RTT, measurement result num  = frame number - 1
239 	 */
240 	uint32 num_retries_per_ftm; /* retry time for RTT measurment frame */
241 	/* following fields are only valid for 2 side RTT */
242 	uint32 num_retries_per_ftmr;
243 	uint8  LCI_request;
244 	uint8  LCR_request;
245 	/*
246 	* Applies to 1-sided and 2-sided RTT. Valid values will
247 	* be 2-11 and 15 as specified by the 802.11mc std for
248 	* the FTM parameter burst duration. In a multi-burst
249 	* request, if responder overrides with larger value,
250 	* the initiator will return failure. In a single-burst
251 	* request if responder overrides with larger value,
252 	* the initiator will sent TMR_STOP to terminate RTT
253 	* at the end of the burst_duration it requested.
254 	*/
255 	uint32 burst_duration;
256 	uint32 burst_timeout;
257 	uint8  preamble; /* 1 - Legacy, 2 - HT, 4 - VHT */
258 	uint8  bw;  /* 5, 10, 20, 40, 80, 160 */
259 } rtt_target_info_t;
260 
261 typedef struct rtt_goefence_target_info {
262 	bool valid;
263 	struct ether_addr peer_addr;
264 } rtt_geofence_target_info_t;
265 
266 typedef struct rtt_config_params {
267 	int8 rtt_target_cnt;
268 	rtt_target_info_t *target_info;
269 } rtt_config_params_t;
270 
271 typedef struct rtt_geofence_cfg {
272 	int8 geofence_target_cnt;
273 	bool rtt_in_progress;
274 	bool role_concurr_state;
275 	int8 cur_target_idx;
276 	rtt_geofence_target_info_t geofence_target_info[RTT_MAX_GEOFENCE_TARGET_CNT];
277 	int geofence_rtt_interval;
278 #ifdef RTT_GEOFENCE_CONT
279 	bool geofence_cont;
280 #endif /* RTT_GEOFENCE_CONT */
281 } rtt_geofence_cfg_t;
282 
283 /*
284  * Keep Adding more reasons
285  * going forward if needed
286  */
287 enum rtt_schedule_reason {
288 	RTT_SCHED_HOST_TRIGGER			= 1, /* On host command for directed RTT */
289 	RTT_SCHED_SUB_MATCH			= 2, /* on Sub Match for svc with range req */
290 	RTT_SCHED_DIR_TRIGGER_FAIL		= 3, /* On failure of Directed RTT Trigger */
291 	RTT_SCHED_DP_END			= 4, /* ON NDP End event from fw */
292 	RTT_SCHED_DP_REJECTED			= 5, /* On receving reject dp event from fw */
293 	RTT_SCHED_RNG_RPT_DIRECTED		= 6, /* On Ranging report for directed RTT */
294 	RTT_SCHED_RNG_TERM			= 7, /* On Range Term Indicator */
295 	RTT_SHCED_HOST_DIRECTED_TERM		= 8, /* On host terminating directed RTT sessions */
296 	RTT_SCHED_RNG_RPT_GEOFENCE		= 9, /* On Ranging report for geofence RTT */
297 	RTT_SCHED_RTT_RETRY_GEOFENCE		= 10, /* On Geofence Retry */
298 	RTT_SCHED_RNG_TERM_PEND_ROLE_CHANGE	= 11 /* On Rng Term, while pending role change */
299 };
300 
301 /*
302  * Keep Adding more invalid RTT states
303  * going forward if needed
304  */
305 enum rtt_invalid_state {
306 	RTT_STATE_VALID			= 0, /* RTT state is valid */
307 	RTT_STATE_INV_REASON_NDP_EXIST	= 1 /* RTT state invalid as ndp exists */
308 };
309 
310 typedef struct rtt_status_info {
311 	dhd_pub_t	*dhd;
312 	int8		status;   /* current status for the current entry */
313 	int8		txchain; /* current device tx chain */
314 	int		pm; /* to save current value of pm */
315 	int8		pm_restore; /* flag to reset the old value of pm */
316 	int8		cur_idx; /* current entry to do RTT */
317 	bool		all_cancel; /* cancel all request once we got the cancel requet */
318 	uint32		flags; /* indicate whether device is configured as initiator or target */
319 	struct capability {
320 		int32 proto     :8;
321 		int32 feature   :8;
322 		int32 preamble  :8;
323 		int32 bw        :8;
324 	} rtt_capa; /* rtt capability */
325 	struct			mutex rtt_mutex;
326 	struct			mutex rtt_work_mutex;
327 	struct			mutex geofence_mutex;
328 	rtt_config_params_t	rtt_config;
329 	rtt_geofence_cfg_t	geofence_cfg;
330 	struct work_struct	work;
331 	struct list_head	noti_fn_list;
332 	struct list_head	rtt_results_cache; /* store results for RTT */
333 	int			rtt_sched_reason; /* rtt_schedule_reason: what scheduled RTT */
334 	struct delayed_work	proxd_timeout; /* Proxd Timeout work */
335 	struct delayed_work	rtt_retry_timer;   /* Timer for retry RTT after all targets done */
336 } rtt_status_info_t;
337 
338 typedef struct rtt_report {
339 	struct ether_addr addr;
340 	unsigned int burst_num; /* # of burst inside a multi-burst request */
341 	unsigned int ftm_num; /* total RTT measurement frames attempted */
342 	unsigned int success_num; /* total successful RTT measurement frames */
343 	uint8  num_per_burst_peer; /* max number of FTM number per burst the peer support */
344 	rtt_reason_t status; /* raging status */
345 	/* in s, 11mc only, only for RTT_REASON_FAIL_BUSY_TRY_LATER, 1- 31s */
346 	uint8 retry_after_duration;
347 	rtt_type_t type; /* rtt type */
348 	wifi_rssi_rtt  rssi; /* average rssi in 0.5 dB steps e.g. 143 implies -71.5 dB */
349 	wifi_rssi_rtt  rssi_spread; /* rssi spread in 0.5 db steps e.g. 5 implies 2.5 spread */
350 	/*
351 	* 1-sided RTT: TX rate of RTT frame.
352 	* 2-sided RTT: TX rate of initiator's Ack in response to FTM frame.
353 	*/
354 	wifi_rate_t tx_rate;
355 	/*
356 	* 1-sided RTT: TX rate of Ack from other side.
357 	* 2-sided RTT: TX rate of FTM frame coming from responder.
358 	*/
359 	wifi_rate_t rx_rate;
360 	wifi_timespan rtt;	/*  round trip time in 0.1 nanoseconds */
361 	wifi_timespan rtt_sd;	/* rtt standard deviation in 0.1 nanoseconds */
362 	wifi_timespan rtt_spread; /* difference between max and min rtt times recorded */
363 	int distance; /* distance in cm (optional) */
364 	int distance_sd; /* standard deviation in cm (optional) */
365 	int distance_spread; /* difference between max and min distance recorded (optional) */
366 	wifi_timestamp ts; /* time of the measurement (in microseconds since boot) */
367 	int burst_duration; /* in ms, how long the FW time is to fininish one burst measurement */
368 	int negotiated_burst_num; /* Number of bursts allowed by the responder */
369 	bcm_tlv_t *LCI; /* LCI Report */
370 	bcm_tlv_t *LCR; /* Location Civic Report */
371 } rtt_report_t;
372 #define RTT_REPORT_SIZE (sizeof(rtt_report_t))
373 
374 /* rtt_results_header to maintain rtt result list per mac address */
375 typedef struct rtt_results_header {
376 	struct ether_addr peer_mac;
377 	uint32 result_cnt;
378 	uint32 result_tot_len; /* sum of report_len of rtt_result */
379 	struct list_head list;
380 	struct list_head result_list;
381 } rtt_results_header_t;
382 struct rtt_result_detail {
383 	uint8 num_ota_meas;
384 	uint32 result_flags;
385 };
386 /* rtt_result to link all of rtt_report */
387 typedef struct rtt_result {
388 	struct list_head list;
389 	struct rtt_report report;
390 	int32 report_len; /* total length of rtt_report */
391 	struct rtt_result_detail rtt_detail;
392 	int32 detail_len;
393 } rtt_result_t;
394 
395 /* RTT Capabilities */
396 typedef struct rtt_capabilities {
397 	uint8 rtt_one_sided_supported;  /* if 1-sided rtt data collection is supported */
398 	uint8 rtt_ftm_supported;        /* if ftm rtt data collection is supported */
399 	uint8 lci_support;		/* location configuration information */
400 	uint8 lcr_support;		/* Civic Location */
401 	uint8 preamble_support;         /* bit mask indicate what preamble is supported */
402 	uint8 bw_support;               /* bit mask indicate what BW is supported */
403 } rtt_capabilities_t;
404 
405 /* RTT responder information */
406 typedef struct wifi_rtt_responder {
407 	wifi_channel_info channel;   /* channel of responder */
408 	uint8 preamble;             /* preamble supported by responder */
409 } wifi_rtt_responder_t;
410 
411 typedef void (*dhd_rtt_compl_noti_fn)(void *ctx, void *rtt_data);
412 /* Linux wrapper to call common dhd_rtt_set_cfg */
413 int
414 dhd_dev_rtt_set_cfg(struct net_device *dev, void *buf);
415 
416 int
417 dhd_dev_rtt_cancel_cfg(struct net_device *dev, struct ether_addr *mac_list, int mac_cnt);
418 
419 int
420 dhd_dev_rtt_register_noti_callback(struct net_device *dev, void *ctx,
421 	dhd_rtt_compl_noti_fn noti_fn);
422 
423 int
424 dhd_dev_rtt_unregister_noti_callback(struct net_device *dev, dhd_rtt_compl_noti_fn noti_fn);
425 
426 int
427 dhd_dev_rtt_capability(struct net_device *dev, rtt_capabilities_t *capa);
428 
429 int
430 dhd_dev_rtt_avail_channel(struct net_device *dev, wifi_channel_info *channel_info);
431 
432 int
433 dhd_dev_rtt_enable_responder(struct net_device *dev, wifi_channel_info *channel_info);
434 
435 int
436 dhd_dev_rtt_cancel_responder(struct net_device *dev);
437 /* export to upper layer */
438 chanspec_t
439 dhd_rtt_convert_to_chspec(wifi_channel_info_t channel);
440 
441 int
442 dhd_rtt_idx_to_burst_duration(uint idx);
443 
444 int
445 dhd_rtt_set_cfg(dhd_pub_t *dhd, rtt_config_params_t *params);
446 
447 #ifdef WL_NAN
448 void dhd_rtt_initialize_geofence_cfg(dhd_pub_t *dhd);
449 #ifdef RTT_GEOFENCE_CONT
450 void dhd_rtt_set_geofence_cont_ind(dhd_pub_t *dhd, bool geofence_cont);
451 
452 void dhd_rtt_get_geofence_cont_ind(dhd_pub_t *dhd, bool* geofence_cont);
453 #endif /* RTT_GEOFENCE_CONT */
454 
455 #ifdef RTT_GEOFENCE_INTERVAL
456 void dhd_rtt_set_geofence_rtt_interval(dhd_pub_t *dhd, int interval);
457 #endif /* RTT_GEOFENCE_INTERVAL */
458 
459 void dhd_rtt_set_role_concurrency_state(dhd_pub_t *dhd, bool state);
460 
461 bool dhd_rtt_get_role_concurrency_state(dhd_pub_t *dhd);
462 
463 int8 dhd_rtt_get_geofence_target_cnt(dhd_pub_t *dhd);
464 
465 void dhd_rtt_set_geofence_rtt_state(dhd_pub_t *dhd, bool state);
466 
467 bool dhd_rtt_get_geofence_rtt_state(dhd_pub_t *dhd);
468 
469 rtt_geofence_target_info_t*
470 dhd_rtt_get_geofence_target_head(dhd_pub_t *dhd);
471 
472 rtt_geofence_target_info_t*
473 dhd_rtt_get_geofence_current_target(dhd_pub_t *dhd);
474 
475 rtt_geofence_target_info_t*
476 dhd_rtt_get_geofence_target(dhd_pub_t *dhd, struct ether_addr* peer_addr,
477 	int8 *index);
478 
479 int
480 dhd_rtt_add_geofence_target(dhd_pub_t *dhd, rtt_geofence_target_info_t  *target);
481 
482 int
483 dhd_rtt_remove_geofence_target(dhd_pub_t *dhd, struct ether_addr *peer_addr);
484 
485 int
486 dhd_rtt_delete_geofence_target_list(dhd_pub_t *dhd);
487 
488 int
489 dhd_rtt_delete_nan_session(dhd_pub_t *dhd);
490 #endif /* WL_NAN */
491 
492 uint8
493 dhd_rtt_invalid_states(struct net_device *ndev, struct ether_addr *peer_addr);
494 
495 void
496 dhd_rtt_schedule_rtt_work_thread(dhd_pub_t *dhd, int sched_reason);
497 
498 int
499 dhd_rtt_stop(dhd_pub_t *dhd, struct ether_addr *mac_list, int mac_cnt);
500 
501 int
502 dhd_rtt_register_noti_callback(dhd_pub_t *dhd, void *ctx, dhd_rtt_compl_noti_fn noti_fn);
503 
504 int
505 dhd_rtt_unregister_noti_callback(dhd_pub_t *dhd, dhd_rtt_compl_noti_fn noti_fn);
506 
507 int
508 dhd_rtt_event_handler(dhd_pub_t *dhd, wl_event_msg_t *event, void *event_data);
509 
510 int
511 dhd_rtt_capability(dhd_pub_t *dhd, rtt_capabilities_t *capa);
512 
513 int
514 dhd_rtt_avail_channel(dhd_pub_t *dhd, wifi_channel_info *channel_info);
515 
516 int
517 dhd_rtt_enable_responder(dhd_pub_t *dhd, wifi_channel_info *channel_info);
518 
519 int
520 dhd_rtt_cancel_responder(dhd_pub_t *dhd);
521 
522 int
523 dhd_rtt_init(dhd_pub_t *dhd);
524 
525 int
526 dhd_rtt_deinit(dhd_pub_t *dhd);
527 
528 #ifdef WL_CFG80211
529 int dhd_rtt_handle_nan_rtt_session_end(dhd_pub_t *dhd,
530 	struct ether_addr *peer);
531 
532 void dhd_rtt_move_geofence_cur_target_idx_to_next(dhd_pub_t *dhd);
533 
534 int8 dhd_rtt_get_geofence_cur_target_idx(dhd_pub_t *dhd);
535 #endif /* WL_CFG80211 */
536 
537 #endif /* __DHD_RTT_H__ */
538