1098ca2bdSWarner Losh /*- 2*718cf2ccSPedro F. Giffuni * SPDX-License-Identifier: BSD-4-Clause 3*718cf2ccSPedro F. Giffuni * 477ee030bSHidetoshi Shimokawa * Copyright (c) 2003 Hidetoshi Shimokawa 53c60ba66SKatsushi Kobayashi * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa 63c60ba66SKatsushi Kobayashi * All rights reserved. 73c60ba66SKatsushi Kobayashi * 83c60ba66SKatsushi Kobayashi * Redistribution and use in source and binary forms, with or without 93c60ba66SKatsushi Kobayashi * modification, are permitted provided that the following conditions 103c60ba66SKatsushi Kobayashi * are met: 113c60ba66SKatsushi Kobayashi * 1. Redistributions of source code must retain the above copyright 123c60ba66SKatsushi Kobayashi * notice, this list of conditions and the following disclaimer. 133c60ba66SKatsushi Kobayashi * 2. Redistributions in binary form must reproduce the above copyright 143c60ba66SKatsushi Kobayashi * notice, this list of conditions and the following disclaimer in the 153c60ba66SKatsushi Kobayashi * documentation and/or other materials provided with the distribution. 163c60ba66SKatsushi Kobayashi * 3. All advertising materials mentioning features or use of this software 173c60ba66SKatsushi Kobayashi * must display the acknowledgement as bellow: 183c60ba66SKatsushi Kobayashi * 193c60ba66SKatsushi Kobayashi * This product includes software developed by K. Kobayashi and H. Shimokawa 203c60ba66SKatsushi Kobayashi * 213c60ba66SKatsushi Kobayashi * 4. The name of the author may not be used to endorse or promote products 223c60ba66SKatsushi Kobayashi * derived from this software without specific prior written permission. 233c60ba66SKatsushi Kobayashi * 243c60ba66SKatsushi Kobayashi * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 253c60ba66SKatsushi Kobayashi * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 263c60ba66SKatsushi Kobayashi * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 273c60ba66SKatsushi Kobayashi * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 283c60ba66SKatsushi Kobayashi * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 293c60ba66SKatsushi Kobayashi * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 303c60ba66SKatsushi Kobayashi * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 313c60ba66SKatsushi Kobayashi * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 323c60ba66SKatsushi Kobayashi * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 333c60ba66SKatsushi Kobayashi * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 343c60ba66SKatsushi Kobayashi * POSSIBILITY OF SUCH DAMAGE. 353c60ba66SKatsushi Kobayashi * 363c60ba66SKatsushi Kobayashi */ 373c60ba66SKatsushi Kobayashi 383c60ba66SKatsushi Kobayashi typedef struct thread fw_proc; 393c60ba66SKatsushi Kobayashi #include <sys/selinfo.h> 403c60ba66SKatsushi Kobayashi 4177ee030bSHidetoshi Shimokawa #include <sys/uio.h> 429950b741SHidetoshi Shimokawa #include <sys/mutex.h> 439950b741SHidetoshi Shimokawa #include <sys/taskqueue.h> 4477ee030bSHidetoshi Shimokawa 453c60ba66SKatsushi Kobayashi #define splfw splimp 463c60ba66SKatsushi Kobayashi 470892f4c5SHidetoshi Shimokawa STAILQ_HEAD(fw_xferlist, fw_xfer); 480892f4c5SHidetoshi Shimokawa 493c60ba66SKatsushi Kobayashi struct fw_device { 5003161bbcSDoug Rabson uint16_t dst; 513c60ba66SKatsushi Kobayashi struct fw_eui64 eui; 5203161bbcSDoug Rabson uint8_t speed; 5303161bbcSDoug Rabson uint8_t maxrec; 5403161bbcSDoug Rabson uint8_t nport; 5503161bbcSDoug Rabson uint8_t power; 563c60ba66SKatsushi Kobayashi #define CSRROMOFF 0x400 573c60ba66SKatsushi Kobayashi #define CSRROMSIZE 0x400 583c60ba66SKatsushi Kobayashi int rommax; /* offset from 0xffff f000 0000 */ 5903161bbcSDoug Rabson uint32_t csrrom[CSRROMSIZE / 4]; 603c60ba66SKatsushi Kobayashi int rcnt; 61f90ce7b1SHidetoshi Shimokawa struct firewire_comm *fc; 6203161bbcSDoug Rabson uint32_t status; 633c60ba66SKatsushi Kobayashi #define FWDEVINIT 1 643c60ba66SKatsushi Kobayashi #define FWDEVATTACHED 2 653c60ba66SKatsushi Kobayashi #define FWDEVINVAL 3 660981f5f0SHidetoshi Shimokawa STAILQ_ENTRY(fw_device) link; 673c60ba66SKatsushi Kobayashi }; 6893001c72SHidetoshi Shimokawa 693c60ba66SKatsushi Kobayashi struct firewire_softc { 7089c9c53dSPoul-Henning Kamp struct cdev *dev; 713c60ba66SKatsushi Kobayashi struct firewire_comm *fc; 723c60ba66SKatsushi Kobayashi }; 7393001c72SHidetoshi Shimokawa 743c60ba66SKatsushi Kobayashi #define FW_MAX_DMACH 0x20 753c60ba66SKatsushi Kobayashi #define FW_MAX_DEVCH FW_MAX_DMACH 763c60ba66SKatsushi Kobayashi #define FW_XFERTIMEOUT 1 7793001c72SHidetoshi Shimokawa 783c60ba66SKatsushi Kobayashi struct firewire_dev_comm { 793c60ba66SKatsushi Kobayashi device_t dev; 803c60ba66SKatsushi Kobayashi struct firewire_comm *fc; 81d09a5d6fSHidetoshi Shimokawa void (*post_busreset) (void *); 82d09a5d6fSHidetoshi Shimokawa void (*post_explore) (void *); 833c60ba66SKatsushi Kobayashi }; 843c60ba66SKatsushi Kobayashi 853c60ba66SKatsushi Kobayashi struct tcode_info { 863c60ba66SKatsushi Kobayashi u_char hdr_len; /* IEEE1394 header length */ 873c60ba66SKatsushi Kobayashi u_char flag; 883c60ba66SKatsushi Kobayashi #define FWTI_REQ (1 << 0) 893c60ba66SKatsushi Kobayashi #define FWTI_RES (1 << 1) 903c60ba66SKatsushi Kobayashi #define FWTI_TLABEL (1 << 2) 913c60ba66SKatsushi Kobayashi #define FWTI_BLOCK_STR (1 << 3) 923c60ba66SKatsushi Kobayashi #define FWTI_BLOCK_ASY (1 << 4) 939950b741SHidetoshi Shimokawa u_char valid_res; 943c60ba66SKatsushi Kobayashi }; 953c60ba66SKatsushi Kobayashi 963c60ba66SKatsushi Kobayashi struct firewire_comm { 973c60ba66SKatsushi Kobayashi device_t dev; 983c60ba66SKatsushi Kobayashi device_t bdev; 9903161bbcSDoug Rabson uint16_t busid:10, 1003c60ba66SKatsushi Kobayashi nodeid:6; 1013c60ba66SKatsushi Kobayashi u_int mode; 1023c60ba66SKatsushi Kobayashi u_int nport; 1033c60ba66SKatsushi Kobayashi u_int speed; 1043c60ba66SKatsushi Kobayashi u_int maxrec; 1053c60ba66SKatsushi Kobayashi u_int irm; 1063c60ba66SKatsushi Kobayashi u_int max_node; 1073c60ba66SKatsushi Kobayashi u_int max_hop; 1083c60ba66SKatsushi Kobayashi #define FWPHYASYST (1 << 0) 10903161bbcSDoug Rabson uint32_t status; 1109404513cSHidetoshi Shimokawa #define FWBUSDETACH (-2) 111630529adSHidetoshi Shimokawa #define FWBUSNOTREADY (-1) 1123c60ba66SKatsushi Kobayashi #define FWBUSRESET 0 1133c60ba66SKatsushi Kobayashi #define FWBUSINIT 1 1143c60ba66SKatsushi Kobayashi #define FWBUSCYMELECT 2 1153c60ba66SKatsushi Kobayashi #define FWBUSMGRELECT 3 1163c60ba66SKatsushi Kobayashi #define FWBUSMGRDONE 4 1173c60ba66SKatsushi Kobayashi #define FWBUSEXPLORE 5 1183c60ba66SKatsushi Kobayashi #define FWBUSPHYCONF 6 1193c60ba66SKatsushi Kobayashi #define FWBUSEXPDONE 7 1203c60ba66SKatsushi Kobayashi #define FWBUSCOMPLETION 10 1213c60ba66SKatsushi Kobayashi int nisodma; 122c547b896SHidetoshi Shimokawa struct fw_eui64 eui; 12393001c72SHidetoshi Shimokawa struct fw_xferq 12493001c72SHidetoshi Shimokawa *arq, *atq, *ars, *ats, *it[FW_MAX_DMACH],*ir[FW_MAX_DMACH]; 1250892f4c5SHidetoshi Shimokawa struct fw_xferlist tlabels[0x40]; 126f0441453SHidetoshi Shimokawa u_char last_tlabel[0x40]; 127b0f99fbdSHidetoshi Shimokawa struct mtx tlabel_lock; 12893001c72SHidetoshi Shimokawa STAILQ_HEAD(, fw_bind) binds; 1290981f5f0SHidetoshi Shimokawa STAILQ_HEAD(, fw_device) devices; 13093001c72SHidetoshi Shimokawa u_int sid_cnt; 13193001c72SHidetoshi Shimokawa #define CSRSIZE 0x4000 13203161bbcSDoug Rabson uint32_t csr_arc[CSRSIZE / 4]; 13393001c72SHidetoshi Shimokawa #define CROMSIZE 0x400 13403161bbcSDoug Rabson uint32_t *config_rom; 1350bc666e0SHidetoshi Shimokawa struct crom_src_buf *crom_src_buf; 1360bc666e0SHidetoshi Shimokawa struct crom_src *crom_src; 1370bc666e0SHidetoshi Shimokawa struct crom_chunk *crom_root; 13893001c72SHidetoshi Shimokawa struct fw_topology_map *topology_map; 13993001c72SHidetoshi Shimokawa struct fw_speed_map *speed_map; 14093001c72SHidetoshi Shimokawa struct callout busprobe_callout; 1410981f5f0SHidetoshi Shimokawa struct callout bmr_callout; 1420981f5f0SHidetoshi Shimokawa struct callout timeout_callout; 1439950b741SHidetoshi Shimokawa struct task task_timeout; 14403161bbcSDoug Rabson uint32_t (*cyctimer) (struct firewire_comm *); 145d09a5d6fSHidetoshi Shimokawa void (*ibr) (struct firewire_comm *); 14603161bbcSDoug Rabson uint32_t (*set_bmr) (struct firewire_comm *, uint32_t); 14789c9c53dSPoul-Henning Kamp int (*ioctl) (struct cdev *, u_long, caddr_t, int, fw_proc *); 148d09a5d6fSHidetoshi Shimokawa int (*irx_enable) (struct firewire_comm *, int); 149d09a5d6fSHidetoshi Shimokawa int (*irx_disable) (struct firewire_comm *, int); 150d09a5d6fSHidetoshi Shimokawa int (*itx_enable) (struct firewire_comm *, int); 151d09a5d6fSHidetoshi Shimokawa int (*itx_disable) (struct firewire_comm *, int); 152d09a5d6fSHidetoshi Shimokawa void (*timeout) (void *); 153d09a5d6fSHidetoshi Shimokawa void (*poll) (struct firewire_comm *, int, int); 154d09a5d6fSHidetoshi Shimokawa void (*set_intr) (struct firewire_comm *, int); 15503161bbcSDoug Rabson void (*irx_post) (struct firewire_comm *, uint32_t *); 15603161bbcSDoug Rabson void (*itx_post) (struct firewire_comm *, uint32_t *); 15793001c72SHidetoshi Shimokawa struct tcode_info *tcode; 15877ee030bSHidetoshi Shimokawa bus_dma_tag_t dmat; 1599950b741SHidetoshi Shimokawa struct mtx mtx; 1609950b741SHidetoshi Shimokawa struct mtx wait_lock; 1619950b741SHidetoshi Shimokawa struct taskqueue *taskqueue; 1629950b741SHidetoshi Shimokawa struct proc *probe_thread; 16393001c72SHidetoshi Shimokawa }; 16493001c72SHidetoshi Shimokawa #define CSRARC(sc, offset) ((sc)->csr_arc[(offset) / 4]) 16593001c72SHidetoshi Shimokawa 1669950b741SHidetoshi Shimokawa #define FW_GMTX(fc) (&(fc)->mtx) 1679950b741SHidetoshi Shimokawa #define FW_GLOCK(fc) mtx_lock(FW_GMTX(fc)) 1689950b741SHidetoshi Shimokawa #define FW_GUNLOCK(fc) mtx_unlock(FW_GMTX(fc)) 1699950b741SHidetoshi Shimokawa #define FW_GLOCK_ASSERT(fc) mtx_assert(FW_GMTX(fc), MA_OWNED) 1709950b741SHidetoshi Shimokawa 1713c60ba66SKatsushi Kobayashi struct fw_xferq { 1723c60ba66SKatsushi Kobayashi int flag; 1733c60ba66SKatsushi Kobayashi #define FWXFERQ_CHTAGMASK 0xff 1743c60ba66SKatsushi Kobayashi #define FWXFERQ_RUNNING (1 << 8) 1753c60ba66SKatsushi Kobayashi #define FWXFERQ_STREAM (1 << 9) 1763c60ba66SKatsushi Kobayashi 1773c60ba66SKatsushi Kobayashi #define FWXFERQ_BULK (1 << 11) 1783c60ba66SKatsushi Kobayashi #define FWXFERQ_MODEMASK (7 << 10) 1793c60ba66SKatsushi Kobayashi 1803c60ba66SKatsushi Kobayashi #define FWXFERQ_EXTBUF (1 << 13) 1813c60ba66SKatsushi Kobayashi #define FWXFERQ_OPEN (1 << 14) 1823c60ba66SKatsushi Kobayashi 1833c60ba66SKatsushi Kobayashi #define FWXFERQ_HANDLER (1 << 16) 1843c60ba66SKatsushi Kobayashi #define FWXFERQ_WAKEUP (1 << 17) 185d09a5d6fSHidetoshi Shimokawa void (*start) (struct firewire_comm *); 1866cada79aSHidetoshi Shimokawa int dmach; 1870892f4c5SHidetoshi Shimokawa struct fw_xferlist q; 1883c60ba66SKatsushi Kobayashi u_int queued; 1893c60ba66SKatsushi Kobayashi u_int maxq; 1903c60ba66SKatsushi Kobayashi u_int psize; 19177ee030bSHidetoshi Shimokawa struct fwdma_alloc_multi *buf; 1923c60ba66SKatsushi Kobayashi u_int bnchunk; 1933c60ba66SKatsushi Kobayashi u_int bnpacket; 1943c60ba66SKatsushi Kobayashi struct fw_bulkxfer *bulkxfer; 1953c60ba66SKatsushi Kobayashi STAILQ_HEAD(, fw_bulkxfer) stvalid; 1963c60ba66SKatsushi Kobayashi STAILQ_HEAD(, fw_bulkxfer) stfree; 1975a7ba74dSHidetoshi Shimokawa STAILQ_HEAD(, fw_bulkxfer) stdma; 1983c60ba66SKatsushi Kobayashi struct fw_bulkxfer *stproc; 1993c60ba66SKatsushi Kobayashi struct selinfo rsel; 2003c60ba66SKatsushi Kobayashi caddr_t sc; 201d09a5d6fSHidetoshi Shimokawa void (*hand) (struct fw_xferq *); 2023c60ba66SKatsushi Kobayashi }; 20393001c72SHidetoshi Shimokawa 2043c60ba66SKatsushi Kobayashi struct fw_bulkxfer { 20577ee030bSHidetoshi Shimokawa int poffset; 2062b4601d1SHidetoshi Shimokawa struct mbuf *mbuf; 2073c60ba66SKatsushi Kobayashi STAILQ_ENTRY(fw_bulkxfer) link; 2083c60ba66SKatsushi Kobayashi caddr_t start; 2093c60ba66SKatsushi Kobayashi caddr_t end; 2102b4601d1SHidetoshi Shimokawa int resp; 2113c60ba66SKatsushi Kobayashi }; 21293001c72SHidetoshi Shimokawa 2133c60ba66SKatsushi Kobayashi struct fw_bind { 214c4778b5dSHidetoshi Shimokawa u_int64_t start; 215c4778b5dSHidetoshi Shimokawa u_int64_t end; 2160892f4c5SHidetoshi Shimokawa struct fw_xferlist xferlist; 2173c60ba66SKatsushi Kobayashi STAILQ_ENTRY(fw_bind) fclist; 2183c60ba66SKatsushi Kobayashi STAILQ_ENTRY(fw_bind) chlist; 2190892f4c5SHidetoshi Shimokawa void *sc; 2203c60ba66SKatsushi Kobayashi }; 2213c60ba66SKatsushi Kobayashi 2223c60ba66SKatsushi Kobayashi struct fw_xfer { 2233c60ba66SKatsushi Kobayashi caddr_t sc; 2243c60ba66SKatsushi Kobayashi struct firewire_comm *fc; 2253c60ba66SKatsushi Kobayashi struct fw_xferq *q; 226864d7e72SHidetoshi Shimokawa struct timeval tv; 22777ee030bSHidetoshi Shimokawa int8_t resp; 2289950b741SHidetoshi Shimokawa #define FWXF_INIT 0x00 2299950b741SHidetoshi Shimokawa #define FWXF_INQ 0x01 2309950b741SHidetoshi Shimokawa #define FWXF_START 0x02 2319950b741SHidetoshi Shimokawa #define FWXF_SENT 0x04 2329950b741SHidetoshi Shimokawa #define FWXF_SENTERR 0x08 2339950b741SHidetoshi Shimokawa #define FWXF_BUSY 0x10 2349950b741SHidetoshi Shimokawa #define FWXF_RCVD 0x20 2359950b741SHidetoshi Shimokawa 2369950b741SHidetoshi Shimokawa #define FWXF_WAKE 0x80 2379950b741SHidetoshi Shimokawa uint8_t flag; 23889cad461SHidetoshi Shimokawa int8_t tl; 239d09a5d6fSHidetoshi Shimokawa void (*hand) (struct fw_xfer *); 2403c60ba66SKatsushi Kobayashi struct { 241c4778b5dSHidetoshi Shimokawa struct fw_pkt hdr; 24203161bbcSDoug Rabson uint32_t *payload; 24303161bbcSDoug Rabson uint16_t pay_len; 24403161bbcSDoug Rabson uint8_t spd; 2453c60ba66SKatsushi Kobayashi } send, recv; 2463c60ba66SKatsushi Kobayashi struct mbuf *mbuf; 2473c60ba66SKatsushi Kobayashi STAILQ_ENTRY(fw_xfer) link; 24889cad461SHidetoshi Shimokawa STAILQ_ENTRY(fw_xfer) tlabel; 24948249fe0SHidetoshi Shimokawa struct malloc_type *malloc; 2503c60ba66SKatsushi Kobayashi }; 251c4778b5dSHidetoshi Shimokawa 252c4778b5dSHidetoshi Shimokawa struct fw_rcv_buf { 253c4778b5dSHidetoshi Shimokawa struct firewire_comm *fc; 254c4778b5dSHidetoshi Shimokawa struct fw_xfer *xfer; 255c4778b5dSHidetoshi Shimokawa struct iovec *vec; 256c4778b5dSHidetoshi Shimokawa u_int nvec; 25703161bbcSDoug Rabson uint8_t spd; 258c4778b5dSHidetoshi Shimokawa }; 259c4778b5dSHidetoshi Shimokawa 26003161bbcSDoug Rabson void fw_sidrcv (struct firewire_comm *, uint32_t *, u_int); 261d09a5d6fSHidetoshi Shimokawa void fw_rcv (struct fw_rcv_buf *); 262d09a5d6fSHidetoshi Shimokawa void fw_xfer_unload (struct fw_xfer *); 263d09a5d6fSHidetoshi Shimokawa void fw_xfer_free_buf (struct fw_xfer *); 264d09a5d6fSHidetoshi Shimokawa void fw_xfer_free (struct fw_xfer*); 265d09a5d6fSHidetoshi Shimokawa struct fw_xfer *fw_xfer_alloc (struct malloc_type *); 266d09a5d6fSHidetoshi Shimokawa struct fw_xfer *fw_xfer_alloc_buf (struct malloc_type *, int, int); 267d09a5d6fSHidetoshi Shimokawa void fw_init (struct firewire_comm *); 268d09a5d6fSHidetoshi Shimokawa int fw_tbuf_update (struct firewire_comm *, int, int); 269d09a5d6fSHidetoshi Shimokawa int fw_rbuf_update (struct firewire_comm *, int, int); 270d09a5d6fSHidetoshi Shimokawa int fw_bindadd (struct firewire_comm *, struct fw_bind *); 271d09a5d6fSHidetoshi Shimokawa int fw_bindremove (struct firewire_comm *, struct fw_bind *); 2720892f4c5SHidetoshi Shimokawa int fw_xferlist_add (struct fw_xferlist *, struct malloc_type *, int, int, int, 2730892f4c5SHidetoshi Shimokawa struct firewire_comm *, void *, void (*)(struct fw_xfer *)); 2740892f4c5SHidetoshi Shimokawa void fw_xferlist_remove (struct fw_xferlist *); 275d09a5d6fSHidetoshi Shimokawa int fw_asyreq (struct firewire_comm *, int, struct fw_xfer *); 276ad9cf506SHidetoshi Shimokawa void fw_busreset (struct firewire_comm *, uint32_t); 27703161bbcSDoug Rabson uint16_t fw_crc16 (uint32_t *, uint32_t); 278d09a5d6fSHidetoshi Shimokawa void fw_xfer_timeout (void *); 279d09a5d6fSHidetoshi Shimokawa void fw_xfer_done (struct fw_xfer *); 2809950b741SHidetoshi Shimokawa void fw_xferwake (struct fw_xfer *); 2819950b741SHidetoshi Shimokawa int fw_xferwait (struct fw_xfer *); 282d09a5d6fSHidetoshi Shimokawa void fw_asy_callback_free (struct fw_xfer *); 283d09a5d6fSHidetoshi Shimokawa struct fw_device *fw_noderesolve_nodeid (struct firewire_comm *, int); 284d09a5d6fSHidetoshi Shimokawa struct fw_device *fw_noderesolve_eui64 (struct firewire_comm *, struct fw_eui64 *); 28503161bbcSDoug Rabson struct fw_bind *fw_bindlookup (struct firewire_comm *, uint16_t, uint32_t); 286d09a5d6fSHidetoshi Shimokawa void fw_drain_txq (struct firewire_comm *); 287d09a5d6fSHidetoshi Shimokawa int fwdev_makedev (struct firewire_softc *); 288d09a5d6fSHidetoshi Shimokawa int fwdev_destroydev (struct firewire_softc *); 2896a113b3dSRobert Watson void fwdev_clone (void *, struct ucred *, char *, int, struct cdev **); 2909950b741SHidetoshi Shimokawa int fw_open_isodma(struct firewire_comm *, int); 2913c60ba66SKatsushi Kobayashi 2923c60ba66SKatsushi Kobayashi extern int firewire_debug; 2933c60ba66SKatsushi Kobayashi extern devclass_t firewire_devclass; 294ac2d2894SHidetoshi Shimokawa extern int firewire_phydma_enable; 2953c60ba66SKatsushi Kobayashi 29610d3ed64SHidetoshi Shimokawa #define FWPRI ((PZERO + 8) | PCATCH) 29745545499SHidetoshi Shimokawa 2989950b741SHidetoshi Shimokawa #define CALLOUT_INIT(x) callout_init(x, 1 /* mpsafe */) 299c4778b5dSHidetoshi Shimokawa 3005166f1dfSHidetoshi Shimokawa MALLOC_DECLARE(M_FW); 30148249fe0SHidetoshi Shimokawa MALLOC_DECLARE(M_FWXFER); 302