summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormjacob <mjacob@cvs.openbsd.org>2001-04-04 22:07:20 +0000
committermjacob <mjacob@cvs.openbsd.org>2001-04-04 22:07:20 +0000
commitba2ec9ad00ca8fb59a0a6b7541f20cbfd37726c8 (patch)
treebba06d402f436594f01f4ba5d3d53b29074aa343
parentbd4d73746acd6293ee009e2d0634a7e0bc8aa58c (diff)
Ansify source. Handles are now 16 bits.
-rw-r--r--sys/arch/sparc/dev/isp_sbus.c55
-rw-r--r--sys/dev/ic/isp_inline.h92
2 files changed, 45 insertions, 102 deletions
diff --git a/sys/arch/sparc/dev/isp_sbus.c b/sys/arch/sparc/dev/isp_sbus.c
index 3a6108b6343..6f52ca6f6be 100644
--- a/sys/arch/sparc/dev/isp_sbus.c
+++ b/sys/arch/sparc/dev/isp_sbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isp_sbus.c,v 1.15 2001/02/12 23:22:02 mjacob Exp $ */
+/* $OpenBSD: isp_sbus.c,v 1.16 2001/04/04 22:06:22 mjacob Exp $ */
/*
* SBus specific probe and attach routines for Qlogic ISP SCSI adapters.
*
@@ -47,14 +47,14 @@
#include <dev/microcode/isp/asm_sbus.h>
#endif
-static u_int16_t isp_sbus_rd_reg __P((struct ispsoftc *, int));
-static void isp_sbus_wr_reg __P((struct ispsoftc *, int, u_int16_t));
-static int isp_sbus_mbxdma __P((struct ispsoftc *));
-static int isp_sbus_dmasetup __P((struct ispsoftc *, struct scsi_xfer *,
- ispreq_t *, u_int16_t *, u_int16_t));
-static void isp_sbus_dmateardown __P((struct ispsoftc *, struct scsi_xfer *,
- u_int32_t));
-static int isp_sbus_intr __P((void *));
+static u_int16_t isp_sbus_rd_reg(struct ispsoftc *, int);
+static void isp_sbus_wr_reg(struct ispsoftc *, int, u_int16_t);
+static int isp_sbus_mbxdma(struct ispsoftc *);
+static int isp_sbus_dmasetup(struct ispsoftc *, struct scsi_xfer *,
+ ispreq_t *, u_int16_t *, u_int16_t);
+static void
+isp_sbus_dmateardown(struct ispsoftc *, struct scsi_xfer *, u_int16_t);
+static int isp_sbus_intr(void *);
#ifndef ISP_1000_RISC_CODE
#define ISP_1000_RISC_CODE NULL
@@ -93,10 +93,7 @@ struct cfattach isp_sbus_ca = {
};
static int
-isp_match(parent, cfarg, aux)
- struct device *parent;
- void *cfarg;
- void *aux;
+isp_match(struct device *parent, void *cfarg, void *aux)
{
int rv;
struct cfdata *cf = cfarg;
@@ -129,9 +126,7 @@ isp_match(parent, cfarg, aux)
}
static void
-isp_sbus_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
+isp_sbus_attach(struct device *parent, struct device *self, void *aux)
{
int freq, storebp = 0;
struct confargs *ca = aux;
@@ -272,9 +267,7 @@ isp_sbus_attach(parent, self, aux)
}
static u_int16_t
-isp_sbus_rd_reg(isp, regoff)
- struct ispsoftc *isp;
- int regoff;
+isp_sbus_rd_reg(struct ispsoftc *isp, int regoff)
{
struct isp_sbussoftc *sbc = (struct isp_sbussoftc *) isp;
int offset = sbc->sbus_poff[(regoff & _BLK_REG_MASK) >> _BLK_REG_SHFT];
@@ -283,10 +276,7 @@ isp_sbus_rd_reg(isp, regoff)
}
static void
-isp_sbus_wr_reg (isp, regoff, val)
- struct ispsoftc *isp;
- int regoff;
- u_int16_t val;
+isp_sbus_wr_reg(struct ispsoftc *isp, int regoff, u_int16_t val)
{
struct isp_sbussoftc *sbc = (struct isp_sbussoftc *) isp;
int offset = sbc->sbus_poff[(regoff & _BLK_REG_MASK) >> _BLK_REG_SHFT];
@@ -296,8 +286,7 @@ isp_sbus_wr_reg (isp, regoff, val)
static int
-isp_sbus_mbxdma(isp)
- struct ispsoftc *isp;
+isp_sbus_mbxdma(struct ispsoftc *isp)
{
struct isp_sbussoftc *sbc = (struct isp_sbussoftc *) isp;
size_t len;
@@ -365,12 +354,8 @@ isp_sbus_mbxdma(isp)
*/
static int
-isp_sbus_dmasetup(isp, xs, rq, iptrp, optr)
- struct ispsoftc *isp;
- struct scsi_xfer *xs;
- ispreq_t *rq;
- u_int16_t *iptrp;
- u_int16_t optr;
+isp_sbus_dmasetup(struct ispsoftc *isp, struct scsi_xfer *xs, ispreq_t *rq,
+ u_int16_t *iptrp, u_int16_t optr)
{
struct isp_sbussoftc *sbc = (struct isp_sbussoftc *) isp;
ispcontreq_t *crq;
@@ -439,10 +424,7 @@ mbxsync:
}
static void
-isp_sbus_dmateardown(isp, xs, handle)
- struct ispsoftc *isp;
- struct scsi_xfer *xs;
- u_int32_t handle;
+isp_sbus_dmateardown(struct ispsoftc *isp, XS_T *xs, u_int16_t handle)
{
struct isp_sbussoftc *sbc = (struct isp_sbussoftc *) isp;
vaddr_t kdvma;
@@ -462,8 +444,7 @@ isp_sbus_dmateardown(isp, xs, handle)
}
static int
-isp_sbus_intr(arg)
- void *arg;
+isp_sbus_intr(void *arg)
{
int r;
struct ispsoftc *isp = (struct ispsoftc *)arg;
diff --git a/sys/dev/ic/isp_inline.h b/sys/dev/ic/isp_inline.h
index e896fed280b..d94d223e0fa 100644
--- a/sys/dev/ic/isp_inline.h
+++ b/sys/dev/ic/isp_inline.h
@@ -1,8 +1,8 @@
-/* $OpenBSD: isp_inline.h,v 1.7 2001/03/02 04:49:02 mjacob Exp $ */
+/* $OpenBSD: isp_inline.h,v 1.8 2001/04/04 22:07:19 mjacob Exp $ */
/*
* Qlogic Host Adapter Inline Functions
*
- * Copyright (c) 1999, 2000 by Matthew Jacob
+ * Copyright (c) 1999, 2000, 2001 by Matthew Jacob
* Feral Software
* All rights reserved.
* mjacob@feral.com
@@ -39,29 +39,15 @@
* will be a seed for the last handled allocated.
*/
-static INLINE int
-isp_save_xs __P((struct ispsoftc *, XS_T *, u_int32_t *));
-
-static INLINE XS_T *
-isp_find_xs __P((struct ispsoftc *, u_int32_t));
-
-static INLINE u_int32_t
-isp_find_handle __P((struct ispsoftc *, XS_T *));
-
-static INLINE int
-isp_handle_index __P((u_int32_t));
-
-static INLINE void
-isp_destroy_handle __P((struct ispsoftc *, u_int32_t));
-
-static INLINE void
-isp_remove_handle __P((struct ispsoftc *, XS_T *));
+static INLINE int isp_save_xs(struct ispsoftc *, XS_T *, u_int16_t *);
+static INLINE XS_T *isp_find_xs(struct ispsoftc *, u_int16_t);
+static INLINE u_int16_t isp_find_handle(struct ispsoftc *, XS_T *);
+static INLINE int isp_handle_index(u_int16_t);
+static INLINE void isp_destroy_handle(struct ispsoftc *, u_int16_t);
+static INLINE void isp_remove_handle(struct ispsoftc *, XS_T *);
static INLINE int
-isp_save_xs(isp, xs, handlep)
- struct ispsoftc *isp;
- XS_T *xs;
- u_int32_t *handlep;
+isp_save_xs(struct ispsoftc *isp, XS_T *xs, u_int16_t *handlep)
{
int i, j;
@@ -85,27 +71,23 @@ isp_save_xs(isp, xs, handlep)
}
static INLINE XS_T *
-isp_find_xs(isp, handle)
- struct ispsoftc *isp;
- u_int32_t handle;
+isp_find_xs(struct ispsoftc *isp, u_int16_t handle)
{
- if (handle < 1 || handle > (u_int32_t) isp->isp_maxcmds) {
+ if (handle < 1 || handle > (u_int16_t) isp->isp_maxcmds) {
return (NULL);
} else {
return (isp->isp_xflist[handle - 1]);
}
}
-static INLINE u_int32_t
-isp_find_handle(isp, xs)
- struct ispsoftc *isp;
- XS_T *xs;
+static INLINE u_int16_t
+isp_find_handle(struct ispsoftc *isp, XS_T *xs)
{
int i;
if (xs != NULL) {
for (i = 0; i < isp->isp_maxcmds; i++) {
if (isp->isp_xflist[i] == xs) {
- return ((u_int32_t) i+1);
+ return ((u_int16_t) i+1);
}
}
}
@@ -113,39 +95,31 @@ isp_find_handle(isp, xs)
}
static INLINE int
-isp_handle_index(handle)
- u_int32_t handle;
+isp_handle_index(u_int16_t handle)
{
return (handle-1);
}
static INLINE void
-isp_destroy_handle(isp, handle)
- struct ispsoftc *isp;
- u_int32_t handle;
+isp_destroy_handle(struct ispsoftc *isp, u_int16_t handle)
{
- if (handle > 0 && handle <= (u_int32_t) isp->isp_maxcmds) {
+ if (handle > 0 && handle <= (u_int16_t) isp->isp_maxcmds) {
isp->isp_xflist[isp_handle_index(handle)] = NULL;
}
}
static INLINE void
-isp_remove_handle(isp, xs)
- struct ispsoftc *isp;
- XS_T *xs;
+isp_remove_handle(struct ispsoftc *isp, XS_T *xs)
{
isp_destroy_handle(isp, isp_find_handle(isp, xs));
}
static INLINE int
-isp_getrqentry __P((struct ispsoftc *, u_int16_t *, u_int16_t *, void **));
+isp_getrqentry(struct ispsoftc *, u_int16_t *, u_int16_t *, void **);
static INLINE int
-isp_getrqentry(isp, iptrp, optrp, resultp)
- struct ispsoftc *isp;
- u_int16_t *iptrp;
- u_int16_t *optrp;
- void **resultp;
+isp_getrqentry(struct ispsoftc *isp, u_int16_t *iptrp,
+ u_int16_t *optrp, void **resultp)
{
volatile u_int16_t iptr, optr;
@@ -163,17 +137,12 @@ isp_getrqentry(isp, iptrp, optrp, resultp)
return (0);
}
-static INLINE void
-isp_print_qentry __P((struct ispsoftc *, char *, int, void *));
+static INLINE void isp_print_qentry (struct ispsoftc *, char *, int, void *);
#define TBA (4 * (((QENTRY_LEN >> 2) * 3) + 1) + 1)
static INLINE void
-isp_print_qentry(isp, msg, idx, arg)
- struct ispsoftc *isp;
- char *msg;
- int idx;
- void *arg;
+isp_print_qentry(struct ispsoftc *isp, char *msg, int idx, void *arg)
{
char buf[TBA];
int amt, i, j;
@@ -190,15 +159,10 @@ isp_print_qentry(isp, msg, idx, arg)
}
}
-static INLINE void
-isp_print_bytes __P((struct ispsoftc *, char *, int, void *));
+static INLINE void isp_print_bytes(struct ispsoftc *, char *, int, void *);
static INLINE void
-isp_print_bytes(isp, msg, amt, arg)
- struct ispsoftc *isp;
- char *msg;
- int amt;
- void *arg;
+isp_print_bytes(struct ispsoftc *isp, char *msg, int amt, void *arg)
{
char buf[128];
u_int8_t *ptr = arg;
@@ -237,12 +201,10 @@ isp_print_bytes(isp, msg, amt, arg)
* We assume we enter here with any locks held.
*/
-static INLINE int isp_fc_runstate __P((struct ispsoftc *, int));
+static INLINE int isp_fc_runstate(struct ispsoftc *, int);
static INLINE int
-isp_fc_runstate(isp, tval)
- struct ispsoftc *isp;
- int tval;
+isp_fc_runstate(struct ispsoftc *isp, int tval)
{
fcparam *fcp;
int *tptr;