Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 1 | /* |
Qiwei Cai | 4505fc6 | 2018-05-17 18:35:19 +0800 | [diff] [blame] | 2 | * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. |
Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 3 | * |
| 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 | |
| 19 | #if !defined(WLAN_HDD_PACKET_FILTER_API_H__) |
| 20 | #define WLAN_HDD_PACKET_FILTER_API_H__ |
| 21 | |
| 22 | /** |
| 23 | * DOC: wlan_hdd_packet_filter_rules.h |
| 24 | * |
| 25 | */ |
| 26 | |
| 27 | /* Include files */ |
SaidiReddy Yenuga | 744073f | 2017-03-09 17:31:25 +0530 | [diff] [blame] | 28 | #include "wlan_hdd_assoc.h" |
| 29 | #include "wlan_hdd_power.h" |
Qiwei Cai | 4505fc6 | 2018-05-17 18:35:19 +0800 | [diff] [blame] | 30 | |
| 31 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 32 | |
Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 33 | /** |
| 34 | * hdd_enable_default_pkt_filters() - Enable default packet filters based |
| 35 | * on, filters bit map provided in INI, when target goes to suspend mode |
| 36 | * @adapter: Adapter context for which default filters to be configure |
| 37 | * |
| 38 | * Return: zero if success, non-zero otherwise |
| 39 | */ |
| 40 | int hdd_enable_default_pkt_filters(struct hdd_adapter *pAadapter); |
| 41 | |
| 42 | /** |
| 43 | * hdd_disable_default_pkt_filters() - Disable default packet filters based |
| 44 | * on, filters bit map provided in INI, when target resumes |
| 45 | * @adapter: Adapter context for which default filters to be cleared |
| 46 | * |
| 47 | * Return: zero if success, non-zero otherwise |
| 48 | */ |
| 49 | int hdd_disable_default_pkt_filters(struct hdd_adapter *adapter); |
| 50 | |
| 51 | /** |
| 52 | * wlan_hdd_set_filter() - Set packet filter |
| 53 | * @hdd_ctx: Global HDD context |
| 54 | * @request: Packet filter request struct |
| 55 | * @sessionId: Target session for the request |
| 56 | * |
| 57 | * Return: 0 on success, non-zero on error |
| 58 | */ |
| 59 | int wlan_hdd_set_filter(struct hdd_context *hdd_ctx, |
| 60 | struct pkt_filter_cfg *request, |
| 61 | uint8_t sessionId); |
Qiwei Cai | 4505fc6 | 2018-05-17 18:35:19 +0800 | [diff] [blame] | 62 | |
| 63 | #else /* WLAN_FEATURE_PACKET_FILTERING */ |
| 64 | |
| 65 | static inline int |
| 66 | hdd_enable_default_pkt_filters(struct hdd_adapter *adapter) |
| 67 | { |
| 68 | return 0; |
| 69 | } |
| 70 | |
| 71 | static inline int |
| 72 | hdd_disable_default_pkt_filters(struct hdd_adapter *adapter) |
| 73 | { |
| 74 | return 0; |
| 75 | } |
| 76 | |
| 77 | #endif /* WLAN_FEATURE_PACKET_FILTERING */ |
Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 78 | #endif |