iscsit.c (9586:bd5e99a50121) iscsit.c (9601:e0ed15140e6d)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 204 unchanged lines hidden (view full) ---

213static idm_status_t
214iscsit_login_fail(idm_conn_t *ic);
215
216static boolean_t iscsit_cmdsn_in_window(iscsit_conn_t *ict, uint32_t cmdsn);
217static void iscsit_send_direct_scsi_resp(iscsit_conn_t *ict, idm_pdu_t *rx_pdu,
218 uint8_t response, uint8_t cmd_status);
219static void iscsit_send_task_mgmt_resp(idm_pdu_t *tm_resp_pdu,
220 uint8_t tm_status);
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 204 unchanged lines hidden (view full) ---

213static idm_status_t
214iscsit_login_fail(idm_conn_t *ic);
215
216static boolean_t iscsit_cmdsn_in_window(iscsit_conn_t *ict, uint32_t cmdsn);
217static void iscsit_send_direct_scsi_resp(iscsit_conn_t *ict, idm_pdu_t *rx_pdu,
218 uint8_t response, uint8_t cmd_status);
219static void iscsit_send_task_mgmt_resp(idm_pdu_t *tm_resp_pdu,
220 uint8_t tm_status);
221static void iscsit_send_reject(iscsit_conn_t *ict, idm_pdu_t *rejected_pdu,
222 uint8_t reason);
223
224int
225_init(void)
226{
227 int rc;
228
229 rw_init(&iscsit_global.global_rwlock, NULL, RW_DRIVER, NULL);
230 iscsit_global.global_svc_state = ISE_DETACHED;

--- 822 unchanged lines hidden (view full) ---

1053 mutex_init(&ict->ict_mutex, NULL, MUTEX_DRIVER, NULL);
1054 idm_refcnt_init(&ict->ict_refcnt, ict);
1055
1056 /*
1057 * Initialize login state machine
1058 */
1059 if (iscsit_login_sm_init(ict) != IDM_STATUS_SUCCESS) {
1060 iscsit_global_rele();
221
222int
223_init(void)
224{
225 int rc;
226
227 rw_init(&iscsit_global.global_rwlock, NULL, RW_DRIVER, NULL);
228 iscsit_global.global_svc_state = ISE_DETACHED;

--- 822 unchanged lines hidden (view full) ---

1051 mutex_init(&ict->ict_mutex, NULL, MUTEX_DRIVER, NULL);
1052 idm_refcnt_init(&ict->ict_refcnt, ict);
1053
1054 /*
1055 * Initialize login state machine
1056 */
1057 if (iscsit_login_sm_init(ict) != IDM_STATUS_SUCCESS) {
1058 iscsit_global_rele();
1059 /*
1060 * Cleanup the ict after idm notifies us about this failure
1061 */
1061 return (IDM_STATUS_FAIL);
1062 }
1063
1064 return (IDM_STATUS_SUCCESS);
1065}
1066
1067idm_status_t
1068iscsit_conn_reinstate(iscsit_conn_t *reinstate_ict, iscsit_conn_t *new_ict)

--- 122 unchanged lines hidden (view full) ---

1191 */
1192 iscsit_sess_sm_event(ict->ict_sess, SE_CONN_FAIL, ict);
1193 }
1194
1195 ict->ict_ic = NULL;
1196
1197 idm_refcnt_wait_ref(&ict->ict_refcnt);
1198
1062 return (IDM_STATUS_FAIL);
1063 }
1064
1065 return (IDM_STATUS_SUCCESS);
1066}
1067
1068idm_status_t
1069iscsit_conn_reinstate(iscsit_conn_t *reinstate_ict, iscsit_conn_t *new_ict)

--- 122 unchanged lines hidden (view full) ---

1192 */
1193 iscsit_sess_sm_event(ict->ict_sess, SE_CONN_FAIL, ict);
1194 }
1195
1196 ict->ict_ic = NULL;
1197
1198 idm_refcnt_wait_ref(&ict->ict_refcnt);
1199
1200 /* Reap the login state machine */
1201 iscsit_login_sm_fini(ict);
1202
1203 /* Clean up any text command remnants */
1204 iscsit_text_cmd_fini(ict);
1205
1199 mutex_destroy(&ict->ict_mutex);
1200 idm_refcnt_destroy(&ict->ict_refcnt);
1201 kmem_free(ict, sizeof (*ict));
1202
1203 iscsit_global_rele();
1204
1205 return (IDM_STATUS_SUCCESS);
1206}

--- 1533 unchanged lines hidden ---
1206 mutex_destroy(&ict->ict_mutex);
1207 idm_refcnt_destroy(&ict->ict_refcnt);
1208 kmem_free(ict, sizeof (*ict));
1209
1210 iscsit_global_rele();
1211
1212 return (IDM_STATUS_SUCCESS);
1213}

--- 1533 unchanged lines hidden ---