Lines Matching full:isc
468 struct icl_soft_conn *isc;
472 isc = (struct icl_soft_conn *)request->ip_conn;
475 isc->receive_len = 0;
524 isc->receive_len = icl_pdu_data_segment_receive_len(request);
564 icl_conn_receive_pdu(struct icl_soft_conn *isc, struct mbuf **r, size_t *rs)
566 struct icl_conn *ic = &isc->ic;
572 if (isc->receive_state == ICL_CONN_STATE_BHS) {
573 KASSERT(isc->receive_pdu == NULL,
574 ("isc->receive_pdu != NULL"));
582 isc->receive_pdu = request;
584 KASSERT(isc->receive_pdu != NULL,
585 ("isc->receive_pdu == NULL"));
586 request = isc->receive_pdu;
589 switch (isc->receive_state) {
609 isc->receive_state = ICL_CONN_STATE_AHS;
610 isc->receive_len = icl_pdu_ahs_length(request);
616 isc->receive_state = ICL_CONN_STATE_HEADER_DIGEST;
618 isc->receive_len = 0;
620 isc->receive_len = ISCSI_HEADER_DIGEST_SIZE;
632 isc->receive_state = ICL_CONN_STATE_DATA;
633 isc->receive_len = icl_pdu_data_segment_receive_len(request);
649 isc->receive_state = ICL_CONN_STATE_DATA_DIGEST;
651 isc->receive_len = 0;
653 isc->receive_len = ISCSI_DATA_DIGEST_SIZE;
669 isc->receive_state = ICL_CONN_STATE_BHS;
670 isc->receive_len = sizeof(struct iscsi_bhs);
671 isc->receive_pdu = NULL;
675 panic("invalid receive_state %d\n", isc->receive_state);
680 * Don't free the PDU; it's pointed to by isc->receive_pdu
690 icl_conn_receive_pdus(struct icl_soft_conn *isc, struct mbuf **r, size_t *rs)
692 struct icl_conn *ic = &isc->ic;
703 if (*rs < isc->receive_len) {
706 *rs, isc->receive_len);
711 response = icl_conn_receive_pdu(isc, r, rs);
731 struct icl_soft_conn *isc = arg;
732 struct icl_conn *ic = &isc->ic;
755 if (read + available < isc->receive_len) {
756 so->so_rcv.sb_lowat = isc->receive_len - read;
757 cv_wait(&isc->receive_cv, SOCKBUF_MTX(&so->so_rcv));
792 icl_conn_receive_pdus(isc, &r, &read);
799 isc->receive_running = false;
800 cv_signal(&isc->send_cv);
808 struct icl_soft_conn *isc;
813 isc = arg;
814 cv_signal(&isc->receive_cv);
876 icl_conn_send_pdus(struct icl_soft_conn *isc, struct icl_pdu_stailq *queue)
878 struct icl_conn *ic = &isc->ic;
900 isc->check_send_space = false;
1003 struct icl_soft_conn *isc;
1007 isc = arg;
1008 ic = &isc->ic;
1020 if (STAILQ_EMPTY(&queue) || isc->check_send_space)
1021 STAILQ_CONCAT(&queue, &isc->to_send);
1024 icl_conn_send_pdus(isc, &queue);
1031 if (isc->check_send_space)
1039 !STAILQ_EMPTY(&isc->to_send))
1055 cv_wait(&isc->send_cv, ic->ic_lock);
1062 STAILQ_CONCAT(&isc->to_send, &queue);
1064 isc->send_running = false;
1065 cv_signal(&isc->send_cv);
1073 struct icl_soft_conn *isc;
1079 isc = arg;
1080 ic = &isc->ic;
1083 isc->check_send_space = true;
1086 cv_signal(&isc->send_cv);
1320 struct icl_soft_conn *isc = (struct icl_soft_conn *)ic;
1333 if (!STAILQ_EMPTY(&isc->to_send)) {
1334 STAILQ_INSERT_TAIL(&isc->to_send, ip, ip_next);
1343 STAILQ_INSERT_TAIL(&isc->to_send, ip, ip_next);
1344 cv_signal(&isc->send_cv);
1350 struct icl_soft_conn *isc;
1355 isc = (struct icl_soft_conn *)kobj_create(&icl_soft_class, M_ICL_SOFT,
1358 STAILQ_INIT(&isc->to_send);
1359 cv_init(&isc->send_cv, "icl_tx");
1360 cv_init(&isc->receive_cv, "icl_rx");
1362 ic = &isc->ic;
1377 struct icl_soft_conn *isc = (struct icl_soft_conn *)ic;
1384 cv_destroy(&isc->send_cv);
1385 cv_destroy(&isc->receive_cv);
1386 kobj_delete((struct kobj *)isc, M_ICL_SOFT);
1393 struct icl_soft_conn *isc = (struct icl_soft_conn *)ic;
1408 isc->receive_state = ICL_CONN_STATE_BHS;
1409 isc->receive_len = sizeof(struct iscsi_bhs);
1466 soupcall_set(ic->ic_socket, SO_SND, icl_soupcall_send, isc);
1469 soupcall_set(ic->ic_socket, SO_RCV, icl_soupcall_receive, isc);
1476 isc->send_running = isc->receive_running = true;
1483 isc->send_running = isc->receive_running = false;
1484 cv_signal(&isc->send_cv);
1494 isc->receive_running = false;
1495 cv_signal(&isc->send_cv);
1570 struct icl_soft_conn *isc = (struct icl_soft_conn *)ic;
1587 while (isc->receive_running || isc->send_running) {
1588 cv_signal(&isc->receive_cv);
1589 cv_signal(&isc->send_cv);
1590 cv_wait(&isc->send_cv, ic->ic_lock);
1616 if (isc->receive_pdu != NULL) {
1618 icl_soft_conn_pdu_free(ic, isc->receive_pdu);
1619 isc->receive_pdu = NULL;
1625 while (!STAILQ_EMPTY(&isc->to_send)) {
1626 pdu = STAILQ_FIRST(&isc->to_send);
1627 STAILQ_REMOVE_HEAD(&isc->to_send, ip_next);
1631 KASSERT(STAILQ_EMPTY(&isc->to_send),