On Wed, 2 Aug 2000, Rogier Wolff wrote:
>
> Correctly implemented phy-writers would then do:
>
> switch (addr >> 28) {
> case 0: if (val < 0x100) write_phy_8 (addr & 0x0fffffff, val);
> else if (val < 0x10000) write_phy_16 (addr & 0x0fffffff, val);
> else write_phy_32 (addr & 0x0fffffff, val);
> break;
> case 1: write_phy_8 (addr & 0x0fffffff, val);break;
> case 2: write_phy_16 (addr & 0x0fffffff, val);break;
> case 3: write_phy_32 (addr & 0x0fffffff, val);break;
> default: return -EIO; /* Don't know about fancy stuff */
> }
I would suggest making case 0 be the 8-bit one, and leaving binary
compatibility. I think you tried to do that by having case 0 together with
"val < 0x100" be the current case, but if somebody currently passes in the
upper bits as "don't care" due to knowing that it's an 8-bit interface..
And just drop the "autodetect" case. It doesn't add anything, and it's
going to result in flaky behaviour at some point. Make it another "future
expansion" thing, or possibly just document it as something private for
special needs where each phy-writer can just do something magical.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Mon Aug 07 2000 - 21:00:08 EST