.\"
.\" $FreeBSD: src/sbin/iscontrol/iscontrol.8,v 1.3 2008/11/25 07:17:11 scottl Exp $
.\"
-.Dd August 24, 2009
+.Dd September 04, 2009
.Dt ISCONTROL 8
.Os
.Sh NAME
RFC 3720
.\"Sh HISTORY
.Sh BUGS
-.Nm
-should probably load the iscsi_initiator module if needed.
.br
Not all functions/specifications have been implemented yet, noticeably
missing are the Task Management Functions.
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
+#include <sys/module.h>
+#include <sys/linker.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
isc_opt_t *op;
FILE *fd;
+ /* Try to load iscsi_initiator module before starting its operation */
+ if (modfind(INITIATORMOD) < 0) {
+ if (kldload(INITIATORMOD) < 0 || modfind(INITIATORMOD) < 0) {
+ perror(INITIATORMOD ": Error while handling kernel module");
+ return 1;
+ }
+ }
+
op = &opvals;
iscsidev = "/dev/"ISCSIDEV;
fd = NULL;
}
moduledata_t iscsi_mod = {
- "iscsi",
+ "iscsi_initiator",
(modeventhand_t) iscsi_modevent,
0
};
SYSINIT(cpu_rootconf1, SI_SUB_ROOT_CONF, SI_ORDER_FIRST, iscsi_rootconf, NULL)
#endif
-DECLARE_MODULE(iscsi, iscsi_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
-MODULE_DEPEND(iscsi, cam, 1, 1, 1);
+DECLARE_MODULE(iscsi_initiator, iscsi_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
+MODULE_DEPEND(iscsi_initiator, cam, 1, 1, 1);