blob: 77e5dfa212dbaddbff9a07ab90c29a4b867a4018 [file] [log] [blame]
Hanumanth Reddy Pothula3def8942017-10-05 16:19:36 +05301/*
Qiwei Cai4505fc62018-05-17 18:35:19 +08002 * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
Hanumanth Reddy Pothula3def8942017-10-05 16:19:36 +05303 *
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 Yenuga744073f2017-03-09 17:31:25 +053028#include "wlan_hdd_assoc.h"
29#include "wlan_hdd_power.h"
Qiwei Cai4505fc62018-05-17 18:35:19 +080030
31#ifdef WLAN_FEATURE_PACKET_FILTERING
32
Hanumanth Reddy Pothula3def8942017-10-05 16:19:36 +053033/**
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 */
40int 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 */
49int 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 */
59int wlan_hdd_set_filter(struct hdd_context *hdd_ctx,
60 struct pkt_filter_cfg *request,
61 uint8_t sessionId);
Qiwei Cai4505fc62018-05-17 18:35:19 +080062
63#else /* WLAN_FEATURE_PACKET_FILTERING */
64
65static inline int
66hdd_enable_default_pkt_filters(struct hdd_adapter *adapter)
67{
68 return 0;
69}
70
71static inline int
72hdd_disable_default_pkt_filters(struct hdd_adapter *adapter)
73{
74 return 0;
75}
76
77#endif /* WLAN_FEATURE_PACKET_FILTERING */
Hanumanth Reddy Pothula3def8942017-10-05 16:19:36 +053078#endif