blob: 6ed76bd4a2a10c19e358c00e59dc6088cc5e748e [file] [log] [blame]
Mukul Sharmad75a6672017-06-22 15:40:53 +05301/*
Jeff Johnsonb4c29962017-10-07 19:35:14 -07002 * Copyright (c) 2017 The Linux Foundation. All rights reserved.
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 * DOC: Declare various struct, macros which shall be used in
20 * pmo packet filter feature.
21 *
22 * Note: This file shall not contain public API's prototype/declarations.
23 *
24 */
Mukul Sharmad75a6672017-06-22 15:40:53 +053025
26#ifndef _WLAN_PMO_PKT_FILTER_PUBLIC_STRUCT_H_
27#define _WLAN_PMO_PKT_FILTER_PUBLIC_STRUCT_H_
28
29#include "qdf_types.h"
30
31#define PMO_MAX_FILTER_TEST_DATA_LEN 8
32#define PMO_MAX_NUM_TESTS_PER_FILTER 10
33
34/**
35 * enum pmo_rcv_pkt_fltr_type: Receive Filter Parameters
36 * @PMO_RCV_FILTER_TYPE_INVALID: invalied filter type
37 * @PMO_RCV_FILTER_TYPE_FILTER_PKT: packet filter
38 * @PMO_RCV_FILTER_TYPE_BUFFER_PKT: buffer packet
39 * @PMO_RCV_FILTER_TYPE_MAX_ENUM_SIZE: max filter
40 */
41enum pmo_rcv_pkt_fltr_type {
42 PMO_RCV_FILTER_TYPE_INVALID,
43 PMO_RCV_FILTER_TYPE_FILTER_PKT,
44 PMO_RCV_FILTER_TYPE_BUFFER_PKT,
45 PMO_RCV_FILTER_TYPE_MAX_ENUM_SIZE
46};
47
48/**
49 * enum pmo_rcv_pkt_fltr_flag_type: Receive Filter flags
50 * @PMO_FILTER_CMP_TYPE_INVALID: invalied flag
51 * @PMO_FILTER_CMP_TYPE_EQUAL: equal
52 * @PMO_FILTER_CMP_TYPE_MASK_EQUAL: mask
53 * @PMO_FILTER_CMP_TYPE_NOT_EQUAL: not equal
54 * @PMO_FILTER_CMP_TYPE_MASK_NOT_EQUAL: mask not equal
55 * @PMO_FILTER_CMP_TYPE_MAX: max size of flag
56 */
57enum pmo_rcv_pkt_fltr_flag_type {
58 PMO_FILTER_CMP_TYPE_INVALID,
59 PMO_FILTER_CMP_TYPE_EQUAL,
60 PMO_FILTER_CMP_TYPE_MASK_EQUAL,
61 PMO_FILTER_CMP_TYPE_NOT_EQUAL,
62 PMO_FILTER_CMP_TYPE_MASK_NOT_EQUAL,
63 PMO_FILTER_CMP_TYPE_MAX
64};
65
66/**
67 * enum pmo_rcv_pkt_fltr_protocol_params: Receive Filter protocal parameters
68 * @PMO_FILTER_HDR_TYPE_INVALID: invalied type
69 * @PMO_FILTER_HDR_TYPE_MAC: mac protocol
70 * @PMO_FILTER_HDR_TYPE_ARP: arp protocol
71 * @PMO_FILTER_HDR_TYPE_IPV4: ipv4 protocol
72 * @PMO_FILTER_HDR_TYPE_IPV6: ipv6 protocol
73 * @PMO_FILTER_HDR_TYPE_UDP: udp protocol
74 * @PMO_FILTER_HDR_TYPE_MAX: max of type of protocol
75 */
76enum pmo_rcv_pkt_fltr_protocol_params {
77 PMO_FILTER_HDR_TYPE_INVALID,
78 PMO_FILTER_HDR_TYPE_MAC,
79 PMO_FILTER_HDR_TYPE_ARP,
80 PMO_FILTER_HDR_TYPE_IPV4,
81 PMO_FILTER_HDR_TYPE_IPV6,
82 PMO_FILTER_HDR_TYPE_UDP,
83 PMO_FILTER_HDR_TYPE_MAX
84};
85
86/**
87 * struct pmo_rcv_pkt_fltr_field_params - pmo packet filter field parameters
88 * @protocol_layer: Protocol layer
89 * @compare_flag: Comparison flag
90 * @data_length: Length of the data to compare
91 * @data_offset: from start of the respective frame header
92 * @reserved: Reserved field
93 * @compare_data: Data to compare
94 * @data_mask: Mask to be applied on the received packet data before compare
95 */
96struct pmo_rcv_pkt_fltr_field_params {
97 enum pmo_rcv_pkt_fltr_protocol_params protocol_layer;
98 enum pmo_rcv_pkt_fltr_flag_type compare_flag;
99 uint16_t data_length;
100 uint8_t data_offset;
101 uint8_t reserved;
102 uint8_t compare_data[PMO_MAX_FILTER_TEST_DATA_LEN];
103 uint8_t data_mask[PMO_MAX_FILTER_TEST_DATA_LEN];
104};
105
106/**
107 * struct pmo_rcv_pkt_fltr_cfg - pmo packet filter config
108 * @filter_id: filter id
109 * @filter_type: filter type
110 * @num_params: number of parameters
111 * @coalesce_time: time
112 * @self_macaddr: mac address
113 * @bssid: Bssid of the connected AP
114 * @params_data: data
115 */
116struct pmo_rcv_pkt_fltr_cfg {
117 uint8_t filter_id;
118 enum pmo_rcv_pkt_fltr_type filter_type;
119 uint32_t num_params;
120 uint32_t coalesce_time;
121 struct qdf_mac_addr self_macaddr;
122 struct qdf_mac_addr bssid;
123 struct pmo_rcv_pkt_fltr_field_params
124 params_data[PMO_MAX_NUM_TESTS_PER_FILTER];
125};
126
127/**
128 * struct pmo_rcv_pkt_fltr_cfg - pmo receive Filter Clear Parameters
129 * @status: only valid for response message
130 * @filter_id:
131 * @self_macaddr:
132 * @bssid: peer ap address
133 */
134struct pmo_rcv_pkt_fltr_clear_param {
135 uint32_t status;
136 uint8_t filter_id;
137 struct qdf_mac_addr self_macaddr;
138 struct qdf_mac_addr bssid;
139};
140
141#endif /* end of _WLAN_PMO_PKT_FILTER_PUBLIC_STRUCT_H_ */