Deleted Added
full compact
firewire.c (106815) firewire.c (107653)
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 106815 2002-11-12 17:16:20Z simokawa $
33 * $FreeBSD: head/sys/dev/firewire/firewire.c 107653 2002-12-06 02:17:30Z 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>

--- 473 unchanged lines hidden (view full) ---

515 d = make_dev(&firewire_cdevsw, unit2minor(unitmask | FWMEM_FLAG),
516 UID_ROOT, GID_OPERATOR, 0770,
517 "fwmem%d", device_get_unit(dev));
518#if __FreeBSD_version >= 500000
519 dev_depends(sc->dev, d);
520#else
521 sc->dev[i] = d;
522#endif
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>

--- 473 unchanged lines hidden (view full) ---

515 d = make_dev(&firewire_cdevsw, unit2minor(unitmask | FWMEM_FLAG),
516 UID_ROOT, GID_OPERATOR, 0770,
517 "fwmem%d", device_get_unit(dev));
518#if __FreeBSD_version >= 500000
519 dev_depends(sc->dev, d);
520#else
521 sc->dev[i] = d;
522#endif
523 printf("%s: firewire bus attach\n", device_get_nameunit(sc->fc->dev));
524 sc->fc->timeouthandle = timeout((timeout_t *)sc->fc->timeout, (void *)sc->fc, hz * 10);
525
526 /* Locate our children */
527 bus_generic_probe(dev);
528
529 /* launch attachement of the added children */
530 bus_generic_attach(dev);
531

--- 532 unchanged lines hidden (view full) ---

1064 if (root_node >= 0)
1065 fp->mode.ld[1] |= htonl((root_node & 0x3f) << 24 | 1 << 23);
1066 if (gap_count >= 0)
1067 fp->mode.ld[1] |= htonl(1 << 22 | (gap_count & 0x3f) << 16);
1068 fp->mode.ld[2] = ~fp->mode.ld[1];
1069/* XXX Dangerous, how to pass PHY packet to device driver */
1070 fp->mode.common.tcode |= FWTCODE_PHY;
1071
523 sc->fc->timeouthandle = timeout((timeout_t *)sc->fc->timeout, (void *)sc->fc, hz * 10);
524
525 /* Locate our children */
526 bus_generic_probe(dev);
527
528 /* launch attachement of the added children */
529 bus_generic_attach(dev);
530

--- 532 unchanged lines hidden (view full) ---

1063 if (root_node >= 0)
1064 fp->mode.ld[1] |= htonl((root_node & 0x3f) << 24 | 1 << 23);
1065 if (gap_count >= 0)
1066 fp->mode.ld[1] |= htonl(1 << 22 | (gap_count & 0x3f) << 16);
1067 fp->mode.ld[2] = ~fp->mode.ld[1];
1068/* XXX Dangerous, how to pass PHY packet to device driver */
1069 fp->mode.common.tcode |= FWTCODE_PHY;
1070
1072 printf("send phy_config root_node=%d gap_count=%d\n",
1071 if (firewire_debug)
1072 printf("send phy_config root_node=%d gap_count=%d\n",
1073 root_node, gap_count);
1074 fw_asyreq(fc, -1, xfer);
1075}
1076
1077#if 0
1078/*
1079 * Dump self ID.
1080 */

--- 255 unchanged lines hidden (view full) ---

1336 tfwdev = TAILQ_NEXT( tfwdev, link);
1337 }
1338 if(tfwdev == NULL){
1339 TAILQ_INSERT_TAIL(&fc->devices, fwdev, link);
1340 }else{
1341 TAILQ_INSERT_BEFORE(tfwdev, fwdev, link);
1342 }
1343
1073 root_node, gap_count);
1074 fw_asyreq(fc, -1, xfer);
1075}
1076
1077#if 0
1078/*
1079 * Dump self ID.
1080 */

--- 255 unchanged lines hidden (view full) ---

1336 tfwdev = TAILQ_NEXT( tfwdev, link);
1337 }
1338 if(tfwdev == NULL){
1339 TAILQ_INSERT_TAIL(&fc->devices, fwdev, link);
1340 }else{
1341 TAILQ_INSERT_BEFORE(tfwdev, fwdev, link);
1342 }
1343
1344 printf("%s:Discover new %s device ID:%08x%08x\n", device_get_nameunit(fc->dev), linkspeed[fwdev->speed], fc->ongoeui.hi, fc->ongoeui.lo);
1344 device_printf(fc->dev, "New %s device ID:%08x%08x\n",
1345 linkspeed[fwdev->speed],
1346 fc->ongoeui.hi, fc->ongoeui.lo);
1345
1346 fc->ongodev = fwdev;
1347 fc->ongoaddr = CSRROMOFF;
1348 addr = 0xf0000000 | fc->ongoaddr;
1349 }else{
1350 addr = 0xf0000000 | fc->ongoaddr;
1351 }
1352#if 0

--- 31 unchanged lines hidden (view full) ---

1384 fw_xfer_free( xfer);
1385 return;
1386 }
1387#endif
1388 return;
1389done:
1390 /* fw_attach_devs */
1391 fc->status = FWBUSEXPDONE;
1347
1348 fc->ongodev = fwdev;
1349 fc->ongoaddr = CSRROMOFF;
1350 addr = 0xf0000000 | fc->ongoaddr;
1351 }else{
1352 addr = 0xf0000000 | fc->ongoaddr;
1353 }
1354#if 0

--- 31 unchanged lines hidden (view full) ---

1386 fw_xfer_free( xfer);
1387 return;
1388 }
1389#endif
1390 return;
1391done:
1392 /* fw_attach_devs */
1393 fc->status = FWBUSEXPDONE;
1392 printf("bus_explore done\n");
1394 if (firewire_debug)
1395 printf("bus_explore done\n");
1393 fw_attach_dev(fc);
1394 return;
1395
1396}
1397
1398/* Portable Async. request read quad */
1399struct fw_xfer *
1400asyreqq(struct firewire_comm *fc, u_int8_t spd, u_int8_t tl, u_int8_t rt,

--- 232 unchanged lines hidden (view full) ---

1633 fwdev->spec = getcsrdata(fwdev, CSRKEY_SPEC);
1634 if(fwdev->spec == 0)
1635 continue;
1636 fwdev->ver = getcsrdata(fwdev, CSRKEY_VER);
1637 if(fwdev->ver == 0)
1638 continue;
1639 fwdev->maxrec = (fwdev->csrrom[2] >> 12) & 0xf;
1640
1396 fw_attach_dev(fc);
1397 return;
1398
1399}
1400
1401/* Portable Async. request read quad */
1402struct fw_xfer *
1403asyreqq(struct firewire_comm *fc, u_int8_t spd, u_int8_t tl, u_int8_t rt,

--- 232 unchanged lines hidden (view full) ---

1636 fwdev->spec = getcsrdata(fwdev, CSRKEY_SPEC);
1637 if(fwdev->spec == 0)
1638 continue;
1639 fwdev->ver = getcsrdata(fwdev, CSRKEY_VER);
1640 if(fwdev->ver == 0)
1641 continue;
1642 fwdev->maxrec = (fwdev->csrrom[2] >> 12) & 0xf;
1643
1644 device_printf(fc->dev, "Device ");
1641 switch(fwdev->spec){
1642 case CSRVAL_ANSIT10:
1643 switch(fwdev->ver){
1644 case CSRVAL_T10SBP2:
1645 switch(fwdev->spec){
1646 case CSRVAL_ANSIT10:
1647 switch(fwdev->ver){
1648 case CSRVAL_T10SBP2:
1645 printf("Device SBP-II");
1649 printf("SBP-II");
1646 break;
1647 default:
1648 break;
1649 }
1650 break;
1651 case CSRVAL_1394TA:
1652 switch(fwdev->ver){
1653 case CSR_PROTAVC:
1650 break;
1651 default:
1652 break;
1653 }
1654 break;
1655 case CSRVAL_1394TA:
1656 switch(fwdev->ver){
1657 case CSR_PROTAVC:
1654 printf("Device AV/C");
1658 printf("AV/C");
1655 break;
1656 case CSR_PROTCAL:
1659 break;
1660 case CSR_PROTCAL:
1657 printf("Device CAL");
1661 printf("CAL");
1658 break;
1659 case CSR_PROTEHS:
1662 break;
1663 case CSR_PROTEHS:
1660 printf("Device EHS");
1664 printf("EHS");
1661 break;
1662 case CSR_PROTHAVI:
1665 break;
1666 case CSR_PROTHAVI:
1663 printf("Device HAVi");
1667 printf("HAVi");
1664 break;
1665 case CSR_PROTCAM104:
1668 break;
1669 case CSR_PROTCAM104:
1666 printf("Device 1394 Cam 1.04");
1670 printf("1394 Cam 1.04");
1667 break;
1668 case CSR_PROTCAM120:
1671 break;
1672 case CSR_PROTCAM120:
1669 printf("Device 1394 Cam 1.20");
1673 printf("1394 Cam 1.20");
1670 break;
1671 case CSR_PROTCAM130:
1674 break;
1675 case CSR_PROTCAM130:
1672 printf("Device 1394 Cam 1.30");
1676 printf("1394 Cam 1.30");
1673 break;
1674 case CSR_PROTDPP:
1677 break;
1678 case CSR_PROTDPP:
1675 printf("Device 1394 Direct print");
1679 printf("1394 Direct print");
1676 break;
1677 case CSR_PROTIICP:
1680 break;
1681 case CSR_PROTIICP:
1678 printf("Device Industrial & Instrument");
1682 printf("Industrial & Instrument");
1679 break;
1680 default:
1683 break;
1684 default:
1681 printf("Device unkwon 1394TA");
1685 printf("unknown 1394TA");
1682 break;
1683 }
1684 break;
1685 default:
1686 break;
1687 }
1688 break;
1689 default:
1690 printf("unknown spec");
1686 break;
1687 }
1688 fwdev->status = FWDEVATTACHED;
1689 printf("\n");
1690 }
1691 }
1692 err = device_get_children(fc->dev, &devlistp, &devcnt);
1693 if( err != 0 )

--- 478 unchanged lines hidden ---
1691 break;
1692 }
1693 fwdev->status = FWDEVATTACHED;
1694 printf("\n");
1695 }
1696 }
1697 err = device_get_children(fc->dev, &devlistp, &devcnt);
1698 if( err != 0 )

--- 478 unchanged lines hidden ---