Lines Matching defs:ic
72 struct icl_conn ic;
175 icl_conn_fail(struct icl_conn *ic)
177 if (ic->ic_socket == NULL)
183 ic->ic_socket->so_error = EDOOFUS;
184 (ic->ic_error)(ic);
188 icl_soft_conn_pdu_free(struct icl_conn *ic, struct icl_pdu *ip)
198 refcount_release(&ic->ic_outstanding_pdus);
246 icl_soft_conn_new_pdu(struct icl_conn *ic, int flags)
252 refcount_acquire(&ic->ic_outstanding_pdus);
258 refcount_release(&ic->ic_outstanding_pdus);
263 ip->ip_conn = ic;
269 icl_soft_conn_pdu_free(ic, ip);
301 icl_soft_conn_pdu_data_segment_length(struct icl_conn *ic,
566 struct icl_conn *ic = &isc->ic;
575 request = icl_soft_conn_new_pdu(ic, M_NOWAIT);
579 icl_conn_fail(ic);
601 if (len > ic->ic_max_recv_data_segment_length) {
617 if (ic->ic_header_crc32c == false)
650 if (request->ip_data_len == 0 || ic->ic_data_crc32c == false)
683 icl_conn_fail(ic);
692 struct icl_conn *ic = &isc->ic;
696 if (ic->ic_disconnecting)
719 icl_soft_conn_pdu_free(ic, response);
720 icl_conn_fail(ic);
724 (ic->ic_receive)(response);
732 struct icl_conn *ic = &isc->ic;
739 so = ic->ic_socket;
743 if (ic->ic_disconnecting) {
767 icl_conn_fail(ic);
798 ICL_CONN_LOCK(ic);
801 ICL_CONN_UNLOCK(ic);
824 struct icl_conn *ic;
826 ic = request->ip_conn;
832 if (ic->ic_header_crc32c) {
854 if (ic->ic_data_crc32c) {
878 struct icl_conn *ic = &isc->ic;
888 ICL_CONN_LOCK_ASSERT_NOT(ic);
890 so = ic->ic_socket;
940 icl_conn_fail(ic);
967 icl_conn_fail(ic);
993 icl_conn_fail(ic);
1004 struct icl_conn *ic;
1008 ic = &isc->ic;
1012 ICL_CONN_LOCK(ic);
1023 ICL_CONN_UNLOCK(ic);
1025 ICL_CONN_LOCK(ic);
1050 if (ic->ic_disconnecting) {
1055 cv_wait(&isc->send_cv, ic->ic_lock);
1066 ICL_CONN_UNLOCK(ic);
1074 struct icl_conn *ic;
1080 ic = &isc->ic;
1082 ICL_CONN_LOCK(ic);
1084 ICL_CONN_UNLOCK(ic);
1110 icl_soft_conn_pdu_append_bio(struct icl_conn *ic, struct icl_pdu *request,
1221 icl_soft_conn_pdu_append_data(struct icl_conn *ic, struct icl_pdu *request,
1269 icl_soft_conn_pdu_get_bio(struct icl_conn *ic, struct icl_pdu *ip,
1302 icl_soft_conn_pdu_get_data(struct icl_conn *ic, struct icl_pdu *ip,
1310 icl_soft_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip)
1313 icl_soft_conn_pdu_queue_cb(ic, ip, NULL);
1317 icl_soft_conn_pdu_queue_cb(struct icl_conn *ic, struct icl_pdu *ip,
1320 struct icl_soft_conn *isc = (struct icl_soft_conn *)ic;
1323 ICL_CONN_LOCK_ASSERT(ic);
1327 if (ic->ic_disconnecting || ic->ic_socket == NULL) {
1351 struct icl_conn *ic;
1362 ic = &isc->ic;
1363 ic->ic_lock = lock;
1365 refcount_init(&ic->ic_outstanding_pdus, 0);
1367 ic->ic_name = name;
1368 ic->ic_offload = "None";
1369 ic->ic_unmapped = PMAP_HAS_DMAP;
1371 return (ic);
1375 icl_soft_conn_free(struct icl_conn *ic)
1377 struct icl_soft_conn *isc = (struct icl_soft_conn *)ic;
1380 KASSERT(ic->ic_outstanding_pdus == 0,
1382 ic->ic_outstanding_pdus));
1391 icl_conn_start(struct icl_conn *ic)
1393 struct icl_soft_conn *isc = (struct icl_soft_conn *)ic;
1398 ICL_CONN_LOCK(ic);
1403 if (ic->ic_socket == NULL) {
1404 ICL_CONN_UNLOCK(ic);
1410 ic->ic_disconnecting = false;
1412 ICL_CONN_UNLOCK(ic);
1420 ic->ic_max_send_data_segment_length +
1428 ic->ic_max_recv_data_segment_length +
1436 error = soreserve(ic->ic_socket, sendspace, recvspace);
1439 icl_soft_conn_close(ic);
1442 ic->ic_socket->so_snd.sb_flags |= SB_AUTOSIZE;
1443 ic->ic_socket->so_rcv.sb_flags |= SB_AUTOSIZE;
1454 error = sosetopt(ic->ic_socket, &opt);
1457 icl_soft_conn_close(ic);
1465 SOCKBUF_LOCK(&ic->ic_socket->so_snd);
1466 soupcall_set(ic->ic_socket, SO_SND, icl_soupcall_send, isc);
1467 SOCKBUF_UNLOCK(&ic->ic_socket->so_snd);
1468 SOCKBUF_LOCK(&ic->ic_socket->so_rcv);
1469 soupcall_set(ic->ic_socket, SO_RCV, icl_soupcall_receive, isc);
1470 SOCKBUF_UNLOCK(&ic->ic_socket->so_rcv);
1475 ICL_CONN_LOCK(ic);
1477 ICL_CONN_UNLOCK(ic);
1478 error = kthread_add(icl_send_thread, ic, NULL, NULL, 0, 0, "%stx",
1479 ic->ic_name);
1482 ICL_CONN_LOCK(ic);
1485 ICL_CONN_UNLOCK(ic);
1486 icl_soft_conn_close(ic);
1489 error = kthread_add(icl_receive_thread, ic, NULL, NULL, 0, 0, "%srx",
1490 ic->ic_name);
1493 ICL_CONN_LOCK(ic);
1496 ICL_CONN_UNLOCK(ic);
1497 icl_soft_conn_close(ic);
1505 icl_soft_conn_handoff(struct icl_conn *ic, int fd)
1512 ICL_CONN_LOCK_ASSERT_NOT(ic);
1520 ICL_CONN_LOCK(ic);
1521 if (ic->ic_socket == NULL) {
1522 ICL_CONN_UNLOCK(ic);
1526 ICL_CONN_UNLOCK(ic);
1548 ICL_CONN_LOCK(ic);
1550 if (ic->ic_socket != NULL) {
1551 ICL_CONN_UNLOCK(ic);
1556 ic->ic_socket = fp->f_data;
1560 ICL_CONN_UNLOCK(ic);
1562 error = icl_conn_start(ic);
1568 icl_soft_conn_close(struct icl_conn *ic)
1570 struct icl_soft_conn *isc = (struct icl_soft_conn *)ic;
1576 * Receive thread sleeps on so->so_rcv lock, send on ic->ic_lock.
1578 ICL_CONN_LOCK(ic);
1579 if (!ic->ic_disconnecting) {
1580 so = ic->ic_socket;
1583 ic->ic_disconnecting = true;
1590 cv_wait(&isc->send_cv, ic->ic_lock);
1594 so = ic->ic_socket;
1596 ICL_CONN_UNLOCK(ic);
1599 ic->ic_socket = NULL;
1604 ICL_CONN_UNLOCK(ic);
1614 ICL_CONN_LOCK(ic);
1618 icl_soft_conn_pdu_free(ic, isc->receive_pdu);
1633 ICL_CONN_UNLOCK(ic);
1637 icl_soft_conn_task_setup(struct icl_conn *ic, struct icl_pdu *ip,
1645 icl_soft_conn_task_done(struct icl_conn *ic, void *prv)
1650 icl_soft_conn_transfer_setup(struct icl_conn *ic, struct icl_pdu *ip,
1658 icl_soft_conn_transfer_done(struct icl_conn *ic, void *prv)
1676 icl_soft_conn_connect(struct icl_conn *ic, int domain, int socktype,
1680 return (icl_soft_proxy_connect(ic, domain, socktype, protocol,
1685 icl_soft_handoff_sock(struct icl_conn *ic, struct socket *so)
1689 ICL_CONN_LOCK_ASSERT_NOT(ic);
1694 ICL_CONN_LOCK(ic);
1695 if (ic->ic_socket != NULL) {
1696 ICL_CONN_UNLOCK(ic);
1699 ic->ic_socket = so;
1700 ICL_CONN_UNLOCK(ic);
1702 error = icl_conn_start(ic);