1/*-
2 * Copyright (c) 2014 Alexander Motin <mav@FreeBSD.org>
3 * Copyright (c) 2004, 2005 Silicon Graphics International Corp.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
--- 12 unchanged lines hidden (view full) ---
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/cam/ctl/ctl_tpc_local.c 275942 2014-12-19 20:35:06Z mav $");
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/types.h>
35#include <sys/lock.h>
36#include <sys/module.h>
37#include <sys/mutex.h>
--- 20 unchanged lines hidden (view full) ---
58#include <cam/ctl/ctl_tpc.h>
59#include <cam/ctl/ctl_error.h>
60
61struct tpcl_softc {
62 struct ctl_port port;
63 int cur_tag_num;
64};
65
66static struct tpcl_softc tpcl_softc;
67
68static int tpcl_init(void);
69static void tpcl_shutdown(void);
70static void tpcl_online(void *arg);
71static void tpcl_offline(void *arg);
72static int tpcl_lun_enable(void *arg, struct ctl_id target_id, int lun_id);
73static int tpcl_lun_disable(void *arg, struct ctl_id target_id, int lun_id);
--- 229 unchanged lines hidden (view full) ---
303static void
304tpcl_done(union ctl_io *io)
305{
306
307 tpc_done(io);
308}
309
310uint64_t
311tpcl_resolve(struct ctl_softc *softc, int init_port,
312 struct scsi_ec_cscd *cscd, uint32_t *ss)
313{
314 struct scsi_ec_cscd_id *cscdid;
315 struct ctl_port *port;
316 struct ctl_lun *lun;
317 uint64_t lunid = UINT64_MAX, l;
318 int i;
319
320 if (cscd->type_code != EC_CSCD_ID)
321 return (lunid);
--- 64 unchanged lines hidden ---
2 * Copyright (c) 2014 Alexander Motin <mav@FreeBSD.org>
3 * Copyright (c) 2004, 2005 Silicon Graphics International Corp.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
--- 12 unchanged lines hidden (view full) ---
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/cam/ctl/ctl_tpc_local.c 275942 2014-12-19 20:35:06Z mav $");
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/types.h>
35#include <sys/lock.h>
36#include <sys/module.h>
37#include <sys/mutex.h>
--- 20 unchanged lines hidden (view full) ---
58#include <cam/ctl/ctl_tpc.h>
59#include <cam/ctl/ctl_error.h>
60
61struct tpcl_softc {
62 struct ctl_port port;
63 int cur_tag_num;
64};
65
66static struct tpcl_softc tpcl_softc;
67
68static int tpcl_init(void);
69static void tpcl_shutdown(void);
70static void tpcl_online(void *arg);
71static void tpcl_offline(void *arg);
72static int tpcl_lun_enable(void *arg, struct ctl_id target_id, int lun_id);
73static int tpcl_lun_disable(void *arg, struct ctl_id target_id, int lun_id);
--- 229 unchanged lines hidden (view full) ---
303static void
304tpcl_done(union ctl_io *io)
305{
306
307 tpc_done(io);
308}
309
310uint64_t
311tpcl_resolve(struct ctl_softc *softc, int init_port,
312 struct scsi_ec_cscd *cscd, uint32_t *ss)
313{
314 struct scsi_ec_cscd_id *cscdid;
315 struct ctl_port *port;
316 struct ctl_lun *lun;
317 uint64_t lunid = UINT64_MAX, l;
318 int i;
319
320 if (cscd->type_code != EC_CSCD_ID)
321 return (lunid);
--- 64 unchanged lines hidden ---