Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Jeff Johnson | 9421434 | 2018-05-06 07:58:13 -0700 | [diff] [blame] | 2 | * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all |
| 7 | * copies. |
| 8 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 10 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 11 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 12 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 13 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 14 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 15 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 16 | * PERFORMANCE OF THIS SOFTWARE. |
| 17 | */ |
| 18 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 19 | #ifndef __P2P_H |
| 20 | #define __P2P_H |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 21 | |
Jeff Johnson | 8125856 | 2017-01-12 10:40:13 -0800 | [diff] [blame] | 22 | /** |
| 23 | * DOC: wlan_hdd_p2p.h |
| 24 | * |
| 25 | * Linux HDD P2P include file |
| 26 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 27 | |
| 28 | #define WLAN_HDD_GET_TYPE_FRM_FC(__fc__) (((__fc__) & 0x0F) >> 2) |
| 29 | #define WLAN_HDD_GET_SUBTYPE_FRM_FC(__fc__) (((__fc__) & 0xF0) >> 4) |
| 30 | #define WLAN_HDD_80211_FRM_DA_OFFSET 4 |
Abhishek Singh | 437606a | 2016-04-27 13:51:49 +0530 | [diff] [blame] | 31 | #define WLAN_HDD_80211_PEER_ADDR_OFFSET (WLAN_HDD_80211_FRM_DA_OFFSET + \ |
| 32 | MAC_ADDR_LEN) |
| 33 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 34 | #define P2P_POWER_SAVE_TYPE_OPPORTUNISTIC (1 << 0) |
| 35 | #define P2P_POWER_SAVE_TYPE_PERIODIC_NOA (1 << 1) |
| 36 | #define P2P_POWER_SAVE_TYPE_SINGLE_NOA (1 << 2) |
| 37 | |
Srinivas Girigowda | 5d5fdc5 | 2017-03-24 22:30:57 -0700 | [diff] [blame] | 38 | struct p2p_app_set_ps { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 39 | uint8_t opp_ps; |
| 40 | uint32_t ctWindow; |
| 41 | uint8_t count; |
| 42 | uint32_t duration; |
| 43 | uint32_t interval; |
| 44 | uint32_t single_noa_duration; |
| 45 | uint8_t psSelection; |
Srinivas Girigowda | 5d5fdc5 | 2017-03-24 22:30:57 -0700 | [diff] [blame] | 46 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 47 | |
| 48 | int wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 49 | struct wireless_dev *wdev, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 50 | struct ieee80211_channel *chan, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 51 | unsigned int duration, u64 *cookie); |
| 52 | |
| 53 | int wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 54 | struct wireless_dev *wdev, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 55 | u64 cookie); |
| 56 | |
| 57 | int wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 58 | struct wireless_dev *wdev, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 59 | u64 cookie); |
| 60 | |
| 61 | int hdd_set_p2p_ps(struct net_device *dev, void *msgData); |
| 62 | int hdd_set_p2p_opps(struct net_device *dev, uint8_t *command); |
| 63 | int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command); |
| 64 | |
Jeff Johnson | 19b66e8 | 2017-10-02 13:25:56 -0700 | [diff] [blame] | 65 | void __hdd_indicate_mgmt_frame(struct hdd_adapter *adapter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 66 | uint32_t nFrameLength, uint8_t *pbFrames, |
| 67 | uint8_t frameType, uint32_t rxChan, int8_t rxRssi); |
| 68 | |
Jeff Johnson | 19b66e8 | 2017-10-02 13:25:56 -0700 | [diff] [blame] | 69 | int wlan_hdd_check_remain_on_channel(struct hdd_adapter *adapter); |
Jeff Johnson | 19b66e8 | 2017-10-02 13:25:56 -0700 | [diff] [blame] | 70 | void wlan_hdd_cancel_existing_remain_on_channel(struct hdd_adapter *adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 71 | |
| 72 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) |
| 73 | int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, |
| 74 | struct cfg80211_mgmt_tx_params *params, u64 *cookie); |
Amar Singhal | 01098f7 | 2015-10-08 11:55:32 -0700 | [diff] [blame] | 75 | #else |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 76 | int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, |
| 77 | struct ieee80211_channel *chan, bool offchan, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 78 | unsigned int wait, |
| 79 | const u8 *buf, size_t len, bool no_cck, |
| 80 | bool dont_wait_for_ack, u64 *cookie); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 81 | #endif |
| 82 | |
Dustin Brown | 9ed30a5 | 2017-08-16 13:59:38 -0700 | [diff] [blame] | 83 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) |
| 84 | struct wireless_dev *wlan_hdd_add_virtual_intf(struct wiphy *wiphy, |
| 85 | const char *name, |
| 86 | unsigned char name_assign_type, |
| 87 | enum nl80211_iftype type, |
| 88 | struct vif_params *params); |
| 89 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)) || defined(WITH_BACKPORTS) |
Ryan Hsu | 07495ea | 2016-01-21 15:25:39 -0800 | [diff] [blame] | 90 | struct wireless_dev *wlan_hdd_add_virtual_intf(struct wiphy *wiphy, |
| 91 | const char *name, |
| 92 | unsigned char name_assign_type, |
| 93 | enum nl80211_iftype type, |
| 94 | u32 *flags, |
| 95 | struct vif_params *params); |
| 96 | #else |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 97 | struct wireless_dev *wlan_hdd_add_virtual_intf(struct wiphy *wiphy, |
| 98 | const char *name, |
| 99 | enum nl80211_iftype type, |
| 100 | u32 *flags, |
| 101 | struct vif_params *params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 102 | |
Ryan Hsu | 07495ea | 2016-01-21 15:25:39 -0800 | [diff] [blame] | 103 | #endif |
| 104 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 105 | int wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev); |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 106 | int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev); |
Amar Singhal | 01098f7 | 2015-10-08 11:55:32 -0700 | [diff] [blame] | 107 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 108 | |
Jeff Johnson | 19b66e8 | 2017-10-02 13:25:56 -0700 | [diff] [blame] | 109 | void wlan_hdd_cleanup_remain_on_channel_ctx(struct hdd_adapter *adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 110 | |
| 111 | void wlan_hdd_roc_request_dequeue(struct work_struct *work); |
Wu Gao | 9a704f4 | 2017-03-10 18:42:11 +0800 | [diff] [blame] | 112 | |
| 113 | /** |
| 114 | * wlan_hdd_set_power_save() - hdd set power save |
| 115 | * @adapter: adapter context |
Wu Gao | 02bd75b | 2017-10-13 18:34:02 +0800 | [diff] [blame] | 116 | * @ps_config: pointer to power save configure |
Wu Gao | 9a704f4 | 2017-03-10 18:42:11 +0800 | [diff] [blame] | 117 | * |
| 118 | * This function sets power save parameters. |
| 119 | * |
| 120 | * Return: 0 - success |
| 121 | * others - failure |
| 122 | */ |
Jeff Johnson | fbb5452 | 2017-08-29 14:25:27 -0700 | [diff] [blame] | 123 | int wlan_hdd_set_power_save(struct hdd_adapter *adapter, |
Wu Gao | 02bd75b | 2017-10-13 18:34:02 +0800 | [diff] [blame] | 124 | struct p2p_ps_config *ps_config); |
Wu Gao | 9a704f4 | 2017-03-10 18:42:11 +0800 | [diff] [blame] | 125 | |
| 126 | /** |
Archana Ramachandran | b8c04f9 | 2017-03-17 20:05:47 -0700 | [diff] [blame] | 127 | * wlan_hdd_set_mas() - Function to set MAS value to FW |
| 128 | * @adapter: Pointer to HDD adapter |
| 129 | * @mas_value: 0-Disable, 1-Enable MAS |
| 130 | * |
| 131 | * This function passes down the value of MAS to FW |
| 132 | * |
| 133 | * Return: Configuration message posting status, SUCCESS or Fail |
| 134 | * |
| 135 | */ |
Jeff Johnson | fbb5452 | 2017-08-29 14:25:27 -0700 | [diff] [blame] | 136 | int32_t wlan_hdd_set_mas(struct hdd_adapter *adapter, uint8_t mas_value); |
Archana Ramachandran | b8c04f9 | 2017-03-17 20:05:47 -0700 | [diff] [blame] | 137 | |
| 138 | /** |
| 139 | * wlan_hdd_set_mcc_p2p_quota() - Function to set quota for P2P |
| 140 | * to FW |
| 141 | * @adapter: Pointer to HDD adapter |
| 142 | * @set_value: Quota value for the interface |
| 143 | * |
| 144 | * This function is used to set the quota for P2P cases |
| 145 | * |
| 146 | * Return: Configuration message posting status, SUCCESS or Fail |
| 147 | * |
| 148 | */ |
Jeff Johnson | fbb5452 | 2017-08-29 14:25:27 -0700 | [diff] [blame] | 149 | int wlan_hdd_set_mcc_p2p_quota(struct hdd_adapter *adapter, |
Archana Ramachandran | b8c04f9 | 2017-03-17 20:05:47 -0700 | [diff] [blame] | 150 | uint32_t set_value); |
| 151 | |
| 152 | /** |
| 153 | * wlan_hdd_go_set_mcc_p2p_quota() - Function to set quota for |
| 154 | * P2P GO to FW |
| 155 | * @hostapd_adapter: Pointer to HDD adapter |
| 156 | * @set_value: Quota value for the interface |
| 157 | * |
| 158 | * This function is used to set the quota for P2P GO cases |
| 159 | * |
| 160 | * Return: Configuration message posting status, SUCCESS or Fail |
| 161 | * |
| 162 | */ |
Jeff Johnson | fbb5452 | 2017-08-29 14:25:27 -0700 | [diff] [blame] | 163 | int wlan_hdd_go_set_mcc_p2p_quota(struct hdd_adapter *hostapd_adapter, |
Archana Ramachandran | b8c04f9 | 2017-03-17 20:05:47 -0700 | [diff] [blame] | 164 | uint32_t set_value); |
| 165 | /** |
| 166 | * wlan_hdd_set_mcc_latency() - Set MCC latency to FW |
| 167 | * @adapter: Pointer to HDD adapter |
| 168 | * @set_value: Latency value |
| 169 | * |
| 170 | * Sets the MCC latency value during STA-P2P concurrency |
| 171 | * |
| 172 | * Return: None |
| 173 | */ |
Jeff Johnson | fbb5452 | 2017-08-29 14:25:27 -0700 | [diff] [blame] | 174 | void wlan_hdd_set_mcc_latency(struct hdd_adapter *adapter, int set_value); |
Wu Gao | 4a1ec8c | 2018-07-23 19:18:40 +0800 | [diff] [blame] | 175 | |
| 176 | /** |
| 177 | * wlan_hdd_cleanup_actionframe() - Cleanup action frame |
| 178 | * @adapter: Pointer to HDD adapter |
| 179 | * |
| 180 | * This function cleans up action frame. |
| 181 | * |
| 182 | * Return: None |
| 183 | */ |
| 184 | void wlan_hdd_cleanup_actionframe(struct hdd_adapter *adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 185 | #endif /* __P2P_H */ |