Re: [PATCH] Topcliff PHUB: Generate PacketHub driver

From: Arnd Bergmann
Date: Wed Jun 16 2010 - 06:51:02 EST


On Wednesday 16 June 2010, Masayuki Ohtake wrote:
> > Especially if you want to be able to use tools like 'cat', 'hexdump'
> > or 'dd' on the file descriptor, you need to implement support for
> > short reads.
> I don't know how to test(short read/write access).
> Could you tell me how to do the above ?

The easiest way is using dd, where you can specify the block
size as well as input and output offsets.

e.g.
dd if=/dev/topcliffphub of=testfile bs=7

Should be able to read the contents of the rom completely
without error conditions, copying seven bytes at a time.

dd if=inputfile of=/dev/topcliffphub bs=1 seek=1024 count=16

would write 16 bytes from inputfile into the rom at position 1024.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/