Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Arun Khandavalli | cc544b3 | 2017-01-30 19:52:16 +0530 | [diff] [blame] | 2 | * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 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_HOSTAPD_H) |
| 29 | #define WLAN_HDD_HOSTAPD_H |
| 30 | |
| 31 | /** |
| 32 | * DOC: wlan_hdd_hostapd.h |
| 33 | * |
| 34 | * WLAN Host Device driver hostapd header file |
| 35 | */ |
| 36 | |
| 37 | /* Include files */ |
| 38 | |
| 39 | #include <linux/netdevice.h> |
| 40 | #include <linux/skbuff.h> |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 41 | #include <qdf_list.h> |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 42 | #include <qdf_types.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 43 | #include <wlan_hdd_main.h> |
| 44 | |
| 45 | /* Preprocessor definitions and constants */ |
| 46 | |
| 47 | /* max length of command string in hostapd ioctl */ |
| 48 | #define HOSTAPD_IOCTL_COMMAND_STRLEN_MAX 8192 |
| 49 | |
| 50 | hdd_adapter_t *hdd_wlan_create_ap_dev(hdd_context_t *pHddCtx, |
Ryan Hsu | 07495ea | 2016-01-21 15:25:39 -0800 | [diff] [blame] | 51 | tSirMacAddr macAddr, |
| 52 | unsigned char name_assign_type, |
| 53 | uint8_t *name); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 54 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 55 | QDF_STATUS hdd_register_hostapd(hdd_adapter_t *pAdapter, uint8_t rtnl_held); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 56 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 57 | QDF_STATUS hdd_unregister_hostapd(hdd_adapter_t *pAdapter, bool rtnl_held); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 58 | |
| 59 | eCsrAuthType |
| 60 | hdd_translate_rsn_to_csr_auth_type(uint8_t auth_suite[4]); |
| 61 | |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 62 | int hdd_softap_set_channel_change(struct net_device *dev, |
Kiran Kumar Lokere | 1364467 | 2016-02-29 15:40:10 -0800 | [diff] [blame] | 63 | int target_channel, |
| 64 | enum phy_ch_width target_bw); |
Abhishek Singh | 1bdb157 | 2015-10-16 16:24:19 +0530 | [diff] [blame] | 65 | |
Chandrasekaran Manishekar | cde33d7 | 2016-04-14 19:03:39 +0530 | [diff] [blame] | 66 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
| 67 | void hdd_sap_restart_with_channel_switch(hdd_adapter_t *adapter, |
| 68 | uint32_t target_channel, |
| 69 | uint32_t target_bw); |
Archana Ramachandran | ea34c4f | 2017-03-19 18:56:18 -0700 | [diff] [blame^] | 70 | /** |
| 71 | * sap_restart_chan_switch_cb() - Function to restart SAP with |
| 72 | * a different channel |
| 73 | * @psoc: PSOC object information |
| 74 | * @vdev_id: vdev id |
| 75 | * @channel: channel to switch |
| 76 | * |
| 77 | * This function restarts SAP with a different channel |
| 78 | * |
| 79 | * Return: None |
| 80 | * |
| 81 | */ |
| 82 | void sap_restart_chan_switch_cb (struct wlan_objmgr_psoc *psoc, |
| 83 | uint8_t vdev_id, uint32_t channel, |
| 84 | uint32_t channel_bw); |
| 85 | /** |
| 86 | * wlan_hdd_get_channel_for_sap_restart() - Function to get |
| 87 | * suitable channel and restart SAP |
| 88 | * @psoc: PSOC object information |
| 89 | * @vdev_id: vdev id |
| 90 | * @channel: channel to be returned |
| 91 | * @sec_ch: secondary channel to be returned |
| 92 | * @restart_sap: restsart SAP as a part of channel switch |
| 93 | * |
| 94 | * This function gets the channel parameters to restart SAP |
| 95 | * |
| 96 | * Return: None |
| 97 | * |
| 98 | */ |
| 99 | QDF_STATUS wlan_hdd_get_channel_for_sap_restart( |
| 100 | struct wlan_objmgr_psoc *psoc, |
| 101 | uint8_t vdev_id, uint8_t *channel, |
| 102 | uint8_t *sec_ch, bool restart_sap); |
Chandrasekaran Manishekar | cde33d7 | 2016-04-14 19:03:39 +0530 | [diff] [blame] | 103 | #endif |
| 104 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 105 | eCsrEncryptionType |
| 106 | hdd_translate_rsn_to_csr_encryption_type(uint8_t cipher_suite[4]); |
| 107 | |
| 108 | eCsrEncryptionType |
| 109 | hdd_translate_rsn_to_csr_encryption_type(uint8_t cipher_suite[4]); |
| 110 | |
| 111 | eCsrAuthType |
| 112 | hdd_translate_wpa_to_csr_auth_type(uint8_t auth_suite[4]); |
| 113 | |
| 114 | eCsrEncryptionType |
| 115 | hdd_translate_wpa_to_csr_encryption_type(uint8_t cipher_suite[4]); |
| 116 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 117 | QDF_STATUS hdd_softap_sta_deauth(hdd_adapter_t *, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 118 | struct tagCsrDelStaParams *); |
Deepthi Gowri | b3bfefd | 2016-09-13 15:14:34 +0530 | [diff] [blame] | 119 | void hdd_softap_sta_disassoc(hdd_adapter_t *, struct tagCsrDelStaParams *); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 120 | void hdd_softap_tkip_mic_fail_counter_measure(hdd_adapter_t *, bool); |
| 121 | int hdd_softap_unpack_ie(tHalHandle halHandle, |
| 122 | eCsrEncryptionType *pEncryptType, |
| 123 | eCsrEncryptionType *mcEncryptType, |
| 124 | eCsrAuthType *pAuthType, |
| 125 | bool *pMFPCapable, |
| 126 | bool *pMFPRequired, |
| 127 | uint16_t gen_ie_len, uint8_t *gen_ie); |
| 128 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 129 | QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 130 | void *usrDataForCallback); |
Arun Khandavalli | cc544b3 | 2017-01-30 19:52:16 +0530 | [diff] [blame] | 131 | QDF_STATUS hdd_init_ap_mode(hdd_adapter_t *pAdapter, bool reinit); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 132 | void hdd_set_ap_ops(struct net_device *pWlanHostapdDev); |
| 133 | int hdd_hostapd_stop(struct net_device *dev); |
Prashanth Bhatta | 527fd75 | 2016-04-28 12:35:23 -0700 | [diff] [blame] | 134 | int hdd_sap_context_init(hdd_context_t *hdd_ctx); |
| 135 | void hdd_sap_context_destroy(hdd_context_t *hdd_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 136 | #ifdef FEATURE_WLAN_FORCE_SAP_SCC |
| 137 | void hdd_restart_softap(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter); |
| 138 | #endif /* FEATURE_WLAN_FORCE_SAP_SCC */ |
| 139 | #ifdef QCA_HT_2040_COEX |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 140 | QDF_STATUS hdd_set_sap_ht2040_mode(hdd_adapter_t *pHostapdAdapter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 141 | uint8_t channel_type); |
| 142 | #endif |
| 143 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 144 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 145 | int wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, |
| 146 | struct net_device *dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 147 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 148 | int wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, |
| 149 | struct net_device *dev, |
| 150 | struct cfg80211_ap_settings *params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 151 | |
| 152 | int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy, |
| 153 | struct net_device *dev, |
| 154 | struct cfg80211_beacon_data *params); |
| 155 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 156 | QDF_STATUS wlan_hdd_config_acs(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter); |
Arun Khandavalli | cc544b3 | 2017-01-30 19:52:16 +0530 | [diff] [blame] | 157 | void hdd_sap_indicate_disconnect_for_sta(hdd_adapter_t *adapter); |
| 158 | void hdd_sap_destroy_events(hdd_adapter_t *adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 159 | #endif /* end #if !defined(WLAN_HDD_HOSTAPD_H) */ |