Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Nov 2002 10:15:16 -0800 (PST)
From:      Buzz Slye <buzz@gaia.arc.nasa.gov>
To:        freebsd-firewire@freebsd.org
Subject:   Kodak on firewire
Message-ID:  <Pine.GSO.4.44.0211191013040.1262-100000@mono.arc.nasa.gov>

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

I am going to try this one again.  This time it really is a Kodak camera,
not an Oxford disk.  (The result fails the same way.)  The Kodak is not
a SCSI device.  The Kodak camera is logged in and attached by SBP-II as
follows:

firewire0: node_id = 0x8800ffc0, non CYCLEMASTER mode
firewire0: 2 nodes, maxhop <= 1, cable IRM = 0 (me)
fw_set_bus_manager: 63->0 (loop=0)
send phy_config root_node=-1 gap_count=1
start AT DMA status=11
firewire0:Discover new S400 device ID:00e0263d00006323
bus_explore done
Device Kodal Pro Back Plus
sbp_post_explore
sbp_post_explore: EUI:00e0263d00006323 spec=0 key=0.
sbp_alloc_target
sbp_probe_target 0
sbp0:0:0 sbp_mgm_orb
sbp0:0:0 LOGIN
sbp0:0:0 sbp_enqueue_ocb orb=0x42008 in physical memory
sbp0:0:0 ordered:0 type:16 EUI:00e0263d00006323 node:1 speed:2 maxrec:10 new!
sbp0:0:0 'Kodak' '(null)' '000000'
sbp0:0:0 sbp_login_callback
sbp resp: 0 len: 48 off: 0
sbp ffc00c10 ffc10001 00000000 00200000
sbp 41000000 00042008 00000000 00000000
sbp 00000000 00000000 00000000 00000000
received address 0x0
sbp0:0:0 ORB status src:1 resp:0 dead:0 len:1 stat:0 orb:0 00042008
sbp0:0:0 No additional information to report
orb: 0x42008 next: 0x0, flags 0
sbp0:0:0 login: len 12, ID 0, cmd 0000fffff0020000, recon_hold 0
sbp0:0:0 sbp_busy_timeout
sbp0:0:0 sbp_but_timeout_callback
sbp0:0:0 sbp_agent_reset
sbp0:0:0 sbp_do_attach
sbp0:0:0 sbp_cam_scan_lun
sbp0:0:0 XPT_PATH_INQ:.
sbp0:0:0 XPT_PATH_INQ:.
sbp0:0:0 XPT_SCSI_IO: cmd: 12 00 00 00 24 00 00 00 10 00, flags: 0x40, 6b cmd/36b data/18b sense
ORB 80000000 00000000 ffc00000 0004215c
ORB 8a900000 12000000 24000000 00000000
sbp0:0:0 sbp_enqueue_ocb orb=0x4213c in physical memory
sbp0:0:0 sbp_orb_pointer
sbp0:0:0 sbp_cmd_callback
sbp resp: 0 len: 48 off: 0
sbp ffc01810 ffc10001 00000000 00200000
sbp 47000000 0004213c 0b50500d 80000000
sbp 00000000 00000000 00000000 00000000
received address 0x0
sbp0:0:0 ORB status src:1 resp:0 dead:0 len:7 stat:0 orb:0 0004213c
sbp0:0:0 No additional information to report
orb: 0x4213c next: 0x0, flags 1
sbp0:0:0 XPT_SCSI_IO: cmd: 12 00 00 00 24 00 00 00 10 00, flags: 0x40, 6b cmd/36b data/18b sense
sbp0:0:0 SCSI status b sfmt 0 valid 0 key 0 code 50 qlfr d len 7
sbp_scsi_status: unknown scsi status
sbp0:0:0 sbp_fix_inq_data

   ..... the last 18 lines above are repeated several times .....

sbp0:0:0 sbp_cam_callback

I now would like to run a program which accesses the camera directly through
firewire.c by way of iotcl.  (This is what fw_tap.c does to run the ethernet
code.)  After opening "/dev/fw1" and allocating asyreq, I have the following:

	asyreq->req.type = FWASREQEUI;
	asyreq->req.sped = FWSPD_S400;
	asyreq->req.len = 120;
	asyreq->req.dst.eui.hi = DEVICE_EUI_HI;
	asyreq->req.dst.eui.lo = DEVICE_EUI_LO;

	asyreq->pkt.mode.common.tcode = FWTCODE_WREQB;
	asyreq->pkt.mode.wreqb.len = htons(24);
	asyreq->pkt.mode.wreqb.src = 0;			/* ??? */
	asyreq->pkt.mode.wreqb.dest_lo = htonl((int)resp);	/* ??? */
	asyreq->pkt.mode.wreqb.payload[0] = htonl(1 << 31);
	asyreq->pkt.mode.wreqb.payload[3] = 0;		/* ??? */
	asyreq->pkt.mode.wreqb.payload[4] = htonl(0x8a900000);
	asyreq->pkt.mode.wreqb.payload[5] = htonl(0x12000000);
	asyreq->pkt.mode.wreqb.payload[6] = htonl(0x24000000);

        ioctl(fd, FW_ASYREQ, asyreq);

Note that the inquiry command (the first byte of the command data block,
i.e., the 0x12 in payload[5]) is the same as already sent by SBP-II.
See the above XPT_SCSI_IO.  This results in:

fw_rcv: unknown response tcode=2 src=0xffc1 tl=34 rt=0 data=0x84511a82
try ad-hoc work around!!
no use...

The command orb has been sent, but the response fails.  A look at the
code for firewire.c shows that this message is generated because a call
to fw_tl2xfer indicates that the response destination does not agree
with the original source.  How can I get the response back to my program ?

Thanx,

        Robert Slye   MS 242-4
        NASA/Ames Research Center
        Moffett Field, CA 94035

        buzz@gaia.arc.nasa.gov





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?Pine.GSO.4.44.0211191013040.1262-100000>