FTL endianness

David Woodhouse dwmw2 at infradead.org
Mon Mar 27 05:01:37 EST 2000


I'm porting the latest FTL code to the MTD system. I see code like this:

  if ((header.NumEraseUnits > 65536) || (header.BlockSize != 9) ||
	(header.EraseUnitSize < 10) || (header.EraseUnitSize > 31) ||
	(header.NumTransferUnits >= header.NumEraseUnits)) {
	printk(KERN_NOTICE "ftl_cs: FTL header corrupt!\n");
	return -1;
    }

This is odd - unless I'm missing something, it means that FTL on bigendian
machines has to be bigendian, and FTL on littleendian machines has to be
littleendian. And that you can't swap flash cards between the two.

The NFTL spec certainly says that the format on the media should be 
little-endian, so I byteswap it all. Isn't this the case for FTL?

If so - how many people are actually using FTL on BE machines? If there aren't 
{m,}any, we can just fix it and forget about it. Otherwise we could make it 
conditional and/or provide two modules - ftl_be and ftl_le.


--
dwmw2




To unsubscribe, send "unsubscribe mtd" to majordomo at infradead.org



More information about the linux-mtd mailing list