Index: sys/dev/ieee1394/files.ieee1394 =================================================================== RCS file: /cvsroot/syssrc/sys/dev/ieee1394/files.ieee1394,v retrieving revision 1.5 diff -c -r1.5 files.ieee1394 *** sys/dev/ieee1394/files.ieee1394 2001/05/13 14:01:43 1.5 --- sys/dev/ieee1394/files.ieee1394 2001/10/22 21:45:20 *************** *** 18,20 **** --- 18,25 ---- attach fw at fwbus file dev/ieee1394/if_fw.c fw + + # isochronous pseudo device for IEEE 1394, i.LINK or FireWire + defpseudo fwiso: ieee1394 + file dev/ieee1394/fwiso.c fwiso needs-count + Index: sys/dev/ieee1394/fwohci.c =================================================================== RCS file: /cvsroot/syssrc/sys/dev/ieee1394/fwohci.c,v retrieving revision 1.43 diff -c -r1.43 fwohci.c *** sys/dev/ieee1394/fwohci.c 2001/09/18 16:11:00 1.43 --- sys/dev/ieee1394/fwohci.c 2001/10/22 22:04:04 *************** *** 51,56 **** --- 51,57 ---- */ #include "opt_inet.h" + #include "fwiso.h" #include #include *************** *** 77,82 **** --- 78,84 ---- #include #include + #include static const char * const ieee1394_speeds[] = { IEEE1394_SPD_STRINGS }; *************** *** 155,164 **** --- 157,170 ---- void (*)(struct device *, struct mbuf *)); static int fwohci_if_input(struct fwohci_softc *, void *, struct fwohci_pkt *); static int fwohci_if_input_iso(struct fwohci_softc *, void *, struct fwohci_pkt *); + static int fwohci_dev_input_iso(struct fwohci_softc *, void *, struct fwohci_pkt *); + static int fwohci_if_output(struct device *, struct mbuf *, void (*)(struct device *, struct mbuf *)); static int fwohci_if_setiso(struct device *, u_int32_t, u_int32_t, u_int32_t, void (*)(struct device *, struct mbuf *)); + static int fwohci_dev_setiso(struct device *, u_int32_t, u_int32_t, u_int32_t, + void (*)(void *, struct uio *), void *); static int fwohci_read(struct ieee1394_abuf *); static int fwohci_write(struct ieee1394_abuf *); static int fwohci_read_resp(struct fwohci_softc *, void *, struct fwohci_pkt *); *************** *** 306,311 **** --- 312,352 ---- return retval; } + static int + fwohci_dev_setiso(struct device *self, u_int32_t channel, u_int32_t tag, + u_int32_t direction, void (*handler)(void *, struct uio *), void *arg) + { + struct fwohci_softc *sc = (struct fwohci_softc *)self; + int retval; + int s; + + if (direction == 1) { + return EIO; + } + + s = splnet(); + if (handler != NULL) { + retval = fwohci_handler_set(sc, IEEE1394_TCODE_STREAM_DATA, + channel, tag, fwohci_dev_input_iso, handler); + } else { + retval = fwohci_handler_set(sc, IEEE1394_TCODE_STREAM_DATA, + channel, tag, NULL, NULL); + } + splx(s); + + if (!retval) { + printf("%s: dev iso handler set\n", + sc->sc_sc1394.sc1394_dev.dv_xname); + } else { + printf("%s: dev iso handler cannot set\n", + sc->sc_sc1394.sc1394_dev.dv_xname); + } + + sc->sc_sc1394.sc1394_isoarg = arg; /* XXX */ + + return retval; + } + int fwohci_intr(void *arg) { *************** *** 463,468 **** --- 504,510 ---- sc->sc_sc1394.sc1394_ifinreg = fwohci_if_inreg; sc->sc_sc1394.sc1394_ifoutput = fwohci_if_output; sc->sc_sc1394.sc1394_ifsetiso = fwohci_if_setiso; + sc->sc_sc1394.sc1394_devsetiso = fwohci_dev_setiso; /* * establish hooks for shutdown and suspend/resume *************** *** 473,478 **** --- 515,524 ---- sc->sc_sc1394.sc1394_if = config_found(&sc->sc_sc1394.sc1394_dev, "fw", fwohci_print); + #ifdef NFWISO + fwiso_register_if(&sc->sc_sc1394); + #endif + /* Main loop. It's not coming back normally. */ fwohci_event_thread(sc); *************** *** 3066,3071 **** --- 3112,3149 ---- m_freem(m0); } return error; + } + + static int + fwohci_dev_input_iso(struct fwohci_softc *sc, void *arg, struct fwohci_pkt *pkt) + { + void (*handler)(void *, struct uio *) = arg; + #ifdef FW_DEBUG + int chan, tag; + int i; + #endif + + #ifdef FW_DEBUG + chan = (pkt->fp_hdr[0] & 0x00003f00) >> 8; + tag = (pkt->fp_hdr[0] & 0x0000c000) >> 14; + DPRINTFN(1, ("fwohci_dev_input_iso: " + "tcode=0x%x, chan=%d, tag=%x, dlen=%d", + pkt->fp_tcode, chan, tag, pkt->fp_dlen)); + for (i = 0; i < pkt->fp_hlen/4; i++) + DPRINTFN(2, ("%s%08x", i?" ":"\n\t", pkt->fp_hdr[i])); + DPRINTFN(2, ("$")); + for (n = 0, len = pkt->fp_dlen; len > 0; len -= i, n++){ + iov = &pkt->fp_iov[n]; + for (i = 0; i < iov->iov_len; i++) + DPRINTFN(2, ("%s%02x", + (i%32)?((i%4)?"":" "):"\n\t", + ((u_int8_t *)iov->iov_base)[i])); + DPRINTFN(2, ("$")); + } + DPRINTFN(2, ("\n")); + #endif /* FW_DEBUG */ + (*handler)(sc->sc_sc1394.sc1394_isoarg, &pkt->fp_uio); + return IEEE1394_RCODE_COMPLETE; } /* Index: sys/dev/ieee1394/fwohcivar.h =================================================================== RCS file: /cvsroot/syssrc/sys/dev/ieee1394/fwohcivar.h,v retrieving revision 1.15 diff -c -r1.15 fwohcivar.h *** sys/dev/ieee1394/fwohcivar.h 2001/07/17 20:01:04 1.15 --- sys/dev/ieee1394/fwohcivar.h 2001/10/22 21:56:18 *************** *** 50,56 **** #define OHCI_BUF_ARRS_CNT 8 #define OHCI_BUF_ATRQ_CNT (8*8) #define OHCI_BUF_ATRS_CNT (8*8) ! #define OHCI_BUF_IR_CNT 8 #define OHCI_BUF_CNT \ (OHCI_BUF_ARRQ_CNT + OHCI_BUF_ARRS_CNT + OHCI_BUF_ATRQ_CNT + \ OHCI_BUF_ATRS_CNT + OHCI_BUF_IR_CNT + 1 + 1) --- 50,56 ---- #define OHCI_BUF_ARRS_CNT 8 #define OHCI_BUF_ATRQ_CNT (8*8) #define OHCI_BUF_ATRS_CNT (8*8) ! #define OHCI_BUF_IR_CNT 24 #define OHCI_BUF_CNT \ (OHCI_BUF_ARRQ_CNT + OHCI_BUF_ARRS_CNT + OHCI_BUF_ATRQ_CNT + \ OHCI_BUF_ATRS_CNT + OHCI_BUF_IR_CNT + 1 + 1) Index: sys/dev/ieee1394/ieee1394var.h =================================================================== RCS file: /cvsroot/syssrc/sys/dev/ieee1394/ieee1394var.h,v retrieving revision 1.13 diff -c -r1.13 ieee1394var.h *** sys/dev/ieee1394/ieee1394var.h 2001/07/18 11:59:54 1.13 --- sys/dev/ieee1394/ieee1394var.h 2001/10/22 22:05:18 *************** *** 80,86 **** struct ieee1394_softc { struct device sc1394_dev; struct device *sc1394_if; /* Move to fwohci level. */ ! const struct ieee1394_callbacks sc1394_callback; /* Nuke probably. */ u_int32_t *sc1394_configrom; u_int32_t sc1394_configrom_len; /* quadlets. */ --- 80,88 ---- struct ieee1394_softc { struct device sc1394_dev; struct device *sc1394_if; /* Move to fwohci level. */ ! struct device *sc1394_iso; /* Move to fwohci level. */ ! void *sc1394_isoarg; /* XXX */ ! const struct ieee1394_callbacks sc1394_callback; /* Nuke probably. */ u_int32_t *sc1394_configrom; u_int32_t sc1394_configrom_len; /* quadlets. */ *************** *** 95,101 **** void (*)(struct device *, struct mbuf *)); /* Nuke */ int (*sc1394_ifsetiso)(struct device *, u_int32_t, u_int32_t, u_int32_t, void (*)(struct device *, struct mbuf *)); /* Nuke */ ! LIST_ENTRY(ieee1394_softc) sc1394_node; }; --- 97,105 ---- void (*)(struct device *, struct mbuf *)); /* Nuke */ int (*sc1394_ifsetiso)(struct device *, u_int32_t, u_int32_t, u_int32_t, void (*)(struct device *, struct mbuf *)); /* Nuke */ ! int (*sc1394_devsetiso)(struct device *, u_int32_t, u_int32_t, ! u_int32_t, void (*)(void *, struct uio *), void *); /* Nuke */ ! LIST_ENTRY(ieee1394_softc) sc1394_node; }; Index: sys/conf/files =================================================================== RCS file: /cvsroot/syssrc/sys/conf/files,v retrieving revision 1.463 diff -c -r1.463 files *** sys/conf/files 2001/09/25 06:01:05 1.463 --- sys/conf/files 2001/10/27 14:58:15 *************** *** 169,174 **** --- 169,175 ---- define ether define fddi define hippi + define ieee1394 define token define sppp define wlan *************** *** 503,509 **** define tcbus { } # TurboChannel attachment define mcabus { } # MicroChannel attachment define usbus { } # USB attachment ! define fwbus { } # IEEE 1394 attachment define vmebus { } # VME bus attachment define pcmciabus { [controller = -1], [socket = -1]} # PCMCIA bus attachment define cbbus {[slot = -1]} # CardBus attachment --- 504,510 ---- define tcbus { } # TurboChannel attachment define mcabus { } # MicroChannel attachment define usbus { } # USB attachment ! define fwbus {[idhi=-1],[idlo=-1]} # IEEE 1394 attachment define vmebus { } # VME bus attachment define pcmciabus { [controller = -1], [socket = -1]} # PCMCIA bus attachment define cbbus {[slot = -1]} # CardBus attachment *************** *** 522,528 **** # OHCI IEEE 1394 controller # (This needs to be here since it will have both PCI and CardBus attachments) device fwohci: fwbus ! file dev/ieee1394/fwohci.c fwohci needs-flag # legitimate pseudo-devices defpseudo vnd: disk --- 523,530 ---- # OHCI IEEE 1394 controller # (This needs to be here since it will have both PCI and CardBus attachments) device fwohci: fwbus ! device fwlynx: fwbus ! #file dev/ieee1394/fwohci.c fwohci needs-flag # legitimate pseudo-devices defpseudo vnd: disk *************** *** 831,836 **** --- 833,839 ---- file net/if_gre.c gre needs-count file net/if_hif.c hif needs-count file net/if_hippisubr.c hippi needs-flag + file net/if_ieee1394subr.c ieee1394 file net/if_loop.c loop needs-count file net/if_media.c file net/if_ppp.c ppp needs-count *************** *** 884,889 **** --- 887,893 ---- file netccitt/pk_usrreq.c ccitt file netinet/fil.c ipfilter file netinet/if_arp.c arp | netatalk needs-flag + file netinet/if_ieee1394arp.c arp & ieee1394 & inet file netinet/if_atm.c atm file netinet/igmp.c inet file netinet/in.c inet Index: sys/arch/i386/i386/conf.c =================================================================== RCS file: /cvsroot/syssrc/sys/arch/i386/i386/conf.c,v retrieving revision 1.147 diff -c -r1.147 conf.c *** sys/arch/i386/i386/conf.c 2001/07/23 14:07:09 1.147 --- sys/arch/i386/i386/conf.c 2001/10/27 15:00:55 *************** *** 240,245 **** --- 240,248 ---- cdev_decl(scsibus); #include "bktr.h" + #include "fwiso.h" + cdev_decl(fwiso); + #ifdef __I4B_IS_INTEGRATED /* open, close, ioctl */ #define cdev_i4bctl_init(c,n) { \ *************** *** 393,398 **** --- 396,402 ---- #ifdef ALTQ cdev_notdef(), /* 75: ALTQ */ #endif + cdev__ocri_init(NFWISO,fwiso), /* 76: Firewire iso */ }; int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]); *************** *** 509,514 **** --- 513,520 ---- /* 72 */ NODEV, /* 73 */ NODEV, /* 74 */ NODEV, + /* 75 */ NODEV, + /* 76 */ NODEV, }; /* Index: sys/sys/conf.h =================================================================== RCS file: /cvsroot/syssrc/sys/sys/conf.h,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 conf.h *** sys/sys/conf.h 2001/05/24 07:13:00 1.1.1.1 --- sys/sys/conf.h 2001/10/27 15:03:14 *************** *** 71,76 **** --- 71,77 ---- #define dev_decl(n,t) __CONCAT(dev_type_,t)(__CONCAT(n,t)) #define dev_init(c,n,t) \ ((c) > 0 ? __CONCAT(n,t) : (__CONCAT(dev_type_,t)((*))) enxio) + #define dev_noimpl(t,f) (__CONCAT(dev_type_,t)((*)))f #endif /* _KERNEL */ *************** *** 181,186 **** --- 182,193 ---- dev_decl(n,open); dev_decl(n,close); dev_decl(n,read); \ dev_decl(n,write); dev_decl(n,ioctl); dev_decl(n,stop); \ dev_decl(n,tty); dev_decl(n,poll); dev_decl(n,mmap) + + /* open, close, read, ioctl */ + #define cdev__ocri_init(c,n) { \ + dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \ + dev_noimpl(write,enodev), dev_init(c,n,ioctl), \ + dev_noimpl(stop,enodev), 0, seltrue, dev_noimpl(mmap,enodev), 0 } /* open, close, read, write, ioctl */ #define cdev_disk_init(c,n) { \ Index: sys/sys/malloc.h =================================================================== RCS file: /cvsroot/syssrc/sys/sys/malloc.h,v retrieving revision 1.2 diff -c -r1.2 malloc.h *** sys/sys/malloc.h 2001/05/24 08:45:32 1.2 --- sys/sys/malloc.h 2001/10/27 15:03:15 *************** *** 175,181 **** #define M_SOFTINTR 114 /* Softinterrupt structures */ #define M_NATPT 115 /* Network Address Translation - Protocol Translation */ #define M_LIN6 116 /* LIN6 */ ! #define M_LAST 117 /* Must be last type + 1 */ #define INITKMEMNAMES { \ "free", /* 0 M_FREE */ \ --- 175,183 ---- #define M_SOFTINTR 114 /* Softinterrupt structures */ #define M_NATPT 115 /* Network Address Translation - Protocol Translation */ #define M_LIN6 116 /* LIN6 */ ! #define M_1394CTL 117 /* IEEE 1394 control structures */ ! #define M_1394DATA 118 /* IEEE 1394 data buffers */ ! #define M_LAST 119 /* Must be last type + 1 */ #define INITKMEMNAMES { \ "free", /* 0 M_FREE */ \ *************** *** 295,300 **** --- 297,304 ---- "softintr", /* 114 M_SOFTINTR */ \ "natpt", /* 115 M_NATPT */ \ "lin6sock", /* 116 M_LIN6 */ \ + "1394ctl", /* 116 M_1394CTL */ \ + "1394data", /* 117 M_1394DATA */ \ NULL, /* 117 */ \ } Index: sys/dev/ieee1394/Makefile =================================================================== RCS file: /cvsroot/syssrc/sys/dev/ieee1394/Makefile,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 Makefile *** sys/dev/ieee1394/Makefile 2001/05/24 07:12:07 1.1.1.1 --- sys/dev/ieee1394/Makefile 2001/10/27 15:06:56 *************** *** 2,7 **** INCSDIR= /usr/include/dev/ieee1394 ! INCS= ieee1394reg.h .include --- 2,7 ---- INCSDIR= /usr/include/dev/ieee1394 ! INCS= ieee1394reg.h fwiso_ioctl.h .include Index: sys/dev/pci/fwohci_pci.c =================================================================== RCS file: /cvsroot/syssrc/sys/dev/pci/fwohci_pci.c,v retrieving revision 1.10 diff -c -r1.10 fwohci_pci.c *** sys/dev/pci/fwohci_pci.c 2001/05/01 14:10:30 1.10 --- sys/dev/pci/fwohci_pci.c 2001/10/22 23:06:11 *************** *** 121,127 **** #endif /* Map and establish the interrupt. */ ! if (pci_intr_map(pa, &ih)) { printf("%s: couldn't map interrupt\n", self->dv_xname); return; } --- 121,128 ---- #endif /* Map and establish the interrupt. */ ! if (pci_intr_map(pa->pa_pc, pa->pa_intrtag, pa->pa_intrpin, ! pa->pa_intrline, &ih)) { printf("%s: couldn't map interrupt\n", self->dv_xname); return; } Index: sys/dev/DEVNAMES =================================================================== RCS file: /cvsroot/syssrc/sys/dev/DEVNAMES,v retrieving revision 1.1.1.2 diff -c -r1.1.1.2 DEVNAMES *** sys/dev/DEVNAMES 2001/07/23 14:09:47 1.1.1.2 --- sys/dev/DEVNAMES 2001/10/27 15:35:15 *************** *** 296,301 **** --- 296,306 ---- fpu mac68k frodo hp300 fta MI + fw MI + fwbus MI Attribute + fwlynx MI + fwnode MI + fwohci MI fxp MI gayle amiga Attribute gbox hp300 *************** *** 361,366 **** --- 366,372 ---- ie MI ie arm32 ie sun3 + ieee1394 MI iic arm32 ik vax inphy MI Index: sys/dev/pci/files.pci =================================================================== RCS file: /cvsroot/syssrc/sys/dev/pci/files.pci,v retrieving revision 1.1.1.2 diff -c -r1.1.1.2 files.pci *** sys/dev/pci/files.pci 2001/07/23 14:10:21 1.1.1.2 --- sys/dev/pci/files.pci 2001/10/27 15:37:07 *************** *** 313,318 **** --- 313,322 ---- attach fwohci at pci with fwohci_pci file dev/pci/fwohci_pci.c fwohci_pci + # IEEE 1394 TI "Lynx" controller + attach fwlynx at pci with fwlynx_pci + file dev/pci/fwlynx_pci.c fwlynx_pci + # VIA Rhine/Rhine II Fast Ethernet controllers device vr: ether, ifnet, arp, mii, mii_bitbang attach vr at pci Index: sys/arch/i386/conf/files.i386 =================================================================== RCS file: /cvsroot/syssrc/sys/arch/i386/conf/files.i386,v retrieving revision 1.1.1.3 diff -c -r1.1.1.3 files.i386 *** sys/arch/i386/confi/files.i386 2001/09/25 05:16:46 1.1.1.3 --- sys/arch/i386/confi/files.i386 2001/10/27 15:52:51 *************** *** 387,390 **** --- 387,392 ---- include "dev/usb/files.usb" + include "dev/ieee1394/files.ieee1394" + include "arch/i386/pnpbios/files.pnpbios" Index: sys/net/if_ieee1394subr.c =================================================================== RCS file: /cvsroot/syssrc/sys/net/if_ieee1394subr.c,v retrieving revision 1.11 diff -c -r1.11 if_ieee1394subr.c *** sys/net/if_ieee1394subr.c 2001/06/14 14:44:24 1.11 --- sys/net/if_ieee1394subr.c 2001/10/22 22:30:32 *************** *** 637,643 **** --- 637,645 ---- ifp->if_type = IFT_IEEE1394; ifp->if_addrlen = sizeof(struct ieee1394_hwaddr); ifp->if_hdrlen = sizeof(struct ieee1394_header); + #if defined(__NetBSD__) && __NetBSD_Version__ >= 105001000 ifp->if_dlt = DLT_EN10MB; /* XXX */ + #endif ifp->if_mtu = IEEE1394MTU; ifp->if_output = ieee1394_output; ifp->if_input = ieee1394_input; *************** *** 647,653 **** --- 649,657 ---- if (ifp->if_baudrate == 0) ifp->if_baudrate = IF_Mbps(100); + #if defined(__NetBSD__) && __NetBSD_Version__ >= 105001000 if_alloc_sadl(ifp); + #endif memcpy(LLADDR(ifp->if_sadl), hwaddr, ifp->if_addrlen); ifp->if_broadcastaddr = malloc(ifp->if_addrlen, M_DEVBUF, M_WAITOK); *************** *** 657,664 **** baddr->iha_maxrec = 512 << baddr->iha_speed; memset(baddr->iha_offset, 0, sizeof(baddr->iha_offset)); LIST_INIT(&ic->ic_reassq); ! #if NBPFILTER > 0 bpfattach(ifp, DLT_EN10MB, 14); /* XXX */ #endif } --- 661,672 ---- baddr->iha_maxrec = 512 << baddr->iha_speed; memset(baddr->iha_offset, 0, sizeof(baddr->iha_offset)); LIST_INIT(&ic->ic_reassq); ! #if NBPFILTER > 0 ! #if defined(HAVE_OLD_BPF) || (defined(__NetBSD__) && __NetBSD_Version__ >= 105001000) bpfattach(ifp, DLT_EN10MB, 14); /* XXX */ + #else + bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB, 14); + #endif #endif } *************** *** 671,677 **** --- 679,687 ---- #endif free(ifp->if_broadcastaddr, M_DEVBUF); ifp->if_broadcastaddr = NULL; + #if defined(__NetBSD__) && __NetBSD_Version__ >= 105001000 if_free_sadl(ifp); + #endif } int Index: sys/netinet/if_ieee1394arp.c =================================================================== RCS file: /cvsroot/syssrc/sys/netinet/if_ieee1394arp.c,v retrieving revision 1.5 diff -c -r1.5 files.ieee1394 *** sys/netinet/if_ieee1394arp.c 2001/06/04 11:29:59 1.5 --- sys/netinet/if_ieee1394arp.c 2001/10/22 22:32:27 *************** *** 124,130 **** * Use splvm() -- we're blocking things that would cause * mbuf allocation. */ ! s = splvm(); if (!recurse && arp_locked) { splx(s); return 0; --- 124,130 ---- * Use splvm() -- we're blocking things that would cause * mbuf allocation. */ ! s = splimp(); if (!recurse && arp_locked) { splx(s); return 0; *************** *** 139,145 **** { int s; ! s = splvm(); arp_locked--; splx(s); } --- 139,145 ---- { int s; ! s = splimp(); arp_locked--; splx(s); }