Lines Matching defs:ic
64 static void idm_task_abort_one(idm_conn_t *ic, idm_task_t *idt,
184 idm_conn_t *ic;
190 ic = idm_conn_create_common(CONN_TYPE_INI, it->it_type,
193 bcopy(&cr->cr_ini_dst_addr, &ic->ic_ini_dst_addr,
197 rc = it->it_ops->it_ini_conn_create(cr, ic);
200 idm_conn_destroy_common(ic);
217 *new_con = ic;
220 list_insert_tail(&idm.idm_ini_conn_list, ic);
231 * ic - idm_conn_t structure representing the relevant connection
237 idm_conn_t *ic = ic_void;
239 ic->ic_transport_ops->it_ini_conn_destroy(ic);
240 idm_conn_destroy_common(ic);
244 idm_ini_conn_destroy(idm_conn_t *ic)
255 list_remove(&idm.idm_ini_conn_list, ic);
259 &idm_ini_conn_destroy_task, ic, TQ_SLEEP) == NULL) {
275 * ic - idm_conn_t structure representing the relevant connection
283 idm_ini_conn_connect(idm_conn_t *ic)
287 rc = idm_conn_sm_init(ic);
289 return (ic->ic_conn_sm_status);
293 idm_conn_hold(ic);
296 idm_conn_event(ic, CE_CONNECT_REQ, NULL);
299 mutex_enter(&ic->ic_state_mutex);
300 while (!(ic->ic_state_flags & CF_LOGIN_READY) &&
301 !(ic->ic_state_flags & CF_ERROR)) {
302 cv_wait(&ic->ic_state_cv, &ic->ic_state_mutex);
311 if (ic->ic_state_flags & CF_ERROR) {
312 rc = ic->ic_conn_sm_status;
314 mutex_exit(&ic->ic_state_mutex);
315 idm_conn_rele(ic);
326 * ic - idm_conn_t structure representing the relevant connection
333 idm_ini_conn_disconnect(idm_conn_t *ic)
335 idm_conn_event(ic, CE_TRANSPORT_FAIL, NULL);
345 * ic - idm_conn_t structure representing the relevant connection
349 idm_ini_conn_disconnect_sync(idm_conn_t *ic)
351 mutex_enter(&ic->ic_state_mutex);
352 if ((ic->ic_state != CS_S9_INIT_ERROR) &&
353 (ic->ic_state != CS_S11_COMPLETE)) {
354 idm_conn_event_locked(ic, CE_TRANSPORT_FAIL, NULL, CT_NONE);
355 while ((ic->ic_state != CS_S9_INIT_ERROR) &&
356 (ic->ic_state != CS_S11_COMPLETE))
357 cv_wait(&ic->ic_state_cv, &ic->ic_state_mutex);
359 mutex_exit(&ic->ic_state_mutex);
634 idm_negotiate_key_values(idm_conn_t *ic, nvlist_t *request_nvl,
637 ASSERT(ic->ic_transport_ops != NULL);
638 return (ic->ic_transport_ops->it_negotiate_key_values(ic,
649 idm_notice_key_values(idm_conn_t *ic, nvlist_t *negotiated_nvl)
651 ASSERT(ic->ic_transport_ops != NULL);
652 ic->ic_transport_ops->it_notice_key_values(ic, negotiated_nvl);
661 idm_declare_key_values(idm_conn_t *ic, nvlist_t *config_nvl,
664 ASSERT(ic->ic_transport_ops != NULL);
665 return (ic->ic_transport_ops->it_declare_key_values(ic, config_nvl,
961 * ic - connection on which the buffer will be transferred
968 idm_buf_alloc(idm_conn_t *ic, void *bufptr, uint64_t buflen)
973 ASSERT(ic != NULL);
978 mutex_enter(&ic->ic_state_mutex);
979 if (!ic->ic_ffp) {
980 mutex_exit(&ic->ic_state_mutex);
985 idm_conn_hold(ic);
986 mutex_exit(&ic->ic_state_mutex);
990 idm_conn_rele(ic);
994 buf->idb_ic = ic;
1018 rc = ic->ic_transport_ops->it_buf_alloc(buf, buflen);
1020 idm_conn_rele(ic);
1038 rc = ic->ic_transport_ops->it_buf_setup(buf);
1040 idm_conn_rele(ic);
1064 idm_conn_t *ic = buf->idb_ic;
1070 ic->ic_transport_ops->it_buf_free(buf);
1072 ic->ic_transport_ops->it_buf_teardown(buf);
1075 idm_conn_rele(ic);
1254 idm_task_alloc(idm_conn_t *ic)
1258 ASSERT(ic != NULL);
1261 if (!ic->ic_ffp) {
1272 mutex_enter(&ic->ic_state_mutex);
1273 if (!ic->ic_ffp) {
1274 mutex_exit(&ic->ic_state_mutex);
1278 idm_conn_hold(ic);
1279 mutex_exit(&ic->ic_state_mutex);
1282 idt->idt_ic = ic;
1349 idm_conn_t *ic;
1355 ic = idt->idt_ic;
1372 idm_conn_rele(ic);
1381 idm_task_find_common(idm_conn_t *ic, uint32_t itt, uint32_t ttt,
1391 if (IDM_CONN_ISTGT(ic)) {
1410 (idt->idt_ic != ic) ||
1411 (IDM_CONN_ISTGT(ic) &&
1417 if ((idt->idt_ic != ic) &&
1419 (IDM_CONN_ISINI(ic) || idt->idt_client_handle ==
1423 (void *)ic, (void *)idt->idt_ic);
1447 idm_task_find(idm_conn_t *ic, uint32_t itt, uint32_t ttt)
1449 return (idm_task_find_common(ic, itt, ttt, B_FALSE));
1457 idm_task_find_and_complete(idm_conn_t *ic, uint32_t itt, uint32_t ttt)
1459 return (idm_task_find_common(ic, itt, ttt, B_TRUE));
1472 idm_task_find_by_handle(idm_conn_t *ic, uintptr_t handle)
1526 idm_task_abort(idm_conn_t *ic, idm_task_t *idt, idm_abort_type_t abort_type)
1540 ASSERT(!ic->ic_ffp);
1549 (task->idt_ic == ic)) {
1551 idm_task_abort_one(ic, task, abort_type);
1559 idm_task_abort_one(ic, idt, abort_type);
1592 idm_task_abort_one(idm_conn_t *ic, idm_task_t *idt, idm_abort_type_t abort_type)
1603 ic->ic_transport_ops->it_free_task_rsrc(idt);
1617 ic->ic_transport_ops->it_free_task_rsrc(idt);
1719 idm_conn_t *ic = pdu->isp_ic;
1739 mutex_enter(&ic->ic_state_mutex);
1740 if (ic->ic_ffp && (ic->ic_pdu_events == 0)) {
1741 mutex_exit(&ic->ic_state_mutex);
1745 DTRACE_ISCSI_2(scsi__response, idm_conn_t *, ic,
1748 idm_pdu_tx_forward(ic, pdu);
1752 DTRACE_ISCSI_2(task__response, idm_conn_t *, ic,
1755 idm_pdu_tx_forward(ic, pdu);
1759 DTRACE_ISCSI_2(data__send, idm_conn_t *, ic,
1762 idm_pdu_tx_forward(ic, pdu);
1766 DTRACE_ISCSI_2(data__request, idm_conn_t *, ic,
1769 idm_pdu_tx_forward(ic, pdu);
1773 DTRACE_ISCSI_2(nop__send, idm_conn_t *, ic,
1776 idm_pdu_tx_forward(ic, pdu);
1780 DTRACE_ISCSI_2(text__response, idm_conn_t *, ic,
1783 idm_pdu_tx_forward(ic, pdu);
1791 idm_pdu_tx_forward(ic, pdu);
1797 mutex_enter(&ic->ic_state_mutex);
1814 idm_conn_tx_pdu_event(ic, CE_LOGIN_SND, (uintptr_t)pdu);
1817 DTRACE_ISCSI_2(login__response, idm_conn_t *, ic,
1820 idm_parse_login_rsp(ic, pdu, /* Is RX */ B_FALSE);
1823 idm_parse_logout_req(ic, pdu, /* Is RX */ B_FALSE);
1826 DTRACE_ISCSI_2(logout__response, idm_conn_t *, ic,
1829 idm_parse_logout_rsp(ic, pdu, /* Is RX */ B_FALSE);
1832 DTRACE_ISCSI_2(async__send, idm_conn_t *, ic,
1838 idm_conn_tx_pdu_event(ic, CE_ASYNC_LOGOUT_SND,
1842 idm_conn_tx_pdu_event(ic, CE_ASYNC_DROP_CONN_SND,
1846 idm_conn_tx_pdu_event(ic, CE_ASYNC_DROP_ALL_CONN_SND,
1852 idm_conn_tx_pdu_event(ic, CE_MISC_TX,
1859 DTRACE_ISCSI_2(scsi__response, idm_conn_t *, ic,
1862 idm_conn_tx_pdu_event(ic, CE_MISC_TX, (uintptr_t)pdu);
1866 DTRACE_ISCSI_2(task__response, idm_conn_t *, ic,
1869 idm_conn_tx_pdu_event(ic, CE_MISC_TX, (uintptr_t)pdu);
1873 DTRACE_ISCSI_2(data__send, idm_conn_t *, ic,
1876 idm_conn_tx_pdu_event(ic, CE_MISC_TX, (uintptr_t)pdu);
1880 DTRACE_ISCSI_2(data__request, idm_conn_t *, ic,
1883 idm_conn_tx_pdu_event(ic, CE_MISC_TX, (uintptr_t)pdu);
1887 DTRACE_ISCSI_2(nop__send, idm_conn_t *, ic,
1890 idm_conn_tx_pdu_event(ic, CE_MISC_TX, (uintptr_t)pdu);
1894 DTRACE_ISCSI_2(text__response, idm_conn_t *, ic,
1897 idm_conn_tx_pdu_event(ic, CE_MISC_TX, (uintptr_t)pdu);
1913 idm_conn_tx_pdu_event(ic, CE_MISC_TX, (uintptr_t)pdu);
1916 mutex_exit(&ic->ic_state_mutex);
1994 idm_pdu_init(idm_pdu_t *pdu, idm_conn_t *ic, void *private, idm_pdu_cb_t *cb)
2004 pdu->isp_ic = ic;
2267 idm_conn_hold(idm_conn_t *ic)
2269 idm_refcnt_hold(&ic->ic_refcnt);
2273 idm_conn_rele(idm_conn_t *ic)
2275 idm_refcnt_rele(&ic->ic_refcnt);
2279 idm_conn_set_target_name(idm_conn_t *ic, char *target_name)
2281 (void) strlcpy(ic->ic_target_name, target_name, ISCSI_MAX_NAME_LEN + 1);
2285 idm_conn_set_initiator_name(idm_conn_t *ic, char *initiator_name)
2287 (void) strlcpy(ic->ic_initiator_name, initiator_name,
2292 idm_conn_set_isid(idm_conn_t *ic, uint8_t isid[ISCSI_ISID_LEN])
2294 (void) snprintf(ic->ic_isid, ISCSI_MAX_ISID_LEN + 1,