From 2ebde326cbe64667e0ba53bb9a09819fda5da330 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 10:18:44 +0000 Subject: [PATCH] Add some stuff to make it easier to figure out for the system administrator whether the ICL_KERNEL_PROXY stuff got compiled in correctly. Sponsored by: The FreeBSD Foundation --- sys/cam/ctl/ctl_frontend_iscsi.c | 17 ++++++++++++++++- sys/cam/ctl/ctl_ioctl.h | 6 +++++- sys/dev/iscsi/iscsi.c | 4 ++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c index 411aafc748c..36650354d2e 100644 --- a/sys/cam/ctl/ctl_frontend_iscsi.c +++ b/sys/cam/ctl/ctl_frontend_iscsi.c @@ -75,6 +75,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef ICL_KERNEL_PROXY +FEATURE(cfiscsi_kernel_proxy, "iSCSI target built with ICL_KERNEL_PROXY"); +#endif + static MALLOC_DEFINE(M_CFISCSI, "cfiscsi", "Memory used for CTL iSCSI frontend"); static uma_zone_t cfiscsi_data_wait_zone; @@ -1960,7 +1964,18 @@ cfiscsi_ioctl(struct cdev *dev, case CTL_ISCSI_CLOSE: cfiscsi_ioctl_close(ci); break; -#endif /* ICL_KERNEL_PROXY */ +#else + case CTL_ISCSI_LISTEN: + case CTL_ISCSI_ACCEPT: + case CTL_ISCSI_SEND: + case CTL_ISCSI_RECEIVE: + case CTL_ISCSI_CLOSE: + ci->status = CTL_ISCSI_ERROR; + snprintf(ci->error_str, sizeof(ci->error_str), + "%s: CTL compiled without ICL_KERNEL_PROXY", + __func__); + break; +#endif /* !ICL_KERNEL_PROXY */ default: ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), diff --git a/sys/cam/ctl/ctl_ioctl.h b/sys/cam/ctl/ctl_ioctl.h index d9aab930add..acd6bfed80a 100644 --- a/sys/cam/ctl/ctl_ioctl.h +++ b/sys/cam/ctl/ctl_ioctl.h @@ -617,7 +617,11 @@ typedef enum { CTL_ISCSI_LIST, CTL_ISCSI_LOGOUT, CTL_ISCSI_TERMINATE, -#ifdef ICL_KERNEL_PROXY +#if defined(ICL_KERNEL_PROXY) || 1 + /* + * We actually need those in all cases, but leave the ICL_KERNEL_PROXY, + * to remember to remove them along with rest of proxy code, eventually. + */ CTL_ISCSI_LISTEN, CTL_ISCSI_ACCEPT, CTL_ISCSI_SEND, diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index 77b6cfcb0ec..2a43e79a0a1 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -66,6 +66,10 @@ #include #endif +#ifdef ICL_KERNEL_PROXY +FEATURE(iscsi_kernel_proxy, "iSCSI initiator built with ICL_KERNEL_PROXY"); +#endif + /* * XXX: This is global so the iscsi_unload() can access it. * Think about how to do this properly.