Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Agrawal Ashish | 6773c90 | 2017-01-06 19:45:03 +0530 | [diff] [blame] | 2 | * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -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. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 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 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 28 | #if !defined( WLAN_HDD_HOSTAPD_H ) |
| 29 | #define WLAN_HDD_HOSTAPD_H |
| 30 | |
| 31 | /**=========================================================================== |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 32 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 33 | \file WLAN_HDD_HOSTAPD_H.h |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 34 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 35 | \brief Linux HDD HOSTAPD include file |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 36 | ==========================================================================*/ |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 37 | |
| 38 | /*--------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 39 | Include files |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 40 | -------------------------------------------------------------------------*/ |
| 41 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 42 | #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 Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 50 | /*--------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 51 | Preprocessor definitions and constants |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 52 | -------------------------------------------------------------------------*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 53 | |
Rajesh Chauhan | a0516c6 | 2014-01-30 16:11:18 -0800 | [diff] [blame] | 54 | /* max length of command string in hostapd ioctl */ |
Atul Mittal | 1d72242 | 2014-03-19 11:15:07 +0530 | [diff] [blame] | 55 | #define HOSTAPD_IOCTL_COMMAND_STRLEN_MAX 8192 |
Rajesh Chauhan | a0516c6 | 2014-01-30 16:11:18 -0800 | [diff] [blame] | 56 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 57 | hdd_adapter_t* hdd_wlan_create_ap_dev( hdd_context_t *pHddCtx, tSirMacAddr macAddr, tANI_U8 *name); |
| 58 | |
| 59 | VOS_STATUS hdd_register_hostapd(hdd_adapter_t *pAdapter, tANI_U8 rtnl_held); |
| 60 | |
c_hpothu | 002231a | 2015-02-05 14:58:51 +0530 | [diff] [blame] | 61 | VOS_STATUS hdd_unregister_hostapd(hdd_adapter_t *pAdapter, tANI_U8 rtnl_held); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 62 | |
| 63 | eCsrAuthType |
| 64 | hdd_TranslateRSNToCsrAuthType( u_int8_t auth_suite[4]); |
| 65 | |
| 66 | eCsrEncryptionType |
| 67 | hdd_TranslateRSNToCsrEncryptionType(u_int8_t cipher_suite[4]); |
| 68 | |
| 69 | eCsrEncryptionType |
| 70 | hdd_TranslateRSNToCsrEncryptionType(u_int8_t cipher_suite[4]); |
| 71 | |
| 72 | eCsrAuthType |
| 73 | hdd_TranslateWPAToCsrAuthType(u_int8_t auth_suite[4]); |
| 74 | |
| 75 | eCsrEncryptionType |
| 76 | hdd_TranslateWPAToCsrEncryptionType(u_int8_t cipher_suite[4]); |
| 77 | |
Hanumantha Reddy Pothula | bfd06f7 | 2014-10-31 14:03:37 +0530 | [diff] [blame] | 78 | VOS_STATUS hdd_softap_sta_deauth(hdd_adapter_t*, struct tagCsrDelStaParams*); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 79 | void hdd_softap_sta_disassoc(hdd_adapter_t*,v_U8_t*); |
| 80 | void hdd_softap_tkip_mic_fail_counter_measure(hdd_adapter_t*,v_BOOL_t); |
| 81 | int hdd_softap_unpackIE( tHalHandle halHandle, |
Chet Lanctot | 8cecea2 | 2014-02-11 19:09:36 -0800 | [diff] [blame] | 82 | 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 Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 88 | u_int8_t *gen_ie ); |
| 89 | |
Kapil Gupta | 137ef89 | 2016-12-13 19:38:00 +0530 | [diff] [blame] | 90 | /** |
| 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 | */ |
| 100 | static inline void |
| 101 | hdd_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 Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 110 | VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCallback); |
Hanumanth Reddy Pothula | 15bc0fa | 2017-02-03 17:24:17 +0530 | [diff] [blame] | 111 | VOS_STATUS hdd_init_ap_mode(hdd_adapter_t *pAdapter, bool re_init); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 112 | void hdd_set_ap_ops( struct net_device *pWlanHostapdDev ); |
Arun Kumar Khandavalli | a3bd800 | 2014-01-17 16:21:19 +0530 | [diff] [blame] | 113 | int hdd_hostapd_stop (struct net_device *dev); |
Sushant Kaushik | ba6764e | 2014-06-30 19:52:09 +0530 | [diff] [blame] | 114 | void hdd_restart_softap (hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter); |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 115 | #ifdef FEATURE_WLAN_CH_AVOID |
| 116 | void hdd_hostapd_ch_avoid_cb(void *pAdapter, void *indParam); |
| 117 | #endif /* FEATURE_WLAN_CH_AVOID */ |
Rashmi Ramanna | 1f0948d | 2014-08-28 15:33:48 +0530 | [diff] [blame] | 118 | int hdd_del_all_sta(hdd_adapter_t *pAdapter); |
Hanumanth Reddy Pothula | d864f31 | 2017-01-18 16:16:08 +0530 | [diff] [blame] | 119 | void hdd_sap_indicate_disconnect_for_sta(hdd_adapter_t *adapter); |
Hanumanth Reddy Pothula | 15bc0fa | 2017-02-03 17:24:17 +0530 | [diff] [blame] | 120 | void hdd_sap_destroy_timers(hdd_adapter_t *adapter); |
Hanumanth Reddy Pothula | d864f31 | 2017-01-18 16:16:08 +0530 | [diff] [blame] | 121 | |
Agrawal Ashish | 17ef508 | 2016-10-17 18:33:21 +0530 | [diff] [blame] | 122 | #ifdef SAP_AUTH_OFFLOAD |
Agrawal Ashish | 6773c90 | 2017-01-06 19:45:03 +0530 | [diff] [blame] | 123 | bool hdd_set_sap_auth_offload(hdd_adapter_t *pHostapdAdapter, |
Agrawal Ashish | 17ef508 | 2016-10-17 18:33:21 +0530 | [diff] [blame] | 124 | bool enabled); |
| 125 | #else |
Agrawal Ashish | 6773c90 | 2017-01-06 19:45:03 +0530 | [diff] [blame] | 126 | static inline bool |
Agrawal Ashish | 17ef508 | 2016-10-17 18:33:21 +0530 | [diff] [blame] | 127 | hdd_set_sap_auth_offload(hdd_adapter_t *pHostapdAdapter, bool enabled) |
| 128 | { |
| 129 | } |
| 130 | #endif |
Ashish Kumar Dhanotiya | 42aa515 | 2017-01-03 20:25:57 +0530 | [diff] [blame] | 131 | |
| 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 | */ |
| 144 | void hdd_check_for_unsafe_ch(hdd_adapter_t *phostapd_adapter, |
| 145 | hdd_context_t *hdd_ctx); |
| 146 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 147 | #endif // end #if !defined( WLAN_HDD_HOSTAPD_H ) |