diff options
author | gibbs <gibbs@FreeBSD.org> | 2003-06-28 04:45:25 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 2003-06-28 04:45:25 +0000 |
commit | 19f91b5d1aa0d7417a8ac0ab20128c27cd41e3a1 (patch) | |
tree | 190ea5d0a8396b09f3ca216145d9241ed25d3c19 /sys/dev/aic7xxx | |
parent | 4d49134a719d00fafcc1b4c6f47f3399592bc56b (diff) | |
download | FreeBSD-src-19f91b5d1aa0d7417a8ac0ab20128c27cd41e3a1.zip FreeBSD-src-19f91b5d1aa0d7417a8ac0ab20128c27cd41e3a1.tar.gz |
aic79xx.h:
Add softc flag to indicate that we have seen at
least one selection since the last bus reset or
SE/LVD bus change.
aic79xx.c:
Fix a few style nits.
In ahd_update_pending_scbs(), only touch card registers
once we have found an SCB that needs to be updated.
This removes lots of clutter from PCI traces taken of
error recovery performed by the driver.
Short circuit the first selection iocell workaround handler
if we've run once since the last bus reset or iocell change.
This also removes clutter from PCI traces.
Note if completions are pending in the qoutfifo when we dump
card state.
Diffstat (limited to 'sys/dev/aic7xxx')
-rw-r--r-- | sys/dev/aic7xxx/aic79xx.c | 21 | ||||
-rw-r--r-- | sys/dev/aic7xxx/aic79xx.h | 5 |
2 files changed, 16 insertions, 10 deletions
diff --git a/sys/dev/aic7xxx/aic79xx.c b/sys/dev/aic7xxx/aic79xx.c index 1ecf983..5fb052f 100644 --- a/sys/dev/aic7xxx/aic79xx.c +++ b/sys/dev/aic7xxx/aic79xx.c @@ -37,7 +37,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#200 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#201 $ * * $FreeBSD$ */ @@ -2332,7 +2332,7 @@ ahd_dump_sglist(struct scb *scb) len = ahd_le32toh(sg_list[i].len); printf("sg[%d] - Addr 0x%x%x : Length %d%s\n", i, - (len >> 24) & SG_HIGH_ADDR_BITS, + (len & AHD_SG_HIGH_ADDR_MASK) >> 24, ahd_le32toh(sg_list[i].addr), len & AHD_SG_LEN_MASK, len & AHD_DMA_LAST_SEG ? " Last" : ""); @@ -2920,7 +2920,7 @@ ahd_update_pending_scbs(struct ahd_softc *ahd) { struct scb *pending_scb; int pending_scb_count; - int i; + u_int scb_tag; int paused; u_int saved_scbptr; ahd_mode_state saved_modes; @@ -2978,17 +2978,14 @@ ahd_update_pending_scbs(struct ahd_softc *ahd) ahd_outb(ahd, SCSISEQ0, ahd_inb(ahd, SCSISEQ0) & ~ENSELO); saved_scbptr = ahd_get_scbptr(ahd); /* Ensure that the hscbs down on the card match the new information */ - for (i = 0; i < ahd->scb_data.maxhscbs; i++) { + for (scb_tag = 0; scb_tag < ahd->scb_data.maxhscbs; scb_tag++) { struct hardware_scb *pending_hscb; u_int control; - u_int scb_tag; - ahd_set_scbptr(ahd, i); - scb_tag = i; pending_scb = ahd_lookup_scb(ahd, scb_tag); if (pending_scb == NULL) continue; - + ahd_set_scbptr(ahd, scb_tag); pending_hscb = pending_scb->hscb; control = ahd_inb_scbram(ahd, SCB_CONTROL); control &= ~MK_MESSAGE; @@ -5416,6 +5413,7 @@ ahd_setup_iocell_workaround(struct ahd_softc *ahd) printf("%s: Setting up iocell workaround\n", ahd_name(ahd)); #endif ahd_restore_modes(ahd, saved_modes); + ahd->flags &= ~AHD_HAD_FIRST_SEL; } static void @@ -5424,6 +5422,8 @@ ahd_iocell_first_selection(struct ahd_softc *ahd) ahd_mode_state saved_modes; u_int sblkctl; + if ((ahd->flags & AHD_HAD_FIRST_SEL) != 0) + return; saved_modes = ahd_save_modes(ahd); ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); sblkctl = ahd_inb(ahd, SBLKCTL); @@ -5443,6 +5443,7 @@ ahd_iocell_first_selection(struct ahd_softc *ahd) ahd_outb(ahd, SIMODE0, ahd_inb(ahd, SIMODE0) & ~(ENSELDO|ENSELDI)); ahd_outb(ahd, CLRINT, CLRSCSIINT); ahd_restore_modes(ahd, saved_modes); + ahd->flags |= AHD_HAD_FIRST_SEL; } /*************************** SCB Management ***********************************/ @@ -8506,6 +8507,10 @@ ahd_dump_card_state(struct ahd_softc *ahd) ahd->saved_dst_mode)); if (paused) printf("Card was paused\n"); + + if (ahd_check_cmdcmpltqueues(ahd)) + printf("Completions are pending\n"); + /* * Mode independent registers. */ diff --git a/sys/dev/aic7xxx/aic79xx.h b/sys/dev/aic7xxx/aic79xx.h index 50252f0..2b758bc 100644 --- a/sys/dev/aic7xxx/aic79xx.h +++ b/sys/dev/aic7xxx/aic79xx.h @@ -37,7 +37,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#93 $ + * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#94 $ * * $FreeBSD$ */ @@ -373,7 +373,8 @@ typedef enum { AHD_HP_BOARD = 0x100000, AHD_RESET_POLL_ACTIVE = 0x200000, AHD_UPDATE_PEND_CMDS = 0x400000, - AHD_RUNNING_QOUTFIFO = 0x800000 + AHD_RUNNING_QOUTFIFO = 0x800000, + AHD_HAD_FIRST_SEL = 0x1000000 } ahd_flag; /************************* Hardware SCB Definition ***************************/ |