From owner-freebsd-hackers Wed Nov 20 23:00:52 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id XAA09566 for hackers-outgoing; Wed, 20 Nov 1996 23:00:52 -0800 (PST) Received: from mail.hughes.net (mail.hughes.net [205.139.34.24]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id XAA09561 for ; Wed, 20 Nov 1996 23:00:47 -0800 (PST) Received: from trailblazer.com ([205.139.43.19]) by mail.hughes.net (post.office MTA v1.9.3 ID# 0-13727) with SMTP id AAA22800 for <@mail.hughes.net:freebsd-hackers@freebsd.org>; Wed, 20 Nov 1996 23:00:45 -0800 Received: by trailblazer.com (940816.SGI.8.6.9/930416.SGI) for freebsd-hackers@freebsd.org id XAA08286; Wed, 20 Nov 1996 23:02:15 -0800 From: "Jon Morgan" Message-Id: <9611202302.ZM8284@terminus.trailblazer.com> Date: Wed, 20 Nov 1996 23:02:14 -0800 X-Mailer: Z-Mail (3.2.0 26oct94 MediaMail) To: freebsd-hackers@freebsd.org Subject: vx driver problems Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I found problems in if_vx.c where the driver handles ifconfig link[012] flags. The driver is ANDing the index into the connector_table rather than the actual bit value out of the table. Here's the code for 2.1.6-RELEASE that fixes the problem: *** if_vx.c.orig Wed Nov 20 20:07:59 1996 --- if_vx.c Wed Nov 20 21:45:35 1996 *************** *** 355,365 **** * (if present on card or AUI if not). */ /* Set the xcvr. */ ! if(ifp->if_flags & IFF_LINK0 && sc->vx_connectors & CONNECTOR_AUI) { i = CONNECTOR_AUI; ! } else if(ifp->if_flags & IFF_LINK1 && sc->vx_connectors & CONNECTOR_BNC) { i = CONNECTOR_BNC; ! } else if(ifp->if_flags & IFF_LINK2 && sc->vx_connectors & CONNECTOR_UTP) { i = CONNECTOR_UTP; } else { i = sc->vx_connector; --- 355,365 ---- * (if present on card or AUI if not). */ /* Set the xcvr. */ ! if(ifp->if_flags & IFF_LINK0 && sc->vx_connectors & connector_table[CONNECTOR_AUI].bit) { i = CONNECTOR_AUI; ! } else if(ifp->if_flags & IFF_LINK1 && sc->vx_connectors & connector_table[CONNECTOR_BNC].bit) { i = CONNECTOR_BNC; ! } else if(ifp->if_flags & IFF_LINK2 && sc->vx_connectors & connector_table[CONNECTOR_UTP].bit) { i = CONNECTOR_UTP; } else { i = sc->vx_connector; and here's the equivalent code for 3.0-CURRENT (I havn't tested this, but it should be the same): *** if_vx.c.orig Wed Nov 20 20:07:59 1996 --- if_vx.c Wed Nov 20 21:45:35 1996 *************** *** 355,365 **** * (if present on card or AUI if not). */ /* Set the xcvr. */ ! if(ifp->if_flags & IFF_LINK0 && sc->vx_connectors & CONNECTOR_AUI) { i = CONNECTOR_AUI; ! } else if(ifp->if_flags & IFF_LINK1 && sc->vx_connectors & CONNECTOR_BNC) { i = CONNECTOR_BNC; ! } else if(ifp->if_flags & IFF_LINK2 && sc->vx_connectors & CONNECTOR_UTP) { i = CONNECTOR_UTP; } else { i = sc->vx_connector; --- 355,365 ---- * (if present on card or AUI if not). */ /* Set the xcvr. */ ! if(ifp->if_flags & IFF_LINK0 && sc->vx_connectors & connector_table[CONNECTOR_AUI].bit) { i = CONNECTOR_AUI; ! } else if(ifp->if_flags & IFF_LINK1 && sc->vx_connectors & connector_table[CONNECTOR_BNC].bit) { i = CONNECTOR_BNC; ! } else if(ifp->if_flags & IFF_LINK2 && sc->vx_connectors & connector_table[CONNECTOR_UTP].bit) { i = CONNECTOR_UTP; } else { i = sc->vx_connector;