From volf@oasis.IAEhv.nl  Sun Nov 23 09:47:21 1997
Received: from news.IAEhv.nl (root@news.IAEhv.nl [194.151.64.4])
          by hub.freebsd.org (8.8.7/8.8.7) with SMTP id JAA20982
          for <freebsd-gnats-submit@freebsd.org>; Sun, 23 Nov 1997 09:47:16 -0800 (PST)
          (envelope-from volf@oasis.IAEhv.nl)
Received: from oasis.IAEhv.nl (uucp@localhost) 
          by news.IAEhv.nl (8.6.13/1.63) with IAEhv.nl; pid 18000
          on Sun, 23 Nov 1997 17:47:12 GMT; id RAA18000
          efrom: volf@oasis.IAEhv.nl; eto: freebsd.org!freebsd-gnats-submit
Received: from LOCAL (volf@localhost) 
          by oasis.IAEhv.nl (8.8.8/1.63); pid 3668 
          on Sun, 23 Nov 1997 17:43:43 GMT; id RAA03668
          efrom: volf; eto: UNKNOWN
Message-Id: <199711231743.RAA03668@oasis.IAEhv.nl>
Date: Sun, 23 Nov 1997 17:43:43 GMT
From: volf@oasis.IAEhv.nl (Frank Volf)
Reply-To: volf@oasis.IAEhv.nl
To: FreeBSD-gnats-submit@freebsd.org
Cc: volf@oasis.IAEhv.nl
Subject: ncrcontrol version mismatch
X-Send-Pr-Version: 3.2

>Number:         5133
>Category:       kern
>Synopsis:       ncrcontrol version mismatch
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 23 09:50:00 PST 1997
>Closed-Date:    Sat Dec 6 16:40:13 PST 1997
>Last-Modified:  Sat Dec  6 16:43:39 PST 1997
>Originator:     Frank Volf
>Release:        FreeBSD 2.2.2-RELEASE i386
>Organization:
Frank Volf's private UUCP site, Eindhoven, the Netherlands
>Environment:

FreeBSD oasis.IAEhv.nl 2.2.2-RELEASE FreeBSD 2.2.2-RELEASE #1: Wed Nov 19
14:34:41 MET 1997     volf@oasis.IAEhv.nl:/new/usr/src/sys/compile/OASIS i386

>Description:

Kernel compilation with option FAILSAFE changes the size of the internal
data structures of the ncr driver. 

To be precise MAX_START is different for kernels compiled with and without
FAILSAFE. MAX_START is used in the ncb struct, so this structure has a
different size for kernels with and without FAILSAFE.

Unfortunately, the size of this struct is used to calculate the "ncr
version" (as strored in the const ncr_version), which is calculated as

static const u_long     ncr_version = NCR_VERSION       * 11
        + (u_long) sizeof (struct ncb)  *  7
        + (u_long) sizeof (struct ccb)  *  5
        + (u_long) sizeof (struct lcb)  *  3
        + (u_long) sizeof (struct tcb)  *  2;

in ncr.c

A problem arises when compiling the ncrcontrol.c program. This program 
(correctly) checks if the kernel ncr version is equal to the ncr version
with which this program is build. Unfortunately, the FAILSAFE option
is not passed to the cc command line compiling ncrcontrol.c, thus
the ncrcontrol program will *always* complain about the version mismatch
when used with a "FAILSAFE" kernel. Adding -DFAILSAFE to the CFLAGS
in the Makefile fixes the problem for me, but that is of course very
undesirable solution.

Currently, I don't see a clean way to solve this problem, other than always
using the same datastructures (and thus waste a few bytes when FAILSAFE
is specified).

BTW: I only looked at the 2.2.2 kernel code, I don't know if this is
fixed in current.

Frank
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: se 
State-Changed-When: Sat Dec 6 16:40:13 PST 1997 
State-Changed-Why:  
Fixed in rev. 1.113 (1.82.2.10 for RELENG_2_2) of ncr.c: 
Define MAX_START as 32, independent of the default number of tags. 
>Unformatted:
