xref: /freebsd/sys/dev/firewire/if_fwipvar.h (revision f374ba41)
1 /*-
2  * SPDX-License-Identifier: BSD-4-Clause
3  *
4  * Copyright (c) 2004
5  *	Doug Rabson
6  * Copyright (c) 2002-2003
7  * 	Hidetoshi Shimokawa. All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. All advertising materials mentioning features or use of this software
18  *    must display the following acknowledgement:
19  *
20  *	This product includes software developed by Hidetoshi Shimokawa.
21  *
22  * 4. Neither the name of the author nor the names of its contributors
23  *    may be used to endorse or promote products derived from this software
24  *    without specific prior written permission.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36  * SUCH DAMAGE.
37  *
38  * $FreeBSD$
39  */
40 
41 #ifndef _NET_IF_FWIPVAR_H_
42 #define _NET_IF_FWIPVAR_H_
43 
44 struct fwip_softc {
45 	/* XXX this must be first for fd.post_explore() */
46 	struct firewire_dev_comm fd;
47 	short dma_ch;
48 	struct fw_bind fwb;
49 	struct fw_eui64 last_dest;
50 	struct fw_pkt last_hdr;
51 	struct task start_send;
52 	STAILQ_HEAD(, fw_xfer) xferlist;
53 	struct crom_chunk unit4;	/* unit directory for IPv4 */
54 	struct crom_chunk spec4;	/* specifier description IPv4 */
55 	struct crom_chunk ver4;		/* version description IPv4 */
56 	struct crom_chunk unit6;	/* unit directory for IPv6 */
57 	struct crom_chunk spec6;	/* specifier description IPv6 */
58 	struct crom_chunk ver6;		/* version description IPv6 */
59 	struct fwip_eth_softc {
60 		if_t fwip_ifp;
61 		struct fwip_softc *fwip;
62 	} fw_softc;
63 	struct mtx mtx;
64 };
65 #define FWIP_LOCK(fwip)   mtx_lock(&(fwip)->mtx)
66 #define FWIP_UNLOCK(fwip) mtx_unlock(&(fwip)->mtx)
67 #endif /* !_NET_IF_FWIPVAR_H_ */
68