1237263Snp/*-
2237263Snp * Copyright (c) 2012 Chelsio Communications, Inc.
3237263Snp * All rights reserved.
4237263Snp *
5237263Snp * Redistribution and use in source and binary forms, with or without
6237263Snp * modification, are permitted provided that the following conditions
7237263Snp * are met:
8237263Snp * 1. Redistributions of source code must retain the above copyright
9237263Snp *    notice, this list of conditions and the following disclaimer.
10237263Snp * 2. Redistributions in binary form must reproduce the above copyright
11237263Snp *    notice, this list of conditions and the following disclaimer in the
12237263Snp *    documentation and/or other materials provided with the distribution.
13237263Snp *
14237263Snp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15237263Snp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16237263Snp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17237263Snp * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18237263Snp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19237263Snp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20237263Snp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21237263Snp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22237263Snp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23237263Snp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24237263Snp * SUCH DAMAGE.
25237263Snp *
26237263Snp * $FreeBSD$
27237263Snp *
28237263Snp */
29237263Snp
30237263Snp#ifndef __T4_TOM_L2T_H
31237263Snp#define __T4_TOM_L2T_H
32237263Snp
33237263Snp#include "t4_l2t.h"
34237263Snp
35237263Snpint t4_l2t_send_slow(struct adapter *, struct wrqe *, struct l2t_entry *);
36237263Snpstruct l2t_entry *t4_l2t_get(struct port_info *, struct ifnet *,
37237263Snp    struct sockaddr *);
38237263Snpvoid t4_l2_update(struct toedev *, struct ifnet *, struct sockaddr *,
39237263Snp    uint8_t *, uint16_t);
40302339Snpint do_l2t_write_rpl2(struct sge_iq *, const struct rss_header *,
41302339Snp    struct mbuf *);
42237263Snp
43237263Snpstatic inline int
44237263Snpt4_l2t_send(struct adapter *sc, struct wrqe *wr, struct l2t_entry *e)
45237263Snp{
46237263Snp	if (__predict_true(e->state == L2T_STATE_VALID)) {
47237263Snp		t4_wrq_tx(sc, wr);
48237263Snp		return (0);
49237263Snp	} else
50237263Snp		return (t4_l2t_send_slow(sc, wr, e));
51237263Snp}
52237263Snp
53237263Snp#endif  /* __T4_TOM_L2T_H */
54