Lines Matching +full:dc +full:- +full:id

5  *  Copyright (c) 2001-2013 ATTO Technology, Inc.
21 * LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
40 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
50 for (t = a->targetdb; t < a->targetdb_end; t++) { 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()
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()
68 spin_lock_irqsave(&a->mem_lock, flags); in esas2r_targ_db_remove_all()
70 spin_unlock_irqrestore(&a->mem_lock, flags); in esas2r_targ_db_remove_all()
73 esas2r_trace("remove id:%d", esas2r_targ_get_id(t, in esas2r_targ_db_remove_all()
89 if (test_bit(AF_DISC_PENDING, &a->flags)) { in esas2r_targ_db_report_changes()
94 for (t = a->targetdb; t < a->targetdb_end; t++) { in esas2r_targ_db_report_changes()
97 spin_lock_irqsave(&a->mem_lock, flags); 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()
101 spin_unlock_irqrestore(&a->mem_lock, flags); in esas2r_targ_db_report_changes()
121 dc) in esas2r_targ_db_add_raid()
127 if (dc->curr_virt_id >= ESAS2R_MAX_TARGETS) { in esas2r_targ_db_add_raid()
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()
140 esas2r_hdebug("add RAID %s, T:%d", dc->raid_grp_name, in esas2r_targ_db_add_raid()
145 if (dc->interleave == 0 in esas2r_targ_db_add_raid()
146 || dc->block_size == 0) { 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()
173 struct esas2r_disc_context *dc, in esas2r_targ_db_add_pthru() argument
181 if (dc->curr_virt_id >= ESAS2R_MAX_TARGETS) { 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()
202 dc->curr_virt_id, in esas2r_targ_db_add_pthru()
203 dc->curr_phys_id); 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()
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()
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()
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()
262 u16 id = target_id + 1; in esas2r_targ_db_find_next_present() local
264 while (id < ESAS2R_MAX_TARGETS) { in esas2r_targ_db_find_next_present()
265 struct esas2r_target *t = a->targetdb + id; in esas2r_targ_db_find_next_present()
267 if (t->target_state == TS_PRESENT) in esas2r_targ_db_find_next_present()
270 id++; in esas2r_targ_db_find_next_present()
273 return id; in esas2r_targ_db_find_next_present()
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()
298 spin_lock_irqsave(&a->mem_lock, flags); in esas2r_targ_db_get_tgt_cnt()
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()
303 spin_unlock_irqrestore(&a->mem_lock, flags); in esas2r_targ_db_get_tgt_cnt()