mirror of
https://github.com/opnsense/src.git
synced 2026-02-25 19:05:20 -05:00
ioctl frontend ports.
This revision introduces two changes to CTL:
- Changes the way options are passed to CTL_LUN_REQ and CTL_PORT_REQ ioctls.
Removes ctl_be_arg structure and associated logic and replaces it with
nv(3)-based logic for passing in and out arguments.
- Allows creating multiple ioctl frontend ports using either ctladm(8) or
ctld(8).
New frontend ports are represented by /dev/cam/ctl<pp>.<vp> nodes, eg /dev/cam/ctl5.3.
Those device nodes respond only to CTL_IO ioctl.
New command-line options for ctladm:
# creates new ioctl frontend port with using free pp and vp=0
ctladm port -c
# creates new ioctl frontend port with pp=10 and vp=0
ctladm port -c -O pp=10
# creates new ioctl frontend port with pp=11 and vp=12
ctladm port -c -O pp=11 -O vp=12
# removes port with number 4 (it's a "targ_port" number, not pp number)
ctladm port -r -p 4
New syntax for ctl.conf:
target ... {
port ioctl/<pp>
...
}
target ... {
port ioctl/<pp>/<vp>
...
Note: Most of this work was made by jceel@, thank you.
Submitted by: jceel
Reworked by: myself
Reviewed by: mav (earlier versions and recently during the rework)
Obtained from: FreeNAS and TrueOS
Relnotes: Yes
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D9299
26 lines
652 B
Makefile
26 lines
652 B
Makefile
# $FreeBSD$
|
|
|
|
.include <src.opts.mk>
|
|
|
|
PROG= ctladm
|
|
SRCS= ctladm.c util.c ctl_util.c ctl_scsi_all.c
|
|
.PATH: ${SRCTOP}/sys/cam/ctl
|
|
SDIR= ${SRCTOP}/sys
|
|
CFLAGS+= -I${SDIR}
|
|
# This is necessary because of these warnings:
|
|
# warning: cast increases required alignment of target type
|
|
# The solution is to either upgrade the compiler (preferred), or do void
|
|
# pointer gymnastics to get around the warning. For now, disable the
|
|
# warning instead of doing the void pointer workaround.
|
|
.if ${MACHINE_CPUARCH} == "arm"
|
|
WARNS?= 3
|
|
.endif
|
|
|
|
LIBADD= cam sbuf bsdxml util nv
|
|
MAN= ctladm.8
|
|
|
|
.if ${MK_ISCSI} != "no"
|
|
CFLAGS+= -DWANT_ISCSI
|
|
.endif
|
|
|
|
.include <bsd.prog.mk>
|