[nSLUG] Happy Meal Ethernet

Peter Cordes peter at llama.nslug.ns.ca
Wed Mar 19 17:19:48 AST 2003


On Wed, Mar 19, 2003 at 12:08:41PM -0400, Donald Teed wrote:
> 
> I found a solution on the Debian Sparc mailing list.
> 
> There is a patch to kernel source available (description of
> the edit needed actually):
> 
> http://sparclinux.net/pub/patches/U1-hme-lockup.patch
> 
> When that udelay(1); line is added, and the kernel recompiled
> (2.4.20 in this case), the Sparc Ultra 1 Creator machine
> has a happy meal ethernet in name and function.

 I guess it needs extra time to get fries with that, eh.

 (Those who haven't heard about some of the funniest comments in the kernel,
see below):

static void happy_meal_tcvr_write(struct happy_meal *hp,
                                  unsigned long tregs, int reg,
                                  unsigned short value)
{
        int tries = TCVR_WRITE_TRIES;
        
        ASD(("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg, value));

        /* Welcome to Sun Microsystems, can I take your order please? */
        if (!hp->happy_flags & HFLAG_FENABLE)
                return happy_meal_bb_write(hp, tregs, reg, value);

        /* Would you like fries with that? */
        hme_write32(hp, tregs + TCVR_FRAME,
                    (FRAME_WRITE | (hp->paddr << 23) |
                     ((reg & 0xff) << 18) | (value & 0xffff)));
        while (!(hme_read32(hp, tregs + TCVR_FRAME) & 0x10000) && --tries)
                udelay(20);

        /* Anything else? */
        if (!tries)
                printk(KERN_ERR "happy meal: Aieee, transceiver MIF write bolixe
d\n");

        /* Fifty-two cents is your change, have a nice day. */
}


> 
> This is the first solution I've found that can survive an nmap 
> probe and keep the ethernet connection up.

 Cool.  Too bad the fix involves busy-waiting, if only for a microsecond.
Can you (still?) send back-back packets with the patch installed?  (packet
rate with ping -f might be a good test, because the delay probably happens
for every packet sent to the card.  ping -f would be a good way to make sure
the problem is really fixed/worked around).  Not that it matters, I guess, since
it's a tiny delay and you're not going to need massive throughput.

-- 
#define X(x,y) x##y
Peter Cordes ;  e-mail: X(peter at llama.nslug. , ns.ca)

"The gods confound the man who first found out how to distinguish the hours!
 Confound him, too, who in this place set up a sundial, to cut and hack
 my day so wretchedly into small pieces!" -- Plautus, 200 BC



More information about the nSLUG mailing list