Subject: kern/8141: "options NCR_TEKRAM_EEPROM" for /sys/dev/pci/ncr.c breaks compile
To: None <gnats-bugs@gnats.netbsd.org>
From: None <hopha@casema.net>
List: netbsd-bugs
Date: 08/03/1999 23:09:09
>Number: 8141
>Category: kern
>Synopsis: "options NCR_TEKRAM_EEPROM" for /sys/dev/pci/ncr.c breaks compile
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people (Kernel Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Aug 3 22:05:00 1999
>Last-Modified:
>Originator: Hans Hoppe
>Organization:
Guild of dysfunctional sysadmins
>Release: 1.4 (probably earlier too) through current
>Environment:
System: NetBSD 1.4 i386 with ncr pci SCSI driver.
The bug is in /sys/dev/pci/ncr.c, at least in v1.80 ad v1.81.
>Description:
If "options NCR_TEKRAM_EEPROM" is specified in the config file,
the kernel make halts on /sys/dev/pci/ncr.c with a missing
prototype error for read_tekram_eeprom.
>How-To-Repeat:
Put the ncr pci SCSI driver with "options NCR_TEKRAM_EEPROM"
in the kernel config file, then config and make.
>Fix:
In the following diff to /sys/dev/pci/ncr.c (v1.81), a prototype
is added for read_tekram_eeprom, and some related structures were
moved upward.
--- ncr.c.v1.81 Tue Aug 3 23:57:26 1999
+++ ncr.c Wed Aug 4 00:14:00 1999
@@ -1404,6 +1404,37 @@
ncrcmd snoopend [ 2];
};
+#ifdef NCR_TEKRAM_EEPROM
+struct tekram_eeprom_dev {
+ u_char devmode;
+#define TKR_PARCHK 0x01
+#define TKR_TRYSYNC 0x02
+#define TKR_ENDISC 0x04
+#define TKR_STARTUNIT 0x08
+#define TKR_USETAGS 0x10
+#define TKR_TRYWIDE 0x20
+ u_char syncparam; /* max. sync transfer rate (table ?) */
+ u_char filler1;
+ u_char filler2;
+};
+
+struct tekram_eeprom {
+ struct tekram_eeprom_dev
+ dev[16];
+ u_char adaptid;
+ u_char adaptmode;
+#define TKR_ADPT_GT2DRV 0x01
+#define TKR_ADPT_GT1GB 0x02
+#define TKR_ADPT_RSTBUS 0x04
+#define TKR_ADPT_ACTNEG 0x08
+#define TKR_ADPT_NOSEEK 0x10
+#define TKR_ADPT_MORLUN 0x20
+ u_char delay; /* unit ? (table ???) */
+ u_char tags; /* use 4 times as many ... */
+ u_char filler[60];
+};
+#endif
+
/*==========================================================
**
**
@@ -1468,6 +1499,11 @@
static void ncr_attach (pcici_t tag, int unit);
#endif /* __NetBSD__ */
+#ifdef NCR_TEKRAM_EEPROM
+static int read_tekram_eeprom
+ (ncb_p np, struct tekram_eeprom *buffer);
+#endif
+
#endif /* KERNEL */
/*==========================================================
@@ -8082,36 +8118,6 @@
/*=========================================================================*/
#ifdef NCR_TEKRAM_EEPROM
-
-struct tekram_eeprom_dev {
- u_char devmode;
-#define TKR_PARCHK 0x01
-#define TKR_TRYSYNC 0x02
-#define TKR_ENDISC 0x04
-#define TKR_STARTUNIT 0x08
-#define TKR_USETAGS 0x10
-#define TKR_TRYWIDE 0x20
- u_char syncparam; /* max. sync transfer rate (table ?) */
- u_char filler1;
- u_char filler2;
-};
-
-
-struct tekram_eeprom {
- struct tekram_eeprom_dev
- dev[16];
- u_char adaptid;
- u_char adaptmode;
-#define TKR_ADPT_GT2DRV 0x01
-#define TKR_ADPT_GT1GB 0x02
-#define TKR_ADPT_RSTBUS 0x04
-#define TKR_ADPT_ACTNEG 0x08
-#define TKR_ADPT_NOSEEK 0x10
-#define TKR_ADPT_MORLUN 0x20
- u_char delay; /* unit ? (table ???) */
- u_char tags; /* use 4 times as many ... */
- u_char filler[60];
-};
static void
tekram_write_bit (ncb_p np, int bit)
>Audit-Trail:
>Unformatted: