Changes to get the first working scsi driver (ncr.c) for the pc532.
This commit is contained in:
parent
c94a9739fd
commit
e082e0b31d
|
@ -30,7 +30,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ncr.c,v 1.1 1994/02/22 22:55:04 phil Exp $
|
||||
* $Id: ncr.c,v 1.2 1994/02/23 07:59:03 phil Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
|||
|
||||
/* #define PSEUDO_DMA 1 */
|
||||
|
||||
static int pdebug=1;
|
||||
static int ncr_debug=1;
|
||||
|
||||
#include "sys/types.h"
|
||||
#include "sys/malloc.h"
|
||||
|
@ -329,7 +329,8 @@ ncr5380_scsi_cmd(struct scsi_xfer *xs)
|
|||
return (r);
|
||||
}
|
||||
cur_xs = xs;
|
||||
ncr_needs_finish = 1;
|
||||
if (xs->when_done != NULL)
|
||||
(*xs->when_done)(xs->done_arg, xs->done_arg2);
|
||||
return SUCCESSFULLY_QUEUED;
|
||||
|
||||
/*
|
||||
|
@ -345,18 +346,6 @@ ncr5380_scsi_cmd(struct scsi_xfer *xs)
|
|||
*/
|
||||
}
|
||||
|
||||
void
|
||||
ncr5380_finish ()
|
||||
{ int times = 1;
|
||||
while (ncr_needs_finish != 0)
|
||||
{
|
||||
printf ("finish times = %d.\n", times++);
|
||||
ncr_needs_finish = 0;
|
||||
if (cur_xs->when_done != NULL)
|
||||
(*cur_xs->when_done)(cur_xs);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
ncr5380_show_scsi_cmd(struct scsi_xfer *xs)
|
||||
{
|
||||
|
@ -402,6 +391,7 @@ ncr5380_intr(int adapter)
|
|||
{
|
||||
register volatile sci_padded_regmap_t *regs = ncr;
|
||||
|
||||
printf ("ncr_intr\n");
|
||||
SCI_CLR_INTR(regs);
|
||||
regs->sci_mode = 0x00;
|
||||
}
|
||||
|
@ -433,7 +423,6 @@ ncr5380_reset_target(int adapter, int target)
|
|||
register volatile sci_padded_regmap_t *regs = ncr;
|
||||
int dummy;
|
||||
|
||||
printf ("ncr_reset\n");
|
||||
scsi_select_ctlr (NCR5380);
|
||||
regs->sci_icmd = SCI_ICMD_TEST;
|
||||
regs->sci_icmd = SCI_ICMD_TEST | SCI_ICMD_RST;
|
||||
|
@ -468,7 +457,7 @@ ncr5380_send_cmd(struct scsi_xfer *xs)
|
|||
if (sense) {
|
||||
switch (sense) {
|
||||
case 0x02: /* Check condition */
|
||||
printf("check cond. target %d.\n", xs->targ);
|
||||
/* printf("check cond. target %d.\n", xs->targ); */
|
||||
s = splbio();
|
||||
scsi_group0(xs->adapter,
|
||||
xs->targ,
|
||||
|
@ -478,7 +467,6 @@ ncr5380_send_cmd(struct scsi_xfer *xs)
|
|||
0, (caddr_t) &(xs->sense),
|
||||
sizeof(struct scsi_sense_data));
|
||||
splx(s);
|
||||
printf ("After scsi_group0.");
|
||||
xs->error = XS_SENSE;
|
||||
return HAD_ERROR;
|
||||
case 0x08: /* Busy */
|
||||
|
@ -890,7 +878,7 @@ scsi_group0(int adapter, int id, int lun, int opcode, int addr, int len,
|
|||
|| (i-- < 0) ) { \
|
||||
printf("ncr.c: timeout counter = %d, len = %d count=%d (count-len %d).\n", \
|
||||
i, len,count,count-len); \
|
||||
printf("pdebug = %d, 1=out, 2=in",pdebug); \
|
||||
printf("ncr_debug = %d, 1=out, 2=in",ncr_debug); \
|
||||
/*dump_regs();*/ \
|
||||
if (poll && !(regs->sci_csr & SCI_CSR_PHASE_MATCH)) { \
|
||||
regs->sci_icmd &= ~SCI_ICMD_DATA; \
|
||||
|
@ -914,7 +902,7 @@ sci_pdma_out(regs, phase, count, data)
|
|||
register volatile u_char *byte_data = sci_1byte_addr;
|
||||
register int len = count, i;
|
||||
|
||||
pdebug=1;
|
||||
ncr_debug=1;
|
||||
|
||||
if (count < 128)
|
||||
return sci_data_out(regs, phase, count, data);
|
||||
|
@ -962,7 +950,7 @@ sci_pdma_in(regs, phase, count, data)
|
|||
register volatile u_char *byte_data = sci_1byte_addr;
|
||||
register int len = count, i;
|
||||
|
||||
pdebug=2;
|
||||
ncr_debug=2;
|
||||
if (count < 128)
|
||||
return sci_data_in(regs, phase, count, data);
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: scn.c,v 1.3 1994/02/21 06:43:31 phil Exp $
|
||||
* $Id: scn.c,v 1.4 1994/02/23 07:59:05 phil Exp $
|
||||
*/
|
||||
|
||||
#include "scn.h"
|
||||
|
@ -408,7 +408,10 @@ struct pc532_device *dp;
|
|||
}
|
||||
#endif
|
||||
|
||||
return (1);
|
||||
/* print the device number... */
|
||||
printf ("scn%d at mainbus0 addr 0x%x\n", unit, line_base);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
*
|
||||
* @(#)autoconf.c 7.1 (Berkeley) 5/9/91
|
||||
*
|
||||
* $Id: autoconf.c,v 1.2 1993/10/27 06:31:06 phil Exp $
|
||||
* $Id: autoconf.c,v 1.3 1994/02/23 07:59:17 phil Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -224,10 +224,7 @@ config_dev(struct pc532_device *dp, int *num)
|
|||
if (driv = dp->pd_driver) {
|
||||
dp->pd_alive = (*driv->probe)(dp);
|
||||
if (dp->pd_alive)
|
||||
if ((*driv->attach)(dp)) {
|
||||
if (((*num)++)) printf (", ");
|
||||
printf("%s%d", dp->pd_name, dp->pd_unit);
|
||||
}
|
||||
(*driv->attach)(dp);
|
||||
return (1);
|
||||
} else return(0);
|
||||
}
|
||||
|
|
|
@ -1102,7 +1102,8 @@ do_soft_intr:
|
|||
movqd 0, _want_softclock(pc)
|
||||
|
||||
no_soft:
|
||||
#if NNCR > 0
|
||||
|
||||
#if 0 /* NNCR > 0 */
|
||||
cmpqd 0, _ncr_needs_finish(pc)
|
||||
beq no_ncr
|
||||
bsr _ncr5380_finish
|
||||
|
|
Loading…
Reference in New Issue