problem with vr0

George Georgalis george at galis.org
Wed Jan 26 21:48:08 PST 2005


On Wed, Jan 26, 2005 at 07:37:02PM +0000, Gary Allan wrote:
>
>I've noticed that polling support for the vr device can not be 
>controlled or displayed from ifconfig (Unlike in FreeBSD). Adding the 
>following seems to enable that support. No guarantees on correctness but 
>maybe someone else can take a look.
>
>cd /usr/src/sys/dev/netif/vr/
>diff -ruN if_vr.c if_vr.c.new
>--- if_vr.c     2005-01-26 19:19:42.000000000 +0000
>+++ if_vr.c.new 2005-01-26 19:26:04.000000000 +0000
>@@ -880,6 +880,10 @@
>        ifp->if_init = vr_init;
>        ifp->if_baudrate = 10000000;
>        ifp->if_snd.ifq_maxlen = VR_TX_LIST_CNT - 1;
>+#ifdef DEVICE_POLLING
>+       ifp->if_capabilities |= IFCAP_POLLING;
>+#endif
>+       ifp->if_capenable = ifp->if_capabilities;
>
>        /*
>         * Do MII setup.
>@@ -1690,6 +1694,11 @@
>                mii = device_get_softc(sc->vr_miibus);
>                error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
>                break;
>+       case SIOCSIFCAP:
>+                ifp->if_capenable &= ~IFCAP_POLLING;
>+                ifp->if_capenable |= ifr->ifr_reqcap & IFCAP_POLLING;
>+                break;
>+
>        default:
>                error = EINVAL;
>                break;
>
>
>After the modifications with DEVICE_POLLING kernel support and 
>kern.polling.enable=1.

Neat, now I can see that polling is really on...

# ifconfig vr0 -polling && ifconfig vr0
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::230:1bff:feb4:99a8%vr0 prefixlen 64 scopeid 0x3 
        inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
        ether 00:30:1b:b4:99:a8
        media: Ethernet none (10baseT/UTP)
        status: no carrier
# ifconfig vr0 polling && ifconfig vr0
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=40<polling>
        inet6 fe80::230:1bff:feb4:99a8%vr0 prefixlen 64 scopeid 0x3 
        inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
        ether 00:30:1b:b4:99:a8
        media: Ethernet none (10baseT/UTP)
        status: no carrier

And I know exactly what people mean by vr0 code stinks, what a mess.

BTW - would it be reasonable to teach patch that tabs and spaces are
both whitespace?

// George

-- 
George Georgalis, systems architect, administrator Linux BSD IXOYE
http://galis.org/george/ cell:646-331-2027 mailto:george at xxxxxxxxx





More information about the Bugs mailing list