xref: /freebsd/sys/dev/iscsi/icl_conn_if.m (revision 3fc36ee018bb836bd1796067cf4ef8683f166ebc)
1#-
2# Copyright (c) 2014 The FreeBSD Foundation
3# All rights reserved.
4#
5# This software was developed by Edward Tomasz Napierala under sponsorship
6# from the FreeBSD Foundation.
7#
8# Redistribution and use in source and binary forms, with or without
9# modification, are permitted provided that the following conditions
10# are met:
11# 1. Redistributions of source code must retain the above copyright
12#    notice, this list of conditions and the following disclaimer.
13# 2. Redistributions in binary form must reproduce the above copyright
14#    notice, this list of conditions and the following disclaimer in the
15#    documentation and/or other materials provided with the distribution.
16#
17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27# SUCH DAMAGE.
28#
29# $FreeBSD$
30#
31
32#include <sys/socket.h>
33#include <dev/iscsi/icl.h>
34
35INTERFACE icl_conn;
36
37METHOD size_t pdu_data_segment_length {
38	struct icl_conn *_ic;
39	const struct icl_pdu *_ip;
40};
41
42METHOD int pdu_append_data {
43	struct icl_conn *_ic;
44	struct icl_pdu *_ip;
45	const void *_addr;
46	size_t _len;
47	int _flags;
48};
49
50METHOD void pdu_get_data {
51	struct icl_conn *_ic;
52	struct icl_pdu *_ip;
53	size_t _off;
54	void *_addr;
55	size_t _len;
56};
57
58METHOD void pdu_queue {
59	struct icl_conn *_ic;
60	struct icl_pdu *_ip;
61};
62
63METHOD void pdu_free {
64	struct icl_conn *_ic;
65	struct icl_pdu *_ip;
66};
67
68METHOD struct icl_pdu * new_pdu {
69	struct icl_conn *_ic;
70	int _flags;
71};
72
73METHOD void free {
74	struct icl_conn *_ic;
75};
76
77METHOD int handoff {
78	struct icl_conn *_ic;
79	int _fd;
80};
81
82METHOD void close {
83	struct icl_conn *_ic;
84};
85
86METHOD int task_setup {
87	struct icl_conn *_ic;
88	struct icl_pdu *_ip;
89	struct ccb_scsiio *_csio;
90	uint32_t *_task_tag;
91	void **_prvp;
92};
93
94METHOD void task_done {
95	struct icl_conn *_ic;
96	void *_prv;
97};
98
99METHOD int transfer_setup {
100	struct icl_conn *_ic;
101	union ctl_io *_io;
102	uint32_t *_transfer_tag;
103	void **_prvp;
104};
105
106METHOD void transfer_done {
107	struct icl_conn *_ic;
108	void *_prv;
109};
110
111#
112# The function below is only used with ICL_KERNEL_PROXY.
113#
114METHOD int connect {
115	struct icl_conn *_ic;
116	int _domain;
117	int _socktype;
118	int _protocol;
119	struct sockaddr *_from_sa;
120	struct sockaddr *_to_sa;
121};
122