Use the PRVERB() macro instead of 'if (bootverbose) printf()...

Add debuging for all failure cases in aha_cmd().

Always check DATAIN_REG_READY even if we're ready to exit the
read loop.

The last fix allows the AHA-1640 MCA SCSI adapter to operate
correctly and likely fixes problems on a few other oddball
adapters. (I suspect my Dell Drive Array in 1540 mode needs this.)

Reviewed by:	Warner Losh
This commit is contained in:
mdodd 1999-10-02 17:40:07 +00:00
parent 685a5b9058
commit bbea2fab83

View File

@ -330,8 +330,7 @@ aha_probe(struct aha_softc* aha)
* looking at a BusLogic.
*/
if ((error = ahareset(aha, /*hard_reset*/TRUE)) != 0) {
if (bootverbose)
printf("%s: Failed Reset\n", aha_name(aha));
PRVERB(("%s: Failed Reset\n", aha_name(aha)));
return (ENXIO);
}
@ -1704,7 +1703,8 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params,
*/
cmd_complete = 1;
saved_status = status;
} else if ((status & DATAIN_REG_READY) != 0) {
}
if ((status & DATAIN_REG_READY) != 0) {
u_int8_t data;
data = aha_inb(aha, DATAIN_REG);
@ -1767,11 +1767,16 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params,
if (param_len > 0) {
/* The controller did not accept the full argument list */
PRVERB(("%s: Controller did not accept full argument list "
"(%d > 0)\n",
aha_name(aha), param_len));
return (E2BIG);
}
if (reply_len != reply_buf_size) {
/* Too much or too little data received */
PRVERB(("%s: Too much or too little data received (%d != %d)\n",
aha_name(aha), reply_len, reply_buf_size));
return (EMSGSIZE);
}