| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: sc.c,v 1.15 2017/10/31 14:55:45 christos Exp $ */ | | 1 | /* $NetBSD: sc.c,v 1.16 2017/10/31 15:10:28 christos Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1992 OMRON Corporation. | | 4 | * Copyright (c) 1992 OMRON Corporation. |
5 | * | | 5 | * |
6 | * This code is derived from software contributed to Berkeley by | | 6 | * This code is derived from software contributed to Berkeley by |
7 | * OMRON Corporation. | | 7 | * OMRON Corporation. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -397,26 +397,29 @@ scfinish(int ctlr) | | | @@ -397,26 +397,29 @@ scfinish(int ctlr) |
397 | | | 397 | |
398 | return status; | | 398 | return status; |
399 | } | | 399 | } |
400 | | | 400 | |
401 | static void | | 401 | static void |
402 | scabort(struct scsi_softc *hs) | | 402 | scabort(struct scsi_softc *hs) |
403 | { | | 403 | { |
404 | struct scsidevice *hd = hs->sc_spc; | | 404 | struct scsidevice *hd = hs->sc_spc; |
405 | int len; | | 405 | int len; |
406 | | | 406 | |
407 | printf("sc%d: abort phase=0x%x, ssts=0x%x, ints=0x%x\n", | | 407 | printf("sc%d: abort phase=0x%x, ssts=0x%x, ints=0x%x\n", |
408 | hs->sc_ctlr, hd->scsi_psns, hd->scsi_ssts, hd->scsi_ints); | | 408 | hs->sc_ctlr, hd->scsi_psns, hd->scsi_ssts, hd->scsi_ints); |
409 | | | 409 | |
| | | 410 | if (hd->scsi_ints != 0) |
| | | 411 | hd->scsi_ints = hd->scsi_ints; |
| | | 412 | |
410 | if (hd->scsi_psns == 0 || (hd->scsi_ssts & SSTS_INITIATOR) == 0) | | 413 | if (hd->scsi_psns == 0 || (hd->scsi_ssts & SSTS_INITIATOR) == 0) |
411 | /* no longer connected to scsi target */ | | 414 | /* no longer connected to scsi target */ |
412 | return; | | 415 | return; |
413 | | | 416 | |
414 | /* get the number of bytes remaining in current xfer + fudge */ | | 417 | /* get the number of bytes remaining in current xfer + fudge */ |
415 | len = (hd->scsi_tch << 16) | (hd->scsi_tcm << 8) | hd->scsi_tcl; | | 418 | len = (hd->scsi_tch << 16) | (hd->scsi_tcm << 8) | hd->scsi_tcl; |
416 | | | 419 | |
417 | /* for that many bus cycles, try to send an abort msg */ | | 420 | /* for that many bus cycles, try to send an abort msg */ |
418 | for (len += 1024; | | 421 | for (len += 1024; |
419 | ((hd->scsi_ssts & SSTS_INITIATOR)) != 0 && --len >= 0;) { | | 422 | ((hd->scsi_ssts & SSTS_INITIATOR)) != 0 && --len >= 0;) { |
420 | hd->scsi_scmd = SCMD_SET_ATN; | | 423 | hd->scsi_scmd = SCMD_SET_ATN; |
421 | | | 424 | |
422 | while ((hd->scsi_psns & PSNS_REQ) == 0) { | | 425 | while ((hd->scsi_psns & PSNS_REQ) == 0) { |