15129044dSC.J. Collier/*-
25129044dSC.J. Collier *   BSD LICENSE
35129044dSC.J. Collier *
4809f0800SChristian Ehrhardt *   Copyright(c) Broadcom Limited.
55129044dSC.J. Collier *   All rights reserved.
65129044dSC.J. Collier *
75129044dSC.J. Collier *   Redistribution and use in source and binary forms, with or without
85129044dSC.J. Collier *   modification, are permitted provided that the following conditions
95129044dSC.J. Collier *   are met:
105129044dSC.J. Collier *
115129044dSC.J. Collier *     * Redistributions of source code must retain the above copyright
125129044dSC.J. Collier *       notice, this list of conditions and the following disclaimer.
135129044dSC.J. Collier *     * Redistributions in binary form must reproduce the above copyright
145129044dSC.J. Collier *       notice, this list of conditions and the following disclaimer in
155129044dSC.J. Collier *       the documentation and/or other materials provided with the
165129044dSC.J. Collier *       distribution.
17809f0800SChristian Ehrhardt *     * Neither the name of Broadcom Corporation nor the names of its
185129044dSC.J. Collier *       contributors may be used to endorse or promote products derived
195129044dSC.J. Collier *       from this software without specific prior written permission.
205129044dSC.J. Collier *
215129044dSC.J. Collier *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
225129044dSC.J. Collier *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
235129044dSC.J. Collier *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
245129044dSC.J. Collier *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
255129044dSC.J. Collier *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
265129044dSC.J. Collier *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
275129044dSC.J. Collier *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
285129044dSC.J. Collier *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
295129044dSC.J. Collier *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
305129044dSC.J. Collier *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
315129044dSC.J. Collier *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
325129044dSC.J. Collier */
335129044dSC.J. Collier
34809f0800SChristian Ehrhardt#ifndef _BNXT_FILTER_H_
35809f0800SChristian Ehrhardt#define _BNXT_FILTER_H_
365129044dSC.J. Collier
37809f0800SChristian Ehrhardt#include <rte_ether.h>
385129044dSC.J. Collier
39809f0800SChristian Ehrhardtstruct bnxt;
40809f0800SChristian Ehrhardtstruct bnxt_filter_info {
41809f0800SChristian Ehrhardt	STAILQ_ENTRY(bnxt_filter_info)	next;
42809f0800SChristian Ehrhardt	uint64_t		fw_l2_filter_id;
43809f0800SChristian Ehrhardt#define INVALID_MAC_INDEX	((uint16_t)-1)
44809f0800SChristian Ehrhardt	uint16_t		mac_index;
45809f0800SChristian Ehrhardt
46809f0800SChristian Ehrhardt	/* Filter Characteristics */
47809f0800SChristian Ehrhardt	uint32_t		flags;
48809f0800SChristian Ehrhardt	uint32_t		enables;
49809f0800SChristian Ehrhardt	uint8_t			l2_addr[ETHER_ADDR_LEN];
50809f0800SChristian Ehrhardt	uint8_t			l2_addr_mask[ETHER_ADDR_LEN];
51809f0800SChristian Ehrhardt	uint16_t		l2_ovlan;
52809f0800SChristian Ehrhardt	uint16_t		l2_ovlan_mask;
53809f0800SChristian Ehrhardt	uint16_t		l2_ivlan;
54809f0800SChristian Ehrhardt	uint16_t		l2_ivlan_mask;
55809f0800SChristian Ehrhardt	uint8_t			t_l2_addr[ETHER_ADDR_LEN];
56809f0800SChristian Ehrhardt	uint8_t			t_l2_addr_mask[ETHER_ADDR_LEN];
57809f0800SChristian Ehrhardt	uint16_t		t_l2_ovlan;
58809f0800SChristian Ehrhardt	uint16_t		t_l2_ovlan_mask;
59809f0800SChristian Ehrhardt	uint16_t		t_l2_ivlan;
60809f0800SChristian Ehrhardt	uint16_t		t_l2_ivlan_mask;
61809f0800SChristian Ehrhardt	uint8_t			tunnel_type;
62809f0800SChristian Ehrhardt	uint16_t		mirror_vnic_id;
63809f0800SChristian Ehrhardt	uint32_t		vni;
64809f0800SChristian Ehrhardt	uint8_t			pri_hint;
65809f0800SChristian Ehrhardt	uint64_t		l2_filter_id_hint;
66809f0800SChristian Ehrhardt};
67809f0800SChristian Ehrhardt
68809f0800SChristian Ehrhardtstruct bnxt_filter_info *bnxt_alloc_filter(struct bnxt *bp);
69809f0800SChristian Ehrhardtvoid bnxt_init_filters(struct bnxt *bp);
70809f0800SChristian Ehrhardtvoid bnxt_free_all_filters(struct bnxt *bp);
71809f0800SChristian Ehrhardtvoid bnxt_free_filter_mem(struct bnxt *bp);
72809f0800SChristian Ehrhardtint bnxt_alloc_filter_mem(struct bnxt *bp);
735129044dSC.J. Collier
745129044dSC.J. Collier#endif
75