* Copyright (c) 1988 University of Utah.
* Copyright (c) 1990 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Van Jacobson of Lawrence Berkeley Laboratory and the Systems
* Programming Group of the University of Utah Computer Science Department.
* %sccs.include.redist.c%
* from: Utah $Hdr: sd.c 1.2 90/01/23$
* @(#)sd.c 7.5 (Berkeley) %G%
#include "../dev/scsireg.h"
115712, 218112, 82944, 115712
register struct sd_softc
*ss
= &sd_softc
[ctlr
][unit
];
/* NB: HP6300 won't boot if next printf is removed (???) - vj */
printf("sd(%d,%d,0,0): ", ctlr
, unit
);
stat
= scsi_test_unit_rdy(ctlr
, unit
);
/* drive may be doing RTZ - wait a bit */
if (stat
== STS_CHECKCOND
) {
stat
= scsi_test_unit_rdy(ctlr
, unit
);
printf("giving up (stat=%x).\n", stat
);
* try to get the drive block size.
stat
= scsi_read_capacity(ctlr
, unit
,
(u_char
*)capbuf
, sizeof(capbuf
));
if (capbuf
[1] > DEV_BSIZE
)
for (; capbuf
[1] > DEV_BSIZE
; capbuf
[1] >>= 1)
register struct sd_softc
*ss
;
if (ctlr
>= NSCSI
|| scsialive(ctlr
) == 0)
ss
= &sd_softc
[ctlr
][unit
];
if (sdinit(ctlr
, unit
) == 0)
io
->i_boff
= sdpartoff
[part
];
register int ctlr
= io
->i_adapt
;
register int unit
= io
->i_ctlr
;
register struct sd_softc
*ss
= &sd_softc
[ctlr
][unit
];
daddr_t blk
= io
->i_bn
>> ss
->sc_blkshift
;
u_int nblk
= io
->i_cc
>> ss
->sc_blkshift
;
stat
= scsi_tt_read(ctlr
, unit
, io
->i_ma
, io
->i_cc
, blk
, nblk
);
stat
= scsi_tt_write(ctlr
, unit
, io
->i_ma
, io
->i_cc
, blk
, nblk
);
printf("sd(%d,%d,%d,%d): block=%x, error=0x%x\n",
ctlr
, unit
, io
->i_unit
, io
->i_part
, blk
, stat
);
if (++ss
->sc_retry
> SDRETRY
)