summaryrefslogtreecommitdiff
path: root/net/isboot-kmod/files/patch-iscsi.c
diff options
context:
space:
mode:
authorKurt Jaeger <pi@FreeBSD.org>2015-09-24 10:28:58 +0000
committerKurt Jaeger <pi@FreeBSD.org>2015-09-24 10:28:58 +0000
commita8558b9e523a3853eefe3628d289a34bdb8dc7b8 (patch)
treeb743192b31cdb170ff472688a067902081c5dc70 /net/isboot-kmod/files/patch-iscsi.c
parentUpdate to version 1.15. (diff)
New port: net/isboot-kmod
This installs Daisuke Aoyama's isboot kernel module, which allows booting FreeBSD directly from an iSCSI root disk. If your BIOS supports iSCSI you may configure your target settings in the BIOS and boot directly. If not, you may PXE boot using software that contains iSCSI support such as iPXE. The module reads the iSCSI Boot Firmware Table (IBFT) to configure the network and re-attach the volume once the kernel begins execution. WWW: http://shell.peach.ne.jp/aoyama/archives/2115 (Japanese) PR: 203294 Submitted by: John Nielsen <john@jnielsen.net>
Notes
Notes: svn path=/head/; revision=397686
Diffstat (limited to 'net/isboot-kmod/files/patch-iscsi.c')
-rw-r--r--net/isboot-kmod/files/patch-iscsi.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/net/isboot-kmod/files/patch-iscsi.c b/net/isboot-kmod/files/patch-iscsi.c
new file mode 100644
index 000000000000..8634a7414894
--- /dev/null
+++ b/net/isboot-kmod/files/patch-iscsi.c
@@ -0,0 +1,56 @@
+--- iscsi.c.orig 2015-09-23 05:51:43 UTC
++++ iscsi.c
+@@ -1036,24 +1036,30 @@ isboot_append_param(pdu_t *pp, char *for
+ return (n);
+ }
+
+-#if __FreeBSD_version >= 1000050
++#if __FreeBSD_version < 1000050
++static void
++isboot_free_mbufext(void *p, void *optarg)
++#endif
++#if __FreeBSD_version >= 1000050 && __FreeBSD_version < 1100000
++#define EXT_FREE_OK 0
+ static int
+ isboot_free_mbufext(struct mbuf *m, void *p, void *optarg)
+-#else
++#endif
++#if __FreeBSD_version >= 1100000
+ static void
+-isboot_free_mbufext(void *p, void *optarg)
++isboot_free_mbufext(struct mbuf *m, void *p, void *optarg)
+ #endif
+ {
+
+ ISBOOT_TRACE("isboot_free_mbufext\n");
+ if (p == NULL)
+-#if __FreeBSD_version >= 1000050
++#if __FreeBSD_version >= 1000050 && __FreeBSD_version < 1100000
+ return (EXT_FREE_OK);
+ #else
+ return;
+ #endif
+ isboot_free_mext(p);
+-#if __FreeBSD_version >= 1000050
++#if __FreeBSD_version >= 1000050 && __FreeBSD_version < 1100000
+ return (EXT_FREE_OK);
+ #endif
+ }
+@@ -1072,7 +1078,7 @@ isboot_xmit_pdu(struct isboot_sess *sess
+ + sizeof(pp->hdr_dig) > MHLEN) {
+ panic("AHS=%d is too large", pp->ahs_len);
+ }
+- MGETHDR(mh, M_TRYWAIT, MT_DATA);
++ MGETHDR(mh, M_WAITOK, MT_DATA);
+ mh->m_pkthdr.rcvif = NULL;
+ memcpy(mh->m_data, &pp->ipdu, ISCSI_BHS_LEN);
+ mh->m_len = ISCSI_BHS_LEN;
+@@ -1099,7 +1105,7 @@ isboot_xmit_pdu(struct isboot_sess *sess
+ /* allocate external buffer and add it to mbuf */
+ ds_dd = isboot_malloc_mext(ISCSI_ALIGN(pp->ds_len)
+ + sizeof(pp->ds_dig));
+- MGET(md, M_TRYWAIT, MT_DATA);
++ MGET(md, M_WAITOK, MT_DATA);
+ #if __FreeBSD_version >= 800016
+ MEXTADD(md, (caddr_t)ds_dd, (ISCSI_ALIGN(pp->ds_len)
+ + sizeof(pp->ds_dig)),