Deleted Added
full compact
ctl_frontend.c (279002) ctl_frontend.c (284798)
1/*-
2 * Copyright (c) 2003 Silicon Graphics International Corp.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

31 */
32/*
33 * CAM Target Layer front end interface code
34 *
35 * Author: Ken Merry <ken@FreeBSD.org>
36 */
37
38#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2003 Silicon Graphics International Corp.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

31 */
32/*
33 * CAM Target Layer front end interface code
34 *
35 * Author: Ken Merry <ken@FreeBSD.org>
36 */
37
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: stable/10/sys/cam/ctl/ctl_frontend.c 279002 2015-02-19 14:31:16Z mav $");
39__FBSDID("$FreeBSD: stable/10/sys/cam/ctl/ctl_frontend.c 284798 2015-06-25 07:11:48Z mav $");
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/kernel.h>
44#include <sys/types.h>
45#include <sys/malloc.h>
46#include <sys/lock.h>
47#include <sys/mutex.h>

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

296 desc->length = CTL_WWPN_LEN;
297 scsi_u64to8b(port->wwpn, desc->identifier);
298 }
299}
300
301void
302ctl_port_online(struct ctl_port *port)
303{
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/kernel.h>
44#include <sys/types.h>
45#include <sys/malloc.h>
46#include <sys/lock.h>
47#include <sys/mutex.h>

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

296 desc->length = CTL_WWPN_LEN;
297 scsi_u64to8b(port->wwpn, desc->identifier);
298 }
299}
300
301void
302ctl_port_online(struct ctl_port *port)
303{
304 struct ctl_softc *softc = control_softc;
305 struct ctl_lun *lun;
306 uint32_t l;
307
308 if (port->lun_map) {
309 for (l = 0; l < CTL_MAX_LUNS; l++) {
310 if (ctl_lun_map_from_port(port, l) >= CTL_MAX_LUNS)
311 continue;
312 port->lun_enable(port->targ_lun_arg, l);
313 }
314 } else {
315 STAILQ_FOREACH(lun, &softc->lun_list, links)
316 port->lun_enable(port->targ_lun_arg, lun->lun);
317 }
304 port->port_online(port->onoff_arg);
305 /* XXX KDM need a lock here? */
306 port->status |= CTL_PORT_STATUS_ONLINE;
307}
308
309void
310ctl_port_offline(struct ctl_port *port)
311{
318 port->port_online(port->onoff_arg);
319 /* XXX KDM need a lock here? */
320 port->status |= CTL_PORT_STATUS_ONLINE;
321}
322
323void
324ctl_port_offline(struct ctl_port *port)
325{
326 struct ctl_softc *softc = control_softc;
327 struct ctl_lun *lun;
328 uint32_t l;
329
312 port->port_offline(port->onoff_arg);
330 port->port_offline(port->onoff_arg);
331 if (port->lun_map) {
332 for (l = 0; l < CTL_MAX_LUNS; l++) {
333 if (ctl_lun_map_from_port(port, l) >= CTL_MAX_LUNS)
334 continue;
335 port->lun_disable(port->targ_lun_arg, l);
336 }
337 } else {
338 STAILQ_FOREACH(lun, &softc->lun_list, links)
339 port->lun_disable(port->targ_lun_arg, lun->lun);
340 }
313 /* XXX KDM need a lock here? */
314 port->status &= ~CTL_PORT_STATUS_ONLINE;
315}
316
317/*
318 * vim: ts=8
319 */
341 /* XXX KDM need a lock here? */
342 port->status &= ~CTL_PORT_STATUS_ONLINE;
343}
344
345/*
346 * vim: ts=8
347 */