From 8ed98609141e56dd738ea333279beec9f961dca8 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Fri, 12 Apr 2013 16:25:03 +0000 Subject: [PATCH] Remove ctl(4) from GENERIC. Also remove 'options CTL_DISABLE' and kern.cam.ctl.disable tunable; those were introduced as a workaround to make it possible to boot GENERIC on low memory machines. With ctl(4) being built as a module and automatically loaded by ctladm(8), this makes CTL work out of the box. Reviewed by: ken Sponsored by: FreeBSD Foundation --- sys/amd64/conf/GENERIC | 5 +---- sys/arm/conf/ATMEL | 2 +- sys/cam/ctl/ctl.c | 14 -------------- sys/cam/ctl/ctl_backend.c | 5 ----- sys/cam/ctl/ctl_frontend_cam_sim.c | 5 ----- sys/cam/ctl/ctl_frontend_internal.c | 5 ----- sys/cam/ctl/scsi_ctl.c | 5 ----- sys/conf/options | 3 --- sys/i386/conf/GENERIC | 5 +---- sys/i386/conf/PAE | 2 -- sys/ia64/conf/GENERIC | 2 +- sys/modules/ctl/Makefile | 1 - sys/sparc64/conf/GENERIC | 5 +---- 13 files changed, 5 insertions(+), 54 deletions(-) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 828e6ea0b7d8..1043b2b47378 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -137,10 +137,7 @@ device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) device ses # Enclosure Services (SES and SAF-TE) -device ctl # CAM Target Layer -options CTL_DISABLE # Disable CTL by default to save memory. - # Re-enable with kern.cam.ctl.disable=0 in - # /boot/loader.conf +#device ctl # CAM Target Layer # RAID controllers interfaced to the SCSI subsystem device amr # AMI MegaRAID diff --git a/sys/arm/conf/ATMEL b/sys/arm/conf/ATMEL index fc2316508d6f..eb3dd7d425bf 100644 --- a/sys/arm/conf/ATMEL +++ b/sys/arm/conf/ATMEL @@ -150,7 +150,7 @@ device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) device ses # Enclosure Services (SES and SAF-TE) -device ctl # CAM Target Layer +#device ctl # CAM Target Layer # Serial (COM) ports device uart # Multi-uart driver diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index cced79d3026a..137dee3a2d93 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -79,8 +79,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "opt_ctl.h" - struct ctl_softc *control_softc = NULL; /* @@ -320,16 +318,8 @@ static int persis_offset; static uint8_t ctl_pause_rtr; static int ctl_is_single = 1; static int index_to_aps_page; -#ifdef CTL_DISABLE -int ctl_disable = 1; -#else -int ctl_disable = 0; -#endif SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); -SYSCTL_INT(_kern_cam_ctl, OID_AUTO, disable, CTLFLAG_RDTUN, &ctl_disable, 0, - "Disable CTL"); -TUNABLE_INT("kern.cam.ctl.disable", &ctl_disable); /* * Serial number (0x80), device id (0x83), and supported pages (0x00) @@ -966,10 +956,6 @@ ctl_init(void) ctl_pause_rtr = 0; rcv_sync_msg = 0; - /* If we're disabled, don't initialize. */ - if (ctl_disable != 0) - return (0); - control_softc = malloc(sizeof(*control_softc), M_DEVBUF, M_WAITOK | M_ZERO); softc = control_softc; diff --git a/sys/cam/ctl/ctl_backend.c b/sys/cam/ctl/ctl_backend.c index 863e9c79ef7d..5234c4a32076 100644 --- a/sys/cam/ctl/ctl_backend.c +++ b/sys/cam/ctl/ctl_backend.c @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); #include extern struct ctl_softc *control_softc; -extern int ctl_disable; int ctl_backend_register(struct ctl_backend_driver *be) @@ -72,10 +71,6 @@ ctl_backend_register(struct ctl_backend_driver *be) ctl_softc = control_softc; - /* Don't continue if CTL is disabled */ - if (ctl_disable != 0) - return (0); - mtx_lock(&ctl_softc->ctl_lock); /* * Sanity check, make sure this isn't a duplicate registration. diff --git a/sys/cam/ctl/ctl_frontend_cam_sim.c b/sys/cam/ctl/ctl_frontend_cam_sim.c index 95483322902f..6a6a4872cdfe 100644 --- a/sys/cam/ctl/ctl_frontend_cam_sim.c +++ b/sys/cam/ctl/ctl_frontend_cam_sim.c @@ -119,7 +119,6 @@ struct cfcs_softc cfcs_softc; * amount of SCSI sense data that we will report to CAM. */ static int cfcs_max_sense = sizeof(struct scsi_sense_data); -extern int ctl_disable; SYSCTL_NODE(_kern_cam, OID_AUTO, ctl2cam, CTLFLAG_RD, 0, "CAM Target Layer SIM frontend"); @@ -150,10 +149,6 @@ cfcs_init(void) #endif int retval; - /* Don't continue if CTL is disabled */ - if (ctl_disable != 0) - return (0); - softc = &cfcs_softc; retval = 0; bzero(softc, sizeof(*softc)); diff --git a/sys/cam/ctl/ctl_frontend_internal.c b/sys/cam/ctl/ctl_frontend_internal.c index 9b25a70bd606..0c1ec27fa6df 100644 --- a/sys/cam/ctl/ctl_frontend_internal.c +++ b/sys/cam/ctl/ctl_frontend_internal.c @@ -188,7 +188,6 @@ struct cfi_softc { MALLOC_DEFINE(M_CTL_CFI, "ctlcfi", "CTL CFI"); static struct cfi_softc fetd_internal_softc; -extern int ctl_disable; int cfi_init(void); void cfi_shutdown(void) __unused; @@ -243,10 +242,6 @@ cfi_init(void) retval = 0; - /* If we're disabled, don't initialize */ - if (ctl_disable != 0) - return (0); - if (sizeof(struct cfi_lun_io) > CTL_PORT_PRIV_SIZE) { printf("%s: size of struct cfi_lun_io %zd > " "CTL_PORT_PRIV_SIZE %d\n", __func__, diff --git a/sys/cam/ctl/scsi_ctl.c b/sys/cam/ctl/scsi_ctl.c index 30f16f7bd397..f065e3b7e6ee 100644 --- a/sys/cam/ctl/scsi_ctl.c +++ b/sys/cam/ctl/scsi_ctl.c @@ -244,7 +244,6 @@ MODULE_DEPEND(ctlfe, ctl, 1, 1, 1); MODULE_DEPEND(ctlfe, cam, 1, 1, 1); extern struct ctl_softc *control_softc; -extern int ctl_disable; void ctlfeshutdown(void) @@ -257,10 +256,6 @@ ctlfeinit(void) { cam_status status; - /* Don't initialize if we're disabled */ - if (ctl_disable != 0) - return; - STAILQ_INIT(&ctlfe_softc_list); mtx_init(&ctlfe_list_mtx, ctlfe_mtx_desc, NULL, MTX_DEF); diff --git a/sys/conf/options b/sys/conf/options index e584e0c1bf41..c5bdbb0a08bd 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -332,9 +332,6 @@ SCSI_PT_DEFAULT_TIMEOUT opt_pt.h # Options used only in cam/scsi/scsi_ses.c SES_ENABLE_PASSTHROUGH opt_ses.h -# Options used only in cam/ctl -CTL_DISABLE opt_ctl.h - # Options used in dev/sym/ (Symbios SCSI driver). SYM_SETUP_LP_PROBE_MAP opt_sym.h #-Low Priority Probe Map (bits) # Allows the ncr to take precedence diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 5f10405df3d2..be606ecf482f 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -145,10 +145,7 @@ device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) device ses # Enclosure Services (SES and SAF-TE) -device ctl # CAM Target Layer -options CTL_DISABLE # Disable CTL by default to save memory. - # Re-enable with kern.cam.ctl.disable=0 in - # /boot/loader.conf +#device ctl # CAM Target Layer # RAID controllers interfaced to the SCSI subsystem device amr # AMI MegaRAID diff --git a/sys/i386/conf/PAE b/sys/i386/conf/PAE index 5600d08f386a..254dc08b65ce 100644 --- a/sys/i386/conf/PAE +++ b/sys/i386/conf/PAE @@ -38,8 +38,6 @@ nodevice ncv nodevice nsp nodevice stg -nodevice ctl - nodevice asr nodevice dpt nodevice mly diff --git a/sys/ia64/conf/GENERIC b/sys/ia64/conf/GENERIC index 882a5c7ed277..0407e35229d3 100644 --- a/sys/ia64/conf/GENERIC +++ b/sys/ia64/conf/GENERIC @@ -113,7 +113,7 @@ device da # Direct Access (ie disk) device pass # Passthrough (direct ATA/SCSI access) device sa # Sequential Access (ie tape) device ses # Enclosure Services (SES and SAF-TE) -device ctl # CAM Target Layer +#device ctl # CAM Target Layer # RAID controllers device aac # Adaptec FSA RAID diff --git a/sys/modules/ctl/Makefile b/sys/modules/ctl/Makefile index 0be1e1083a4a..5744b7d08ccd 100644 --- a/sys/modules/ctl/Makefile +++ b/sys/modules/ctl/Makefile @@ -21,7 +21,6 @@ SRCS+= bus_if.h SRCS+= device_if.h SRCS+= vnode_if.h SRCS+= opt_cam.h -SRCS+= opt_ctl.h SRCS+= opt_kdtrace.h .include diff --git a/sys/sparc64/conf/GENERIC b/sys/sparc64/conf/GENERIC index 818394e7a3de..ad8f42990ecb 100644 --- a/sys/sparc64/conf/GENERIC +++ b/sys/sparc64/conf/GENERIC @@ -120,10 +120,7 @@ device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) device ses # Enclosure Services (SES and SAF-TE) -device ctl # CAM Target Layer -options CTL_DISABLE # Disable CTL by default to save memory. - # Re-enable with kern.cam.ctl.disable=0 in - # /boot/loader.conf +#device ctl # CAM Target Layer # RAID controllers #device amr # AMI MegaRAID