ctl_frontend_iscsi.c (268685) | ctl_frontend_iscsi.c (268688) |
---|---|
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 268685 2014-07-15 17:08:04Z mav $ | 29 * $FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c 268688 2014-07-15 17:10:48Z mav $ |
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 268685 2014-07-15 17:08:04Z mav $"); | 37__FBSDID("$FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c 268688 2014-07-15 17:10:48Z mav $"); |
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> --- 98 unchanged lines hidden (view full) --- 144#define PDU_SESSION(X) CONN_SESSION((X)->ip_conn) 145#define PDU_EXPDATASN(X) (X)->ip_prv0 146#define PDU_TOTAL_TRANSFER_LEN(X) (X)->ip_prv1 147#define PDU_R2TSN(X) (X)->ip_prv2 148 149int cfiscsi_init(void); 150static void cfiscsi_online(void *arg); 151static void cfiscsi_offline(void *arg); | 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> --- 98 unchanged lines hidden (view full) --- 144#define PDU_SESSION(X) CONN_SESSION((X)->ip_conn) 145#define PDU_EXPDATASN(X) (X)->ip_prv0 146#define PDU_TOTAL_TRANSFER_LEN(X) (X)->ip_prv1 147#define PDU_R2TSN(X) (X)->ip_prv2 148 149int cfiscsi_init(void); 150static void cfiscsi_online(void *arg); 151static void cfiscsi_offline(void *arg); |
152static int cfiscsi_info(void *arg, struct sbuf *sb); |
|
152static int cfiscsi_lun_enable(void *arg, 153 struct ctl_id target_id, int lun_id); 154static int cfiscsi_lun_disable(void *arg, 155 struct ctl_id target_id, int lun_id); 156static uint32_t cfiscsi_lun_map(void *arg, uint32_t lun); 157static int cfiscsi_ioctl(struct cdev *dev, 158 u_long cmd, caddr_t addr, int flag, struct thread *td); 159static void cfiscsi_datamove(union ctl_io *io); --- 1250 unchanged lines hidden (view full) --- 1410 return; 1411 1412#ifdef ICL_KERNEL_PROXY 1413 icl_listen_free(softc->listener); 1414 softc->listener = NULL; 1415#endif 1416} 1417 | 153static int cfiscsi_lun_enable(void *arg, 154 struct ctl_id target_id, int lun_id); 155static int cfiscsi_lun_disable(void *arg, 156 struct ctl_id target_id, int lun_id); 157static uint32_t cfiscsi_lun_map(void *arg, uint32_t lun); 158static int cfiscsi_ioctl(struct cdev *dev, 159 u_long cmd, caddr_t addr, int flag, struct thread *td); 160static void cfiscsi_datamove(union ctl_io *io); --- 1250 unchanged lines hidden (view full) --- 1411 return; 1412 1413#ifdef ICL_KERNEL_PROXY 1414 icl_listen_free(softc->listener); 1415 softc->listener = NULL; 1416#endif 1417} 1418 |
1419static int 1420cfiscsi_info(void *arg, struct sbuf *sb) 1421{ 1422 struct cfiscsi_target *ct = (struct cfiscsi_target *)arg; 1423 int retval; 1424 1425 retval = sbuf_printf(sb, "\t<cfiscsi_state>%d</cfiscsi_state>\n", 1426 ct->ct_state); 1427 return (retval); 1428} 1429 |
|
1418static void 1419cfiscsi_ioctl_handoff(struct ctl_iscsi *ci) 1420{ 1421 struct cfiscsi_softc *softc; 1422 struct cfiscsi_session *cs; 1423 struct cfiscsi_target *ct; 1424 struct ctl_iscsi_handoff_params *cihp; 1425 int error; --- 566 unchanged lines hidden (view full) --- 1992 port->frontend = &cfiscsi_frontend; 1993 port->port_type = CTL_PORT_ISCSI; 1994 /* XXX KDM what should the real number be here? */ 1995 port->num_requested_ctl_io = 4096; 1996 port->port_name = "iscsi"; 1997 port->virtual_port = strtoul(tag, NULL, 0); 1998 port->port_online = cfiscsi_online; 1999 port->port_offline = cfiscsi_offline; | 1430static void 1431cfiscsi_ioctl_handoff(struct ctl_iscsi *ci) 1432{ 1433 struct cfiscsi_softc *softc; 1434 struct cfiscsi_session *cs; 1435 struct cfiscsi_target *ct; 1436 struct ctl_iscsi_handoff_params *cihp; 1437 int error; --- 566 unchanged lines hidden (view full) --- 2004 port->frontend = &cfiscsi_frontend; 2005 port->port_type = CTL_PORT_ISCSI; 2006 /* XXX KDM what should the real number be here? */ 2007 port->num_requested_ctl_io = 4096; 2008 port->port_name = "iscsi"; 2009 port->virtual_port = strtoul(tag, NULL, 0); 2010 port->port_online = cfiscsi_online; 2011 port->port_offline = cfiscsi_offline; |
2012 port->port_info = cfiscsi_info; |
|
2000 port->onoff_arg = ct; 2001 port->lun_enable = cfiscsi_lun_enable; 2002 port->lun_disable = cfiscsi_lun_disable; 2003 port->lun_map = cfiscsi_lun_map; 2004 port->targ_lun_arg = ct; 2005 port->fe_datamove = cfiscsi_datamove; 2006 port->fe_done = cfiscsi_done; 2007 --- 869 unchanged lines hidden --- | 2013 port->onoff_arg = ct; 2014 port->lun_enable = cfiscsi_lun_enable; 2015 port->lun_disable = cfiscsi_lun_disable; 2016 port->lun_map = cfiscsi_lun_map; 2017 port->targ_lun_arg = ct; 2018 port->fe_datamove = cfiscsi_datamove; 2019 port->fe_done = cfiscsi_done; 2020 --- 869 unchanged lines hidden --- |