Lines Matching defs:target

33  * - if wide target renegotiates sync, back to narrow?
38 * - keep track if ATN remains asserted and target not going into
247 static void fas_make_sdtr(struct fas *fas, int msgout_offset, int target);
248 static void fas_make_wdtr(struct fas *fas, int msgout_offset, int target,
262 static void fas_set_wide_conf3(struct fas *fas, int target, int width);
263 static void fas_force_renegotiation(struct fas *fas, int target);
482 * target-scsi-options highest
496 "?target%x-scsi-options = 0x%x\n", tgt,
503 IPRINTF2("target%x-scsi-options= 0x%x\n",
539 char *prop_template = "target%d-scsi-options";
560 * to a target.
729 * (will be enabled by target driver if required)
860 * if target<n>-scsi-options property exists, use it;
869 fas_log(fas, CE_NOTE, "?target%x-scsi-options=0x%x\n",
1650 #define FAS_SET_PERIOD_OFFSET_CONF3_REGS(fas, target) \
1653 period = fas->f_sync_period[target] & SYNC_PERIOD_MASK; \
1654 offset = fas->f_offset[target]; \
1655 conf3 = fas->f_fasconf3[target]; \
1777 * initialize period and offset for each target
1815 * may occur; it is preferable to stop the target first before
1947 * fas_scsi_abort: abort a current cmd or all cmds for a target
1956 IPRINTF2("fas_scsi_abort: target %d.%d\n", ap->a_target, ap->a_lun);
1965 * reset handling: reset bus or target
1974 IPRINTF3("fas_scsi_reset: target %d.%d, level %d\n",
2594 "starting untagged cmd, target=%d,"
2606 IPRINTF2("tagged packet for non-tagged target %d.%d\n",
2653 * If a QFull condition occurs, the target driver may set its throttle
2780 EPRINTF("fas_accept_pkt: switching target and lun slot scan\n");
2839 * If FLAG_HEAD is set, run cmd if target and bus are
2996 * the target driver submitted more than 255
3096 uchar_t cmd, target, lun;
3118 target = Tgt(sp);
3122 * if a non-tagged cmd is submitted to an active tagged target
3127 TAGGED(target) && fas->f_tcmds[slot] &&
3153 if (TAGGED(target) && (sp->cmd_pkt_flags & FLAG_TAGMASK)) {
3182 tshift = 1<<target;
3261 fas_make_wdtr(fas, i, target, FAS_XFER_WIDTH);
3282 fas_make_sdtr(fas, i, target);
3313 * load target id and enable bus id encoding and 32 bit counter
3316 (target & 0xf) | FAS_BUSID_ENCODID | FAS_BUSID_32BIT_COUNTER);
3318 FAS_SET_PERIOD_OFFSET_CONF3_REGS(fas, target);
3644 EPRINTF4("remove tag %d slot %d for target %d.%d\n",
3763 * off a target.
3831 * already in progress. the target is
3864 * Complete the process of selecting a target
3910 * We succesfully selected a target (we think).
3918 * In this case, we selected the target, but went
3924 * a target that appears to not accomodate
3933 * In this case, we selected the target and sent
3989 * make sure we negotiate when this target comes
4078 * Handle the reconnection of a target
4085 uchar_t target, lun;
4099 * Pick up target id from fifo
4101 * There should only be the reselecting target's id
4104 target = fas->f_fifo[0];
4107 * we know the target so update period, conf3,
4110 FAS_SET_PERIOD_OFFSET_CONF3_REGS(fas, target);
4114 * target will go immediately into data phase so
4148 EPRINTF2("fas_reconnect: target=%x, idmsg=%x\n",
4149 target, tmp);
4151 fas->f_resel_slot = slot = (target * NLUNS_PER_TARGET) | lun;
4154 (target & 0xf) | FAS_BUSID_ENCODID |
4163 if (TAGGED(target) && fas->f_tcmds[slot] &&
4173 * But if target is confused, then we'll blow up
4186 * queueing like we thought or the target died.
4227 target = slot/NLUNS_PER_TARGET;
4361 * run a polled proxy command for this target.
4366 target);
4407 EPRINTF2("Reconnecting %d.%d\n", target, slot % NLUNS_PER_TARGET);
4416 fas_log(fas, CE_WARN, "target %x: failed reselection (%s)",
4417 target, bad_reselect);
4499 * assuming that the target went south and dropped busy,
4512 int target = Tgt(sp);
4523 IPRINTF2("Successful %s message to target %d\n",
4540 fas_force_renegotiation(fas, target);
4546 * the target rejected the negotiations,
4565 * target dropped off the bus during
4586 * handle target disconnecting
4673 * If the target didn't disconnect from the
4894 * Check to make sure we're still connected to the target.
4895 * If the target dropped the bus, that is a fatal error.
5026 * if target is fast, we can get cmd. completion by the time we get
5108 * bad parity for the status byte, but the target refuses
5169 * complete' message, the target isn't going to be
5225 * the target disconnected and dropped BSY*.
5344 * byte from the target (at the target's request).
5348 * a target, but where the message wasn't one of
5385 * target know that we have completely fouled up.
5507 * The target is not guaranteed to go to message out
5509 * message is transferred, the target may (and likely
5579 * try and tell the target...
5621 * The target is rejecting the last message we sent.
5627 * Otherwise, a target has rejected a message that
5698 * target rejected our tag
5846 * to resend a message that the target stated
5906 int target = Tgt(sp);
5929 * the target to decide to drop BSY* and clear the bus.
5953 EPRINTF2("Successful %s message to target %d\n",
5954 scsi_mname(msgout), target);
5965 * If the target dropped busy on any other message, it
5979 * still in message out phase, then the target has
6088 * In cases where the target negotiates synchronous
6090 * disabled, or this target is known to be a weak
6091 * signal target, we send back a message indicating
6097 IPRINTF1("SYNC negotiation initiated by target %d\n",
6114 * If the target's offset is bigger than ours,
6115 * the target has violated the scsi protocol.
6133 * If the target's period is less than ours,
6134 * the target has violated the scsi protocol.
6165 * Is is now safe to produce a responce to a target
6235 * If this target violated the scsi spec, reject the
6255 IPRINTF1("Wide negotiation initiated by target %d\n",
6258 * allow wide neg even if the target driver hasn't
6266 * and depend on target to do sync
6268 * If target does not do a sync neg and enters
6497 * set throttles for all luns of this target
6607 "polled cmd failed (target busy)");
6622 * ensure we are not accessing a target too quickly
6666 * time and wait limit usec for the target to reconnect
6687 * the bus may have gone free because the target
6814 fas_make_sdtr(struct fas *fas, int msgout_offset, int target)
6817 ushort_t tshift = 1<<target;
6822 * If this target experienced a sync backoff use the
6823 * target's sync speed that was adjusted in
6828 period = fas->f_neg_period[target];
6832 * If this is a responce to a target initiated sdtr,
6836 period = fas->f_neg_period[target];
6837 offset = fas->f_offset[target];
6841 * If the target driver disabled
6851 if (fas->f_target_scsi_options[target] & SCSI_OPTIONS_FAST) {
6855 } else if (fas->f_target_scsi_options[target] & SCSI_OPTIONS_SYNC) {
6871 fas->f_neg_period[target] = (uchar_t)period;
6872 fas->f_offset[target] = (uchar_t)offset;
6890 * the target may reject the optional sync message so
6894 fas->f_sync_known |= 1<<target;
6895 fas->f_wide_known |= 1<<target;
6902 fas_make_wdtr(struct fas *fas, int msgout_offset, int target, int width)
6906 if (((fas->f_target_scsi_options[target] & SCSI_OPTIONS_WIDE) == 0) ||
6907 (fas->f_nowide & (1<<target))) {
6908 fas->f_nowide |= 1<<target;
6911 if (fas->f_force_narrow & (1<<target)) {
6930 * the target may reject the optional wide message so
6933 fas->f_wide_known |= 1<<target;
6935 fas_set_wide_conf3(fas, target, width);
6961 * it would be nicer if we could allow the target driver
7141 * the target driver has indicated that it
7144 * we want the target driver's QFULL handling
7164 * when target gives queue full status with no commands
7373 int target, lun, i, n, tag, ncmds;
7412 target = slot / NLUNS_PER_TARGET;
7443 target, lun);
7448 target, lun);
7463 fas->f_tcmds[slot], target, lun);
7475 * we count on a bus reset to disable wide in the target and will
7491 "fas_sync_wide_backoff: target %d: state=%x, phase=%x, sp=0x%p\n",
7507 * disable wide for just this target
7610 fas_force_renegotiation(struct fas *fas, int target)
7612 ushort_t tshift = 1<<target;
7623 fas_set_wide_conf3(struct fas *fas, int target, int width)
7628 fas->f_fasconf3[target] &= ~FAS_CONF3_WIDE;
7631 fas->f_fasconf3[target] |= FAS_CONF3_WIDE;
7632 fas->f_wide_enabled |= (1<<target);
7636 fas_reg_write(fas, &fas->f_reg->fas_conf3, fas->f_fasconf3[target]);
7637 fas->f_fasconf3_reg_last = fas->f_fasconf3[target];
7676 IPRINTF2("attempting to reset target %d.%d\n",
7684 * if the target won't listen, then a retry is useless
7686 * we were trying to reset and the target driver may have done a
7697 * completion pointer to NULL. this will also avoid that a target driver
8077 * prepare a proxy cmd (a cmd sent on behalf of the target driver,
8151 * if reset delay active we cannot access the target.
8184 IPRINTF2("target %d.%d aborted\n",
8188 IPRINTF2("target %d.%d did not abort\n",
8208 int target = ap->a_target;
8214 if (fas->f_reset_delay[target] != 0) {
8224 if (sp && (TAGGED(target) && (msg == MSG_ABORT_TAG))) {
8385 * set throttles to HOLD and set reset_delay for all target/luns
8451 EPRINTF2("target%d: reset delay=%d\n", s,
8456 * clear throttle for all luns on this target
8482 * cleanup after a device reset. this affects all target's luns
8489 * for all luns of this target
8492 int target = slot/NLUNS_PER_TARGET;
8504 * if we are not in panic set up a reset delay for this target,
8509 fas->f_reset_delay[target] = fas->f_scsi_reset_delay;
8532 fas_force_renegotiation(fas, target);
8536 * reset a currently disconnected target
8554 * reset a target with a currently connected command
8594 IPRINTF2("target %d.%d reset\n", ap->a_target, ap->a_lun);
8597 IPRINTF2("target %d.%d did not reset\n",
8800 char target = slot/NLUNS_PER_TARGET;
8802 if (fas_rtest & (1 << target)) {
8804 ap.a_target = target;
8829 char target = slot/NLUNS_PER_TARGET;
8832 if (fas_atest & (1 << target)) {
8834 ap.a_target = target;
8841 } else if ((fas_atest_disc == 1) && NOTAG(target)) {
8847 TAGGED(target) &&
8867 } else if (fas_atest_disc == 2 && NOTAG(target)) {
8912 int target = ap->a_target;
8913 ushort_t tshift = (1<<target);
8964 fas_force_renegotiation(fas, target);
8970 int slot = target * NLUNS_PER_TARGET | ap->a_lun;
8978 slot = target * NLUNS_PER_TARGET | ap->a_lun;
8981 if (fas->f_target_scsi_options[target] &
8983 IPRINTF1("target %d: TQ enabled\n",
8984 target);
8990 IPRINTF1("target %d: TQ disabled\n",
8991 target);
9003 fas_update_props(fas, target);
9010 if (fas->f_target_scsi_options[target] &
9020 fas_force_renegotiation(fas, target);
9038 fas->f_qfull_retries[target] = (uchar_t)val;
9043 fas->f_qfull_retry_interval[target] =
9054 int slot = target * NLUNS_PER_TARGET | ap->a_lun;
9066 (fas->f_target_scsi_options[target] &
9072 if (tgtonly && fas->f_offset[target]) {
9106 rval = fas->f_qfull_retries[target];
9110 fas->f_qfull_retry_interval[target]) /
9121 fas_update_props(fas, target);
9128 target, cap, tgtonly, doset, val, rval);
9136 * create/update sync/wide/TQ/scsi-options properties for this target
9154 (void) sprintf(property, "target%x-sync-speed", tgt);
9157 (void) sprintf(property, "target%x-wide", tgt);
9160 (void) sprintf(property, "target%x-TQ", tgt);
9191 int target = slot / NLUNS_PER_TARGET;
9202 size = ((NOTAG(target)) ? FAS_F_SLOT_SIZE : FAS_F_SLOTS_SIZE_TQ);
9204 "fas_alloc_active_slots: target=%x size=%x, old=0x%p, oldsize=%x\n",
9205 target, size, (void *)old_active,
9213 fas->f_active[slot]->f_n_slots = (NOTAG(target) ? 1 : NTAGS);
9218 if (TAGGED(target)) {