1/*
2 * Generic SCSI Target Kernel Mode Driver
3 *
4 * Copyright (c) 2002 Nate Lawson.
5 * Copyright (c) 1998, 1999, 2001, 2002 Justin T. Gibbs.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
--- 12 unchanged lines hidden (view full) ---
21 * 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: head/sys/cam/scsi/scsi_target.c 111815 2003-03-03 12:15:54Z phk $
30 */
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/kernel.h>
35#include <sys/conf.h>
36#include <sys/malloc.h>
37#include <sys/poll.h>
--- 62 unchanged lines hidden (view full) ---
100static d_kqfilter_t targkqfilter;
101static void targreadfiltdetach(struct knote *kn);
102static int targreadfilt(struct knote *kn, long hint);
103static struct filterops targread_filtops =
104 { 1, NULL, targreadfiltdetach, targreadfilt };
105
106#define TARG_CDEV_MAJOR 65
107static struct cdevsw targ_cdevsw = {
108 .d_open = targopen,
109 .d_close = targclose,
110 .d_read = targread,
111 .d_write = targwrite,
112 .d_ioctl = targioctl,
113 .d_poll = targpoll,
114 .d_name = "targ",
115 .d_maj = TARG_CDEV_MAJOR,
116 .d_flags = D_KQFILTER,
117 .d_kqfilter = targkqfilter
118};
119
120static cam_status targendislun(struct cam_path *path, int enable,
121 int grp6_len, int grp7_len);
122static cam_status targenable(struct targ_softc *softc,
123 struct cam_path *path,
124 int grp6_len, int grp7_len);
125static cam_status targdisable(struct targ_softc *softc);
--- 1066 unchanged lines hidden ---
2 * Generic SCSI Target Kernel Mode Driver
3 *
4 * Copyright (c) 2002 Nate Lawson.
5 * Copyright (c) 1998, 1999, 2001, 2002 Justin T. Gibbs.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
--- 12 unchanged lines hidden (view full) ---
21 * 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: head/sys/cam/scsi/scsi_target.c 111815 2003-03-03 12:15:54Z phk $
30 */
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/kernel.h>
35#include <sys/conf.h>
36#include <sys/malloc.h>
37#include <sys/poll.h>
--- 62 unchanged lines hidden (view full) ---
100static d_kqfilter_t targkqfilter;
101static void targreadfiltdetach(struct knote *kn);
102static int targreadfilt(struct knote *kn, long hint);
103static struct filterops targread_filtops =
104 { 1, NULL, targreadfiltdetach, targreadfilt };
105
106#define TARG_CDEV_MAJOR 65
107static struct cdevsw targ_cdevsw = {
108 .d_open = targopen,
109 .d_close = targclose,
110 .d_read = targread,
111 .d_write = targwrite,
112 .d_ioctl = targioctl,
113 .d_poll = targpoll,
114 .d_name = "targ",
115 .d_maj = TARG_CDEV_MAJOR,
116 .d_flags = D_KQFILTER,
117 .d_kqfilter = targkqfilter
118};
119
120static cam_status targendislun(struct cam_path *path, int enable,
121 int grp6_len, int grp7_len);
122static cam_status targenable(struct targ_softc *softc,
123 struct cam_path *path,
124 int grp6_len, int grp7_len);
125static cam_status targdisable(struct targ_softc *softc);
--- 1066 unchanged lines hidden ---