Lines Matching defs:fwe

86 static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD, 0,
101 struct fwe_softc *fwe;
107 fwe = ((struct fwe_eth_softc *)ifp->if_softc)->fwe;
108 fc = fwe->fd.fc;
117 BUS_ADD_CHILD(parent, 0, "fwe", device_get_unit(parent));
137 struct fwe_softc *fwe;
143 fwe = ((struct fwe_softc *)device_get_softc(dev));
146 bzero(fwe, sizeof(struct fwe_softc));
147 mtx_init(&fwe->mtx, "fwe", NULL, MTX_DEF);
149 fwe->stream_ch = stream_ch;
150 fwe->dma_ch = -1;
152 fwe->fd.fc = device_get_ivars(dev);
154 tx_speed = fwe->fd.fc->speed;
156 fwe->fd.dev = dev;
157 fwe->fd.post_explore = NULL;
158 fwe->eth_softc.fwe = fwe;
160 fwe->pkt_hdr.mode.stream.tcode = FWTCODE_STREAM;
161 fwe->pkt_hdr.mode.stream.sy = 0;
162 fwe->pkt_hdr.mode.stream.chtag = fwe->stream_ch;
168 eui = &fwe->fd.fc->eui;
180 ifp = fwe->eth_softc.ifp = if_alloc(IFT_ETHER);
185 ifp->if_softc = &fwe->eth_softc;
208 fwe_stop(struct fwe_softc *fwe)
212 struct ifnet *ifp = fwe->eth_softc.ifp;
216 fc = fwe->fd.fc;
218 if (fwe->dma_ch >= 0) {
219 xferq = fc->ir[fwe->dma_ch];
222 fc->irx_disable(fc, fwe->dma_ch);
232 for (xfer = STAILQ_FIRST(&fwe->xferlist); xfer != NULL;
237 STAILQ_INIT(&fwe->xferlist);
240 fwe->dma_ch = -1;
249 struct fwe_softc *fwe;
253 fwe = device_get_softc(dev);
254 ifp = fwe->eth_softc.ifp;
262 fwe_stop(fwe);
267 mtx_destroy(&fwe->mtx);
274 struct fwe_softc *fwe = ((struct fwe_eth_softc *)arg)->fwe;
276 struct ifnet *ifp = fwe->eth_softc.ifp;
287 fc = fwe->fd.fc;
288 if (fwe->dma_ch < 0) {
289 fwe->dma_ch = fw_open_isodma(fc, /* tx */0);
290 if (fwe->dma_ch < 0)
292 xferq = fc->ir[fwe->dma_ch];
295 fwe->stream_ch = stream_ch;
296 fwe->pkt_hdr.mode.stream.chtag = fwe->stream_ch;
298 xferq->flag |= fwe->stream_ch & 0xff;
300 xferq->sc = (caddr_t) fwe;
321 STAILQ_INIT(&fwe->xferlist);
327 xfer->fc = fwe->fd.fc;
328 xfer->sc = (caddr_t)fwe;
330 STAILQ_INSERT_TAIL(&fwe->xferlist, xfer, link);
333 xferq = fc->ir[fwe->dma_ch];
338 fc->irx_enable(fc, fwe->dma_ch);
353 struct fwe_softc *fwe = ((struct fwe_eth_softc *)ifp->if_softc)->fwe;
362 fwe_init(&fwe->eth_softc);
365 fwe_stop(fwe);
379 "\tch %d dma %d\n", fwe->stream_ch, fwe->dma_ch);
386 struct firewire_comm *fc = fwe->fd.fc;
424 struct fwe_softc *fwe;
428 fwe = (struct fwe_softc *)xfer->sc;
429 ifp = fwe->eth_softc.ifp;
438 FWE_LOCK(fwe);
439 STAILQ_INSERT_TAIL(&fwe->xferlist, xfer, link);
440 FWE_UNLOCK(fwe);
451 struct fwe_softc *fwe = ((struct fwe_eth_softc *)ifp->if_softc)->fwe;
456 if (fwe->dma_ch < 0) {
477 fwe_as_output(fwe, ifp);
489 fwe_as_output(struct fwe_softc *fwe, struct ifnet *ifp)
498 xferq = fwe->fd.fc->atq;
501 FWE_LOCK(fwe);
502 xfer = STAILQ_FIRST(&fwe->xferlist);
507 FWE_UNLOCK(fwe);
510 STAILQ_REMOVE_HEAD(&fwe->xferlist, link);
511 FWE_UNLOCK(fwe);
515 FWE_LOCK(fwe);
516 STAILQ_INSERT_HEAD(&fwe->xferlist, xfer, link);
517 FWE_UNLOCK(fwe);
525 *(uint32_t *)&xfer->send.hdr = *(int32_t *)&fwe->pkt_hdr;
530 if (fw_asyreq(fwe->fd.fc, -1, xfer) != 0) {
545 xferq->start(fwe->fd.fc);
554 struct fwe_softc *fwe;
559 fwe = (struct fwe_softc *)xferq->sc;
560 ifp = fwe->eth_softc.ifp;
566 if (fwe->fd.fc->irx_post != NULL)
567 fwe->fd.fc->irx_post(fwe->fd.fc, fp->mode.ld);
608 fwe->fd.fc->irx_enable(fwe->fd.fc, fwe->dma_ch);
624 "fwe",
630 DRIVER_MODULE(fwe, firewire, fwe_driver, fwe_devclass, 0, 0);
631 MODULE_VERSION(fwe, 1);
632 MODULE_DEPEND(fwe, firewire, 1, 1, 1);