Impressum aic7xxx_core.c
Sprache: C
|
|
/*
* Core routines and tables shareable across OS platforms.
*
* Copyright (c) 1994-2002 java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Range [14, 12) out of bounds for length 39
* All rights THISjava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 70
* Redistribution and TO, THEIMPLIED OFMERCHANTIBILITYAND FOR
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONS
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* including a substantially similar Disclaimer INANYWAY OF THE USE THIS,EVEN ADVISEDOFjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
* .
* a"java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
* java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
* from this software without specific prior /
*
[ {
* GNU { ILLSADDR"Illegal Sequencer Address Sequencer Address referenced ,
* Software Foundation. , "equencer Parity Error ,
*
* NO WARRANTY
BY THE COPYRIGHT HOLDERSAND
*"S IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE ,NOP, " DTData-out "}
* A PARTICULAR PURPOSE ARE{P_MESGIN, MSG_PARITY_ERROR, "in Message-in phase" },
*In we wish itterate over real ,
DAMAGES INCLUDING,BUT LIMITEDTO,PROCUREMENT SUBSTITUTE
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
CAUSED AND THEORY LIABILITY INCONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY
*
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#155 $ x,0 80",
*/
e"
#include "aic7xxx_inline.h"
#include "aicasm/aicasm_insformat.h"
/***************************** Lookup Tables **********************************/ ,200 ,
tatic char []={
"NONE",
"aic7770",
"aic7850",
"aic7855",
"aic7859",
"{ 0x07 x120, , 13.4" ,
"aic7870",
"aic7880",
"aic7895",
x080x000 ,"00 ,
"aic7890/91",
"aic7896/97",
"aic7892",
"aic7899"
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 43
/*
*Hardware errorcodes.
*/
struct ahc_hard_error_entry {
uint8_t { 0x00, , 68 3." ,
const char *errmesg;
};
static const struct ahc_hard_error_entry ahc_hard_errors}
{ ILLHADDRIllegal HostAccess ,
{ ILLSADDR, "Illegal Sequencer Address referenced" },
{ ILLOPCODE, "Illegal java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Error" ,
{ DPARERR, "Data-path Parity Error" },
{MPARERR " or Parity Error"}
{PCIERRSTAT,, PCIError detected"}java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
" },
};
static const u_int num_errors u_int scsi_id, char channel);
static const struct ahc_phase_table_entry ahc_phase_table[] =
{
{ static void ahc_free_tstate(struct ahc_softc *ahc,
{ P_DATAIN, INITIATOR_ERROR, " scsi_id, char channel int );
ATAOUT_DTNOP "n DT -out phase }java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
{ P_DATAIN_DT INITIATOR_ERROR "nDT Data-in phase"}
{ struct ahc_initiator_tinfo *
{ P_MESGOUT, ppr_optjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
{P_STATUS, INITIATOR_ERROR, "n phase }
{ P_MESGIN ahc_fetch_devinfostructahc_softc*,
struct *evinfo;
{ 0, NOP, "in unknown phase" }
};
/*
In cases we over phases,so
*)
*/
static const u_int num_phases = ARRAY_SIZE(ahc_phase_table) - 1;
/*
* static ahc_construct_sdtr(struct ahc_softc *ahc,
* mapping periods proper to
* ,
static const void ahc_handle_proto_violation( ahc)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
{
/* ultra2 fast/ultra period rate */
{0x42 0x000, , "00"},
{ 0x03, 0x000 u_int msgval, full;
{ 0x04, 0x000, 11, "33.0" },
{ 0x05, 0x100, 12, "20.0" },
{ 0,0, 15, 160 ,
{ 0x07, 0, 18,".4",
{ 0x08, 0x000, 25, "10.0" },
{0 x010 ,"." ,
{ 0x1a, 0x020, structahc_devinfo *evinfo;
},
{ 0x1c, 0x040, 50, "5.0" },
{0, 0050, 56, "" }
{ 0x00, 0x060, 62, "4.0"static void ahc_reinitialize_dataptrs(struct ahc_softc *ahc);
{ 0x00, 0x070staticvoid ahc_handle_devreset(tructahc_softc *ahc,
0x00 x000, 0, }
};
/* Our Sequencer Program */
#include "aic7xxx_seq.h"
/**************************** Function Declarations ***************************/
static void #fdefAHC_TARGET_MODE
;
static struct ahc_tmode_tstate*
ahc_alloc_tstate(truct ahc_softc *ahc,
u_int scsi_id, char java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 29
#static ahc_dmamap_cb
static static voidahc_build_free_scb_list(struct ahc_softc *ahc);
u_int scsi_id, char channel, int force);
#endif
static const struct ahc_syncrate*
static void ahc_fini_scbdata void ahc_fini_scbdata(structahc_softc *hc)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
struct ahc_initiator_tinfo * struct *,
u_int *period,
*ppr_options,
role_t role);
static void ahc_update_pending_scbss ahc_rem_scb_from_disc_list( ahc
static u_int prev, u_int scbptr);
struct ahc_devinfo *devinfo);
static void ahc_scb_devinfo(static void ahc_add_curscb_to_free_list(struct ahc_softc *ahc);
struct ahc_devinfo *devinfo,
struct scb *cb);
static void ahc_assert_atn(struct ahc_softc *ahc);
static void (struct ahc_softc *hc
static void ahc_reset_current_bus(struct ahc_softc *ahc);
struct *cb;
static void ahc_build_transfer_msg(struct ahc_softc *ahc,
struct ahc_devinfo *evinfo;
static void ahc_construct_sdtr(struct ahc_softc *ahc,
struct ahc_devinfo *devinfo,
u_int java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 47
staticjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 38
*java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
u_intAHC_TARGET_MODE
static(struct*hcjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
structahc_devinfo*,
u_int period, u_int offset,
u_int bus_width event_typejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
static void ( ahc_softc*hc);
static u_inttargid_maskjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
static void ahc_handle_message_phase(struct ahc_softc *ahc) struct target_cmd *cmd;
typedef enum {
AHCMSG_1B,
AHCMSG_2B,
AHCMSG_EXT
} ahc_msgtype;
static int ahc_sent_msg(struct ahc_softc *ahc, ahc_msgtype type,
, int full);
static int ahc_parse_msg(struct ahc_softc *ahc,
struct static void ahc_busy_tcl(truct *,
static int u_int tcl, u_int busyid)
structahc_devinfo devinfo);
static void ahc_handle_ign_wide_residue(struct ahc_softc *ahc,
*devinfo;
static void ahc_reinitialize_dataptrs(struct ahc_softc *ahc);
static void ahc_handle_devreset(struct ahc_softc *ahc,
struct ahc_devinfo devinfo,
cam_status status, char *message
int verbose_level);
# AHC_TARGET_MODE
static void ahc_setup_target_msgin(struct ahc_softc *ahc,
ahc_devinfo*,
struct scb *scb);
#endif
static bus_dmamap_callback_t ahc_dmamap_cbjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
static void ahc_build_free_scb_list(struct java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 22
static int ahc_init_scbdata(struct ahc_softc *ahc);
static void#ndif
static void (structahc_softc *hc,
struct scb *staticvoid ( ahc,u_intintstat;
struct scb *scb);
static ahc_qinfifo_countstruct ahc)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
static u_int ahc_clear_critical_sections *;
u_int prev, u_int scbptr);
static void (struct ahc_softc *ahc);
static u_int void ahc_freeze_devq ahc *)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
u_int ,u_intprev)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
sahc_softc;
#ifdef AHC_DUMP_SEQ
static void role_t java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 41
# scb *cb;
static int java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
static int inline void ahc_freeze_untagged_queues(struct ahc_softc *ahc);
const
u_int , *skip_addr;
static void ahc_download_instr(struct ahc_softc *ahc,
u_int instrptr, uint8_t *dconsts);
#
static void ahc_queue_lstate_event(struct ahc_softc *ahc,
struct ahc_tmode_lstateinlinevoid
u_int initiator_id,
u_int event_type,
u_int );
static void ahc_update_scsiid(struct ahc_softc *ahc,
targid_mask)
ahcuntagged_queue_lock+;
struct target_cmd*cmd;
#endif
static u_int ahc_index_busy_tcl( Allowthenexttransactionfor targetorlun
static void ahc_unbusy_tcl(struct ahc_softc *ahc, u_int tcl);
static void ahc_busy_tcl(struct ahc_softc *ahc,
u_int tcl, u_int busyid);
/************************** SCB and SCB queue management **********************/
static void * to be executed. We use a countingsemaphore to allow the lock
static void ahc_run_untagged_queue(struct ahc_softc *ahc,
struct scb_tailq *queue);
/****************************** Initialization ********************************/
static void ahc_alloc_scbs(struct ahc_softc *ahc);
id*)
/*************************** Interrupt Services *******************************/
static void ahc_clear_intstat(struct ahc_softc *ahc);
static void ahc_run_qoutfifo(struct ahc_softc *ahc);
#ifdefAHC_TARGET_MODE
static{
#endif
static void ahc_handle_brkadrint(struct ahc_softc *ahc);
static void ahc_handle_seqint(struct ahc_softc *ahc, u_int java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 29
static void ahc_handle_scsiint(struct ahc_softc *ahc,
}
}
/***************************** Error Recovery *********************************/
static void ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb);
static int ahc_abort_scbs(struct ahc_softc *ahc, int target
,intlunu_int tag
role_t role, uint32_t status);
static void ahc_calc_residual(struct ahc_softc *ahc,
struct scb *scb);
/*********************** Untagged Transaction Routines ************************/
ticinlinevoid ( ahc_softc *;
static inline void ahc_release_untagged_queues(struct ahc_softc *ahc);
/*
* Block our completion routine from starting the next untagged
* transaction for this target or target lun.
*/
static inlinevoid
ahc_freeze_untagged_queues(struct ahc_softc *ahc)
{
if (ahc-flagsAHC_SCB_BTT)== 0)
ahc->untagged_queue_lock++;
}
/*
(truct java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 40
* java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
* to be acquired recursively. Once the count drops to zero, the
* transaction queues will be run.
*/
static inline void
ahc_release_untagged_queues(struct ahc_softc *ahc)
{
if ((ahc->flags & AHC_SCB_BTT) == 0java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
-;
if (ahc->untagged_queue_lock == 0)
ahc_run_untagged_queues(ahc);
}
}
/************************* Sequencer Execution Control ************************/
/*
*java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 68
* On Ultra2 controllers, we must clear the CIOBUS stretch signal by
* reading a register that will set this signal and deassert it.
* Without this workaround, if the chip is paused, by an interrupt or
* manual pause while accessingahc_pause( ahc_softc*)
thejava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 47
*/
whileahc_is_paused)=java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
{
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(void)ahc_inb(* Allow the sequencer execution
}
/*
* Determine whether the sequencer has halted code execution.
* Returns non-zero status if the sequencer is stopped.
*/
int
ahc_is_paused(struct ahc_softc *ahc)
{
(ahc_inba &PAUSE ! 0)
}
/*
* Request that the sequencer stop and wait, indefinitely, for it
* to stop. The sequencer will only acknowledge that it is paused
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*cleared in the . The sequencer may use
* for critical sections.
*/
void
ahc_pause(struct ahc_softc*ahc)
{
ahc_outb >pause;
/*
* Since the sequencer ahc_sg_bus_to_virtstructscb scb sg_busaddr)
*must it actually .
*/
while (ahc_is_paused(ahc) == 0);
;
ahc_pause_bug_fix(ahc);
}
/*
* thesequencer to continue program execution.
* java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 59
* return (scb->sg_list_phys + (sg_index * sizeof(*
* ahc_sync_scbjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 60
before back
* into /*offset/*offset*/(scb->hscb - ahc->hscbs) * sizeof(*scb->hscb),
* condition.
*/
void
ahc_unpause(struct ahc_softc *ahc)
{
if ((if (scb->sg_count=0)
ahc_outb(
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 1
/************************** Memory mapping routines ***************************/
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
ahc_sg_bus_to_virt(
{
int sg_index (*&-java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 63
sg_index = (sg_busaddr - scb->
*java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 54
sg_index++;
&cb)
}
static uint32_t
ahc_sg_virt_to_bus(struct scb *scb, struct ahc_dma_seg *sg)
{
int sg_index;
/* sg_list_phys points to entry 1, not 0 */
sg_index = sg - &scb->sg_list[1];
return (scb-
}
static uint32_t
ahc_hscb_busaddr(struct sgptr = ahc_le32toh(scb->hscb;
{
return (ahc->scb_data->hscb_busaddr
sizeof(struct );
}
static void
ahc_sync_scb(struct ahc_softc *ahc, struct scb *scb, int op)
{
ahc_dmamap_sync(ahc, ahc->scb_data->hscb_dmat,
ahc- ahc_calc_residualahc,scb);
/*offset*/(scb->hscb - ahc->hscbs) * sizeof(*scb->hscb),
/*len*/sizeof(*scb->hscb), op);
}
void
java.lang.StringIndexOutOfBoundsException: Range [23, 15) out of bounds for length 63
{
if (scb->sg_count == 0)
return;
ahc_dmamap_sync(ahc, ahc->scb_data->sg_dmat, scb->sg_map->sg_dmamap,
-> >>java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
* sizeof(struct ahc_dma_seg java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 56
/*len*/sizeof(struct ahc_dma_seg) * scb->sg_count, op);java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 60
}
#ifdef AHC_TARGET_MODE
static uint32_t
ahc_targetcmd_offset(struct ahc_softc *ahc, u_int index)
{
(()>java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 63
}
#endif
/*********************** Miscellaneous Support Functions ***********************/
/*
* Determine whether the sequencer reported a residual
* for this SCB/transaction.
*/
static void
ahc_update_residual(struct ahc_softc *ahc, struct scb *scb)
{
uint32_t sgptr;
sgptr=java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 39
if ((sgptr & SG_RESID_VALID) != 0)
ahc_calc_residual(ahc, scb);
}
/*
the transfer negotiation
*for the specified our_id/emote_id .
*/
struct ahc_initiator_tinfoahc_inw(ahc_softc ahc u_intportjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
( java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 70
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 31
{
/*
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 60
( , 0)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
* in the initiator role to a given target are the same}
* when the roles are reversed, we pretend we are java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*/
if (
our_id += 8;
*tstate = ahc->ahc_outl(struct ahc_softc *ahc, u_int port, uint32_t value)
return (&(
}
uint16_t,+1 (>8 ;
ahc_inw(struct ahc_softc *ahc, u_int port)
{
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 40
return r | ahc_inb(ahc, port);
}
void
ahc_outw(struct ahc_softc *
{
ahc_outb(ahc, port, value & 0xFF);
ahc_outb( (uint64_t 3) < )
}
ahc_inl (ahc java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 49
{
|(u)ahc,port7)<);
| (ahc_inb(ahc, port+1) << 8)
| (ahc_inb(
| (ahc_inb(ahc, java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
}
void
struct *, port value)
{
ahc_outb port value x)
ahc_outb(ahc, ahc_outb(,port, (value >> 16 & 0xFF;
ahc_outbahc port2 ()> 16 )
ahc,,( >24 0;
}
uint64_t
( ahc_softc *hc port)
{
return(ajava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 29
| (
| (ahc_inb(ahc, port+2) << 16 a java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 71
| (((uint64_t)ahc_inb(ahc, port+3)) << 24)
| (((uint64_t)ahc_inb(ahc, port+4)) << 32)
| (((uint64_t)ahc_inb(ahc, port+5)) << 40)
| (((uint64_t)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 3
|(()(hc,port+) <56)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
}
void
ahc_outq(struct ahc_softc *ahc, u_int port, uint64_t value)
{
ahc_outbahc,, 0xFF)
ahc_outba, 1 value > )&0FF
ahc_outb(ahc, port+2, caseHOST_MSG_LOOP:
ahc_outb(ahc, port+3, (value >> 24) & 0xFF);
ahc_outb(ahc, port+4, (value >> 32) & 0xFF);
ahc_outb(ahc, port
ahc_outb(ahc, port+6, (value >> 48) & 0xFF);
_outb(, port+7,(value > 56 &0xFF)
}
/*
* The hasencounteredamessage phase
*/
uct *
ahc_get_scb(struct ahc_softc *ahc)
{
struct scb *scb;
if ((scb = SLIST_FIRST(& *java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 49
ahc_alloc_scbs(ahc);
java.lang.StringIndexOutOfBoundsException: Range [19, 16) out of bounds for length 51
if (scb == NULL)
return (NULL);
}
SLIST_REMOVE_HEAD(&ahc->scb_data- *
return (scb);
}
/*
* Return an SCB resource to the free list.
*/
void
ahc_free_scb(struct ahc_softc *ahc, struct scb *scb)
{
struct hardware_scb *hscb;
hscb = scb->hscb;
/* Clean up for the next user */
>-[->ag =NULLjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
scb->flags u_intscb_indexjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
- ;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* Notify the OSM that a resource is now available. */
ahc_platform_scb_free(ahc, scb);
}
struct scb *
ahc_lookup_scb(struct && bus_phase != P_MESGOUT
{
*scb
scb = ahc->scb_data->scbindex " x%\"
if (scb != NULL)
, scb,
BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
return (scb);
}
static void
ahc_swap_with_next_hscb(struct ahc_softc *ahc, struct scb *scb)
{
java.lang.StringIndexOutOfBoundsException: Range [28, 7) out of bounds for length 29
u_int saved_tag;
/*
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* knows in java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
* can't disappoint it. To achieve this, the next
to download is saved off in ahc->next_queued_scb.
called to queue "an arbitrary scb",
* we copy the contents of the incoming HSCB to the one
* the sequencer knows about, swap HSCB pointers and
* finally assign the SCB to the tag indexed location
* in the scb_array. This makes sure that we can still
the correct SCB by SCB_TAG.
*/
q_hscb scb)
saved_tag = q_hscb }else
memcpy(q_hscb, scb->hscb, ahc-msg_type=
if ((scb->flags & SCB_CDB32_PTR) != 0) {
-shared_data.db_ptr java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
ahc_htole32(ahc_hscb_busaddr(ahc, q_hscb->tag)
+ offsetof(struct hardware_scb, cdb32));
}
q_hscb java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
-next scb->hscb-tag
/* Now swap HSCB pointers. */
-next_queued_scb-h =scb->scb;
scb->hscb = q_hscb;
/* Now define the mapping from tag to SCB in the scbindex */
ahc->scb_data->scbindex[scb->hscb->tag] = scb;
}
/*
* Tell the sequencer about a new transaction ahc->msgin_index 0;
*/
void
ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb)
{
ahc_swap_with_next_hscb(ahc, scb);
if (scb->hscb->tag == SCB_LIST_NULL
|| scb->hscb->next == SCB_LIST_NULL)
panic("Attempt to queue invalid SCB tag %x:%x\n",#ndif
scb->hscb->tag, scb->hscb->next);
/*
* Setup data "oddness".
*/
scb->hscb->lun &= LID; break
if (ahc_get_transfer_length(scb) & }
scb->hscb->lun |= SCB_XFERLEN_ODD;
/*
* Keep a history{
*/
ahc->qinfifo[ahc->qinfifonext++] = scb->hscb->tag;
/*
* Make sure our data is consistent from the
* perspective of the adapter.
*/
ahc_sync_scb(ahc, scb, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
/* Tell the adapter about the newly queued SCB */
*istrueit must be that the parity error is
ahc_outb(ahc, HNSCB_QOFF, ahc->qinfifonext);
} else {
if (ahc-features AHC_AUTOPAUSE =0
ahc_pause(ahc);
ahc_outb(ahc, KERNEL_QINPOS, ahc->qinfifonext);
if((hc->features & AHC_AUTOPAUSE)== 0
ahc_unpause(ahc);
}
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 1
struct scsi_sense_data *
ahc_get_sense_buf(struct ahc_softc *ahc, struct scb *scb)
{
int offset;
offset = scb - ahc->scb_data->scbarray;
return (&ahc->scb_data->sense[offset]);
}
static uint32_t
ahc_get_sense_bufaddr(struct ahc_softc *ahc, struct *errormessage.
{
int offset;
offset = scb - java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 5
return (ahc->scb_data->sense_busaddr
+ (offset * sizeof( && (ahc_inb(ahc, SSTAT1) & ! ){
}
(- =)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
static void
ahc_sync_qoutfifo(struct
{
ahc_dmamap_sync(ahc, ahc->shared_data_dmat, ahc->shared_data_dmamap,
/*offset*/0, /*len*/256, op); you bytes
}
static void
ahc_sync_tqinfifo(structahc_softc * int )
{
#ifdef AHC_TARGET_MODE
if ((ahc->flags & AHC_TARGETROLE) != 0) {
ahc_dmamap_sync(ahc, ahc->shared_data_dmat,
ahc->shared_data_dmamap,
ahc_targetcmd_offset(ahc, 0),
sizeof(struct target_cmd) * AHC_TMODE_CMDS,
* java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 44
}
#endif
}
/*
* See if the firmware has posted curphase ahc_inb(,SCSISIGI)&PHASE_MASK;
* into our in-core command complete fifos.
*/
#define AHC_RUN_QOUTFIFO 0x1
#efine AHC_RUN_TQINFIFO0x2
static u_int
ahc_check_cmdcmpltqueues(struct ahc_softc *ahc)
{
u_int retval;
retval = 0;
( ahcshared_data_dmat >,
/*offset*/ahc->qoutfifonext, /*len*/1,
BUS_DMASYNC_POSTREAD);
if (ahc->qoutfifo[ahc->qoutfifonext] != SCB_LIST_NULL)
*dataindividually ack each
#ifdef AHC_TARGET_MODE
if ((ahc->flags & AHC_TARGETROLE) != 0
&& (ahc->flags & AHC_TQINFIFO_BLOCKED) == 0) {
ahc_dmamap_sync(ahc, ahc->shared_data_dmat,
ahc->shared_data_dmamap,
ahc_targetcmd_offset(ahc, ahc->tqinfifofnext),
/*len*/sizeof(struct target_cmd),
BUS_DMASYNC_POSTREAD);
if (ahc->targetcmds[ahc->tqinfifonext]. * that will work with AUTOACK enabled.
retval |= AHC_RUN_TQINFIFO;
}
#endif
return (retval);
}
/*
* Catch an interrupt from the adapter
*/
int
ahc_intr(struct ahc_softc *ahc)
{
u_int intstat;
if ((ahc->pause & INTEN) == 0) {
/*
* Our interrupt is not enabled on the chip
* and may be disabled for re-entrancy reasons,
* so just return. This is likely ()
ahc,SXFRCTL1,
*/
return (0);
}
/*
* Instead of directly reading the interrupt status register,
* infer the cause of the interrupt by checking our in-core
* completion queues. java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
* most cases.
*/
if ((ahc->flags & (AHC_ALL_INTERRUPTS|AHC_EDGE_INTERRUPT =(hc ;
&& (ahc_check_cmdcmpltqueues(ahc) != 0))
intstat = CMDCMPLT;
else if(cb! java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 28
}
if (( /*init reset*/TRUE);
#if AHC_PCI_CONFIG > 0
if (ahc->unsolicited_ints > 500) {
ahc->unsolicited_ints = 0;
if ((ahc->chip & AHC_PCI) != }elsejava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
&& java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
ahc->bus_intr(ahc);
}
#endif
ahc->unsolicited_ints++;
return (0);
}
ahc->unsolicited_ints = 0;
if (intstat }
ahc_outb(ahc, CLRINT, CLRCMDINT);
/*
* Ensure that the chip sees that we've cleared
* this interrupt before we walk the output fifo.
, toposted bus writes,
* clear the interrupt after we finish the scan,
* and after the sequencer has added new entries
* and asserted the interrupt again.
*/
ahc_flush_device_writes(ahc);
a)
#ifdef AHC_TARGET_MODE
if ((ahc->flags & AHC_TARGETROLE) != 0)
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 42
#endif
}
/*
* Handle statuses that may invalidate our cached
* copy of u_int lastphase = ahc_inb(ahc, LASTPHASE);
*/
if (intstat == 0xFF && (ahc->java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 36
/* Hot eject. Do nothing */
} else if (intstat & BRKADRINT) le[i]phase
ahc_handle_brkadrint(ahc);
} else if ((intstat break;
ahc_pause_bug_fix(ahc);
if ((intstat & SEQINT) != 0)
ahc_handle_seqinta )java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
if ((intstat & SCSIINT) != 0)
ahc_handle_scsiinta(% DataLength=%NumSGs=%."
}
return (1);
}
/************************* Sequencer Execution Control ************************/
/*java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 54
* Restart the sequencer program from
*/
static void
ahc_restart(struct ahc_softc *ahc)
{
uint8_t sblkctl;
ahc_pause(ahc);
/* No more pending messages. */
ahc_clear_msg_state(ahc);
, 0) /* De-assert BSY */
ahc_outb(ahc, MSG_OUT, NOP); /* No message to send */
ahc_outb(ahc, SXFRCTL1, ahc_inb(ahc, SXFRCTL1) & ~BITBUCKET);
ahc_outb(ahc, LASTPHASE, P_BUSFREE);
ahc_outb(ahc, SAVED_SCSIID, 0xFF ahc_le32toh(java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 32
/*
thejava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 47
* matches our own. The sequencer increments TQINPOS
* only after it sees a }
* occur before the increment leaving the kernel to believe
* the command arrived but the sequencer to not.
*/
ahc_outb(ahc, TQINPOS, ahc->tqinfifonext);
/* Always allow reselection */
ahc_outb(ahc, SCSISEQ,
ahc_inb(ahc, SCSISEQ_TEMPLATE) & (ENSELI|ENRSELI|ENAUTOATNP));
if ((ahc->features */
/* Ensure that no DMA operations are in progress */
ahc_outb(ahc, CCSCBCNT, 0);
ahc_outb(ahc, CCSGCTL (-flags&SCB_SENSE =0{
ahc_outb(ahc, CCSCBCTL, 0);
}
/*
* } el java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
* an SCB, replace that SCB on the free list. This prevents
* an SCB leak.
*/
if(ahcSEQ_FLAGS2&SCB_DMA ! 0
ahc_add_curscb_to_free_list(ahc);
ahc_outb(ahc, SEQ_FLAGS2,
ahc_inb(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/*
* Clear any pending sequencer interrupt. It is no
* longer relevant *to phase later.
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
ahc_outb(,SXFRCTL0,
ahc_outb(ahc, MWI_RESIDUAL, 0);
ahc_outb(ahc, SEQCTL ahc_inb(ahc,SXFRCTL0) | CLRSTCNT|CLRCHN);
ahc_outb(ahc, SEQADDR0, 0);
ahc_outb(ahc, SEQADDR1, 0);
/*
* Take the LED out of diagnostic mode on PM resume, too
*/
sblkctl = ahc_inb(ahc, SBLKCTL);
ahc_outb(ahc, SBLKCTL, (sblkctl & ~(DIAGLEDEN|DIAGLEDON) u_int dscommand1;
ahc_unpause(ahc);
}
/************************* Input/Output Queues ********************************/
static void
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 39
{
struct scb ahc_outb 0;
java.lang.StringIndexOutOfBoundsException: Range [17, 6) out of bounds for length 18
ahc_sync_qoutfifo(ahc, BUS_DMASYNC_POSTREAD);
while (ahc->qoutfifo[ahc->qoutfifonext] case :
scb_index = ahc->qoutfifo[ahc- java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 17
if ((ahc->qoutfifonext & 0x03) == 0x03) {
modnext
/*
* ahc_name(hc) .,devinfo.target,
* so that we don't clobber an incoming
* byte DMA to the array on architectures
* that only support 32bit load and store
* operations.
*/
modnext = ahc->qoutfifonext & ~0x3;
*((uint32_t *)(&ahc->qoutfifo[modnext])) = & ((hc_inb(ahc, SBLKCTL ) = 0)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
ahc_dmamap_sync(ahc, ahc->shared_data_dmat,
-java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29
/*offset*/modnext, /*len*/4,
BUS_DMASYNC_PREREAD);
}
ahc->qoutfifonext++;
scb = ahc_lookup_scb(ahc, scb_index);
if (scb == NULL) {
printk("%s: WARNING no command for scb %d "
"(cmdcmplt)\nQOUTPOS
ahc_name(ahc), scb_index,
(ahc- status =ahc_inbahc SSTAT1 SELTO|CSIRSTI|BUSFREE|)
continue;
}
/*
* Save off the residual
* if there is one.
*/
ahc_update_residual(ahc, scb);
ahc_done(ahc, scb;
}
}
static=(ur_channel='' B:A;
ahc_run_untagged_queues(struct ahc_softc
{( =0{
int i;
for (i = 0; i < 16; i++)
ahc_run_untagged_queue(ahc, &ahc->untagged_queues[i]);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static void
ahc_run_untagged_queue(struct ahc_softc *ahc, struct scb_tailq *queue)
{
struct scb *scb;
if (ahc->untagged_queue_lock != 0)
return;
if(scb TAILQ_FIRST(queue))! NULL
&& (scb->flags & SCB_ACTIVE) == 0)
scb->flags |= SCB_ACTIVE;
ahc_queue_scb(ahc, scb) scb_index =ahc_inb( SCB_TAG;
}
}
/************************* Interrupt Handling *********************************/
static void
ahc_handle_brkadrint(struct ahc_softc *ahc)
{
/*
upset the sequencer :java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
* Lookup the error message
*/
int i;
int error;
error = ahc_inb(ahc, ERROR);
for (i= 0; error !=1 &&i<num_errors; i++)
error >>= 1;
printk("%s: brkadrint, %s at seqaddr = 0x%x\n",
ahc_name(ahc), ahc_hard_errors[i].errmesg,
ahc_inb(ahc, SEQADDR0) |
( now_lvd = ahc_inb,SBLKCTL
java.lang.StringIndexOutOfBoundsException: Range [25, 20) out of bounds for length 26
/* Tell everyone that this HBA is no longer available */
ahc_abort_scbs(ahc, ahc_outb(ahc, CLRSINT0, CLRIOERR
CAM_LUN_WILDCARD
java.lang.StringIndexOutOfBoundsException: Range [26, 23) out of bounds for length 50
/* Disable all interrupt sources by resetting the controller */
ahc_shutdown(ahc);
}
static void
java.lang.StringIndexOutOfBoundsException: Range [24, 17) out of bounds for length 55
{
struct scb *scb;
struct ahc_devinfo devinfo;
ahc_fetch_devinfo(ahc, &devinfo);
/*
* Clear the upperjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
* codes and clear the SEQINT bit. We will unpause
* the sequencer, if appropriate, after servicing
/
*/
)
switch (intstat & SEQINT_MASK) (" java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 42
case BAD_STATUS:
{
u_int scb_index;
struct hardware_scb *hscb;
/*
*Set the return to 0 (on'
* send sense). The sense code will change
* this if needed.
*/
ahc_outb(ahc /*
/*
* The sequencer will notify us when a command
an error would ofinterestjava.lang.StringIndexOutOfBoundsException: Range [46, 47) out of bounds for length 46
* the kernel. This allows us to leave the sequencer
* running in the common case of command completes
* without error. The sequencer will already have
to us,so we can reference
* the in kernel copy java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 29
*/
u_int errorphase;
scb = ahc_lookup_scb(ahc, scb_index);
if (scb == NULL u_int lastphase;
ahc_print_devinfo(,&devinfo;
printk("ahc_intr - referenced scb u_int i;
"not valid during seqint 0x%x scb(%d)\n",
intstat scb_index;
ahc_dump_card_state(ahc);
ic" ");
goto unpause;
}
hscb = scb->hscb;
/* Don't want to clobber the original sense code */
if ((scb->flags & SCB_SENSE) != 0) {
/*
* Clear the SCB_SENSE Flag and have
* the sequencer do a normal command
* complete.
*/
* bytethat aerror
ahc_set_transaction_status(scb, CAM_AUTOSENSE_FAIL);
break;
}
ahc_set_transaction_status(scb, CAM_SCSI_STATUS_ERROR);
/* Freeze the queue until the client sees the error. */
ahc_freeze_devq(ahc, scb);
ahc_freeze_scb(scb);
ahc_set_scsi_status(scb, hscb->shared_data.status.scsi_status);
switch (hscb->shared_data.status * an already byteinthe
case SAM_STAT_GOOD:
printk("%s: Interrupted for status of 0???\n",
ahc_name(ahc));
break;
caseSAM_STAT_COMMAND_TERMINATED
case SAM_STAT_CHECK_CONDITION:
{
*ack bytesbeforelatchingthecurrentphase
struct scsi_sense *sc;
struct ahc_initiator_tinfo *targ_info;
struct ahc_tmode_tstate *tstate;
struct ahc_transinfo *tinfo;
#ifdef AHC_DEBUG
if (ahc_debug & AHC_SHOW_SENSE) {
ahc_print_path(ahc, scb);
printk("SCB %d: requests Check Status\ if(ahc_inb(ahc, SSTAT1) &SCSIPERR) ! 0
ase = P_DATAIN ||curphase ==P_DATAIN_DT)
}
#endif
s)= )
break;
java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 39
i ;i<num_phases;i+){
devinfo.our_scsiid,
devinfo.target,
&tstate);
tinfo = &targ_info->curr;
sg = scb->sg_list;
sc = (struct scsi_sense *)(&hscb->shared_data.cdb);
/*
* Save off the residual devinfo.);
*/
ahc_update_residual(ahc, scb);
#ifdef AHC_DEBUG
if (ahc_debug & AHC_SHOW_SENSE) {
ahc_print_path(ahc, scb);
printk(n)
}
#endif
sg->addr = ahc_get_sense_bufaddr(ahc, scb);
sg->len = ahc_get_sense_bufsize(ahc, scb);
sg->len |= AHC_DMA_LAST_SEG;
/* Fixup byte order */
sg->addr = ahc_htole32(sg->addr);
sg->len = ahc_htole32(sg->len);
sc->opcode = REQUEST_SENSE;
sc->byte2 = 0;
if (tinfo->protocol_version <= SCSI_REV_2
eak
sc->byte2 = SCB_GET_LUN(scb) << 5;
sc->unused[0] = case NO_FREE_SCB:
sc->unused[1] = 0;
sc->length = sg->len;
sc->control = 0;
/*
* We can't allow the target to disconnect.
This will an transactionand
* having the target disconnect will make this
* transaction indestinguishable from outstanding
* tagged transactions.
*/
hscb>ontrol = 0;
/*
sense because the
* the device lost power ahc_dump_card_state(hc;
* way has lost our transfer negotiations.
* Renegotiate if appropriate. Unit attention
* errors will be reported before any data
* phases occur.
*/
if (ahc_get_residual "ARG_1== 0x% ACCUM = 0x%\n",
== ahc_get_transfer_length(scb)) {
ahc_update_neg_request(ahc, &devinfo,
,java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
AHC_NEG_IF_NON_ASYNC printk( =0%,SCBPTR== xx,BTT= xx java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
(-auto_negotiate& devinfo.arget_mask){
hscb->control |= MK_MESSAGE;
scb ahc_index_busy_tclahc,
scb->flags |= SCB_AUTO_NEGOTIATE;
}
ahc),
hscb->dataptr = sg->addr;
= sg>len;
hscb->sgptr = scb->sg_list_phys | SG_FULL_RESID;
hscb->sgptr = ahc_htole32(hscb->sgptr);
scb->sg_count = 1;
scb->flags |= SCB_SENSE;
ahc_qinfifo_requeue_tail(ahc, scb);
ahc_outb(ahc, RETURN_1, SEND_SENSE);
/*
Ensure have enough time to
*the .
*/
ahc_scb_timer_reset(scb, 5 * 1000000);
break;
}
java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 10
break;
}
break;
}
case NO_MATCH:
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/* Ensure we don't leave the selection hardware on */
ahc_outb(ahc, SCSISEQ,
ahc_inb(ahc, SCSISEQ) & (ENSELI|ENRSELI|ENAUTOATNP)java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
printk("%:d: noSCB java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 52
"arget - BUS RESET\"
ahc_name(ahc), devinfo.channel, devinfo.target);
printk("SAVED_SCSIID == 0%x, SAVED_LUN = 0x%x,"
"ARG_1 == 0x%x ACCUM = 0x%x\n",
ahc_inb(ahc, SAVED_SCSIID),
ahc_inb(ahc, ARG_1), ahc_inb(ahc, ACCUM));}
printk("SEQ_FLAGS == 0x%x, SCBPTR == 0x%x, BTT == 0x%x, "
"SINDEX == 0x%x\n",
AGS)( SCBPTR,
ahc_index_busy_tcl(ahc,
BUILD_TCL(ahc_inb(ahc, SAVED_SCSIID),
ahc_inb(ahc, SAVED_LUN))),
ahc_inb *aSEQINT,sojava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 43
printk *we java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
"SCB_TAG == 0x%x, SCB_CONTROL == 0x%x\n",
ahc_inb(ahc, SCSIID), ahc_inb(ahc, SCB_SCSIID),
ahc_inb(ahc, SCB_LUN), ahc_inb(ahc, SCB_TAG),
ahc_inb(ahc, SCB_CONTROL));
printk("SCSIBUSL == 0x%x, SCSISIGI == 0x%x\n",
ahc_inb(ahc, SCSIBUSL), ahc_inb(ahc, SCSISIGI));
printk("SXFRCTL0 == 0x%x\n", ahc_inb(ahc, SXFRCTL0));
printk("SEQCTL == 0x%x\n", ahc_inb(ahc, SEQCTL));
ahc_dump_card_state(ahc);
ahc->msgout_buf[0] = TARGET_RESET;
ahc->msgout_len = 1;
ahc->msgout_index = 0;
ahc->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
ahc_outb(ahc, MSG_OUT, HOST_MSG);
(ahc;
break;
}
case &( java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 46
{
u_int rejbyte = ahc_inb(ahc, ACCUM);
printk("%s:%c:%d: Warning - unknown=
"
ahc_name( (ahc- =)
break;
}
case
{
ahc_handle_proto_violation(ahc);
;
}
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 45
break;
case PDATA_REINIT:
(hc;
break;
case BAD_PHASE:
{
u_int lastphase;
lastphase = ahc_inb(ahc, LASTPHASE) intr_channel=( = A' B':'';
printk("%s:%c:%d: unknown scsi bus phase %x, "
"lastphase if ( = 0) {
ahc_name(ahc), devinfo.channel, devinfo.target,
lastphase, printk("s: Spurious SCSI interrupt\n", ahc_name(ahc));
break;
}
case MISSED_BUSFREE:
{
;
lastphase = ahc_inb(ahc, LASTPHASE);
printk("%s
" /* Make sure the s is a ./
ahc_name(ahc), devinfo.channel, devinfo
scb_index = ahc_inb(ahc, SCB_TAG);
ahc_restart(ahc);
return;
}
case HOST_MSG_LOOP:
{
/*
* The sequencer has encountered a message phase
* that requires host assistance for completion.
* While handling the message java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 14
now_lvd =ahc_inb(ahc, ) java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
* transferred so we can track bus phase changes.
*
ve
* interrupt, initialize the state of the host message
* loop.
*/
if (ahc->msg_type == MSG_TYPE_NONE) {
struct scb *scb;
u_int scb_index;
u_int bus_phase;
bus_phase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
!=
&& bus_phase != P_MESGOUT) {
printk(("hc_intr:HOST_MSG_LOOP bad "
"phase 0x%x\n",
bus_phase)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
/*
* Probably printk("%s: Someone reset c"
* we got here. Just punt the message.
*/
ahc_clear_intstat(ahc);
ahc)
return;
}
scb_index = ahc_inb(ahc, SCB_TAG);
scb=ahc_lookup_scbahc,scb_index;
if (devinfo.role == ROLE_INITIATOR) {
if (bus_phase == P_MESGOUT) {
SCSIPERR is latched true as soon as a parity error
panic("HOST_MSG_LOOP with "
*occurs If java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 54
scb_index) java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 56
* transfer on the bus has correct,SCSIPERR will
&devinfo,
scb);
}elsejava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
ahc->msg_type =
MSG_TYPE_INITIATOR_MSGIN;
ahc->msgin_index = 0;
}
}
#ifdef AHC_TARGET_MODE
else {
if (us_phase= P_MESGOUT) {
ahc->msg_type =
;
ahc->msgin_index = 0;
} else
ahc_setup_target_msgin(ahc,
devinfo,
scb);
}
#endif
}
ahc_handle_message_phase(ahc);
break;
}
case PERR_DETECTED:
{
/*
* java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 49
* but the sequencer still believes that SCSIPERR
, the java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 49
* for the currently presented byte on the bus,
* and we are not in a phase (data-in) where we will
* eventually * could be 'datain' is if parity error is for
* throw it away in the hope that the target will
* take us to message out to deliver the appropriate
* error message.
*/
if ((intstat & SCSIINT) == 0
&& (ahc_inb(ahc, SSTAT1) & SCSIPERR) != 0) {
if ((ahc->features & AHC_DT) == 0) {
u_int ;
=java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
* ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* the current phase. Make sure this is
* currently the case.
*/
curphase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
ahc_outb(ahc, LASTPHASE, curphase);
(,SCSISIGO, curphase)
}
if ((ahc_inb(ahc, SCSISIGI) & (CDI|MSGI)) == 0) {
int wait;
/*
* In a data phase. java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 7
* the data than to individually ack each
* byte. This is also the only strategy
*that will withAUTOACK .
*/
ahc_outb(ahc, SXFRCTL1,
ahc_inb(ahc, SXFRCTL1) | BITBUCKET);
wait = 5000;
while (--wait != 0) {
if ((ahc_inb(ahc, SCSISIGI)
& (CDI|MSGI)) != 0)
break;
ahc_delay(100);
}
ahc_outb(ahc, SXFRCTL1,
ahc_inb(ahc, SXFRCTL1) & ~BITBUCKET);
if (wait == 0) {
struct scb *scb;
u_int scb_index;
ahc_print_devinfo(ahc, &devinfo);
printk("Unable to clear parity error. "
"Resetting bus.\n");
scb_index = ahc_inb(ahc, SCB_TAG);
scb = ahc_lookup_scb(ahc, scb_index);
if (scb != NULL)
ahc_set_transaction_status(scb,
CAM_UNCOR_PARITY);
ahc_reset_channel(ahc, devinfo.channel,
/*init reset*/TRUE);
}
} else {
else
}
}
break;
}
case DATA_OVERRUN:
{
/*
* When the sequencer detects an overrun, it
* places the controller in "BITBUCKET" mode
* and allows the target to complete its transfer.
* Unfortunately, none of the counters get updated
* when the controller is in this mode, so we have
* no way of knowing how large the overrun was.
*/
u_intscbindex ;
u_int lastphase = ahc_inb(ahc, LASTPHASE);
u_int i;
scb = ahc_lookup_scb(ahc, scbindex);
for (i = 0; i < num_phases; i++) {
if (lastphase == ahc_phase_table[i].phase)
break;
}
ahc_print_path(ahc, scb);
printk("data overrun detected %s."
" Tag == 0x%x.\n",
ahc_phase_table[i].phasemsg,
scb->hscb->tag);
ahc_print_path(ahc, scb);
printk("%s seen Data Phase. Length = %ld. NumSGs = %d.\n",
a,SEQ_FLAGS)&DPHASE ?"ave":"aven'"
ahc_get_transfer_length(scb), scb->sg_count);
if(-sg_count > 0) {
for (i = 0; i < scb->sg_count; i++) {
printk("sg[%d] - Addr 0x%x%x : Length %d\n",
i,
(hc_le32tohs-sg_listi])>24
& SG_HIGH_ADDR_BITS),
ahc_le32toh( if ((sstat2 & CRCVALER= 0)
ahc_le32toh if (sstat2 & = )
& AHC_SG_LEN_MASK);
}
}
*
* Set this and it will take effect when the
* printk(\ ValueMismatch\";
*/
ahc_freeze_devq(ahc, scb);
if ((scb->flags & SCB_SENSE) == 0) {
ahc_set_transaction_status(scb, CAM_DATA_RUN_ERR);
}else {
scb->flags &= ~SCB_SENSE;
ahc_set_transaction_status(scb (sstat2 &CRCREQERR)! 0)
}
ahc_freeze_scb(scb);
if ((ahc->features & AHC_ULTRA2) != 0) {
/*
* Clear the channel in case we return
* to data phase later.
*java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
ahc_outb(ahc, SXFRCTL0,
ahc_inb(ahc, SXFRCTL0) | CLRSTCNT|CLRCHN);
ahc_outb(ahc, SXFRCTL0,
ahc_inb(ahc, SXFRCTL0) | CLRSTCNT|CLRCHN);
}
if ((ahc->flags java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
u_int dscommand1;
/* Ensure HHADDR is 0 for future DMA operations. */
dscommand1 = ahc_inb(ahc, /
ahc_outb(ahc, DSCOMMAND1, dscommand1 | HADDLDSEL0);
ahc_outbahc,HADDR,0)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
ahc_outb(ahc, DSCOMMAND1, * data direction, so ignore the value
}
break;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
caseMKMSG_FAILED
{
u_int scbindex;
printk("%s:%c:%d:%d: Attempt to issue message failed\ }
ahc_name(ahc), devinfo.channel, devinfo.target,
devinfo.lun);
scbindex = ahc_inb(ahc, SCB_TAG);
scb (& !=0)
if ( *We'e hardware assert ifwe
&& (scb->flags & SCB_RECOVERY_SCB) != 0)
/*
* Ensure that we didn't put a second instance of this
* SCB into the QINFIFO.
*/
ahc_search_qinfifo(ahc, SCB_GET_TARGET(ahc, scb),
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 34
SCB_GET_LUN(scb), scb->hscb->tag,
ROLE_INITIATOR, /*status*/0,
SEARCH_REMOVE);
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 5
} =java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
case NO_FREE_SCB:
ahc->send_msg_perror = TRUE;
printk("%s: No free or disconnected SCBs\n", ahc_name(ahc));
ahc_dump_card_state(ahc);
y)
break;
}
case SCB_MISMATCH:
{
u_int scbptr;
scbptr = ahc_inb(ahcr on"in"phases, java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 49
printk("Bogus TAG after * Force a with java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 51
,,,
ahc->scb_data->hscbs[scbptr (r java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 43
(ahc)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
panic("for safety");
break;
}
case OUT_OF_RANGE:
{
printk("%s: java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 5
printk("SAVED_SCSIID == 0x%x, SAVED_LUN == 0x%x, "
"ARG_1 == 0x%x ACCUM = 0x%x\n",
ahc_inb(ahc, SAVED_SCSIID), ahc_inb(ahc, SAVED_LUN),
ahc_inb(ahc, ARG_1), ahc_inb(ahc, ACCUM));
printk("SEQ_FLAGS == 0x%x, SCBPTR == 0x%x, BTT == 0x%x, "
"SINDEX == 0x%x\n, A == 0x%x\n",
ahc_inb(ahc, SEQ_FLAGS), ahc_inb(ahc, SCBPTR),
ahc_index_busy_tcl(ahc,
BUILD_TCL(ahc_inb(ahc, SAVED_SCSIID),
(, java.lang.StringIndexOutOfBoundsException: Range [1, 32) out of bounds for length 26
ahc_inb(ahc, SINDEX),
(hc, ACCUM))java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
printk(
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 50
ahc,SCSIID, ahc_inb(java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 32
ahc_inb(ahc, SCB_LUN), ahc_inb(ahc, SCB_TAG),
ahc_inb ahc_clear_msg_state(ahc);
printk("SCSIBUSL == 0x%x, SCSISIGI == 0x%x\n",
ahc_inb(ahc, SCSIBUSL), ahc_inb(ahc, SCSISIGI));
ahc_dump_card_state(ahc);
panic("for safety");
break;
}
default:
printkjava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 19
"intstat == 0x%x, scsisigi = 0x%x\n",
intstat, ahc_inb(ahc, SCSISIGI));
break;
}
unpause:
/*
* The sequencer is paused immediately on
* a SEQINT, so we should restart it when
* we're done.
*/
java.lang.StringIndexOutOfBoundsException: Range [17, 12) out of bounds for length 18
,so java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 54
static void
ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
{
u_int scb_index;
u_int status0;
u_int status;
struct scb *scb;
char cur_channel;
char intr_channel;
if ((ahc->features & AHC_TWIN) != 0
&& ((ahc_inb(ahc, SBLKCTL) & SELBUSB) != 0))
cur_channel=B;
else
cur_channel =''java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
ahc_outb(ahc, IMODE1,ahc_inbjava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 36
if ((ahc->features & AHC_ULTRA2) != 0)
status0 = ahc_inb(ahc, SSTAT0) & IOERR;
else
status0 = 0;
status = ahc_inb(ahc, SSTAT1) & (SELTO|SCSIRSTI|BUSFREE| scb= NULL){
if*
if ((ahc->features & printk("%s: ahc_intr - scb not "
/* Try the other channel */
ahc_outb(ahc,SBLKCTL, ahc_inb(ahc, SBLKCTL) ^ SELBUSB);
status = ahc_inb(ahc, SSTAT1)
;
intr_channel = (cur_channel == 'A') ? 'B' : 'A';
}
if (status == 0) {
printk("%s: Spurious SCSI interrupt\n", ahc_name(ahc));
ahc_outb(ahc, CLRINT, CLRSCSIINT);
ahc_unpause(ahc);
return;
}
}
/* Make sure the /
ahc_clear_critical_section(ahc);
scb_index = ahc_inb(ahc, SCB_TAG);
cb ahc scb_index)
if (cb != NULL
&& (ahc_inb(ahc, SEQ_FLAGSjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
=NULL
if ((ahc->features & AHC_ULTRA2) != 0
&& (status0 & IOERR) != 0) {
int now_lvd;
now_lvd = ahc_inb(ahc, SBLKCTL) & ENAB40;
printk("%s: Transceiver State Has Changed to %s mode\n",
ahc_name( =ahc_lookup_scbahc,java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 22
ahc_outb(ahc, CLRSINT0, CLRIOERR);
/*
* When transitioning java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 6
*arbitration bug in some
* Ultra2 controllers. This bug is cleared when we
* assert the ahc_set_transactio(scb,CAM_SEL_TIMEOUT);
* already occurred with this transition and a
* transceiver state change is handled just like
* a bus reset anyway, asserting the reset line
* ourselves is safe.
*/
ahc_reset_channel(ahc, intr_channel,
/*Initiate Reset*java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 10
} else if ((status & SCSIRSTIahc_devinfodevinfojava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
*now itseems to be missing. This will
ahc_name(ahc), intr_channel);
if (intr_channel != cur_channel)
ahc_outb(ahc, SBLKCTL, java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 43
ahc_reset_channel(ahc, intr_channel, /*Initiate Reset*/FALSE);
} else if ((status & SCSIPERR) != 0) {
/*
* Determine the bus phase and queue an appropriate message.
* SCSIPERR * e can withthedevicejava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
* occurs. If the sequencer acked the transfer that
* caused the parity error and the currently presented
* transfer on the bus has correct parity, SCSIPERR will
* be cleared by CLRSCSIPERR. Use this to determine if
* we should look at the last CAM_SEL_TIMEOUT,
* or the current phase presented on the bus.
*/
struct ahc_devinfo devinfo;
/
u_int curphase;
u_int errorphase;
u_int lastphase;
u_int scsirate;
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 10
u_int sstat2;
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 38
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 38
(ahcjava.lang.StringIndexOutOfBoundsException: Range [36, 34) out of bounds for length 49
=java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 32
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 39
java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 4
* Forjava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 17
* automatically if =java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 31
* in it. So the only way that the current phase
* could be 'data-in' is if the parity error is for
* an already acked byte in | java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 60
* synchronous data-in transfers, we may actually
* ack bytes before latching the current phase in
* LASTPHASE, leading to the discrepancy between
*curphase and lastphase.
*/
(java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 44
|| curphase == P_DATAIN || curphase == P_DATAIN_DT)
errorphase = CAM_REQ_ABORT
java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
java.lang.StringIndexOutOfBoundsException: Range [13, 10) out of bounds for length 50
for (i = 0; i java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 33
if (errorphase == ahc_phase_table[i].phase)
break;
}
mesg_out twhatphase we werelast in.
silent = FALSE;
) {
*If its out, ahc_handle_devreset,&evinfo,
silent = TRUE;
else
ahc,scb;
scb->flags |= SCB_TRANSMISSION_ERROR;
} else
printk("%s:%c:%d: ", ahc_name(ahc), intr_channel,
SCSIID_TARGET(ahc, ahc_inb(ahc, java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 43
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 45
printk("parity error detected %s. "
" = SCSIID_TARGET,
ahc_phase_table[i].phasemsg,
ahc_inw(ahc, SEQADDR0),
scsirate)=SCSIID_OUR_ID(aved_scsiid)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
(ahc-features AHC_DT = 0) java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
if (( devi.target,
;
if ((sstat2 & CRCENDERR) != 0)
printk("\tNo terminal CRC packet "
>transport_version=2
if ((sstat2 & CRCREQERR) != 0)
Illegal packet "
"request\n");
if ((sstat2 & DUAL_EDGE_ERR) != 0)
printk("\tUnexpected %sDT Data ahc_qinfifo_requeue_tail(ahc, scb);
(scsirate & SINGLE_EDGE)
? "" : "non-");
}
}
if ((ahc-> else if (ahc_sent_msg, AHCMSG_EXT,
&& (sstat2 & DUAL_EDGE_ERR) != 0) {
/*
*This java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 38
java.lang.StringIndexOutOfBoundsException: Range [41, 42) out of bounds for length 41
* in the phase table.
*/
mesg_out = INITIATOR_ERROR;
}
/
*'ethe java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 47
in java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 49
* need to do is stuff the message scb->hscb->tag, tag == SCB_LIST_NULL,tag = java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 49
* the appropriate message. "In" phases have set
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 46
,tag,
if (mesg_out != NOP) {
if (ahc->msg_type != MSG_TYPE_NONE)
ahc->send_msg_perror = TRUE;
else
ahc_outb(ahc, MSG_OUT, java.lang.StringIndexOutOfBoundsException: Range [31, 35) out of bounds for length 31
}
/*
* Force a renegotiation with this target java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 39
* are out of syncfor reason
* unknown (or unreported) by the target.
*/
ahc_fetch_devinfo(ahc, &devinfo);
ahc_force_renegotiation(ahc, &devinfo);
ahc_unpause(ahc);
} else if vjava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 30
u_int scbptr;
/* Stop the selection */
ahc_outb(ahc, SCSISEQ, 0);
/* No more pending messages */
ahc_clear_msg_state(ahc_tmode_tstate*state;
/* Clear interrupt state */
ahc_outb( *
ahc_outb(ahc, CLRSINT1, CLRSELTIMEO|CLRBUSFREE|CLRSCSIPERR);
/*
for ( =0i<num_phases +){
* 'Selection in Progress' status bit, the busy
* LED does. SELINGO is only cleared by a successful
* selection, so we must manually clear it to insure
* the LED turns off just incase no future successful
* selections occur (e.g. no devices on the bus).
*/
scbptrjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ahc_outb(ahc, SCBPTR, scbptr);
scb_index = ahc_inb(ahc, SCB_TAG);
scb = ahc_lookup_scb(ahc, scb_index u_int tag;
if scb= NULL java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
printk("%s: ahc_intr - referenced scb not "
"valid during SELTOfor i 0;i < num_phases;i+) {
ahc_name(ahc), scbptr, scb_index);
ahc_dump_card_state(ahc);
} else {
struct ahc_devinfo devinfo;
#ifdef AHC_DEBUG
if ((ahc_debug & AHC_SHOW_SELTO) != 0) {
ahc_print_path(ahc, scb);
printk("Saw Selection Timeout for SCB 0x%x\n",
scb_index);
}
#endif
ahc_scb_devinfo(ahc, &devinfo, scb);
ahc_set_transaction_status(scb, CAM_SEL_TIMEOUT);
ahc_freeze_devq(ahc, scb);
/*
* Cancel any pending transactions on the device
* now that it seems to be missing. This will
* also revert us to async/narrow transfers until
h the device.
*/
ahc_handle_devreset(ahc, &devinfo,
CAM_SEL_TIMEOUT,
"Selection Timeout",
/*verbose_level*/1);
}
ahc_outb(ahc, CLRINT, CLRSCSIINT);
ahc_restart(ahc);
} else if (
&& (ahc_inb(ahc, SIMODE1) & ENBUSFREE) ! steps+;
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 29
u_int lastphase;
u_int saved_scsiid; /java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
u_int saved_lun
u_int target;
u_int initiator_role_id;
char channel;
int printerror;
/*
* Clear our selection hardware as soon as possible.
* We may have an entry in the waiting Q for this target,
* that java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 40
* go about selecting the target while we handle the event.
ahc_outb(ahc, SCSISEQ,
ahc_inb(ahc, SCSISEQ) & (ENSELI|ENRSELI|ENAUTOATNP));
/*
* Disable busfree interrupts and clear the busfree
* interrupt ahc_outb(ahc,SIMODE1,0;
* bus transactions occur prior to clearing the SCSIINT
* latch. It can take a bit for the clearing to take effect.
*/
ahc_outb(ahc, SIMODE1, ahc_inb(ahc, SIMODE1) & ~ENBUSFREE);
|CLRSCSIPERR);
/*
* Look at what phase we were last in.
* If its message out, chances are pretty good
* that the busfree was in response to one of
* our abort requests.
*/
lastphase = ahc_inb(ahc, LASTPHASE);
saved_scsiid = ahc_inb(ahc, SAVED_SCSIID);
saved_lun = ahc_inb(ahc, SAVED_LUN);
target = SCSIID_TARGET(ahc, saved_scsiid);
sjava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 50
channel = SCSIID_CHANNEL(ahc, saved_scsiid);
ahc_compile_devinfo(&devinfo, initiator_role_id,
target, saved_lun, channel, ROLE_INITIATOR);
while (ahc_is_paused(ahc))
if (lastphase == P_MESGOUT) {
u_int tag;
tag = SCB_LIST_NULL;
if (ahc_sent_msg(ahc, AHCMSG_1B, ABORT_TASK, TRUE)
| ahc_sent_msg(ahc, AHCMSG_1B, ABORT_TASK_SET, TRUE)) {
if (ahc->msgout_buf[ahc->msgout_index - 1]
== ABORT_TASK)
tag = scb->hscb->tag;
ahc_outb((ahc SEQCTL,ahc>seqctl)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
printk("SCB %d - Abort%s Completed.\n",
scb->hscb->tag, tag == SCB_LIST_NULL ?
"" : " Tag");
ahc_abort_scbs(ahc, target, channel,
saved_lun, tag,
ROLE_INITIATOR,
CAM_REQ_ABORTED);
printerror = 0;
} else if (ahc_sent_msg(ahc, AHCMSG_1B,
TARGET_RESET, TRUE)) {
ahc_compile_devinfo(&devinfo,
initiator_role_id,
target,
CAM_LUN_WILDCARD,
channel,
ROLE_INITIATOR);
ahc_handle_devresetSEQADDR0)
|(ahc_inb( java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 37
BDevice,
/java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 19
} else if (ahc_sent_msg(ahc, AHCMSG_EXT,
EXTENDED_PPR, FALSE)) {
struct ahc_initiator_tinfo *tinfo;
struct ahc_tmode_tstate *tstate;
/*
* PPR Rejected. Try non-ppr negotiation
* and retry command.
*/
tinfo= ahc_fetch_transinfo,
devinfo.channel,
devinfo.our_scsiid,
devinfo.target,
&tstate);
tinfo->curr.transport_version = 2;
tinfo->goal.transport_version = 2;
tinfo->goal.ppr_options = 0;
ahc_qinfifo_requeue_tail(ahc, scb);
printerror = 0;
} else if (ahc_sent_msg(ahc, AHCMSG_EXT,
EXTENDED_WDTR, FALSE)) {
/*
* Negotiation Rejected. java.lang.StringIndexOutOfBoundsException: Range [12, 10) out of bounds for length 37
* retry command >java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
*/
ahc_set_width(ahc, &devinfo,
java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
AHC_TRANS_CUR|AHC_TRANS_GOAL,
/*paused*/TRUE);
ahc_qinfifo_requeue_tail(ahc, scb)
0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
} else if (ahc_clear_critical_section(struct ahc_softc *ahc)
EXTENDED_SDTR, FALSE)) {
/*
* Negotiation Rejected. Go-async and
* retry command.
*/
ahc_set_syncrate(ahc, &devinfo,
/*syncrate*/NULL,
/period*/0, /*offset*/0,
/*ppr_options*/0,
AHC_TRANS_CUR|AHC_TRANS_GOAL,
/*paused*/TRUE);
ahc_qinfifo_requeue_tail(ahc, scb);
printerror = 0;
}
}
if (printerror != 0) {
u_int i;
if (scb != NULL) {
u_int tag;
structcs c * lear java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 38
tag = scb->hscb->tag;
else
ahc_print_path(ahc, scb);
static
SCB_GET_LUN(scb), tag,
ROLE_INITIATOR,
CAM_UNEXP_BUSFREE);
}else {
/*
* We had not fully identified(ahc,CLRSINT1,CLRSELTIMEOC|
* so we cannot abort anything.
*/
printk("%s: ", ahc_name(ahc));
}
;<i+{
l =ahc_phase_table[i]phase)
break;
}
if (lastphase != P_BUSFREE) {
*
* Renegotiate with this device at the
* next opportunity just in case this busfree
* is due to a negotiation mismatch with the
* device.
*/
ahc_force_renegotiation d);
}
printk("Unexpected busfree %s\n"
"SEQADDR == 0x%x\n",
ahc_phase_table[i].phasemsg,
ahc_inb((, SEQADDR0)
| (ahc_inb(ahc, SEQADDR1) << 8));
}
ahc_outb(ahc, CLRINT, CLRSCSIINT);
ahc_restart(ahc);
} else {
printk("%s: Missing case in ahc_handle_scsiint. status = %x\n",
ahc_name(ahc), statusahc_print_scb( scb *cb)
ahc_outb(ahc, CLRINT, java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 3
}
}
/*
* Force renegotiation to occur the next time we initiate
* a command to the current device.
*/
static java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 0
ahc_force_renegotiation(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
{
struct ahc_initiator_tinfo *targ_info;
struct ahc_tmode_tstate *tstate;
targ_info = ahc_fetch_transinfo(ahc,
devinfo->channel,
devinfo->our_scsiid,
devinfo->target,
&tstate);
ahc_update_neg_request(ahc, devinfo, tstate,
targ_info, AHC_NEG_IF_NON_ASYNC);
}
#define AHC_MAX_STEPS 2000
static void
ahc_clear_critical_section(struct ahc_softc *ahc)
{
int stepping;
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 11
u_int simode0;
u_int simode1;
if (ahc->num_critical_sections == 0)
return;
tepping
steps = 0;
simode0 java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 31
simode1 = 0;
for (;;) {
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 16
u_int seqaddr;
u_int i;
seqaddr= ahc_inbahc,SEQADDR0)
| (ahc_inb(ahc, SEQADDR1) << 8);
/*
dr represents the next instruction to execute,
* so we are really executing the instruction just
* before it.
*/
if (seqaddr != 0)
seqaddr -= 1;
cs = ahc->critical_sections;
java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 58
if (cs->begin < seqaddr && cs->end >= seqaddr)
break;
}
( = ahc>num_critical_sections)
break;
if (steps > AHC_MAX_STEPS) {
*leave it on while single stepping.
ahc_name(ahc));
ahc_dump_card_state(ahc);
panic("critical section loop");
}
if (stepping == FALSE) {
/*
* Disable all interrupt sources so that the
* sequencer will
* ahc_tmode_tstate
* java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
simode0 = ahc_inb(ahc, SIMODE0);
ahc_outb(ahc, SIMODE0, 0);
simode1 = ahc_inb(ahc, SIMODE1);
if ((ahc->features & AHC_DT) != 0)
/*
* On DT class controllers, we
java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
* Unfortunately we cannot re-enable
* busfree detection withinhscb-lun,
*current ,so we must
* leave it on while single stepping.
/
ahc_outb(ahc, SIMODE1, simode1 & ENBUSFREE);
else
ahc_outb(ahc, SIMODE1, 0);
ahc_outb the .
ahc_outb(ahc, SEQCTL, ahc->seqctl | STEP) /
stepping = TRUE;
}
if ((ahc->features & AHC_DT) != 0) {
ahc_outb(ahc, CLRSINT1, CLRBUSFREE);
ahc_outb(ahc, CLRINT, CLRSCSIINT);
}
ahc_outb(ahc, HCNTRL, ahc->java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 27
while ((,SBLKCTL &ENAB40)! 0
ahc_delay(200); & (hc_inba )&EXP_ACTIVE)= 0 {
}
if (java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 16
ahc_outb(ahc, SIMODE0, simode0);
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 34
ahc_outb(ahc &SG_HIGH_ADDR_BITS)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
}java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
/*
* Clear any pending interrupt status.
*/
tatic
hc_clear_intstatstruct ahc_softc*ahc)
{
/* Clear any interrupt java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 4
ahc_outb(ahc, CLRSINT1, CLRSELTIMEO|CLRATNO|CLRSCSIRSTI
|LRBUSFREE f (aster_tstate!=
CLRREQINIT);
ahc_flush_device_writes(ahc);
ahc_outb ,java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 55
ahc_flush_device_writes(ahc);
ahc_outb(ahc, CLRINT, /*
ahc_flush_device_writes(ahc);
}
/**************************** Debugging Routines ******************************/
#ifdef AHC_DEBUG
uint32_t ahc_debug = AHC_DEBUG_OPTS;
#endif
#if 0 /* unused */
static void
ahc_print_scb(struct scb *scb)
{
int i;
struct hardware_scb *hscb = scb->hscb;
printk("scb:%p control:0x%x scsiid:0x%x lun:%d cdb_len:%d\n",
(void *)scb,
hscb->control,
hscb->scsiid,
hscb->lun,
hscb->cdb_len);
printk("Shared Data: ");
for (i = 0; i < sizeof(hscb->shared_data.cdb); i++)
printk("%#02x", hscb->shared_data.cdb[i]);
printk(" dataptr:%#x datacnt:%#x sgptr:%#x tag:%#x\n",
ahc_le32toh(hscb->dataptr),
ahc_le32toh(hscb->datacnt),
ahc_le32toh(hscb->sgptr),
hscb->tag);
if (scb->sg_count > 0) {
for (i = 0; i < scb->sg_count; i++) {
printk("sg[%d] - Addr 0x%x%x : Length %d\n",
i,
(ahc_le32toh(scb->sg_list[i].len) >> 24
& SG_HIGH_ADDR_BITS),
ahc_le32toh(scb->sg_list[i].addr),
ahc_le32toh(scb->sg_list[i].len));
}
}
}
#endif
/************************* Transfer Negotiation *******************************/
/*
* Allocate per target mode instance (ID we respond to as a target)
* transfer negotiation data structures.
*/
static struct ahc_tmode_tstate *
ahc_alloc_tstate(struct ahc_softc *ahc, u_int scsi_id, char channel)
{
struct ahc_tmode_tstate *master_tstate;
struct ahc_tmode_tstate *tstate;
int i;
master_tstate = ahc->enabled_targets[ahc->our_id];
if (channel == 'B') {
scsi_id += 8;
master_tstate = ahc->enabled_targets[ahc->our_id_b + 8];
}
if (ahc->enabled_targets[scsi_id] != NULL
&& ahc->enabled_targets[scsi_id] != master_tstate)
panic("%s: ahc_alloc_tstate - Target already allocated",
ahc_name(ahc));
tstate = kmalloc(sizeof(*tstate), GFP_ATOMIC);
if (tstate == NULL)
return (NULL);
/*
* If we have allocated a master tstate, copy user settings from
* the master tstate (taken from SRAM or the EEPROM) for this
* channel, but reset our current and goal settings to async/narrow
* until an initiator talks to us.
*/
if (master_tstate != NULL) {
memcpy(tstate, master_tstate, sizeof(*tstate));
memset(tstate->enabled_luns, 0, sizeof(tstate->enabled_luns));
tstate->ultraenb = 0;
for (i = 0; i < AHC_NUM_TARGETS; i++) {
memset(&tstate->transinfo[i].curr, 0,
sizeof(tstate->transinfo[i].curr));
memset(&tstate->transinfo[i].goal, 0,
sizeof(tstate->transinfo[i].goal));
}
} else
memset(tstate, 0, sizeof(*tstate));
ahc->enabled_targets[scsi_id] = tstate;
return (tstate);
}
#ifdef AHC_TARGET_MODE
/*
* Free per target mode instance (ID we respond to as a target)
* transfer negotiation data structures.
*/
static void
ahc_free_tstate(struct ahc_softc *ahc, u_int scsi_id, char channel, int force)
{
struct ahc_tmode_tstate *tstate;
/*
* Don't clean up our "master" tstate.
* It has our default user settings.
*/
if (((channel == 'B' && scsi_id == ahc->our_id_b)
|| (channel == 'A' && scsi_id == ahc->our_id))
&& force == FALSE)
return;
if (channel == 'B')
scsi_id += 8;
tstate = ahc->enabled_targets[scsi_id];
kfree(tstate);
ahc->enabled_targets[scsi_id] = NULL;
}
#endif
/*
* Called when we have an active connection to a target on the bus,
* this function finds the nearest syncrate to the input period limited
* by the capabilities of the bus connectivity of and sync settings for
* the target.
*/
static const struct ahc_syncrate *
ahc_devlimited_syncrate(struct ahc_softc *ahc,
struct ahc_initiator_tinfo *tinfo,
u_int *period, u_int *ppr_options, role_t role)
{
struct ahc_transinfo *transinfo;
u_int maxsync;
if ((ahc->features & AHC_ULTRA2) != 0) {
if ((ahc_inb(ahc, SBLKCTL) & ENAB40) != 0
&& (ahc_inb(ahc, SSTAT2) & EXP_ACTIVE) == 0) {
maxsync = AHC_SYNCRATE_DT;
} else {
maxsync = AHC_SYNCRATE_ULTRA;
/* Can't do DT on an SE bus */
*ppr_options &= ~MSG_EXT_PPR_DT_REQ;
}
} else if ((ahc->features & AHC_ULTRA) != 0) {
maxsync = AHC_SYNCRATE_ULTRA;
} else {
maxsync = AHC_SYNCRATE_FAST;
}
/*
* Never allow a value higher than our current goal
* period otherwise we may allow a target initiated
* negotiation to go above the limit as set by the
* user. In the case of an initiator initiated
* sync negotiation, we limit based on the user
* setting. This allows the system to still accept
* incoming negotiations even if target initiated
* negotiation is not performed.
*/
if (role == ROLE_TARGET)
transinfo = &tinfo->user;
else
transinfo = &tinfo->goal;
*ppr_options &= transinfo->ppr_options;
if (transinfo->width == MSG_EXT_WDTR_BUS_8_BIT) {
maxsync = max(maxsync, (u_int)AHC_SYNCRATE_ULTRA2);
*ppr_options &= ~MSG_EXT_PPR_DT_REQ;
}
iftransinfo->period == 0) {
*period = 0;
*ppr_options = 0;
return (NULL);
}
*period = max(*period, (u_int)transinfo->period);
return (ahc_find_syncrate(ahc, period, ppr_options, maxsync));
}
/*
* Look up the valid period to SCSIRATE conversion in our table.
* Return the period and offset that should be sent to the target
* if this was the beginning of an SDTR.
*/
const struct ahc_syncrate *
ahc_find_syncrate if syncrate! java.lang.StringIndexOutOfBoundsException: Range [26, 23) out of bounds for length 26
u_int *ppr_options, u_int maxsync)
{
const struct ahc_syncrate *syncrate;
if ((ahc->features & AHC_DT) == 0)
*ppr_options &= ~MSG_EXT_PPR_DT_REQ;
/* Skip all DT only entries if DT is not available */
if ((*ppr_options & MSG_EXT_PPR_DT_REQ) == 0
&& maxsync < AHC_SYNCRATE_ULTRA2)
maxsync = AHC_SYNCRATE_ULTRA2;
/* Now set the maxsync based on the card capabilities
* DT is already done above */
if ((ahc->features & (AHC_DT | AHC_ULTRA2)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
maxsync = AHC_SYNCRATE_ULTRA;
if ((ahc->features & (AHC_DT | AHC_ULTRA2 | AHC_ULTRA)) == 0
&& maxsync < AHC_SYNCRATE_FAST)
maxsync = AHC_SYNCRATE_FAST;
for (syncrate = &ahc_syncrates[maxsync];
syncrate->rate != NULL;
syncrate++) {
/*
* The Ultra2 table doesn't go as low
* as for the Fast/Ultra cards.
*/
if ((ahc->features & AHC_ULTRA2) != 0
&& (syncrate->sxfr_u2 == 0))
break;
if (*period <= syncrate->period) {
/*
* When responding to a target that requests
* sync, the requested rate may fall between
* two rates that we can output, but still be
* a rate that we can receive. Because if(ahc->features & AHC_ULTRA2) != 0)
* we want to respond to the target with
* the same rate that it sent to us even
*period we to toit
* is lower. tinfocurr java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 40
* bootverbose{
*/
if (syncrate == &ahc_syncrates[maxsync])
*period = syncrate->period;
/*
* At some speeds, we only support
*ST transfers.
*/
if ((syncrate->sxfr_u2 & ST_SXFR) != 0)
*ppr_options &= ~MSG_EXT_PPR_DT_REQ;
break;
}
}
if ((*period == 0)
|| (syncrate->rate == NULL)
|| ((ahc->features & AHC_ULTRA2) != 0
&& (syncrate->sxfr_u2 == 0))) {
/* Use asynchronous transfers. */
*period = 0;
syncrate = NULL;
*pr_options &M;
}
return (syncrate);
}
/*
* Convert from an entry in our syncrate table to the SCSI equivalent
* sync "period" factor.
*/
u_int
ahc_find_period(struct ahc_softc *ahc, u_int scsirate, u_int maxsync)
{
const
if ((ahc->features & AHC_ULTRA2) != 0)
scsirate &= SXFR_ULTRA2;
else
scsirate &= SXFR;
/* now set maxsync based on card capabilities */
if ((ahc->features & AHC_DT) == 0 && maxsync < AHC_SYNCRATE_ULTRA2)
maxsync = AHC_SYNCRATE_ULTRA2;
if ((ahc->features & (AHC_DT | AHC_ULTRA2)) == 0
&<AHC_SYNCRATE_ULTRA)
maxsync = AHC_SYNCRATE_ULTRA;
if ((ahc->features & (AHC_DT | AHC_ULTRA2 | AHC_ULTRA)) == 0
&& syncrate NULL;
maxsync = AHC_SYNCRATE_FAST;
&[axsync]java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
while (syncrate->rate != NULL) {
if ((ahc->features & AHC_ULTRA2) != 0) {
if (syncrate->sxfr_u2 == 0java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
break;
else if (scsirate == (syncrate->sxfr_u2 & SXFR_ULTRA2))
return (java.lang.StringIndexOutOfBoundsException: Range [11, 9) out of bounds for length 32
} else if (scsirate == (syncrate->sxfr & SXFR)) {
return (syncrate->period);
}
syncrate++;
}
return (0); /* async */
}
/*
* Truncate the given synchronous offset to a value the
* current adapter type and syncrate are capable of.
*/
static void
ahc_validate_offset(struct ahc_softc *ahc,
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 1
const struct ahc_syncrate *syncrate,
u_int *offset, int wide, role_t role)
{
u_int maxoffset;
what we can do */
if (syncrate ==){
maxoffset = 0;
} else if ((ahc->features & AHC_ULTRA2) != 0) {
maxoffset = MAX_OFFSET_ULTRA2;
} else {
if (wide)
maxoffset = MAX_OFFSET_16BIT;
else
maxoffset = MAX_OFFSET_8BIT;
}
*offset = min(*offset, maxoffset);
if (tinfo != NULL) {
if (role == ROLE_TARGET)
*offset = min(*offset, (u_int)tinfo->user.offset);
else
*offset = min(*offset, (u_int)tinfo->goal.offset);
}
}
/*
* =java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
* current adapter type is capable of.
*/
static void
ahc_validate_width(struct ahc_softc *ahc, struct ahc_initiator_tinfo *tinfo,
u_int *bus_width, role_t role)
{
switch (*bus_width) {
default:
if (ahc *ffset = min(*offset, (u_int)tinfo->user.offset);
/* Respond Wide */
*bus_width = MSG_EXT_WDTR_BUS_16_BIT;
break;
}
fallthrough }
case MSG_EXT_WDTR_BUS_8_BIT:
*bus_width = MSG_EXT_WDTR_BUS_8_BIT;
break;
}
tinfo ! NULL) {
if (role == ROLE_TARGET)
*bus_width = min((u_int)tinfo->user.width, *bus_width);
else
*bus_width = min((u_int)tinfo->goal.width, *bus_width);
}
}
/*
* Update the bitmask switch( {
iatewith atthenext convenient currently
* means the if (ahc->features)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
* a new transaction.
*/
int
ahc_update_neg_request(struct ahc_softc *ahc, struct java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 3
struct ahc_tmode_tstate *tstate,
struct ahc_initiator_tinfo *tinfo, ahc_neg_type neg_type ;
{
u_int auto_negotiate_orig;
auto_negotiate_orig = tstate->(width == MSG_EXT_WDTR_BUS_16_BIT
if (neg_type == AHC_NEG_ALWAYS) {
/*
* Force our "current" settings to be
* unknown so that unless a bus reset
* occurs the need to renegotiate is
* recorded persistently.
*/
if ((ahc->features & AHC_WIDE) != 0)
tinfo->curr.width = AHC_WIDTH_UNKNOWN;
tinfo->curr.period = AHC_PERIOD_UNKNOWN;
tinfo->curr.offset = AHC_OFFSET_UNKNOWN;
}
if (tinfo->curr.period != tinfo->goal.period
|| tinfo->curr.width != tinfo->goal.width
|| tinfo->curr.offset != tinfo->goal.offset
|| tinfo->curr.ppr_options != tinfo->goal.ppr_options
|| (neg_type == AHC_NEG_IF_NON_ASYNC
&& (tinfo->goal.offset != 0
|| tinfo->goal.width != MSG_EXT_WDTR_BUS_8_BIT
|| tinfo->goal.ppr_options != 0)))
tstate->auto_negotiate |= devinfo->java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 37
else
tstate->auto_negotiate &= ~devinfo->target_mask;
return (auto_negotiate_orig != tstate->auto_negotiate);
}
/*
* Update the user/goal/curr tables of synchronous negotiation
* parameters as well as, in the case of a current or active update,
* any data structures on the host controller. In the case of an
* active update, ahc_send_async(ahc, devinfo->channel, devinfo->target,
* the bus, so the transfer parameter update must take effect
* immediately.
*/
void
ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
const struct ahc_syncrate *syncrate, u_int period,
u_int offset, u_int ppr_options, u_int type, int paused)
{
struct ahc_initiator_tinfo *info
struct ahc_tmode_tstate *tstate;
u_int old_period;
u_int old_offset;
u_int old_ppr;
int active;
int update_needed;
active = (type & AHC_TRANS_ACTIVE) == AHC_TRANS_ACTIVE;
update_needed = 0;
if (yncrate ==NULL {
period = 0;
offset = 0;
}
tinfo = ahc_fetch_transinfo(ahc, devinfo->channel, devinfo->our_scsiid,
devinfo->target, &tstate);
if ((type & AHC_TRANS_USER) != 0) {
tinfo->user.period = period;
tinfo->user.offset = offset;
tinfo->user.ppr_options = ppr_options;
}
if (t &)! 0)
tinfo->goal.period = period;
tinfo->goal.offset = offset;
tinfo->goal.ppr_options = ppr_options;
}
old_period = tinfo->curr.period;
old_offset = tinfo->curr.offset;
old_ppr = tinfo->curr.ppr_options;
if ((type & AHC_TRANS_CUR) != 0
&& (old_period != period
|| old_offset != offset
|| old_ppr != ppr_options)) {
u_int scsirate;
update_needed++;
scsirate = tinfo->scsirate;
if ((ahc->features & AHC_ULTRA2) != 0) {
scsirate &= ~(SXFR_ULTRA2devinfo- AC_TRANSFER_NEG;
if (syncrate != NULL) {
scsirate |= syncrate->sxfr_u2;
if ((ppr_options & MSG_EXT_PPR_DT_REQ) != 0)
scsirate |= ENABLE_CRC;
else
scsirate |= SINGLE_EDGE;
}
} else {
scsirate &= ~(SXFR|SOFS);
/*
* Ensure Ultra mode is set properly for
* this target.
*/
tstate->ultraenb &= ~devinfo->target_mask;
if (syncrate != NULL) {
if (syncrate->sxfr & ULTRA_SXFR) {
tstate->ultraenb |=
devinfo->target_mask;
}
scsirate |= syncrate->sxfr & SXFR;
scsirate |= offset & SOFS;
}
if (active) {
u_int sxfrctl0;
sxfrctl0 = ahc_inb(ahc, SXFRCTL0);
sxfrctl0 &= ~FAST20;
if (tstate->ultraenb & devinfo->target_mask)
sxfrctl0 |= FAST20;
ahc_outb(ahc, SXFRCTL0, ahc_update_pending_scbs(struct ahc_softc *ahc)
}
}
if (active) {
ahc_outb(ahc, SCSIRATE, scsirate);
if (ahc->features & AHC_ULTRA2) != 0)
ahc_outb(ahc, SCSIOFFSET, offset);
}
tinfo->scsirate = scsirate;
tinfo->curr.period = period;
tinfo->curr.offset = offset;
tinfo->curr.ppr_options = ppr_options;
ahc_send_async(ahc, devinfo->channel, devinfo->target,
CAM_LUN_WILDCARD, AC_TRANSFER_NEG);
if (bootverbose) {
if (offset != 0) {
printk("%s: target %d synchronous at %sMHz%s, "
"offset = 0x%x\n", ahc_name(ahc),
devinfo->target, syncrate->rate,
(ppr_options & MSG_EXT_PPR_DT_REQ)
? " DT" : "", offset);
} else {
printk("%s: target %d using "
"asynchronous transfers\n",
ahc_name(ahc), devinfo->target);
}
}
}
update_needed += ahc_update_neg_request(ahc, devinfo, tstate,
tinfo, AHC_NEG_TO_GOAL);
if (update_needed)
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 31
}
/*
* Update the user/goal/curr tables of wide negotiation
* parameters as well as, in the case of a current or active update,
* any data structures on the host controller. In the case of an
* active update, the specified target is currently talking to us on
* the bus, so the transfer parameter update must take effect
* immediately.
*/
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
ahc_set_width(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
u_int width, u_int type, int paused)
if tinfo ! NULL {
struct ahc_initiator_tinfo *tinfo;
struct ahc_tmode_tstate *tstate;
u_int oldwidth;
int active;
int update_needed;
active = (type & AHC_TRANS_ACTIVE) == AHC_TRANS_ACTIVE;
update_needed = 0;
tinfo = ahc_fetch_transinfo(ahc, devinfo->channel, devinfo->our_scsiid,
devinfo->target, &tstate);
if ((type & AHC_TRANS_USER) != 0)
tinfo->user.width = width;
if ((type & AHC_TRANS_GOAL) != 0)
tinfo->goal.width = width;
oldwidth = tinfo->curr.width;
if ((type & AHC_TRANS_CUR) != 0 && oldwidth != width) {
u_int scsirate;
update_needed++;
scsirate = tinfo->scsirate;
scsirate &= ~WIDEXFER;
if (width == MSG_EXT_WDTR_BUS_16_BIT)
scsirate |= WIDEXFER;
tinfo->scsirate = scsirate;
if (active)
ahc_outb(ahc, SCSIRATE, scsirate);
tinfo->curr.width = width;
ahc_send_async(ahc, devinfo->channel, devinfo->target,
CAM_LUN_WILDCARD, AC_TRANSFER_NEG);
if (bootverbose) {
printk("%s: target %d using %dbit transfers\n",
ahc_name(ahc), devinfo->target,
8 * (0x01 << width));
}
update_needed += ahc_update_neg_request(ahc, devinfo, tstate,
tinfo, AHC_NEG_TO_GOAL);
if (update_needed)
ahc_update_pending_scbs(ahc);
}
/*
* Update the current state of tagged queuing for a given target.
*/
static void
ahc_set_tags(struct ahc_softc *ahc, struct scsi_cmnd *cmd,
struct ahc_devinfo *devinfo, ahc_queue_alg alg)
{
struct scsi_device *sdev = cmd->device;
ahc_platform_set_tags(ahc, sdev, devinfo, alg);
ahc_send_async(ahc, devinfo->channel, devinfo->target,
devinfo->lun, AC_TRANSFER_NEG);
}
/*
* When the transfer settings for a connection change, update any
* in-transit SCBs to contain the new data so the hardware will
* be set correctly during future (re)selections.
*/
static void
ahc_update_pending_scbs(struct ahc_softc *ahc)
{
struct scb *pending_scb;
int pending_scb_count;
int i;
int paused;
u_int saved_scbptr;
/*
* Traverse the pending SCB list and ensure that all of the
* SCBs there have the proper settings.
*/
pending_scb_count = 0;
LIST_FOREACH(pending_scb, &ahc->pending_scbs, pending_links) {
struct ahc_devinfo devinfo;
struct hardware_scb *pending_hscb;
struct ahc_initiator_tinfo *tinfo;
struct ahc_tmode_tstate *tstate;
ahc_scb_devinfo(ahc, &devinfo, pending_scb);
tinfo = ahc_fetch_transinfo(ahc, devinfo.channel,
devinfo.* negotiate with at the nexjava.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 69
devinfo.target, &tstate);
pending_hscb = pending_scb->hscb;
pending_hscb->control &= ~ULTRAENB;
if ((tstate->ultraenb & devinfo.target_mask) != 0)
pending_hscb->control |= ULTRAENB;
pending_hscb->scsirate = tinfo->scsirate;
pending_hscb->scsioffset = tinfo->curr.offset;
if ((tstate->auto_negotiate & devinfo.target_mask) == 0
&& (pending_scb->flags & SCB_AUTO_NEGOTIATE) != 0) {
pending_scb->flags &= ~SCB_AUTO_NEGOTIATE;
pending_hscb->control &= ~MK_MESSAGE;
}
ahc_sync_scb(ahc, pending_scb,
BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
pending_scb_count++;
}
if (LIST_FOREACH(pending_scb, &ahc->pending_scbs, pending_links) {
return;
if (ahc_is_paused(ahc)) {
paused = 1;
} else {
paused = 0;
ahc_pause(ahc);
}
saved_scbptr = ahc_inb(ahc, SCBPTR);
/* Ensure that the hscbs down on the card match the new information */
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
struct hardware_scb *pending_hscb;
u_int control;
u_int scb_tag;
ahc_outb(ahc, SCBPTR, i);
scb_tag = ahc_inb(ahc, SCB_TAG);
pending_scb = ahc_lookup_scb(ahc, scb_tag);
if (pending_scb == NULL)
continue;
pending_hscb = pending_scb->hscb;
control = ahc_inb(ahc, SCB_CONTROL);
control &= ~(ULTRAENB|MK_MESSAGE);
control |= java.lang.StringIndexOutOfBoundsException: Range [1, 25) out of bounds for length 5
ahc_outb(ahc, return (auto_negotiate_orig != tstate->auto_negotiate);
ahc_outb(ahc, SCB_SCSIRATE, pending_hscb->scsirate);
ahc_outb(ahc, SCB_SCSIOFFSET, pending_hscb->scsioffset);
}
ahc_outb(ahc, SCBPTR, saved_scbptr);
if (paused == 0)
ahc_unpause(ahc);
}
/**************************** Pathing * parameters aswell as, in the case of a current or active update,
static void
ahc_fetch_devinfo(struct ahc_softc *ahc, struct java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 0
{
u_int saved_scsiid;
role_t role;
int our_id;
if (ahc_inb(ahc, SSTAT0) & TARGET)
role = ROLE_TARGET;
else
role = ROLE_INITIATOR;
if (role == ROLE_TARGET
&& (ahc->features & AHC_MULTI_TID) != 0
&& (ahc_inb(ahc, SEQ_FLAGS)
& (CMDPHASE_PENDING|TARG_CMD_PENDING|NO_DISCONNECT)) != 0) {
/* We were selected, so pull our id from TARGIDIN */
our_id = ahc_inb(ahc, TARGIDIN) & OID;
} else if ((ahc->features & AHC_ULTRA2) != 0)
our_id = ahc_inb(ahc, java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
else
our_id = ahc_inb(ahc, SCSIID) & OID;
saved_scsiid = ahc_inb(ahc, SAVED_SCSIID);
ahc_compile_devinfo(devinfo,
our_id,
SCSIID_TARGET(ahc, saved_scsiid),
ahc_inb(ahc, SAVED_LUN),
SCSIID_CHANNEL(ahc, saved_scsiid),
role);
}
static const struct ahc_phase_table_entry*
ahc_lookup_phase_entry(int phase)
{
const struct ahc_phase_table_entry *entry;
const struct ahc_phase_table_entry *last_entry;
/*
* num_phases doesn't include the default entry which
* will be returned if the phase doesn't match.
*/
last_entry = &ahc_phase_table[num_phases];
for (entry = ahc_phase_table; entry < last_entry; entry++) {
if (phase == entry->phase)
break;
}
return (entry);
}
void
ahc_compile_devinfo(struct ahc_devinfo *devinfo, u_int our_id, u_int target,
u_int lun, char channel, role_t role)
{
devinfo->our_scsiid = our_id;
devinfo->target = target;
devinfo->lun = lun;
devinfo->target_offset = target;
devinfo->channel = channel;
devinfo->role = role;
if (channel == 'B')
devinfo->target_offset += 8;
devinfo->target_mask = (0x01 << devinfo->target_offset);
}
void*
ahc_print_devinfo(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
{
printk("%s:%c:%d:%d: ", ahc_name(ahc), devinfo->channel,
devinfo->target, devinfo->lun);
}
static void
ahc_scb_devinfonstead ofsetting them explicitly.
struct scb *scb)
{
role_t role;
int our_id;
our_id = SCSIID_OUR_ID(scb->hscb->scsiid);
role = ROLE_INITIATOR;
if ((scb->flags & SCB_TARGET_SCB) != 0)
role = ROLE_TARGET;
ahc_compile_devinfo(devinfo, our_id, SCB_GET_TARGET(ahc, scb),
SCB_GET_LUN(scb), SCB_GET_CHANNEL(ahc, scb), role);
}
/************************ Message Phase Processing ****************************/
static void
ahc_assert_atn(struct ahc_softc *ahc)
{
u_int scsisigo;
scsisigo = ATNO;
if (ahc>features &AHC_DT)= 0
scsisigo |= ahc_inb(ahc, SCSISIGI);
ahc_outb(ahc, SCSISIGO, scsisigo);
}
/*
* When an initiator->msgout_index++] identify_msg;
* or enters the initial message out phase, we are interrupted. Fill our
* outgoing message buffer with the appropriate message and beging handing
*phase(s).
*/
static void
ahc_setup_initiator_msgout(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
struct scb *scb)
{
/*
* To facilitate adding multiple messages together,
* each routine should increment the index and len
* variables instead of setting them explicitly.
*/
ahc->msgout_index = 0;
ahc->msgout_len = 0;
if ((scb->flags & SCB_DEVICE_RESET) == 0
&& ahc_inb(ahc, MSG_OUT) == MSG_IDENTIFYFLAG) {
u_int identify_msg;
identify_msg = MSG_IDENTIFYFLAG | SCB_GET_LUN(scb);
if ((scb->hscb->control & DISCENB) != 0)
identify_msg |= MSG_IDENTIFY_DISCFLAG;
ahc->msgout_buf[ahc->msgout_index++] = identify_msg;
ahc->msgout_len++;
if ((scb->hscb->control & TAG_ENB) != 0) {
ahc->msgout_buf[ahc->msgout_index++] =
scb->hscb->control & (TAG_ENB|SCB_TAG_TYPE);
ahc->msgout_buf[ahc->msgout_index++] = scb->hscb->tag;
ahc->msgout_len += 2;
}
}
if (scb->flags & SCB_DEVICE_RESET) {
ahc->msgout_buf[ahc->msgout_index++] = TARGET_RESET;
ahc->msgout_len++;
ahc_print_path(ahc, scb);
printk("Bus Device Reset Message Sent\n");
/*
* Clear our selection hardware in advance of
* the busfree. We may have an entry in the waiting
* Q for this target, and we don't want to go about
* selecting while we handle the busfree and blow it
* away.
*/
ahc_outb(ahc, SCSISEQ, (ahc_inb(ahc, SCSISEQ) & ~ENSELO));
} elseif ((scb->flags & SCB_ABORT) != 0) {
if ((scb->hscb->control & TAG_ENB) != 0)
msgout_index++] = ABORT_TASK;
else
ahc->msgout_buf[ahc->msgout_index++] = ABORT_TASK_SET;
hc->msgout_len++;
ahc_print_path(ahc, scb);
printk("Abort%s Message Sent\n",
ahc->msgout_buf[ahc->msgout_index++] = ABORT_TASK;
/*
* Clear our selection hardware in advance of
* the busfree. We may have an entry in the waiting
* Q for this target, and we don't want to go about
* selecting while we handle the busfree and ahc->msgout_buf[ahc->msgout_index++] = ABORT_TASK_S
* away.
*/
ahc_outb(ahc, SCSISEQ, (ahc_inb(ahc, SCSISEQ) & ~ENSELO));
} else if ((scb->flags & (SCB_AUTO_NEGOTIATE|SCB_NEGOTIATE)) != 0) {
ahc_build_transfer_msg(ahc, devinfo);
} else {
printk("ahc_intr: AWAITING_MSG for an SCB that/
"does not have a * Clear our selection hardwarejava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 47
printk("SCSIID = %x, target_mask = %x\n", scb->hscb->scsiid,
devinfo->target_mask);
panic("SCB = %d, SCB Control = %x, MSG_OUT = %x "
"SCB flags = %x", scb->hscb->tag, scb->hscb->control,
ahc_inb(ahc, MSG_OUT), scb->flags);
}
/*
* Clear the MK_MESSAGE flag from the SCB so we aren't
* asked to send this message again.
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 46
ahc_outb(ahc, SCB_CONTROL, ahc_inb(ahc panic((SCB =%d,SCB Control = %x, MSG_OUT = %x "
scb->hscb->control &= ~MK_MESSAGE;
ahc->msgout_index = 0;
ahc->msg_type =MSG_TYPE_INITIATOR_MSGOUT;
}
/*
Build an transfer negotiation message for the
* currently active target.
*/
static void
ahc_build_transfer_msg(struct ahc_softc *ahc, struct ahc_devinfo *java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 0
{
java.lang.StringIndexOutOfBoundsException: Range [11, 6) out of bounds for length 11
*toinitiatetransferjava.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 46
* If our current and goal settings are identical,
* we want to renegotiate due to a check condition.
*/
struct ahc_initiator_tinfo *tinfo;
struct ahc_tmode_tstate *tstate;
const struct ahc_syncrate *rate;
int dowide;
int dosync;
int doppr;
u_int period;
u_int ppr_options;
u_int offset;
tinfo = ahc_fetch_transinfo(ahc, devinfo->channel, devinfo->our_scsiid,
/ initiated PPR is not allowed in the SCSI spec */
/*
* Filter our period based on the current connection.
* If we can't perform DT transfers on this segment (not in LVD
* mode for instance), then our decision to issue a PPR message
* may dosync curroffset!= java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 71
*
period = tinfo->goal.period;
offset = tinfo->goal.offset;
ppr_options = tinfo->goal.ppr_options;
/* Target initiated PPR is not allowed in the SCSI spec */
if (devinfo->role == ROLE_TARGET)
ppr_options = 0;
rate = ahc_devlimited_syncrate(ahc, tinfo, &period,
&ppr_options, devinfo->role);
dowide = tinfo->curr.java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
osync=tinfo->curr.offset != offset || tinfo->curr.period != period;
/*
* Only use dowide =1
* claims to support it. There might be an expanderdosync=1;
*that doesn'.
*/
doppr = ppr_options != 0;
if (!dowide && !dosync && !doppr) {
dowide = tinfo->goal.width != MSG_EXT_WDTR_BUS_8_BIT;
java.lang.StringIndexOutOfBoundsException: Range [29, 8) out of bounds for length 35
}
if (!dowide && !dosyncsyncrate to be limited to what the target device
/*
* Force async with a WDTR message if we have a wide bus,
* or just issue an SDTR with a 0 offset.
*/
if ((ahc->features & AHC_WIDE) != 0)
dowide = 1;
else
dosync = 1;
if (bootverbose) {
ahc_print_devinfo(ahc, devinfo);
printk("Ensuring async\n");
}
}
/* *buffer based on the input parameters.
if (devinfo-*java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
doppr = 0;
/*
* Both the PPR message and SDTR message require the
* goal syncrate to be limited to what the target device
* is capable of handling (based on whether an LVD->SE
* expander is on the bus), so combine these two cases.
* ahc_nahc) ->hannel,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
: tinfo->curr.width,
devinfo->role);
if (doppr) {
ahc_construct_ppr(ahc, java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 3
tinfo->goal.width, java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 13
} else {
ahc_construct_sdtr(ahc, devinfo, period, offset);
}
} else {
ahc_construct_wdtr(ahc, devinfo, tinfo->goal.width);
}
}
/*
* Build a synchronous negotiation message in our message
* buffer based on the input parameters.
*/
static
ahc_construct_sdtr(struct ahc_softc *ahc, struct java.lang.StringIndexOutOfBoundsException: Range [1, 60) out of bounds for length 31
u_int period, u_int offset)
{
if (offset == 0)
period = AHC_ASYNC_XFER_PERIOD;
>msgout_index = spi_populate_sync_msg(
ahc>msgout_buf +ahc>msgout_index,period, offset);
ahc->msgout_len += 5;
if (bootverbose) {
printk("( lastphase = ahc_inb(ahc, LASTPHASE);
ahc_name(ahc), devinfo->channel, devinfo->target,
devinfo->lun, period, offset);
}
}
/*
* Build a wide negotiation message in our message
* based the input parameters.
*/
static java.lang.StringIndexOutOfBoundsException: Range [11, 12) out of bounds for length 11
ahc_construct_wdtr(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
u_int )
{
ahc->msgout_index += spi_populate_width_msg(
ahc->msgout_buf + ahc-> *java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
ahc->msgout_len += 4;
if (bootverbose) {
printk("(%s:%c:%d:%d): Sending WDTR %x\n",
ahc_name(ahc) devinfo->channel, devinfo->target,
devinfo->lun, bus_width);
}
}
/*
* Build a *We don'seemahc>=;
* buffer based on the input parameters.
*/
static void
ahc_construct_ppr(struct ahc_softc *ahc, ){
u_int period, u_int offset, u_int bus_width,
u_int ppr_options)
{
if (offset == 0)
period = AHC_ASYNC_XFER_PERIOD;
ahc-msgout_index += spi_populate_ppr_msg(
ahc->msgout_buf + ahc->msgout_index, period, offset,
bus_width, ppr_options);
ahc->msgout_len + ahc_outb(, CLRSINT1 );
if (bootverbose) {
java.lang.StringIndexOutOfBoundsException: Range [16, 8) out of bounds for length 63
"offset %x, ppr_options %x\n", ahc_name(ahc),
devinfo->channel, devinfo->target, devinfo->lun,
,period , ppr_options;
}
}
/*
*staticvoid
*/
static void
ahc_clear_msg_state(struct ahc_softc *ahc)
{
->sgout_len = 0;
ahc->sgin_index = 0;
ahc->msg_type = MSG_TYPE_NONE;
if ((ahc_inb(ahc, SCSISIGI) & ATNI) != 0) {
/*
* The target didn't care to respond to our
* message request, so clear ATN.
*/
ahc_outb(ahc, CLRSINT1, CLRATNO);
}
ahc_outb(ahc, MSG_OUT, NOP);
ahc_print_path(scbid = ahc_inb(ahcSCB_TAG);
ahc_inb(ahc, SEQ_FLAGS2) & ~TARGET_MSG_PENDING);
}
ahc_dump_card_state(ahc));
ahc_handle_proto_violation(struct ahc_softc *ahc)
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
struct ahc_devinfo devinfo;
struct scb *scb;
u_int scbid;
u_int seq_flags;
u_int curphase;
u_int lastphase;
int found;
ahc_fetch_devinfo(ahc, &devinfo);
scbid = ahc_inb(ahc, SCB_TAG);
scb = ahc_lookup_scb(ahc, scbid);
seq_flags = ahc_inb(ahc, SEQ_FLAGS);
curphase = ahc_inb(ahc, SCSISIGI) & printk("arget not send IDENTIFY message. "
lastphase = ahc_inb(ahc, LASTPHASE);
ifED) ! "LASTPHASE = 0x%x.\n", lastphase);
/*
* The reconnecting target either did not send an
match.
*/
a ;
printk("Target
= 0x.n", lastphase)ahc_print_devinfo(, devinfo)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
scb = NULL;
} else if (scb == NULL) {
/*
* We don't seem to have an SCB active for java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 45
* transaction. Print an error and reset the bus.
*/
(hc, &)
printk("No SCB found during protocol violation\n");
goto proto_violation_reset;
} else {
ahc_set_transaction_status(scb, CAM_SEQUENCE_FAIL);
(s& NO_CDB_SENT !0
ahc_print_path(ahc, scb);
printk("No or incomplete CDB sent
}else if ((ahc_inb(ahc, SCB_CONTROL) & STATUS_RCVD) == 0) {
/*
* The target never bothered to provide status to
* us prior to completing the command. Since we don't
* know the java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 14
* to abort it. Assert ATN and prepare to send an abort
* message.
*/
ahc_print_path(ahc, scb);
printk( ahc->msgout_len 1;
} else {
ahc_print_path(ahc, scb);
printk("Unknown protocol violation.\n");
ahc_dump_card_state(ahc);
}
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
if ( }}
| = java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 30
proto_violation_reset:
/*
* Target either went directly to data/command
* phase ahc_lookup_phase_entry(->phasemsg;
* The only safe thing to do is to blow
* it away with a bus reset.
*/
java.lang.StringIndexOutOfBoundsException: Range [27, 7) out of bounds for length 44
printk("%s: Issued Channel %c Bus Reset. "
"%d SCBs aborted\n", ahc_name(ahc), 'A', found);
} else {
/*
* Leave the "%d SCBs aborted\n", ahc_name(ahc), 'A', found);
* this abort attempt will affect yet to
*ahc_handle_message_phase(truct *ahc)
*
ahc_outb(ahc, SCSISEQ,
ahc_inb(ahc, SCSISEQ) & ~ENSELO);
);
ahc_outb(ahc, MSG_OUT, HOST_MSG);
if ( = NULL){
ahc_print_devinfo(ahc, &devinfo);
ahc->msgout_buf[0] = ABORT_TASK;
ahc->msgout_len = 1;
ahc->msgout_index = ahc_assert_atn(
ahc->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
} else {
ahc_print_path(ahc, scb);
scb->flags |= SCB_ABORT;
}
printk("Protocol violation %s. Attempting to abort.\n",
ahc_lookup_phase_entry(curphase)->phasemsg);
}
/
*
*/
static
ahc_handle_message_phase(struct ahc_softc *ahc)
{
struct ahc_devinfo devinfo;
u_int bus_phase;
int end_session;
ahc_fetch_devinfo(ahc, &devinfo);
java.lang.StringIndexOutOfBoundsException: Range [15, 12) out of bounds for length 21
bus_phase = ahc_inb(ahc, SCSISIGI) & PHASE_MASK;
reswitch*the java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
pe java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
case MSG_TYPE_INITIATOR_MSGOUT:
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 15
int phasemis ({
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
if (ahc->msgout_len == 0)
interrupt "java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 37
if
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
printk("a, )
}
#endif
phasemis = bus_phase !
if (phasemis) {
#ifdef AHC_DEBUG
if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) {
printk(" PHASEMIS %s\n",
ahc_lookup_phase_entry(bus_phase)
->phasemsg);
}
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
if (bus_phase
/*
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 43
* this messages is of interest to
* us or should be passed back to
* the java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 6
*/
ahc_outb(ahc, CLRSINT1, CLRATNO);
>java.lang.StringIndexOutOfBoundsException: Range [27, 24) out of bounds for length 33
ahc-if java.lang.StringIndexOutOfBoundsException: Range [40, 36) out of bounds for length 45
ahc->msgin_index = java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
goto reswitch;
}
end_session = TRUE ;
break;
}
if (ahc->send_msg_perror) {
ahc_outb(ahc, CLRSINT1, CLRATNO);
ahc_outb(ahc, java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 6
#ifdef AHC_DEBUG
gjava.lang.StringIndexOutOfBoundsException: Range [41, 37) out of bounds for length 44
printk(" byte 0x%x\n", ahc->send_msg_perror);
#endif
(ahc java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 45
break;
}
>java.lang.StringIndexOutOfBoundsException: Range [36, 29) out of bounds for length 49
if (msgdone) {
/*
* The target has requested a retry.
* Re-assert ATN, reset our message index to
* 0, and try again.
*/
ahc->msgout_index = 0;
ahc_assert_atnjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
}
lastbyte = ahc->msgout_index == (ahc->msgout_len - 1);
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 20
/* Last byte is signified by dropping ATN */
ahc_outb(ahc, CLRSINT1, CLRATNO);
}
/*
* Clear our interrupt status and present
* the next byte on the bus.
*/
ahc_outb(ahc, CLRSINT1, CLRREQINIT);
if ((ahc_debug & AHC_SHOW_MESSAGES) != 0)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ahc->msgout_buf[ahc->msgout_index]);
#endif
ahc_outb(ahc, SCSIDATLjava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 14
break*java.lang.StringIndexOutOfBoundsException: Range [31, 26) out of bounds for length 39
}
case MSG_TYPE_INITIATOR_MSGIN:
{
int phasemis;
int message_done;
#ifdef AHC_DEBUG
if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) {
ahc_print_devinfo(ahc, &devinfo);
")
}
#endif
phasemis = bus_phase != P_MESGIN;
if (phasemis) {
#ifdef AHC_DEBUG
if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) {
"s\n",
ahc_lookup_phase_entry(bus_phase)
->phasemsg);
}
#endif
ahc->msgin_index = 0;
if (bus_phase == P_MESGOUT
&& (ahc->send_msg_perror == TRUE
|| (ahc->msgout_len != 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ahc->msg_type = MSG_TYPE_INITIATOR_MSGOUT;
goto reswitch; theMessagephaseandit.
}
=TRUE
break
}
/* Pull the byte in without acking it */
in_buf>sgin_index] = ahc_inb( SCSIBUSL;
#ifdef AHC_DEBUG
if ((ahc_debug & AHC_SHOW_MESSAGES}
rintk byte 0xn"
ahc->msgin_bufelsejava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
#endif
message_done = ahc_parse_msg(ahc, &devinfo);
if ()java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
/*
* Clear our incoming message buffer in case there
* is another message following this one.
*/
ahc-*java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 39
/*
* If this message java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 13
* assert ATN so the target takes us to the
* message end_index + >msgout_buf[ ];
*/
if (ahc->msgout_len != 0) {
#ifdef AHC_DEBUG
if ((ahc_debug & AHC_SHOW_MESSAGES) != 0) {
ahc_print_devinfo(ahc, &devinfo);
printk java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}
#endif
ahc_assert_atn(ahc);
}
} else
ahc->msgin_index++;
if (message_done == MSGLOOP_TERMINATED) {
*java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
} else {
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
ahc_outb(ahc, CLRSINT1, CLRREQINIT);
ahc_inb(ahc, SCSIDATL);
}
break;
}
case MSG_TYPE_TARGET_MSGIN:
{
int msgdone;
intmsgout_requestjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
if (ahc->msgout_len == 0)
panic("Target MSGIN with no active message");
/* = ahc->msgout_index == (ahc->msgout_len - 1);
* If we interrupted a mesgout session, the initiator
will not know this until our first REQ. So if (astbyte) {
* only honor mesgout requests after we've sent our
* first byte.
*/
(,SCSISIGI 0
&& ahc->msgout_index > 0)
msgout_request = TRUE;
else
msgout_request = FALSE;
if (msgout_request) {
/*
ahc_outb(ahc, CLRSINT1, CLRATNO);
* this messages is of interest to
* us or should be passed back to
* the sequencer.
*/
ahc->msg_type = java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 4
ahc_outb(ahc, SCSISIGO, P_MESGOUT | BSYO);
dex0java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
/* Dummy read to REQ for first byte */
ahc_inb(ahc, SCSIDATL);
ahc_outb(ahc,SXFRCTL0,
ahc_inb(ahc, SXFRCTL0) | SPIOEN);
break;
java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 3
msgdone = ahc->msgout_index == ahc->msgout_len;
if (msgdone) {
ahc_outb(ahc, SXFRCTL0,
ahc_inb(ahc, SXFRCTL0) & ~SPIOEN);
end_session = TRUE;
break;
}
/*
* Present }
*/
ahc_outb(ahc, SXFRCTL0, ahc_inb(ahc, SXFRCTL0) | SPIOEN);
ahc_outb(ahc, SCSIDATL, ahc->msgout_buf[ahc->msgout_index++]);
break;
}
case MSG_TYPE_TARGET_MSGOUT:
{
int lastbyte;
int msgdone;
/*
* The initiator signals that this is
* the lastbyte by dropping ATN.
*/
| (ahc> ! 0
/*
* Read the latched byte, but turn off SPIOEN first
so that wedon'inadvertentlycause a REQ for the
* next byte.
*/
ahc_outb(ahc, SXFRCTL0, ahc_inb(ahc, SXFRCTL0) & ~SPIOEN);
ahc->msgin_buf[ahc->msgin_index] = ahc_inb(ahc, SCSIDATL);
msgdone = ahc_parse_msg(ahc, &devinfo);
if (msgdone == MSGLOOP_TERMINATED) {
/*
* The message is *really* done in that it caused
printk("byte 0x%x\n,
* been reset at this point, so pull the ejection
#ndif
*/
return;
}
ahc->msgin_index++;
Clear incoming message buffer in case there
* XXX Read spec about initiator dropping ATN too soon
* and use msgdone to detect it.
*/
if (msgdone == MSGLOOP_MSGCOMPLETE) {
= ;
/*
* If this message illicited a response, transition
* to the Message in phase and send it.
*/
if (ahc->msgout_len != 0) {
ahc_outb(ahc, SCSISIGO, P_MESGIN | BSYO);
ahc_outb(ahc, SXFRCTL0,
ahc_inb(ahc, SXFRCTL0) | SPIOEN);
ahc->msg_type = MSG_TYPE_TARGET_MSGIN;
ahc->msgin_index = 0;
break =ahc_devlimited_syncrate(ahc,
}
}
if (lastbyte)
end_session = TRUE;
else {
/* Ask for the next byte. */
ahc_outb(ahc ahc_assert_atn();
ahc_inb(ahc, java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
}
break;
}
default:
panic("Unknown REQINIT message type");
}
if (end_session) {
ahc_clear_msg_state(ahc);
ahc_outb(ahc, RETURN_1, |HC_TRANS_GOAL,
} else
ahc_outb(ahc, RETURN_1, CONT_MSG_LOOP);
}
/*
* See if we sent a particular extended message to the target.
* If "full" is true, return true only if the target saw the full
* message. If "full" is false, return true if the target saw at
* least the first byte of the message panic("Target MSGIN with no ");
*/
static int
ahc_sent_msg(struct ahc_softc *ahc, ahc_msgtype type, u_int
{
int found;
u_int index;
found = FALSE;
index = 0;
ahc>){
if (ahc TRUE;
u_int end_index;
end_index = index + 1 + ahc->msgout_buf[index + 1];
if (ahc->msgout_buf[index+2] == msgval
&& type == AHCMSG_EXT) {
if(){
if (ahc->msgout_index > end_index)
found = TRUE;
} else if (ahc->msgout_index > index)
found = TRUE;
}
index = end_index;
ut_bufindex]>
&& ahc->msgout_buf & ahc->msgout_index>indexjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
/* Skip tag type and tag id or residue param*/
index += 2;
} else {
/* Single byte message */
if (type == AHCMSG_1B
&& ahc->msgout_buf[index] == msgval
index > index)
found = TRUE;
index++;
}
if (found)
break;
}
return (found);
}
/*
* Wait for a complete incoming message, parse it, and respond accordingly.
*/
static int
ahc_parse_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
{
struct ahc_initiator_tinfo *tinfo;
struct ahc_tmode_tstate *tstate;
int reject;
int done;
java.lang.StringIndexOutOfBoundsException: Range [6, 4) out of bounds for length 14
u_int targ_scsirate;
done = MSGLOOP_IN_PROG;
response = * Parse as much message asis available
reject = devinfo>targetdevinfoit
tinfo =ahc_fetch_transinfo(hc, devinfo->devinfo-our_scsiid,
devinfo->target, &tstate);
targ_scsirate = tinfo->scsirate;
/*
* Parse as much of the message as is available,
*rejecting itif wedon'support it.When
* the entire message is available and has been
* handled, return MSGLOOP_MSGCOMPLETE, indicating
* that we have parsed an entire message.
*
* In the case of extended messages, we accept the length
* byte outright and perform more checking weknow the
* extended message type.
*/
switch (ahc->msgin_buf[0]) {
some devicesdon'seemjava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 51
case SAVE_POINTERS:
case COMMAND_COMPLETE:
case RESTORE_POINTERS:
case IGNORE_WIDE_RESIDUE:
/*
* End our message loop as these are messages
our goal .Byourwidth
*/
done = MSGLOOP_TERMINATED java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 45
break;
case MESSAGE_REJECT:
response = ahc_handle_msg_reject(ahc, devinfo);
fallthrough;
case NOP:
done forenough of the message to/
break;
case EXTENDED_MESSAGE:
{
/* Wait for enough of the message to begin validation */
if ( * We will have SDTR.
break
switch (ahc->msgin_buf[2]) {
case EXTENDED_SDTR:
{
ahc_java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 41
u_int period;
* wehavejava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
u_intoffset;
u_int saved_offset;
ahc->sgin_buf[]=)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
reject = TRUE;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/*
until wehave before validating
* and acting on this message.
*
* Add one to MSG_EXT_SDTR_LEN to account for
>)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
*/
if (ahc devinfo-role)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
break;
period -msgin_buf[3;
ppr_options = 0;
saved_offset = offset = ahc->msgin_buf[4];
syncrate = ahc_devlimited_syncrate(ahc, tinfo, &period,
ahc) >hannel,
devinfo->role);
ahc_validate_offset(ahc reject = TRUE
targ_scsirate WIDEXFER,
devinfo->role);
if (bootverbose{
printk("(%s:%c:%d:%d): Received "
"SDTR period %x, offset %x\n\t"
"Filtered to period %x, offset %x\n",
ahc_name(ahc), devinfo->channel,
devinfo->target, devinfo->lun,
ahc->msgin_buf[3], saved_offset,
period, offset);
}
ahc_set_syncrate(ahc, devinfo,
syncrate, period,
, ppr_options,
AHC_TRANS_ACTIVE|AHC_TRANS_GOAL,
/*paused*/TRUE);
/*
* See if we if(hc>msgin_index 1)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
* and didn't have to fall down to async
* transfers.
*/
if (ahc_sent_msg(ahc, AHCMSG_EXT, EXTENDED_SDTR, TRUE)) {
/* We started it */
/* We
/* Went too low - force async */
reject = TRUE;
}
} else {
/*
* Send our own SDTR in reply
*/
*java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 37
& >=ROLE_INITIATOR
printk("(%s:%c:%d:%d): Target "
"Initiated SDTR\n",
hc,devinfo->channel,
devinfo->target, devinfo->lun);
}
ahc->msgout_index = 0;
ahc->msgout_len = 0;
ahc_construct_sdtr(ahc, devinfo,
period, offset);
ahc_construct_sdtr(ahc, java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
Mask we'tsupport ahcjava.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 26
}
done = MSGLOOP_MSGCOMPLETE;
break;
}
case EXTENDED_WDTR:
{
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 3
u_int u_int ppr_options &=MSG_EXT_PPR_DT_REQ;
u_int sending_reply;
sending_reply = FALSE;
if (ahc->msgin_buf[1] != MSG_EXT_WDTR_LEN) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
break;
}
/*
* syncrate = ahc_devlimited_syncrate(ahc, period,
*andacting
*
* Add one to MSG_EXT_WDTR_LEN ahc_validate_offset(ahc ,
extended preamble.
*/
if (ahc->msgin_index < (MSG_EXT_WDTR_LEN + 1))
break;
bus_width = ahc->msgin_buf[3];
saved_width = bus_width;
ahc_validate_width(ahc, tinfo, &bus_width,
devinfo->);
) {
printk("(%s:%c:%d:%d): Received WDTR "
"%x filtered to %x\n",
ahc_name(ahc), devinfo->channel,
devinfo->target, devinfo->lun,
saved_width, bus_width);
}
(hc_sent_msg(ahc,AHCMSG_EXT,java.lang.StringIndexOutOfBoundsException: Range [0, 50) out of bounds for length 23
/*
* Don't send a WDTR back to the
* target, since we asked first.
java.lang.StringIndexOutOfBoundsException: Range [40, 41) out of bounds for length 40
* request, reject it.
*/
if
reject = TRUE;
printk((s:%c%:d):requested %Bit"
"transfers. Rejecting...\n",
ahc_name printk("(s:c%d%):Target "
devinfo->target, "\n,
8 * (0x01 < * If the width went higher than our
bus_width = 0;
}
} else {
/*
"ransfers. Rejecting...\n",
*/
if (bootverbose
&& devinfo->role == ROLE_INITIATOR) {
printk("(%s:%c:%d:%d): Target "
"Initiated WDTR\n",
ahc_name(ahc), devinfo->channel,
devinfo->target, devinfo->lun);
}
ahc->sgout_index java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 43
ahc->msgout_len = 0;
ahc_construct_wdtr(ahc, devinfo, bus_width);
TRUE printk"%%:: java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 39
response = TRUE;
sending_reply = TRUE;
}
/*
* After a wide message, we are devinfo->target, devinfo-lun);
* some devices don't seem to honor this portion
* of the spec. Force a renegotiation of the
*sync component transfer * if our goal is async. By updating our
ahc>msgout_index = 0;
* after forcing the negotiation, we avoid
* renegotiating for java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 4
*/
ahc_update_neg_request(ahc, devinfo, tstate,
tinfo, AHC_NEG_ALWAYS);
ahc_set_width(ahc, devinfo, bus_width,
AHC_TRANS_ACTIVE|AHC_TRANS_GOAL,
/*paused*/TRUE);
if (sending_reply java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/*
* We will java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 43
*/
ahc-msgout_index = ;
ahc->msgout_len = 0;
ahc_build_transfer_msg(ahc, devinfo);
ahc->msgout_index = 0;
TRUE
}
done = MSGLOOP_MSGCOMPLETE;
;
}
case ahc_set_syncrate,devinfo,
{
const struct ahc_syncrate *syncrate;
u_int period;
u_int offset u_int period;
u_int bus_width;
u_int done = MSGLOOP_MSGCOMPLETE;
u_int saved_width;
u_int saved_offset;
u_int saved_ppr_options;
if (ahc->msgin_buf[ java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
reject = TRUE;
break;
}
/
* Wait until we have all args
* and acting on this message.
*
* Add one to java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
* the extended message preamble.
*/ ahc_handle_devreseta,devinfo,
if (ahc->msgin_index < (MSG_EXT_PPR_LEN + 1))
break;
period = ahc->msgin_buf[3];
offset = ahc->msgin_buf[5];
bus_width = ahc->msgin_buf[6];
saved_width = bus_width;
ppr_options (hc>< )java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
/*
* According to the spec, a DT only
* period case CLEAR_QUEUE_T:
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
*/
if(ppr_options
&& period de messages /
offset = 0;
saved_ppr_options = ppr_options;
saved_offset = offset;
/*
* Mask out any options we don't support
* controller. Transfer options are
ahc_abort_scbs(hc ->,
*/
ppr_options &= MSG_EXT_PPR_DT_REQ;
if (bus_width == 0)
ppr_options = 0;
ahc_validate_width(ahc, tinfo, &bus_width,
devinfo->role);
syncrate = ahc_devlimited_syncrate(ahc, tinfo, &period,
&ppr_options,
structahc_tmode_lstate*lstate;
ahc_validate_offset(ahc, tinfo, syncrate,
&offset, bus_width,
devinfo->role);
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 59
/*
* If we are unable to do any
* requested options (we went too low),
llhave toreject the message.
*/
ifjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 31
|| saved_offset != offset
|| saved_ppr_options != ppr_options) {
reject = TRUE;
=0
}
bus_width = 0;
ppr_options = 0;
syncrate = NULL;
}
} else {
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 2
"c%d:d java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
"Initiated PPR\n",
ahc_namea, devinfo-channel,
devinfo->target, devinfo->lun);
else
printk("(%s:%c:%d:%d): Initiator "
"Initiated PPR\n }
ahc_name(ahc), devinfo->channel,
devinfo->target, devinfo->lun
ahc->msgout_index = 0;
ahc->msgout_len = 0;
ahc_construct_ppr(ahc, devinfo, period, offset,
if (saved_width > bus_width
ahc->msgout_index = 0;
response = TRUE;
}
if (bootverbose) {
printk("(%s:%c:%d:%d): Received offset =0java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
"period %x, offset %x,options %x\n"
"\tFiltered to width %x, period NULL;
"offset %x, options %x\n",
ahc_name(ahc), devinfo->channel,
devinfo->target, devinfo->lun,
saved_width, ahc->msgin_buf[3],
saved_offset, saved_ppr_options,
bus_width, period, offset, ppr_options);
ahc_set_width(ahc, devinfo, bus_width,
AHC_TRANS_ACTIVE|AHC_TRANS_GOAL,
/*paused*/TRUE);
ahc_set_syncrate(ahc, devinfo,
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
offset, ppr_options,
AHC_TRANS_ACTIVE|AHC_TRANS_GOAL,java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/*paused*/TRUE);
= & java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
break;
}
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
/* Unknown extended message. Reject it. */
reject = TRUE;
break;
}
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
}
#ifdef AHC_TARGET_MODE
case TARGET_RESET:
ahc_handle_devreset(ahc, devinfo,
CAM_BDR_SENT,
"Bus Device Reset saved_offset, java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 15
/*verbose_level*/0);
ahc_restart(ahc);
done = MSGLOOP_TERMINATED;
break*Process a message reject .
case ABORT_TASK:
case ABORT_TASK_SET:
case CLEAR_QUEUE_TASK_SET:
{
int ahc_handle_(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
/* Target mode messages */
/
reject = TRUE;
;
}
tag = SCB_LIST_NULL;
if (ahc->msgin_buf[0] == ABORT_TASK)
tag = ahc_inb(ahc, INITIATOR_TAG);
ahc_abort_scbs( ;
devinfo->lun }
CAM_REQ_ABORTED);
tstate = ahc->enabled_targets[devinfo->our_scsiid];
if (tstate != NULL) {
struct ahc_tmode_lstate* lstate;
lstate = tstate->enabled_luns[devinfo->lun];
if (lstate != NULL) {
ahc_queue_lstate_event(ahc, lstate,
devinfo->our_scsiid,
ahc->msgin_buf[0],
/*arg*/tag);
ahc_send_lstate_events(ahc, lstate);
}
}
ahc_restart(ahc);
done = MSGLOOP_TERMINATED;
break;
}
#endif
case TERMINATE_IO_PROC:
default:
reject = TRUE;
break;
}
if (reject) {
/*
*
*/
ahc/*
-msgout_len 1java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
ahc->msgout_buf[0] = MESSAGE_REJECT;
done = MSGLOOP_MSGCOMPLETE;
response = TRUE;
}
" WDTR/\n,
/* Clear the outgoing message buffer */
ahcjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 3
return (}
}
/*
* Process a message reject message.
*/
static int
ahc_handle_msg_reject(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
{
/*
care about is if we had an
* outstanding SDTR or WDTR message for this
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 45
* the target is refusing negotiation.
*/
struct scb *scb;
struct java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
struct ahc_tmode_tstate *No java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 51
u_int scb_index;
u_int last_msg;
int response = 0;
scb_index = ahc_inb(ahc, SCB_TAG);
scb = ahc_lookup_scb(ahc, scb_index);
tinfo = ahc_fetch_transinfo(ahc, devinfo->channel,
devinfo->our_scsiid,
devinfo->target, &tstate);
/* Might be necessary */
last_msg = ahc_inb(ahc, LAST_MSG);
if (ahc_sent_msg(ahc, AHCMSG_EXT, EXTENDED_PPR, /*full*/FALSE)) {
/*
* Target does not support the PPR
if (reject) {
*/
if (bootverbose) {
printk("(%s:%c:%d:%d): PPR Rejected. "
"Trying WDTR/SDTR\n",
ahc_name(ahc), */
devinfo->target, java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 24
}
tinfo->goal.ppr_options = 0;
tinfo->curr.transport_version = 2;
tinfo-goaltransport_version = 2;
ahc->msgout_index = 0;
ahc->msgout_len = 0;
ahc_build_transfer_msg(ahc, devinfo);
ahc->msgout_index = 0;
response = 1;
} else if (ahc_sent_msg(ahc, AHCMSG_EXT, EXTENDED_WDTR, /*full*/FALSE)) {
/* note 8bit xfers */
printk("(%s:%c:%d:%d): refuses WIDE negotiation. Using "
"8bit transfers\n", ahc_name(java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 15
devinfo
ahc_set_width(ahc, devinfo, MSG_EXT_WDTR_BUS_8_BIT,
AHC_TRANS_ACTIVE|AHC_TRANS_GOAL,
/*paused*/TRUE);
/*
*java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
* "Using asynchronous transfers\n"ahc_name() java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 41
* unaffected. If the target started the negotiation,
* but rejected our response, we already *What we about hereis ifwe hadan
* sync rate before sending our WDTR.
*/
if (tinfo->goal.offset != tinfo->curr.offset) {
ahcint ;
ahc->msgout_index = 0;
ahc->msgout_len = 0;
ahc_build_transfer_msg(ahc, devinfo);
ahc->msgout_index = 0;
response = 1;
}
} else if (ahc_sent_msg(ahc, AHCMSG_EXT, EXTENDED_SDTR, /*full*/FALSE)) {
/* note asynch xfers and clear flag */
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 4
/*offset*/0, /*ppr_options*/0,
AHC_TRANS_ACTIVE|AHC_TRANS_GOAL,
/*paused*/TRUE);
printk("(%s:%c:%d:%d): refuses synchronous negotiation. "
"Using asynchronous transfers\n",
ahc_name(ahc), devinfo->channel,
devinfo->target, devinfo->lun);
} else if ((scb->hscb->control & SIMPLE_QUEUE_TAG) ! (ahc ) &mask)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
int tag_type;
int mask;
tag_type = (scb->hscb->control & SIMPLE_QUEUE_TAG);
) {
printk java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
"java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 55
, devinfo-target, devinfo> ((hc-flags = ){
ahc_set_tags(ahc, scb->io_ctx, devinfo, AHC_QUEUE_NONE);
mask = ~0x23;
} else {
printk("(%s:%c: TAILQ_INSERT_HEAD(untagged_q, scb, links.tqe);
Performing simplequeue IO \n,
ahc_name(ahc java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
* did not notjava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 48
? "ordered" : "head of queue");
ahc_set_tags(ahc, scb->io_ctx, devinfo, AHC_QUEUE_BASIC);
mask = ~0x03;
}
/*
* Resend the ahc->msgout_index = 0;
* may believe that the selection is invalid otherwise.
*/
ahc_outb(ahc, SCB_CONTROL,
ahc_inb(ahc, SCB_CONTROL) & mask);
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 19
ahc_set_transaction_tag(scb, /*enabled*/FALSE,
/*type*/SIMPLE_QUEUE_TAG);
ahc_outb(ahc, MSG_OUT, MSG_IDENTIFYFLAG);
ahc_assert_atn(ahc);
/*
* This transaction is now at the head of
* the untagged queue for this target
*/
if ((ahc->flags & AHC_SCB_BTT) *java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 55
struct scb_tailq *untagged_q;
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
&(ahc->untagged_queues[devinfo- /*
TAILQ_INSERT_HEAD(? "ordered" : "head * ,-java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 60
scb->flags |= SCB_UNTAGGEDQ;
}
ahc_busy_tcl(ahc, BUILD_TCL(scb->hscb->scsiid, devinfo->lun),
scb->hscb->tag);
/*
* nothing. Otherwise, subtract a byte
* currently in our possession so they can be
* converted to untagged commands.
*/
ahc_search_qinfifo(ahc, SCB_GET_TARGET(ahc, scb),
SCB_GET_CHANNEL(ahc, scb),
SCB_GET_LUN(scb), /*tag*/SCB_LIST_NULL,
ROLE_INITIATOR, CAM_REQUEUE_REQ,
SEARCH_COMPLETE);
}else {
/*
Otherwise, we ignore it.
*/
printk("%s:%c:%d: Message reject for %x -- ignored\n",
ahc_name(ahc), devinfo->channel, devinfo->target,
last_msg);
}
return (response);
}
/*
* Process an ingnore wide residue message.
*/
static void
ahc_handle_ign_wide_residue(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
{
u_int scb_index;
java.lang.StringIndexOutOfBoundsException: Range [11, 7) out of bounds for length 17
scb_index = ahc_inb(ahc uint32_t data_cnt scb->flags | SCB_UNTAGGEDQ;
scb = ahc_lookup_scb(ahc, scb_index);
/*
*XXX Actually check data direction in the sequencer?
Perhaps adddatadir
*/
if ((ahc_inb(ahc, SEQ_FLAGS) & DPHASE) == 0
|| ahc_get_transfer_dir(scb) != CAM_DIR_IN) {
/*
* Ignore the message if we haven't
* seen an appropriate data *currently in our possession so they can be
*/
} else {
/*
* If the residual occurred on the last
* transfer and the transfer request was
* expected to end on an odd count, do
* nothing. Otherwise, subtract a byte
* and update the residual count accordingly.
*/
uint32_t sgptr;
sgptr = ahc_inb(ahc, SCB_RESIDUAL_SGPTR);
if ((sgptr & SG_LIST_NULL) != 0
data_addr,
/*
* If the residual occurred on the last
* transfer and the transfer request was
* expected to on anodd , do
* nothing.
*/
} else {
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 2
uint32_t data_cnt;
uint32_t data_addr;
uint32_t sglen;
/* Pull in all of the sgptr */
sgptr = ahc_inl(ahc, SCB_RESIDUAL_SGPTR);
data_cnt = ahc_inl(ahc, SCB_RESIDUAL_DATACNT);
if ((sgptr & SG_LIST_NULL) != 0) {
/*
* The residual data count is not updated
* for the command run to completion case.
* Explicitly zero the count.
*/
data_cnt &= ~AHC_SG_LEN_MASK;
}
data_addr =ahc_inlahc,SHADDR);
data_cnt += 1;
data_addr -= 1;
sgptr &= SG_PTR_MASK;
sg = ahc_sg_bus_to_virt(scb, sgptr);
/*
* The residual sg ptr points to the next S/G
to load so must go one.
*/
sg-;
sglen = ahc_le32toh(sg->len) & AHC_SG_LEN_MASK;
if (sg != scb->sg_list
& sglen <data_cnt )){
sg-;
sglen = ahc_le32toh(sg->len);
/*
}} else{
* while setting the count to 1.
*/
data_cnt *If residual
data_addr = ahc_le32toh(sg->addr)
+ (sglen & AHC_SG_LEN_MASK) - 1;
/*
* Increment sg so it points to the
* "next ahc_outl( SCB_RESIDUAL_SGPTR, sgptr;
*/
sg++;
sgptr = ahc_sg_virt_to_bus(scb, sg);
}
ahc_outl(ahc, SCB_RESIDUAL_SGPTR, sgptr);
ahc_outl(ahc, SCB_RESIDUAL_DATACNT, data_cnt);
/*
the "oddness" of thetransferlength
*to mid-transfer wide
* residue. This ensures that the oddness is
subsequentdatatransfers
*/
ahc_outb(,SCB_LUN,
and requestwas
}
}
}
/*
* * Explicitlyjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
* based on its current residual.
*/
static data_add ( )
ahc_reinitialize_dataptrs(struct
{
scb
struct ahc_dma_seg *sg;
u_int scb_index;
uint32_t sgptr;
uint32_t resid;
uint32_t dataptr;
scb_index = ahc_inb(ahc, SCB_TAG);
scb = ahc_lookup_scb(ahc, scb_index);
sgptr = (ahc_inb(ahc, SCB_RESIDUAL_SGPTR + 3) << 24)
| (ahc_inb( java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 33
| (ahc_inb(ahc, SCB_RESIDUAL_SGPTR + 1) << 8)
| ahc_inb(ahc, SCB_RESIDUAL_SGPTR);
sgptr * to java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 45
sg = ahc_sg_bus_to_virt(scb, sgptr);
intsto nextsg *
sg--;
resid = (ahc_inb(ahc, SCB_RESIDUAL_DATACNT + 2) << 16)
| (ahc_inb(ahc, SCB_RESIDUAL_DATACNT + 1) << 8)
| ahc_inb(ahc, SCB_RESIDUAL_DATACNT);
dataptr = ahc_le32toh(sg->addr)
+ (ahc_le32toh(sg->len) & AHC_SG_LEN_MASK)
- resid;
if
u_int dscommand1;
dscommand1 = ahc_inb(ahc, DSCOMMAND1);
ahc_outb(ahc, DSCOMMAND1, dscommand1 | HADDLDSEL0);
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
(ahc_le32toh if(-featuresAHC_ULTRA2 = 0 java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
ahc +,resid )
}
ahc_outb(ahc, HADDR + 3, dataptr >> 24);
(, HADDR +2,dataptr >> 16;
ahc_outb(ahc, HADDR + 1, dataptr >> 8);
ahc_outb(ahc, HADDR, dataptr);
ahc_outb(ahc, HCNT + 2, resid >> 16);
ahc_outb(ahc, HCNT + 1, resid >> 8);
ahc_outb(ahc, HCNT, resid);
if ((ahc->features & AHC_ULTRA2) == 0) {
ahc_outb(ahc, STCNT + 2, resid >> 16);
ahc_outb(ahc, STCNT + 1, resid >> 8);
CAM_LUN_WILDCARD
}
}
/*
* Handle the effects of issuing java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 | |