xref: /freebsd/sys/dev/firewire/if_fwevar.h (revision 2ff63af9b88c7413b7d71715b5532625752a248e)
1098ca2bdSWarner Losh /*-
2df57947fSPedro F. Giffuni  * SPDX-License-Identifier: BSD-4-Clause
3df57947fSPedro F. Giffuni  *
477ee030bSHidetoshi Shimokawa  * Copyright (c) 2002-2003
53c60ba66SKatsushi Kobayashi  * 	Hidetoshi Shimokawa. All rights reserved.
63c60ba66SKatsushi Kobayashi  *
73c60ba66SKatsushi Kobayashi  * Redistribution and use in source and binary forms, with or without
83c60ba66SKatsushi Kobayashi  * modification, are permitted provided that the following conditions
93c60ba66SKatsushi Kobayashi  * are met:
103c60ba66SKatsushi Kobayashi  * 1. Redistributions of source code must retain the above copyright
113c60ba66SKatsushi Kobayashi  *    notice, this list of conditions and the following disclaimer.
123c60ba66SKatsushi Kobayashi  * 2. Redistributions in binary form must reproduce the above copyright
133c60ba66SKatsushi Kobayashi  *    notice, this list of conditions and the following disclaimer in the
143c60ba66SKatsushi Kobayashi  *    documentation and/or other materials provided with the distribution.
153c60ba66SKatsushi Kobayashi  * 3. All advertising materials mentioning features or use of this software
163c60ba66SKatsushi Kobayashi  *    must display the following acknowledgement:
173c60ba66SKatsushi Kobayashi  *
183c60ba66SKatsushi Kobayashi  *	This product includes software developed by Hidetoshi Shimokawa.
193c60ba66SKatsushi Kobayashi  *
203c60ba66SKatsushi Kobayashi  * 4. Neither the name of the author nor the names of its contributors
213c60ba66SKatsushi Kobayashi  *    may be used to endorse or promote products derived from this software
223c60ba66SKatsushi Kobayashi  *    without specific prior written permission.
233c60ba66SKatsushi Kobayashi  *
243c60ba66SKatsushi Kobayashi  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
253c60ba66SKatsushi Kobayashi  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
263c60ba66SKatsushi Kobayashi  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
273c60ba66SKatsushi Kobayashi  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
283c60ba66SKatsushi Kobayashi  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
293c60ba66SKatsushi Kobayashi  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
303c60ba66SKatsushi Kobayashi  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
313c60ba66SKatsushi Kobayashi  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
323c60ba66SKatsushi Kobayashi  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
333c60ba66SKatsushi Kobayashi  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
343c60ba66SKatsushi Kobayashi  * SUCH DAMAGE.
353c60ba66SKatsushi Kobayashi  *
363c60ba66SKatsushi Kobayashi  */
373c60ba66SKatsushi Kobayashi 
383c60ba66SKatsushi Kobayashi #ifndef _NET_IF_FWEVAR_H_
393c60ba66SKatsushi Kobayashi #define _NET_IF_FWEVAR_H_
403c60ba66SKatsushi Kobayashi 
413c60ba66SKatsushi Kobayashi struct fwe_softc {
429950b741SHidetoshi Shimokawa 	/* XXX this must be the first for fd.post_explore() */
433c60ba66SKatsushi Kobayashi 	struct firewire_dev_comm fd;
443c60ba66SKatsushi Kobayashi 	short stream_ch;
453c60ba66SKatsushi Kobayashi 	short dma_ch;
463c60ba66SKatsushi Kobayashi 	struct fw_pkt pkt_hdr;
472b4601d1SHidetoshi Shimokawa 	STAILQ_HEAD(, fw_xfer) xferlist;
483c60ba66SKatsushi Kobayashi 	struct fwe_eth_softc {
49*61c05f13SJustin Hibbits 		if_t ifp;
503c60ba66SKatsushi Kobayashi 		struct fwe_softc *fwe;
513c60ba66SKatsushi Kobayashi 	} eth_softc;
529950b741SHidetoshi Shimokawa 	struct mtx mtx;
533c60ba66SKatsushi Kobayashi };
549950b741SHidetoshi Shimokawa #define FWE_LOCK(fwe)	mtx_lock(&(fwe)->mtx)
559950b741SHidetoshi Shimokawa #define FWE_UNLOCK(fwe)	mtx_unlock(&(fwe)->mtx)
563c60ba66SKatsushi Kobayashi #endif /* !_NET_IF_FWEVAR_H_ */
57