• Home
  • Raw
  • Download

Lines Matching refs:t

48 	struct esas2r_target *t;  in esas2r_targ_db_initialize()  local
50 for (t = a->targetdb; t < a->targetdb_end; t++) { in esas2r_targ_db_initialize()
51 memset(t, 0, sizeof(struct esas2r_target)); in esas2r_targ_db_initialize()
53 t->target_state = TS_NOT_PRESENT; in esas2r_targ_db_initialize()
54 t->buffered_target_state = TS_NOT_PRESENT; in esas2r_targ_db_initialize()
55 t->new_target_state = TS_INVALID; in esas2r_targ_db_initialize()
61 struct esas2r_target *t; in esas2r_targ_db_remove_all() local
64 for (t = a->targetdb; t < a->targetdb_end; t++) { in esas2r_targ_db_remove_all()
65 if (t->target_state != TS_PRESENT) in esas2r_targ_db_remove_all()
69 esas2r_targ_db_remove(a, t); in esas2r_targ_db_remove_all()
73 esas2r_trace("remove id:%d", esas2r_targ_get_id(t, in esas2r_targ_db_remove_all()
75 esas2r_target_state_changed(a, esas2r_targ_get_id(t, in esas2r_targ_db_remove_all()
84 struct esas2r_target *t; in esas2r_targ_db_report_changes() local
94 for (t = a->targetdb; t < a->targetdb_end; t++) { in esas2r_targ_db_report_changes()
98 if (t->buffered_target_state != t->target_state) in esas2r_targ_db_report_changes()
99 state = t->buffered_target_state = t->target_state; in esas2r_targ_db_report_changes()
105 t, in esas2r_targ_db_report_changes()
110 esas2r_targ_get_id(t, in esas2r_targ_db_report_changes()
123 struct esas2r_target *t; in esas2r_targ_db_add_raid() local
133 t = a->targetdb + dc->curr_virt_id; in esas2r_targ_db_add_raid()
135 if (t->target_state == TS_PRESENT) { in esas2r_targ_db_add_raid()
142 t, in esas2r_targ_db_add_raid()
156 t->block_size = dc->block_size; in esas2r_targ_db_add_raid()
157 t->inter_byte = dc->interleave; in esas2r_targ_db_add_raid()
158 t->inter_block = dc->interleave / dc->block_size; in esas2r_targ_db_add_raid()
159 t->virt_targ_id = dc->curr_virt_id; in esas2r_targ_db_add_raid()
160 t->phys_targ_id = ESAS2R_TARG_ID_INV; in esas2r_targ_db_add_raid()
162 t->flags &= ~TF_PASS_THRU; in esas2r_targ_db_add_raid()
163 t->flags |= TF_USED; in esas2r_targ_db_add_raid()
165 t->identifier_len = 0; in esas2r_targ_db_add_raid()
167 t->target_state = TS_PRESENT; in esas2r_targ_db_add_raid()
169 return t; in esas2r_targ_db_add_raid()
177 struct esas2r_target *t; in esas2r_targ_db_add_pthru() local
189 t = esas2r_targ_db_find_by_ident(a, ident, ident_len); in esas2r_targ_db_add_pthru()
191 if (t == NULL) { in esas2r_targ_db_add_pthru()
192 t = a->targetdb + dc->curr_virt_id; in esas2r_targ_db_add_pthru()
194 if (ident_len > sizeof(t->identifier) in esas2r_targ_db_add_pthru()
195 || t->target_state == TS_PRESENT) { in esas2r_targ_db_add_pthru()
201 esas2r_hdebug("add PT; T:%d, V:%d, P:%d", esas2r_targ_get_id(t, a), in esas2r_targ_db_add_pthru()
205 t->block_size = 0; in esas2r_targ_db_add_pthru()
206 t->inter_byte = 0; in esas2r_targ_db_add_pthru()
207 t->inter_block = 0; in esas2r_targ_db_add_pthru()
208 t->virt_targ_id = dc->curr_virt_id; in esas2r_targ_db_add_pthru()
209 t->phys_targ_id = dc->curr_phys_id; in esas2r_targ_db_add_pthru()
210 t->identifier_len = ident_len; in esas2r_targ_db_add_pthru()
212 memcpy(t->identifier, ident, ident_len); in esas2r_targ_db_add_pthru()
214 t->flags |= TF_PASS_THRU | TF_USED; in esas2r_targ_db_add_pthru()
216 t->target_state = TS_PRESENT; in esas2r_targ_db_add_pthru()
218 return t; in esas2r_targ_db_add_pthru()
221 void esas2r_targ_db_remove(struct esas2r_adapter *a, struct esas2r_target *t) in esas2r_targ_db_remove() argument
225 t->target_state = TS_NOT_PRESENT; in esas2r_targ_db_remove()
227 esas2r_trace("remove id:%d", esas2r_targ_get_id(t, a)); in esas2r_targ_db_remove()
235 struct esas2r_target *t; in esas2r_targ_db_find_by_sas_addr() local
237 for (t = a->targetdb; t < a->targetdb_end; t++) in esas2r_targ_db_find_by_sas_addr()
238 if (t->sas_addr == *sas_addr) in esas2r_targ_db_find_by_sas_addr()
239 return t; in esas2r_targ_db_find_by_sas_addr()
248 struct esas2r_target *t; in esas2r_targ_db_find_by_ident() local
250 for (t = a->targetdb; t < a->targetdb_end; t++) { in esas2r_targ_db_find_by_ident()
251 if (ident_len == t->identifier_len in esas2r_targ_db_find_by_ident()
252 && memcmp(&t->identifier[0], identifier, in esas2r_targ_db_find_by_ident()
254 return t; in esas2r_targ_db_find_by_ident()
265 struct esas2r_target *t = a->targetdb + id; in esas2r_targ_db_find_next_present() local
267 if (t->target_state == TS_PRESENT) in esas2r_targ_db_find_next_present()
279 struct esas2r_target *t; in esas2r_targ_db_find_by_virt_id() local
281 for (t = a->targetdb; t < a->targetdb_end; t++) { in esas2r_targ_db_find_by_virt_id()
282 if (t->target_state != TS_PRESENT) in esas2r_targ_db_find_by_virt_id()
285 if (t->virt_targ_id == virt_id) in esas2r_targ_db_find_by_virt_id()
286 return t; in esas2r_targ_db_find_by_virt_id()
295 struct esas2r_target *t; in esas2r_targ_db_get_tgt_cnt() local
299 for (t = a->targetdb; t < a->targetdb_end; t++) in esas2r_targ_db_get_tgt_cnt()
300 if (t->target_state == TS_PRESENT) in esas2r_targ_db_get_tgt_cnt()