[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-vlan
Subject:    [VLAN] Re: [VLAN] Problem creating vlan devices [Solved]
From:       Ben Greear greearb () candelatech ! com
Date:       1999-12-28 14:59:58
[Download RAW message or body]

Markus Westergren wrote:
> 
> Ben Greear wrote:
> > I believe the real problem is that the driver for your ethernet card does
> > not zero out the netdevice.h 'device' structure before it starts configuring
> > it.  The result may be an eth0 device that has junk in it for a device->vlan_dev pointer,
> > and so the checks in my code think it could be a VLAN device instead of
> > a plain old ethernet device.
> >
> > I put some better error checking in the piece of code I believe is broken,
> > which should hopefully make it very clear which check is failing...
> >
> > When you get a chance, see what error messages you get when you use the
> > attached file.  (It belongs in net/802_1Q/)
> >
> > Also, what ethernet driver do you use?
> >
> > Thanks,
> > Ben
> >
> > --
> > Ben Greear (greearb@candelatech.com)  http://scry.wanfear.com/~greear
> > Author of ScryMUD:  scry.wanfear.com 4444        (Released under GPL)
> > http://scry.wanfear.com
> 
> Yes, you're right the problem was in the ethernet driver. I added the
> following code to __initfunc in the ne.c (i have two NE2000 NICs):
> 
> #ifdef CONFIG_VLAN_802_1Q
>    /* If we're using VLAN clear some variables */
>    dev->vlan_dev = NULL;
>    dev->default_vid = 1;   /* Is this OK? */
> #endif
> 
> And it works!! Should dev->default_vid have some special value? Thanks
> for your help.
> 
> /Markus

The driver should really do something like this when it first gets the device:
memset(&dev, 0, sizeof(struct device));

At least I believe that is the right thing to do.  It might be worth
sending that fix off to the maintainer of the driver too...

The dev->default_vid should be zero when it is not being used by a VLAN
(ie at init).  The vlan code will set the appropriate value when/if you
add it to a vlan.

Enjoy,
Ben

> 
> _______________________________________________
> VLAN mailing list  -  VLAN@Scry.WANfear.com
> http://www.WANfear.com/mailman/listinfo/vlan
> VLAN Page:  http://scry.wanfear.com/~greear/vlan.html

-- 
Ben Greear (greearb@candelatech.com)  http://scry.wanfear.com/~greear 
Author of ScryMUD:  scry.wanfear.com 4444        (Released under GPL)
http://scry.wanfear.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic