Lines Matching refs:target

454 	unsigned char	target  = scmd_id(SCpnt);
520 /* syncreg, ackwidth, target id, SREQ sampling rate */
523 param->target_id = BIT(host_id) | BIT(target);
586 unsigned char target = scmd_id(SCpnt);
630 * set SCSIOUT LATCH(initiator)/TARGET(target) (OR-ed) ID
633 BIT(host_id) | BIT(target));
803 * reselection target id&lun must be already set.
845 data->cur_target = &(data->target[newid]);
912 nsp32_target *target;
917 "enter. target: 0x%x LUN: 0x%llx cmnd: 0x%x cmndlen: 0x%x "
931 /* check target ID is not same as this initiator ID */
933 nsp32_dbg(NSP32_DEBUG_QUEUECOMMAND, "target==host???");
939 /* check target LUN is allowable value */
976 * If target is the first time to transfer after the reset
977 * (target don't have SDTR_DONE and SDTR_INITIATOR), sync
980 target = &data->target[scmd_id(SCpnt)];
981 data->cur_target = target;
983 if (!(target->sync_flag & (SDTR_DONE | SDTR_INITIATOR | SDTR_TARGET))) {
987 nsp32_set_max_sync(data, target, &period, &offset);
989 target->sync_flag |= SDTR_INITIATOR;
991 nsp32_set_async(data, target);
992 target->sync_flag |= SDTR_DONE;
997 target->limit_entry, period, offset);
998 } else if (target->sync_flag & SDTR_INITIATOR) {
1000 * It was negotiating SDTR with target, sending from the
1004 nsp32_set_async(data, target);
1005 target->sync_flag &= ~SDTR_INITIATOR;
1006 target->sync_flag |= SDTR_DONE;
1010 } else if (target->sync_flag & SDTR_TARGET) {
1012 * It was negotiating SDTR with target, sending from target,
1016 nsp32_set_async(data, target);
1017 target->sync_flag &= ~SDTR_TARGET;
1018 target->sync_flag |= SDTR_DONE;
1021 "Unknown SDTR from target is reached, fall back to async.");
1025 "target: %d sync_flag: 0x%x syncreg: 0x%x ackwidth: 0x%x",
1026 SCpnt->device->id, target->sync_flag, target->syncreg,
1027 target->ackwidth);
1487 for (id = 0; id < ARRAY_SIZE(data->target); id++) {
1496 if (data->target[id].sync_flag == SDTR_DONE) {
1497 if (data->target[id].period == 0 &&
1498 data->target[id].offset == ASYNC_OFFSET ) {
1507 if (data->target[id].period != 0) {
1509 speed = 1000000 / (data->target[id].period * 4);
1514 data->target[id].offset
1644 * target SDTR check
1656 * SDTR negotiation pulled by the target has been
2041 message_reject from target, SDTR negotiation is failed */
2045 * Current target is negotiating SDTR, but it's
2123 * Exchange this message between initiator and target.
2226 nsp32_target *target = data->cur_target;
2234 * If this inititor sent the SDTR message, then target responds SDTR,
2237 * If initiator did not send the SDTR, but target sends SDTR,
2240 if (target->sync_flag & SDTR_INITIATOR) {
2242 * Initiator sent SDTR, the target responds and
2245 nsp32_dbg(NSP32_DEBUG_MSGINOCCUR, "target responds SDTR");
2247 target->sync_flag &= ~SDTR_INITIATOR;
2248 target->sync_flag |= SDTR_DONE;
2255 * Negotiation is failed, the target send back
2263 * Negotiation is succeeded, the target want
2281 * Negotiation is failed, the target send back
2287 entry = nsp32_search_period_entry(data, target, get_period);
2300 nsp32_set_sync_entry(data, target, entry, get_offset);
2303 nsp32_dbg(NSP32_DEBUG_MSGINOCCUR, "target send SDTR");
2305 target->sync_flag |= SDTR_INITIATOR;
2318 entry = nsp32_search_period_entry(data, target, get_period);
2321 nsp32_set_async(data, target);
2324 nsp32_set_sync_entry(data, target, entry, get_offset);
2329 target->period = get_period;
2335 * If the current message is unacceptable, send back to the target
2341 nsp32_set_async(data, target); /* set as ASYNC transfer mode */
2343 target->period = 0;
2351 * target and speed period value. If failed to search, return negative value.
2354 nsp32_target *target,
2359 if (target->limit_entry >= data->syncnum) {
2361 target->limit_entry = 0;
2364 for (i = target->limit_entry; i < data->syncnum; i++) {
2384 * target <-> initiator use ASYNC transfer
2386 static void nsp32_set_async(nsp32_hw_data *data, nsp32_target *target)
2388 unsigned char period = data->synct[target->limit_entry].period_num;
2390 target->offset = ASYNC_OFFSET;
2391 target->period = 0;
2392 target->syncreg = TO_SYNCREG(period, ASYNC_OFFSET);
2393 target->ackwidth = 0;
2394 target->sample_reg = 0;
2401 * target <-> initiator use maximum SYNC transfer
2404 nsp32_target *target,
2410 period_num = data->synct[target->limit_entry].period_num;
2411 *period = data->synct[target->limit_entry].start_period;
2412 ackwidth = data->synct[target->limit_entry].ackwidth;
2415 target->syncreg = TO_SYNCREG(period_num, *offset);
2416 target->ackwidth = ackwidth;
2417 target->offset = *offset;
2418 target->sample_reg = 0; /* disable SREQ sampling */
2423 * target <-> initiator use entry number speed
2426 nsp32_target *target,
2436 target->syncreg = TO_SYNCREG(period, offset);
2437 target->ackwidth = ackwidth;
2438 target->offset = offset;
2439 target->sample_reg = sample_rate | SAMPLING_ENABLE;
2449 * connected target responds SCSI REQ negation. We have to wait
2674 * setup target
2676 for (i = 0; i < ARRAY_SIZE(data->target); i++) {
2677 nsp32_target *target = &(data->target[i]);
2679 target->limit_entry = 0;
2680 target->sync_flag = 0;
2681 nsp32_set_async(data, target);
2858 for (i = 0; i < ARRAY_SIZE(data->target); i++) {
2859 nsp32_target *target = &data->target[i];
2861 target->sync_flag = 0;
2862 nsp32_set_async(data, target);
2987 nsp32_target *target;
3032 target = &data->target[i];
3034 target->limit_entry = 0; /* set as ULTRA20M */
3037 entry = nsp32_search_period_entry(data, target, ret);
3042 target->limit_entry = entry;
3073 nsp32_target *target;
3087 target = &data->target[i];
3106 entry = nsp32_search_period_entry(data, target, val);
3111 target->limit_entry = entry;