linux-mips-fnet
[Top] [All Lists]

declance coding blues

To: linux-mips@fnet.fr
Subject: declance coding blues
From: Richard van den Berg <R.vandenBerg@inter.NL.net>
Date: Mon, 31 Aug 1998 13:58:12 +0200 (MET DST)
Hello,

I worked out Haralds proposal a bit further:

#include <asm/bootinfo.h>

...

        if (TURBOCHANNEL) {
                if (IOASIC && dev->name == 0x8010a1dc){
                        /* first device is on IOASIC, for some reason "eth0"
                         * doesn't work
                         */
                        esar_base = (char *)(system_base + 0x80002);
                        dev->base_addr = system_base + 0xc0000;
                } else {
                        /* check if there's a PMAD-AA present and calculate
                         * it's addresses
                         */
                }
        }

        /* dunno if that works on DS5100 */
        switch (mips_machtype) {
        case MACH_DS23100 || MACH_DS5100:
                esar_base = (char *)0xbd000001;
                dev->base_addr = 0xb8000000;
                break;
        }

        if(!esar_base){
                printk("Don't know where to find the LANCE!");
                exit;
        }

and works fine, the only thing that bothers me is the comparison of
dev->name. Like the comment says putting "eth0" instead of 0x8010a1dc
doesn't work. This is the story of dev: it is from the device structure
in include/linux/netdevice.h and the first initializition in it is

char *name;

In drivers/net/Space.c "eth0" is assigned to name and dev->name shows
up as eth0 it only is not equal to eth0, why?!
I got the value 0x8010a1dc from

printk("%x\n", dev->name);

Any light on this is very appriciated.

Regards,

Richard

<Prev in Thread] Current Thread [Next in Thread>
  • declance coding blues, Richard van den Berg <=