Lines Matching refs:fwe
86 static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
101 struct fwe_softc *fwe; in fwe_poll() local
107 fwe = ((struct fwe_eth_softc *)if_getsoftc(ifp))->fwe; in fwe_poll()
108 fc = fwe->fd.fc; in fwe_poll()
137 struct fwe_softc *fwe; in fwe_attach() local
143 fwe = ((struct fwe_softc *)device_get_softc(dev)); in fwe_attach()
146 bzero(fwe, sizeof(struct fwe_softc)); in fwe_attach()
147 mtx_init(&fwe->mtx, "fwe", NULL, MTX_DEF); in fwe_attach()
149 fwe->stream_ch = stream_ch; in fwe_attach()
150 fwe->dma_ch = -1; in fwe_attach()
152 fwe->fd.fc = device_get_ivars(dev); in fwe_attach()
154 tx_speed = fwe->fd.fc->speed; in fwe_attach()
156 fwe->fd.dev = dev; in fwe_attach()
157 fwe->fd.post_explore = NULL; in fwe_attach()
158 fwe->eth_softc.fwe = fwe; in fwe_attach()
160 fwe->pkt_hdr.mode.stream.tcode = FWTCODE_STREAM; in fwe_attach()
161 fwe->pkt_hdr.mode.stream.sy = 0; in fwe_attach()
162 fwe->pkt_hdr.mode.stream.chtag = fwe->stream_ch; in fwe_attach()
168 eui = &fwe->fd.fc->eui; in fwe_attach()
180 ifp = fwe->eth_softc.ifp = if_alloc(IFT_ETHER); in fwe_attach()
181 if_setsoftc(ifp, &fwe->eth_softc); in fwe_attach()
204 fwe_stop(struct fwe_softc *fwe) in fwe_stop() argument
208 if_t ifp = fwe->eth_softc.ifp; in fwe_stop()
212 fc = fwe->fd.fc; in fwe_stop()
214 if (fwe->dma_ch >= 0) { in fwe_stop()
215 xferq = fc->ir[fwe->dma_ch]; in fwe_stop()
218 fc->irx_disable(fc, fwe->dma_ch); in fwe_stop()
228 for (xfer = STAILQ_FIRST(&fwe->xferlist); xfer != NULL; in fwe_stop()
233 STAILQ_INIT(&fwe->xferlist); in fwe_stop()
236 fwe->dma_ch = -1; in fwe_stop()
245 struct fwe_softc *fwe; in fwe_detach() local
249 fwe = device_get_softc(dev); in fwe_detach()
250 ifp = fwe->eth_softc.ifp; in fwe_detach()
258 fwe_stop(fwe); in fwe_detach()
263 mtx_destroy(&fwe->mtx); in fwe_detach()
270 struct fwe_softc *fwe = ((struct fwe_eth_softc *)arg)->fwe; in fwe_init() local
272 if_t ifp = fwe->eth_softc.ifp; in fwe_init()
283 fc = fwe->fd.fc; in fwe_init()
284 if (fwe->dma_ch < 0) { in fwe_init()
285 fwe->dma_ch = fw_open_isodma(fc, /* tx */0); in fwe_init()
286 if (fwe->dma_ch < 0) in fwe_init()
288 xferq = fc->ir[fwe->dma_ch]; in fwe_init()
291 fwe->stream_ch = stream_ch; in fwe_init()
292 fwe->pkt_hdr.mode.stream.chtag = fwe->stream_ch; in fwe_init()
294 xferq->flag |= fwe->stream_ch & 0xff; in fwe_init()
296 xferq->sc = (caddr_t) fwe; in fwe_init()
317 STAILQ_INIT(&fwe->xferlist); in fwe_init()
323 xfer->fc = fwe->fd.fc; in fwe_init()
324 xfer->sc = (caddr_t)fwe; in fwe_init()
326 STAILQ_INSERT_TAIL(&fwe->xferlist, xfer, link); in fwe_init()
329 xferq = fc->ir[fwe->dma_ch]; in fwe_init()
334 fc->irx_enable(fc, fwe->dma_ch); in fwe_init()
349 struct fwe_softc *fwe = ((struct fwe_eth_softc *)if_getsoftc(ifp))->fwe; in fwe_ioctl() local
358 fwe_init(&fwe->eth_softc); in fwe_ioctl()
361 fwe_stop(fwe); in fwe_ioctl()
375 "\tch %d dma %d\n", fwe->stream_ch, fwe->dma_ch); in fwe_ioctl()
382 struct firewire_comm *fc = fwe->fd.fc; in fwe_ioctl()
418 struct fwe_softc *fwe; in fwe_output_callback() local
422 fwe = (struct fwe_softc *)xfer->sc; in fwe_output_callback()
423 ifp = fwe->eth_softc.ifp; in fwe_output_callback()
432 FWE_LOCK(fwe); in fwe_output_callback()
433 STAILQ_INSERT_TAIL(&fwe->xferlist, xfer, link); in fwe_output_callback()
434 FWE_UNLOCK(fwe); in fwe_output_callback()
445 struct fwe_softc *fwe = ((struct fwe_eth_softc *)if_getsoftc(ifp))->fwe; in fwe_start() local
450 if (fwe->dma_ch < 0) { in fwe_start()
471 fwe_as_output(fwe, ifp); in fwe_start()
483 fwe_as_output(struct fwe_softc *fwe, if_t ifp) in fwe_as_output() argument
492 xferq = fwe->fd.fc->atq; in fwe_as_output()
495 FWE_LOCK(fwe); in fwe_as_output()
496 xfer = STAILQ_FIRST(&fwe->xferlist); in fwe_as_output()
501 FWE_UNLOCK(fwe); in fwe_as_output()
504 STAILQ_REMOVE_HEAD(&fwe->xferlist, link); in fwe_as_output()
505 FWE_UNLOCK(fwe); in fwe_as_output()
509 FWE_LOCK(fwe); in fwe_as_output()
510 STAILQ_INSERT_HEAD(&fwe->xferlist, xfer, link); in fwe_as_output()
511 FWE_UNLOCK(fwe); in fwe_as_output()
519 *(uint32_t *)&xfer->send.hdr = *(int32_t *)&fwe->pkt_hdr; in fwe_as_output()
524 if (fw_asyreq(fwe->fd.fc, -1, xfer) != 0) { in fwe_as_output()
539 xferq->start(fwe->fd.fc); in fwe_as_output()
548 struct fwe_softc *fwe; in fwe_as_input() local
555 fwe = (struct fwe_softc *)xferq->sc; in fwe_as_input()
556 ifp = fwe->eth_softc.ifp; in fwe_as_input()
562 if (fwe->fd.fc->irx_post != NULL) in fwe_as_input()
563 fwe->fd.fc->irx_post(fwe->fd.fc, fp->mode.ld); in fwe_as_input()
606 fwe->fd.fc->irx_enable(fwe->fd.fc, fwe->dma_ch); in fwe_as_input()
626 DRIVER_MODULE(fwe, firewire, fwe_driver, 0, 0);
627 MODULE_VERSION(fwe, 1);
628 MODULE_DEPEND(fwe, firewire, 1, 1, 1);