blob: ff845cd1e3a6130a79492c94facfac875012470b [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Jeff Johnson32d95a32012-09-10 13:15:23 -07002 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -07003 *
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#ifndef __P2P_H
23#define __P2P_H
24/**===========================================================================
25
26\file wlan_hdd_p2p.h
27
28\brief Linux HDD P2P include file
29 Copyright 2008 (c) Qualcomm, Incorporated.
30 All Rights Reserved.
31 Qualcomm Confidential and Proprietary.
32
33==========================================================================*/
34#ifdef CONFIG_CFG80211
35#define ACTION_FRAME_TX_TIMEOUT 1000
Jeff Johnsone7245742012-09-05 17:12:55 -070036#define WAIT_CANCEL_REM_CHAN 1000
37#define WAIT_REM_CHAN_READY 1000
Jeff Johnson295189b2012-06-20 16:38:30 -070038#define WAIT_CHANGE_CHANNEL_FOR_OFFCHANNEL_TX 3000
39
Jeff Johnsone7245742012-09-05 17:12:55 -070040#define ACTION_FRAME_DEFAULT_WAIT 200
41
Jeff Johnson295189b2012-06-20 16:38:30 -070042#define WLAN_HDD_GET_TYPE_FRM_FC(__fc__) (((__fc__) & 0x0F) >> 2)
43#define WLAN_HDD_GET_SUBTYPE_FRM_FC(__fc__) (((__fc__) & 0xF0) >> 4)
44#define WLAN_HDD_80211_FRM_DA_OFFSET 4
45#define P2P_WILDCARD_SSID_LEN 7
46#define P2P_WILDCARD_SSID "DIRECT-"
47
48enum hdd_rx_flags {
49 HDD_RX_FLAG_DECRYPTED = 1 << 0,
50 HDD_RX_FLAG_MMIC_STRIPPED = 1 << 1,
51 HDD_RX_FLAG_IV_STRIPPED = 1 << 2,
52};
53
54
55#ifdef WLAN_FEATURE_P2P
56#define P2P_POWER_SAVE_TYPE_OPPORTUNISTIC 1 << 0;
57#define P2P_POWER_SAVE_TYPE_PERIODIC_NOA 1 << 1;
58#define P2P_POWER_SAVE_TYPE_SINGLE_NOA 1 << 2;
59
Madan Mohan Koyyalamudi26bd7142012-10-30 18:14:19 -070060#ifdef WLAN_FEATURE_P2P_DEBUG
61typedef enum { P2P_NOT_ACTIVE,
62 P2P_GO_NEG_PROCESS,
63 P2P_GO_NEG_COMPLETED,
64 P2P_CLIENT_CONNECTING_STATE_1,
65 P2P_GO_COMPLETED_STATE,
66 P2P_CLIENT_CONNECTED_STATE_1,
67 P2P_CLIENT_DISCONNECTED_STATE,
68 P2P_CLIENT_CONNECTING_STATE_2,
69 P2P_CLIENT_COMPLETED_STATE
70 }tP2PConnectionStatus;
71
72extern tP2PConnectionStatus globalP2PConnectionStatus;
73#endif
74
Jeff Johnson295189b2012-06-20 16:38:30 -070075typedef struct p2p_app_setP2pPs{
76 tANI_U8 opp_ps;
77 tANI_U32 ctWindow;
78 tANI_U8 count;
79 tANI_U32 duration;
80 tANI_U32 interval;
81 tANI_U32 single_noa_duration;
82 tANI_U8 psSelection;
83}p2p_app_setP2pPs_t;
84
85int wlan_hdd_cfg80211_remain_on_channel( struct wiphy *wiphy,
86 struct net_device *dev,
87 struct ieee80211_channel *chan,
88 enum nl80211_channel_type channel_type,
89 unsigned int duration, u64 *cookie );
90
91int wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy,
92 struct net_device *dev,
93 u64 cookie );
94
95#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
96int wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
97 struct net_device *dev,
98 u64 cookie);
99#endif
100
101int hdd_setP2pPs( struct net_device *dev, void *msgData );
102int hdd_setP2pOpps( struct net_device *dev, tANI_U8 *command );
103int hdd_setP2pNoa( struct net_device *dev, tANI_U8 *command );
104
105void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter,
106 tANI_U32 nFrameLength, tANI_U8* pbFrames,
107 tANI_U8 frameType,
108 tANI_U32 rxChan);
109
110void hdd_remainChanReadyHandler( hdd_adapter_t *pAdapter );
111void hdd_sendActionCnf( hdd_adapter_t *pAdapter, tANI_BOOLEAN actionSendSuccess );
Jeff Johnson32d95a32012-09-10 13:15:23 -0700112int wlan_hdd_check_remain_on_channel(hdd_adapter_t *pAdapter);
Jeff Johnson295189b2012-06-20 16:38:30 -0700113
114#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
115int wlan_hdd_action( struct wiphy *wiphy, struct net_device *dev,
116 struct ieee80211_channel *chan, bool offchan,
117 enum nl80211_channel_type channel_type,
118 bool channel_type_valid, unsigned int wait,
119 const u8 *buf, size_t len, bool no_cck,
120 bool dont_wait_for_ack, u64 *cookie );
121#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
122int wlan_hdd_action( struct wiphy *wiphy, struct net_device *dev,
123 struct ieee80211_channel *chan, bool offchan,
124 enum nl80211_channel_type channel_type,
125 bool channel_type_valid, unsigned int wait,
126 const u8 *buf, size_t len, u64 *cookie );
127#else
128int wlan_hdd_action( struct wiphy *wiphy, struct net_device *dev,
129 struct ieee80211_channel *chan,
130 enum nl80211_channel_type channel_type,
131 bool channel_type_valid,
132 const u8 *buf, size_t len, u64 *cookie );
133#endif
134
135#endif // WLAN_FEATURE_P2P
136
137struct net_device* wlan_hdd_add_virtual_intf(
138 struct wiphy *wiphy, char *name, enum nl80211_iftype type,
139 u32 *flags, struct vif_params *params );
140
141int wlan_hdd_del_virtual_intf( struct wiphy *wiphy, struct net_device *dev );
142
143#endif // CONFIG_CFG80211
144
145#endif // __P2P_H