Deleted Added
full compact
ctl_frontend_iscsi.c (265507) ctl_frontend_iscsi.c (265508)
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 265507 2014-05-07 07:29:39Z trasz $
29 * $FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c 265508 2014-05-07 07:31:25Z trasz $
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 265507 2014-05-07 07:29:39Z trasz $");
37__FBSDID("$FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c 265508 2014-05-07 07:31:25Z trasz $");
38
39#include <sys/param.h>
40#include <sys/capability.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>

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

70#include "../../dev/iscsi/icl.h"
71#include "../../dev/iscsi/iscsi_proto.h"
72#include "ctl_frontend_iscsi.h"
73
74#ifdef ICL_KERNEL_PROXY
75#include <sys/socketvar.h>
76#endif
77
38
39#include <sys/param.h>
40#include <sys/capability.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>

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

70#include "../../dev/iscsi/icl.h"
71#include "../../dev/iscsi/iscsi_proto.h"
72#include "ctl_frontend_iscsi.h"
73
74#ifdef ICL_KERNEL_PROXY
75#include <sys/socketvar.h>
76#endif
77
78#ifdef ICL_KERNEL_PROXY
79FEATURE(cfiscsi_kernel_proxy, "iSCSI target built with ICL_KERNEL_PROXY");
80#endif
81
78static MALLOC_DEFINE(M_CFISCSI, "cfiscsi", "Memory used for CTL iSCSI frontend");
79static uma_zone_t cfiscsi_data_wait_zone;
80
81SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, iscsi, CTLFLAG_RD, 0,
82 "CAM Target Layer iSCSI Frontend");
83static int debug = 3;
84TUNABLE_INT("kern.cam.ctl.iscsi.debug", &debug);
85SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN,

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

1955 cfiscsi_ioctl_send(ci);
1956 break;
1957 case CTL_ISCSI_RECEIVE:
1958 cfiscsi_ioctl_receive(ci);
1959 break;
1960 case CTL_ISCSI_CLOSE:
1961 cfiscsi_ioctl_close(ci);
1962 break;
82static MALLOC_DEFINE(M_CFISCSI, "cfiscsi", "Memory used for CTL iSCSI frontend");
83static uma_zone_t cfiscsi_data_wait_zone;
84
85SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, iscsi, CTLFLAG_RD, 0,
86 "CAM Target Layer iSCSI Frontend");
87static int debug = 3;
88TUNABLE_INT("kern.cam.ctl.iscsi.debug", &debug);
89SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN,

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

1959 cfiscsi_ioctl_send(ci);
1960 break;
1961 case CTL_ISCSI_RECEIVE:
1962 cfiscsi_ioctl_receive(ci);
1963 break;
1964 case CTL_ISCSI_CLOSE:
1965 cfiscsi_ioctl_close(ci);
1966 break;
1963#endif /* ICL_KERNEL_PROXY */
1967#else
1968 case CTL_ISCSI_LISTEN:
1969 case CTL_ISCSI_ACCEPT:
1970 case CTL_ISCSI_SEND:
1971 case CTL_ISCSI_RECEIVE:
1972 case CTL_ISCSI_CLOSE:
1973 ci->status = CTL_ISCSI_ERROR;
1974 snprintf(ci->error_str, sizeof(ci->error_str),
1975 "%s: CTL compiled without ICL_KERNEL_PROXY",
1976 __func__);
1977 break;
1978#endif /* !ICL_KERNEL_PROXY */
1964 default:
1965 ci->status = CTL_ISCSI_ERROR;
1966 snprintf(ci->error_str, sizeof(ci->error_str),
1967 "%s: invalid iSCSI request type %d", __func__, ci->type);
1968 break;
1969 }
1970
1971 return (0);

--- 841 unchanged lines hidden ---
1979 default:
1980 ci->status = CTL_ISCSI_ERROR;
1981 snprintf(ci->error_str, sizeof(ci->error_str),
1982 "%s: invalid iSCSI request type %d", __func__, ci->type);
1983 break;
1984 }
1985
1986 return (0);

--- 841 unchanged lines hidden ---