2131
2131
AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
2132
2132
ahd_outb(ahd, SCSISEQ0, ahd_inb(ahd, SCSISEQ0) & ~ENSELO);
2134
printf("%s:%c:%d: no active SCB for reconnecting "
2134
printk("%s:%c:%d: no active SCB for reconnecting "
2135
2135
"target - issuing BUS DEVICE RESET\n",
2136
2136
ahd_name(ahd), 'A', ahd_inb(ahd, SELID) >> 4);
2137
printf("SAVED_SCSIID == 0x%x, SAVED_LUN == 0x%x, "
2137
printk("SAVED_SCSIID == 0x%x, SAVED_LUN == 0x%x, "
2138
2138
"REG0 == 0x%x ACCUM = 0x%x\n",
2139
2139
ahd_inb(ahd, SAVED_SCSIID), ahd_inb(ahd, SAVED_LUN),
2140
2140
ahd_inw(ahd, REG0), ahd_inb(ahd, ACCUM));
2141
printf("SEQ_FLAGS == 0x%x, SCBPTR == 0x%x, BTT == 0x%x, "
2141
printk("SEQ_FLAGS == 0x%x, SCBPTR == 0x%x, BTT == 0x%x, "
2142
2142
"SINDEX == 0x%x\n",
2143
2143
ahd_inb(ahd, SEQ_FLAGS), ahd_get_scbptr(ahd),
2144
2144
ahd_find_busy_tcl(ahd,
2145
2145
BUILD_TCL(ahd_inb(ahd, SAVED_SCSIID),
2146
2146
ahd_inb(ahd, SAVED_LUN))),
2147
2147
ahd_inw(ahd, SINDEX));
2148
printf("SELID == 0x%x, SCB_SCSIID == 0x%x, SCB_LUN == 0x%x, "
2148
printk("SELID == 0x%x, SCB_SCSIID == 0x%x, SCB_LUN == 0x%x, "
2149
2149
"SCB_CONTROL == 0x%x\n",
2150
2150
ahd_inb(ahd, SELID), ahd_inb_scbram(ahd, SCB_SCSIID),
2151
2151
ahd_inb_scbram(ahd, SCB_LUN),
2152
2152
ahd_inb_scbram(ahd, SCB_CONTROL));
2153
printf("SCSIBUS[0] == 0x%x, SCSISIGI == 0x%x\n",
2153
printk("SCSIBUS[0] == 0x%x, SCSISIGI == 0x%x\n",
2154
2154
ahd_inb(ahd, SCSIBUS), ahd_inb(ahd, SCSISIGI));
2155
printf("SXFRCTL0 == 0x%x\n", ahd_inb(ahd, SXFRCTL0));
2156
printf("SEQCTL0 == 0x%x\n", ahd_inb(ahd, SEQCTL0));
2155
printk("SXFRCTL0 == 0x%x\n", ahd_inb(ahd, SXFRCTL0));
2156
printk("SEQCTL0 == 0x%x\n", ahd_inb(ahd, SEQCTL0));
2157
2157
ahd_dump_card_state(ahd);
2158
2158
ahd->msgout_buf[0] = MSG_BUS_DEV_RESET;
2159
2159
ahd->msgout_len = 1;
2731
2731
if (silent == FALSE) {
2732
printf("%s: Transmission error detected\n", ahd_name(ahd));
2732
printk("%s: Transmission error detected\n", ahd_name(ahd));
2733
2733
ahd_lqistat1_print(lqistat1, &cur_col, 50);
2734
2734
ahd_lastphase_print(lastphase, &cur_col, 50);
2735
2735
ahd_scsisigi_print(curphase, &cur_col, 50);
2736
2736
ahd_perrdiag_print(perrdiag, &cur_col, 50);
2738
2738
ahd_dump_card_state(ahd);
2741
2741
if ((lqistat1 & (LQIOVERI_LQ|LQIOVERI_NLQ)) != 0) {
2742
2742
if (silent == FALSE) {
2743
printf("%s: Gross protocol error during incoming "
2743
printk("%s: Gross protocol error during incoming "
2744
2744
"packet. lqistat1 == 0x%x. Resetting bus.\n",
2745
2745
ahd_name(ahd), lqistat1);
2817
2817
* Busfree detection is enabled.
2819
2819
if (silent == FALSE)
2820
printf("LQICRC_NLQ\n");
2820
printk("LQICRC_NLQ\n");
2821
2821
if (scb == NULL) {
2822
printf("%s: No SCB valid for LQICRC_NLQ. "
2822
printk("%s: No SCB valid for LQICRC_NLQ. "
2823
2823
"Resetting bus\n", ahd_name(ahd));
2824
2824
ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
2827
2827
} else if ((lqistat1 & LQIBADLQI) != 0) {
2828
printf("Need to handle BADLQI!\n");
2828
printk("Need to handle BADLQI!\n");
2829
2829
ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
2831
2831
} else if ((perrdiag & (PARITYERR|PREVPHASE)) == PARITYERR) {
2832
2832
if ((curphase & ~P_DATAIN_DT) != 0) {
2833
2833
/* Ack the byte. So we can continue. */
2834
2834
if (silent == FALSE)
2835
printf("Acking %s to clear perror\n",
2835
printk("Acking %s to clear perror\n",
2836
2836
ahd_lookup_phase_entry(curphase)->phasemsg);
2837
2837
ahd_inb(ahd, SCSIDAT);
2877
2877
if ((ahd_inb(ahd, SCSISIGO) & ATNO) != 0
2878
2878
&& (ahd_inb(ahd, MDFFSTAT) & DLZERO) != 0) {
2879
2879
if ((lqistat1 & LQIPHASE_LQ) != 0) {
2880
printf("LQIRETRY for LQIPHASE_LQ\n");
2880
printk("LQIRETRY for LQIPHASE_LQ\n");
2881
2881
ahd_outb(ahd, LQCTL2, LQIRETRY);
2882
2882
} else if ((lqistat1 & LQIPHASE_NLQ) != 0) {
2883
printf("LQIRETRY for LQIPHASE_NLQ\n");
2883
printk("LQIRETRY for LQIPHASE_NLQ\n");
2884
2884
ahd_outb(ahd, LQCTL2, LQIRETRY);
2886
2886
panic("ahd_handle_lqiphase_error: No phase errors\n");
3171
3171
tinfo->curr.transport_version = 2;
3172
3172
tinfo->goal.transport_version = 2;
3173
3173
tinfo->goal.ppr_options = 0;
3175
* Remove any SCBs in the waiting for selection
3176
* queue that may also be for this target so
3177
* that command ordering is preserved.
3179
ahd_freeze_devq(ahd, scb);
3180
ahd_qinfifo_requeue_tail(ahd, scb);
3176
* Remove any SCBs in the waiting
3177
* for selection queue that may
3178
* also be for this target so that
3179
* command ordering is preserved.
3181
ahd_freeze_devq(ahd, scb);
3182
ahd_qinfifo_requeue_tail(ahd, scb);
3181
3184
printerror = 0;
3183
3186
} else if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_WDTR, FALSE)
3189
3192
#ifdef AHD_DEBUG
3190
3193
if ((ahd_debug & AHD_SHOW_MESSAGES) != 0)
3191
printf("WDTR negotiation rejected busfree.\n");
3194
printk("WDTR negotiation rejected busfree.\n");
3193
3196
ahd_set_width(ahd, &devinfo,
3194
3197
MSG_EXT_WDTR_BUS_8_BIT,
3195
3198
AHD_TRANS_CUR|AHD_TRANS_GOAL,
3196
3199
/*paused*/TRUE);
3198
* Remove any SCBs in the waiting for selection
3199
* queue that may also be for this target so that
3200
* command ordering is preserved.
3202
ahd_freeze_devq(ahd, scb);
3203
ahd_qinfifo_requeue_tail(ahd, scb);
3202
* Remove any SCBs in the waiting for
3203
* selection queue that may also be for
3204
* this target so that command ordering
3207
ahd_freeze_devq(ahd, scb);
3208
ahd_qinfifo_requeue_tail(ahd, scb);
3204
3210
printerror = 0;
3205
3211
} else if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_SDTR, FALSE)
3206
3212
&& ppr_busfree == 0) {
3211
3217
#ifdef AHD_DEBUG
3212
3218
if ((ahd_debug & AHD_SHOW_MESSAGES) != 0)
3213
printf("SDTR negotiation rejected busfree.\n");
3219
printk("SDTR negotiation rejected busfree.\n");
3215
3221
ahd_set_syncrate(ahd, &devinfo,
3216
3222
/*period*/0, /*offset*/0,
3217
3223
/*ppr_options*/0,
3218
3224
AHD_TRANS_CUR|AHD_TRANS_GOAL,
3219
3225
/*paused*/TRUE);
3221
* Remove any SCBs in the waiting for selection
3222
* queue that may also be for this target so that
3223
* command ordering is preserved.
3225
ahd_freeze_devq(ahd, scb);
3226
ahd_qinfifo_requeue_tail(ahd, scb);
3228
* Remove any SCBs in the waiting for
3229
* selection queue that may also be for
3230
* this target so that command ordering
3233
ahd_freeze_devq(ahd, scb);
3234
ahd_qinfifo_requeue_tail(ahd, scb);
3227
3236
printerror = 0;
3228
3237
} else if ((ahd->msg_flags & MSG_FLAG_EXPECT_IDE_BUSFREE) != 0
3229
3238
&& ahd_sent_msg(ahd, AHDMSG_1B,
3594
3603
hscb = scb->hscb;
3595
printf("scb:%p control:0x%x scsiid:0x%x lun:%d cdb_len:%d\n",
3604
printk("scb:%p control:0x%x scsiid:0x%x lun:%d cdb_len:%d\n",
3600
3609
hscb->cdb_len);
3601
printf("Shared Data: ");
3610
printk("Shared Data: ");
3602
3611
for (i = 0; i < sizeof(hscb->shared_data.idata.cdb); i++)
3603
printf("%#02x", hscb->shared_data.idata.cdb[i]);
3604
printf(" dataptr:%#x%x datacnt:%#x sgptr:%#x tag:%#x\n",
3612
printk("%#02x", hscb->shared_data.idata.cdb[i]);
3613
printk(" dataptr:%#x%x datacnt:%#x sgptr:%#x tag:%#x\n",
3605
3614
(uint32_t)((ahd_le64toh(hscb->dataptr) >> 32) & 0xFFFFFFFF),
3606
3615
(uint32_t)(ahd_le64toh(hscb->dataptr) & 0xFFFFFFFF),
3607
3616
ahd_le32toh(hscb->datacnt),
3933
3942
if (offset != 0) {
3936
printf("%s: target %d synchronous with "
3945
printk("%s: target %d synchronous with "
3937
3946
"period = 0x%x, offset = 0x%x",
3938
3947
ahd_name(ahd), devinfo->target,
3939
3948
period, offset);
3941
3950
if ((ppr_options & MSG_EXT_PPR_RD_STRM) != 0) {
3945
3954
if ((ppr_options & MSG_EXT_PPR_DT_REQ) != 0) {
3946
printf("%s", options ? "|DT" : "(DT");
3955
printk("%s", options ? "|DT" : "(DT");
3949
3958
if ((ppr_options & MSG_EXT_PPR_IU_REQ) != 0) {
3950
printf("%s", options ? "|IU" : "(IU");
3959
printk("%s", options ? "|IU" : "(IU");
3953
3962
if ((ppr_options & MSG_EXT_PPR_RTI) != 0) {
3954
printf("%s", options ? "|RTI" : "(RTI");
3963
printk("%s", options ? "|RTI" : "(RTI");
3957
3966
if ((ppr_options & MSG_EXT_PPR_QAS_REQ) != 0) {
3958
printf("%s", options ? "|QAS" : "(QAS");
3967
printk("%s", options ? "|QAS" : "(QAS");
3961
3970
if (options != 0)
3966
printf("%s: target %d using "
3975
printk("%s: target %d using "
3967
3976
"asynchronous transfers%s\n",
3968
3977
ahd_name(ahd), devinfo->target,
3969
3978
(ppr_options & MSG_EXT_PPR_QAS_REQ) != 0
4485
4494
ahd_outb(ahd, SCSISEQ0, 0);
4487
printf("ahd_intr: AWAITING_MSG for an SCB that "
4496
printk("ahd_intr: AWAITING_MSG for an SCB that "
4488
4497
"does not have a waiting message\n");
4489
printf("SCSIID = %x, target_mask = %x\n", scb->hscb->scsiid,
4498
printk("SCSIID = %x, target_mask = %x\n", scb->hscb->scsiid,
4490
4499
devinfo->target_mask);
4491
4500
panic("SCB = %d, SCB Control = %x:%x, MSG_OUT = %x "
4492
4501
"SCB flags = %x", SCB_GET_TAG(scb), scb->hscb->control,
5611
5620
tag_type = (scb->hscb->control & MSG_SIMPLE_TASK);
5613
5622
if (tag_type == MSG_SIMPLE_TASK) {
5614
printf("(%s:%c:%d:%d): refuses tagged commands. "
5623
printk("(%s:%c:%d:%d): refuses tagged commands. "
5615
5624
"Performing non-tagged I/O\n", ahd_name(ahd),
5616
5625
devinfo->channel, devinfo->target, devinfo->lun);
5617
5626
ahd_set_tags(ahd, scb->io_ctx, devinfo, AHD_QUEUE_NONE);
5620
printf("(%s:%c:%d:%d): refuses %s tagged commands. "
5629
printk("(%s:%c:%d:%d): refuses %s tagged commands. "
5621
5630
"Performing simple queue tagged I/O only\n",
5622
5631
ahd_name(ahd), devinfo->channel, devinfo->target,
5623
5632
devinfo->lun, tag_type == MSG_ORDERED_TASK
6065
6074
struct ahd_softc *ahd;
6067
6076
#ifndef __FreeBSD__
6068
ahd = malloc(sizeof(*ahd), M_DEVBUF, M_NOWAIT);
6077
ahd = kmalloc(sizeof(*ahd), GFP_ATOMIC);
6070
printf("aic7xxx: cannot malloc softc!\n");
6071
free(name, M_DEVBUF);
6079
printk("aic7xxx: cannot malloc softc!\n");
6075
6084
ahd = device_get_softc((device_t)platform_arg);
6077
6086
memset(ahd, 0, sizeof(*ahd));
6078
ahd->seep_config = malloc(sizeof(*ahd->seep_config),
6079
M_DEVBUF, M_NOWAIT);
6087
ahd->seep_config = kmalloc(sizeof(*ahd->seep_config), GFP_ATOMIC);
6080
6088
if (ahd->seep_config == NULL) {
6081
6089
#ifndef __FreeBSD__
6082
free(ahd, M_DEVBUF);
6084
free(name, M_DEVBUF);
6087
6095
LIST_INIT(&ahd->pending_scbs);
6635
6643
ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
6636
6644
#ifdef AHD_DEBUG
6637
6645
if ((ahd_debug & AHD_SHOW_MISC) != 0)
6638
printf("%s: iocell first selection\n", ahd_name(ahd));
6646
printk("%s: iocell first selection\n", ahd_name(ahd));
6640
6648
if ((sblkctl & ENAB40) != 0) {
6641
6649
ahd_outb(ahd, DSPDATACTL,
6642
6650
ahd_inb(ahd, DSPDATACTL) & ~BYPASSENAB);
6643
6651
#ifdef AHD_DEBUG
6644
6652
if ((ahd_debug & AHD_SHOW_MISC) != 0)
6645
printf("%s: BYPASS now disabled\n", ahd_name(ahd));
6653
printk("%s: BYPASS now disabled\n", ahd_name(ahd));
6648
6656
ahd_outb(ahd, SIMODE0, ahd_inb(ahd, SIMODE0) & ~(ENSELDO|ENSELDI));
7215
7220
error = ahd_write_flexport(ahd, FLXADDR_ROMSTAT_CURSENSECTL,
7217
7222
if (error != 0) {
7218
printf("%s: current sensing timeout 1\n", ahd_name(ahd));
7223
printk("%s: current sensing timeout 1\n", ahd_name(ahd));
7219
7224
goto init_done;
7221
7226
for (i = 20, fstat = FLX_FSTAT_BUSY;
7222
7227
(fstat & FLX_FSTAT_BUSY) != 0 && i; i--) {
7223
7228
error = ahd_read_flexport(ahd, FLXADDR_FLEXSTAT, &fstat);
7224
7229
if (error != 0) {
7225
printf("%s: current sensing timeout 2\n",
7230
printk("%s: current sensing timeout 2\n",
7226
7231
ahd_name(ahd));
7227
7232
goto init_done;
7231
printf("%s: Timedout during current-sensing test\n",
7236
printk("%s: Timedout during current-sensing test\n",
7232
7237
ahd_name(ahd));
7233
7238
goto init_done;
8966
8971
#ifdef AHD_DEBUG
8967
8972
if ((ahd_debug & AHD_SHOW_SENSE) != 0) {
8968
8973
ahd_print_path(ahd, scb);
8969
printf("SCB 0x%x Received PKT Status of 0x%x\n",
8974
printk("SCB 0x%x Received PKT Status of 0x%x\n",
8970
8975
SCB_GET_TAG(scb), siu->status);
8971
printf("\tflags = 0x%x, sense len = 0x%x, "
8976
printk("\tflags = 0x%x, sense len = 0x%x, "
8972
8977
"pktfail = 0x%x\n",
8973
8978
siu->flags, scsi_4btoul(siu->sense_length),
8974
8979
scsi_4btoul(siu->pkt_failures_length));
8977
8982
if ((siu->flags & SIU_RSPVALID) != 0) {
8978
8983
ahd_print_path(ahd, scb);
8979
8984
if (scsi_4btoul(siu->pkt_failures_length) < 4) {
8980
printf("Unable to parse pkt_failures\n");
8985
printk("Unable to parse pkt_failures\n");
8983
8988
switch (SIU_PKTFAIL_CODE(siu)) {
8984
8989
case SIU_PFC_NONE:
8985
printf("No packet failure found\n");
8990
printk("No packet failure found\n");
8987
8992
case SIU_PFC_CIU_FIELDS_INVALID:
8988
printf("Invalid Command IU Field\n");
8993
printk("Invalid Command IU Field\n");
8990
8995
case SIU_PFC_TMF_NOT_SUPPORTED:
8991
printf("TMF not supportd\n");
8996
printk("TMF not supportd\n");
8993
8998
case SIU_PFC_TMF_FAILED:
8994
printf("TMF failed\n");
8999
printk("TMF failed\n");
8996
9001
case SIU_PFC_INVALID_TYPE_CODE:
8997
printf("Invalid L_Q Type code\n");
9002
printk("Invalid L_Q Type code\n");
8999
9004
case SIU_PFC_ILLEGAL_REQUEST:
9000
printf("Illegal request\n");
9005
printk("Illegal request\n");
9741
9746
saved_modes = ahd_save_modes(ahd);
9742
9747
ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
9743
printf(">>>>>>>>>>>>>>>>>> Dump Card State Begins <<<<<<<<<<<<<<<<<\n"
9748
printk(">>>>>>>>>>>>>>>>>> Dump Card State Begins <<<<<<<<<<<<<<<<<\n"
9744
9749
"%s: Dumping Card State at program address 0x%x Mode 0x%x\n",
9746
9751
ahd_inw(ahd, CURADDR),
9747
9752
ahd_build_mode_state(ahd, ahd->saved_src_mode,
9748
9753
ahd->saved_dst_mode));
9750
printf("Card was paused\n");
9755
printk("Card was paused\n");
9752
9757
if (ahd_check_cmdcmpltqueues(ahd))
9753
printf("Completions are pending\n");
9758
printk("Completions are pending\n");
9756
9761
* Mode independent registers.
9792
9797
ahd_lqostat0_print(ahd_inb(ahd, LQOSTAT0), &cur_col, 50);
9793
9798
ahd_lqostat1_print(ahd_inb(ahd, LQOSTAT1), &cur_col, 50);
9794
9799
ahd_lqostat2_print(ahd_inb(ahd, LQOSTAT2), &cur_col, 50);
9796
printf("\nSCB Count = %d CMDS_PENDING = %d LASTSCB 0x%x "
9801
printk("\nSCB Count = %d CMDS_PENDING = %d LASTSCB 0x%x "
9797
9802
"CURRSCB 0x%x NEXTSCB 0x%x\n",
9798
9803
ahd->scb_data.numscbs, ahd_inw(ahd, CMDS_PENDING),
9799
9804
ahd_inw(ahd, LASTSCB), ahd_inw(ahd, CURRSCB),
9804
9809
CAM_LUN_WILDCARD, SCB_LIST_NULL,
9805
9810
ROLE_UNKNOWN, /*status*/0, SEARCH_PRINT);
9806
9811
saved_scb_index = ahd_get_scbptr(ahd);
9807
printf("Pending list:");
9812
printk("Pending list:");
9809
9814
LIST_FOREACH(scb, &ahd->pending_scbs, pending_links) {
9810
9815
if (i++ > AHD_SCB_MAX)
9812
cur_col = printf("\n%3d FIFO_USE[0x%x] ", SCB_GET_TAG(scb),
9817
cur_col = printk("\n%3d FIFO_USE[0x%x] ", SCB_GET_TAG(scb),
9813
9818
ahd_inb_scbram(ahd, SCB_FIFO_USE_COUNT));
9814
9819
ahd_set_scbptr(ahd, SCB_GET_TAG(scb));
9815
9820
ahd_scb_control_print(ahd_inb_scbram(ahd, SCB_CONTROL),
9817
9822
ahd_scb_scsiid_print(ahd_inb_scbram(ahd, SCB_SCSIID),
9820
printf("\nTotal %d\n", i);
9825
printk("\nTotal %d\n", i);
9822
printf("Kernel Free SCB list: ");
9827
printk("Kernel Free SCB list: ");
9824
9829
TAILQ_FOREACH(scb, &ahd->scb_data.free_scbs, links.tqe) {
9825
9830
struct scb *list_scb;
9827
9832
list_scb = scb;
9829
printf("%d ", SCB_GET_TAG(list_scb));
9834
printk("%d ", SCB_GET_TAG(list_scb));
9830
9835
list_scb = LIST_NEXT(list_scb, collision_links);
9831
9836
} while (list_scb && i++ < AHD_SCB_MAX);
9834
9839
LIST_FOREACH(scb, &ahd->scb_data.any_dev_free_scb_list, links.le) {
9835
9840
if (i++ > AHD_SCB_MAX)
9837
printf("%d ", SCB_GET_TAG(scb));
9842
printk("%d ", SCB_GET_TAG(scb));
9841
printf("Sequencer Complete DMA-inprog list: ");
9846
printk("Sequencer Complete DMA-inprog list: ");
9842
9847
scb_index = ahd_inw(ahd, COMPLETE_SCB_DMAINPROG_HEAD);
9844
9849
while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) {
9845
9850
ahd_set_scbptr(ahd, scb_index);
9846
printf("%d ", scb_index);
9851
printk("%d ", scb_index);
9847
9852
scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE);
9851
printf("Sequencer Complete list: ");
9856
printk("Sequencer Complete list: ");
9852
9857
scb_index = ahd_inw(ahd, COMPLETE_SCB_HEAD);
9854
9859
while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) {
9855
9860
ahd_set_scbptr(ahd, scb_index);
9856
printf("%d ", scb_index);
9861
printk("%d ", scb_index);
9857
9862
scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE);
9862
printf("Sequencer DMA-Up and Complete list: ");
9867
printk("Sequencer DMA-Up and Complete list: ");
9863
9868
scb_index = ahd_inw(ahd, COMPLETE_DMA_SCB_HEAD);
9865
9870
while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) {
9866
9871
ahd_set_scbptr(ahd, scb_index);
9867
printf("%d ", scb_index);
9872
printk("%d ", scb_index);
9868
9873
scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE);
9871
printf("Sequencer On QFreeze and Complete list: ");
9876
printk("Sequencer On QFreeze and Complete list: ");
9872
9877
scb_index = ahd_inw(ahd, COMPLETE_ON_QFREEZE_HEAD);
9874
9879
while (!SCBID_IS_NULL(scb_index) && i++ < AHD_SCB_MAX) {
9875
9880
ahd_set_scbptr(ahd, scb_index);
9876
printf("%d ", scb_index);
9881
printk("%d ", scb_index);
9877
9882
scb_index = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE);
9880
9885
ahd_set_scbptr(ahd, saved_scb_index);
9881
9886
dffstat = ahd_inb(ahd, DFFSTAT);
9882
9887
for (i = 0; i < 2; i++) {
9903
9908
ahd_soffcnt_print(ahd_inb(ahd, SOFFCNT), &cur_col, 50);
9904
9909
ahd_mdffstat_print(ahd_inb(ahd, MDFFSTAT), &cur_col, 50);
9905
9910
if (cur_col > 50) {
9909
cur_col += printf("SHADDR = 0x%x%x, SHCNT = 0x%x ",
9914
cur_col += printk("SHADDR = 0x%x%x, SHCNT = 0x%x ",
9910
9915
ahd_inl(ahd, SHADDR+4),
9911
9916
ahd_inl(ahd, SHADDR),
9912
9917
(ahd_inb(ahd, SHCNT)
9913
9918
| (ahd_inb(ahd, SHCNT + 1) << 8)
9914
9919
| (ahd_inb(ahd, SHCNT + 2) << 16)));
9915
9920
if (cur_col > 50) {
9919
cur_col += printf("HADDR = 0x%x%x, HCNT = 0x%x ",
9924
cur_col += printk("HADDR = 0x%x%x, HCNT = 0x%x ",
9920
9925
ahd_inl(ahd, HADDR+4),
9921
9926
ahd_inl(ahd, HADDR),
9922
9927
(ahd_inb(ahd, HCNT)
9935
9940
for (i = 0; i < 20; i++)
9936
printf("0x%x ", ahd_inb(ahd, LQIN + i));
9941
printk("0x%x ", ahd_inb(ahd, LQIN + i));
9938
9943
ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
9939
printf("%s: LQISTATE = 0x%x, LQOSTATE = 0x%x, OPTIONMODE = 0x%x\n",
9944
printk("%s: LQISTATE = 0x%x, LQOSTATE = 0x%x, OPTIONMODE = 0x%x\n",
9940
9945
ahd_name(ahd), ahd_inb(ahd, LQISTATE), ahd_inb(ahd, LQOSTATE),
9941
9946
ahd_inb(ahd, OPTIONMODE));
9942
printf("%s: OS_SPACE_CNT = 0x%x MAXCMDCNT = 0x%x\n",
9947
printk("%s: OS_SPACE_CNT = 0x%x MAXCMDCNT = 0x%x\n",
9943
9948
ahd_name(ahd), ahd_inb(ahd, OS_SPACE_CNT),
9944
9949
ahd_inb(ahd, MAXCMDCNT));
9945
printf("%s: SAVED_SCSIID = 0x%x SAVED_LUN = 0x%x\n",
9950
printk("%s: SAVED_SCSIID = 0x%x SAVED_LUN = 0x%x\n",
9946
9951
ahd_name(ahd), ahd_inb(ahd, SAVED_SCSIID),
9947
9952
ahd_inb(ahd, SAVED_LUN));
9948
9953
ahd_simode0_print(ahd_inb(ahd, SIMODE0), &cur_col, 50);
9950
9955
ahd_set_modes(ahd, AHD_MODE_CCHAN, AHD_MODE_CCHAN);
9952
9957
ahd_ccscbctl_print(ahd_inb(ahd, CCSCBCTL), &cur_col, 50);
9954
9959
ahd_set_modes(ahd, ahd->saved_src_mode, ahd->saved_dst_mode);
9955
printf("%s: REG0 == 0x%x, SINDEX = 0x%x, DINDEX = 0x%x\n",
9960
printk("%s: REG0 == 0x%x, SINDEX = 0x%x, DINDEX = 0x%x\n",
9956
9961
ahd_name(ahd), ahd_inw(ahd, REG0), ahd_inw(ahd, SINDEX),
9957
9962
ahd_inw(ahd, DINDEX));
9958
printf("%s: SCBPTR == 0x%x, SCB_NEXT == 0x%x, SCB_NEXT2 == 0x%x\n",
9963
printk("%s: SCBPTR == 0x%x, SCB_NEXT == 0x%x, SCB_NEXT2 == 0x%x\n",
9959
9964
ahd_name(ahd), ahd_get_scbptr(ahd),
9960
9965
ahd_inw_scbram(ahd, SCB_NEXT),
9961
9966
ahd_inw_scbram(ahd, SCB_NEXT2));
9962
printf("CDB %x %x %x %x %x %x\n",
9967
printk("CDB %x %x %x %x %x %x\n",
9963
9968
ahd_inb_scbram(ahd, SCB_CDB_STORE),
9964
9969
ahd_inb_scbram(ahd, SCB_CDB_STORE+1),
9965
9970
ahd_inb_scbram(ahd, SCB_CDB_STORE+2),
9966
9971
ahd_inb_scbram(ahd, SCB_CDB_STORE+3),
9967
9972
ahd_inb_scbram(ahd, SCB_CDB_STORE+4),
9968
9973
ahd_inb_scbram(ahd, SCB_CDB_STORE+5));
9970
9975
for (i = 0; i < ahd->stack_size; i++) {
9971
9976
ahd->saved_stack[i] =
9972
9977
ahd_inb(ahd, STACK)|(ahd_inb(ahd, STACK) << 8);
9973
printf(" 0x%x", ahd->saved_stack[i]);
9978
printk(" 0x%x", ahd->saved_stack[i]);
9975
9980
for (i = ahd->stack_size-1; i >= 0; i--) {
9976
9981
ahd_outb(ahd, STACK, ahd->saved_stack[i] & 0xFF);
9977
9982
ahd_outb(ahd, STACK, (ahd->saved_stack[i] >> 8) & 0xFF);
9979
printf("\n<<<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>>\n");
9984
printk("\n<<<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>>\n");
9980
9985
ahd_restore_modes(ahd, saved_modes);
9981
9986
if (paused == 0)
9982
9987
ahd_unpause(ahd);
10427
10432
tstate = ahd_alloc_tstate(ahd, target, channel);
10428
10433
if (tstate == NULL) {
10429
10434
xpt_print_path(ccb->ccb_h.path);
10430
printf("Couldn't allocate tstate\n");
10435
printk("Couldn't allocate tstate\n");
10431
10436
ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
10435
lstate = malloc(sizeof(*lstate), M_DEVBUF, M_NOWAIT);
10440
lstate = kmalloc(sizeof(*lstate), GFP_ATOMIC);
10436
10441
if (lstate == NULL) {
10437
10442
xpt_print_path(ccb->ccb_h.path);
10438
printf("Couldn't allocate lstate\n");
10443
printk("Couldn't allocate lstate\n");
10439
10444
ccb->ccb_h.status = CAM_RESRC_UNAVAIL;