From cb29ab3392d6f26bdf0eb6605a2e93ada7607784 Mon Sep 17 00:00:00 2001 From: "Justin T. Gibbs" Date: Wed, 16 Feb 2005 23:13:38 +0000 Subject: [PATCH] aic79xx.c: aic7xxx.c: Allow print_reg() to be called with a NULL column. aic79xx.c: Correct new usage of SCB_GET_TAG(). aic7xxx.c: Fix stray ahd that snuck in here. --- sys/dev/aic7xxx/aic79xx.c | 13 +++++++++---- sys/dev/aic7xxx/aic7xxx.c | 8 +++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/sys/dev/aic7xxx/aic79xx.c b/sys/dev/aic7xxx/aic79xx.c index 83e54258d46..0cd1a795057 100644 --- a/sys/dev/aic7xxx/aic79xx.c +++ b/sys/dev/aic7xxx/aic79xx.c @@ -8933,6 +8933,12 @@ ahd_print_register(ahd_reg_parse_entry_t *table, u_int num_entries, { int printed; u_int printed_mask; + u_int dummy_column; + + if (cur_column == NULL) { + dummy_column = 0; + cur_column = &dummy_column; + } if (cur_column != NULL && *cur_column >= wrap_point) { printf("\n"); @@ -8969,8 +8975,7 @@ ahd_print_register(ahd_reg_parse_entry_t *table, u_int num_entries, printed += printf(") "); else printed += printf(" "); - if (cur_column != NULL) - *cur_column += printed; + *cur_column += printed; return (printed); } @@ -9355,7 +9360,7 @@ ahd_recover_commands(struct ahd_softc *ahd) lun = SCB_GET_LUN(scb); ahd_print_path(ahd, scb); - printf("SCB %d - timed out\n", SCB_GET_TAG(scb->hscb->tag)); + printf("SCB %d - timed out\n", SCB_GET_TAG(scb)); if (scb->flags & (SCB_DEVICE_RESET|SCB_ABORT)) { /* @@ -9422,7 +9427,7 @@ bus_reset: "Identify Msg.\n", ahd_name(ahd)); goto bus_reset; } else if (ahd_search_qinfifo(ahd, target, channel, lun, - SCB_GET_TAG(scb->hscb->tag), + SCB_GET_TAG(scb), ROLE_INITIATOR, /*status*/0, SEARCH_COUNT) > 0) { diff --git a/sys/dev/aic7xxx/aic7xxx.c b/sys/dev/aic7xxx/aic7xxx.c index 296e3627fb4..a42cff64408 100644 --- a/sys/dev/aic7xxx/aic7xxx.c +++ b/sys/dev/aic7xxx/aic7xxx.c @@ -3924,7 +3924,7 @@ ahc_alloc(void *platform_arg, char *name) return (NULL); } LIST_INIT(&ahc->pending_scbs); - LIST_INIT(&ahd->timedout_scbs); + LIST_INIT(&ahc->timedout_scbs); /* We don't know our unit number until the OSM sets it */ ahc->name = name; ahc->unit = -1; @@ -6707,6 +6707,12 @@ ahc_print_register(ahc_reg_parse_entry_t *table, u_int num_entries, { int printed; u_int printed_mask; + u_int dummy_column; + + if (cur_column == NULL) { + dummy_column = 0; + cur_column = &dummy_column; + } if (cur_column != NULL && *cur_column >= wrap_point) { printf("\n");