firewire.c (110072) | firewire.c (110179) |
---|---|
1/* 2 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 30 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 * POSSIBILITY OF SUCH DAMAGE. 32 * | 1/* 2 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 30 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 * POSSIBILITY OF SUCH DAMAGE. 32 * |
33 * $FreeBSD: head/sys/dev/firewire/firewire.c 110072 2003-01-30 05:18:35Z simokawa $ | 33 * $FreeBSD: head/sys/dev/firewire/firewire.c 110179 2003-02-01 06:34:36Z simokawa $ |
34 * 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/types.h> 40#include <sys/mbuf.h> 41#include <sys/socket.h> --- 1065 unchanged lines hidden (view full) --- 1107 1108/* 1109 * To collect device informations on the IEEE1394 bus. 1110 */ 1111static void 1112fw_bus_explore(struct firewire_comm *fc ) 1113{ 1114 int err = 0; | 34 * 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/types.h> 40#include <sys/mbuf.h> 41#include <sys/socket.h> --- 1065 unchanged lines hidden (view full) --- 1107 1108/* 1109 * To collect device informations on the IEEE1394 bus. 1110 */ 1111static void 1112fw_bus_explore(struct firewire_comm *fc ) 1113{ 1114 int err = 0; |
1115 struct fw_device *fwdev, *tfwdev; | 1115 struct fw_device *fwdev, *pfwdev, *tfwdev; |
1116 u_int32_t addr; 1117 struct fw_xfer *xfer; 1118 struct fw_pkt *fp; 1119 1120 if(fc->status != FWBUSEXPLORE) 1121 return; 1122 1123loop: --- 47 unchanged lines hidden (view full) --- 1171 fwdev->status = FWDEVINIT; 1172#if 0 1173 fwdev->speed = CSRARC(fc, SPED_MAP + 8 + fc->ongonode / 4) 1174 >> ((3 - (fc->ongonode % 4)) * 8); 1175#else 1176 fwdev->speed = fc->speed_map->speed[fc->nodeid][fc->ongonode]; 1177#endif 1178 | 1116 u_int32_t addr; 1117 struct fw_xfer *xfer; 1118 struct fw_pkt *fp; 1119 1120 if(fc->status != FWBUSEXPLORE) 1121 return; 1122 1123loop: --- 47 unchanged lines hidden (view full) --- 1171 fwdev->status = FWDEVINIT; 1172#if 0 1173 fwdev->speed = CSRARC(fc, SPED_MAP + 8 + fc->ongonode / 4) 1174 >> ((3 - (fc->ongonode % 4)) * 8); 1175#else 1176 fwdev->speed = fc->speed_map->speed[fc->nodeid][fc->ongonode]; 1177#endif 1178 |
1179 tfwdev = TAILQ_FIRST(&fc->devices); 1180 while( tfwdev != NULL && 1181 (tfwdev->eui.hi > fwdev->eui.hi) && 1182 ((tfwdev->eui.hi == fwdev->eui.hi) && 1183 tfwdev->eui.lo > fwdev->eui.lo)){ 1184 tfwdev = TAILQ_NEXT( tfwdev, link); | 1179 pfwdev = NULL; 1180 TAILQ_FOREACH(tfwdev, &fc->devices, link) { 1181 if (tfwdev->eui.hi > fwdev->eui.hi || 1182 (tfwdev->eui.hi == fwdev->eui.hi && 1183 tfwdev->eui.lo > fwdev->eui.lo)) 1184 break; 1185 pfwdev = tfwdev; |
1185 } | 1186 } |
1186 if(tfwdev == NULL){ 1187 TAILQ_INSERT_TAIL(&fc->devices, fwdev, link); 1188 }else{ 1189 TAILQ_INSERT_BEFORE(tfwdev, fwdev, link); 1190 } | 1187 if (pfwdev == NULL) 1188 TAILQ_INSERT_HEAD(&fc->devices, fwdev, link); 1189 else 1190 TAILQ_INSERT_AFTER(&fc->devices, pfwdev, fwdev, link); |
1191 1192 device_printf(fc->bdev, "New %s device ID:%08x%08x\n", 1193 linkspeed[fwdev->speed], 1194 fc->ongoeui.hi, fc->ongoeui.lo); 1195 1196 fc->ongodev = fwdev; 1197 fc->ongoaddr = CSRROMOFF; 1198 addr = 0xf0000000 | fc->ongoaddr; --- 861 unchanged lines hidden --- | 1191 1192 device_printf(fc->bdev, "New %s device ID:%08x%08x\n", 1193 linkspeed[fwdev->speed], 1194 fc->ongoeui.hi, fc->ongoeui.lo); 1195 1196 fc->ongodev = fwdev; 1197 fc->ongoaddr = CSRROMOFF; 1198 addr = 0xf0000000 | fc->ongoaddr; --- 861 unchanged lines hidden --- |