xref: /freebsd/sys/dev/iscsi/icl_conn_if.m (revision 3f05af05ace08ae28892ecfd28b000822a5d7ae0)
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 <dev/iscsi/icl.h>
33
34INTERFACE icl_conn;
35
36METHOD size_t pdu_data_segment_length {
37	struct icl_conn *_ic;
38	const struct icl_pdu *_ip;
39};
40
41METHOD int pdu_append_data {
42	struct icl_conn *_ic;
43	struct icl_pdu *_ip;
44	const void *_addr;
45	size_t _len;
46	int _flags;
47};
48
49METHOD void pdu_get_data {
50	struct icl_conn *_ic;
51	struct icl_pdu *_ip;
52	size_t _off;
53	void *_addr;
54	size_t _len;
55};
56
57METHOD void pdu_queue {
58	struct icl_conn *_ic;
59	struct icl_pdu *_ip;
60};
61
62METHOD void pdu_free {
63	struct icl_conn *_ic;
64	struct icl_pdu *_ip;
65};
66
67METHOD struct icl_pdu * new_pdu {
68	struct icl_conn *_ic;
69	int _flags;
70};
71
72METHOD void free {
73	struct icl_conn *_ic;
74};
75
76METHOD int handoff {
77	struct icl_conn *_ic;
78	int _fd;
79};
80
81METHOD void close {
82	struct icl_conn *_ic;
83};
84
85METHOD bool connected {
86	struct icl_conn *_ic;
87};
88
89METHOD int task_setup {
90	struct icl_conn *_ic;
91	struct ccb_scsiio *_csio;
92	uint32_t *_task_tag;
93	void **_prvp;
94};
95
96METHOD void task_done {
97	struct icl_conn *_ic;
98	void *_prv;
99};
100
101METHOD int transfer_setup {
102	struct icl_conn *_ic;
103	union ctl_io *_io;
104	uint32_t *_transfer_tag;
105	void **_prvp;
106};
107
108METHOD void transfer_done {
109	struct icl_conn *_ic;
110	void *_prv;
111};
112