Lines Matching refs:fwdev

107 	struct fw_device *fwdev;  in fw_noderesolve_nodeid()  local
111 STAILQ_FOREACH(fwdev, &fc->devices, link) in fw_noderesolve_nodeid()
112 if (fwdev->dst == dst && fwdev->status != FWDEVINVAL) in fw_noderesolve_nodeid()
116 return fwdev; in fw_noderesolve_nodeid()
125 struct fw_device *fwdev; in fw_noderesolve_eui64() local
130 STAILQ_FOREACH(fwdev, &fc->devices, link) in fw_noderesolve_eui64()
131 if (FW_EUI64_EQUAL(fwdev->eui, *eui)) in fw_noderesolve_eui64()
136 if(fwdev == NULL) return NULL; in fw_noderesolve_eui64()
137 if(fwdev->status == FWDEVINVAL) return NULL; in fw_noderesolve_eui64()
138 return fwdev; in fw_noderesolve_eui64()
512 struct fw_device *fwdev, *fwdev_next; in firewire_detach() local
552 for (fwdev = STAILQ_FIRST(&fc->devices); fwdev != NULL; in firewire_detach()
553 fwdev = fwdev_next) { in firewire_detach()
554 fwdev_next = STAILQ_NEXT(fwdev, link); in firewire_detach()
555 free(fwdev); in firewire_detach()
1492 struct fw_device *fwdev; in fw_bus_probe() local
1502 STAILQ_FOREACH(fwdev, &fc->devices, link) in fw_bus_probe()
1503 if (fwdev->status != FWDEVINVAL) { in fw_bus_probe()
1504 fwdev->status = FWDEVINVAL; in fw_bus_probe()
1505 fwdev->rcnt = 0; in fw_bus_probe()
1509 __func__, fwdev->eui.hi, fwdev->eui.lo); in fw_bus_probe()
1514 __func__, fwdev->eui.hi, fwdev->eui.lo); in fw_bus_probe()
1524 fw_explore_read_quads(struct fw_device *fwdev, int offset, in fw_explore_read_quads() argument
1532 xfer = fwmem_read_quad(fwdev, NULL, (uint8_t)-1, in fw_explore_read_quads()
1552 fw_explore_csrblock(struct fw_device *fwdev, int offset, int recur) in fw_explore_csrblock() argument
1558 dir = (struct csrdirectory *)&fwdev->csrrom[offset/sizeof(uint32_t)]; in fw_explore_csrblock()
1559 err = fw_explore_read_quads(fwdev, CSRROMOFF + offset, in fw_explore_csrblock()
1565 reg = (struct csrreg *)&fwdev->csrrom[offset/sizeof(uint32_t)]; in fw_explore_csrblock()
1566 err = fw_explore_read_quads(fwdev, CSRROMOFF + offset, in fw_explore_csrblock()
1574 if (fwdev->rommax < off) in fw_explore_csrblock()
1575 fwdev->rommax = off; in fw_explore_csrblock()
1593 err = fw_explore_csrblock(fwdev, off, recur); in fw_explore_csrblock()
1604 struct fw_device *fwdev, *pfwdev, *tfwdev; in fw_explore_node() local
1660 STAILQ_FOREACH(fwdev, &fc->devices, link) in fw_explore_node()
1661 if (FW_EUI64_EQUAL(fwdev->eui, binfo->eui64)) in fw_explore_node()
1663 if (fwdev == NULL) { in fw_explore_node()
1665 fwdev = (fw_device*)malloc(sizeof(struct fw_device)); in fw_explore_node()
1666 if (fwdev == NULL) { in fw_explore_node()
1671 memset(fwdev, 0, sizeof(struct fw_device)); in fw_explore_node()
1672 fwdev->fc = fc; in fw_explore_node()
1673 fwdev->eui = binfo->eui64; in fw_explore_node()
1674 fwdev->dst = dfwdev->dst; in fw_explore_node()
1675 fwdev->maxrec = dfwdev->maxrec; in fw_explore_node()
1676 fwdev->status = dfwdev->status; in fw_explore_node()
1690 fwdev->speed = fc->speed_map->speed[fc->nodeid][node]; in fw_explore_node()
1692 fwdev->speed = binfo->link_spd; in fw_explore_node()
1697 while (fwdev->speed > FWSPD_S100 /* 0 */) { in fw_explore_node()
1698 err = fw_explore_read_quads(fwdev, CSRROMOFF, in fw_explore_node()
1704 linkspeed[fwdev->speed]); in fw_explore_node()
1705 fwdev->speed--; in fw_explore_node()
1713 if (tfwdev->eui.hi > fwdev->eui.hi || in fw_explore_node()
1714 (tfwdev->eui.hi == fwdev->eui.hi && in fw_explore_node()
1715 tfwdev->eui.lo > fwdev->eui.lo)) in fw_explore_node()
1720 STAILQ_INSERT_HEAD(&fc->devices, fwdev, link); in fw_explore_node()
1722 STAILQ_INSERT_AFTER(&fc->devices, pfwdev, fwdev, link); in fw_explore_node()
1725 linkspeed[fwdev->speed], in fw_explore_node()
1726 fwdev->eui.hi, fwdev->eui.lo); in fw_explore_node()
1728 fwdev->dst = node; in fw_explore_node()
1729 fwdev->status = FWDEVINIT; in fw_explore_node()
1731 if (bcmp(&csr[0], &fwdev->csrrom[0], sizeof(uint32_t) * 5) == 0) { in fw_explore_node()
1738 bzero(&fwdev->csrrom[0], CROMSIZE); in fw_explore_node()
1741 bcopy(&csr[0], &fwdev->csrrom[0], sizeof(uint32_t) * 5); in fw_explore_node()
1742 fwdev->rommax = CSRROMOFF + sizeof(uint32_t) * 4; in fw_explore_node()
1744 err = fw_explore_csrblock(fwdev, 0x14, 1); /* root directory */ in fw_explore_node()
1751 fwdev->status = FWDEVINVAL; in fw_explore_node()
1752 fwdev->csrrom[0] = 0; in fw_explore_node()
1870 struct fw_device *fwdev, *next; in fw_attach_dev() local
1877 for (fwdev = STAILQ_FIRST(&fc->devices); fwdev != NULL; fwdev = next) { in fw_attach_dev()
1878 next = STAILQ_NEXT(fwdev, link); in fw_attach_dev()
1879 if (fwdev->status == FWDEVINIT) { in fw_attach_dev()
1880 fwdev->status = FWDEVATTACHED; in fw_attach_dev()
1881 } else if (fwdev->status == FWDEVINVAL) { in fw_attach_dev()
1882 fwdev->rcnt ++; in fw_attach_dev()
1886 __func__, fwdev->rcnt, hold_count); in fw_attach_dev()
1887 if (fwdev->rcnt > hold_count) { in fw_attach_dev()
1894 __func__, fwdev->eui.hi, fwdev->eui.lo); in fw_attach_dev()
1895 STAILQ_REMOVE(&fc->devices, fwdev, fw_device, in fw_attach_dev()
1897 free(fwdev); in fw_attach_dev()
2398 struct fw_device fwdev; in fw_bmr() local
2434 bzero(&fwdev, sizeof(fwdev)); in fw_bmr()
2435 fwdev.fc = fc; in fw_bmr()
2436 fwdev.dst = cmstr; in fw_bmr()
2437 fwdev.speed = 0; in fw_bmr()
2438 fwdev.maxrec = 8; /* 512 */ in fw_bmr()
2439 fwdev.status = FWDEVINIT; in fw_bmr()
2442 fwmem_write_quad(&fwdev, NULL, 0/*spd*/, in fw_bmr()