blob: f251327d7f067af2cac29aeda87d9e0b13cdd6eb [file] [log] [blame]
Manikandan Mohandcc21ba2016-03-15 14:31:56 -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 *
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_TSF_H
29#define WLAN_HDD_TSF_H
30
31/**
32 * enum hdd_tsf_get_state - status of get tsf action
33 * @TSF_RETURN: get tsf
34 * @TSF_STA_NOT_CONNECTED_NO_TSF: sta not connected to ap
35 * @TSF_NOT_RETURNED_BY_FW: fw not returned tsf
36 * @TSF_CURRENT_IN_CAP_STATE: driver in capture state
37 * @TSF_CAPTURE_FAIL: capture fail
38 * @TSF_GET_FAIL: get fail
39 * @TSF_RESET_GPIO_FAIL: GPIO reset fail
40 * @TSF_SAP_NOT_STARTED_NO_TSF SAP not started
41 */
42enum hdd_tsf_get_state {
43 TSF_RETURN = 0,
44 TSF_STA_NOT_CONNECTED_NO_TSF,
45 TSF_NOT_RETURNED_BY_FW,
46 TSF_CURRENT_IN_CAP_STATE,
47 TSF_CAPTURE_FAIL,
48 TSF_GET_FAIL,
49 TSF_RESET_GPIO_FAIL,
50 TSF_SAP_NOT_STARTED_NO_TSF
51};
52
53/**
54 * enum hdd_tsf_capture_state - status of capture
55 * @TSF_IDLE: idle
56 * @TSF_CAP_STATE: current is in capture state
57 */
58enum hdd_tsf_capture_state {
59 TSF_IDLE = 0,
60 TSF_CAP_STATE
61};
62
63#ifdef WLAN_FEATURE_TSF
64void wlan_hdd_tsf_init(struct hdd_context_s *hdd_ctx);
65int hdd_capture_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len);
66int hdd_indicate_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len);
67#else
68static inline void wlan_hdd_tsf_init(struct hdd_context_s *hdd_ctx)
69{
70 return;
71}
72
73static inline int hdd_indicate_tsf(struct hdd_adapter_s *adapter, uint32_t *buf,
74 int len)
75{
76 return -ENOTSUPP;
77}
78
79static inline int
80hdd_capture_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len)
81{
82 return -ENOTSUPP;
83}
84#endif
85
86#endif