firewire.c (127468) | firewire.c (129274) |
---|---|
1/* 2 * Copyright (c) 2003 Hidetoshi Shimokawa 3 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 17 unchanged lines hidden (view full) --- 26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 * POSSIBILITY OF SUCH DAMAGE. 33 * | 1/* 2 * Copyright (c) 2003 Hidetoshi Shimokawa 3 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 17 unchanged lines hidden (view full) --- 26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 * POSSIBILITY OF SUCH DAMAGE. 33 * |
34 * $FreeBSD: head/sys/dev/firewire/firewire.c 127468 2004-03-26 23:17:10Z simokawa $ | 34 * $FreeBSD: head/sys/dev/firewire/firewire.c 129274 2004-05-16 11:26:39Z dfr $ |
35 * 36 */ 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/types.h> 41 42#include <sys/kernel.h> --- 1245 unchanged lines hidden (view full) --- 1288 fc->ongoaddr = CSRROMOFF; 1289 fc->ongodev = NULL; 1290 fc->ongoeui.hi = 0xffffffff; fc->ongoeui.lo = 0xffffffff; 1291 fw_bus_explore(fc); 1292 splx(s); 1293} 1294 1295/* | 35 * 36 */ 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/types.h> 41 42#include <sys/kernel.h> --- 1245 unchanged lines hidden (view full) --- 1288 fc->ongoaddr = CSRROMOFF; 1289 fc->ongodev = NULL; 1290 fc->ongoeui.hi = 0xffffffff; fc->ongoeui.lo = 0xffffffff; 1291 fw_bus_explore(fc); 1292 splx(s); 1293} 1294 1295/* |
1296 * Find the self_id packet for a node, ignoring sequels. 1297 */ 1298static union fw_self_id * 1299fw_find_self_id(struct firewire_comm *fc, int node) 1300{ 1301 uint32_t i; 1302 union fw_self_id *s; 1303 1304 for (i = 0; i < fc->topology_map->self_id_count; i++) { 1305 s = &fc->topology_map->self_id[i]; 1306 if (s->p0.sequel) 1307 continue; 1308 if (s->p0.phy_id == node) 1309 return s; 1310 } 1311 return 0; 1312} 1313 1314/* |
|
1296 * To collect device informations on the IEEE1394 bus. 1297 */ 1298static void 1299fw_bus_explore(struct firewire_comm *fc ) 1300{ 1301 int err = 0; 1302 struct fw_device *fwdev, *pfwdev, *tfwdev; 1303 u_int32_t addr; --- 6 unchanged lines hidden (view full) --- 1310loop: 1311 if(fc->ongonode == fc->nodeid) fc->ongonode++; 1312 1313 if(fc->ongonode > fc->max_node) goto done; 1314 if(fc->ongonode >= 0x3f) goto done; 1315 1316 /* check link */ 1317 /* XXX we need to check phy_id first */ | 1315 * To collect device informations on the IEEE1394 bus. 1316 */ 1317static void 1318fw_bus_explore(struct firewire_comm *fc ) 1319{ 1320 int err = 0; 1321 struct fw_device *fwdev, *pfwdev, *tfwdev; 1322 u_int32_t addr; --- 6 unchanged lines hidden (view full) --- 1329loop: 1330 if(fc->ongonode == fc->nodeid) fc->ongonode++; 1331 1332 if(fc->ongonode > fc->max_node) goto done; 1333 if(fc->ongonode >= 0x3f) goto done; 1334 1335 /* check link */ 1336 /* XXX we need to check phy_id first */ |
1318 if (!fc->topology_map->self_id[fc->ongonode].p0.link_active) { | 1337 if (!fw_find_self_id(fc, fc->ongonode)->p0.link_active) { |
1319 if (firewire_debug) 1320 printf("node%d: link down\n", fc->ongonode); 1321 fc->ongonode++; 1322 goto loop; 1323 } 1324 1325 if(fc->ongoaddr <= CSRROMOFF && 1326 fc->ongoeui.hi == 0xffffffff && --- 853 unchanged lines hidden (view full) --- 2180fw_bmr(struct firewire_comm *fc) 2181{ 2182 struct fw_device fwdev; 2183 union fw_self_id *self_id; 2184 int cmstr; 2185 u_int32_t quad; 2186 2187 /* Check to see if the current root node is cycle master capable */ | 1338 if (firewire_debug) 1339 printf("node%d: link down\n", fc->ongonode); 1340 fc->ongonode++; 1341 goto loop; 1342 } 1343 1344 if(fc->ongoaddr <= CSRROMOFF && 1345 fc->ongoeui.hi == 0xffffffff && --- 853 unchanged lines hidden (view full) --- 2199fw_bmr(struct firewire_comm *fc) 2200{ 2201 struct fw_device fwdev; 2202 union fw_self_id *self_id; 2203 int cmstr; 2204 u_int32_t quad; 2205 2206 /* Check to see if the current root node is cycle master capable */ |
2188 self_id = &fc->topology_map->self_id[fc->max_node]; | 2207 self_id = fw_find_self_id(fc, fc->max_node); |
2189 if (fc->max_node > 0) { 2190 /* XXX check cmc bit of businfo block rather than contender */ 2191 if (self_id->p0.link_active && self_id->p0.contender) 2192 cmstr = fc->max_node; 2193 else { 2194 device_printf(fc->bdev, 2195 "root node is not cycle master capable\n"); 2196 /* XXX shall we be the cycle master? */ --- 68 unchanged lines hidden --- | 2208 if (fc->max_node > 0) { 2209 /* XXX check cmc bit of businfo block rather than contender */ 2210 if (self_id->p0.link_active && self_id->p0.contender) 2211 cmstr = fc->max_node; 2212 else { 2213 device_printf(fc->bdev, 2214 "root node is not cycle master capable\n"); 2215 /* XXX shall we be the cycle master? */ --- 68 unchanged lines hidden --- |