Deleted Added
full compact
ctl_frontend_iscsi.c (280258) ctl_frontend_iscsi.c (284798)
1/*-
2 * Copyright (c) 2012 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

--- 12 unchanged lines hidden (view full) ---

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 *
1/*-
2 * Copyright (c) 2012 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

--- 12 unchanged lines hidden (view full) ---

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: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c 280258 2015-03-19 13:37:36Z rwatson $
29 * $FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c 284798 2015-06-25 07:11:48Z mav $
30 */
31
32/*
33 * CTL frontend for the iSCSI protocol.
34 */
35
36#include <sys/cdefs.h>
30 */
31
32/*
33 * CTL frontend for the iSCSI protocol.
34 */
35
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c 280258 2015-03-19 13:37:36Z rwatson $");
37__FBSDID("$FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c 284798 2015-06-25 07:11:48Z mav $");
38
39#include <sys/param.h>
40#include <sys/capsicum.h>
41#include <sys/condvar.h>
42#include <sys/file.h>
43#include <sys/kernel.h>
44#include <sys/kthread.h>
45#include <sys/lock.h>

--- 99 unchanged lines hidden (view full) ---

145#define PDU_EXPDATASN(X) (X)->ip_prv0
146#define PDU_TOTAL_TRANSFER_LEN(X) (X)->ip_prv1
147#define PDU_R2TSN(X) (X)->ip_prv2
148
149int cfiscsi_init(void);
150static void cfiscsi_online(void *arg);
151static void cfiscsi_offline(void *arg);
152static int cfiscsi_info(void *arg, struct sbuf *sb);
38
39#include <sys/param.h>
40#include <sys/capsicum.h>
41#include <sys/condvar.h>
42#include <sys/file.h>
43#include <sys/kernel.h>
44#include <sys/kthread.h>
45#include <sys/lock.h>

--- 99 unchanged lines hidden (view full) ---

145#define PDU_EXPDATASN(X) (X)->ip_prv0
146#define PDU_TOTAL_TRANSFER_LEN(X) (X)->ip_prv1
147#define PDU_R2TSN(X) (X)->ip_prv2
148
149int cfiscsi_init(void);
150static void cfiscsi_online(void *arg);
151static void cfiscsi_offline(void *arg);
152static int cfiscsi_info(void *arg, struct sbuf *sb);
153static int cfiscsi_lun_enable(void *arg,
154 struct ctl_id target_id, int lun_id);
155static int cfiscsi_lun_disable(void *arg,
156 struct ctl_id target_id, int lun_id);
153static int cfiscsi_lun_enable(void *arg, int lun_id);
154static int cfiscsi_lun_disable(void *arg, int lun_id);
157static int cfiscsi_ioctl(struct cdev *dev,
158 u_long cmd, caddr_t addr, int flag, struct thread *td);
159static void cfiscsi_datamove(union ctl_io *io);
160static void cfiscsi_datamove_in(union ctl_io *io);
161static void cfiscsi_datamove_out(union ctl_io *io);
162static void cfiscsi_done(union ctl_io *io);
163static bool cfiscsi_pdu_update_cmdsn(const struct icl_pdu *request);
164static void cfiscsi_pdu_handle_nop_out(struct icl_pdu *request);

--- 2131 unchanged lines hidden (view full) ---

2296 newct->ct_target_id = ++softc->last_target_id;
2297 TAILQ_INSERT_TAIL(&softc->targets, newct, ct_next);
2298 mtx_unlock(&softc->lock);
2299
2300 return (newct);
2301}
2302
2303static int
155static int cfiscsi_ioctl(struct cdev *dev,
156 u_long cmd, caddr_t addr, int flag, struct thread *td);
157static void cfiscsi_datamove(union ctl_io *io);
158static void cfiscsi_datamove_in(union ctl_io *io);
159static void cfiscsi_datamove_out(union ctl_io *io);
160static void cfiscsi_done(union ctl_io *io);
161static bool cfiscsi_pdu_update_cmdsn(const struct icl_pdu *request);
162static void cfiscsi_pdu_handle_nop_out(struct icl_pdu *request);

--- 2131 unchanged lines hidden (view full) ---

2294 newct->ct_target_id = ++softc->last_target_id;
2295 TAILQ_INSERT_TAIL(&softc->targets, newct, ct_next);
2296 mtx_unlock(&softc->lock);
2297
2298 return (newct);
2299}
2300
2301static int
2304cfiscsi_lun_enable(void *arg, struct ctl_id target_id, int lun_id)
2302cfiscsi_lun_enable(void *arg, int lun_id)
2305{
2306
2307 return (0);
2308}
2309
2310static int
2303{
2304
2305 return (0);
2306}
2307
2308static int
2311cfiscsi_lun_disable(void *arg, struct ctl_id target_id, int lun_id)
2309cfiscsi_lun_disable(void *arg, int lun_id)
2312{
2313
2314 return (0);
2315}
2316
2317static void
2318cfiscsi_datamove_in(union ctl_io *io)
2319{

--- 577 unchanged lines hidden ---
2310{
2311
2312 return (0);
2313}
2314
2315static void
2316cfiscsi_datamove_in(union ctl_io *io)
2317{

--- 577 unchanged lines hidden ---