summaryrefslogtreecommitdiffstats
path: root/sys/scsi
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-03-16 18:17:34 +0000
committerbde <bde@FreeBSD.org>1995-03-16 18:17:34 +0000
commit289f11acb49b6dbb3081e09bf94a86f008f55814 (patch)
treee4952f18ac85eccbbd3d9b0f010098732d07fe6d /sys/scsi
parent4c4945abee9eabe3a2be340ba973ae861c21a3c6 (diff)
downloadFreeBSD-src-289f11acb49b6dbb3081e09bf94a86f008f55814.zip
FreeBSD-src-289f11acb49b6dbb3081e09bf94a86f008f55814.tar.gz
Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) and most of the warnings from `gcc -Wnested-externs'. Fix all the bugs found. There were no serious ones.
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/scsi_driver.c4
-rw-r--r--sys/scsi/scsiconf.c11
-rw-r--r--sys/scsi/scsiconf.h6
-rw-r--r--sys/scsi/sd.c17
4 files changed, 24 insertions, 14 deletions
diff --git a/sys/scsi/scsi_driver.c b/sys/scsi/scsi_driver.c
index 785e755..b5f3fad 100644
--- a/sys/scsi/scsi_driver.c
+++ b/sys/scsi/scsi_driver.c
@@ -35,13 +35,15 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_driver.c,v 1.4 1995/03/05 20:01:44 dufault Exp $
+ * $Id: scsi_driver.c,v 1.5 1995/03/15 14:22:06 dufault Exp $
*
*/
#include <sys/types.h>
#include <sys/errno.h>
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/buf.h>
+#include <sys/devconf.h>
#include <sys/malloc.h>
#include <scsi/scsi_all.h>
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index f4cff94..53dbf27 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -16,7 +16,7 @@
*
* New configuration setup: dufault@hda.com
*
- * $Id: scsiconf.c,v 1.22 1995/03/06 15:02:13 dufault Exp $
+ * $Id: scsiconf.c,v 1.23 1995/03/15 14:22:08 dufault Exp $
*/
#include <sys/types.h>
@@ -41,6 +41,13 @@
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
+/*
+ * XXX SCSI_DEVICE_ENTRIES() generates extern switches but it should
+ * generate static switches except for this. Separate macros are
+ * probably required for the extern and static parts.
+ */
+extern struct scsi_device uk_switch;
+
/* Extensible arrays: Use a realloc like implementation to permit
* the arrays to be extend. These are set up to be moved out
* of this file if needed elsewhere.
@@ -388,7 +395,6 @@ scsi_device_register(struct scsi_device *sd)
static struct scsi_device *
scsi_device_lookup(int type)
{
- extern struct scsi_device uk_switch;
struct scsi_device *sd;
for (sd = device_list; sd; sd = sd->next)
@@ -401,7 +407,6 @@ scsi_device_lookup(int type)
static struct scsi_device *
scsi_device_lookup_by_name(char *name)
{
- extern struct scsi_device uk_switch;
struct scsi_device *sd;
for (sd = device_list; sd; sd = sd->next)
diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h
index 2c18e9c..47c963b 100644
--- a/sys/scsi/scsiconf.h
+++ b/sys/scsi/scsiconf.h
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
*
- * $Id: scsiconf.h,v 1.18 1995/03/01 22:24:44 dufault Exp $
+ * $Id: scsiconf.h,v 1.19 1995/03/04 20:51:00 dufault Exp $
*/
#ifndef SCSI_SCSICONF_H
#define SCSI_SCSICONF_H 1
@@ -440,6 +440,7 @@ struct scsi_xfer
#define XS_LENGTH 0x09 /* Illegal length (over/under run) */
#ifdef KERNEL
+void *extend_get(struct extend_array *ea, int index);
char * scsi_type_long_name(int type);
char * scsi_type_name(int type);
void scsi_attachdevs __P((struct scsi_link *sc_link_proto));
@@ -454,7 +455,9 @@ errval scsi_inquire( struct scsi_link *sc_link,
errval scsi_prevent( struct scsi_link *sc_link, u_int32 type,u_int32 flags);
errval scsi_probe_busses __P(( int, int, int));
errval scsi_start_unit( struct scsi_link *sc_link, u_int32 flags);
+errval scsi_stop_unit(struct scsi_link *sc_link, u_int32 eject, u_int32 flags);
void scsi_done(struct scsi_xfer *xs);
+void scsi_user_done(struct scsi_xfer *xs);
errval scsi_scsi_cmd( struct scsi_link *sc_link, struct scsi_generic *scsi_cmd,
u_int32 cmdlen, u_char *data_addr,
u_int32 datalen, u_int32 retries,
@@ -469,6 +472,7 @@ struct proc *p)));
int scsi_opened_ok __P((dev_t dev, int flag, int type, struct scsi_link *sc_link));
+char *scsi_sense_desc(int asc, int ascq);
void scsi_sense_print(struct scsi_xfer *xs);
void show_scsi_xs(struct scsi_xfer *xs);
void show_scsi_cmd(struct scsi_xfer *xs);
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index b334b4c..62d05d2 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
*
- * $Id: sd.c,v 1.53 1995/03/06 05:36:59 davidg Exp $
+ * $Id: sd.c,v 1.54 1995/03/15 14:22:10 dufault Exp $
*/
#define SPLSD splbio
@@ -40,6 +40,8 @@
#include <vm/vm.h>
#include <sys/devconf.h>
#include <sys/dkstat.h>
+#include <machine/md_var.h>
+#include <i386/i386/cons.h> /* XXX */
u_int32 sdstrats, sdqueues;
@@ -1030,10 +1032,7 @@ sddump(dev_t dev)
int32 nblocks;
char *addr;
struct scsi_rw_big cmd;
- extern int Maxmem;
static int sddoingadump = 0;
- extern caddr_t CADDR1; /* map the page we are about to write, here */
- extern struct pte *CMAP1;
struct scsi_xfer *xs = &sx;
errval retval;
int c;
@@ -1041,8 +1040,8 @@ sddump(dev_t dev)
addr = (char *) 0; /* starting address */
/* toss any characters present prior to dump */
- while ((c = cncheckc(1)) && (c != 0x100));
- /*syscons and pccons differ */
+ while (cncheckc())
+ ;
/* size of memory to dump */
num = Maxmem;
@@ -1082,7 +1081,7 @@ sddump(dev_t dev)
blknum = dumplo + blkoff;
while (num > 0) {
- *(int *)CMAP1 =
+ *(int *)CMAP1 = /* XXX use pmap_enter() */
PG_V | PG_KW | trunc_page(addr);
pmap_update();
/*
@@ -1112,7 +1111,7 @@ sddump(dev_t dev)
xs->resid = blkcnt * 512;
xs->error = XS_NOERROR;
xs->bp = 0;
- xs->data = (u_char *) CADDR1;
+ xs->data = (u_char *) CADDR1; /* XXX use pmap_enter() */
xs->datalen = blkcnt * 512;
/*
@@ -1137,7 +1136,7 @@ sddump(dev_t dev)
(int) addr += 512 * blkcnt;
/* operator aborting dump? */
- if ((c = cncheckc(1)) && (c != 0x100))
+ if (cncheckc())
return (EINTR);
}
return (0);
OpenPOWER on IntegriCloud