async bug
Doug Rabson
dfr at nlsystems.com
Wed May 19 01:13:20 PDT 2004
On Tuesday 18 May 2004 22:33, Buzz Slye wrote:
> The code for the version of 2004/03/28 does not appear to work
> correctly for an asyncronus request of a single register.
>
> (i.e., try: fwcontrol -b 0)
>
> R. E. Slye
> NASA/Ames
The ioctl api is very confusing to use. I had to use the kernel debugger
to get my test program that reads quads over the bus to work. The code
below should work:
uint32_t
fw_read_quad(int fd, int node, uint64_t addr)
{
struct fw_asyreq req;
memset(&req, 0, sizeof req);
req.req.type = FWASREQNODE;
req.req.len = sizeof(req.pkt.mode.rreqq) + 2*sizeof(uint32_t);
req.pkt.mode.rreqq.dst = FWLOCALBUS | node;
req.pkt.mode.rreqq.tcode = FWTCODE_RREQQ;
req.pkt.mode.rreqq.dest_hi = addr >> 32;
req.pkt.mode.rreqq.dest_lo = addr;
if (ioctl(fd, FW_ASYREQ, &req) < 0) {
err(1, "ioctl");
return 0;
}
return req.pkt.mode.rresq.data;
}
More information about the freebsd-firewire
mailing list