blob: 1326fab3900ef56753c0bc3a717c89d1f781ba93 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam842dad02014-02-18 18:44:02 -08002 * 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.
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#ifndef __P2P_H
29#define __P2P_H
30/**===========================================================================
31
32\file wlan_hdd_p2p.h
33
34\brief Linux HDD P2P include file
35 Copyright 2008 (c) Qualcomm, Incorporated.
36 All Rights Reserved.
37 Qualcomm Confidential and Proprietary.
38
39==========================================================================*/
Sudhir Sattayappa Kohalli8ee532d2013-02-15 13:16:26 -080040#define ACTION_FRAME_TX_TIMEOUT 2000
Jeff Johnsone7245742012-09-05 17:12:55 -070041#define WAIT_CANCEL_REM_CHAN 1000
42#define WAIT_REM_CHAN_READY 1000
Jeff Johnson295189b2012-06-20 16:38:30 -070043#define WAIT_CHANGE_CHANNEL_FOR_OFFCHANNEL_TX 3000
Nirav Shah87cd0cb2013-12-28 21:22:09 +053044#define READY_EVENT_PROPOGATE_TIME 2
Jeff Johnson295189b2012-06-20 16:38:30 -070045
Jeff Johnsone7245742012-09-05 17:12:55 -070046#define ACTION_FRAME_DEFAULT_WAIT 200
47
vamsida0e5ab2013-12-26 14:33:27 +053048#define ESTIMATED_ROC_DUR_REQD_FOR_ACTION_TX 20
49
Jeff Johnson295189b2012-06-20 16:38:30 -070050#define WLAN_HDD_GET_TYPE_FRM_FC(__fc__) (((__fc__) & 0x0F) >> 2)
51#define WLAN_HDD_GET_SUBTYPE_FRM_FC(__fc__) (((__fc__) & 0xF0) >> 4)
52#define WLAN_HDD_80211_FRM_DA_OFFSET 4
53#define P2P_WILDCARD_SSID_LEN 7
54#define P2P_WILDCARD_SSID "DIRECT-"
Sushant Kaushik22257d62014-05-20 19:27:07 +053055#define ACTION_FRAME_RSP_WAIT 500
56#define ACTION_FRAME_ACK_WAIT 300
Chet Lanctot186b5732013-03-18 10:26:30 -070057#ifdef WLAN_FEATURE_11W
58#define WLAN_HDD_SET_WEP_FRM_FC(__fc__) ( (__fc__) = ((__fc__) | 0x40))
59#endif //WLAN_FEATURE_11W
60
Jeff Johnson295189b2012-06-20 16:38:30 -070061enum hdd_rx_flags {
62 HDD_RX_FLAG_DECRYPTED = 1 << 0,
63 HDD_RX_FLAG_MMIC_STRIPPED = 1 << 1,
64 HDD_RX_FLAG_IV_STRIPPED = 1 << 2,
65};
66
67
Madan Mohan Koyyalamudic0d1b3f2012-11-13 10:41:07 -080068#define P2P_POWER_SAVE_TYPE_OPPORTUNISTIC (1 << 0)
69#define P2P_POWER_SAVE_TYPE_PERIODIC_NOA (1 << 1)
70#define P2P_POWER_SAVE_TYPE_SINGLE_NOA (1 << 2)
Jeff Johnson295189b2012-06-20 16:38:30 -070071
Madan Mohan Koyyalamudi26bd7142012-10-30 18:14:19 -070072#ifdef WLAN_FEATURE_P2P_DEBUG
73typedef enum { P2P_NOT_ACTIVE,
74 P2P_GO_NEG_PROCESS,
75 P2P_GO_NEG_COMPLETED,
76 P2P_CLIENT_CONNECTING_STATE_1,
77 P2P_GO_COMPLETED_STATE,
78 P2P_CLIENT_CONNECTED_STATE_1,
79 P2P_CLIENT_DISCONNECTED_STATE,
80 P2P_CLIENT_CONNECTING_STATE_2,
81 P2P_CLIENT_COMPLETED_STATE
82 }tP2PConnectionStatus;
83
84extern tP2PConnectionStatus globalP2PConnectionStatus;
85#endif
86
Jeff Johnson295189b2012-06-20 16:38:30 -070087typedef struct p2p_app_setP2pPs{
88 tANI_U8 opp_ps;
89 tANI_U32 ctWindow;
90 tANI_U8 count;
91 tANI_U32 duration;
92 tANI_U32 interval;
93 tANI_U32 single_noa_duration;
94 tANI_U8 psSelection;
95}p2p_app_setP2pPs_t;
96
97int wlan_hdd_cfg80211_remain_on_channel( struct wiphy *wiphy,
Jeff Johnson3bbe4bf2013-01-18 17:05:29 -080098#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
99 struct wireless_dev *wdev,
100#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700101 struct net_device *dev,
Jeff Johnson3bbe4bf2013-01-18 17:05:29 -0800102#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700103 struct ieee80211_channel *chan,
Yue Maf49ba872013-08-19 12:04:25 -0700104#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
Jeff Johnson295189b2012-06-20 16:38:30 -0700105 enum nl80211_channel_type channel_type,
Yue Maf49ba872013-08-19 12:04:25 -0700106#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700107 unsigned int duration, u64 *cookie );
108
109int wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy,
Jeff Johnson3bbe4bf2013-01-18 17:05:29 -0800110#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
111 struct wireless_dev *wdev,
112#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700113 struct net_device *dev,
Jeff Johnson3bbe4bf2013-01-18 17:05:29 -0800114#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700115 u64 cookie );
116
117#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
118int wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
Jeff Johnson3bbe4bf2013-01-18 17:05:29 -0800119#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
120 struct wireless_dev *wdev,
121#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700122 struct net_device *dev,
Jeff Johnson3bbe4bf2013-01-18 17:05:29 -0800123#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700124 u64 cookie);
125#endif
126
127int hdd_setP2pPs( struct net_device *dev, void *msgData );
128int hdd_setP2pOpps( struct net_device *dev, tANI_U8 *command );
129int hdd_setP2pNoa( struct net_device *dev, tANI_U8 *command );
130
131void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter,
132 tANI_U32 nFrameLength, tANI_U8* pbFrames,
133 tANI_U8 frameType,
Chilam NG571c65a2013-01-19 12:27:36 +0530134 tANI_U32 rxChan, tANI_S8 rxRssi);
Jeff Johnson295189b2012-06-20 16:38:30 -0700135
136void hdd_remainChanReadyHandler( hdd_adapter_t *pAdapter );
137void hdd_sendActionCnf( hdd_adapter_t *pAdapter, tANI_BOOLEAN actionSendSuccess );
Jeff Johnson32d95a32012-09-10 13:15:23 -0700138int wlan_hdd_check_remain_on_channel(hdd_adapter_t *pAdapter);
Sushant Kaushik5ad9b7b2014-05-21 21:09:43 +0530139VOS_STATUS wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter);
Jeff Johnson295189b2012-06-20 16:38:30 -0700140
Jeff Johnson3bbe4bf2013-01-18 17:05:29 -0800141#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
DARAM SUDHA39eede62014-02-12 11:16:40 +0530142int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct wireless_dev *wdev,
Jeff Johnson3bbe4bf2013-01-18 17:05:29 -0800143 struct ieee80211_channel *chan, bool offchan,
Yue Maf49ba872013-08-19 12:04:25 -0700144#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
Jeff Johnson3bbe4bf2013-01-18 17:05:29 -0800145 enum nl80211_channel_type channel_type,
Yue Maf49ba872013-08-19 12:04:25 -0700146 bool channel_type_valid,
147#endif
148 unsigned int wait,
Jeff Johnson3bbe4bf2013-01-18 17:05:29 -0800149 const u8 *buf, size_t len, bool no_cck,
150 bool dont_wait_for_ack, u64 *cookie );
151#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
DARAM SUDHA39eede62014-02-12 11:16:40 +0530152int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev,
Jeff Johnson295189b2012-06-20 16:38:30 -0700153 struct ieee80211_channel *chan, bool offchan,
154 enum nl80211_channel_type channel_type,
155 bool channel_type_valid, unsigned int wait,
156 const u8 *buf, size_t len, bool no_cck,
157 bool dont_wait_for_ack, u64 *cookie );
158#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
DARAM SUDHA39eede62014-02-12 11:16:40 +0530159int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev,
Jeff Johnson295189b2012-06-20 16:38:30 -0700160 struct ieee80211_channel *chan, bool offchan,
161 enum nl80211_channel_type channel_type,
162 bool channel_type_valid, unsigned int wait,
163 const u8 *buf, size_t len, u64 *cookie );
164#else
DARAM SUDHA39eede62014-02-12 11:16:40 +0530165int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev,
Jeff Johnson295189b2012-06-20 16:38:30 -0700166 struct ieee80211_channel *chan,
167 enum nl80211_channel_type channel_type,
168 bool channel_type_valid,
169 const u8 *buf, size_t len, u64 *cookie );
170#endif
171
Jeff Johnson295189b2012-06-20 16:38:30 -0700172
Jeff Johnson3bbe4bf2013-01-18 17:05:29 -0800173#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
174struct wireless_dev* wlan_hdd_add_virtual_intf(
175 struct wiphy *wiphy, const char *name,
176 enum nl80211_iftype type,
177 u32 *flags, struct vif_params *params );
178#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
179struct wireless_dev* wlan_hdd_add_virtual_intf(
180 struct wiphy *wiphy, char *name, enum nl80211_iftype type,
181 u32 *flags, struct vif_params *params );
182#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
Jeff Johnson295189b2012-06-20 16:38:30 -0700183struct net_device* wlan_hdd_add_virtual_intf(
184 struct wiphy *wiphy, char *name, enum nl80211_iftype type,
185 u32 *flags, struct vif_params *params );
Jeff Johnson3bbe4bf2013-01-18 17:05:29 -0800186#else
187int wlan_hdd_add_virtual_intf( struct wiphy *wiphy, char *name,
188 enum nl80211_iftype type,
189 u32 *flags, struct vif_params *params );
190#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700191
Jeff Johnson3bbe4bf2013-01-18 17:05:29 -0800192#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
193int wlan_hdd_del_virtual_intf( struct wiphy *wiphy, struct wireless_dev *wdev );
194#else
Jeff Johnson295189b2012-06-20 16:38:30 -0700195int wlan_hdd_del_virtual_intf( struct wiphy *wiphy, struct net_device *dev );
Jeff Johnson3bbe4bf2013-01-18 17:05:29 -0800196#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700197
Jeff Johnson295189b2012-06-20 16:38:30 -0700198#endif // __P2P_H