Remove some more NetBSD compat shims and other unused bits from these

drivers:
- Remove scsi_low_pisa.*, they were unused.
- Remove <compat/netbsd/physio_proc.h> and calls to the stubs in that
  header.  They were empty nops.
- Retire sl_xname and use device_get_nameunit() and device_printf() with
  the underlying device_t instead.
- Remove unused {ct,ncv,nsp,stg}print() functions.
- Remove empty SOFT_INTR_REQUIRED() macro and the unused sl_irq member.
This commit is contained in:
John Baldwin 2012-09-10 18:49:49 +00:00
parent 451abc51c9
commit a89828a2b0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=240325
24 changed files with 170 additions and 464 deletions

View File

@ -157,7 +157,7 @@ static struct scsi_low_softc_tab sl_tab = LIST_HEAD_INITIALIZER(sl_tab);
#ifdef SCSI_LOW_INFO_DETAIL
#define SCSI_LOW_INFO(slp, ti, s) scsi_low_info((slp), (ti), (s))
#else /* !SCSI_LOW_INFO_DETAIL */
#define SCSI_LOW_INFO(slp, ti, s) printf("%s: %s\n", (slp)->sl_xname, (s))
#define SCSI_LOW_INFO(slp, ti, s) device_printf((slp)->sl_dev, "%s\n", (s))
#endif /* !SCSI_LOW_INFO_DETAIL */
#ifdef SCSI_LOW_STATICS
@ -439,8 +439,9 @@ scsi_low_scsi_action_cam(sim, ccb)
#ifdef SCSI_LOW_DEBUG
if (SCSI_LOW_DEBUG_GO(SCSI_LOW_DEBUG_ACTION, target) != 0)
{
printf("%s: cam_action: func code 0x%x target: %d, lun: %d\n",
slp->sl_xname, ccb->ccb_h.func_code, target, lun);
device_printf(slp->sl_dev,
"cam_action: func code 0x%x target: %d, lun: %d\n",
ccb->ccb_h.func_code, target, lun);
}
#endif /* SCSI_LOW_DEBUG */
@ -449,7 +450,7 @@ scsi_low_scsi_action_cam(sim, ccb)
#ifdef SCSI_LOW_DIAGNOSTIC
if (target == CAM_TARGET_WILDCARD || lun == CAM_LUN_WILDCARD)
{
printf("%s: invalid target/lun\n", slp->sl_xname);
device_printf(slp->sl_dev, "invalid target/lun\n");
ccb->ccb_h.status = CAM_REQ_INVALID;
xpt_done(ccb);
return;
@ -502,7 +503,7 @@ scsi_low_scsi_action_cam(sim, ccb)
#ifdef SCSI_LOW_DIAGNOSTIC
if (target == CAM_TARGET_WILDCARD || lun == CAM_LUN_WILDCARD)
{
printf("%s: invalid target/lun\n", slp->sl_xname);
device_printf(slp->sl_dev, "invalid target/lun\n");
ccb->ccb_h.status = CAM_REQ_INVALID;
xpt_done(ccb);
return;
@ -530,7 +531,7 @@ scsi_low_scsi_action_cam(sim, ccb)
#ifdef SCSI_LOW_DIAGNOSTIC
if (target == CAM_TARGET_WILDCARD)
{
printf("%s: invalid target\n", slp->sl_xname);
device_printf(slp->sl_dev, "invalid target\n");
ccb->ccb_h.status = CAM_REQ_INVALID;
xpt_done(ccb);
return;
@ -603,7 +604,7 @@ scsi_low_scsi_action_cam(sim, ccb)
#ifdef SCSI_LOW_DIAGNOSTIC
if (target == CAM_TARGET_WILDCARD)
{
printf("%s: invalid target\n", slp->sl_xname);
device_printf(slp->sl_dev, "invalid target\n");
ccb->ccb_h.status = CAM_REQ_INVALID;
xpt_done(ccb);
return;
@ -624,8 +625,8 @@ scsi_low_scsi_action_cam(sim, ccb)
if (li->li_flags_valid != SCSI_LOW_LUN_FLAGS_ALL_VALID)
{
ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
printf("%s: invalid GET_TRANS_CURRENT_SETTINGS call\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"invalid GET_TRANS_CURRENT_SETTINGS call\n");
goto settings_out;
}
#endif /* SCSI_LOW_DIAGNOSTIC */
@ -687,7 +688,7 @@ scsi_low_scsi_action_cam(sim, ccb)
#ifdef SCSI_LOW_DIAGNOSTIC
if (target == CAM_TARGET_WILDCARD)
{
printf("%s: invalid target\n", slp->sl_xname);
device_printf(slp->sl_dev, "invalid target\n");
ccb->ccb_h.status = CAM_REQ_INVALID;
xpt_done(ccb);
return;
@ -767,9 +768,6 @@ scsi_low_attach_cam(slp)
struct cam_devq *devq;
int tagged_openings;
sprintf(slp->sl_xname, "%s%d",
device_get_name(slp->sl_dev), device_get_unit(slp->sl_dev));
devq = cam_simq_alloc(SCSI_LOW_NCCB);
if (devq == NULL)
return (ENOMEM);
@ -890,8 +888,8 @@ scsi_low_done_cam(slp, cb)
(scsi_low_cmd_flags[cb->ccb_scp.scp_cmd[0]] &
SCSI_LOW_CMD_ABORT_WARNING) != 0)
{
printf("%s: WARNING: scsi_low IO abort\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"WARNING: scsi_low IO abort\n");
scsi_low_print(slp, NULL);
}
#endif /* SCSI_LOW_DIAGNOSTIC */
@ -1203,7 +1201,7 @@ scsi_low_alloc_ti(slp, targ)
ti = SCSI_LOW_MALLOC(slp->sl_targsize);
if (ti == NULL)
panic("%s short of memory", slp->sl_xname);
panic("%s short of memory", device_get_nameunit(slp->sl_dev));
bzero(ti, slp->sl_targsize);
ti->ti_id = targ;
@ -1310,7 +1308,8 @@ scsi_low_timeout_check(slp)
cb->ccb_flags |= CCB_NORETRY;
cb->ccb_error |= SELTIMEOUTIO;
if (scsi_low_revoke_ccb(slp, cb, 1) != NULL)
panic("%s: ccb not finished", slp->sl_xname);
panic("%s: ccb not finished",
device_get_nameunit(slp->sl_dev));
}
if (slp->sl_Tnexus == NULL)
@ -1393,7 +1392,7 @@ scsi_low_timeout_check(slp)
bus_reset:
cb->ccb_error |= TIMEOUTIO;
printf("%s: slccb (0x%lx) timeout!\n", slp->sl_xname, (u_long) cb);
device_printf(slp->sl_dev, "slccb (0x%lx) timeout!\n", (u_long) cb);
scsi_low_info(slp, NULL, "scsi bus hangup. try to recover.");
scsi_low_init(slp, SCSI_LOW_RESTART_HARD);
scsi_low_start(slp);
@ -1434,7 +1433,8 @@ scsi_low_abort_ccb(slp, cb)
else if ((cb->ccb_flags & CCB_DISCQ) != 0)
{
if (scsi_low_revoke_ccb(slp, cb, 0) == NULL)
panic("%s: revoked ccb done", slp->sl_xname);
panic("%s: revoked ccb done",
device_get_nameunit(slp->sl_dev));
cb->ccb_flags |= CCB_STARTQ;
TAILQ_INSERT_HEAD(&slp->sl_start, cb, ccb_chain);
@ -1445,7 +1445,8 @@ scsi_low_abort_ccb(slp, cb)
else
{
if (scsi_low_revoke_ccb(slp, cb, 1) != NULL)
panic("%s: revoked ccb retried", slp->sl_xname);
panic("%s: revoked ccb retried",
device_get_nameunit(slp->sl_dev));
}
return 0;
}
@ -1509,8 +1510,8 @@ scsi_low_attach(slp, openings, ntargs, nluns, targsize, lunsize)
if (rv != 0)
{
splx(s);
printf("%s: scsi_low_attach: osdep attach failed\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"scsi_low_attach: osdep attach failed\n");
return EINVAL;
}
@ -1519,8 +1520,8 @@ scsi_low_attach(slp, openings, ntargs, nluns, targsize, lunsize)
if (scsi_low_init(slp, SCSI_LOW_RESTART_HARD) != 0)
{
splx(s);
printf("%s: scsi_low_attach: initialization failed\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"scsi_low_attach: initialization failed\n");
return EINVAL;
}
@ -1735,7 +1736,7 @@ scsi_low_setup_start(slp, ti, li, cb)
return SCSI_LOW_START_QTAG;
default:
panic("%s: no setup phase", slp->sl_xname);
panic("%s: no setup phase", device_get_nameunit(slp->sl_dev));
}
return SCSI_LOW_START_NO_QTAG;
@ -1791,7 +1792,7 @@ scsi_low_start(slp)
if (slp->sl_Tnexus || slp->sl_Lnexus || slp->sl_Qnexus)
{
scsi_low_info(slp, NULL, "NEXUS INCOSISTENT");
panic("%s: inconsistent", slp->sl_xname);
panic("%s: inconsistent", device_get_nameunit(slp->sl_dev));
}
#endif /* SCSI_LOW_DIAGNOSTIC */
@ -1928,7 +1929,7 @@ scsi_low_arbit_fail(slp, cb)
if (slp->sl_disc == 0)
{
#ifdef SCSI_LOW_DIAGNOSTIC
printf("%s: try selection again\n", slp->sl_xname);
device_printf(slp->sl_dev, "try selection again\n");
#endif /* SCSI_LOW_DIAGNOSTIC */
slp->sl_retry_sel = 1;
}
@ -2356,7 +2357,7 @@ scsi_low_bus_reset(slp)
(*slp->sl_funcs->scsi_low_bus_reset) (slp);
printf("%s: try to reset scsi bus ", slp->sl_xname);
device_printf(slp->sl_dev, "try to reset scsi bus ");
for (i = 0; i <= SCSI2_RESET_DELAY / TWIDDLEWAIT ; i++)
scsi_low_twiddle_wait();
cnputc('\b');
@ -2372,7 +2373,7 @@ scsi_low_restart(slp, flags, s)
int error;
if (s != NULL)
printf("%s: scsi bus restart. reason: %s\n", slp->sl_xname, s);
device_printf(slp->sl_dev, "scsi bus restart. reason: %s\n", s);
if ((error = scsi_low_init(slp, flags)) != 0)
return error;
@ -2411,8 +2412,8 @@ scsi_low_establish_ccb(ti, li, tag)
#ifdef SCSI_LOW_DEBUG
if (SCSI_LOW_DEBUG_TEST_GO(SCSI_LOW_NEXUS_CHECK, ti->ti_id) != 0)
{
printf("%s: nexus(0x%lx) abort check start\n",
slp->sl_xname, (u_long) cb);
device_printf(slp->sl_dev, "nexus(0x%lx) abort check start\n",
(u_long) cb);
cb->ccb_flags |= (CCB_NORETRY | CCB_SILENT);
scsi_low_revoke_ccb(slp, cb, 1);
return NULL;
@ -2514,7 +2515,7 @@ scsi_low_reselected(slp, targ)
return ti;
world_restart:
printf("%s: reselect(%x:unknown) %s\n", slp->sl_xname, targ, s);
device_printf(slp->sl_dev, "reselect(%x:unknown) %s\n", targ, s);
scsi_low_restart(slp, SCSI_LOW_RESTART_HARD,
"reselect: scsi world confused");
return NULL;
@ -2894,7 +2895,7 @@ scsi_low_errfunc_qtag(slp, msgflags)
slp->sl_Lnexus->li_cfgflags &= ~SCSI_LOW_QTAG;
scsi_low_calcf_lun(slp->sl_Lnexus);
}
printf("%s: scsi_low: qtag msg rejected\n", slp->sl_xname);
device_printf(slp->sl_dev, "scsi_low: qtag msg rejected\n");
}
return 0;
}
@ -2920,7 +2921,7 @@ scsi_low_msgout(slp, ti, fl)
slp->sl_ph_count ++;
if (slp->sl_ph_count > SCSI_LOW_MAX_PHCHANGES)
{
printf("%s: too many phase changes\n", slp->sl_xname);
device_printf(slp->sl_dev, "too many phase changes\n");
slp->sl_error |= FATALIO;
scsi_low_assert_msg(slp, ti, SCSI_LOW_MSG_ABORT, 0);
}
@ -2945,7 +2946,7 @@ scsi_low_msgout(slp, ti, fl)
ti->ti_msgflags |= ti->ti_omsgflags;
ti->ti_omsgflags = 0;
#ifdef SCSI_LOW_DIAGNOSTIC
printf("%s: scsi_low_msgout: retry msgout\n", slp->sl_xname);
device_printf(slp->sl_dev, "scsi_low_msgout: retry msgout\n");
#endif /* SCSI_LOW_DIAGNOSTIC */
}
@ -3020,7 +3021,7 @@ scsi_low_msginfunc_rejop(slp)
struct targ_info *ti = slp->sl_Tnexus;
u_int8_t msg = ti->ti_msgin[0];
printf("%s: MSGIN: msg 0x%x rejected\n", slp->sl_xname, (u_int) msg);
device_printf(slp->sl_dev, "MSGIN: msg 0x%x rejected\n", (u_int) msg);
scsi_low_assert_msg(slp, ti, SCSI_LOW_MSG_REJECT, 0);
return 0;
}
@ -3128,7 +3129,8 @@ scsi_low_msginfunc_lcc(slp)
cb->ccb_tag = SCSI_LOW_UNKTAG;
cb->ccb_otag = SCSI_LOW_UNKTAG;
if (scsi_low_done(slp, cb) == SCSI_LOW_DONE_RETRY)
panic("%s: linked ccb retried", slp->sl_xname);
panic("%s: linked ccb retried",
device_get_nameunit(slp->sl_dev));
slp->sl_Qnexus = ncb;
slp->sl_ph_count = 0;
@ -3220,8 +3222,8 @@ scsi_low_synch(slp)
*/
ti->ti_maxsynch.period = 0;
ti->ti_maxsynch.offset = 0;
printf("%s: target brain damaged. async transfer\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"target brain damaged. async transfer\n");
return EINVAL;
}
@ -3236,8 +3238,8 @@ scsi_low_synch(slp)
* for our adapter.
* The adapter changes max synch and max offset.
*/
printf("%s: synch neg failed. retry synch msg neg ...\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"synch neg failed. retry synch msg neg ...\n");
return error;
}
@ -3257,8 +3259,9 @@ scsi_low_synch(slp)
return 0;
#endif /* SCSI_LOW_NEGOTIATE_BEFORE_SENSE */
printf("%s(%d:*): <%s> offset %d period %dns ",
slp->sl_xname, ti->ti_id, s, offset, period * 4);
device_printf(slp->sl_dev,
"(%d:*): <%s> offset %d period %dns ",
ti->ti_id, s, offset, period * 4);
if (period != 0)
{
@ -3285,8 +3288,8 @@ scsi_low_wide(slp)
* Current width is not acceptable for our adapter.
* The adapter changes max width.
*/
printf("%s: wide neg failed. retry wide msg neg ...\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"wide neg failed. retry wide msg neg ...\n");
return error;
}
@ -3307,8 +3310,8 @@ scsi_low_wide(slp)
return 0;
#endif /* SCSI_LOW_NEGOTIATE_BEFORE_SENSE */
printf("%s(%d:*): transfer width %d bits\n",
slp->sl_xname, ti->ti_id, 1 << (3 + ti->ti_width));
device_printf(slp->sl_dev, "(%d:*): transfer width %d bits\n",
ti->ti_id, 1 << (3 + ti->ti_width));
}
return 0;
}
@ -3452,8 +3455,8 @@ scsi_low_msginfunc_msg_reject(slp)
if (ti->ti_emsgflags != 0)
{
printf("%s: msg flags [0x%x] rejected\n",
slp->sl_xname, ti->ti_emsgflags);
device_printf(slp->sl_dev, "msg flags [0x%x] rejected\n",
ti->ti_emsgflags);
msgflags = SCSI_LOW_MSG_REJECT;
mdp = &scsi_low_msgout_data[0];
for ( ; mdp->md_flags != SCSI_LOW_MSG_ALL; mdp ++)
@ -3505,7 +3508,7 @@ scsi_low_msgin(slp, ti, c)
slp->sl_ph_count ++;
if (slp->sl_ph_count > SCSI_LOW_MAX_PHCHANGES)
{
printf("%s: too many phase changes\n", slp->sl_xname);
device_printf(slp->sl_dev, "too many phase changes\n");
slp->sl_error |= FATALIO;
scsi_low_assert_msg(slp, ti, SCSI_LOW_MSG_ABORT, 0);
}
@ -3798,7 +3801,8 @@ scsi_low_revoke_ccb(slp, cb, fdone)
if ((cb->ccb_flags & (CCB_STARTQ | CCB_DISCQ)) ==
(CCB_STARTQ | CCB_DISCQ))
{
panic("%s: ccb in both queue", slp->sl_xname);
panic("%s: ccb in both queue",
device_get_nameunit(slp->sl_dev));
}
#endif /* SCSI_LOW_DIAGNOSTIC */
@ -3825,7 +3829,8 @@ scsi_low_revoke_ccb(slp, cb, fdone)
cb->ccb_error |= FATALIO;
cb->ccb_flags &= ~CCB_AUTOSENSE;
if (scsi_low_done(slp, cb) != SCSI_LOW_DONE_COMPLETE)
panic("%s: done ccb retried", slp->sl_xname);
panic("%s: done ccb retried",
device_get_nameunit(slp->sl_dev));
return NULL;
}
else
@ -3992,8 +3997,9 @@ scsi_low_calcf_target(ti)
#ifdef SCSI_LOW_DEBUG
if (SCSI_LOW_DEBUG_GO(SCSI_LOW_DEBUG_CALCF, ti->ti_id) != 0)
{
printf("%s(%d:*): max period(%dns) offset(%d) width(%d)\n",
slp->sl_xname, ti->ti_id,
device_printf(slp->sl_dev,
"(%d:*): max period(%dns) offset(%d) width(%d)\n",
ti->ti_id,
ti->ti_maxsynch.period * 4,
ti->ti_maxsynch.offset,
ti->ti_width);
@ -4008,8 +4014,9 @@ scsi_low_calcf_show(li)
struct targ_info *ti = li->li_ti;
struct scsi_low_softc *slp = ti->ti_sc;
printf("%s(%d:%d): period(%d ns) offset(%d) width(%d) flags 0x%b\n",
slp->sl_xname, ti->ti_id, li->li_lun,
device_printf(slp->sl_dev,
"(%d:%d): period(%d ns) offset(%d) width(%d) flags 0x%b\n",
ti->ti_id, li->li_lun,
ti->ti_maxsynch.period * 4,
ti->ti_maxsynch.offset,
ti->ti_width,
@ -4031,7 +4038,7 @@ scsi_low_start_up(slp)
struct slccb *cb;
int target, lun;
printf("%s: scsi_low: probing all devices ....\n", slp->sl_xname);
device_printf(slp->sl_dev, "scsi_low: probing all devices ....\n");
for (target = 0; target < slp->sl_ntargs; target ++)
{
@ -4039,16 +4046,17 @@ scsi_low_start_up(slp)
{
if ((slp->sl_show_result & SHOW_PROBE_RES) != 0)
{
printf("%s: scsi_low: target %d (host card)\n",
slp->sl_xname, target);
device_printf(slp->sl_dev,
"scsi_low: target %d (host card)\n",
target);
}
continue;
}
if ((slp->sl_show_result & SHOW_PROBE_RES) != 0)
{
printf("%s: scsi_low: target %d lun ",
slp->sl_xname, target);
device_printf(slp->sl_dev, "scsi_low: target %d lun ",
target);
}
ti = slp->sl_ti[target];
@ -4125,8 +4133,8 @@ scsi_low_test_abort(slp, ti, li)
acb = TAILQ_FIRST(&li->li_discq);
if (scsi_low_abort_ccb(slp, acb) == 0)
{
printf("%s: aborting ccb(0x%lx) start\n",
slp->sl_xname, (u_long) acb);
device_printf(slp->sl_dev,
"aborting ccb(0x%lx) start\n", (u_long) acb);
}
}
}
@ -4141,7 +4149,7 @@ scsi_low_test_atten(slp, ti, msg)
if (slp->sl_ph_count < SCSI_LOW_MAX_ATTEN_CHECK)
scsi_low_assert_msg(slp, ti, msg, 0);
else
printf("%s: atten check OK\n", slp->sl_xname);
device_printf(slp->sl_dev, "atten check OK\n");
}
static void
@ -4216,9 +4224,9 @@ scsi_low_print(slp, ti)
}
sp = &slp->sl_scp;
printf("%s: === NEXUS T(0x%lx) L(0x%lx) Q(0x%lx) NIO(%d) ===\n",
slp->sl_xname, (u_long) ti, (u_long) li, (u_long) cb,
slp->sl_nio);
device_printf(slp->sl_dev,
"=== NEXUS T(0x%lx) L(0x%lx) Q(0x%lx) NIO(%d) ===\n",
(u_long) ti, (u_long) li, (u_long) cb, slp->sl_nio);
/* target stat */
if (ti != NULL)
@ -4234,8 +4242,8 @@ scsi_low_print(slp, ti)
nqio = li->li_nqio;
}
printf("%s(%d:%d) ph<%s> => ph<%s> DISC(%d) QIO(%d:%d)\n",
slp->sl_xname,
device_printf(slp->sl_dev,
"(%d:%d) ph<%s> => ph<%s> DISC(%d) QIO(%d:%d)\n",
ti->ti_id, lun, phase[(int) ti->ti_ophase],
phase[(int) ti->ti_phase], ti->ti_disc,
nqio, maxnqio);

View File

@ -83,12 +83,6 @@ struct scsi_low_osdep_interface {
#endif
};
struct scsi_low_osdep_targ_interface {
};
struct scsi_low_osdep_lun_interface {
};
/******** os depend interface functions *************/
struct slccb;
struct scsi_low_softc;
@ -252,8 +246,6 @@ TAILQ_HEAD(targ_info_tab, targ_info);
LIST_HEAD(lun_info_tab, lun_info);
struct lun_info {
struct scsi_low_osdep_lun_interface li_sloi;
int li_lun;
struct targ_info *li_ti; /* my target */
@ -340,8 +332,6 @@ struct scsi_low_msg_log {
};
struct targ_info {
struct scsi_low_osdep_targ_interface ti_slti;
TAILQ_ENTRY(targ_info) ti_chain; /* targ_info link */
struct scsi_low_softc *ti_sc; /* our softc */
@ -500,7 +490,6 @@ struct scsi_low_softc {
struct scsi_low_osdep_interface sl_si;
#define sl_dev sl_si.si_dev
struct scsi_low_osdep_funcs *sl_osdep_fp;
u_char sl_xname[16];
/* our chain */
LIST_ENTRY(scsi_low_softc) sl_chain;
@ -605,10 +594,6 @@ struct scsi_low_softc {
/* targinfo size */
int sl_targsize;
#if defined(i386) || defined(__i386__)
u_int sl_irq; /* XXX */
#endif /* i386 */
};
/*************************************************

View File

@ -1,81 +0,0 @@
/* $NecBSD: scsi_low_pisa.c,v 1.13.18.1 2001/06/08 06:27:48 honda Exp $ */
/* $NetBSD$ */
/*-
* [NetBSD for NEC PC-98 series]
* Copyright (c) 1995, 1996, 1997, 1998
* NetBSD/pc98 porting staff. All rights reserved.
* Copyright (c) 1995, 1996, 1997, 1998
* Naofumi HONDA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/queue.h>
#include <sys/bus.h>
#include <sys/module.h>
#include <cam/scsi/scsi_low.h>
#include <cam/scsi/scsi_low_pisa.h>
int
scsi_low_deactivate_pisa(sc)
struct scsi_low_softc *sc;
{
if (scsi_low_deactivate(sc) != 0)
return EBUSY;
return 0;
}
int
scsi_low_activate_pisa(sc, flags)
struct scsi_low_softc *sc;
int flags;
{
sc->sl_cfgflags = ((sc->sl_cfgflags & 0xffff0000) |
(flags & 0x00ff));
if (scsi_low_activate(sc) != 0)
return EBUSY;
return 0;
}
static moduledata_t scsi_low_moduledata = {
"scsi_low",
NULL,
NULL
};
DECLARE_MODULE(scsi_low, scsi_low_moduledata, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
MODULE_VERSION(scsi_low, 1);
MODULE_DEPEND(scsi_low, cam, 1, 1, 1);

View File

@ -1,40 +0,0 @@
/* $FreeBSD$ */
/* $NecBSD: scsi_low_pisa.h,v 1.3.14.1 2001/06/08 06:27:49 honda Exp $ */
/* $NetBSD$ */
/*-
* [NetBSD for NEC PC-98 series]
* Copyright (c) 1998
* NetBSD/pc98 porting staff. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _SCSI_LOW_PISA_H_
#define _SCSI_LOW_PISA_H_
int scsi_low_activate_pisa(struct scsi_low_softc *, int);
int scsi_low_deactivate_pisa(struct scsi_low_softc *);
#endif /* !_SCSI_LOW_PISA_H_ */

View File

@ -1,57 +0,0 @@
/* $FreeBSD$ */
/* $NecBSD: physio_proc.h,v 3.4 1999/07/23 20:47:03 honda Exp $ */
/* $NetBSD$ */
/*-
* [NetBSD for NEC PC-98 series]
* Copyright (c) 1998
* NetBSD/pc98 porting staff. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _COMPAT_NETBSD_PHYSIO_PROC_H_
#define _COMPAT_NETBSD_PHYSIO_PROC_H_
#include <sys/queue.h>
struct buf;
struct physio_proc {
};
static __inline struct physio_proc *physio_proc_enter(struct buf *);
static __inline void physio_proc_leave(struct physio_proc *);
static __inline struct physio_proc *
physio_proc_enter(bp)
struct buf *bp;
{
return NULL;
}
static __inline void
physio_proc_leave(pp)
struct physio_proc *pp;
{
}
#endif /* _COMPAT_NETBSD_PHYSIO_PROC_H_ */

View File

@ -130,7 +130,6 @@ cam/ctl/ctl_util.c optional ctl
cam/ctl/scsi_ctl.c optional ctl
cam/scsi/scsi_da.c optional da
cam/scsi/scsi_low.c optional ct | ncv | nsp | stg
cam/scsi/scsi_low_pisa.c optional ct | ncv | nsp | stg
cam/scsi/scsi_pass.c optional pass
cam/scsi/scsi_pt.c optional pt
cam/scsi/scsi_sa.c optional sa

View File

@ -53,9 +53,7 @@ __FBSDID("$FreeBSD$");
#include <machine/md_var.h>
#include <compat/netbsd/dvcfg.h>
#include <compat/netbsd/physio_proc.h>
#include <sys/module.h> /* XXX: Hack */
#include <cam/scsi/scsi_low.h>
#include <dev/ic/wd33c93reg.h>
@ -115,8 +113,9 @@ bshw_bus_reset(ct)
/* open hardware busmaster mode */
if (hw->hw_dma_init != NULL && ((*hw->hw_dma_init)(ct)) != 0)
{
printf("%s: change mode using external DMA (%x)\n",
slp->sl_xname, (u_int)ct_cr_read_1(chp, 0x37));
device_printf(slp->sl_dev,
"change mode using external DMA (%x)\n",
(u_int)ct_cr_read_1(chp, 0x37));
}
/* clear hardware synch registers */
@ -240,7 +239,7 @@ bshw_lc_smit_fstat(ct, wc, read)
}
}
printf("%s: SMIT fifo status timeout\n", ct->sc_sclow.sl_xname);
device_printf(ct->sc_sclow.sl_dev, "SMIT fifo status timeout\n");
return EIO;
}
@ -279,14 +278,15 @@ bshw_smit_xfer_stop(ct)
else if (count > bs->sc_sdatalen)
{
bad:
printf("%s: smit_xfer_end: cnt error\n", slp->sl_xname);
device_printf(slp->sl_dev,
"smit_xfer_end: cnt error\n");
slp->sl_error |= PDMAERR;
}
scsi_low_data_finish(slp);
}
else
{
printf("%s: smit_xfer_end: phase miss\n", slp->sl_xname);
device_printf(slp->sl_dev, "smit_xfer_end: phase miss\n");
slp->sl_error |= PDMAERR;
}
}
@ -488,8 +488,9 @@ bshw_dma_xfer_stop(ct)
}
else if (count > (u_int) bs->sc_seglen)
{
printf("%s: port data %x != seglen %x\n",
slp->sl_xname, count, bs->sc_seglen);
device_printf(slp->sl_dev,
"port data %x != seglen %x\n",
count, bs->sc_seglen);
slp->sl_error |= PDMAERR;
}
@ -497,7 +498,7 @@ bshw_dma_xfer_stop(ct)
}
else
{
printf("%s: extra DMA interrupt\n", slp->sl_xname);
device_printf(slp->sl_dev, "extra DMA interrupt\n");
slp->sl_error |= PDMAERR;
}

View File

@ -50,9 +50,6 @@ __FBSDID("$FreeBSD$");
#include <machine/bus.h>
#include <compat/netbsd/dvcfg.h>
#include <compat/netbsd/physio_proc.h>
#include <cam/scsi/scsi_low.h>
#include <dev/ic/wd33c93reg.h>
@ -348,17 +345,6 @@ ctprobesubr(chp, dvcfg, hsid, chipclk, chiprevp)
return 1;
}
int
ctprint(aux, name)
void *aux;
const char *name;
{
if (name != NULL)
printf("%s: scsibus ", name);
return 1;
}
void
ctattachsubr(ct)
struct ct_softc *ct;
@ -480,7 +466,6 @@ ct_world_start(ct, fdone)
scsi_low_bus_reset(slp);
cthw_chip_reset(chp, NULL, ct->sc_chipclk, slp->sl_hostid);
SOFT_INTR_REQUIRED(slp);
return 0;
}
@ -760,8 +745,8 @@ ct_phase_error(ct, scsi_status)
if (pep->pe_msg != NULL)
{
printf("%s: phase error: %s",
slp->sl_xname, pep->pe_msg);
device_printf(slp->sl_dev, "phase error: %s",
pep->pe_msg);
scsi_low_print(slp, slp->sl_Tnexus);
}
@ -904,7 +889,7 @@ ct_unbusy(ct)
DELAY(CT_DELAY_INTERVAL);
}
printf("%s: unbusy timeout\n", slp->sl_xname);
device_printf(slp->sl_dev, "unbusy timeout\n");
return EBUSY;
}
@ -935,7 +920,6 @@ ctintr(arg)
struct scsi_low_softc *slp = &ct->sc_sclow;
struct ct_bus_access_handle *chp = &ct->sc_ch;
struct targ_info *ti;
struct physio_proc *pp;
struct buf *bp;
u_int derror, flags;
int len, satgo, error;
@ -974,7 +958,7 @@ ctintr(arg)
if (ct_debug > 0)
{
scsi_low_print(slp, NULL);
printf("%s: scsi_status 0x%x\n\n", slp->sl_xname,
device_printf(slp->sl_dev, "scsi_status 0x%x\n\n",
(u_int) scsi_status);
#ifdef KDB
if (ct_debug > 1)
@ -1079,9 +1063,7 @@ ctintr(arg)
slp->sl_flags |= HW_PDMASTART;
if ((ct->sc_xmode & CT_XMODE_PIO) != 0)
{
pp = physio_proc_enter(bp);
error = (*ct->ct_pio_xfer_start) (ct);
physio_proc_leave(pp);
if (error == 0)
{
ct->sc_dma |= CT_DMA_PIOSTART;
@ -1105,7 +1087,8 @@ ctintr(arg)
{
if (!(slp->sl_flags & HW_READ_PADDING))
{
printf("%s: read padding required\n", slp->sl_xname);
device_printf(slp->sl_dev,
"read padding required\n");
return 1;
}
}
@ -1113,7 +1096,8 @@ ctintr(arg)
{
if (!(slp->sl_flags & HW_WRITE_PADDING))
{
printf("%s: write padding required\n", slp->sl_xname);
device_printf(slp->sl_dev,
"write padding required\n");
return 1;
}
}
@ -1134,8 +1118,8 @@ ctintr(arg)
slp->sl_scp.scp_cmdlen,
SCSI_LOW_WRITE, &derror) != 0)
{
printf("%s: scsi cmd xfer short\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"scsi cmd xfer short\n");
}
return 1;
@ -1167,7 +1151,7 @@ ctintr(arg)
case BSR_UNSPINFO0:
case BSR_UNSPINFO1:
printf("%s: illegal bus phase (0x%x)\n", slp->sl_xname,
device_printf(slp->sl_dev, "illegal bus phase (0x%x)\n",
(u_int) scsi_status);
scsi_low_print(slp, ti);
return 1;
@ -1187,8 +1171,8 @@ ctintr(arg)
if (ct_xfer(ct, ti->ti_msgoutstr, len,
SCSI_LOW_WRITE, &derror) != 0)
{
printf("%s: scsi msgout xfer short\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"scsi msgout xfer short\n");
}
SCSI_LOW_DEASSERT_ATN(slp);
ct->sc_atten = 0;

View File

@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$");
#include <isa/isavar.h>
#include <compat/netbsd/dvcfg.h>
#include <compat/netbsd/physio_proc.h>
#include <cam/scsi/scsi_low.h>
@ -297,7 +296,6 @@ ct_isa_attach(device_t dev)
slp->sl_dev = dev;
slp->sl_hostid = bs->sc_hostid;
slp->sl_irq = isa_get_irq(dev);
slp->sl_cfgflags = device_get_flags(dev);
s = splcam();

View File

@ -208,9 +208,4 @@ ct_cmdp_write_1(chp, val)
CT_BUS_WEIGHT(chp)
}
#if defined(__i386__) && 0
#define SOFT_INTR_REQUIRED(slp) (softintr((slp)->sl_irq))
#else /* !__i386__ */
#define SOFT_INTR_REQUIRED(slp)
#endif /* !__i386__ */
#endif /* !_CT_MACHDEP_H_ */

View File

@ -132,6 +132,5 @@ struct ct_targ_info {
*****************************************************************/
int ctprobesubr(struct ct_bus_access_handle *, u_int, int, u_int, int *);
void ctattachsubr(struct ct_softc *);
int ctprint(void *, const char *);
int ctintr(void *);
#endif /* !_CTVAR_H_ */

View File

@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
#include <machine/bus.h>
#include <compat/netbsd/dvcfg.h>
#include <compat/netbsd/physio_proc.h>
#include <cam/scsi/scsi_low.h>
@ -326,7 +325,7 @@ ncvhw_power(sc, flags)
if (flags == SCSI_LOW_POWDOWN)
{
printf("%s power down\n", slp->sl_xname);
device_printf(slp->sl_dev, "power down\n");
ncvhw_select_register_1(iot, ioh, &sc->sc_hw);
bus_space_write_1(iot, ioh, cr1_atacmd, ATACMD_POWDOWN);
}
@ -335,13 +334,13 @@ ncvhw_power(sc, flags)
switch (sc->sc_rstep)
{
case 0:
printf("%s resume step O\n", slp->sl_xname);
device_printf(slp->sl_dev, "resume step O\n");
ncvhw_select_register_1(iot, ioh, &sc->sc_hw);
bus_space_write_1(iot, ioh, cr1_atacmd, ATACMD_ENGAGE);
break;
case 1:
printf("%s resume step I\n", slp->sl_xname);
device_printf(slp->sl_dev, "resume step I\n");
ncvhw_reset(iot, ioh, &sc->sc_hw);
ncvhw_init(iot, ioh, &sc->sc_hw);
break;
@ -473,7 +472,6 @@ ncv_world_start(sc, fdone)
(bus_space_read_1(sc->sc_iot, sc->sc_ioh, cr0_istat) & INTR_SBR))
return ENODEV;
SOFT_INTR_REQUIRED(slp);
return 0;
}
@ -607,17 +605,6 @@ ncvprobesubr(iot, ioh, dvcfg, hsid)
return 1;
}
int
ncvprint(aux, name)
void *aux;
const char *name;
{
if (name != NULL)
printf("%s: scsibus ", name);
return 1;
}
void
ncvattachsubr(sc)
struct ncv_softc *sc;
@ -696,9 +683,9 @@ ncv_pdma_end(sc, ti)
bad:
if ((slp->sl_error & PDMAERR) == 0)
{
printf("%s: stragne cnt hw 0x%x soft 0x%x\n",
slp->sl_xname, len,
slp->sl_scp.scp_datalen);
device_printf(slp->sl_dev,
"strange cnt hw 0x%x soft 0x%x\n", len,
slp->sl_scp.scp_datalen);
}
slp->sl_error |= PDMAERR;
}
@ -706,7 +693,7 @@ ncv_pdma_end(sc, ti)
}
else
{
printf("%s: data phase miss\n", slp->sl_xname);
device_printf(slp->sl_dev, "data phase miss\n");
slp->sl_error |= PDMAERR;
}
@ -859,7 +846,7 @@ ncv_reselected(sc)
if ((bus_space_read_1(iot, ioh, cr0_sffl) & CR0_SFFLR_BMASK) != 2)
{
printf("%s illegal fifo bytes\n", slp->sl_xname);
device_printf(slp->sl_dev, "illegal fifo bytes\n");
scsi_low_restart(slp, SCSI_LOW_RESTART_HARD, "chip confused");
return EJUSTRETURN;
}
@ -965,7 +952,6 @@ ncvintr(arg)
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
struct targ_info *ti;
struct physio_proc *pp;
struct buf *bp;
u_int derror, flags;
int len;
@ -1005,7 +991,7 @@ ncvintr(arg)
if (ncv_debug)
{
scsi_low_print(slp, NULL);
printf("%s st %x ist %x\n\n", slp->sl_xname,
device_printf(slp->sl_dev, "st %x ist %x\n\n",
status, ireason);
#ifdef KDB
if (ncv_debug > 1)
@ -1087,8 +1073,8 @@ ncvintr(arg)
ncv_target_nexus_establish(sc);
if ((status & PHASE_MASK) != MESSAGE_IN_PHASE)
{
printf("%s: unexpected phase after reselect\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"unexpected phase after reselect\n");
slp->sl_error |= FATALIO;
scsi_low_assert_msg(slp, ti, SCSI_LOW_MSG_ABORT, 1);
return 1;
@ -1115,14 +1101,13 @@ ncvintr(arg)
scsi_low_attention(slp);
}
pp = physio_proc_enter(bp);
if (slp->sl_scp.scp_datalen <= 0)
{
if ((ireason & INTR_BS) == 0)
break;
if ((slp->sl_error & PDMAERR) == 0)
printf("%s: data underrun\n", slp->sl_xname);
device_printf(slp->sl_dev, "data underrun\n");
slp->sl_error |= PDMAERR;
if ((slp->sl_flags & HW_WRITE_PADDING) != 0)
@ -1134,8 +1119,8 @@ ncvintr(arg)
}
else
{
printf("%s: write padding required\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"write padding required\n");
}
}
else
@ -1148,7 +1133,6 @@ ncvintr(arg)
}
ncv_pio_write(sc, slp->sl_scp.scp_data, len);
}
physio_proc_leave(pp);
break;
case DATA_IN_PHASE: /* data in */
@ -1158,14 +1142,13 @@ ncvintr(arg)
scsi_low_attention(slp);
}
pp = physio_proc_enter(bp);
if (slp->sl_scp.scp_datalen <= 0)
{
if ((ireason & INTR_BS) == 0)
break;
if ((slp->sl_error & PDMAERR) == 0)
printf("%s: data overrun\n", slp->sl_xname);
device_printf(slp->sl_dev, "data overrun\n");
slp->sl_error |= PDMAERR;
if ((slp->sl_flags & HW_READ_PADDING) != 0)
@ -1176,8 +1159,8 @@ ncvintr(arg)
}
else
{
printf("%s: read padding required\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"read padding required\n");
break;
}
}
@ -1191,7 +1174,6 @@ ncvintr(arg)
}
ncv_pio_read(sc, slp->sl_scp.scp_data, len);
}
physio_proc_leave(pp);
break;
case COMMAND_PHASE: /* cmd out */

View File

@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$");
#include <dev/pccard/pccardvar.h>
#include <cam/scsi/scsi_low.h>
#include <cam/scsi/scsi_low_pisa.h>
#include <dev/ncv/ncr53c500reg.h>
#include <dev/ncv/ncr53c500hw.h>

View File

@ -36,8 +36,6 @@
#ifndef __NCR53C500HW_H_
#define __NCR53C500HW_H_
#include <compat/netbsd/dvcfg.h>
#define NCV_HOSTID 7
#define NCV_NTARGETS 8
#define NCV_NLUNS 8

View File

@ -82,12 +82,6 @@ struct ncv_targ_info {
*****************************************************************/
int ncvprobesubr(bus_space_tag_t, bus_space_handle_t ioh, u_int, int);
void ncvattachsubr(struct ncv_softc *);
int ncvprint(void *, const char *);
int ncvintr(void *);
#if defined(__i386__) && 0
#define SOFT_INTR_REQUIRED(slp) (softintr((slp)->sl_irq))
#else /* !__i386__ */
#define SOFT_INTR_REQUIRED(slp)
#endif /* !__i386__ */
#endif /* !_NCR53C500VAR_H_ */

View File

@ -54,9 +54,6 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
#include <machine/bus.h>
#include <compat/netbsd/dvcfg.h>
#include <compat/netbsd/physio_proc.h>
#include <cam/scsi/scsi_low.h>
#include <dev/nsp/nspreg.h>
#include <dev/nsp/nspvar.h>
@ -229,7 +226,7 @@ nsp_expect_signal(struct nsp_softc *sc, u_int8_t curphase, u_int8_t mask)
DELAY(NSP_DELAY_INTERVAL);
}
printf("%s: nsp_expect_signal timeout\n", slp->sl_xname);
device_printf(slp->sl_dev, "nsp_expect_signal timeout\n");
return -1;
}
@ -463,7 +460,6 @@ nsp_world_start(sc, fdone)
nsphw_init(sc);
scsi_low_bus_reset(slp);
SOFT_INTR_REQUIRED(slp);
return 0;
}
@ -601,17 +597,6 @@ nspprobesubr(iot, ioh, dvcfg)
return 1;
}
int
nspprint(aux, name)
void *aux;
const char *name;
{
if (name != NULL)
printf("%s: scsibus ", name);
return 1;
}
void
nspattachsubr(sc)
struct nsp_softc *sc;
@ -761,8 +746,8 @@ nsp_pdma_end(sc, ti)
else
{
slp->sl_error |= PDMAERR;
printf("%s len %x >= datalen %x\n",
slp->sl_xname,
device_printf(slp->sl_dev,
"len %x >= datalen %x\n",
len, slp->sl_scp.scp_datalen);
}
}
@ -772,8 +757,9 @@ nsp_pdma_end(sc, ti)
sc->sc_cnt > cb->ccb_scp.scp_datalen)
{
slp->sl_error |= PDMAERR;
printf("%s: data read count error %x != %x (%x)\n",
slp->sl_xname, sc->sc_cnt, cnt,
device_printf(slp->sl_dev,
"data read count error %x != %x (%x)\n",
sc->sc_cnt, cnt,
cb->ccb_scp.scp_datalen);
}
}
@ -783,7 +769,7 @@ nsp_pdma_end(sc, ti)
else
{
printf("%s data phase miss\n", slp->sl_xname);
device_printf(slp->sl_dev, "data phase miss\n");
slp->sl_error |= PDMAERR;
}
}
@ -834,8 +820,8 @@ nsp_read_fifo(sc, suspendio)
#ifdef NSP_DEBUG
if (res < sc->sc_cnt || res == (u_int) -1)
{
printf("%s: strange fifo ack count 0x%x < 0x%x\n",
slp->sl_xname, res, sc->sc_cnt);
device_printf(slp->sl_dev,
"strange fifo ack count 0x%x < 0x%x\n", res, sc->sc_cnt);
return 0;
}
#endif /* NSP_DEBUG */
@ -845,8 +831,8 @@ nsp_read_fifo(sc, suspendio)
{
if ((slp->sl_error & PDMAERR) == 0)
{
printf("%s: data overrun 0x%x > 0x%x\n",
slp->sl_xname, res, slp->sl_scp.scp_datalen);
device_printf(slp->sl_dev, "data overrun 0x%x > 0x%x\n",
res, slp->sl_scp.scp_datalen);
}
slp->sl_error |= PDMAERR;
@ -854,7 +840,7 @@ nsp_read_fifo(sc, suspendio)
if ((slp->sl_flags & HW_READ_PADDING) == 0)
{
printf("%s: read padding required\n", slp->sl_xname);
device_printf(slp->sl_dev, "read padding required\n");
return 0;
}
@ -924,8 +910,9 @@ nsp_write_fifo(sc, suspendio)
#ifdef NSP_DEBUG
if ((slp->sl_scp.scp_datalen % WFIFO_CRIT) != 0)
{
printf("%s: strange write length 0x%x\n",
slp->sl_xname, slp->sl_scp.scp_datalen);
device_printf(slp->sl_dev,
"strange write length 0x%x\n",
slp->sl_scp.scp_datalen);
}
#endif /* NSP_DEBUG */
res = slp->sl_scp.scp_datalen % suspendio;
@ -1071,7 +1058,7 @@ nsp_pio_read(sc, suspendio)
if ((-- tout) <= 0)
{
printf("%s: nsp_pio_read: timeout\n", slp->sl_xname);
device_printf(slp->sl_dev, "nsp_pio_read: timeout\n");
return;
}
}
@ -1183,7 +1170,7 @@ nsp_pio_write(sc, suspendio)
if ((-- tout) <= 0)
{
printf("%s: nsp_pio_write: timeout\n", slp->sl_xname);
device_printf(slp->sl_dev, "nsp_pio_write: timeout\n");
return;
}
}
@ -1215,7 +1202,7 @@ nsp_negate_signal(struct nsp_softc *sc, u_int8_t mask, u_char *s)
DELAY(NSP_DELAY_INTERVAL);
}
printf("%s: %s nsp_negate_signal timeout\n", slp->sl_xname, s);
device_printf(slp->sl_dev, "%s nsp_negate_signal timeout\n", s);
return -1;
}
@ -1329,9 +1316,9 @@ nsp_error(struct nsp_softc * sc, u_char *s, u_int8_t isrc, u_int8_t ph,
{
struct scsi_low_softc *slp = &sc->sc_sclow;
printf("%s: %s\n", slp->sl_xname, s);
printf("%s: isrc 0x%x scmon 0x%x irqphs 0x%x\n",
slp->sl_xname, (u_int) isrc, (u_int) ph, (u_int) irqphs);
device_printf(slp->sl_dev, "%s\n", s);
device_printf(slp->sl_dev, "isrc 0x%x scmon 0x%x irqphs 0x%x\n",
(u_int) isrc, (u_int) ph, (u_int) irqphs);
}
static int
@ -1404,8 +1391,8 @@ nsp_phase_match(struct nsp_softc *sc, u_int8_t phase, u_int8_t stat)
if ((stat & SCBUSMON_PHMASK) != phase)
{
printf("%s: phase mismatch 0x%x != 0x%x\n",
slp->sl_xname, (u_int) phase, (u_int) stat);
device_printf(slp->sl_dev, "phase mismatch 0x%x != 0x%x\n",
(u_int) phase, (u_int) stat);
return EINVAL;
}
@ -1424,7 +1411,6 @@ nspintr(arg)
bus_space_tag_t bst = sc->sc_iot;
bus_space_handle_t bsh = sc->sc_ioh;
struct targ_info *ti;
struct physio_proc *pp;
struct buf *bp;
u_int derror, flags;
int len, rv;
@ -1572,8 +1558,8 @@ nspintr(arg)
nsp_target_nexus_establish(sc);
if ((ph & SCBUSMON_PHMASK) != PHASE_MSGIN)
{
printf("%s: unexpected phase after reselect\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"unexpected phase after reselect\n");
slp->sl_error |= FATALIO;
scsi_low_assert_msg(slp, ti, SCSI_LOW_MSG_ABORT, 1);
return 1;
@ -1653,9 +1639,7 @@ nspintr(arg)
scsi_low_attention(slp);
}
pp = physio_proc_enter(bp);
nsp_pio_write(sc, sc->sc_suspendio);
physio_proc_leave(pp);
break;
case IRQPHS_DATAIN:
@ -1665,9 +1649,7 @@ nspintr(arg)
scsi_low_attention(slp);
}
pp = physio_proc_enter(bp);
nsp_pio_read(sc, sc->sc_suspendio);
physio_proc_leave(pp);
break;
case IRQPHS_STATUS:
@ -1864,7 +1846,7 @@ nsp_timeout(sc)
slp->sl_error |= PDMAERR;
if ((slp->sl_flags & HW_WRITE_PADDING) == 0)
{
printf("%s: write padding required\n", slp->sl_xname);
device_printf(slp->sl_dev, "write padding required\n");
break;
}

View File

@ -48,14 +48,12 @@ __FBSDID("$FreeBSD$");
#include <machine/bus.h>
#include <machine/resource.h>
#include <sys/rman.h>
#include <compat/netbsd/dvcfg.h>
#include <sys/bus.h>
#include <dev/pccard/pccardvar.h>
#include <cam/scsi/scsi_low.h>
#include <cam/scsi/scsi_low_pisa.h>
#include <dev/nsp/nspreg.h>
#include <dev/nsp/nspvar.h>

View File

@ -91,12 +91,6 @@ struct nsp_targ_info {
*****************************************************************/
int nspprobesubr(bus_space_tag_t, bus_space_handle_t, u_int);
void nspattachsubr(struct nsp_softc *);
int nspprint(void *, const char *);
int nspintr(void *);
#if defined(__i386__) && 0
#define SOFT_INTR_REQUIRED(slp) (softintr((slp)->sl_irq))
#else /* !__i386__ */
#define SOFT_INTR_REQUIRED(slp)
#endif /* !__i386__ */
#endif /* !_NSPVAR_H_ */

View File

@ -53,9 +53,6 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
#include <machine/bus.h>
#include <compat/netbsd/dvcfg.h>
#include <compat/netbsd/physio_proc.h>
#include <cam/scsi/scsi_low.h>
#include <dev/stg/tmc18c30reg.h>
#include <dev/stg/tmc18c30var.h>
@ -349,7 +346,6 @@ stg_world_start(sc, fdone)
scsi_low_bus_reset(slp);
stghw_init(sc);
SOFT_INTR_REQUIRED(slp);
return 0;
}
@ -424,17 +420,6 @@ stgprobesubr(iot, ioh, dvcfg)
return 0;
}
int
stgprint(aux, name)
void *aux;
const char *name;
{
if (name != NULL)
printf("%s: scsibus ", name);
return 1;
}
void
stgattachsubr(sc)
struct stg_softc *sc;
@ -494,8 +479,8 @@ stg_pdma_end(sc, ti)
else
{
slp->sl_error |= PDMAERR;
printf("%s len %x >= datalen %x\n",
slp->sl_xname,
device_printf(slp->sl_dev,
"len %x >= datalen %x\n",
len, slp->sl_scp.scp_datalen);
}
}
@ -505,8 +490,8 @@ stg_pdma_end(sc, ti)
if (len != 0)
{
slp->sl_error |= PDMAERR;
printf("%s: len %x left in fifo\n",
slp->sl_xname, len);
device_printf(slp->sl_dev,
"len %x left in fifo\n", len);
}
}
scsi_low_data_finish(slp);
@ -514,7 +499,7 @@ stg_pdma_end(sc, ti)
else
{
printf("%s data phase miss\n", slp->sl_xname);
device_printf(slp->sl_dev, "data phase miss\n");
slp->sl_error |= PDMAERR;
}
@ -583,8 +568,8 @@ stg_pio_read(sc, ti, thold)
slp->sl_error |= PDMAERR;
if ((slp->sl_flags & HW_READ_PADDING) == 0)
{
printf("%s: read padding required\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"read padding required\n");
break;
}
@ -612,7 +597,7 @@ stg_pio_read(sc, ti, thold)
}
if (tout <= 0)
printf("%s: pio read timeout\n", slp->sl_xname);
device_printf(slp->sl_dev, "pio read timeout\n");
}
static void
@ -694,7 +679,7 @@ stg_pio_write(sc, ti, thold)
}
if (tout <= 0)
printf("%s: pio write timeout\n", slp->sl_xname);
device_printf(slp->sl_dev, "pio write timeout\n");
}
static int
@ -717,7 +702,7 @@ stg_negate_signal(struct stg_softc *sc, u_int8_t mask, u_char *s)
DELAY(STG_DELAY_INTERVAL);
}
printf("%s: %s stg_negate_signal timeout\n", slp->sl_xname, s);
device_printf(slp->sl_dev, "%s stg_negate_signal timeout\n", s);
return -1;
}
@ -744,7 +729,7 @@ stg_expect_signal(struct stg_softc *sc, u_int8_t phase, u_int8_t mask)
DELAY(STG_DELAY_INTERVAL);
}
printf("%s: stg_expect_signal timeout\n", slp->sl_xname);
device_printf(slp->sl_dev, "stg_expect_signal timeout\n");
return -1;
}
@ -819,7 +804,7 @@ stg_reselected(sc)
}
else if (slp->sl_Tnexus != NULL)
{
printf("%s: unexpected termination\n", slp->sl_xname);
device_printf(slp->sl_dev, "unexpected termination\n");
stg_disconnected(sc, slp->sl_Tnexus);
}
@ -843,7 +828,7 @@ stg_reselected(sc)
}
DELAY(1);
}
printf("%s: reselction timeout I\n", slp->sl_xname);
device_printf(slp->sl_dev, "reselction timeout I\n");
return EJUSTRETURN;
reselect_start:
@ -866,7 +851,7 @@ stg_reselected(sc)
goto reselected;
DELAY(1);
}
printf("%s: reselction timeout II\n", slp->sl_xname);
device_printf(slp->sl_dev, "reselction timeout II\n");
return EJUSTRETURN;
reselected:
@ -996,7 +981,6 @@ stgintr(arg)
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
struct targ_info *ti;
struct physio_proc *pp;
struct buf *bp;
u_int derror, flags;
int len, s;
@ -1034,7 +1018,7 @@ stgintr(arg)
if (stg_debug)
{
scsi_low_print(slp, NULL);
printf("%s: st %x ist %x\n\n", slp->sl_xname,
device_printf(slp->sl_dev, "st %x ist %x\n\n",
status, astatus);
#ifdef KDB
if (stg_debug > 1)
@ -1151,8 +1135,8 @@ stgintr(arg)
stg_target_nexus_establish(sc);
if ((status & PHASE_MASK) != MESSAGE_IN_PHASE)
{
printf("%s: unexpected phase after reselect\n",
slp->sl_xname);
device_printf(slp->sl_dev,
"unexpected phase after reselect\n");
slp->sl_error |= FATALIO;
scsi_low_assert_msg(slp, ti, SCSI_LOW_MSG_ABORT, 1);
goto out;
@ -1189,7 +1173,7 @@ stgintr(arg)
if (stg_xfer(sc, slp->sl_scp.scp_cmd, slp->sl_scp.scp_cmdlen,
COMMAND_PHASE, 0) != 0)
{
printf("%s: CMDOUT short\n", slp->sl_xname);
device_printf(slp->sl_dev, "CMDOUT short\n");
}
break;
@ -1200,12 +1184,10 @@ stgintr(arg)
scsi_low_attention(slp);
}
pp = physio_proc_enter(bp);
if ((sc->sc_icinit & ICTL_FIFO) != 0)
stg_pio_write(sc, ti, sc->sc_wthold);
else
stg_pio_write(sc, ti, 0);
physio_proc_leave(pp);
break;
case DATA_IN_PHASE:
@ -1215,12 +1197,10 @@ stgintr(arg)
scsi_low_attention(slp);
}
pp = physio_proc_enter(bp);
if ((sc->sc_icinit & ICTL_FIFO) != 0)
stg_pio_read(sc, ti, sc->sc_rthold);
else
stg_pio_read(sc, ti, 0);
physio_proc_leave(pp);
break;
case STATUS_PHASE:
@ -1236,7 +1216,7 @@ stgintr(arg)
}
if (regv != bus_space_read_1(iot, ioh, tmc_rdata))
{
printf("%s: STATIN: data mismatch\n", slp->sl_xname);
device_printf(slp->sl_dev, "STATIN: data mismatch\n");
}
stg_negate_signal(sc, BSTAT_ACK, "statin<ACK>");
break;
@ -1258,7 +1238,7 @@ stgintr(arg)
if (stg_xfer(sc, ti->ti_msgoutstr, len, MESSAGE_OUT_PHASE,
slp->sl_clear_atten) != 0)
{
printf("%s: MSGOUT short\n", slp->sl_xname);
device_printf(slp->sl_dev, "MSGOUT short\n");
}
else
{
@ -1290,7 +1270,7 @@ stgintr(arg)
/* read data with ACK */
if (regv != bus_space_read_1(iot, ioh, tmc_rdata))
{
printf("%s: MSGIN: data mismatch\n", slp->sl_xname);
device_printf(slp->sl_dev, "MSGIN: data mismatch\n");
}
/* wait for the ack negated */
@ -1303,14 +1283,14 @@ stgintr(arg)
break;
case BUSFREE_PHASE:
printf("%s: unexpected disconnect\n", slp->sl_xname);
device_printf(slp->sl_dev, "unexpected disconnect\n");
stg_disconnected(sc, ti);
break;
default:
slp->sl_error |= FATALIO;
printf("%s: unknown phase bus %x intr %x\n",
slp->sl_xname, status, astatus);
device_printf(slp->sl_dev, "unknown phase bus %x intr %x\n",
status, astatus);
break;
}
@ -1338,7 +1318,7 @@ stg_timeout(sc)
if (sc->sc_ubf_timeout ++ == 0)
return 0;
printf("%s: unexpected bus free detected\n", slp->sl_xname);
device_printf(slp->sl_dev, "unexpected bus free detected\n");
slp->sl_error |= FATALIO;
scsi_low_print(slp, slp->sl_Tnexus);
stg_disconnected(sc, slp->sl_Tnexus);
@ -1360,8 +1340,7 @@ stg_timeout(sc)
slp->sl_error |= PDMAERR;
if ((slp->sl_flags & HW_WRITE_PADDING) == 0)
{
printf("%s: write padding required\n",
slp->sl_xname);
device_printf(slp->sl_dev, "write padding required\n");
break;
}

View File

@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$");
#include <sys/rman.h>
#include <cam/scsi/scsi_low.h>
#include <cam/scsi/scsi_low_pisa.h>
#include <dev/stg/tmc18c30reg.h>
#include <dev/stg/tmc18c30var.h>

View File

@ -49,14 +49,12 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <machine/bus.h>
#include <compat/netbsd/dvcfg.h>
#include <sys/bus.h>
#include <dev/pccard/pccardvar.h>
#include <cam/scsi/scsi_low.h>
#include <cam/scsi/scsi_low_pisa.h>
#include <dev/stg/tmc18c30reg.h>
#include <dev/stg/tmc18c30var.h>

View File

@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$");
#include <dev/pci/pcivar.h>
#include <cam/scsi/scsi_low.h>
#include <cam/scsi/scsi_low_pisa.h>
#include <dev/stg/tmc18c30reg.h>
#include <dev/stg/tmc18c30var.h>

View File

@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
#include <sys/rman.h>
#include <cam/scsi/scsi_low.h>
#include <cam/scsi/scsi_low_pisa.h>
#include <dev/stg/tmc18c30reg.h>
#include <dev/stg/tmc18c30var.h>

View File

@ -90,12 +90,6 @@ struct stg_targ_info {
*****************************************************************/
int stgprobesubr(bus_space_tag_t, bus_space_handle_t, u_int);
void stgattachsubr(struct stg_softc *);
int stgprint(void *, const char *);
int stgintr(void *);
#if defined(__i386__) && 0
#define SOFT_INTR_REQUIRED(slp) (softintr((slp)->sl_irq))
#else /* !__i386__ */
#define SOFT_INTR_REQUIRED(slp)
#endif /* !__i386__ */
#endif /* !_TMC18C30VAR_H_ */