lkml.org 
[lkml]   [2000]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Interface change: Now or later?


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/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.060 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site