Lines Matching refs:session
90 struct Scsi_Host *shost = conn->session->host; in iscsi_conn_queue_xmit()
100 struct Scsi_Host *shost = conn->session->host; in iscsi_conn_queue_recv()
108 static void __iscsi_update_cmdsn(struct iscsi_session *session, in __iscsi_update_cmdsn() argument
118 if (exp_cmdsn != session->exp_cmdsn && in __iscsi_update_cmdsn()
119 !iscsi_sna_lt(exp_cmdsn, session->exp_cmdsn)) in __iscsi_update_cmdsn()
120 session->exp_cmdsn = exp_cmdsn; in __iscsi_update_cmdsn()
122 if (max_cmdsn != session->max_cmdsn && in __iscsi_update_cmdsn()
123 !iscsi_sna_lt(max_cmdsn, session->max_cmdsn)) in __iscsi_update_cmdsn()
124 session->max_cmdsn = max_cmdsn; in __iscsi_update_cmdsn()
127 void iscsi_update_cmdsn(struct iscsi_session *session, struct iscsi_nopin *hdr) in iscsi_update_cmdsn() argument
129 __iscsi_update_cmdsn(session, be32_to_cpu(hdr->exp_cmdsn), in iscsi_update_cmdsn()
222 ISCSI_DBG_SESSION(task->conn->session, in iscsi_prep_ecdb_ahs()
245 struct iscsi_session *session = task->conn->session; in iscsi_check_tmf_restrictions() local
246 struct iscsi_tm *tmf = &session->tmhdr; in iscsi_check_tmf_restrictions()
249 if (session->tmf_state == TMF_INITIAL) in iscsi_check_tmf_restrictions()
269 iscsi_session_printk(KERN_INFO, session, in iscsi_check_tmf_restrictions()
278 if (session->fast_abort) { in iscsi_check_tmf_restrictions()
279 iscsi_session_printk(KERN_INFO, session, in iscsi_check_tmf_restrictions()
294 ISCSI_DBG_SESSION(session, in iscsi_check_tmf_restrictions()
317 struct iscsi_session *session = conn->session; in iscsi_prep_scsi_cmd_pdu() local
328 if (conn->session->tt->alloc_pdu) { in iscsi_prep_scsi_cmd_pdu()
329 rc = conn->session->tt->alloc_pdu(task, ISCSI_OP_SCSI_CMD); in iscsi_prep_scsi_cmd_pdu()
337 if (session->tt->parse_pdu_itt) in iscsi_prep_scsi_cmd_pdu()
341 task->conn->session->age); in iscsi_prep_scsi_cmd_pdu()
388 if (session->imm_data_en) { in iscsi_prep_scsi_cmd_pdu()
389 if (transfer_length >= session->first_burst) in iscsi_prep_scsi_cmd_pdu()
390 task->imm_count = min(session->first_burst, in iscsi_prep_scsi_cmd_pdu()
399 if (!session->initial_r2t_en) { in iscsi_prep_scsi_cmd_pdu()
400 r2t->data_length = min(session->first_burst, in iscsi_prep_scsi_cmd_pdu()
427 hdr->cmdsn = task->cmdsn = cpu_to_be32(session->cmdsn); in iscsi_prep_scsi_cmd_pdu()
429 if (session->tt->init_task && session->tt->init_task(task)) in iscsi_prep_scsi_cmd_pdu()
433 session->cmdsn++; in iscsi_prep_scsi_cmd_pdu()
436 ISCSI_DBG_SESSION(session, "iscsi prep [%s cid %d sc %p cdb 0x%x " in iscsi_prep_scsi_cmd_pdu()
441 session->cmdsn, in iscsi_prep_scsi_cmd_pdu()
442 session->max_cmdsn - session->exp_cmdsn + 1); in iscsi_prep_scsi_cmd_pdu()
457 struct iscsi_session *session = conn->session; in iscsi_free_task() local
461 ISCSI_DBG_SESSION(session, "freeing task itt 0x%x state %d sc %p\n", in iscsi_free_task()
464 session->tt->cleanup_task(task); in iscsi_free_task()
473 kfifo_in(&session->cmdpool.queue, (void*)&task, sizeof(void*)); in iscsi_free_task()
508 struct iscsi_session *session = task->conn->session; in iscsi_put_task() local
511 spin_lock_bh(&session->back_lock); in iscsi_put_task()
513 spin_unlock_bh(&session->back_lock); in iscsi_put_task()
529 ISCSI_DBG_SESSION(conn->session, in iscsi_complete_task()
563 ISCSI_DBG_SESSION(conn->session, "[itt 0x%x]\n", task->itt); in iscsi_complete_scsi_task()
566 __iscsi_update_cmdsn(conn->session, exp_cmdsn, max_cmdsn); in iscsi_complete_scsi_task()
598 if (conn->session->running_aborted_task == task) { in cleanup_queued_task()
599 conn->session->running_aborted_task = NULL; in cleanup_queued_task()
629 conn->session->queued_cmdsn--; in __fail_scsi_task()
645 struct iscsi_session *session = task->conn->session; in fail_scsi_task() local
647 spin_lock_bh(&session->back_lock); in fail_scsi_task()
649 spin_unlock_bh(&session->back_lock); in fail_scsi_task()
655 struct iscsi_session *session = conn->session; in iscsi_prep_mgmt_task() local
660 if (conn->session->state == ISCSI_STATE_LOGGING_OUT) in iscsi_prep_mgmt_task()
668 nop->cmdsn = cpu_to_be32(session->cmdsn); in iscsi_prep_mgmt_task()
680 session->queued_cmdsn++; in iscsi_prep_mgmt_task()
681 session->cmdsn++; in iscsi_prep_mgmt_task()
685 if (session->tt->init_task && session->tt->init_task(task)) in iscsi_prep_mgmt_task()
689 session->state = ISCSI_STATE_LOGGING_OUT; in iscsi_prep_mgmt_task()
692 ISCSI_DBG_SESSION(session, "mgmtpdu [op 0x%x hdr->itt 0x%x " in iscsi_prep_mgmt_task()
709 struct iscsi_session *session = conn->session; in iscsi_alloc_mgmt_task() local
714 if (session->state == ISCSI_STATE_TERMINATE || in iscsi_alloc_mgmt_task()
738 if (session->state != ISCSI_STATE_LOGGED_IN) in iscsi_alloc_mgmt_task()
749 if (!kfifo_out(&session->cmdpool.queue, in iscsi_alloc_mgmt_task()
770 if (conn->session->tt->alloc_pdu) { in iscsi_alloc_mgmt_task()
771 if (conn->session->tt->alloc_pdu(task, hdr->opcode)) { in iscsi_alloc_mgmt_task()
783 if (session->tt->parse_pdu_itt) in iscsi_alloc_mgmt_task()
787 task->conn->session->age); in iscsi_alloc_mgmt_task()
807 struct iscsi_session *session = conn->session; in iscsi_send_mgmt_task() local
808 struct iscsi_host *ihost = shost_priv(conn->session->host); in iscsi_send_mgmt_task()
816 rc = session->tt->xmit_task(task); in iscsi_send_mgmt_task()
847 struct iscsi_session *session = conn->session; in iscsi_conn_send_pdu() local
850 spin_lock_bh(&session->frwd_lock); in iscsi_conn_send_pdu()
853 spin_unlock_bh(&session->frwd_lock); in iscsi_conn_send_pdu()
874 struct iscsi_session *session = conn->session; in iscsi_scsi_cmd_rsp() local
877 iscsi_update_cmdsn(session, (struct iscsi_nopin*)rhdr); in iscsi_scsi_cmd_rsp()
891 BUG_ON(!session->tt->check_protection); in iscsi_scsi_cmd_rsp()
893 ascq = session->tt->check_protection(task, §or); in iscsi_scsi_cmd_rsp()
926 ISCSI_DBG_SESSION(session, "copied %d bytes of sense\n", in iscsi_scsi_cmd_rsp()
949 ISCSI_DBG_SESSION(session, "cmd rsp done [sc %p res %d itt 0x%x]\n", in iscsi_scsi_cmd_rsp()
974 iscsi_update_cmdsn(conn->session, (struct iscsi_nopin *)hdr); in iscsi_data_in_rsp()
989 ISCSI_DBG_SESSION(conn->session, "data in with status done " in iscsi_data_in_rsp()
999 struct iscsi_session *session = conn->session; in iscsi_tmf_rsp() local
1004 if (session->tmf_state != TMF_QUEUED) in iscsi_tmf_rsp()
1008 session->tmf_state = TMF_SUCCESS; in iscsi_tmf_rsp()
1010 session->tmf_state = TMF_NOT_FOUND; in iscsi_tmf_rsp()
1012 session->tmf_state = TMF_FAILED; in iscsi_tmf_rsp()
1013 wake_up(&session->ehwait); in iscsi_tmf_rsp()
1138 spin_unlock(&conn->session->back_lock); in iscsi_handle_reject()
1139 spin_lock(&conn->session->frwd_lock); in iscsi_handle_reject()
1142 spin_unlock(&conn->session->frwd_lock); in iscsi_handle_reject()
1143 spin_lock(&conn->session->back_lock); in iscsi_handle_reject()
1184 struct iscsi_session *session = conn->session; in iscsi_itt_to_task() local
1190 if (session->tt->parse_pdu_itt) in iscsi_itt_to_task()
1191 session->tt->parse_pdu_itt(conn, itt, &i, NULL); in iscsi_itt_to_task()
1194 if (i >= session->cmds_max) in iscsi_itt_to_task()
1197 return session->cmds[i]; in iscsi_itt_to_task()
1215 struct iscsi_session *session = conn->session; in __iscsi_complete_pdu() local
1230 ISCSI_DBG_SESSION(session, "[op 0x%x cid %d itt 0x%x len %d]\n", in __iscsi_complete_pdu()
1234 iscsi_update_cmdsn(session, (struct iscsi_nopin*)hdr); in __iscsi_complete_pdu()
1247 spin_unlock(&session->back_lock); in __iscsi_complete_pdu()
1248 spin_lock(&session->frwd_lock); in __iscsi_complete_pdu()
1250 spin_unlock(&session->frwd_lock); in __iscsi_complete_pdu()
1251 spin_lock(&session->back_lock); in __iscsi_complete_pdu()
1302 iscsi_update_cmdsn(session, (struct iscsi_nopin*)hdr); in __iscsi_complete_pdu()
1311 iscsi_update_cmdsn(session, (struct iscsi_nopin*)hdr); in __iscsi_complete_pdu()
1318 iscsi_update_cmdsn(session, (struct iscsi_nopin*)hdr); in __iscsi_complete_pdu()
1328 iscsi_update_cmdsn(session, (struct iscsi_nopin*)hdr); in __iscsi_complete_pdu()
1358 spin_lock(&conn->session->back_lock); in iscsi_complete_pdu()
1360 spin_unlock(&conn->session->back_lock); in iscsi_complete_pdu()
1367 struct iscsi_session *session = conn->session; in iscsi_verify_itt() local
1373 if (session->tt->parse_pdu_itt) in iscsi_verify_itt()
1374 session->tt->parse_pdu_itt(conn, itt, &i, &age); in iscsi_verify_itt()
1380 if (age != session->age) { in iscsi_verify_itt()
1383 (__force u32)itt, session->age); in iscsi_verify_itt()
1387 if (i >= session->cmds_max) { in iscsi_verify_itt()
1390 "%u.\n", i, session->cmds_max); in iscsi_verify_itt()
1417 if (iscsi_cmd(task->sc)->age != conn->session->age) { in iscsi_itt_to_ctask()
1418 iscsi_session_printk(KERN_ERR, conn->session, in iscsi_itt_to_ctask()
1420 iscsi_cmd(task->sc)->age, conn->session->age); in iscsi_itt_to_ctask()
1428 void iscsi_session_failure(struct iscsi_session *session, in iscsi_session_failure() argument
1433 spin_lock_bh(&session->frwd_lock); in iscsi_session_failure()
1434 conn = session->leadconn; in iscsi_session_failure()
1435 if (session->state == ISCSI_STATE_TERMINATE || !conn) { in iscsi_session_failure()
1436 spin_unlock_bh(&session->frwd_lock); in iscsi_session_failure()
1441 spin_unlock_bh(&session->frwd_lock); in iscsi_session_failure()
1457 struct iscsi_session *session = conn->session; in iscsi_set_conn_failed() local
1459 if (session->state == ISCSI_STATE_FAILED) in iscsi_set_conn_failed()
1463 session->state = ISCSI_STATE_FAILED; in iscsi_set_conn_failed()
1472 struct iscsi_session *session = conn->session; in iscsi_conn_failure() local
1475 spin_lock_bh(&session->frwd_lock); in iscsi_conn_failure()
1477 spin_unlock_bh(&session->frwd_lock); in iscsi_conn_failure()
1486 struct iscsi_session *session = conn->session; in iscsi_check_cmdsn_window_closed() local
1491 if (!iscsi_sna_lte(session->queued_cmdsn, session->max_cmdsn)) { in iscsi_check_cmdsn_window_closed()
1492 ISCSI_DBG_SESSION(session, "iSCSI CmdSN closed. ExpCmdSn " in iscsi_check_cmdsn_window_closed()
1494 session->exp_cmdsn, session->max_cmdsn, in iscsi_check_cmdsn_window_closed()
1495 session->cmdsn, session->queued_cmdsn); in iscsi_check_cmdsn_window_closed()
1542 spin_unlock_bh(&conn->session->frwd_lock); in iscsi_xmit_task()
1543 rc = conn->session->tt->xmit_task(task); in iscsi_xmit_task()
1544 spin_lock_bh(&conn->session->frwd_lock); in iscsi_xmit_task()
1575 spin_lock_bh(&conn->session->frwd_lock); in iscsi_requeue_task()
1586 spin_unlock_bh(&conn->session->frwd_lock); in iscsi_requeue_task()
1604 spin_lock_bh(&conn->session->frwd_lock); in iscsi_data_xmit()
1606 ISCSI_DBG_SESSION(conn->session, "Tx suspended!\n"); in iscsi_data_xmit()
1607 spin_unlock_bh(&conn->session->frwd_lock); in iscsi_data_xmit()
1629 spin_lock_bh(&conn->session->back_lock); in iscsi_data_xmit()
1631 spin_unlock_bh(&conn->session->back_lock); in iscsi_data_xmit()
1644 if (conn->session->state == ISCSI_STATE_LOGGING_OUT) in iscsi_data_xmit()
1666 if (conn->session->state == ISCSI_STATE_LOGGING_OUT) { in iscsi_data_xmit()
1692 spin_unlock_bh(&conn->session->frwd_lock); in iscsi_data_xmit()
1696 spin_unlock_bh(&conn->session->frwd_lock); in iscsi_data_xmit()
1718 if (!kfifo_out(&conn->session->cmdpool.queue, in iscsi_alloc_task()
1722 iscsi_cmd(sc)->age = conn->session->age; in iscsi_alloc_task()
1755 struct iscsi_session *session; in iscsi_queuecommand() local
1765 session = cls_session->dd_data; in iscsi_queuecommand()
1766 spin_lock_bh(&session->frwd_lock); in iscsi_queuecommand()
1774 if (session->state != ISCSI_STATE_LOGGED_IN) { in iscsi_queuecommand()
1781 switch (session->state) { in iscsi_queuecommand()
1816 conn = session->leadconn; in iscsi_queuecommand()
1851 if (session->tt->xmit_task(task)) { in iscsi_queuecommand()
1852 session->cmdsn--; in iscsi_queuecommand()
1861 session->queued_cmdsn++; in iscsi_queuecommand()
1862 spin_unlock_bh(&session->frwd_lock); in iscsi_queuecommand()
1866 spin_lock_bh(&session->back_lock); in iscsi_queuecommand()
1868 spin_unlock_bh(&session->back_lock); in iscsi_queuecommand()
1870 spin_unlock_bh(&session->frwd_lock); in iscsi_queuecommand()
1871 ISCSI_DBG_SESSION(session, "cmd 0x%x rejected (%d)\n", in iscsi_queuecommand()
1876 spin_lock_bh(&session->back_lock); in iscsi_queuecommand()
1878 spin_unlock_bh(&session->back_lock); in iscsi_queuecommand()
1880 spin_unlock_bh(&session->frwd_lock); in iscsi_queuecommand()
1881 ISCSI_DBG_SESSION(session, "iscsi: cmd 0x%x is not queued (%d)\n", in iscsi_queuecommand()
1892 struct iscsi_session *session = cls_session->dd_data; in iscsi_target_alloc() local
1894 starget->can_queue = session->scsi_cmds_max; in iscsi_target_alloc()
1901 struct iscsi_session *session = from_timer(session, t, tmf_timer); in iscsi_tmf_timedout() local
1903 spin_lock(&session->frwd_lock); in iscsi_tmf_timedout()
1904 if (session->tmf_state == TMF_QUEUED) { in iscsi_tmf_timedout()
1905 session->tmf_state = TMF_TIMEDOUT; in iscsi_tmf_timedout()
1906 ISCSI_DBG_EH(session, "tmf timedout\n"); in iscsi_tmf_timedout()
1908 wake_up(&session->ehwait); in iscsi_tmf_timedout()
1910 spin_unlock(&session->frwd_lock); in iscsi_tmf_timedout()
1916 __must_hold(&session->frwd_lock) in iscsi_exec_task_mgmt_fn()
1918 struct iscsi_session *session = conn->session; in iscsi_exec_task_mgmt_fn() local
1921 spin_unlock_bh(&session->frwd_lock); in iscsi_exec_task_mgmt_fn()
1924 spin_lock_bh(&session->frwd_lock); in iscsi_exec_task_mgmt_fn()
1928 session->tmf_timer.expires = timeout * HZ + jiffies; in iscsi_exec_task_mgmt_fn()
1929 add_timer(&session->tmf_timer); in iscsi_exec_task_mgmt_fn()
1930 ISCSI_DBG_EH(session, "tmf set timeout\n"); in iscsi_exec_task_mgmt_fn()
1932 spin_unlock_bh(&session->frwd_lock); in iscsi_exec_task_mgmt_fn()
1933 mutex_unlock(&session->eh_mutex); in iscsi_exec_task_mgmt_fn()
1943 wait_event_interruptible(session->ehwait, age != session->age || in iscsi_exec_task_mgmt_fn()
1944 session->state != ISCSI_STATE_LOGGED_IN || in iscsi_exec_task_mgmt_fn()
1945 session->tmf_state != TMF_QUEUED); in iscsi_exec_task_mgmt_fn()
1948 del_timer_sync(&session->tmf_timer); in iscsi_exec_task_mgmt_fn()
1950 mutex_lock(&session->eh_mutex); in iscsi_exec_task_mgmt_fn()
1951 spin_lock_bh(&session->frwd_lock); in iscsi_exec_task_mgmt_fn()
1953 if (age != session->age || in iscsi_exec_task_mgmt_fn()
1954 session->state != ISCSI_STATE_LOGGED_IN) in iscsi_exec_task_mgmt_fn()
1964 struct iscsi_session *session = conn->session; in fail_scsi_tasks() local
1969 spin_lock_bh(&session->back_lock); in fail_scsi_tasks()
1970 for (i = 0; i < session->cmds_max; i++) { in fail_scsi_tasks()
1971 task = session->cmds[i]; in fail_scsi_tasks()
1983 spin_unlock_bh(&session->back_lock); in fail_scsi_tasks()
1984 spin_unlock_bh(&session->frwd_lock); in fail_scsi_tasks()
1986 spin_lock_bh(&session->frwd_lock); in fail_scsi_tasks()
1990 ISCSI_DBG_SESSION(session, in fail_scsi_tasks()
1996 spin_unlock_bh(&session->back_lock); in fail_scsi_tasks()
2012 spin_lock_bh(&conn->session->frwd_lock); in iscsi_suspend_queue()
2014 spin_unlock_bh(&conn->session->frwd_lock); in iscsi_suspend_queue()
2028 struct Scsi_Host *shost = conn->session->host; in iscsi_suspend_tx()
2049 struct Scsi_Host *shost = conn->session->host; in iscsi_suspend_rx()
2079 struct iscsi_session *session; in iscsi_eh_cmd_timed_out() local
2084 session = cls_session->dd_data; in iscsi_eh_cmd_timed_out()
2086 ISCSI_DBG_EH(session, "scsi cmd %p timedout\n", sc); in iscsi_eh_cmd_timed_out()
2088 spin_lock_bh(&session->frwd_lock); in iscsi_eh_cmd_timed_out()
2089 spin_lock(&session->back_lock); in iscsi_eh_cmd_timed_out()
2097 spin_unlock(&session->back_lock); in iscsi_eh_cmd_timed_out()
2107 spin_unlock(&session->back_lock); in iscsi_eh_cmd_timed_out()
2110 spin_unlock(&session->back_lock); in iscsi_eh_cmd_timed_out()
2112 if (session->state != ISCSI_STATE_LOGGED_IN) { in iscsi_eh_cmd_timed_out()
2122 ISCSI_DBG_EH(session, "sc on shutdown, handled\n"); in iscsi_eh_cmd_timed_out()
2134 conn = session->leadconn; in iscsi_eh_cmd_timed_out()
2149 ISCSI_DBG_EH(session, "Command making progress. Asking " in iscsi_eh_cmd_timed_out()
2169 spin_lock(&session->back_lock); in iscsi_eh_cmd_timed_out()
2170 for (i = 0; i < conn->session->cmds_max; i++) { in iscsi_eh_cmd_timed_out()
2171 running_task = conn->session->cmds[i]; in iscsi_eh_cmd_timed_out()
2195 ISCSI_DBG_EH(session, "Command has not made progress " in iscsi_eh_cmd_timed_out()
2202 spin_unlock(&session->back_lock); in iscsi_eh_cmd_timed_out()
2207 spin_unlock(&session->back_lock); in iscsi_eh_cmd_timed_out()
2229 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_cmd_timed_out()
2235 ISCSI_DBG_EH(session, "return %s\n", rc == SCSI_EH_RESET_TIMER ? in iscsi_eh_cmd_timed_out()
2244 struct iscsi_session *session = conn->session; in iscsi_check_transport_timeouts() local
2247 spin_lock(&session->frwd_lock); in iscsi_check_transport_timeouts()
2248 if (session->state != ISCSI_STATE_LOGGED_IN) in iscsi_check_transport_timeouts()
2264 spin_unlock(&session->frwd_lock); in iscsi_check_transport_timeouts()
2282 spin_unlock(&session->frwd_lock); in iscsi_check_transport_timeouts()
2296 struct iscsi_session *session; in iscsi_conn_unbind() local
2303 session = conn->session; in iscsi_conn_unbind()
2310 mutex_lock(&session->eh_mutex); in iscsi_conn_unbind()
2315 spin_lock_bh(&session->frwd_lock); in iscsi_conn_unbind()
2324 if (session->state == ISCSI_STATE_LOGGED_IN) in iscsi_conn_unbind()
2327 spin_unlock_bh(&session->frwd_lock); in iscsi_conn_unbind()
2328 mutex_unlock(&session->eh_mutex); in iscsi_conn_unbind()
2347 struct iscsi_session *session; in iscsi_eh_abort() local
2354 session = cls_session->dd_data; in iscsi_eh_abort()
2356 ISCSI_DBG_EH(session, "aborting sc %p\n", sc); in iscsi_eh_abort()
2359 mutex_lock(&session->eh_mutex); in iscsi_eh_abort()
2360 spin_lock_bh(&session->frwd_lock); in iscsi_eh_abort()
2366 ISCSI_DBG_EH(session, "sc never reached iscsi layer or " in iscsi_eh_abort()
2368 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_abort()
2369 mutex_unlock(&session->eh_mutex); in iscsi_eh_abort()
2377 if (!session->leadconn || session->state != ISCSI_STATE_LOGGED_IN || in iscsi_eh_abort()
2378 iscsi_cmd(sc)->age != session->age) { in iscsi_eh_abort()
2379 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_abort()
2380 mutex_unlock(&session->eh_mutex); in iscsi_eh_abort()
2381 ISCSI_DBG_EH(session, "failing abort due to dropped " in iscsi_eh_abort()
2386 spin_lock(&session->back_lock); in iscsi_eh_abort()
2390 ISCSI_DBG_EH(session, "sc completed while abort in progress\n"); in iscsi_eh_abort()
2392 spin_unlock(&session->back_lock); in iscsi_eh_abort()
2393 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_abort()
2394 mutex_unlock(&session->eh_mutex); in iscsi_eh_abort()
2399 spin_unlock(&session->back_lock); in iscsi_eh_abort()
2400 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_abort()
2401 mutex_unlock(&session->eh_mutex); in iscsi_eh_abort()
2407 ISCSI_DBG_EH(session, "aborting [sc %p itt 0x%x]\n", sc, task->itt); in iscsi_eh_abort()
2408 conn = session->leadconn; in iscsi_eh_abort()
2411 age = session->age; in iscsi_eh_abort()
2412 spin_unlock(&session->back_lock); in iscsi_eh_abort()
2420 if (session->tmf_state != TMF_INITIAL) in iscsi_eh_abort()
2422 session->tmf_state = TMF_QUEUED; in iscsi_eh_abort()
2424 hdr = &session->tmhdr; in iscsi_eh_abort()
2427 if (iscsi_exec_task_mgmt_fn(conn, hdr, age, session->abort_timeout)) in iscsi_eh_abort()
2430 switch (session->tmf_state) { in iscsi_eh_abort()
2432 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_abort()
2443 spin_lock_bh(&session->frwd_lock); in iscsi_eh_abort()
2445 session->tmf_state = TMF_INITIAL; in iscsi_eh_abort()
2447 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_abort()
2451 session->running_aborted_task = task; in iscsi_eh_abort()
2452 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_abort()
2457 session->tmf_state = TMF_INITIAL; in iscsi_eh_abort()
2460 ISCSI_DBG_EH(session, "sc completed while abort in " in iscsi_eh_abort()
2466 session->tmf_state = TMF_INITIAL; in iscsi_eh_abort()
2471 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_abort()
2473 ISCSI_DBG_EH(session, "abort success [sc %p itt 0x%x]\n", in iscsi_eh_abort()
2477 mutex_unlock(&session->eh_mutex); in iscsi_eh_abort()
2481 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_abort()
2483 ISCSI_DBG_EH(session, "abort failed [sc %p itt 0x%x]\n", sc, in iscsi_eh_abort()
2490 if (!session->running_aborted_task) in iscsi_eh_abort()
2494 mutex_unlock(&session->eh_mutex); in iscsi_eh_abort()
2512 struct iscsi_session *session; in iscsi_eh_device_reset() local
2518 session = cls_session->dd_data; in iscsi_eh_device_reset()
2520 ISCSI_DBG_EH(session, "LU Reset [sc %p lun %llu]\n", sc, in iscsi_eh_device_reset()
2523 mutex_lock(&session->eh_mutex); in iscsi_eh_device_reset()
2524 spin_lock_bh(&session->frwd_lock); in iscsi_eh_device_reset()
2529 if (!session->leadconn || session->state != ISCSI_STATE_LOGGED_IN) in iscsi_eh_device_reset()
2531 conn = session->leadconn; in iscsi_eh_device_reset()
2534 if (session->tmf_state != TMF_INITIAL) in iscsi_eh_device_reset()
2536 session->tmf_state = TMF_QUEUED; in iscsi_eh_device_reset()
2538 hdr = &session->tmhdr; in iscsi_eh_device_reset()
2541 if (iscsi_exec_task_mgmt_fn(conn, hdr, session->age, in iscsi_eh_device_reset()
2542 session->lu_reset_timeout)) { in iscsi_eh_device_reset()
2547 switch (session->tmf_state) { in iscsi_eh_device_reset()
2551 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_device_reset()
2555 session->tmf_state = TMF_INITIAL; in iscsi_eh_device_reset()
2560 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_device_reset()
2564 spin_lock_bh(&session->frwd_lock); in iscsi_eh_device_reset()
2567 session->tmf_state = TMF_INITIAL; in iscsi_eh_device_reset()
2568 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_device_reset()
2574 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_device_reset()
2576 ISCSI_DBG_EH(session, "dev reset result = %s\n", in iscsi_eh_device_reset()
2578 mutex_unlock(&session->eh_mutex); in iscsi_eh_device_reset()
2585 struct iscsi_session *session = cls_session->dd_data; in iscsi_session_recovery_timedout() local
2587 spin_lock_bh(&session->frwd_lock); in iscsi_session_recovery_timedout()
2588 if (session->state != ISCSI_STATE_LOGGED_IN) { in iscsi_session_recovery_timedout()
2589 session->state = ISCSI_STATE_RECOVERY_FAILED; in iscsi_session_recovery_timedout()
2590 wake_up(&session->ehwait); in iscsi_session_recovery_timedout()
2592 spin_unlock_bh(&session->frwd_lock); in iscsi_session_recovery_timedout()
2606 struct iscsi_session *session; in iscsi_eh_session_reset() local
2610 session = cls_session->dd_data; in iscsi_eh_session_reset()
2612 mutex_lock(&session->eh_mutex); in iscsi_eh_session_reset()
2613 spin_lock_bh(&session->frwd_lock); in iscsi_eh_session_reset()
2614 if (session->state == ISCSI_STATE_TERMINATE) { in iscsi_eh_session_reset()
2616 ISCSI_DBG_EH(session, in iscsi_eh_session_reset()
2618 "%s [age %d]\n", session->targetname, in iscsi_eh_session_reset()
2619 session->age); in iscsi_eh_session_reset()
2620 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_session_reset()
2621 mutex_unlock(&session->eh_mutex); in iscsi_eh_session_reset()
2625 conn = session->leadconn; in iscsi_eh_session_reset()
2628 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_session_reset()
2629 mutex_unlock(&session->eh_mutex); in iscsi_eh_session_reset()
2634 ISCSI_DBG_EH(session, "wait for relogin\n"); in iscsi_eh_session_reset()
2635 wait_event_interruptible(session->ehwait, in iscsi_eh_session_reset()
2636 session->state == ISCSI_STATE_TERMINATE || in iscsi_eh_session_reset()
2637 session->state == ISCSI_STATE_LOGGED_IN || in iscsi_eh_session_reset()
2638 session->state == ISCSI_STATE_RECOVERY_FAILED); in iscsi_eh_session_reset()
2642 mutex_lock(&session->eh_mutex); in iscsi_eh_session_reset()
2643 spin_lock_bh(&session->frwd_lock); in iscsi_eh_session_reset()
2644 if (session->state == ISCSI_STATE_LOGGED_IN) { in iscsi_eh_session_reset()
2645 ISCSI_DBG_EH(session, in iscsi_eh_session_reset()
2647 session->targetname, conn->persistent_address); in iscsi_eh_session_reset()
2650 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_session_reset()
2651 mutex_unlock(&session->eh_mutex); in iscsi_eh_session_reset()
2674 struct iscsi_session *session; in iscsi_eh_target_reset() local
2680 session = cls_session->dd_data; in iscsi_eh_target_reset()
2682 ISCSI_DBG_EH(session, "tgt Reset [sc %p tgt %s]\n", sc, in iscsi_eh_target_reset()
2683 session->targetname); in iscsi_eh_target_reset()
2685 mutex_lock(&session->eh_mutex); in iscsi_eh_target_reset()
2686 spin_lock_bh(&session->frwd_lock); in iscsi_eh_target_reset()
2691 if (!session->leadconn || session->state != ISCSI_STATE_LOGGED_IN) in iscsi_eh_target_reset()
2693 conn = session->leadconn; in iscsi_eh_target_reset()
2696 if (session->tmf_state != TMF_INITIAL) in iscsi_eh_target_reset()
2698 session->tmf_state = TMF_QUEUED; in iscsi_eh_target_reset()
2700 hdr = &session->tmhdr; in iscsi_eh_target_reset()
2703 if (iscsi_exec_task_mgmt_fn(conn, hdr, session->age, in iscsi_eh_target_reset()
2704 session->tgt_reset_timeout)) { in iscsi_eh_target_reset()
2709 switch (session->tmf_state) { in iscsi_eh_target_reset()
2713 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_target_reset()
2717 session->tmf_state = TMF_INITIAL; in iscsi_eh_target_reset()
2722 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_target_reset()
2726 spin_lock_bh(&session->frwd_lock); in iscsi_eh_target_reset()
2729 session->tmf_state = TMF_INITIAL; in iscsi_eh_target_reset()
2730 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_target_reset()
2736 spin_unlock_bh(&session->frwd_lock); in iscsi_eh_target_reset()
2738 ISCSI_DBG_EH(session, "tgt %s reset result = %s\n", session->targetname, in iscsi_eh_target_reset()
2740 mutex_unlock(&session->eh_mutex); in iscsi_eh_target_reset()
3023 struct iscsi_session *session; in iscsi_session_setup() local
3045 session = cls_session->dd_data; in iscsi_session_setup()
3046 session->cls_session = cls_session; in iscsi_session_setup()
3047 session->host = shost; in iscsi_session_setup()
3048 session->state = ISCSI_STATE_FREE; in iscsi_session_setup()
3049 session->fast_abort = 1; in iscsi_session_setup()
3050 session->tgt_reset_timeout = 30; in iscsi_session_setup()
3051 session->lu_reset_timeout = 15; in iscsi_session_setup()
3052 session->abort_timeout = 10; in iscsi_session_setup()
3053 session->scsi_cmds_max = scsi_cmds; in iscsi_session_setup()
3054 session->cmds_max = scsi_cmds + ISCSI_MGMT_CMDS_MAX; in iscsi_session_setup()
3055 session->queued_cmdsn = session->cmdsn = initial_cmdsn; in iscsi_session_setup()
3056 session->exp_cmdsn = initial_cmdsn + 1; in iscsi_session_setup()
3057 session->max_cmdsn = initial_cmdsn + 1; in iscsi_session_setup()
3058 session->max_r2t = 1; in iscsi_session_setup()
3059 session->tt = iscsit; in iscsi_session_setup()
3060 session->dd_data = cls_session->dd_data + sizeof(*session); in iscsi_session_setup()
3062 session->tmf_state = TMF_INITIAL; in iscsi_session_setup()
3063 timer_setup(&session->tmf_timer, iscsi_tmf_timedout, 0); in iscsi_session_setup()
3064 mutex_init(&session->eh_mutex); in iscsi_session_setup()
3065 init_waitqueue_head(&session->ehwait); in iscsi_session_setup()
3067 spin_lock_init(&session->frwd_lock); in iscsi_session_setup()
3068 spin_lock_init(&session->back_lock); in iscsi_session_setup()
3071 if (iscsi_pool_init(&session->cmdpool, session->cmds_max, in iscsi_session_setup()
3072 (void***)&session->cmds, in iscsi_session_setup()
3077 for (cmd_i = 0; cmd_i < session->cmds_max; cmd_i++) { in iscsi_session_setup()
3078 struct iscsi_task *task = session->cmds[cmd_i]; in iscsi_session_setup()
3098 iscsi_pool_free(&session->cmdpool); in iscsi_session_setup()
3112 struct iscsi_session *session = cls_session->dd_data; in iscsi_session_remove() local
3113 struct Scsi_Host *shost = session->host; in iscsi_session_remove()
3131 struct iscsi_session *session = cls_session->dd_data; in iscsi_session_free() local
3134 iscsi_pool_free(&session->cmdpool); in iscsi_session_free()
3135 kfree(session->password); in iscsi_session_free()
3136 kfree(session->password_in); in iscsi_session_free()
3137 kfree(session->username); in iscsi_session_free()
3138 kfree(session->username_in); in iscsi_session_free()
3139 kfree(session->targetname); in iscsi_session_free()
3140 kfree(session->targetalias); in iscsi_session_free()
3141 kfree(session->initiatorname); in iscsi_session_free()
3142 kfree(session->boot_root); in iscsi_session_free()
3143 kfree(session->boot_nic); in iscsi_session_free()
3144 kfree(session->boot_target); in iscsi_session_free()
3145 kfree(session->ifacename); in iscsi_session_free()
3146 kfree(session->portal_type); in iscsi_session_free()
3147 kfree(session->discovery_parent_type); in iscsi_session_free()
3175 struct iscsi_session *session = cls_session->dd_data; in iscsi_conn_setup() local
3188 conn->session = session; in iscsi_conn_setup()
3202 spin_lock_bh(&session->frwd_lock); in iscsi_conn_setup()
3203 if (!kfifo_out(&session->cmdpool.queue, in iscsi_conn_setup()
3206 spin_unlock_bh(&session->frwd_lock); in iscsi_conn_setup()
3209 spin_unlock_bh(&session->frwd_lock); in iscsi_conn_setup()
3228 kfifo_in(&session->cmdpool.queue, (void*)&conn->login_task, in iscsi_conn_setup()
3246 struct iscsi_session *session = conn->session; in iscsi_conn_teardown() local
3252 mutex_lock(&session->eh_mutex); in iscsi_conn_teardown()
3253 spin_lock_bh(&session->frwd_lock); in iscsi_conn_teardown()
3255 if (session->leadconn == conn) { in iscsi_conn_teardown()
3259 session->state = ISCSI_STATE_TERMINATE; in iscsi_conn_teardown()
3260 wake_up(&session->ehwait); in iscsi_conn_teardown()
3262 spin_unlock_bh(&session->frwd_lock); in iscsi_conn_teardown()
3267 spin_lock_bh(&session->frwd_lock); in iscsi_conn_teardown()
3273 spin_lock_bh(&session->back_lock); in iscsi_conn_teardown()
3274 kfifo_in(&session->cmdpool.queue, (void*)&conn->login_task, in iscsi_conn_teardown()
3276 spin_unlock_bh(&session->back_lock); in iscsi_conn_teardown()
3277 if (session->leadconn == conn) in iscsi_conn_teardown()
3278 session->leadconn = NULL; in iscsi_conn_teardown()
3279 spin_unlock_bh(&session->frwd_lock); in iscsi_conn_teardown()
3280 mutex_unlock(&session->eh_mutex); in iscsi_conn_teardown()
3289 struct iscsi_session *session = conn->session; in iscsi_conn_start() local
3291 if (!session) { in iscsi_conn_start()
3297 if ((session->imm_data_en || !session->initial_r2t_en) && in iscsi_conn_start()
3298 session->first_burst > session->max_burst) { in iscsi_conn_start()
3301 session->first_burst, session->max_burst); in iscsi_conn_start()
3317 spin_lock_bh(&session->frwd_lock); in iscsi_conn_start()
3319 session->state = ISCSI_STATE_LOGGED_IN; in iscsi_conn_start()
3320 session->queued_cmdsn = session->cmdsn; in iscsi_conn_start()
3335 session->tmf_state = TMF_INITIAL; in iscsi_conn_start()
3336 session->age++; in iscsi_conn_start()
3337 if (session->age == 16) in iscsi_conn_start()
3338 session->age = 0; in iscsi_conn_start()
3346 spin_unlock_bh(&session->frwd_lock); in iscsi_conn_start()
3348 iscsi_unblock_session(session->cls_session); in iscsi_conn_start()
3349 wake_up(&session->ehwait); in iscsi_conn_start()
3355 fail_mgmt_tasks(struct iscsi_session *session, struct iscsi_conn *conn) in fail_mgmt_tasks() argument
3360 for (i = 0; i < conn->session->cmds_max; i++) { in fail_mgmt_tasks()
3361 task = conn->session->cmds[i]; in fail_mgmt_tasks()
3368 ISCSI_DBG_SESSION(conn->session, in fail_mgmt_tasks()
3372 spin_lock_bh(&session->back_lock); in fail_mgmt_tasks()
3374 spin_unlock_bh(&session->back_lock); in fail_mgmt_tasks()
3382 spin_unlock_bh(&session->back_lock); in fail_mgmt_tasks()
3389 struct iscsi_session *session = conn->session; in iscsi_conn_stop() local
3392 mutex_lock(&session->eh_mutex); in iscsi_conn_stop()
3393 spin_lock_bh(&session->frwd_lock); in iscsi_conn_stop()
3395 spin_unlock_bh(&session->frwd_lock); in iscsi_conn_stop()
3396 mutex_unlock(&session->eh_mutex); in iscsi_conn_stop()
3406 session->state = ISCSI_STATE_TERMINATE; in iscsi_conn_stop()
3408 session->state = ISCSI_STATE_IN_RECOVERY; in iscsi_conn_stop()
3412 spin_unlock_bh(&session->frwd_lock); in iscsi_conn_stop()
3417 spin_lock_bh(&session->frwd_lock); in iscsi_conn_stop()
3419 spin_unlock_bh(&session->frwd_lock); in iscsi_conn_stop()
3430 if (session->state == ISCSI_STATE_IN_RECOVERY && in iscsi_conn_stop()
3432 ISCSI_DBG_SESSION(session, "blocking session\n"); in iscsi_conn_stop()
3433 iscsi_block_session(session->cls_session); in iscsi_conn_stop()
3440 spin_lock_bh(&session->frwd_lock); in iscsi_conn_stop()
3442 fail_mgmt_tasks(session, conn); in iscsi_conn_stop()
3443 memset(&session->tmhdr, 0, sizeof(session->tmhdr)); in iscsi_conn_stop()
3444 spin_unlock_bh(&session->frwd_lock); in iscsi_conn_stop()
3445 mutex_unlock(&session->eh_mutex); in iscsi_conn_stop()
3452 struct iscsi_session *session = cls_session->dd_data; in iscsi_conn_bind() local
3455 spin_lock_bh(&session->frwd_lock); in iscsi_conn_bind()
3457 session->leadconn = conn; in iscsi_conn_bind()
3460 spin_unlock_bh(&session->frwd_lock); in iscsi_conn_bind()
3466 spin_lock_bh(&session->back_lock); in iscsi_conn_bind()
3467 session->max_cmdsn = session->exp_cmdsn = session->cmdsn + 1; in iscsi_conn_bind()
3468 spin_unlock_bh(&session->back_lock); in iscsi_conn_bind()
3501 struct iscsi_session *session = conn->session; in iscsi_set_param() local
3506 sscanf(buf, "%d", &session->fast_abort); in iscsi_set_param()
3509 sscanf(buf, "%d", &session->abort_timeout); in iscsi_set_param()
3512 sscanf(buf, "%d", &session->lu_reset_timeout); in iscsi_set_param()
3515 sscanf(buf, "%d", &session->tgt_reset_timeout); in iscsi_set_param()
3536 sscanf(buf, "%d", &session->initial_r2t_en); in iscsi_set_param()
3539 sscanf(buf, "%hu", &session->max_r2t); in iscsi_set_param()
3542 sscanf(buf, "%d", &session->imm_data_en); in iscsi_set_param()
3545 sscanf(buf, "%d", &session->first_burst); in iscsi_set_param()
3548 sscanf(buf, "%d", &session->max_burst); in iscsi_set_param()
3551 sscanf(buf, "%d", &session->pdu_inorder_en); in iscsi_set_param()
3554 sscanf(buf, "%d", &session->dataseq_inorder_en); in iscsi_set_param()
3557 sscanf(buf, "%d", &session->erl); in iscsi_set_param()
3563 return iscsi_switch_str_param(&session->username, buf); in iscsi_set_param()
3565 return iscsi_switch_str_param(&session->username_in, buf); in iscsi_set_param()
3567 return iscsi_switch_str_param(&session->password, buf); in iscsi_set_param()
3569 return iscsi_switch_str_param(&session->password_in, buf); in iscsi_set_param()
3571 return iscsi_switch_str_param(&session->targetname, buf); in iscsi_set_param()
3573 return iscsi_switch_str_param(&session->targetalias, buf); in iscsi_set_param()
3575 sscanf(buf, "%d", &session->tpgt); in iscsi_set_param()
3583 return iscsi_switch_str_param(&session->ifacename, buf); in iscsi_set_param()
3585 return iscsi_switch_str_param(&session->initiatorname, buf); in iscsi_set_param()
3587 return iscsi_switch_str_param(&session->boot_root, buf); in iscsi_set_param()
3589 return iscsi_switch_str_param(&session->boot_nic, buf); in iscsi_set_param()
3591 return iscsi_switch_str_param(&session->boot_target, buf); in iscsi_set_param()
3593 return iscsi_switch_str_param(&session->portal_type, buf); in iscsi_set_param()
3595 return iscsi_switch_str_param(&session->discovery_parent_type, in iscsi_set_param()
3599 session->discovery_sess = !!val; in iscsi_set_param()
3614 struct iscsi_session *session = cls_session->dd_data; in iscsi_session_get_param() local
3619 len = sysfs_emit(buf, "%d\n", session->fast_abort); in iscsi_session_get_param()
3622 len = sysfs_emit(buf, "%d\n", session->abort_timeout); in iscsi_session_get_param()
3625 len = sysfs_emit(buf, "%d\n", session->lu_reset_timeout); in iscsi_session_get_param()
3628 len = sysfs_emit(buf, "%d\n", session->tgt_reset_timeout); in iscsi_session_get_param()
3631 len = sysfs_emit(buf, "%d\n", session->initial_r2t_en); in iscsi_session_get_param()
3634 len = sysfs_emit(buf, "%hu\n", session->max_r2t); in iscsi_session_get_param()
3637 len = sysfs_emit(buf, "%d\n", session->imm_data_en); in iscsi_session_get_param()
3640 len = sysfs_emit(buf, "%u\n", session->first_burst); in iscsi_session_get_param()
3643 len = sysfs_emit(buf, "%u\n", session->max_burst); in iscsi_session_get_param()
3646 len = sysfs_emit(buf, "%d\n", session->pdu_inorder_en); in iscsi_session_get_param()
3649 len = sysfs_emit(buf, "%d\n", session->dataseq_inorder_en); in iscsi_session_get_param()
3652 len = sysfs_emit(buf, "%d\n", session->def_taskmgmt_tmo); in iscsi_session_get_param()
3655 len = sysfs_emit(buf, "%d\n", session->erl); in iscsi_session_get_param()
3658 len = sysfs_emit(buf, "%s\n", session->targetname); in iscsi_session_get_param()
3661 len = sysfs_emit(buf, "%s\n", session->targetalias); in iscsi_session_get_param()
3664 len = sysfs_emit(buf, "%d\n", session->tpgt); in iscsi_session_get_param()
3667 len = sysfs_emit(buf, "%s\n", session->username); in iscsi_session_get_param()
3670 len = sysfs_emit(buf, "%s\n", session->username_in); in iscsi_session_get_param()
3673 len = sysfs_emit(buf, "%s\n", session->password); in iscsi_session_get_param()
3676 len = sysfs_emit(buf, "%s\n", session->password_in); in iscsi_session_get_param()
3679 len = sysfs_emit(buf, "%s\n", session->ifacename); in iscsi_session_get_param()
3682 len = sysfs_emit(buf, "%s\n", session->initiatorname); in iscsi_session_get_param()
3685 len = sysfs_emit(buf, "%s\n", session->boot_root); in iscsi_session_get_param()
3688 len = sysfs_emit(buf, "%s\n", session->boot_nic); in iscsi_session_get_param()
3691 len = sysfs_emit(buf, "%s\n", session->boot_target); in iscsi_session_get_param()
3694 len = sysfs_emit(buf, "%u\n", session->auto_snd_tgt_disable); in iscsi_session_get_param()
3697 len = sysfs_emit(buf, "%u\n", session->discovery_sess); in iscsi_session_get_param()
3700 len = sysfs_emit(buf, "%s\n", session->portal_type); in iscsi_session_get_param()
3703 len = sysfs_emit(buf, "%u\n", session->chap_auth_en); in iscsi_session_get_param()
3706 len = sysfs_emit(buf, "%u\n", session->discovery_logout_en); in iscsi_session_get_param()
3709 len = sysfs_emit(buf, "%u\n", session->bidi_chap_en); in iscsi_session_get_param()
3712 len = sysfs_emit(buf, "%u\n", session->discovery_auth_optional); in iscsi_session_get_param()
3715 len = sysfs_emit(buf, "%d\n", session->time2wait); in iscsi_session_get_param()
3718 len = sysfs_emit(buf, "%d\n", session->time2retain); in iscsi_session_get_param()
3721 len = sysfs_emit(buf, "%u\n", session->tsid); in iscsi_session_get_param()
3725 session->isid[0], session->isid[1], in iscsi_session_get_param()
3726 session->isid[2], session->isid[3], in iscsi_session_get_param()
3727 session->isid[4], session->isid[5]); in iscsi_session_get_param()
3730 len = sysfs_emit(buf, "%u\n", session->discovery_parent_idx); in iscsi_session_get_param()
3733 if (session->discovery_parent_type) in iscsi_session_get_param()
3735 session->discovery_parent_type); in iscsi_session_get_param()