blob: 61f3f5116a6e55a0acc0ae0364a17ca5262ea4c5 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Prashanth Bhatta75fa9a12016-01-11 18:30:08 -08002 * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
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
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080028/**
29 * DOC: wlan_hdd_oemdata.h
30 *
31 * Internal includes for the oem data
32 */
33
34#ifndef __WLAN_HDD_OEM_DATA_H__
35#define __WLAN_HDD_OEM_DATA_H__
36
Prashanth Bhatta75fa9a12016-01-11 18:30:08 -080037#ifdef FEATURE_OEM_DATA_SUPPORT
38
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080039#ifndef OEM_DATA_REQ_SIZE
Krishna Kumaar Natarajanee4dbed2016-03-30 16:21:23 -070040#define OEM_DATA_REQ_SIZE 500
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080041#endif
42
43#ifndef OEM_DATA_RSP_SIZE
44#define OEM_DATA_RSP_SIZE 1724
45#endif
46
47#define OEM_APP_SIGNATURE_LEN 16
48#define OEM_APP_SIGNATURE_STR "QUALCOMM-OEM-APP"
49
50#define OEM_TARGET_SIGNATURE_LEN 8
51#define OEM_TARGET_SIGNATURE "QUALCOMM"
52
53#define OEM_CAP_MAX_NUM_CHANNELS 128
54
55/**
56 * typedef eOemErrorCode - OEM error codes
57 * @OEM_ERR_NULL_CONTEXT: %NULL context
58 * @OEM_ERR_APP_NOT_REGISTERED: OEM App is not registered
59 * @OEM_ERR_INVALID_SIGNATURE: Invalid signature
60 * @OEM_ERR_NULL_MESSAGE_HEADER: Invalid message header
61 * @OEM_ERR_INVALID_MESSAGE_TYPE: Invalid message type
62 * @OEM_ERR_INVALID_MESSAGE_LENGTH: Invalid length in message body
63 */
64typedef enum {
65 OEM_ERR_NULL_CONTEXT = 1,
66 OEM_ERR_APP_NOT_REGISTERED,
67 OEM_ERR_INVALID_SIGNATURE,
68 OEM_ERR_NULL_MESSAGE_HEADER,
69 OEM_ERR_INVALID_MESSAGE_TYPE,
70 OEM_ERR_INVALID_MESSAGE_LENGTH
71} eOemErrorCode;
72
73/**
74 * typedef tDriverVersion - Driver version identifier (w.x.y.z)
75 * @major: Version ID major number
76 * @minor: Version ID minor number
77 * @patch: Version ID patch number
78 * @build: Version ID build number
79 */
Anurag Chouhan6d760662016-02-20 16:05:43 +053080typedef struct qdf_packed {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080081 uint8_t major;
82 uint8_t minor;
83 uint8_t patch;
84 uint8_t build;
85} tDriverVersion;
86
87/**
88 * typedef t_iw_oem_data_cap - OEM Data Capabilities
89 * @oem_target_signature: Signature of chipset vendor, e.g. QUALCOMM
90 * @oem_target_type: Chip type
91 * @oem_fw_version: Firmware version
92 * @driver_version: Host software version
93 * @allowed_dwell_time_min: Channel dwell time - allowed minimum
94 * @allowed_dwell_time_max: Channel dwell time - allowed maximum
95 * @curr_dwell_time_min: Channel dwell time - current minimim
96 * @curr_dwell_time_max: Channel dwell time - current maximum
97 * @supported_bands: Supported bands, 2.4G or 5G Hz
98 * @num_channels: Num of channels IDs to follow
99 * @channel_list: List of channel IDs
100 */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530101typedef struct qdf_packed {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800102 uint8_t oem_target_signature[OEM_TARGET_SIGNATURE_LEN];
103 uint32_t oem_target_type;
104 uint32_t oem_fw_version;
105 tDriverVersion driver_version;
106 uint16_t allowed_dwell_time_min;
107 uint16_t allowed_dwell_time_max;
108 uint16_t curr_dwell_time_min;
109 uint16_t curr_dwell_time_max;
110 uint16_t supported_bands;
111 uint16_t num_channels;
112 uint8_t channel_list[OEM_CAP_MAX_NUM_CHANNELS];
113} t_iw_oem_data_cap;
114
115/**
116 * typedef tHddChannelInfo - Channel information
117 * @chan_id: channel id
118 * @reserved0: reserved for padding and future use
119 * @mhz: primary 20 MHz channel frequency in mhz
120 * @band_center_freq1: Center frequency 1 in MHz
121 * @band_center_freq2: Center frequency 2 in MHz, valid only for 11ac
122 * VHT 80+80 mode
123 * @info: channel info
124 * @reg_info_1: regulatory information field 1 which contains min power,
125 * max power, reg power and reg class id
126 * @reg_info_2: regulatory information field 2 which contains antennamax
127 */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530128typedef struct qdf_packed {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800129 uint32_t chan_id;
130 uint32_t reserved0;
131 uint32_t mhz;
132 uint32_t band_center_freq1;
133 uint32_t band_center_freq2;
134 uint32_t info;
135 uint32_t reg_info_1;
136 uint32_t reg_info_2;
137} tHddChannelInfo;
138
139/**
140 * typedef tPeerStatusInfo - Status information for a given peer
141 * @peer_mac_addr: peer mac address
142 * @peer_status: peer status: 1: CONNECTED, 2: DISCONNECTED
143 * @vdev_id: vdev_id for the peer mac
144 * @peer_capability: peer capability: 0: RTT/RTT2, 1: RTT3. Default is 0
145 * @reserved0: reserved0
146 * @peer_chan_info: channel info on which peer is connected
147 */
Anurag Chouhan6d760662016-02-20 16:05:43 +0530148typedef struct qdf_packed {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800149 uint8_t peer_mac_addr[ETH_ALEN];
150 uint8_t peer_status;
151 uint8_t vdev_id;
152 uint32_t peer_capability;
153 uint32_t reserved0;
154 tHddChannelInfo peer_chan_info;
155} tPeerStatusInfo;
156
Krishna Kumaar Natarajan53ca2902015-12-04 14:01:46 -0800157/**
158 * enum oem_capability_mask - mask field for userspace client capabilities
159 * @OEM_CAP_RM_FTMRR: FTM range report mask bit
160 * @OEM_CAP_RM_LCI: LCI capability mask bit
161 */
162enum oem_capability_mask {
163 OEM_CAP_RM_FTMRR = (1 << (0)),
164 OEM_CAP_RM_LCI = (1 << (1)),
165};
166
167/**
168 * struct oem_get_capability_rsp - capabilites set by userspace and target.
169 * @target_cap: target capabilities
170 * @client_capabilities: capabilities set by userspace via set request
171 */
172struct oem_get_capability_rsp {
173 t_iw_oem_data_cap target_cap;
174 struct sme_oem_capability cap;
175};
176
Anurag Chouhan6d760662016-02-20 16:05:43 +0530177void hdd_send_peer_status_ind_to_oem_app(struct qdf_mac_addr *peerMac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800178 uint8_t peerStatus,
179 uint8_t peerTimingMeasCap,
180 uint8_t sessionId,
181 tSirSmeChanInfo *chan_info);
182
183int iw_get_oem_data_cap(struct net_device *dev, struct iw_request_info *info,
184 union iwreq_data *wrqu, char *extra);
185
186int oem_activate_service(struct hdd_context_s *hdd_ctx);
187
188void hdd_send_oem_data_rsp_msg(int length, uint8_t *oemDataRsp);
Prashanth Bhatta75fa9a12016-01-11 18:30:08 -0800189#else
190static inline int oem_activate_service(struct hdd_context_s *hdd_ctx)
191{
192 return 0;
193}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800194#endif /* FEATURE_OEM_DATA_SUPPORT */
Prashanth Bhatta75fa9a12016-01-11 18:30:08 -0800195#endif /* __WLAN_HDD_OEM_DATA_H__ */