Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
| 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 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 22 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23 | * |
| 24 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 25 | * |
| 26 | * |
| 27 | * Permission to use, copy, modify, and/or distribute this software for |
| 28 | * any purpose with or without fee is hereby granted, provided that the |
| 29 | * above copyright notice and this permission notice appear in all |
| 30 | * copies. |
| 31 | * |
| 32 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 33 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 35 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 36 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 37 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 38 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 39 | * PERFORMANCE OF THIS SOFTWARE. |
| 40 | */ |
| 41 | |
| 42 | #ifndef __P2P_H |
| 43 | #define __P2P_H |
| 44 | /**=========================================================================== |
| 45 | |
| 46 | \file wlan_hdd_p2p.h |
| 47 | |
| 48 | \brief Linux HDD P2P include file |
| 49 | Copyright 2008 (c) Qualcomm, Incorporated. |
| 50 | All Rights Reserved. |
| 51 | Qualcomm Confidential and Proprietary. |
| 52 | |
| 53 | ==========================================================================*/ |
| 54 | #ifdef CONFIG_CFG80211 |
| 55 | #define ACTION_FRAME_TX_TIMEOUT 1000 |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 56 | #define WAIT_CANCEL_REM_CHAN 1000 |
| 57 | #define WAIT_REM_CHAN_READY 1000 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 58 | #define WAIT_CHANGE_CHANNEL_FOR_OFFCHANNEL_TX 3000 |
| 59 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 60 | #define ACTION_FRAME_DEFAULT_WAIT 200 |
| 61 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 62 | #define WLAN_HDD_GET_TYPE_FRM_FC(__fc__) (((__fc__) & 0x0F) >> 2) |
| 63 | #define WLAN_HDD_GET_SUBTYPE_FRM_FC(__fc__) (((__fc__) & 0xF0) >> 4) |
| 64 | #define WLAN_HDD_80211_FRM_DA_OFFSET 4 |
| 65 | #define P2P_WILDCARD_SSID_LEN 7 |
| 66 | #define P2P_WILDCARD_SSID "DIRECT-" |
| 67 | |
| 68 | enum hdd_rx_flags { |
| 69 | HDD_RX_FLAG_DECRYPTED = 1 << 0, |
| 70 | HDD_RX_FLAG_MMIC_STRIPPED = 1 << 1, |
| 71 | HDD_RX_FLAG_IV_STRIPPED = 1 << 2, |
| 72 | }; |
| 73 | |
| 74 | |
| 75 | #ifdef WLAN_FEATURE_P2P |
Madan Mohan Koyyalamudi | c0d1b3f | 2012-11-13 10:41:07 -0800 | [diff] [blame] | 76 | #define P2P_POWER_SAVE_TYPE_OPPORTUNISTIC (1 << 0) |
| 77 | #define P2P_POWER_SAVE_TYPE_PERIODIC_NOA (1 << 1) |
| 78 | #define P2P_POWER_SAVE_TYPE_SINGLE_NOA (1 << 2) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 79 | |
Madan Mohan Koyyalamudi | 26bd714 | 2012-10-30 18:14:19 -0700 | [diff] [blame] | 80 | #ifdef WLAN_FEATURE_P2P_DEBUG |
| 81 | typedef enum { P2P_NOT_ACTIVE, |
| 82 | P2P_GO_NEG_PROCESS, |
| 83 | P2P_GO_NEG_COMPLETED, |
| 84 | P2P_CLIENT_CONNECTING_STATE_1, |
| 85 | P2P_GO_COMPLETED_STATE, |
| 86 | P2P_CLIENT_CONNECTED_STATE_1, |
| 87 | P2P_CLIENT_DISCONNECTED_STATE, |
| 88 | P2P_CLIENT_CONNECTING_STATE_2, |
| 89 | P2P_CLIENT_COMPLETED_STATE |
| 90 | }tP2PConnectionStatus; |
| 91 | |
| 92 | extern tP2PConnectionStatus globalP2PConnectionStatus; |
| 93 | #endif |
| 94 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 95 | typedef struct p2p_app_setP2pPs{ |
| 96 | tANI_U8 opp_ps; |
| 97 | tANI_U32 ctWindow; |
| 98 | tANI_U8 count; |
| 99 | tANI_U32 duration; |
| 100 | tANI_U32 interval; |
| 101 | tANI_U32 single_noa_duration; |
| 102 | tANI_U8 psSelection; |
| 103 | }p2p_app_setP2pPs_t; |
| 104 | |
| 105 | int wlan_hdd_cfg80211_remain_on_channel( struct wiphy *wiphy, |
Jeff Johnson | 3bbe4bf | 2013-01-18 17:05:29 -0800 | [diff] [blame] | 106 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) |
| 107 | struct wireless_dev *wdev, |
| 108 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 109 | struct net_device *dev, |
Jeff Johnson | 3bbe4bf | 2013-01-18 17:05:29 -0800 | [diff] [blame] | 110 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 111 | struct ieee80211_channel *chan, |
| 112 | enum nl80211_channel_type channel_type, |
| 113 | unsigned int duration, u64 *cookie ); |
| 114 | |
| 115 | int wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy, |
Jeff Johnson | 3bbe4bf | 2013-01-18 17:05:29 -0800 | [diff] [blame] | 116 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) |
| 117 | struct wireless_dev *wdev, |
| 118 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 119 | struct net_device *dev, |
Jeff Johnson | 3bbe4bf | 2013-01-18 17:05:29 -0800 | [diff] [blame] | 120 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 121 | u64 cookie ); |
| 122 | |
| 123 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) |
| 124 | int wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy, |
Jeff Johnson | 3bbe4bf | 2013-01-18 17:05:29 -0800 | [diff] [blame] | 125 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) |
| 126 | struct wireless_dev *wdev, |
| 127 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 128 | struct net_device *dev, |
Jeff Johnson | 3bbe4bf | 2013-01-18 17:05:29 -0800 | [diff] [blame] | 129 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 130 | u64 cookie); |
| 131 | #endif |
| 132 | |
| 133 | int hdd_setP2pPs( struct net_device *dev, void *msgData ); |
| 134 | int hdd_setP2pOpps( struct net_device *dev, tANI_U8 *command ); |
| 135 | int hdd_setP2pNoa( struct net_device *dev, tANI_U8 *command ); |
| 136 | |
| 137 | void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter, |
| 138 | tANI_U32 nFrameLength, tANI_U8* pbFrames, |
| 139 | tANI_U8 frameType, |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame^] | 140 | tANI_U32 rxChan, tANI_S8 rxRssi); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 141 | |
| 142 | void hdd_remainChanReadyHandler( hdd_adapter_t *pAdapter ); |
| 143 | void hdd_sendActionCnf( hdd_adapter_t *pAdapter, tANI_BOOLEAN actionSendSuccess ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 144 | int wlan_hdd_check_remain_on_channel(hdd_adapter_t *pAdapter); |
Gopichand Nakkala | f527dc6 | 2012-12-31 16:35:10 -0800 | [diff] [blame] | 145 | void wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 146 | |
Jeff Johnson | 3bbe4bf | 2013-01-18 17:05:29 -0800 | [diff] [blame] | 147 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) |
| 148 | int wlan_hdd_action( struct wiphy *wiphy, struct wireless_dev *wdev, |
| 149 | struct ieee80211_channel *chan, bool offchan, |
| 150 | enum nl80211_channel_type channel_type, |
| 151 | bool channel_type_valid, unsigned int wait, |
| 152 | const u8 *buf, size_t len, bool no_cck, |
| 153 | bool dont_wait_for_ack, u64 *cookie ); |
| 154 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 155 | int wlan_hdd_action( struct wiphy *wiphy, struct net_device *dev, |
| 156 | struct ieee80211_channel *chan, bool offchan, |
| 157 | enum nl80211_channel_type channel_type, |
| 158 | bool channel_type_valid, unsigned int wait, |
| 159 | const u8 *buf, size_t len, bool no_cck, |
| 160 | bool dont_wait_for_ack, u64 *cookie ); |
| 161 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) |
| 162 | int wlan_hdd_action( struct wiphy *wiphy, struct net_device *dev, |
| 163 | struct ieee80211_channel *chan, bool offchan, |
| 164 | enum nl80211_channel_type channel_type, |
| 165 | bool channel_type_valid, unsigned int wait, |
| 166 | const u8 *buf, size_t len, u64 *cookie ); |
| 167 | #else |
| 168 | int wlan_hdd_action( struct wiphy *wiphy, struct net_device *dev, |
| 169 | struct ieee80211_channel *chan, |
| 170 | enum nl80211_channel_type channel_type, |
| 171 | bool channel_type_valid, |
| 172 | const u8 *buf, size_t len, u64 *cookie ); |
| 173 | #endif |
| 174 | |
| 175 | #endif // WLAN_FEATURE_P2P |
| 176 | |
Jeff Johnson | 3bbe4bf | 2013-01-18 17:05:29 -0800 | [diff] [blame] | 177 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) |
| 178 | struct wireless_dev* wlan_hdd_add_virtual_intf( |
| 179 | struct wiphy *wiphy, const char *name, |
| 180 | enum nl80211_iftype type, |
| 181 | u32 *flags, struct vif_params *params ); |
| 182 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) |
| 183 | struct wireless_dev* wlan_hdd_add_virtual_intf( |
| 184 | struct wiphy *wiphy, char *name, enum nl80211_iftype type, |
| 185 | u32 *flags, struct vif_params *params ); |
| 186 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 187 | struct net_device* wlan_hdd_add_virtual_intf( |
| 188 | struct wiphy *wiphy, char *name, enum nl80211_iftype type, |
| 189 | u32 *flags, struct vif_params *params ); |
Jeff Johnson | 3bbe4bf | 2013-01-18 17:05:29 -0800 | [diff] [blame] | 190 | #else |
| 191 | int wlan_hdd_add_virtual_intf( struct wiphy *wiphy, char *name, |
| 192 | enum nl80211_iftype type, |
| 193 | u32 *flags, struct vif_params *params ); |
| 194 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 195 | |
Jeff Johnson | 3bbe4bf | 2013-01-18 17:05:29 -0800 | [diff] [blame] | 196 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) |
| 197 | int wlan_hdd_del_virtual_intf( struct wiphy *wiphy, struct wireless_dev *wdev ); |
| 198 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 199 | int wlan_hdd_del_virtual_intf( struct wiphy *wiphy, struct net_device *dev ); |
Jeff Johnson | 3bbe4bf | 2013-01-18 17:05:29 -0800 | [diff] [blame] | 200 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 201 | |
| 202 | #endif // CONFIG_CFG80211 |
| 203 | |
| 204 | #endif // __P2P_H |