diff options
| author | Hidetoshi Shimokawa <simokawa@FreeBSD.org> | 2003-01-25 14:47:33 +0000 |
|---|---|---|
| committer | Hidetoshi Shimokawa <simokawa@FreeBSD.org> | 2003-01-25 14:47:33 +0000 |
| commit | c547b896f5bb72011400ccb2cb9a321b20b06596 (patch) | |
| tree | a7d9817a446ea43a90a137c6f9c6ac4f9116a388 /sys/dev/firewire/fwdev.c | |
| parent | 4394f4767dbc3cf49b4dababb4bfafbbd588edf4 (diff) | |
Notes
Diffstat (limited to 'sys/dev/firewire/fwdev.c')
| -rw-r--r-- | sys/dev/firewire/fwdev.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/sys/dev/firewire/fwdev.c b/sys/dev/firewire/fwdev.c index d096ba13d9ef..7233f353239d 100644 --- a/sys/dev/firewire/fwdev.c +++ b/sys/dev/firewire/fwdev.c @@ -531,15 +531,13 @@ fw_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, fw_proc *td) struct fw_xferq *ir, *it; struct fw_xfer *xfer; struct fw_pkt *fp; + struct fw_devinfo *devinfo; struct fw_devlstreq *fwdevlst = (struct fw_devlstreq *)data; struct fw_asyreq *asyreq = (struct fw_asyreq *)data; struct fw_isochreq *ichreq = (struct fw_isochreq *)data; struct fw_isobufreq *ibufreq = (struct fw_isobufreq *)data; struct fw_asybindreq *bindreq = (struct fw_asybindreq *)data; -#if 0 - struct fw_map_buf *map_buf = (struct fw_map_buf *)data; -#endif struct fw_crom_buf *crom_buf = (struct fw_crom_buf *)data; if (DEV_FWMEM(dev)) @@ -842,19 +840,27 @@ error: err = fw_bindadd(sc->fc, fwb); break; case FW_GDEVLST: - i = 0; - for(fwdev = TAILQ_FIRST(&sc->fc->devices); fwdev != NULL; - fwdev = TAILQ_NEXT(fwdev, link)){ - if(i < fwdevlst->n){ - fwdevlst->dst[i] = fwdev->dst; - fwdevlst->status[i] = - (fwdev->status == FWDEVATTACHED)?1:0; - fwdevlst->eui[i].hi = fwdev->eui.hi; - fwdevlst->eui[i].lo = fwdev->eui.lo; + i = len = 1; + /* myself */ + devinfo = &fwdevlst->dev[0]; + devinfo->dst = sc->fc->nodeid; + devinfo->status = 0; /* XXX */ + devinfo->eui.hi = sc->fc->eui.hi; + devinfo->eui.lo = sc->fc->eui.lo; + for (fwdev = TAILQ_FIRST(&sc->fc->devices); fwdev != NULL; + fwdev = TAILQ_NEXT(fwdev, link)) { + if(len < FW_MAX_DEVLST){ + devinfo = &fwdevlst->dev[len++]; + devinfo->dst = fwdev->dst; + devinfo->status = + (fwdev->status == FWDEVINVAL)?0:1; + devinfo->eui.hi = fwdev->eui.hi; + devinfo->eui.lo = fwdev->eui.lo; } i++; } fwdevlst->n = i; + fwdevlst->info_len = len; break; case FW_GTPMAP: bcopy(sc->fc->topology_map, data, |
