Deleted Added
full compact
ctl_tpc_local.c (274785) ctl_tpc_local.c (275942)
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>
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 274785 2014-11-21 06:27:37Z mav $");
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
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
66extern struct ctl_softc *control_softc;
67static struct tpcl_softc tpcl_softc;
68
69static int tpcl_init(void);
70static void tpcl_shutdown(void);
71static void tpcl_online(void *arg);
72static void tpcl_offline(void *arg);
73static int tpcl_lun_enable(void *arg, struct ctl_id target_id, int lun_id);
74static int tpcl_lun_disable(void *arg, struct ctl_id target_id, int lun_id);

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

304static void
305tpcl_done(union ctl_io *io)
306{
307
308 tpc_done(io);
309}
310
311uint64_t
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
312tpcl_resolve(int init_port, struct scsi_ec_cscd *cscd, uint32_t *ss)
311tpcl_resolve(struct ctl_softc *softc, int init_port,
312 struct scsi_ec_cscd *cscd, uint32_t *ss)
313{
313{
314 struct ctl_softc *softc = control_softc;
315 struct scsi_ec_cscd_id *cscdid;
316 struct ctl_port *port;
317 struct ctl_lun *lun;
318 uint64_t lunid = UINT64_MAX, l;
319 int i;
320
321 if (cscd->type_code != EC_CSCD_ID)
322 return (lunid);

--- 64 unchanged lines hidden ---
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 ---