Hi John,
>> I was writing a linux kernel driver for the icap,
>
> You mean like this one:
>
> http://www.itee.uq.edu.au/~listarch/.../msg00009.html
>
> ?
Yes, it is similar to yours, and I did download your xilinx_hwicap
before starting to work on mine. (And I certainly appreciate you making
your code available.) I ended up writing mine from scratch though
because I wanted to get gain a better understanding of linux drivers,
but more importantly because I wanted to be able to talk to the device
as /dev/icap from Java code (without JNI) or from a shell. I also
wanted to parse the bitstream header so that I could accept any normally
generated bitstream, and I believe your code assumes that there is no
header.
> I think I came across similar issues - with HWICAP you must always write
> a full frame at a time which means buffering in the driver in case the
> user does something like multiple byte writes (e.g. from "cat") instead
> of a nice big block write.
I did pick up that same impression from someone inside Xilinx, but with
the correction that I mentioned, I've had no problem just writing the
data as it comes in. As you're suggesting, "as it comes in" from
something like cat or cp or a Java write function, is completely
arbitrary, and unlikely even to be word aligned. (Admittedly, I do have
to pack the bytes into words, much like you do.) Perhaps I'm just
lucking out, but my icap driver routinely writes data that is decidedly
not split along frame boundaries, as the driver neither knows nor cares
where those boundaries fall.
Based on what I know of your driver, the correction that I mentioned
should work just as well for you as it did for me, and you might find
that it frees you from having to stick to frame boundaries. We can
compare code offline if need be.
Neil