aic7xxx: clean up empty lines in .c and .h files

This commit is contained in:
Mateusz Guzik 2020-09-01 21:37:14 +00:00
parent f051a2b0d5
commit d5b4569f95
21 changed files with 56 additions and 210 deletions

View File

@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
#include <sys/limits.h> /* For CHAR_BIT*/
#include <isa/isavar.h> /* For ISA attach glue */
static struct aic7770_identity *ahc_isa_find_device(bus_space_tag_t tag,
bus_space_handle_t bsh);
static void ahc_isa_identify(driver_t *driver,

View File

@ -165,7 +165,6 @@ ahc_pci_map_registers(struct ahc_softc *ahc)
}
if (allow_memio != 0) {
regs_type = SYS_RES_MEMORY;
regs_id = AHC_PCI_MEMADDR;
regs = bus_alloc_resource_any(ahc->dev_softc, regs_type,

View File

@ -165,7 +165,6 @@ ahd_pci_map_registers(struct ahd_softc *ahd)
if ((ahd->bugs & AHD_PCIX_MMAPIO_BUG) == 0
&& allow_memio != 0) {
regs_type = SYS_RES_MEMORY;
regs_id = AHD_PCI_MEMADDR;
regs = bus_alloc_resource_any(ahd->dev_softc, regs_type,

View File

@ -323,7 +323,6 @@ aha2840_load_seeprom(struct ahc_softc *ahc)
/*start_addr*/0, sizeof(*sc)/2);
if (have_seeprom) {
if (ahc_verify_cksum(sc) == 0) {
if(bootverbose)
printf ("checksum error\n");

View File

@ -487,7 +487,6 @@ ahd_flush_qoutfifo(struct ahd_softc *ahd)
* if this if for an SCB in the qinfifo.
*/
while (((ccscbctl = ahd_inb(ahd, CCSCBCTL)) & (CCARREN|CCSCBEN)) != 0) {
if ((ccscbctl & (CCSCBDIR|CCARREN)) == (CCSCBDIR|CCARREN)) {
if ((ccscbctl & ARRDONE) != 0)
break;
@ -542,7 +541,6 @@ ahd_flush_qoutfifo(struct ahd_softc *ahd)
scbid = ahd_inw(ahd, COMPLETE_ON_QFREEZE_HEAD);
while (!SCBID_IS_NULL(scbid)) {
ahd_set_scbptr(ahd, scbid);
next_scbid = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE);
scb = ahd_lookup_scb(ahd, scbid);
@ -560,7 +558,6 @@ ahd_flush_qoutfifo(struct ahd_softc *ahd)
scbid = ahd_inw(ahd, COMPLETE_SCB_HEAD);
while (!SCBID_IS_NULL(scbid)) {
ahd_set_scbptr(ahd, scbid);
next_scbid = ahd_inw_scbram(ahd, SCB_NEXT_COMPLETE);
scb = ahd_lookup_scb(ahd, scbid);
@ -762,7 +759,6 @@ ahd_run_data_fifo(struct ahd_softc *ahd, struct scb *scb)
*/
if ((ahd_inb(ahd, DFSTATUS) & PRELOAD_AVAIL) != 0
&& (ahd_inb(ahd, DFCNTRL) & HDMAENACK) != 0) {
/*
* Determine the offset of the next S/G
* element to load.
@ -819,7 +815,6 @@ ahd_run_data_fifo(struct ahd_softc *ahd, struct scb *scb)
ahd_outb(ahd, DFCNTRL, dfcntrl);
}
} else if ((ahd_inb(ahd, SG_CACHE_SHADOW) & LAST_SEG_DONE) != 0) {
/*
* Transfer completed to the end of SG list
* and has flushed to the host.
@ -1582,24 +1577,20 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat)
ahd_setup_iocell_workaround(ahd);
ahd_unpause(ahd);
} else if ((status0 & OVERRUN) != 0) {
printf("%s: SCSI offset overrun detected. Resetting bus.\n",
ahd_name(ahd));
AHD_CORRECTABLE_ERROR(ahd);
ahd_reset_channel(ahd, 'A', /*Initiate Reset*/TRUE);
} else if ((status & SCSIRSTI) != 0) {
printf("%s: Someone reset channel A\n", ahd_name(ahd));
ahd_reset_channel(ahd, 'A', /*Initiate Reset*/FALSE);
AHD_UNCORRECTABLE_ERROR(ahd);
} else if ((status & SCSIPERR) != 0) {
/* Make sure the sequencer is in a safe location. */
ahd_clear_critical_section(ahd);
ahd_handle_transmission_error(ahd);
} else if (lqostat0 != 0) {
printf("%s: lqostat0 == 0x%x!\n", ahd_name(ahd), lqostat0);
ahd_outb(ahd, CLRLQOINT0, lqostat0);
if ((ahd->bugs & AHD_CLRLQO_AUTOCLR_BUG) != 0)
@ -1666,7 +1657,6 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat)
ahd_iocell_first_selection(ahd);
ahd_unpause(ahd);
} else if ((status0 & (SELDI|SELDO)) != 0) {
ahd_iocell_first_selection(ahd);
ahd_unpause(ahd);
} else if (status3 != 0) {
@ -1675,7 +1665,6 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat)
AHD_CORRECTABLE_ERROR(ahd);
ahd_outb(ahd, CLRSINT3, status3);
} else if ((lqistat1 & (LQIPHASE_LQ|LQIPHASE_NLQ)) != 0) {
/* Make sure the sequencer is in a safe location. */
ahd_clear_critical_section(ahd);
@ -1852,7 +1841,7 @@ ahd_handle_transmission_error(struct ahd_softc *ahd)
perrdiag = ahd_inb(ahd, PERRDIAG);
msg_out = MSG_INITIATOR_DET_ERR;
ahd_outb(ahd, CLRSINT1, CLRSCSIPERR);
/*
* Try to find the SCB associated with this error.
*/
@ -1980,7 +1969,7 @@ ahd_handle_transmission_error(struct ahd_softc *ahd)
ahd_lookup_phase_entry(curphase)->phasemsg);
ahd_inb(ahd, SCSIDAT);
}
if (curphase == P_MESGIN)
msg_out = MSG_PARITY_ERROR;
}
@ -2106,7 +2095,6 @@ ahd_handle_pkt_busfree(struct ahd_softc *ahd, u_int busfreetime)
waiting_h = ahd_inw(ahd, WAITING_TID_HEAD);
saved_scbptr = ahd_get_scbptr(ahd);
if (waiting_h != scbid) {
ahd_outw(ahd, WAITING_TID_HEAD, scbid);
waiting_t = ahd_inw(ahd, WAITING_TID_TAIL);
if (waiting_t == waiting_h) {
@ -2378,7 +2366,6 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd)
} else if ((ahd->msg_flags & MSG_FLAG_EXPECT_IDE_BUSFREE) != 0
&& ahd_sent_msg(ahd, AHDMSG_1B,
MSG_INITIATOR_DET_ERR, TRUE)) {
#ifdef AHD_DEBUG
if ((ahd_debug & AHD_SHOW_MESSAGES) != 0)
printf("Expected IDE Busfree\n");
@ -2387,7 +2374,6 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd)
} else if ((ahd->msg_flags & MSG_FLAG_EXPECT_QASREJ_BUSFREE)
&& ahd_sent_msg(ahd, AHDMSG_1B,
MSG_MESSAGE_REJECT, TRUE)) {
#ifdef AHD_DEBUG
if ((ahd_debug & AHD_SHOW_MESSAGES) != 0)
printf("Expected QAS Reject Busfree\n");
@ -2404,7 +2390,6 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd)
if (printerror != 0
&& (lastphase == P_MESGIN || lastphase == P_MESGOUT)
&& ((ahd->msg_flags & MSG_FLAG_EXPECT_PPR_BUSFREE) != 0)) {
ahd_freeze_devq(ahd, scb);
aic_set_transaction_status(scb, CAM_REQUEUE_REQ);
aic_freeze_scb(scb);
@ -2477,7 +2462,6 @@ ahd_handle_proto_violation(struct ahd_softc *ahd)
curphase = ahd_inb(ahd, SCSISIGI) & PHASE_MASK;
lastphase = ahd_inb(ahd, LASTPHASE);
if ((seq_flags & NOT_IDENTIFIED) != 0) {
/*
* The reconnecting target either did not send an
* identify message, or did, but we didn't find an SCB
@ -2650,7 +2634,6 @@ ahd_clear_critical_section(struct ahd_softc *ahd)
seqaddr);
#endif
if (stepping == FALSE) {
first_instr = seqaddr;
ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
simode0 = ahd_inb(ahd, SIMODE0);
@ -3116,7 +3099,6 @@ ahd_set_syncrate(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
&& (old_period != period
|| old_offset != offset
|| old_ppr != ppr_options)) {
update_needed++;
tinfo->curr.period = period;
@ -3241,7 +3223,6 @@ ahd_set_width(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
oldwidth = tinfo->curr.width;
if ((type & AHD_TRANS_CUR) != 0 && oldwidth != width) {
update_needed++;
tinfo->curr.width = width;
@ -3307,7 +3288,6 @@ ahd_update_neg_table(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
if (period == 0)
period = AHD_SYNCRATE_ASYNC;
if (period == AHD_SYNCRATE_160) {
if ((ahd->bugs & AHD_PACED_NEGTABLE_BUG) != 0) {
/*
* When the SPI4 spec was finalized, PACE transfers
@ -3564,7 +3544,6 @@ ahd_scb_devinfo(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
SCB_GET_LUN(scb), SCB_GET_CHANNEL(ahd, scb), role);
}
/************************ Message Phase Processing ****************************/
/*
* When an initiator transaction with the MK_MESSAGE flag either reconnects
@ -3641,7 +3620,6 @@ ahd_setup_initiator_msgout(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
*/
ahd_outb(ahd, SCSISEQ0, 0);
} else if ((scb->flags & SCB_ABORT) != 0) {
if ((scb->hscb->control & TAG_ENB) != 0) {
ahd->msgout_buf[ahd->msgout_index++] = MSG_ABORT_TAG;
} else {
@ -3772,7 +3750,6 @@ ahd_build_transfer_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
* messages that WDTR comes first.
*/
if (doppr || (dosync && !dowide)) {
offset = tinfo->goal.offset;
ahd_validate_offset(ahd, tinfo, period, &offset,
doppr ? tinfo->goal.width
@ -4110,7 +4087,6 @@ ahd_handle_message_phase(struct ahd_softc *ahd)
msgout_request = FALSE;
if (msgout_request) {
/*
* Change gears and see if
* this messages is of interest to
@ -4254,7 +4230,6 @@ ahd_sent_msg(struct ahd_softc *ahd, ahd_msgtype type, u_int msgval, int full)
end_index = index + 1 + ahd->msgout_buf[index + 1];
if (ahd->msgout_buf[index+2] == msgval
&& type == AHDMSG_EXT) {
if (full) {
if (ahd->msgout_index > end_index)
found = TRUE;
@ -4264,7 +4239,6 @@ ahd_sent_msg(struct ahd_softc *ahd, ahd_msgtype type, u_int msgval, int full)
index = end_index;
} else if (ahd->msgout_buf[index] >= MSG_SIMPLE_TASK
&& ahd->msgout_buf[index] <= MSG_IGN_WIDE_RESIDUE) {
/* Skip tag type and tag id or residue param*/
index += 2;
} else {
@ -4495,7 +4469,6 @@ ahd_parse_msg(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
AHD_TRANS_ACTIVE|AHD_TRANS_GOAL,
/*paused*/TRUE);
if (sending_reply == FALSE && reject == FALSE) {
/*
* We will always have an SDTR to send.
*/
@ -4768,7 +4741,6 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
ahd->msgout_index = 0;
response = 1;
} else if (ahd_sent_msg(ahd, AHDMSG_EXT, MSG_EXT_WDTR, /*full*/FALSE)) {
/* note 8bit xfers */
printf("(%s:%c:%d:%d): refuses WIDE negotiation. Using "
"8bit transfers\n", ahd_name(ahd),
@ -4784,7 +4756,6 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
* sync rate before sending our WDTR.
*/
if (tinfo->goal.offset != tinfo->curr.offset) {
/* Start the sync negotiation */
ahd->msgout_index = 0;
ahd->msgout_len = 0;
@ -4947,7 +4918,6 @@ ahd_handle_ign_wide_residue(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
sglen = aic_le32toh(sg->len) & AHD_SG_LEN_MASK;
if (sg != scb->sg_list
&& sglen < (data_cnt & AHD_SG_LEN_MASK)) {
sg--;
sglen = aic_le32toh(sg->len);
/*
@ -4980,7 +4950,6 @@ ahd_handle_ign_wide_residue(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
sglen = aic_le32toh(sg->len) & AHD_SG_LEN_MASK;
if (sg != scb->sg_list
&& sglen < (data_cnt & AHD_SG_LEN_MASK)) {
sg--;
sglen = aic_le32toh(sg->len);
/*
@ -5021,7 +4990,6 @@ ahd_handle_ign_wide_residue(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
}
}
/*
* Reinitialize the data pointers for the active transfer
* based on its current residual.
@ -5161,7 +5129,7 @@ ahd_handle_devreset(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
ahd_set_syncrate(ahd, devinfo, /*period*/0, /*offset*/0,
/*ppr_options*/0, AHD_TRANS_CUR,
/*paused*/TRUE);
if (status != CAM_SEL_TIMEOUT)
ahd_send_async(ahd, devinfo->channel, devinfo->target,
lun, AC_SENT_BDR, NULL);
@ -5503,7 +5471,7 @@ ahd_reset(struct ahd_softc *ahd, int reinit)
u_int sxfrctl1;
int wait;
uint32_t cmd;
/*
* Preserve the value of the SXFRCTL1 register for all channels.
* It contains settings that affect termination and we don't want
@ -5978,7 +5946,6 @@ ahd_get_scb(struct ahd_softc *ahd, u_int col_idx)
}
}
if ((scb = LIST_FIRST(&ahd->scb_data.any_dev_free_scb_list)) == NULL) {
if (tries++ != 0)
return (NULL);
if (ahd_alloc_scbs(ahd) == 0)
@ -6010,14 +5977,12 @@ ahd_free_scb(struct ahd_softc *ahd, struct scb *scb)
ahd->scb_data.scbindex[SCB_GET_TAG(scb)] = NULL;
if (scb->col_scb == NULL) {
/*
* No collision possible. Just free normally.
*/
LIST_INSERT_HEAD(&ahd->scb_data.any_dev_free_scb_list,
scb, links.le);
} else if ((scb->col_scb->flags & SCB_ON_COL_LIST) != 0) {
/*
* The SCB we might have collided with is on
* a free collision list. Put both SCBs on
@ -6031,7 +5996,6 @@ ahd_free_scb(struct ahd_softc *ahd, struct scb *scb)
} else if ((scb->col_scb->flags
& (SCB_PACKETIZED|SCB_ACTIVE)) == SCB_ACTIVE
&& (scb->col_scb->hscb->control & TAG_ENB) != 0) {
/*
* The SCB we might collide with on the next allocation
* is still active in a non-packetized, tagged, context.
@ -7156,7 +7120,6 @@ ahd_pause_and_flushwork(struct ahd_softc *ahd)
ahd_outw(ahd, KERNEL_QFREEZE_COUNT, ahd->qfreeze_cnt);
ahd_outb(ahd, SEQ_FLAGS2, ahd_inb(ahd, SEQ_FLAGS2) | SELECTOUT_QFROZEN);
do {
ahd_unpause(ahd);
/*
* Give the sequencer some time to service
@ -7317,7 +7280,7 @@ ahd_freeze_devq(struct ahd_softc *ahd, struct scb *scb)
target = SCB_GET_TARGET(ahd, scb);
lun = SCB_GET_LUN(scb);
channel = SCB_GET_CHANNEL(ahd, scb);
ahd_search_qinfifo(ahd, target, channel, lun,
/*tag*/SCB_LIST_NULL, ROLE_UNKNOWN,
CAM_REQUEUE_REQ, SEARCH_COMPLETE);
@ -7586,7 +7549,6 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel,
if (mk_msg_scb != NULL
&& ahd_match_scb(ahd, mk_msg_scb, target, channel,
lun, tag, role)) {
/*
* We found an scb that needs to be acted on.
*/
@ -7630,7 +7592,6 @@ ahd_search_qinfifo(struct ahd_softc *ahd, int target, char channel,
&& SCBID_IS_NULL(tid_head)
&& ahd_match_scb(ahd, scb, target, channel, CAM_LUN_WILDCARD,
SCB_LIST_NULL, ROLE_UNKNOWN)) {
/*
* When removing the last SCB for a target
* queue with a pending MK_MESSAGE scb, we
@ -7730,7 +7691,6 @@ ahd_stitch_tid_list(struct ahd_softc *ahd, u_int tid_prev,
AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
if (SCBID_IS_NULL(tid_cur)) {
/* Bypass current TID list */
if (SCBID_IS_NULL(tid_prev)) {
ahd_outw(ahd, WAITING_TID_HEAD, tid_next);
@ -7741,7 +7701,6 @@ ahd_stitch_tid_list(struct ahd_softc *ahd, u_int tid_prev,
if (SCBID_IS_NULL(tid_next))
ahd_outw(ahd, WAITING_TID_TAIL, tid_prev);
} else {
/* Stitch through tid_cur */
if (SCBID_IS_NULL(tid_prev)) {
ahd_outw(ahd, WAITING_TID_HEAD, tid_cur);
@ -8029,7 +7988,6 @@ ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset)
*/
max_scsiid = (ahd->features & AHD_WIDE) ? 15 : 7;
for (target = 0; target <= max_scsiid; target++) {
if (ahd->enabled_targets[target] == NULL)
continue;
for (initiator = 0; initiator <= max_scsiid; initiator++) {
@ -8091,14 +8049,13 @@ ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset)
return (found);
}
#define AHD_RESET_POLL_MS 1
static void
ahd_reset_poll(void *arg)
{
struct ahd_softc *ahd = (struct ahd_softc *)arg;
u_int scsiseq1;
ahd_lock(ahd);
ahd_pause(ahd);
ahd_update_modes(ahd);
@ -8128,7 +8085,7 @@ ahd_stat_timer(void *arg)
{
struct ahd_softc *ahd = (struct ahd_softc *)arg;
int enint_coal;
ahd_lock(ahd);
enint_coal = ahd->hs_mailbox & ENINT_COALESCE;
if (ahd->cmdcmplt_total > ahd->int_coalescing_threshold)
@ -8238,7 +8195,6 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb)
if (scsi_4btoul(siu->pkt_failures_length) < 4) {
printf("Unable to parse pkt_failures\n");
} else {
switch (SIU_PKTFAIL_CODE(siu)) {
case SIU_PFC_NONE:
printf("No packet failure found\n");
@ -8750,7 +8706,6 @@ ahd_loadseq(struct ahd_softc *ahd)
ahd->num_critical_sections = cs_count;
if (cs_count != 0) {
cs_count *= sizeof(struct cs);
ahd->critical_sections = malloc(cs_count, M_DEVBUF, M_NOWAIT);
if (ahd->critical_sections == NULL)
@ -8779,9 +8734,7 @@ ahd_check_patch(struct ahd_softc *ahd, struct patch **start_patch,
cur_patch = *start_patch;
while (cur_patch < last_patch && start_instr == cur_patch->begin) {
if (cur_patch->patch_func(ahd) == 0) {
/* Start rejecting code */
*skip_addr = start_instr + cur_patch->skip_instr;
cur_patch += cur_patch->skip_patch;
@ -8815,7 +8768,6 @@ ahd_resolve_seqaddr(struct ahd_softc *ahd, u_int address)
skip_addr = 0;
for (i = 0; i < address;) {
ahd_check_patch(ahd, &cur_patch, i, &skip_addr);
if (skip_addr > i) {
@ -9138,7 +9090,6 @@ ahd_dump_card_state(struct ahd_softc *ahd)
}
printf("\n");
printf("Sequencer DMA-Up and Complete list: ");
scb_index = ahd_inw(ahd, COMPLETE_DMA_SCB_HEAD);
i = 0;
@ -9289,7 +9240,6 @@ ahd_dump_scbs(struct ahd_softc *ahd)
ahd_restore_modes(ahd, saved_modes);
}
/*************************** Timeout Handling *********************************/
void
ahd_timeout(struct scb *scb)
@ -9403,9 +9353,7 @@ ahd_recover_commands(struct ahd_softc *ahd)
scb->flags &= ~SCB_TIMEDOUT;
if (active_scb != NULL) {
if (active_scb != scb) {
/*
* If the active SCB is not us, assume that
* the active SCB has a longer timeout than
@ -9448,7 +9396,6 @@ ahd_recover_commands(struct ahd_softc *ahd)
SCB_GET_TAG(scb),
ROLE_INITIATOR, /*status*/0,
SEARCH_COUNT) > 0) {
/*
* We haven't even gone out on the bus
* yet, so the timeout must be due to
@ -9527,14 +9474,13 @@ ahd_recover_commands(struct ahd_softc *ahd)
break;
}
}
/*
* Any remaining SCBs were not the "culprit", so remove
* them from the timeout list. The timer for these commands
* will be reset once the recovery SCB completes.
*/
while ((scb = LIST_FIRST(&ahd->timedout_scbs)) != NULL) {
LIST_REMOVE(scb, timedout_links);
scb->flags &= ~SCB_TIMEDOUT;
}
@ -9617,7 +9563,6 @@ ahd_read_seeprom(struct ahd_softc *ahd, uint16_t *buf,
AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
end_addr = start_addr + count;
for (cur_addr = start_addr; cur_addr < end_addr; cur_addr++) {
ahd_outb(ahd, SEEADR, cur_addr);
ahd_outb(ahd, SEECTL, SEEOP_READ | SEESTART);
@ -10160,7 +10105,6 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb)
}
}
} else {
ahd->black_hole = NULL;
/*
@ -10245,7 +10189,6 @@ ahd_run_tqinfifo(struct ahd_softc *ahd, int paused)
ahd_sync_tqinfifo(ahd, BUS_DMASYNC_POSTREAD);
while ((cmd = &ahd->targetcmds[ahd->tqinfifonext])->cmd_valid != 0) {
/*
* Only advance through the queue if we
* have the resources to process the command.
@ -10364,7 +10307,7 @@ ahd_handle_target_cmd(struct ahd_softc *ahd, struct target_cmd *cmd)
printf("Reserved or VU command code type encountered\n");
break;
}
memcpy(atio->cdb_io.cdb_bytes, byte, atio->cdb_len);
atio->ccb_h.status |= CAM_CDB_RECVD;

View File

@ -969,7 +969,6 @@ ahd_intr(struct ahd_softc *ahd)
} else if ((intstat & (PCIINT|SPLTINT)) != 0) {
ahd->bus_intr(ahd);
} else {
if ((intstat & SEQINT) != 0)
ahd_handle_seqint(ahd, intstat);

View File

@ -257,7 +257,7 @@ ahd_attach(struct ahd_softc *ahd)
sim = NULL;
goto fail;
}
if (xpt_create_path(&path, /*periph*/NULL,
cam_sim_path(sim), CAM_TARGET_WILDCARD,
CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
@ -287,7 +287,6 @@ ahd_attach(struct ahd_softc *ahd)
ahd_intr_enable(ahd, TRUE);
}
return (count);
}
@ -349,7 +348,6 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb)
ccb_path = ccb->ccb_h.path;
if (ahd->pending_device != NULL
&& xpt_path_comp(ahd->pending_device->path, ccb_path) == 0) {
if ((ccb->ccb_h.flags & CAM_SEND_STATUS) != 0) {
ahd->pending_device = NULL;
} else {
@ -385,7 +383,6 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb)
*/
LIST_FOREACH(list_scb,
&ahd->pending_scbs, pending_links) {
aic_scb_timer_reset(list_scb,
aic_get_timeout(scb));
}
@ -461,12 +458,12 @@ ahd_action(struct cam_sim *sim, union ccb *ccb)
u_int our_id;
CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("ahd_action\n"));
ahd = (struct ahd_softc *)cam_sim_softc(sim);
target_id = ccb->ccb_h.target_id;
our_id = SIM_SCSI_ID(ahd, sim);
switch (ccb->ccb_h.func_code) {
/* Common cases first */
#ifdef AHD_TARGET_MODE
@ -491,7 +488,6 @@ ahd_action(struct cam_sim *sim, union ccb *ccb)
}
}
if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) {
SLIST_INSERT_HEAD(&lstate->accept_tios, &ccb->ccb_h,
sim_links.sle);
ccb->ccb_h.status = CAM_REQ_INPROG;
@ -541,7 +537,6 @@ ahd_action(struct cam_sim *sim, union ccb *ccb)
ccb->ccb_h.target_lun);
}
if ((scb = ahd_get_scb(ahd, col_idx)) == NULL) {
xpt_freeze_simq(sim, /*count*/1);
ahd->flags |= AHD_RESOURCE_SHORTAGE;
ccb->ccb_h.status = CAM_REQUEUE_REQ;
@ -721,7 +716,6 @@ ahd_action(struct cam_sim *sim, union ccb *ccb)
}
}
static void
ahd_set_tran_settings(struct ahd_softc *ahd, int our_id, char channel,
struct ccb_trans_settings *cts)
@ -764,14 +758,14 @@ ahd_set_tran_settings(struct ahd_softc *ahd, int our_id, char channel,
cts->ccb_h.status = CAM_REQ_INVALID;
return;
}
if ((spi->valid & CTS_SPI_VALID_DISC) != 0) {
if ((spi->flags & CTS_SPI_FLAGS_DISC_ENB) != 0)
*discenable |= devinfo.target_mask;
else
*discenable &= ~devinfo.target_mask;
}
if ((scsi->valid & CTS_SCSI_VALID_TQ) != 0) {
if ((scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) != 0)
*tagenable |= devinfo.target_mask;
@ -858,12 +852,12 @@ ahd_get_tran_settings(struct ahd_softc *ahd, int our_id, char channel,
targ_info = ahd_fetch_transinfo(ahd, devinfo.channel,
devinfo.our_scsiid,
devinfo.target, &tstate);
if (cts->type == CTS_TYPE_CURRENT_SETTINGS)
tinfo = &targ_info->curr;
else
tinfo = &targ_info->user;
scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB;
spi->flags &= ~CTS_SPI_FLAGS_DISC_ENB;
if (cts->type == CTS_TYPE_USER_SETTINGS) {
@ -886,7 +880,7 @@ ahd_get_tran_settings(struct ahd_softc *ahd, int our_id, char channel,
spi->sync_offset = tinfo->offset;
spi->bus_width = tinfo->width;
spi->ppr_options = tinfo->ppr_options;
cts->protocol = PROTO_SCSI;
cts->transport = XPORT_SPI;
spi->valid = CTS_SPI_VALID_SYNC_RATE
@ -973,7 +967,6 @@ ahd_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
/* Copy the segments into our SG list */
for (i = nsegments, sg = scb->sg_list; i > 0; i--) {
sg = ahd_sg_setup(ahd, scb, sg, dm_segs->ds_addr,
dm_segs->ds_len,
/*last*/i == 1);
@ -1072,19 +1065,17 @@ ahd_setup_data(struct ahd_softc *ahd, struct cam_sim *sim,
struct hardware_scb *hscb;
struct ccb_hdr *ccb_h;
int error;
hscb = scb->hscb;
ccb_h = &csio->ccb_h;
csio->resid = 0;
csio->sense_resid = 0;
if (ccb_h->func_code == XPT_SCSI_IO) {
hscb->cdb_len = csio->cdb_len;
if ((ccb_h->flags & CAM_CDB_POINTER) != 0) {
if (hscb->cdb_len > MAX_CDB_LEN
&& (ccb_h->flags & CAM_CDB_PHYS) == 0) {
/*
* Should CAM start to support CDB sizes
* greater than 16 bytes, we could use
@ -1109,7 +1100,6 @@ ahd_setup_data(struct ahd_softc *ahd, struct cam_sim *sim,
}
} else {
if (hscb->cdb_len > MAX_CDB_LEN) {
aic_set_transaction_status(scb,
CAM_REQ_INVALID);
ahd_free_scb(ahd, scb);
@ -1240,7 +1230,7 @@ ahd_send_async(struct ahd_softc *ahd, char channel, u_int target,
case AC_TRANSFER_NEG:
{
struct ccb_trans_settings_scsi *scsi;
cts.type = CTS_TYPE_CURRENT_SETTINGS;
scsi = &cts.proto_specific.scsi;
cts.ccb_h.path = path;
@ -1440,7 +1430,7 @@ DB_COMMAND(ahd_in, ahd_ddb_in)
{
int c;
int size;
if (ahd_ddb_softc == NULL) {
db_error("Must set unit with ahd_sunit first!\n");
return;
@ -1487,7 +1477,7 @@ DB_FUNC(ahd_out, ahd_ddb_out, db_cmd_table, CS_MORE, NULL)
db_expr_t old_value;
db_expr_t new_value;
int size;
if (ahd_ddb_softc == NULL) {
db_error("Must set unit with ahd_sunit first!\n");
return;
@ -1508,7 +1498,7 @@ DB_FUNC(ahd_out, ahd_ddb_out, db_cmd_table, CS_MORE, NULL)
db_error("Unknown size\n");
return;
}
while (db_expression(&new_value)) {
switch (size) {
default:
@ -1544,7 +1534,6 @@ DB_COMMAND(ahd_dump, ahd_ddb_dump)
#endif
DECLARE_MODULE(ahd, ahd_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
MODULE_DEPEND(ahd, cam, 1, 1, 1);
MODULE_VERSION(ahd, 1);

View File

@ -257,7 +257,6 @@ void ahd_sysctl(struct ahd_softc *ahd);
int ahd_detach(device_t);
#define ahd_platform_init(arg)
/****************************** Interrupts ************************************/
void ahd_platform_intr(void *);
static __inline void ahd_platform_flushwork(struct ahd_softc *ahd);

View File

@ -404,7 +404,7 @@ ahd_pci_config(struct ahd_softc *ahd, struct ahd_pci_identity *entry)
aic_pci_write_config(ahd->dev_softc, DEVCONFIG,
devconfig, /*bytes*/4);
}
/* Ensure busmastering is enabled */
command = aic_pci_read_config(ahd->dev_softc, PCIR_COMMAND, /*bytes*/2);
command |= PCIM_CMD_BUSMASTEREN;
@ -529,7 +529,6 @@ ahd_pci_test_register_access(struct ahd_softc *ahd)
fail:
if ((ahd_inb(ahd, INTSTAT) & PCIINT) != 0) {
ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
targpcistat = ahd_inb(ahd, TARGPCISTAT);
@ -699,7 +698,7 @@ ahd_configure_termination(struct ahd_softc *ahd, u_int adapter_control)
printf("%s: STPWLEVEL is %s\n",
ahd_name(ahd), (devconfig & STPWLEVEL) ? "on" : "off");
aic_pci_write_config(ahd->dev_softc, DEVCONFIG, devconfig, /*bytes*/4);
/* Make sure current sensing is off. */
if ((ahd->flags & AHD_CURRENT_SENSING) != 0) {
(void)ahd_write_flexport(ahd, FLXADDR_ROMSTAT_CURSENSECTL, 0);
@ -836,7 +835,7 @@ ahd_pci_intr(struct ahd_softc *ahd)
u_int intstat;
u_int i;
u_int reg;
intstat = ahd_inb(ahd, INTSTAT);
if ((intstat & SPLTINT) != 0)
@ -850,7 +849,6 @@ ahd_pci_intr(struct ahd_softc *ahd)
ahd_dump_card_state(ahd);
ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
for (i = 0, reg = DF0PCISTAT; i < 8; i++, reg++) {
if (i == 5)
continue;
pci_status[i] = ahd_inb(ahd, reg);
@ -860,12 +858,11 @@ ahd_pci_intr(struct ahd_softc *ahd)
for (i = 0; i < 8; i++) {
u_int bit;
if (i == 5)
continue;
for (bit = 0; bit < 8; bit++) {
if ((pci_status[i] & (0x1 << bit)) != 0) {
static const char *s;
@ -926,7 +923,6 @@ ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat)
u_int bit;
for (bit = 0; bit < 8; bit++) {
if ((split_status[i] & (0x1 << bit)) != 0) {
static const char *s;

View File

@ -2380,7 +2380,6 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print;
ahd_print_register(NULL, 0, "SCB_DISCONNECTED_LISTS", 0x1b8, regvalue, cur_col, wrap)
#endif
#define MODE_PTR 0x00
#define DST_MODE 0x70
#define SRC_MODE 0x07
@ -3749,7 +3748,6 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print;
#define SCB_DISCONNECTED_LISTS 0x1b8
#define STATUS_QUEUE_FULL 0x28
#define WRTBIASCTL_HP_DEFAULT 0x00
#define NUMDSPS 0x14
@ -3808,7 +3806,6 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print;
#define AHD_SLEWRATE_SHIFT 0x03
#define B_CURRFIFO_0 0x02
/* Downloaded Constant Definitions */
#define SG_SIZEOF 0x04
#define CACHELINE_MASK 0x07
@ -3820,7 +3817,6 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print;
#define PKT_OVERRUN_BUFOFFSET 0x05
#define DOWNLOAD_CONST_COUNT 0x08
/* Exported Labels */
#define LABEL_seq_isr 0x28f
#define LABEL_timer_isr 0x28b

View File

@ -3671,4 +3671,3 @@ ahd_scb_disconnected_lists_print(u_int regvalue, u_int *cur_col, u_int wrap)
return (ahd_print_register(NULL, 0, "SCB_DISCONNECTED_LISTS",
0x1b8, regvalue, cur_col, wrap));
}

View File

@ -319,7 +319,6 @@ ahc_run_qoutfifo(struct ahc_softc *ahc)
ahc_sync_qoutfifo(ahc, BUS_DMASYNC_POSTREAD);
while (ahc->qoutfifo[ahc->qoutfifonext] != SCB_LIST_NULL) {
scb_index = ahc->qoutfifo[ahc->qoutfifonext];
if ((ahc->qoutfifonext & 0x03) == 0x03) {
u_int modnext;
@ -421,7 +420,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
{
struct scb *scb;
struct ahc_devinfo devinfo;
ahc_fetch_devinfo(ahc, &devinfo);
/*
@ -760,7 +759,6 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
*/
if ((intstat & SCSIINT) == 0
&& (ahc_inb(ahc, SSTAT1) & SCSIPERR) != 0) {
if ((ahc->features & AHC_DT) == 0) {
u_int curphase;
@ -845,7 +843,6 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
aic_get_transfer_length(scb), scb->sg_count);
if (scb->sg_count > 0) {
for (i = 0; i < scb->sg_count; i++) {
printf("sg[%d] - Addr 0x%x%x : Length %d\n",
i,
(aic_le32toh(scb->sg_list[i].len) >> 24
@ -1471,7 +1468,6 @@ ahc_clear_critical_section(struct ahc_softc *ahc)
steps++;
if (stepping == FALSE) {
/*
* Disable all interrupt sources so that the
* sequencer will not be stuck by a pausing
@ -1717,11 +1713,10 @@ ahc_find_syncrate(struct ahc_softc *ahc, u_int *period,
if ((*ppr_options & MSG_EXT_PPR_DT_REQ) == 0
&& maxsync < AHC_SYNCRATE_ULTRA2)
maxsync = AHC_SYNCRATE_ULTRA2;
for (syncrate = &ahc_syncrates[maxsync];
syncrate->rate != NULL;
syncrate++) {
/*
* The Ultra2 table doesn't go as low
* as for the Fast/Ultra cards.
@ -1783,7 +1778,6 @@ ahc_find_period(struct ahc_softc *ahc, u_int scsirate, u_int maxsync)
syncrate = &ahc_syncrates[maxsync];
while (syncrate->rate != NULL) {
if ((ahc->features & AHC_ULTRA2) != 0) {
if (syncrate->sxfr_u2 == 0)
break;
@ -1955,7 +1949,6 @@ ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
update_needed++;
scsirate = tinfo->scsirate;
if ((ahc->features & AHC_ULTRA2) != 0) {
scsirate &= ~(SXFR_ULTRA2|SINGLE_EDGE|ENABLE_CRC);
if (syncrate != NULL) {
scsirate |= syncrate->sxfr_u2;
@ -1965,7 +1958,6 @@ ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
scsirate |= SINGLE_EDGE;
}
} else {
scsirate &= ~(SXFR|SOFS);
/*
* Ensure Ultra mode is set properly for
@ -2268,7 +2260,6 @@ ahc_scb_devinfo(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
SCB_GET_LUN(scb), SCB_GET_CHANNEL(ahc, scb), role);
}
/************************ Message Phase Processing ****************************/
static void
ahc_assert_atn(struct ahc_softc *ahc)
@ -2450,7 +2441,6 @@ ahc_build_transfer_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
* messages that WDTR comes first.
*/
if (doppr || (dosync && !dowide)) {
offset = tinfo->goal.offset;
ahc_validate_offset(ahc, tinfo, rate, &offset,
doppr ? tinfo->goal.width
@ -2577,7 +2567,6 @@ ahc_handle_proto_violation(struct ahc_softc *ahc)
curphase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
lastphase = ahc_inb(ahc, LASTPHASE);
if ((seq_flags & NOT_IDENTIFIED) != 0) {
/*
* The reconnecting target either did not send an
* identify message, or did, but we didn't find an SCB
@ -2848,7 +2837,6 @@ ahc_handle_message_phase(struct ahc_softc *ahc)
*/
if ((ahc_inb(ahc, SCSISIGI) & ATNI) != 0
&& ahc->msgout_index > 0) {
/*
* Change gears and see if this messages is
* of interest to us or should be passed back
@ -3047,7 +3035,6 @@ ahc_sent_msg(struct ahc_softc *ahc, ahc_msgtype type, u_int msgval, int full)
end_index = index + 1 + ahc->msgout_buf[index + 1];
if (ahc->msgout_buf[index+2] == msgval
&& type == AHCMSG_EXT) {
if (full) {
if (ahc->msgout_index > end_index)
found = TRUE;
@ -3057,7 +3044,6 @@ ahc_sent_msg(struct ahc_softc *ahc, ahc_msgtype type, u_int msgval, int full)
index = end_index;
} else if (ahc->msgout_buf[index] >= MSG_SIMPLE_TASK
&& ahc->msgout_buf[index] <= MSG_IGN_WIDE_RESIDUE) {
/* Skip tag type and tag id or residue param*/
index += 2;
} else {
@ -3292,7 +3278,6 @@ ahc_parse_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
AHC_TRANS_ACTIVE|AHC_TRANS_GOAL,
/*paused*/TRUE);
if (sending_reply == FALSE && reject == FALSE) {
/*
* We will always have an SDTR to send.
*/
@ -3544,7 +3529,6 @@ ahc_handle_msg_reject(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
ahc->msgout_index = 0;
response = 1;
} else if (ahc_sent_msg(ahc, AHCMSG_EXT, MSG_EXT_WDTR, /*full*/FALSE)) {
/* note 8bit xfers */
printf("(%s:%c:%d:%d): refuses WIDE negotiation. Using "
"8bit transfers\n", ahc_name(ahc),
@ -3560,7 +3544,6 @@ ahc_handle_msg_reject(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
* sync rate before sending our WDTR.
*/
if (tinfo->goal.offset != tinfo->curr.offset) {
/* Start the sync negotiation */
ahc->msgout_index = 0;
ahc->msgout_len = 0;
@ -3723,7 +3706,6 @@ ahc_handle_ign_wide_residue(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
sglen = aic_le32toh(sg->len) & AHC_SG_LEN_MASK;
if (sg != scb->sg_list
&& sglen < (data_cnt & AHC_SG_LEN_MASK)) {
sg--;
sglen = aic_le32toh(sg->len);
/*
@ -3755,7 +3737,6 @@ ahc_handle_ign_wide_residue(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
}
}
/*
* Reinitialize the data pointers for the active transfer
* based on its current residual.
@ -3859,7 +3840,7 @@ ahc_handle_devreset(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
ahc_set_syncrate(ahc, devinfo, /*syncrate*/NULL,
/*period*/0, /*offset*/0, /*ppr_options*/0,
AHC_TRANS_CUR, /*paused*/TRUE);
if (status != CAM_SEL_TIMEOUT)
ahc_send_async(ahc, devinfo->channel, devinfo->target,
CAM_LUN_WILDCARD, AC_SENT_BDR, NULL);
@ -4151,7 +4132,7 @@ ahc_reset(struct ahc_softc *ahc, int reinit)
u_int sxfrctl1_a, sxfrctl1_b;
int error;
int wait;
/*
* Preserve the value of the SXFRCTL1 register for all channels.
* It contains settings that affect termination and we don't want
@ -4255,7 +4236,6 @@ ahc_probe_scbs(struct ahc_softc *ahc) {
int i;
for (i = 0; i < AHC_SCB_MAX; i++) {
ahc_outb(ahc, SCBPTR, i);
ahc_outb(ahc, SCB_BASE, i);
if (ahc_inb(ahc, SCB_BASE) != i)
@ -4656,7 +4636,6 @@ ahc_chip_init(struct ahc_softc *ahc)
/* Set the SCSI Id, SXFRCTL0, SXFRCTL1, and SIMODE1, for both channels*/
if (ahc->features & AHC_TWIN) {
/*
* Setup Channel B first.
*/
@ -4876,7 +4855,7 @@ ahc_init(struct ahc_softc *ahc)
*/
if ((ahc->flags & AHC_USEDEFAULTS) != 0)
ahc->our_id = ahc->our_id_b = 7;
/*
* Default to allowing initiator operations.
*/
@ -5367,7 +5346,7 @@ ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb)
target = SCB_GET_TARGET(ahc, scb);
lun = SCB_GET_LUN(scb);
channel = SCB_GET_CHANNEL(ahc, scb);
ahc_search_qinfifo(ahc, target, channel, lun,
/*tag*/SCB_LIST_NULL, ROLE_UNKNOWN,
CAM_REQUEUE_REQ, SEARCH_COMPLETE);
@ -5658,10 +5637,8 @@ ahc_search_untagged_queues(struct ahc_softc *ahc, aic_io_ctx_t ctx,
found = 0;
i = 0;
if ((ahc->flags & AHC_SCB_BTT) == 0) {
maxtarget = 16;
if (target != CAM_TARGET_WILDCARD) {
i = target;
if (channel == 'B')
i += 8;
@ -5678,7 +5655,6 @@ ahc_search_untagged_queues(struct ahc_softc *ahc, aic_io_ctx_t ctx,
untagged_q = &(ahc->untagged_queues[i]);
next_scb = TAILQ_FIRST(untagged_q);
while (next_scb != NULL) {
scb = next_scb;
next_scb = TAILQ_NEXT(scb, links.tqe);
@ -5935,7 +5911,6 @@ ahc_abort_scbs(struct ahc_softc *ahc, int target, char channel,
}
if (lun == CAM_LUN_WILDCARD) {
/*
* Unless we are using an SCB based
* busy targets table, there is only
@ -6188,7 +6163,6 @@ ahc_reset_channel(struct ahc_softc *ahc, char channel, int initiate_reset)
* Revert to async/narrow transfers until we renegotiate.
*/
for (target = 0; target <= max_scsiid; target++) {
if (ahc->enabled_targets[target] == NULL)
continue;
for (initiator = 0; initiator <= max_scsiid; initiator++) {
@ -6213,7 +6187,6 @@ ahc_reset_channel(struct ahc_softc *ahc, char channel, int initiate_reset)
return found;
}
/***************************** Residual Processing ****************************/
/*
* Calculate the residual for a just completed SCB.
@ -6507,7 +6480,6 @@ ahc_loadseq(struct ahc_softc *ahc)
ahc->num_critical_sections = cs_count;
if (cs_count != 0) {
cs_count *= sizeof(struct cs);
ahc->critical_sections = malloc(cs_count, M_DEVBUF, M_NOWAIT);
if (ahc->critical_sections == NULL)
@ -6537,9 +6509,7 @@ ahc_check_patch(struct ahc_softc *ahc, struct patch **start_patch,
cur_patch = *start_patch;
while (cur_patch < last_patch && start_instr == cur_patch->begin) {
if (cur_patch->patch_func(ahc) == 0) {
/* Start rejecting code */
*skip_addr = start_instr + cur_patch->skip_instr;
cur_patch += cur_patch->skip_patch;
@ -6601,7 +6571,6 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, uint8_t *dconsts)
skip_addr = 0;
for (i = 0; i < address;) {
ahc_check_patch(ahc, &cur_patch, i, &skip_addr);
if (skip_addr > i) {
@ -7122,7 +7091,6 @@ ahc_recover_commands(struct ahc_softc *ahc)
/* It's us */
if ((scb->flags & SCB_TARGET_SCB) != 0) {
/*
* Send back any queued up transactions
* and properly record the error condition.
@ -7183,7 +7151,6 @@ ahc_recover_commands(struct ahc_softc *ahc)
}
if (disconnected) {
ahc_set_recoveryscb(ahc, scb);
/*
* Actually re-queue this SCB in an attempt
@ -7261,14 +7228,13 @@ ahc_recover_commands(struct ahc_softc *ahc)
}
break;
}
/*
* Any remaining SCBs were not the "culprit", so remove
* them from the timeout list. The timer for these commands
* will be reset once the recovery SCB completes.
*/
while ((scb = LIST_FIRST(&ahc->timedout_scbs)) != NULL) {
LIST_REMOVE(scb, timedout_links);
scb->flags &= ~SCB_TIMEDOUT;
}
@ -7371,7 +7337,6 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
* a previous target mode ID has been enabled.
*/
if ((ahc->features & AHC_MULTIROLE) != 0) {
if ((ahc->features & AHC_MULTI_TID) != 0
&& (ahc->flags & AHC_INITIATORROLE) != 0) {
/*
@ -7395,7 +7360,6 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
}
} else if ((ahc->features & AHC_MULTI_TID) == 0
&& ahc->enabled_luns > 0) {
status = CAM_TID_INVALID;
}
}
@ -7643,7 +7607,6 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
}
}
} else {
ahc->black_hole = NULL;
/*
@ -7736,7 +7699,6 @@ ahc_run_tqinfifo(struct ahc_softc *ahc, int paused)
ahc_sync_tqinfifo(ahc, BUS_DMASYNC_POSTREAD);
while ((cmd = &ahc->targetcmds[ahc->tqinfifonext])->cmd_valid != 0) {
/*
* Only advance through the queue if we
* have the resources to process the command.
@ -7867,7 +7829,7 @@ ahc_handle_target_cmd(struct ahc_softc *ahc, struct target_cmd *cmd)
printf("Reserved or VU command code type encountered\n");
break;
}
memcpy(atio->cdb_io.cdb_bytes, byte, atio->cdb_len);
atio->ccb_h.status |= CAM_CDB_RECVD;

View File

@ -637,7 +637,6 @@ ahc_intr(struct ahc_softc *ahc)
} else if (intstat & BRKADRINT) {
ahc_handle_brkadrint(ahc);
} else if ((intstat & (SEQINT|SCSIINT)) != 0) {
ahc_pause_bug_fix(ahc);
if ((intstat & SEQINT) != 0)

View File

@ -70,7 +70,6 @@ static int ahc_create_path(struct ahc_softc *ahc,
char channel, u_int target, u_int lun,
struct cam_path **path);
static int
ahc_create_path(struct ahc_softc *ahc, char channel, u_int target,
u_int lun, struct cam_path **path)
@ -160,7 +159,6 @@ ahc_attach(struct ahc_softc *ahc)
path = NULL;
path2 = NULL;
/*
* Create a thread to perform all recovery.
*/
@ -207,7 +205,7 @@ ahc_attach(struct ahc_softc *ahc)
sim = NULL;
goto fail;
}
if (xpt_create_path(&path, /*periph*/NULL,
cam_sim_path(sim), CAM_TARGET_WILDCARD,
CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
@ -360,7 +358,6 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
ccb_path = ccb->ccb_h.path;
if (ahc->pending_device != NULL
&& xpt_path_comp(ahc->pending_device->path, ccb_path) == 0) {
if ((ccb->ccb_h.flags & CAM_SEND_STATUS) != 0) {
ahc->pending_device = NULL;
} else {
@ -401,7 +398,6 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
*/
LIST_FOREACH(list_scb, &ahc->pending_scbs,
pending_links) {
aic_scb_timer_reset(list_scb,
aic_get_timeout(scb));
}
@ -447,12 +443,12 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
u_int our_id;
CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("ahc_action\n"));
ahc = (struct ahc_softc *)cam_sim_softc(sim);
target_id = ccb->ccb_h.target_id;
our_id = SIM_SCSI_ID(ahc, sim);
switch (ccb->ccb_h.func_code) {
/* Common cases first */
case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */
@ -476,7 +472,6 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
}
}
if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) {
SLIST_INSERT_HEAD(&lstate->accept_tios, &ccb->ccb_h,
sim_links.sle);
ccb->ccb_h.status = CAM_REQ_INPROG;
@ -512,7 +507,6 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
* get an scb to use.
*/
if ((scb = ahc_get_scb(ahc)) == NULL) {
xpt_freeze_simq(sim, /*count*/1);
ahc->flags |= AHC_RESOURCE_SHORTAGE;
ccb->ccb_h.status = CAM_REQUEUE_REQ;
@ -730,7 +724,6 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
case XPT_GET_TRAN_SETTINGS:
/* Get default/user set transfer settings for the target */
{
ahc_get_tran_settings(ahc, SIM_SCSI_ID(ahc, sim),
SIM_CHANNEL(ahc, sim), &ccb->cts);
xpt_done(ccb);
@ -842,12 +835,12 @@ ahc_get_tran_settings(struct ahc_softc *ahc, int our_id, char channel,
targ_info = ahc_fetch_transinfo(ahc, devinfo.channel,
devinfo.our_scsiid,
devinfo.target, &tstate);
if (cts->type == CTS_TYPE_CURRENT_SETTINGS)
tinfo = &targ_info->curr;
else
tinfo = &targ_info->user;
scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB;
spi->flags &= ~CTS_SPI_FLAGS_DISC_ENB;
if (cts->type == CTS_TYPE_USER_SETTINGS) {
@ -870,7 +863,7 @@ ahc_get_tran_settings(struct ahc_softc *ahc, int our_id, char channel,
spi->sync_offset = tinfo->offset;
spi->bus_width = tinfo->width;
spi->ppr_options = tinfo->ppr_options;
cts->protocol = PROTO_SCSI;
cts->transport = XPORT_SPI;
spi->valid = CTS_SPI_VALID_SYNC_RATE
@ -1011,10 +1004,8 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
if ((ahc->bugs & AHC_TMODE_WIDEODD_BUG) != 0
&& (ccb->csio.dxfer_len & 0x1) != 0
&& (ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) {
nsegments++;
if (nsegments > AHC_NSEG) {
aic_set_transaction_status(scb,
CAM_REQ_TOO_BIG);
bus_dmamap_unload(ahc->buffer_dmat,
@ -1039,7 +1030,7 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
scb->hscb->dataptr = 0;
scb->hscb->datacnt = 0;
}
scb->sg_count = nsegments;
/*
@ -1139,16 +1130,15 @@ ahc_setup_data(struct ahc_softc *ahc, struct cam_sim *sim,
struct hardware_scb *hscb;
struct ccb_hdr *ccb_h;
int error;
hscb = scb->hscb;
ccb_h = &csio->ccb_h;
csio->resid = 0;
csio->sense_resid = 0;
if (ccb_h->func_code == XPT_SCSI_IO) {
hscb->cdb_len = csio->cdb_len;
if ((ccb_h->flags & CAM_CDB_POINTER) != 0) {
if (hscb->cdb_len > sizeof(hscb->cdb32)
|| (ccb_h->flags & CAM_CDB_PHYS) != 0) {
aic_set_transaction_status(scb,
@ -1300,7 +1290,7 @@ ahc_send_async(struct ahc_softc *ahc, char channel, u_int target,
case AC_TRANSFER_NEG:
{
struct ccb_trans_settings_scsi *scsi;
cts.type = CTS_TYPE_CURRENT_SETTINGS;
scsi = &cts.proto_specific.scsi;
cts.ccb_h.path = path;

View File

@ -721,7 +721,6 @@ ahc_9005_subdevinfo_valid(uint16_t device, uint16_t vendor,
&& subvendor == 0x9005
&& subdevice != device
&& SUBID_9005_TYPE_KNOWN(subdevice) != 0) {
switch (SUBID_9005_TYPE(subdevice)) {
case SUBID_9005_TYPE_MB:
break;
@ -826,13 +825,12 @@ ahc_pci_config(struct ahc_softc *ahc, struct ahc_pci_identity *entry)
* 64bit bus (PCI64BIT set in devconfig).
*/
if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
if (bootverbose)
printf("%s: Enabling 39Bit Addressing\n",
ahc_name(ahc));
devconfig |= DACEN;
}
/* Ensure that pci error generation, a test feature, is disabled. */
devconfig |= PCIERRGENDIS;
@ -904,7 +902,6 @@ ahc_pci_config(struct ahc_softc *ahc, struct ahc_pci_identity *entry)
dscommand0 = ahc_inb(ahc, DSCOMMAND0);
dscommand0 |= MPARCKEN|CACHETHEN;
if ((ahc->features & AHC_ULTRA2) != 0) {
/*
* DPARCKEN doesn't work correctly on
* some MBs so don't use it.
@ -931,7 +928,6 @@ ahc_pci_config(struct ahc_softc *ahc, struct ahc_pci_identity *entry)
if ((ahc->bugs & AHC_PCI_2_1_RETRY_BUG) != 0
&& ahc->pci_cachesize == 4) {
aic_pci_write_config(ahc->dev_softc, CSIZE_LATTIME,
0, /*bytes*/1);
ahc->pci_cachesize = 0;
@ -1168,7 +1164,7 @@ ahc_probe_ext_scbram(struct ahc_softc *ahc)
fast = FALSE;
large = FALSE;
num_scbs = 0;
if (ahc_ext_scbram_present(ahc) == 0)
goto done;
@ -1377,7 +1373,6 @@ check_extport(struct ahc_softc *ahc, u_int *sxfrctl1)
have_seeprom = ahc_acquire_seeprom(ahc, &sd);
if (have_seeprom) {
if (bootverbose)
printf("%s: Reading SEEPROM...", ahc_name(ahc));
@ -1617,7 +1612,7 @@ configure_termination(struct ahc_softc *ahc,
u_int *sxfrctl1)
{
uint8_t brddat;
brddat = 0;
/*
@ -1625,7 +1620,7 @@ configure_termination(struct ahc_softc *ahc,
* termination settings
*/
*sxfrctl1 = 0;
/*
* SEECS must be on for the GALS to latch
* the data properly. Be sure to leave MS
@ -1921,7 +1916,7 @@ aic785X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
*externalcable_present = (brdctl & BRDDAT6) ? 0 : 1;
*eeprom_present = (ahc_inb(ahc, SPIOCAP) & EEPROM) ? 1 : 0;
}
int
ahc_acquire_seeprom(struct ahc_softc *ahc, struct seeprom_descriptor *sd)
{

View File

@ -1064,7 +1064,6 @@ ahc_reg_print_t ahc_sg_cache_pre_print;
ahc_print_register(NULL, 0, "SG_CACHE_PRE", 0xfc, regvalue, cur_col, wrap)
#endif
#define SCSISEQ 0x00
#define TEMODE 0x80
#define SCSIRSTO 0x01
@ -1749,7 +1748,6 @@ ahc_reg_print_t ahc_sg_cache_pre_print;
#define SG_CACHE_PRE 0xfc
#define MAX_OFFSET_ULTRA2 0x7f
#define SCB_LIST_NULL 0xff
#define HOST_MSG 0xff
@ -1775,7 +1773,6 @@ ahc_reg_print_t ahc_sg_cache_pre_print;
#define CCSGADDR_MAX 0x80
#define STACK_SIZE 0x04
/* Downloaded Constant Definitions */
#define SG_PREFETCH_ADDR_MASK 0x06
#define SG_PREFETCH_ALIGN_MASK 0x05
@ -1786,5 +1783,4 @@ ahc_reg_print_t ahc_sg_cache_pre_print;
#define QINFIFO_OFFSET 0x01
#define DOWNLOAD_CONST_COUNT 0x07
/* Exported Labels */

View File

@ -1681,4 +1681,3 @@ ahc_sg_cache_pre_print(u_int regvalue, u_int *cur_col, u_int wrap)
return (ahc_print_register(SG_CACHE_PRE_parse_table, 3, "SG_CACHE_PRE",
0xfc, regvalue, cur_col, wrap));
}

View File

@ -63,7 +63,7 @@ void
aic_platform_timeout(void *arg)
{
struct scb *scb;
scb = (struct scb *)arg;
aic_lock(scb->aic_softc);
aic_timeout(scb);
@ -130,4 +130,3 @@ aic_calc_geometry(struct ccb_calc_geometry *ccg, int extended)
{
cam_calc_geometry(ccg, extended);
}

View File

@ -191,7 +191,7 @@ aic_scb_timer_reset(struct scb *scb, u_int msec)
static __inline void
aic_scb_timer_start(struct scb *scb)
{
if (AIC_SCB_DATA(scb->aic_softc)->recovery_scbs == 0
&& scb->io_ctx->ccb_h.timeout != CAM_TIME_INFINITY) {
aic_scb_timer_reset(scb, scb->io_ctx->ccb_h.timeout);
@ -355,7 +355,6 @@ static __inline int aic_get_pci_function(aic_dev_softc_t);
static __inline int aic_get_pci_slot(aic_dev_softc_t);
static __inline int aic_get_pci_bus(aic_dev_softc_t);
static __inline uint32_t
aic_pci_read_config(aic_dev_softc_t pci, int reg, int width)
{

View File

@ -132,7 +132,7 @@ main(int argc, char *argv[])
/* Set Sentinal scope node */
sentinal = scope_alloc();
sentinal->type = SCOPE_ROOT;
includes_search_curdir = 1;
appname = *argv;
regfile = NULL;
@ -369,7 +369,6 @@ output_code(void)
for (cur_instr = STAILQ_FIRST(&seq_program);
cur_instr != NULL;
cur_instr = STAILQ_NEXT(cur_instr, links)) {
fprintf(ofile, "%s\t0x%02x, 0x%02x, 0x%02x, 0x%02x",
cur_instr == STAILQ_FIRST(&seq_program) ? "" : ",\n",
#if BYTE_ORDER == LITTLE_ENDIAN
@ -476,7 +475,6 @@ dump_scope(scope_t *scope)
cur_scope = TAILQ_FIRST(&scope->inner_scope);
while (cur_scope != NULL) {
dump_scope(cur_scope);
cur_scope = TAILQ_NEXT(cur_scope, scope_links);
@ -578,7 +576,6 @@ output_listing(char *ifilename)
"this expression[T/F]:");
while (1) {
input = getchar();
input = toupper(input);
@ -601,7 +598,6 @@ output_listing(char *ifilename)
for (cur_instr = STAILQ_FIRST(&seq_program);
cur_instr != NULL;
cur_instr = STAILQ_NEXT(cur_instr, links), instrcount++) {
if (check_patch(&cur_patch, instrcount,
&skip_addr, func_values) == 0) {
/* Don't count this instruction as it is in a patch
@ -757,7 +753,7 @@ cs_alloc(void)
if (new_cs == NULL)
stop("Unable to malloc critical_section object", EX_SOFTWARE);
memset(new_cs, 0, sizeof(*new_cs));
TAILQ_INSERT_TAIL(&cs_tailq, new_cs, links);
return new_cs;
}
@ -772,7 +768,7 @@ scope_alloc(void)
stop("Unable to malloc scope object", EX_SOFTWARE);
memset(new_scope, 0, sizeof(*new_scope));
TAILQ_INIT(&new_scope->inner_scope);
if (SLIST_FIRST(&scope_stack) != NULL) {
TAILQ_INSERT_TAIL(&SLIST_FIRST(&scope_stack)->inner_scope,
new_scope, scope_links);

View File

@ -390,7 +390,7 @@ aic_print_reg_dump_end(FILE *ofile, FILE *dfile,
lower_name = strdup(regnode->symbol->name);
if (lower_name == NULL)
stop("Unable to strdup symbol name", EX_SOFTWARE);
for (letter = lower_name; *letter != '\0'; letter++)
*letter = tolower(*letter);
@ -535,7 +535,6 @@ symtable_dump(FILE *ofile, FILE *dfile)
aic_print_file_prologue(dfile);
aic_print_include(dfile, stock_include_file);
SLIST_FOREACH(curnode, &registers, links) {
switch(curnode->symbol->type) {
case REGISTER:
case SCBLOC:
@ -640,7 +639,6 @@ symtable_dump(FILE *ofile, FILE *dfile)
fprintf(ofile, "\n\n");
while (SLIST_FIRST(&constants) != NULL) {
curnode = SLIST_FIRST(&constants);
SLIST_REMOVE_HEAD(&constants, links);
fprintf(ofile, "#define\t%-8s\t0x%02x\n",
@ -649,11 +647,9 @@ symtable_dump(FILE *ofile, FILE *dfile)
free(curnode);
}
fprintf(ofile, "\n\n/* Downloaded Constant Definitions */\n");
for (i = 0; SLIST_FIRST(&download_constants) != NULL; i++) {
curnode = SLIST_FIRST(&download_constants);
SLIST_REMOVE_HEAD(&download_constants, links);
fprintf(ofile, "#define\t%-8s\t0x%02x\n",
@ -666,7 +662,6 @@ symtable_dump(FILE *ofile, FILE *dfile)
fprintf(ofile, "\n\n/* Exported Labels */\n");
while (SLIST_FIRST(&exported_labels) != NULL) {
curnode = SLIST_FIRST(&exported_labels);
SLIST_REMOVE_HEAD(&exported_labels, links);
fprintf(ofile, "#define\tLABEL_%-8s\t0x%02x\n",
@ -675,4 +670,3 @@ symtable_dump(FILE *ofile, FILE *dfile)
free(curnode);
}
}