Lines Matching refs:disc
191 list_for_each_safe(cur, nxt, &snic->disc.tgt_list) { in snic_tgt_lookup()
305 list_add_tail(&tgt->list, &snic->disc.tgt_list); in snic_tgt_create()
306 tgt->scsi_tgt_id = snic->disc.nxt_tgt_id++; in snic_tgt_create()
347 kfree(snic->disc.rtgt_info); in snic_handle_tgt_disc()
353 mutex_lock(&snic->disc.mutex); in snic_handle_tgt_disc()
355 if (snic->disc.req_cnt) { in snic_handle_tgt_disc()
356 snic->disc.state = SNIC_DISC_DONE; in snic_handle_tgt_disc()
357 snic->disc.req_cnt = 0; in snic_handle_tgt_disc()
358 mutex_unlock(&snic->disc.mutex); in snic_handle_tgt_disc()
359 kfree(snic->disc.rtgt_info); in snic_handle_tgt_disc()
360 snic->disc.rtgt_info = NULL; in snic_handle_tgt_disc()
369 tgtid = (struct snic_tgt_id *)snic->disc.rtgt_info; in snic_handle_tgt_disc()
371 SNIC_BUG_ON(snic->disc.rtgt_cnt == 0 || tgtid == NULL); in snic_handle_tgt_disc()
373 for (i = 0; i < snic->disc.rtgt_cnt; i++) { in snic_handle_tgt_disc()
376 int buf_sz = snic->disc.rtgt_cnt * sizeof(*tgtid); in snic_handle_tgt_disc()
384 snic->disc.rtgt_info = NULL; in snic_handle_tgt_disc()
385 snic->disc.state = SNIC_DISC_DONE; in snic_handle_tgt_disc()
386 mutex_unlock(&snic->disc.mutex); in snic_handle_tgt_disc()
431 snic->disc.rtgt_cnt = tgt_cnt; in snic_report_tgt_cmpl_handler()
432 snic->disc.rtgt_info = (u8 *) tgtid; in snic_report_tgt_cmpl_handler()
450 snic_disc_init(struct snic_disc *disc) in snic_disc_init() argument
452 INIT_LIST_HEAD(&disc->tgt_list); in snic_disc_init()
453 mutex_init(&disc->mutex); in snic_disc_init()
454 disc->disc_id = 0; in snic_disc_init()
455 disc->nxt_tgt_id = 0; in snic_disc_init()
456 disc->state = SNIC_DISC_INIT; in snic_disc_init()
457 disc->req_cnt = 0; in snic_disc_init()
458 disc->rtgt_cnt = 0; in snic_disc_init()
459 disc->rtgt_info = NULL; in snic_disc_init()
460 disc->cb = NULL; in snic_disc_init()
467 struct snic_disc *disc = &snic->disc; in snic_disc_term() local
469 mutex_lock(&disc->mutex); in snic_disc_term()
470 if (disc->req_cnt) { in snic_disc_term()
471 disc->req_cnt = 0; in snic_disc_term()
474 mutex_unlock(&disc->mutex); in snic_disc_term()
483 struct snic_disc *disc = &snic->disc; in snic_disc_start() local
499 mutex_lock(&disc->mutex); in snic_disc_start()
500 if (disc->state == SNIC_DISC_PENDING) { in snic_disc_start()
501 disc->req_cnt++; in snic_disc_start()
502 mutex_unlock(&disc->mutex); in snic_disc_start()
506 disc->state = SNIC_DISC_PENDING; in snic_disc_start()
507 mutex_unlock(&disc->mutex); in snic_disc_start()
550 mutex_lock(&snic->disc.mutex); in snic_tgt_del_all()
553 list_for_each_safe(cur, nxt, &snic->disc.tgt_list) { in snic_tgt_del_all()
562 mutex_unlock(&snic->disc.mutex); in snic_tgt_del_all()