Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jan 2003 09:58:24 +0100
From:      "Petr Holub" <hopet@ics.muni.cz>
To:        <freebsd-firewire@freebsd.org>
Subject:   reading from /dev/fw0?
Message-ID:  <003c01c2b306$45afa5b0$2603fb93@kloboucek>
In-Reply-To: <200212302113.gBULD8rE000655@evenstar.ics.muni.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi all,

I'm running FreeBSD 5.0-RC2 on my DELL Precision 530 and I've
troubles reading from /dev/fw*. I've compiled kernel with
"device firewire" and after connecting camera SONY TRV-30E
it seem that device is found OK - dmesg output from boot while
camera is on is attached bellow my signature.

When I boot the machine without camera attached and attach
it afterwards I get following messages:
----
Jan  3 09:15:07 trurl kernel: firewire0: BUS reset
Jan  3 09:15:07 trurl kernel: firewire0: node_id = 0x0800ffc0, Bus reset failure

Jan  3 09:15:07 trurl kernel: firewire0: BUS reset
Jan  3 09:15:07 trurl last message repeated 15 times
Jan  3 09:15:07 trurl kernel: firewire0: node_id = 0xc800ffc1, CYCLEMASTER mode
Jan  3 09:15:07 trurl kernel: firewire0: 2 nodes, maxhop <= 1, cable IRM = 1 (me
)
Jan  3 09:15:07 trurl kernel: firewire0: BUS reset
Jan  3 09:15:07 trurl last message repeated 18 times
Jan  3 09:15:07 trurl kernel: firewire0: node_id = 0xc800ffc1, CYCLEMASTER mode
Jan  3 09:15:07 trurl kernel: firewire0: 2 nodes, maxhop <= 1, cable IRM = 1 (me
----

I tried to get anything from fw* devices in following ways (in both
cases with camera attached before boot and after boot I get the same
results; all the commands performed as a root):

* dd if=/dev/fw0 of=test
---
-su-2.05b# for i in 0 1 2 3; do dd if=/dev/fw${i} of=test; done
dd: /dev/fw0: Resource temporarily unavailable
0+0 records in
0+0 records out
0 bytes transferred in 0.997995 secs (0 bytes/sec)
dd: /dev/fw1: Resource temporarily unavailable
0+0 records in
0+0 records out
0 bytes transferred in 0.998491 secs (0 bytes/sec)
dd: /dev/fw2: Resource temporarily unavailable
0+0 records in
0+0 records out
0 bytes transferred in 0.998534 secs (0 bytes/sec)
dd: /dev/fw3: Resource temporarily unavailable
0+0 records in
0+0 records out
0 bytes transferred in 0.998398 secs (0 bytes/sec)
---

* cat /dev/fw0
---
-su-2.05b# for i in 0 1 2 3; do cat /dev/fw${i}; done
cat: /dev/fw0: Resource temporarily unavailable
cat: /dev/fw1: Resource temporarily unavailable
cat: /dev/fw2: Resource temporarily unavailable
cat: /dev/fw3: Resource temporarily unavailable
---

* using C program that does roughly following (ioctl's
  are from DVTS):
  if ((fd = open("/dev/fw0", O_RDWR)) < 0) {perror...}
  bufreq.rx.nchunk = 4;
  bufreq.rx.npacket = 25;
  bufreq.rx.psize = 512;
  bufreq.tx.nchunk = 10;
  bufreq.tx.npacket = 2000;
  bufreq.tx.psize = 512;
  if (ioctl(fd, FW_SSTBUF, &bufreq) < 0) {perror...}
  isoreq.ch = 63;
  isoreq.tag = 0;
  if (ioctl(fd, FW_SRSTREAM, &isoreq) < 0) {perror...}
  len = read(dvsend_param->ieee1394dv.fd, recvbuf, 512);
  if (len < 1) {
    printf("ieee1394 recv len : %d\n", len);
    break;
  }

  I get  following:
---
-su-2.05b# ./test_fw
ieee1394 recv len : -1
/dev/fw0 read: Resource temporarily unavailable
---

BTW:
---
-su-2.05b# ls -l /dev/fw*
crwxrwx---  1 root  operator  127,   0 Dec 30 22:10 /dev/fw0
crwxrwx---  1 root  operator  127,   1 Dec 30 22:10 /dev/fw1
crwxrwx---  1 root  operator  127,   2 Dec 30 22:10 /dev/fw2
crwxrwx---  1 root  operator  127,   3 Dec 30 22:10 /dev/fw3
crwxrwx---  1 root  operator  127, 0x01000000 Dec 30 22:10 /dev/fwmem0
---

A small sidenote: when I was playing with this device using C
I found I need to include:
#include "/sys/dev/firewire/firewire.h"
to get to constants and structures like FW_SSTBUF and bufreq.
Why is this header not included somewhere in /usr/include?

Am I supposed to treat this device in some other special way? BTW: I
was able to use this camera with some other machine that runs
FreeBSD 4.6.2 with patch from DVTS (patched once again by myself
because of lazy BIOS on that machine, see
http://cheminfo.chemi.muni.cz/~hopet/FreeBSD/ASUS_T9400.html
if interested) so I think camera is OK.

Thanks very much in advance for your help and the best wishes for 2003!
Petr

================================================================
                            Petr Holub
CESNET z.s.p.o.                       Supercomputing Center Brno
Zikova 4                             Institute of Compt. Science
162 00 Praha 6, CZ                            Masaryk University
Czech Republic                     Botanicka 68a, 60200 Brno, CZ
e-mail: Petr.Holub@cesnet.cz               phone: +420-541512213
                                             fax: +420-541212747
                                       e-mail: hopet@ics.muni.cz

Copyright (c) 1992-2002 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD 5.0-RC2 #0: Sat Dec 28 16:38:26 CET 2002
    toor@trurl.ics.muni.cz:/usr/src/sys/i386/compile/TRURL
Preloaded elf kernel "/boot/kernel/kernel" at 0xc0725000.
Preloaded elf module "/boot/kernel/acpi.ko" at 0xc07250a8.
Timecounter "i8254"  frequency 1193182 Hz
CPU: Pentium 4 (2372.93-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0xf27  Stepping = 7

Features=0xffffffffbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SS
E2,SS,HTT,TM,<b31>>
real memory  = 1073180672 (1023 MB)
avail memory = 1035169792 (987 MB)
Changing APIC ID for IO APIC #0 from 0 to 4 on chip
Programming 24 pins in IOAPIC #0
IOAPIC #0 intpin 2 -> irq 0
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
 cpu0 (BSP): apic id:  0, version: 0x00050014, at 0xfee00000
 cpu1 (AP):  apic id:  2, version: 0x00050014, at 0xfee00000
 io0 (APIC): apic id:  4, version: 0x00178020, at 0xfec00000
Initializing GEOMetry subsystem
Pentium Pro MTRR support enabled
npx0: <math processor> on motherboard
npx0: INT 16 interface
acpi0: <DELL   WS 530 > on motherboard
    ACPI-0625: *** Info: GPE Block0 defined as GPE0 to GPE15
Using $PIR table, 12 entries at 0xc00fb9a0
acpi0: power button is handled as a fixed feature programming model.
Timecounter "ACPI-fast"  frequency 3579545 Hz
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
acpi_cpu0: <CPU> on acpi0
acpi_cpu1: <CPU> on acpi0
acpi_cpu2: <CPU> on acpi0
acpi_cpu3: <CPU> on acpi0
acpi_button0: <Power Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
IOAPIC #0 intpin 19 -> irq 2
IOAPIC #0 intpin 17 -> irq 13
IOAPIC #0 intpin 23 -> irq 16
agp0: <Intel 82860 host to AGP bridge> mem 0xf0000000-0xf7ffffff at device 0.0 on pci0
pcib1: <PCIBIOS PCI-PCI bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
IOAPIC #0 intpin 16 -> irq 17
pci1: <display, VGA> at device 0.0 (no driver attached)
pcib2: <ACPI PCI-PCI bridge> at device 2.0 on pci0
pci2: <ACPI PCI bus> on pcib2
pcib3: <ACPI PCI-PCI bridge> at device 31.0 on pci2
pci3: <ACPI PCI bus> on pcib3
IOAPIC #0 intpin 20 -> irq 18
IOAPIC #0 intpin 22 -> irq 19
pci3: <base peripheral, interrupt controller> at device 0.0 (no driver attached)
em0: <Intel(R) PRO/1000 Network Connection, Version - 1.4.7> port 0xece0-0xecff mem 0xfe4a0000-0xfe4bffff,0xfe4c0000-0xfe4dffff irq
18 at device 12.0 on pci3
em0:  Speed:100 Mbps  Duplex:Full
ahc0: <Adaptec aic7892 Ultra160 SCSI adapter> port 0xe800-0xe8ff mem 0xfe4fe000-0xfe4fefff irq 19 at device 14.0 on pci3
aic7892: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
pcib4: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci4: <ACPI PCI bus> on pcib4
IOAPIC #0 intpin 18 -> irq 20
xl0: <3Com 3c905C-TX Fast Etherlink XL> port 0xdc80-0xdcff mem 0xfe1ffc00-0xfe1ffc7f irq 16 at device 11.0 on pci4
xl0: Ethernet address: 00:08:74:39:45:65
miibus0: <MII bus> on xl0
ukphy0: <Generic IEEE 802.3u media interface> on miibus0
ukphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fwohci0: <Texas Instruments TSB12LV26> mem 0xfe1f8000-0xfe1fbfff,0xfe1ff000-0xfe1ff7ff irq 17 at device 12.0 on pci4
fwohci0: PCI bus latency was changing to 250.
fwohci0: OHCI version 1.0 (ROM=0)
fwohci0: No. of Isochronous channel is 4.
fwohci0: Link 1394a available S400, 2 ports, maxrec 2048 bytes.
fwohci0: EUI64 80:74:08:00:65:45:39:00
firewire0: <IEEE1394(Firewire) bus> on fwohci0
pcm0: <Creative EMU10K1> port 0xdc60-0xdc7f irq 13 at device 13.0 on pci4
bktr0: <BrookTree 878> mem 0xfa003000-0xfa003fff irq 20 at device 14.0 on pci4
bktr0: Warning - card vendor 0xfefe (model 0x0012) unknown.
bktr0: Pinnacle/Miro TV, Temic NTSC tuner.
pci4: <multimedia> at device 14.1 (no driver attached)
bktr1: <BrookTree 878> mem 0xfa001000-0xfa001fff irq 2 at device 15.0 on pci4
bktr1: Warning - card vendor 0x11bd (model 0x0012) unknown.
bktr1: Pinnacle/Miro TV, Temic NTSC tuner.
pci4: <multimedia> at device 15.1 (no driver attached)
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel ICH2 ATA100 controller> port 0xffa0-0xffaf at device 31.1 on pci0
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
uhci0: <Intel 82801BA/BAM (ICH2) USB controller USB-A> port 0xff80-0xff9f irq 2 at device 31.2 on pci0
usb0: <Intel 82801BA/BAM (ICH2) USB controller USB-A> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
uhci1: <Intel 82801BA/BAM (ICH2) USB controller USB-B> port 0xff60-0xff7f irq 16 at device 31.4 on pci0
usb1: <Intel 82801BA/BAM (ICH2) USB controller USB-B> on uhci1
usb1: USB revision 1.0
uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
pcm1: <Intel 82801BA (ICH2)> port 0xcc40-0xcc7f,0xc800-0xc8ff irq 13 at device 31.5 on pci0
fdc0: <Enhanced floppy controller (i82077, NE72065 or clone)> port 0x3f7,0x3f0-0x3f5 irq 6 drq 2 on acpi0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
atkbdc0: <Keyboard controller (i8042)> port 0x64,0x60 irq 1 on acpi0
atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
kbd0 at atkbd0
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model NetMouse/NetScroll Optical, device ID 0
sio0 port 0x3f8-0x3ff irq 4 on acpi0
sio0: type 16550A
sio1 port 0x2f8-0x2ff irq 3 on acpi0
sio1: type 16550A
ppc0 port 0x778-0x77f,0x378-0x37f irq 7 on acpi0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/8 bytes threshold
plip0: <PLIP network interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
orm0: <Option ROMs> at iomem 0xce800-0xcffff,0xc9000-0xce7ff,0xc0000-0xc8fff on isa0
pmtimer0 on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Timecounters tick every 10.000 msec
APIC_IO: Testing 8254 interrupt delivery
APIC_IO: routing 8254 via IOAPIC #0 intpin 2
firewire0: BUS reset
firewire0: node_id = 0x8800ffc0, non CYCLEMASTER mode
firewire0: 2 nodes, maxhop <= 1, cable IRM = 1
ad0: 76293MB <IC35L080AVVA07-0> [155009/16/63] at ata0-master UDMA100
acd0: DVD-ROM <LITEON DVD-ROM LTD163> at ata1-master PIO4
Waiting 15 seconds for SCSI devices to settle
pcm1: measured ac97 link rate at 55947 Hz
firewire0: new bus manager 63
firewire0: New S100 device ID:08004601023531bb
firewire0: Device AV/C
SMP: AP CPU #1 Launched!
da0 at ahc0 bus 0 target 0 lun 0
da0: <SEAGATE ST336752LW 2212> Fixed Direct Access SCSI-3 device
da0: 160.000MB/s transfers (80.000MHz, offset 63, 16bit), Tagged Queueing Enabled
da0: 34732MB (71132959 512 byte sectors: 255H 63S/T 4427C)
Mounting root from ufs:/dev/ad0s1a


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-firewire" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003c01c2b306$45afa5b0$2603fb93>