blob: 2a3d7da43b449579ecb02d22be8957f1874df792 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Arun Khandavallicc544b32017-01-30 19:52:16 +05302 * Copyright (c) 2013-2017 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
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 Chouhanffb21542016-02-17 14:33:03 +053041#include <qdf_list.h>
Anurag Chouhan6d760662016-02-20 16:05:43 +053042#include <qdf_types.h>
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080043#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
Jeff Johnson866aca82017-09-10 15:27:20 -070050struct hdd_adapter *hdd_wlan_create_ap_dev(struct hdd_context *pHddCtx,
Ryan Hsu07495ea2016-01-21 15:25:39 -080051 tSirMacAddr macAddr,
52 unsigned char name_assign_type,
53 uint8_t *name);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080054
Jeff Johnson866aca82017-09-10 15:27:20 -070055QDF_STATUS hdd_unregister_hostapd(struct hdd_adapter *pAdapter, bool rtnl_held);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080056
57eCsrAuthType
58hdd_translate_rsn_to_csr_auth_type(uint8_t auth_suite[4]);
59
Abhishek Singh1bdb1572015-10-16 16:24:19 +053060int hdd_softap_set_channel_change(struct net_device *dev,
Kiran Kumar Lokere13644672016-02-29 15:40:10 -080061 int target_channel,
62 enum phy_ch_width target_bw);
Abhishek Singh1bdb1572015-10-16 16:24:19 +053063
Chandrasekaran Manishekarcde33d72016-04-14 19:03:39 +053064#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
Jeff Johnson866aca82017-09-10 15:27:20 -070065void hdd_sap_restart_with_channel_switch(struct hdd_adapter *adapter,
Chandrasekaran Manishekarcde33d72016-04-14 19:03:39 +053066 uint32_t target_channel,
67 uint32_t target_bw);
Archana Ramachandranea34c4f2017-03-19 18:56:18 -070068/**
69 * sap_restart_chan_switch_cb() - Function to restart SAP with
70 * a different channel
71 * @psoc: PSOC object information
72 * @vdev_id: vdev id
73 * @channel: channel to switch
74 *
75 * This function restarts SAP with a different channel
76 *
77 * Return: None
78 *
79 */
80void sap_restart_chan_switch_cb (struct wlan_objmgr_psoc *psoc,
81 uint8_t vdev_id, uint32_t channel,
82 uint32_t channel_bw);
83/**
84 * wlan_hdd_get_channel_for_sap_restart() - Function to get
85 * suitable channel and restart SAP
86 * @psoc: PSOC object information
87 * @vdev_id: vdev id
88 * @channel: channel to be returned
89 * @sec_ch: secondary channel to be returned
Archana Ramachandranea34c4f2017-03-19 18:56:18 -070090 *
91 * This function gets the channel parameters to restart SAP
92 *
93 * Return: None
94 *
95 */
96QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
97 struct wlan_objmgr_psoc *psoc,
98 uint8_t vdev_id, uint8_t *channel,
Ajit Pal Singh9b0ebdb2017-06-08 11:26:43 +053099 uint8_t *sec_ch);
Chandrasekaran Manishekarcde33d72016-04-14 19:03:39 +0530100#endif
101
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800102eCsrEncryptionType
103hdd_translate_rsn_to_csr_encryption_type(uint8_t cipher_suite[4]);
104
105eCsrEncryptionType
106hdd_translate_rsn_to_csr_encryption_type(uint8_t cipher_suite[4]);
107
108eCsrAuthType
109hdd_translate_wpa_to_csr_auth_type(uint8_t auth_suite[4]);
110
111eCsrEncryptionType
112hdd_translate_wpa_to_csr_encryption_type(uint8_t cipher_suite[4]);
113
Jeff Johnson866aca82017-09-10 15:27:20 -0700114QDF_STATUS hdd_softap_sta_deauth(struct hdd_adapter *adapter,
Arunk Khandavalli4e7afa62017-04-01 16:02:25 +0530115 struct tagCsrDelStaParams *pDelStaParams);
Jeff Johnson866aca82017-09-10 15:27:20 -0700116void hdd_softap_sta_disassoc(struct hdd_adapter *adapter,
Arunk Khandavalli4e7afa62017-04-01 16:02:25 +0530117 struct tagCsrDelStaParams *pDelStaParams);
Jeff Johnson866aca82017-09-10 15:27:20 -0700118void hdd_softap_tkip_mic_fail_counter_measure(struct hdd_adapter *adapter,
Arunk Khandavalli4e7afa62017-04-01 16:02:25 +0530119 bool enable);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800120int hdd_softap_unpack_ie(tHalHandle halHandle,
121 eCsrEncryptionType *pEncryptType,
122 eCsrEncryptionType *mcEncryptType,
123 eCsrAuthType *pAuthType,
124 bool *pMFPCapable,
125 bool *pMFPRequired,
126 uint16_t gen_ie_len, uint8_t *gen_ie);
127
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530128QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800129 void *usrDataForCallback);
Jeff Johnson866aca82017-09-10 15:27:20 -0700130QDF_STATUS hdd_init_ap_mode(struct hdd_adapter *pAdapter, bool reinit);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800131void hdd_set_ap_ops(struct net_device *pWlanHostapdDev);
132int hdd_hostapd_stop(struct net_device *dev);
Jeff Johnsonc54bbf92017-08-28 11:59:35 -0700133int hdd_sap_context_init(struct hdd_context *hdd_ctx);
134void hdd_sap_context_destroy(struct hdd_context *hdd_ctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800135#ifdef FEATURE_WLAN_FORCE_SAP_SCC
Jeff Johnson866aca82017-09-10 15:27:20 -0700136void hdd_restart_softap(struct hdd_context *pHddCtx, struct hdd_adapter *pAdapter);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800137#endif /* FEATURE_WLAN_FORCE_SAP_SCC */
138#ifdef QCA_HT_2040_COEX
Jeff Johnson866aca82017-09-10 15:27:20 -0700139QDF_STATUS hdd_set_sap_ht2040_mode(struct hdd_adapter *pHostapdAdapter,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800140 uint8_t channel_type);
141#endif
142
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800143
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800144int wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
145 struct net_device *dev);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800146
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800147int wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
148 struct net_device *dev,
149 struct cfg80211_ap_settings *params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800150
151int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy,
152 struct net_device *dev,
153 struct cfg80211_beacon_data *params);
154
Jeff Johnson866aca82017-09-10 15:27:20 -0700155int hdd_destroy_acs_timer(struct hdd_adapter *adapter);
Kapil Guptac1224bf2017-06-22 21:22:40 +0530156
Jeff Johnson866aca82017-09-10 15:27:20 -0700157QDF_STATUS wlan_hdd_config_acs(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter);
158void hdd_sap_indicate_disconnect_for_sta(struct hdd_adapter *adapter);
159void hdd_sap_destroy_events(struct hdd_adapter *adapter);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800160#endif /* end #if !defined(WLAN_HDD_HOSTAPD_H) */