1 /******************************************************************************
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as
14 * published by the Free Software Foundation.
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
21 * The full GNU General Public License is included in this distribution
22 * in the file called COPYING.
24 * Contact Information:
25 * Intel Linux Wireless <linuxwifi@intel.com>
26 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
30 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
31 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
32 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
33 * All rights reserved.
35 * Redistribution and use in source and binary forms, with or without
36 * modification, are permitted provided that the following conditions
39 * * Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * * Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in
43 * the documentation and/or other materials provided with the
45 * * Neither the name Intel Corporation nor the names of its
46 * contributors may be used to endorse or promote products derived
47 * from this software without specific prior written permission.
49 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
50 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
51 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
52 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
53 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
54 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
55 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
56 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
57 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
58 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
59 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 *****************************************************************************/
63 #ifndef __iwl_fw_api_filter_h__
64 #define __iwl_fw_api_filter_h__
66 #include "fw/api/mac.h"
68 #define MAX_PORT_ID_NUM 2
69 #define MAX_MCAST_FILTERING_ADDRESSES 256
72 * struct iwl_mcast_filter_cmd - configure multicast filter.
73 * @filter_own: Set 1 to filter out multicast packets sent by station itself
74 * @port_id: Multicast MAC addresses array specifier. This is a strange way
75 * to identify network interface adopted in host-device IF.
76 * It is used by FW as index in array of addresses. This array has
77 * MAX_PORT_ID_NUM members.
78 * @count: Number of MAC addresses in the array
79 * @pass_all: Set 1 to pass all multicast packets.
80 * @bssid: current association BSSID.
82 * @addr_list: Place holder for array of MAC addresses.
83 * IMPORTANT: add padding if necessary to ensure DWORD alignment.
85 struct iwl_mcast_filter_cmd {
93 } __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
95 #define MAX_BCAST_FILTERS 8
96 #define MAX_BCAST_FILTER_ATTRS 2
99 * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
100 * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
101 * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
102 * start of ip payload).
104 enum iwl_mvm_bcast_filter_attr_offset {
105 BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
106 BCAST_FILTER_OFFSET_IP_END = 1,
110 * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
111 * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
112 * @offset: starting offset of this pattern.
113 * @reserved1: reserved
114 * @val: value to match - big endian (MSB is the first
115 * byte to match from offset pos).
116 * @mask: mask to match (big endian).
118 struct iwl_fw_bcast_filter_attr {
124 } __packed; /* BCAST_FILTER_ATT_S_VER_1 */
127 * enum iwl_mvm_bcast_filter_frame_type - filter frame type
128 * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
129 * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
131 enum iwl_mvm_bcast_filter_frame_type {
132 BCAST_FILTER_FRAME_TYPE_ALL = 0,
133 BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
137 * struct iwl_fw_bcast_filter - broadcast filter
138 * @discard: discard frame (1) or let it pass (0).
139 * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
140 * @reserved1: reserved
141 * @num_attrs: number of valid attributes in this filter.
142 * @attrs: attributes of this filter. a filter is considered matched
143 * only when all its attributes are matched (i.e. AND relationship)
145 struct iwl_fw_bcast_filter {
150 struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
151 } __packed; /* BCAST_FILTER_S_VER_1 */
154 * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
155 * @default_discard: default action for this mac (discard (1) / pass (0)).
156 * @reserved1: reserved
157 * @attached_filters: bitmap of relevant filters for this mac.
159 struct iwl_fw_bcast_mac {
162 __le16 attached_filters;
163 } __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
166 * struct iwl_bcast_filter_cmd - broadcast filtering configuration
167 * @disable: enable (0) / disable (1)
168 * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
169 * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
170 * @reserved1: reserved
171 * @filters: broadcast filters
172 * @macs: broadcast filtering configuration per-mac
174 struct iwl_bcast_filter_cmd {
176 u8 max_bcast_filters;
179 struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
180 struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
181 } __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
183 #endif /* __iwl_fw_api_filter_h__ */