summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/isp.c
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2001-03-14 04:11:56 +0000
committermjacob <mjacob@FreeBSD.org>2001-03-14 04:11:56 +0000
commitbd35206cf8fb13d36ed1a704867a731b030d42b4 (patch)
treeaa6a9757f230594d4956d46f22f35b0f33a2fc71 /sys/dev/isp/isp.c
parent4a6cbeb9320e49ce120e8014c4610aae3ec77c29 (diff)
downloadFreeBSD-src-bd35206cf8fb13d36ed1a704867a731b030d42b4.zip
FreeBSD-src-bd35206cf8fb13d36ed1a704867a731b030d42b4.tar.gz
In order to save ourselves grief with the SUNPRO compiler under
Solaris (which, for reasons unknown to me, chokes on u_int16_t as a typedef of unsigned short if used in a transitional (mixed K&R and ANSI) way), we'll go the extra mile and fully ANSIfy things.
Diffstat (limited to 'sys/dev/isp/isp.c')
-rw-r--r--sys/dev/isp/isp.c138
1 files changed, 40 insertions, 98 deletions
diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c
index b0b768d..9046bbc 100644
--- a/sys/dev/isp/isp.c
+++ b/sys/dev/isp/isp.c
@@ -143,8 +143,7 @@ static void isp_parse_nvram_2100 __P((struct ispsoftc *, u_int8_t *));
* Locking done elsewhere.
*/
void
-isp_reset(isp)
- struct ispsoftc *isp;
+isp_reset(struct ispsoftc *isp)
{
mbreg_t mbs;
int loops, i, touched, dodnld = 1;
@@ -730,8 +729,7 @@ again:
*/
void
-isp_init(isp)
- struct ispsoftc *isp;
+isp_init(struct ispsoftc *isp)
{
/*
* Must do this first to get defaults established.
@@ -748,8 +746,7 @@ isp_init(isp)
}
static void
-isp_scsi_init(isp)
- struct ispsoftc *isp;
+isp_scsi_init(struct ispsoftc *isp)
{
sdparam *sdp_chan0, *sdp_chan1;
mbreg_t mbs;
@@ -913,9 +910,7 @@ isp_scsi_init(isp)
}
static void
-isp_scsi_channel_init(isp, channel)
- struct ispsoftc *isp;
- int channel;
+isp_scsi_channel_init(struct ispsoftc *isp, int channel)
{
sdparam *sdp;
mbreg_t mbs;
@@ -1018,8 +1013,7 @@ isp_scsi_channel_init(isp, channel)
* Locks are held before coming here.
*/
static void
-isp_fibre_init(isp)
- struct ispsoftc *isp;
+isp_fibre_init(struct ispsoftc *isp)
{
fcparam *fcp;
isp_icb_t *icbp;
@@ -1201,9 +1195,7 @@ isp_fibre_init(isp)
*/
static int
-isp_getmap(isp, map)
- struct ispsoftc *isp;
- fcpos_map_t *map;
+isp_getmap(struct ispsoftc *isp, fcpos_map_t *map)
{
fcparam *fcp = (fcparam *) isp->isp_param;
mbreg_t mbs;
@@ -1231,8 +1223,7 @@ isp_getmap(isp, map)
}
static void
-isp_mark_getpdb_all(isp)
- struct ispsoftc *isp;
+isp_mark_getpdb_all(struct ispsoftc *isp)
{
fcparam *fcp = (fcparam *) isp->isp_param;
int i;
@@ -1242,10 +1233,7 @@ isp_mark_getpdb_all(isp)
}
static int
-isp_getpdb(isp, id, pdbp)
- struct ispsoftc *isp;
- int id;
- isp_pdb_t *pdbp;
+isp_getpdb(struct ispsoftc *isp, int id, isp_pdb_t *pdbp)
{
fcparam *fcp = (fcparam *) isp->isp_param;
mbreg_t mbs;
@@ -1272,10 +1260,7 @@ isp_getpdb(isp, id, pdbp)
}
static u_int64_t
-isp_get_portname(isp, loopid, nodename)
- struct ispsoftc *isp;
- int loopid;
- int nodename;
+isp_get_portname(struct ispsoftc *isp, int loopid, int nodename)
{
u_int64_t wwn = 0;
mbreg_t mbs;
@@ -1304,9 +1289,7 @@ isp_get_portname(isp, loopid, nodename)
*/
static int
-isp_fclink_test(isp, usdelay)
- struct ispsoftc *isp;
- int usdelay;
+isp_fclink_test(struct ispsoftc *isp, int usdelay)
{
static char *toponames[] = {
"Private Loop",
@@ -1357,10 +1340,10 @@ isp_fclink_test(isp, usdelay)
*/
enano = NANOTIME_SUB(&hrb, &hra);
- isp_prt(isp, ISP_LOGDEBUG3, "usec%d: 0x%lx->0x%lx enano %lu",
+ isp_prt(isp, ISP_LOGDEBUG1,
+ "usec%d: 0x%lx->0x%lx enano 0x%x%08x",
count, (long) GET_NANOSEC(&hra), (long) GET_NANOSEC(&hrb),
- (enano > ((u_int64_t)0xffffffff))? 0xffffffff :
- (unsigned long) (enano & 0xffffffff));
+ (u_int32_t)(enano >> 32), (u_int32_t)(enano & 0xffffffff));
/*
* If the elapsed time is less than 1 millisecond,
@@ -1379,7 +1362,8 @@ isp_fclink_test(isp, usdelay)
enano -= (u_int64_t) 4000000000U;
}
wrk = enano;
- USEC_SLEEP(isp, wrk/1000);
+ wrk /= 1000;
+ USEC_SLEEP(isp, wrk);
} else {
while (enano > (u_int64_t) 4000000000U) {
count += 4000000;
@@ -1528,8 +1512,7 @@ not_on_fabric:
}
static char *
-isp2100_fw_statename(state)
- int state;
+isp2100_fw_statename(int state)
{
switch(state) {
case FW_CONFIG_WAIT: return "Config Wait";
@@ -1550,8 +1533,7 @@ isp2100_fw_statename(state)
*/
static int
-isp_pdb_sync(isp)
- struct ispsoftc *isp;
+isp_pdb_sync(struct ispsoftc *isp)
{
struct lportdb *lp;
fcparam *fcp = isp->isp_param;
@@ -1861,8 +1843,7 @@ dump_em:
}
static int
-isp_scan_loop(isp)
- struct ispsoftc *isp;
+isp_scan_loop(struct ispsoftc *isp)
{
struct lportdb *lp;
fcparam *fcp = isp->isp_param;
@@ -2131,8 +2112,7 @@ isp_scan_loop(isp)
}
static int
-isp_scan_fabric(isp)
- struct ispsoftc *isp;
+isp_scan_fabric(struct ispsoftc *isp)
{
fcparam *fcp = isp->isp_param;
u_int32_t portid, first_portid;
@@ -2242,8 +2222,7 @@ isp_register_fc4_type(struct ispsoftc *isp)
*/
int
-isp_start(xs)
- XS_T *xs;
+isp_start(XS_T *xs)
{
struct ispsoftc *isp;
u_int16_t iptr, optr, handle;
@@ -2621,10 +2600,7 @@ isp_start(xs)
*/
int
-isp_control(isp, ctl, arg)
- struct ispsoftc *isp;
- ispctl_t ctl;
- void *arg;
+isp_control(struct ispsoftc *isp, ispctl_t ctl, void *arg)
{
XS_T *xs;
mbreg_t mbs;
@@ -2809,8 +2785,7 @@ isp_control(isp, ctl, arg)
#define MAX_REQUESTQ_COMPLETIONS 32
int
-isp_intr(arg)
- void *arg;
+isp_intr(void *arg)
{
struct ispsoftc *isp = arg;
XS_T *complist[MAX_REQUESTQ_COMPLETIONS], *xs;
@@ -3193,9 +3168,7 @@ isp_intr(arg)
*/
static int
-isp_parse_async(isp, mbox)
- struct ispsoftc *isp;
- int mbox;
+isp_parse_async(struct ispsoftc *isp, int mbox)
{
int bus;
u_int16_t fast_post_handle = 0;
@@ -3464,10 +3437,8 @@ isp_parse_async(isp, mbox)
*/
static int
-isp_handle_other_response(isp, sp, optrp)
- struct ispsoftc *isp;
- ispstatusreq_t *sp;
- u_int16_t *optrp;
+isp_handle_other_response(struct ispsoftc *isp,
+ ispstatusreq_t *sp, u_int16_t *optrp)
{
switch (sp->req_header.rqs_entry_type) {
case RQSTYPE_STATUS_CONT:
@@ -3501,10 +3472,7 @@ isp_handle_other_response(isp, sp, optrp)
}
static void
-isp_parse_status(isp, sp, xs)
- struct ispsoftc *isp;
- ispstatusreq_t *sp;
- XS_T *xs;
+isp_parse_status(struct ispsoftc *isp, ispstatusreq_t *sp, XS_T *xs)
{
switch (sp->req_completion_status & 0xff) {
case RQCS_COMPLETE:
@@ -3836,9 +3804,7 @@ isp_parse_status(isp, sp, xs)
}
static void
-isp_fastpost_complete(isp, fph)
- struct ispsoftc *isp;
- u_int16_t fph;
+isp_fastpost_complete(struct ispsoftc *isp, u_int16_t fph)
{
XS_T *xs;
@@ -3969,7 +3935,7 @@ static u_int16_t mbpscsi[] = {
ISPOPMAP(0x01, 0x01) /* 0x5d: GET NOST DATA */
};
-#ifndef ISP_STRIPEED
+#ifndef ISP_STRIPPED
static char *scsi_mbcmd_names[] = {
"NO-OP",
"LOAD RAM",
@@ -4331,10 +4297,7 @@ static char *fc_mbcmd_names[] = {
#endif
static void
-isp_mboxcmd(isp, mbp, logmask)
- struct ispsoftc *isp;
- mbreg_t *mbp;
- int logmask;
+isp_mboxcmd(struct ispsoftc *isp, mbreg_t *mbp, int logmask)
{
char *cname, *xname, tname[16], mname[16];
unsigned int lim, ibits, obits, box, opcode;
@@ -4468,8 +4431,7 @@ isp_mboxcmd(isp, mbp, logmask)
}
static void
-isp_fw_state(isp)
- struct ispsoftc *isp;
+isp_fw_state(struct ispsoftc *isp)
{
if (IS_FC(isp)) {
mbreg_t mbs;
@@ -4484,8 +4446,7 @@ isp_fw_state(isp)
}
static void
-isp_update(isp)
- struct ispsoftc *isp;
+isp_update(struct ispsoftc *isp)
{
int bus, upmask;
@@ -4498,9 +4459,7 @@ isp_update(isp)
}
static void
-isp_update_bus(isp, bus)
- struct ispsoftc *isp;
- int bus;
+isp_update_bus(struct ispsoftc *isp, int bus)
{
int tgt;
mbreg_t mbs;
@@ -4618,9 +4577,7 @@ isp_update_bus(isp, bus)
}
static void
-isp_setdfltparm(isp, channel)
- struct ispsoftc *isp;
- int channel;
+isp_setdfltparm(struct ispsoftc *isp, int channel)
{
int tgt;
mbreg_t mbs;
@@ -4880,8 +4837,7 @@ isp_setdfltparm(isp, channel)
*/
void
-isp_reinit(isp)
- struct ispsoftc *isp;
+isp_reinit(struct ispsoftc *isp)
{
XS_T *xs;
u_int16_t handle;
@@ -4925,8 +4881,7 @@ skip:
* NVRAM Routines
*/
static int
-isp_read_nvram(isp)
- struct ispsoftc *isp;
+isp_read_nvram(struct ispsoftc *isp)
{
int i, amt;
u_int8_t csum, minversion;
@@ -4999,10 +4954,7 @@ isp_read_nvram(isp)
}
static void
-isp_rdnvram_word(isp, wo, rp)
- struct ispsoftc *isp;
- int wo;
- u_int16_t *rp;
+isp_rdnvram_word(struct ispsoftc *isp, int wo, u_int16_t *rp)
{
int i, cbits;
u_int16_t bit, rqst;
@@ -5065,9 +5017,7 @@ isp_rdnvram_word(isp, wo, rp)
}
static void
-isp_parse_nvram_1020(isp, nvram_data)
- struct ispsoftc *isp;
- u_int8_t *nvram_data;
+isp_parse_nvram_1020(struct ispsoftc *isp, u_int8_t *nvram_data)
{
int i;
sdparam *sdp = (sdparam *) isp->isp_param;
@@ -5168,10 +5118,7 @@ isp_parse_nvram_1020(isp, nvram_data)
}
static void
-isp_parse_nvram_1080(isp, bus, nvram_data)
- struct ispsoftc *isp;
- int bus;
- u_int8_t *nvram_data;
+isp_parse_nvram_1080(struct ispsoftc *isp, int bus, u_int8_t *nvram_data)
{
int i;
sdparam *sdp = (sdparam *) isp->isp_param;
@@ -5244,10 +5191,7 @@ isp_parse_nvram_1080(isp, bus, nvram_data)
}
static void
-isp_parse_nvram_12160(isp, bus, nvram_data)
- struct ispsoftc *isp;
- int bus;
- u_int8_t *nvram_data;
+isp_parse_nvram_12160(struct ispsoftc *isp, int bus, u_int8_t *nvram_data)
{
sdparam *sdp = (sdparam *) isp->isp_param;
int i;
@@ -5321,9 +5265,7 @@ isp_parse_nvram_12160(isp, bus, nvram_data)
}
static void
-isp_parse_nvram_2100(isp, nvram_data)
- struct ispsoftc *isp;
- u_int8_t *nvram_data;
+isp_parse_nvram_2100(struct ispsoftc *isp, u_int8_t *nvram_data)
{
fcparam *fcp = (fcparam *) isp->isp_param;
u_int64_t wwn;
OpenPOWER on IntegriCloud