blob: 2e564630e59b9d26ab91a187da377abef7020e7e [file] [log] [blame]
Ravi Joshia063dd92016-05-25 16:43:13 -07001/*
Naveen Rawat71549742017-09-15 12:19:22 -07002 * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
Ravi Joshia063dd92016-05-25 16:43:13 -07003 *
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: wlan_hdd_nan_datapath.h
23 *
24 * WLAN Host Device Driver nan datapath API specification
25 */
Ravi Joshia063dd92016-05-25 16:43:13 -070026#ifndef __WLAN_HDD_NAN_DATAPATH_H
27#define __WLAN_HDD_NAN_DATAPATH_H
28
Jeff Johnson82797b62017-08-11 15:31:27 -070029struct hdd_context;
Deepak Dhamdhere5cdce842016-05-31 10:39:12 -070030struct hdd_tgt_cfg;
Deepak Dhamdhere13230d32016-05-26 00:46:53 -070031struct hdd_config;
Jeff Johnson85b5c112017-08-11 15:15:23 -070032struct hdd_adapter;
Deepak Dhamdhere5cdce842016-05-31 10:39:12 -070033struct wireless_dev;
34
35/* NAN Social channels */
36#define NAN_SOCIAL_CHANNEL_2_4GHZ 6
37#define NAN_SOCIAL_CHANNEL_5GHZ_LOWER_BAND 44
38#define NAN_SOCIAL_CHANNEL_5GHZ_UPPER_BAND 149
39
Deepak Dhamdhere5872c8c2016-06-02 15:51:47 -070040#define NDP_BROADCAST_STAID (0)
41
Deepak Dhamdheref16015f2016-06-01 14:28:09 -070042#ifdef WLAN_FEATURE_NAN_DATAPATH
43#define WLAN_HDD_IS_NDI(adapter) ((adapter)->device_mode == QDF_NDI_MODE)
44
45#define WLAN_HDD_IS_NDI_CONNECTED(adapter) ( \
46 eConnectionState_NdiConnected ==\
Jeff Johnsonb9424862017-10-30 08:49:35 -070047 (adapter)->session.station.conn_info.connState)
Deepak Dhamdheref16015f2016-06-01 14:28:09 -070048#else
49#define WLAN_HDD_IS_NDI(adapter) (false)
50#define WLAN_HDD_IS_NDI_CONNECTED(adapter) (false)
51#endif /* WLAN_FEATURE_NAN_DATAPATH */
52
Deepak Dhamdhere3385d752016-05-25 20:36:47 -070053#ifdef WLAN_FEATURE_NAN_DATAPATH
Jeff Johnson82797b62017-08-11 15:31:27 -070054void hdd_ndp_print_ini_config(struct hdd_context *hdd_ctx);
55void hdd_nan_datapath_target_config(struct hdd_context *hdd_ctx,
Deepak Dhamdhere13230d32016-05-26 00:46:53 -070056 struct wma_tgt_cfg *cfg);
Jeff Johnson85b5c112017-08-11 15:15:23 -070057void hdd_ndp_event_handler(struct hdd_adapter *adapter,
Jeff Johnson172237b2017-11-07 15:32:59 -080058 struct csr_roam_info *roam_info,
59 uint32_t roam_id, eRoamCmdStatus roam_status,
60 eCsrRoamResult roam_result);
Deepak Dhamdhere5cdce842016-05-31 10:39:12 -070061int wlan_hdd_cfg80211_process_ndp_cmd(struct wiphy *wiphy,
62 struct wireless_dev *wdev, const void *data, int data_len);
Jeff Johnson85b5c112017-08-11 15:15:23 -070063int hdd_init_nan_data_mode(struct hdd_adapter *adapter);
Jeff Johnson8cb9df12017-08-29 14:28:45 -070064void hdd_ndp_session_end_handler(struct hdd_adapter *adapter);
Deepak Dhamdhere3385d752016-05-25 20:36:47 -070065#else
Jeff Johnson82797b62017-08-11 15:31:27 -070066static inline void hdd_ndp_print_ini_config(struct hdd_context *hdd_ctx)
Deepak Dhamdhere3385d752016-05-25 20:36:47 -070067{
68}
Jeff Johnson82797b62017-08-11 15:31:27 -070069static inline void hdd_nan_datapath_target_config(struct hdd_context *hdd_ctx,
Deepak Dhamdhere13230d32016-05-26 00:46:53 -070070 struct wma_tgt_cfg *cfg)
71{
72}
Jeff Johnson85b5c112017-08-11 15:15:23 -070073static inline void hdd_ndp_event_handler(struct hdd_adapter *adapter,
Jeff Johnson172237b2017-11-07 15:32:59 -080074 struct csr_roam_info *roam_info,
75 uint32_t roam_id,
76 eRoamCmdStatus roam_status,
77 eCsrRoamResult roam_result)
Deepak Dhamdhere5cdce842016-05-31 10:39:12 -070078{
79}
80static inline int wlan_hdd_cfg80211_process_ndp_cmd(struct wiphy *wiphy,
81 struct wireless_dev *wdev, const void *data, int data_len)
82{
83 return 0;
84}
Jeff Johnson85b5c112017-08-11 15:15:23 -070085static inline int hdd_init_nan_data_mode(struct hdd_adapter *adapter)
Deepak Dhamdhere5cdce842016-05-31 10:39:12 -070086{
87 return 0;
88}
Jeff Johnson8cb9df12017-08-29 14:28:45 -070089static inline void hdd_ndp_session_end_handler(struct hdd_adapter *adapter)
Deepak Dhamdhere13983f22016-05-31 19:06:09 -070090{
91}
Deepak Dhamdhere3385d752016-05-25 20:36:47 -070092#endif /* WLAN_FEATURE_NAN_DATAPATH */
93
Naveen Rawatcb5c5402017-03-22 10:12:19 -070094enum nan_datapath_state;
95struct nan_datapath_inf_create_rsp;
96
97struct wlan_objmgr_vdev *hdd_ndi_open(char *iface_name);
98int hdd_ndi_start(uint8_t vdev_id);
99int hdd_ndi_delete(uint8_t vdev_id, char *iface_name, uint16_t transaction_id);
100void hdd_ndi_close(uint8_t vdev_id);
101void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id,
102 struct nan_datapath_inf_create_rsp *ndi_rsp);
103void hdd_ndi_drv_ndi_delete_rsp_handler(uint8_t vdev_id);
Naveen Rawat37f62c82017-03-26 22:24:43 -0700104int hdd_ndp_get_peer_idx(uint8_t vdev_id, struct qdf_mac_addr *addr);
105int hdd_ndp_new_peer_handler(uint8_t vdev_id, uint16_t sta_id,
106 struct qdf_mac_addr *peer_mac_addr, bool fist_peer);
Naveen Rawatb3143ea2017-03-26 22:25:46 -0700107void hdd_ndp_peer_departed_handler(uint8_t vdev_id, uint16_t sta_id,
108 struct qdf_mac_addr *peer_mac_addr, bool last_peer);
Naveen Rawatcb5c5402017-03-22 10:12:19 -0700109
Ravi Joshia063dd92016-05-25 16:43:13 -0700110#endif /* __WLAN_HDD_NAN_DATAPATH_H */