Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Nov 1996 23:02:14 -0800
From:      "Jon Morgan" <morgan@terminus.trailblazer.com>
To:        freebsd-hackers@freebsd.org
Subject:   vx driver problems
Message-ID:  <9611202302.ZM8284@terminus.trailblazer.com>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9611202302.ZM8284>