blob: 1c9aec962119890a36a3c568074af06f859b1323 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Agrawal Ashish6773c902017-01-06 19:45:03 +05302 * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
Kiet Lam842dad02014-02-18 18:44:02 -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.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -080020 */
Kiet Lam842dad02014-02-18 18:44:02 -080021
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
Jeff Johnson295189b2012-06-20 16:38:30 -070028#if !defined( WLAN_HDD_HOSTAPD_H )
29#define WLAN_HDD_HOSTAPD_H
30
31/**===========================================================================
Jeff Johnson7dda7772013-02-27 08:36:13 -080032
Jeff Johnson295189b2012-06-20 16:38:30 -070033 \file WLAN_HDD_HOSTAPD_H.h
Jeff Johnson7dda7772013-02-27 08:36:13 -080034
Jeff Johnson295189b2012-06-20 16:38:30 -070035 \brief Linux HDD HOSTAPD include file
Jeff Johnson295189b2012-06-20 16:38:30 -070036 ==========================================================================*/
Jeff Johnson7dda7772013-02-27 08:36:13 -080037
38/*---------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070039 Include files
Jeff Johnson7dda7772013-02-27 08:36:13 -080040 -------------------------------------------------------------------------*/
41
Jeff Johnson295189b2012-06-20 16:38:30 -070042#include <linux/netdevice.h>
43#include <linux/skbuff.h>
44#include <vos_list.h>
45#include <vos_types.h>
46
47#include <wlan_qct_tl.h>
48#include <wlan_hdd_main.h>
49
Jeff Johnson7dda7772013-02-27 08:36:13 -080050/*---------------------------------------------------------------------------
Jeff Johnson295189b2012-06-20 16:38:30 -070051 Preprocessor definitions and constants
Jeff Johnson7dda7772013-02-27 08:36:13 -080052 -------------------------------------------------------------------------*/
Jeff Johnson295189b2012-06-20 16:38:30 -070053
Rajesh Chauhana0516c62014-01-30 16:11:18 -080054/* max length of command string in hostapd ioctl */
Atul Mittal1d722422014-03-19 11:15:07 +053055#define HOSTAPD_IOCTL_COMMAND_STRLEN_MAX 8192
Rajesh Chauhana0516c62014-01-30 16:11:18 -080056
Jeff Johnson295189b2012-06-20 16:38:30 -070057hdd_adapter_t* hdd_wlan_create_ap_dev( hdd_context_t *pHddCtx, tSirMacAddr macAddr, tANI_U8 *name);
58
59VOS_STATUS hdd_register_hostapd(hdd_adapter_t *pAdapter, tANI_U8 rtnl_held);
60
c_hpothu002231a2015-02-05 14:58:51 +053061VOS_STATUS hdd_unregister_hostapd(hdd_adapter_t *pAdapter, tANI_U8 rtnl_held);
Jeff Johnson295189b2012-06-20 16:38:30 -070062
63eCsrAuthType
64hdd_TranslateRSNToCsrAuthType( u_int8_t auth_suite[4]);
65
66eCsrEncryptionType
67hdd_TranslateRSNToCsrEncryptionType(u_int8_t cipher_suite[4]);
68
69eCsrEncryptionType
70hdd_TranslateRSNToCsrEncryptionType(u_int8_t cipher_suite[4]);
71
72eCsrAuthType
73hdd_TranslateWPAToCsrAuthType(u_int8_t auth_suite[4]);
74
75eCsrEncryptionType
76hdd_TranslateWPAToCsrEncryptionType(u_int8_t cipher_suite[4]);
77
Hanumantha Reddy Pothulabfd06f72014-10-31 14:03:37 +053078VOS_STATUS hdd_softap_sta_deauth(hdd_adapter_t*, struct tagCsrDelStaParams*);
Jeff Johnson295189b2012-06-20 16:38:30 -070079void hdd_softap_sta_disassoc(hdd_adapter_t*,v_U8_t*);
80void hdd_softap_tkip_mic_fail_counter_measure(hdd_adapter_t*,v_BOOL_t);
81int hdd_softap_unpackIE( tHalHandle halHandle,
Chet Lanctot8cecea22014-02-11 19:09:36 -080082 eCsrEncryptionType *pEncryptType,
83 eCsrEncryptionType *mcEncryptType,
84 eCsrAuthType *pAuthType,
85 v_BOOL_t *pMFPCapable,
86 v_BOOL_t *pMFPRequired,
87 u_int16_t gen_ie_len,
Jeff Johnson295189b2012-06-20 16:38:30 -070088 u_int8_t *gen_ie );
89
Kapil Gupta137ef892016-12-13 19:38:00 +053090/**
91 * hdd_change_ch_avoidance_status() - update is_ch_avoid_in_progress flag
92 *
93 * @hdd_ctx: pointer to hdd context
94 * @value: value to set
95 *
96 * This function will change the value of is_ch_avoid_in_progress
97 *
98 * Return: none
99 */
100static inline void
101hdd_change_ch_avoidance_status(hdd_context_t *hdd_ctx,
102 bool value)
103{
104 vos_spin_lock_acquire(&hdd_ctx->sap_update_info_lock);
105 hdd_ctx->is_ch_avoid_in_progress = value;
106 vos_spin_lock_release(&hdd_ctx->sap_update_info_lock);
107}
108
109
Jeff Johnson295189b2012-06-20 16:38:30 -0700110VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCallback);
Hanumanth Reddy Pothula15bc0fa2017-02-03 17:24:17 +0530111VOS_STATUS hdd_init_ap_mode(hdd_adapter_t *pAdapter, bool re_init);
Jeff Johnson295189b2012-06-20 16:38:30 -0700112void hdd_set_ap_ops( struct net_device *pWlanHostapdDev );
Arun Kumar Khandavallia3bd8002014-01-17 16:21:19 +0530113int hdd_hostapd_stop (struct net_device *dev);
Sushant Kaushikba6764e2014-06-30 19:52:09 +0530114void hdd_restart_softap (hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter);
Leo Chang0b0e45a2013-12-15 15:18:55 -0800115#ifdef FEATURE_WLAN_CH_AVOID
116void hdd_hostapd_ch_avoid_cb(void *pAdapter, void *indParam);
117#endif /* FEATURE_WLAN_CH_AVOID */
Rashmi Ramanna1f0948d2014-08-28 15:33:48 +0530118int hdd_del_all_sta(hdd_adapter_t *pAdapter);
Hanumanth Reddy Pothulad864f312017-01-18 16:16:08 +0530119void hdd_sap_indicate_disconnect_for_sta(hdd_adapter_t *adapter);
Hanumanth Reddy Pothula15bc0fa2017-02-03 17:24:17 +0530120void hdd_sap_destroy_timers(hdd_adapter_t *adapter);
Hanumanth Reddy Pothulad864f312017-01-18 16:16:08 +0530121
Agrawal Ashish17ef5082016-10-17 18:33:21 +0530122#ifdef SAP_AUTH_OFFLOAD
Agrawal Ashish6773c902017-01-06 19:45:03 +0530123bool hdd_set_sap_auth_offload(hdd_adapter_t *pHostapdAdapter,
Agrawal Ashish17ef5082016-10-17 18:33:21 +0530124 bool enabled);
125#else
Agrawal Ashish6773c902017-01-06 19:45:03 +0530126static inline bool
Agrawal Ashish17ef5082016-10-17 18:33:21 +0530127hdd_set_sap_auth_offload(hdd_adapter_t *pHostapdAdapter, bool enabled)
128{
129}
130#endif
Ashish Kumar Dhanotiya42aa5152017-01-03 20:25:57 +0530131
132/**
133 * hdd_check_for_unsafe_ch() - Check the current operating channel with
134 * unsafe channel list.
135 * @phostapd_adapter : Pointer to HDD adapter.
136 * @hdd_ctx: pointer to hdd context.
137 *
138 * Check the current operating chennel of SAP with unsafe channel list
139 * and Restart the SAP on safe channel if currently SAP is
140 * on unsafe channel.
141 *
142 * Return : None
143 */
144void hdd_check_for_unsafe_ch(hdd_adapter_t *phostapd_adapter,
145 hdd_context_t *hdd_ctx);
Agrawal Ashish574b3e62017-02-09 18:58:34 +0530146void hdd_force_scc_restart_sap(hdd_adapter_t *adapter,
147 hdd_context_t *hdd_ctx, tANI_U8 channelId);
Ashish Kumar Dhanotiya42aa5152017-01-03 20:25:57 +0530148
Jeff Johnson295189b2012-06-20 16:38:30 -0700149#endif // end #if !defined( WLAN_HDD_HOSTAPD_H )