Ravi Joshi | a063dd9 | 2016-05-25 16:43:13 -0700 | [diff] [blame] | 1 | /* |
Naveen Rawat | 7154974 | 2017-09-15 12:19:22 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. |
Ravi Joshi | a063dd9 | 2016-05-25 16:43:13 -0700 | [diff] [blame] | 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: wlan_hdd_nan_datapath.h |
| 23 | * |
| 24 | * WLAN Host Device Driver nan datapath API specification |
| 25 | */ |
Ravi Joshi | a063dd9 | 2016-05-25 16:43:13 -0700 | [diff] [blame] | 26 | #ifndef __WLAN_HDD_NAN_DATAPATH_H |
| 27 | #define __WLAN_HDD_NAN_DATAPATH_H |
| 28 | |
Jeff Johnson | 82797b6 | 2017-08-11 15:31:27 -0700 | [diff] [blame] | 29 | struct hdd_context; |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 30 | struct hdd_tgt_cfg; |
Deepak Dhamdhere | 13230d3 | 2016-05-26 00:46:53 -0700 | [diff] [blame] | 31 | struct hdd_config; |
Jeff Johnson | 85b5c11 | 2017-08-11 15:15:23 -0700 | [diff] [blame] | 32 | struct hdd_adapter; |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 33 | struct 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 Dhamdhere | 5872c8c | 2016-06-02 15:51:47 -0700 | [diff] [blame] | 40 | #define NDP_BROADCAST_STAID (0) |
| 41 | |
Deepak Dhamdhere | f16015f | 2016-06-01 14:28:09 -0700 | [diff] [blame] | 42 | #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 Johnson | b942486 | 2017-10-30 08:49:35 -0700 | [diff] [blame] | 47 | (adapter)->session.station.conn_info.connState) |
Deepak Dhamdhere | f16015f | 2016-06-01 14:28:09 -0700 | [diff] [blame] | 48 | #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 Dhamdhere | 3385d75 | 2016-05-25 20:36:47 -0700 | [diff] [blame] | 53 | #ifdef WLAN_FEATURE_NAN_DATAPATH |
Jeff Johnson | 82797b6 | 2017-08-11 15:31:27 -0700 | [diff] [blame] | 54 | void hdd_ndp_print_ini_config(struct hdd_context *hdd_ctx); |
| 55 | void hdd_nan_datapath_target_config(struct hdd_context *hdd_ctx, |
Deepak Dhamdhere | 13230d3 | 2016-05-26 00:46:53 -0700 | [diff] [blame] | 56 | struct wma_tgt_cfg *cfg); |
Jeff Johnson | 85b5c11 | 2017-08-11 15:15:23 -0700 | [diff] [blame] | 57 | void hdd_ndp_event_handler(struct hdd_adapter *adapter, |
Jeff Johnson | 172237b | 2017-11-07 15:32:59 -0800 | [diff] [blame] | 58 | struct csr_roam_info *roam_info, |
| 59 | uint32_t roam_id, eRoamCmdStatus roam_status, |
| 60 | eCsrRoamResult roam_result); |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 61 | int wlan_hdd_cfg80211_process_ndp_cmd(struct wiphy *wiphy, |
| 62 | struct wireless_dev *wdev, const void *data, int data_len); |
Jeff Johnson | 85b5c11 | 2017-08-11 15:15:23 -0700 | [diff] [blame] | 63 | int hdd_init_nan_data_mode(struct hdd_adapter *adapter); |
Jeff Johnson | 8cb9df1 | 2017-08-29 14:28:45 -0700 | [diff] [blame] | 64 | void hdd_ndp_session_end_handler(struct hdd_adapter *adapter); |
Deepak Dhamdhere | 3385d75 | 2016-05-25 20:36:47 -0700 | [diff] [blame] | 65 | #else |
Jeff Johnson | 82797b6 | 2017-08-11 15:31:27 -0700 | [diff] [blame] | 66 | static inline void hdd_ndp_print_ini_config(struct hdd_context *hdd_ctx) |
Deepak Dhamdhere | 3385d75 | 2016-05-25 20:36:47 -0700 | [diff] [blame] | 67 | { |
| 68 | } |
Jeff Johnson | 82797b6 | 2017-08-11 15:31:27 -0700 | [diff] [blame] | 69 | static inline void hdd_nan_datapath_target_config(struct hdd_context *hdd_ctx, |
Deepak Dhamdhere | 13230d3 | 2016-05-26 00:46:53 -0700 | [diff] [blame] | 70 | struct wma_tgt_cfg *cfg) |
| 71 | { |
| 72 | } |
Jeff Johnson | 85b5c11 | 2017-08-11 15:15:23 -0700 | [diff] [blame] | 73 | static inline void hdd_ndp_event_handler(struct hdd_adapter *adapter, |
Jeff Johnson | 172237b | 2017-11-07 15:32:59 -0800 | [diff] [blame] | 74 | struct csr_roam_info *roam_info, |
| 75 | uint32_t roam_id, |
| 76 | eRoamCmdStatus roam_status, |
| 77 | eCsrRoamResult roam_result) |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 78 | { |
| 79 | } |
| 80 | static 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 Johnson | 85b5c11 | 2017-08-11 15:15:23 -0700 | [diff] [blame] | 85 | static inline int hdd_init_nan_data_mode(struct hdd_adapter *adapter) |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 86 | { |
| 87 | return 0; |
| 88 | } |
Jeff Johnson | 8cb9df1 | 2017-08-29 14:28:45 -0700 | [diff] [blame] | 89 | static inline void hdd_ndp_session_end_handler(struct hdd_adapter *adapter) |
Deepak Dhamdhere | 13983f2 | 2016-05-31 19:06:09 -0700 | [diff] [blame] | 90 | { |
| 91 | } |
Deepak Dhamdhere | 3385d75 | 2016-05-25 20:36:47 -0700 | [diff] [blame] | 92 | #endif /* WLAN_FEATURE_NAN_DATAPATH */ |
| 93 | |
Naveen Rawat | cb5c540 | 2017-03-22 10:12:19 -0700 | [diff] [blame] | 94 | enum nan_datapath_state; |
| 95 | struct nan_datapath_inf_create_rsp; |
| 96 | |
| 97 | struct wlan_objmgr_vdev *hdd_ndi_open(char *iface_name); |
| 98 | int hdd_ndi_start(uint8_t vdev_id); |
| 99 | int hdd_ndi_delete(uint8_t vdev_id, char *iface_name, uint16_t transaction_id); |
| 100 | void hdd_ndi_close(uint8_t vdev_id); |
| 101 | void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id, |
| 102 | struct nan_datapath_inf_create_rsp *ndi_rsp); |
| 103 | void hdd_ndi_drv_ndi_delete_rsp_handler(uint8_t vdev_id); |
Naveen Rawat | 37f62c8 | 2017-03-26 22:24:43 -0700 | [diff] [blame] | 104 | int hdd_ndp_get_peer_idx(uint8_t vdev_id, struct qdf_mac_addr *addr); |
| 105 | int 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 Rawat | b3143ea | 2017-03-26 22:25:46 -0700 | [diff] [blame] | 107 | void 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 Rawat | cb5c540 | 2017-03-22 10:12:19 -0700 | [diff] [blame] | 109 | |
Ravi Joshi | a063dd9 | 2016-05-25 16:43:13 -0700 | [diff] [blame] | 110 | #endif /* __WLAN_HDD_NAN_DATAPATH_H */ |