Lines Matching refs:fwe
88 static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD, 0,
103 struct fwe_softc *fwe; in fwe_poll() local
109 fwe = ((struct fwe_eth_softc *)ifp->if_softc)->fwe; in fwe_poll()
110 fc = fwe->fd.fc; in fwe_poll()
139 struct fwe_softc *fwe; in fwe_attach() local
145 fwe = ((struct fwe_softc *)device_get_softc(dev)); in fwe_attach()
148 bzero(fwe, sizeof(struct fwe_softc)); in fwe_attach()
149 mtx_init(&fwe->mtx, "fwe", NULL, MTX_DEF); in fwe_attach()
151 fwe->stream_ch = stream_ch; in fwe_attach()
152 fwe->dma_ch = -1; in fwe_attach()
154 fwe->fd.fc = device_get_ivars(dev); in fwe_attach()
156 tx_speed = fwe->fd.fc->speed; in fwe_attach()
158 fwe->fd.dev = dev; in fwe_attach()
159 fwe->fd.post_explore = NULL; in fwe_attach()
160 fwe->eth_softc.fwe = fwe; in fwe_attach()
162 fwe->pkt_hdr.mode.stream.tcode = FWTCODE_STREAM; in fwe_attach()
163 fwe->pkt_hdr.mode.stream.sy = 0; in fwe_attach()
164 fwe->pkt_hdr.mode.stream.chtag = fwe->stream_ch; in fwe_attach()
170 eui = &fwe->fd.fc->eui; in fwe_attach()
182 ifp = fwe->eth_softc.ifp = if_alloc(IFT_ETHER); in fwe_attach()
187 ifp->if_softc = &fwe->eth_softc; in fwe_attach()
210 fwe_stop(struct fwe_softc *fwe) in fwe_stop() argument
214 struct ifnet *ifp = fwe->eth_softc.ifp; in fwe_stop()
218 fc = fwe->fd.fc; in fwe_stop()
220 if (fwe->dma_ch >= 0) { in fwe_stop()
221 xferq = fc->ir[fwe->dma_ch]; in fwe_stop()
224 fc->irx_disable(fc, fwe->dma_ch); in fwe_stop()
234 for (xfer = STAILQ_FIRST(&fwe->xferlist); xfer != NULL; in fwe_stop()
239 STAILQ_INIT(&fwe->xferlist); in fwe_stop()
242 fwe->dma_ch = -1; in fwe_stop()
251 struct fwe_softc *fwe; in fwe_detach() local
255 fwe = device_get_softc(dev); in fwe_detach()
256 ifp = fwe->eth_softc.ifp; in fwe_detach()
264 fwe_stop(fwe); in fwe_detach()
269 mtx_destroy(&fwe->mtx); in fwe_detach()
276 struct fwe_softc *fwe = ((struct fwe_eth_softc *)arg)->fwe; in fwe_init() local
278 struct ifnet *ifp = fwe->eth_softc.ifp; in fwe_init()
289 fc = fwe->fd.fc; in fwe_init()
290 if (fwe->dma_ch < 0) { in fwe_init()
291 fwe->dma_ch = fw_open_isodma(fc, /* tx */0); in fwe_init()
292 if (fwe->dma_ch < 0) in fwe_init()
294 xferq = fc->ir[fwe->dma_ch]; in fwe_init()
297 fwe->stream_ch = stream_ch; in fwe_init()
298 fwe->pkt_hdr.mode.stream.chtag = fwe->stream_ch; in fwe_init()
300 xferq->flag |= fwe->stream_ch & 0xff; in fwe_init()
302 xferq->sc = (caddr_t) fwe; in fwe_init()
323 STAILQ_INIT(&fwe->xferlist); in fwe_init()
329 xfer->fc = fwe->fd.fc; in fwe_init()
330 xfer->sc = (caddr_t)fwe; in fwe_init()
332 STAILQ_INSERT_TAIL(&fwe->xferlist, xfer, link); in fwe_init()
335 xferq = fc->ir[fwe->dma_ch]; in fwe_init()
340 fc->irx_enable(fc, fwe->dma_ch); in fwe_init()
355 struct fwe_softc *fwe = ((struct fwe_eth_softc *)ifp->if_softc)->fwe; in fwe_ioctl() local
364 fwe_init(&fwe->eth_softc); in fwe_ioctl()
367 fwe_stop(fwe); in fwe_ioctl()
381 "\tch %d dma %d\n", fwe->stream_ch, fwe->dma_ch); in fwe_ioctl()
388 struct firewire_comm *fc = fwe->fd.fc; in fwe_ioctl()
424 struct fwe_softc *fwe; in fwe_output_callback() local
428 fwe = (struct fwe_softc *)xfer->sc; in fwe_output_callback()
429 ifp = fwe->eth_softc.ifp; in fwe_output_callback()
438 FWE_LOCK(fwe); in fwe_output_callback()
439 STAILQ_INSERT_TAIL(&fwe->xferlist, xfer, link); in fwe_output_callback()
440 FWE_UNLOCK(fwe); in fwe_output_callback()
451 struct fwe_softc *fwe = ((struct fwe_eth_softc *)ifp->if_softc)->fwe; in fwe_start() local
456 if (fwe->dma_ch < 0) { in fwe_start()
477 fwe_as_output(fwe, ifp); in fwe_start()
489 fwe_as_output(struct fwe_softc *fwe, struct ifnet *ifp) in fwe_as_output() argument
498 xferq = fwe->fd.fc->atq; in fwe_as_output()
501 FWE_LOCK(fwe); in fwe_as_output()
502 xfer = STAILQ_FIRST(&fwe->xferlist); in fwe_as_output()
507 FWE_UNLOCK(fwe); in fwe_as_output()
510 STAILQ_REMOVE_HEAD(&fwe->xferlist, link); in fwe_as_output()
511 FWE_UNLOCK(fwe); in fwe_as_output()
515 FWE_LOCK(fwe); in fwe_as_output()
516 STAILQ_INSERT_HEAD(&fwe->xferlist, xfer, link); in fwe_as_output()
517 FWE_UNLOCK(fwe); in fwe_as_output()
525 *(uint32_t *)&xfer->send.hdr = *(int32_t *)&fwe->pkt_hdr; in fwe_as_output()
530 if (fw_asyreq(fwe->fd.fc, -1, xfer) != 0) { in fwe_as_output()
545 xferq->start(fwe->fd.fc); in fwe_as_output()
554 struct fwe_softc *fwe; in fwe_as_input() local
559 fwe = (struct fwe_softc *)xferq->sc; in fwe_as_input()
560 ifp = fwe->eth_softc.ifp; in fwe_as_input()
566 if (fwe->fd.fc->irx_post != NULL) in fwe_as_input()
567 fwe->fd.fc->irx_post(fwe->fd.fc, fp->mode.ld); in fwe_as_input()
608 fwe->fd.fc->irx_enable(fwe->fd.fc, fwe->dma_ch); in fwe_as_input()
630 DRIVER_MODULE(fwe, firewire, fwe_driver, fwe_devclass, 0, 0);
631 MODULE_VERSION(fwe, 1);
632 MODULE_DEPEND(fwe, firewire, 1, 1, 1);