Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [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. |
| 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 Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 36 | #define WAIT_CANCEL_REM_CHAN 1000 |
| 37 | #define WAIT_REM_CHAN_READY 1000 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 38 | #define WAIT_CHANGE_CHANNEL_FOR_OFFCHANNEL_TX 3000 |
| 39 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 40 | #define ACTION_FRAME_DEFAULT_WAIT 200 |
| 41 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 42 | #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 | |
| 48 | enum 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 Koyyalamudi | 26bd714 | 2012-10-30 18:14:19 -0700 | [diff] [blame^] | 60 | #ifdef WLAN_FEATURE_P2P_DEBUG |
| 61 | typedef 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 | |
| 72 | extern tP2PConnectionStatus globalP2PConnectionStatus; |
| 73 | #endif |
| 74 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 75 | typedef 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 | |
| 85 | int 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 | |
| 91 | int 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)) |
| 96 | int wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy, |
| 97 | struct net_device *dev, |
| 98 | u64 cookie); |
| 99 | #endif |
| 100 | |
| 101 | int hdd_setP2pPs( struct net_device *dev, void *msgData ); |
| 102 | int hdd_setP2pOpps( struct net_device *dev, tANI_U8 *command ); |
| 103 | int hdd_setP2pNoa( struct net_device *dev, tANI_U8 *command ); |
| 104 | |
| 105 | void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter, |
| 106 | tANI_U32 nFrameLength, tANI_U8* pbFrames, |
| 107 | tANI_U8 frameType, |
| 108 | tANI_U32 rxChan); |
| 109 | |
| 110 | void hdd_remainChanReadyHandler( hdd_adapter_t *pAdapter ); |
| 111 | void hdd_sendActionCnf( hdd_adapter_t *pAdapter, tANI_BOOLEAN actionSendSuccess ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 112 | int wlan_hdd_check_remain_on_channel(hdd_adapter_t *pAdapter); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 113 | |
| 114 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) |
| 115 | int 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)) |
| 122 | int 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 |
| 128 | int 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 | |
| 137 | struct 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 | |
| 141 | int wlan_hdd_del_virtual_intf( struct wiphy *wiphy, struct net_device *dev ); |
| 142 | |
| 143 | #endif // CONFIG_CFG80211 |
| 144 | |
| 145 | #endif // __P2P_H |