The iBFT firmware driver has seen some action this last month. Here is a short primer on what it is: The iBFT is an equivalant to the Boot Flag, except that its geared towards iSCSI and hence requires much more information (such as the IP of target, passwords, which device to login, etc). iBFT is a data structure populated by the BIOS or the NIC to contain this so that the OS can read it and login to the iSCSI and present the boot device to the initrd for mounting / FS. There has been two big features added in: 1) Updated to support the 1.03 of the spec: ftp://ftp.software.ibm.com/systems/support/bladecenter/iscsi_boot_firmware_table_v1.03... 2) Split in two modules: one presentation that exports SysFS entries and the other that actually contains the iBFT data. The presentation driver paves the road for iSCSI hardware drivers (QLogic iSCSI HBA for example) to present the boot information they contain via this SysFS interface as they don't put the data in iBFT format. Please pull the 'for-linus' branch of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft-2.6.git for-linus Thank you! Konrad Rzeszutek Wilk (1): ibft: For UEFI machines actually do scan ACPI for iBFT. Mike Christie (2): ibft: separate ibft parsing from sysfs interface ibft: convert iscsi_ibft module to iscsi boot lib Peter Jones (1): ibft: Update iBFT handling for v1.03 of the spec. drivers/firmware/Kconfig | 9 + drivers/firmware/Makefile | 1 + drivers/firmware/iscsi_boot_sysfs.c | 481 +++++++++++++++++++++++ drivers/firmware/iscsi_ibft.c | 726 +++++++++++++---------------------- drivers/firmware/iscsi_ibft_find.c | 55 ++- include/linux/iscsi_boot_sysfs.h | 123 ++++++ include/linux/iscsi_ibft.h | 12 +- 7 files changed, 923 insertions(+), 484 deletions(-) --
For machines with IBFT 1.03 do scan the ACPI table for 'iBFT'
or for 'IBFT'. If the machine is in UEFI mode, only do the ACPI
table scan. For all other machines (pre IBFT 1.03) do
a memory scan if not found in the ACPI tables.
Author: Konrad Rzeszutek Wilk <konrad@kernel.org>
Acked-by: Peter Jones <pjones@redhat.com>
Tested-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
---
drivers/firmware/iscsi_ibft_find.c | 31 +++++++++++++++++++------------
1 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/drivers/firmware/iscsi_ibft_find.c b/drivers/firmware/iscsi_ibft_find.c
index 8f4d157..0bc3fae 100644
--- a/drivers/firmware/iscsi_ibft_find.c
+++ b/drivers/firmware/iscsi_ibft_find.c
@@ -56,23 +56,12 @@ static int __init acpi_find_ibft(struct acpi_table_header *header)
}
#endif /* CONFIG_ACPI */
-/*
- * Routine used to find the iSCSI Boot Format Table. The logical
- * kernel address is set in the ibft_addr global variable.
- */
-unsigned long __init find_ibft_region(unsigned long *sizep)
+static int __init find_ibft_mem_scan(void)
{
unsigned long pos;
unsigned int len = 0;
void *virt;
- ibft_addr = NULL;
-
- /* iBFT 1.03 section 1.4.3.1 mandates that UEFI machines will
- * only use ACPI for this */
- if (efi_enabled)
- return 0;
-
for (pos = IBFT_START; pos < IBFT_END; pos += 16) {
/* The table can't be inside the VGA BIOS reserved space,
* so skip that area */
@@ -91,6 +80,17 @@ unsigned long __init find_ibft_region(unsigned long *sizep)
}
}
}
+ return len;
+}
+/*
+ * Routine used to find the iSCSI Boot Format Table. The logical
+ * kernel address is set in the ibft_addr global variable.
+ */
+unsigned long __init find_ibft_region(unsigned long *sizep)
+{
+
+ ibft_addr = NULL;
+
#ifdef CONFIG_ACPI
/*
* One spec says "IBFT", the other says "iBFT". We have to check
@@ -101,6 +101,13 @@ unsigned long __init find_ibft_region(unsigned long *sizep)
if ...From: Peter Jones <pjones@redhat.com>
- Use struct acpi_table_ibft instead of struct ibft_table_header
- Don't do reserve_ibft_region() on UEFI machines (section 1.4.3.1)
- If ibft_addr isn't initialized when ibft_init() is called, check for
ACPI-based tables.
Author: Peter Jones <pjones@redhat.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
---
drivers/firmware/iscsi_ibft.c | 30 ++++++++++++++++++------------
drivers/firmware/iscsi_ibft_find.c | 34 +++++++++++++++++++++++++++++-----
include/linux/iscsi_ibft.h | 12 ++----------
3 files changed, 49 insertions(+), 27 deletions(-)
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index ed2801c..b3ab24f 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2007 Red Hat, Inc.
+ * Copyright 2007-2010 Red Hat, Inc.
* by Peter Jones <pjones@redhat.com>
* Copyright 2008 IBM, Inc.
* by Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
@@ -19,6 +19,9 @@
*
* Changelog:
*
+ * 06 Jan 2010 - Peter Jones <pjones@redhat.com>
+ * New changelog entries are in the git log from now on. Not here.
+ *
* 14 Mar 2008 - Konrad Rzeszutek <ketuzsezr@darnok.org>
* Updated comments and copyrights. (v0.4.9)
*
@@ -78,9 +81,10 @@
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/types.h>
+#include <linux/acpi.h>
-#define IBFT_ISCSI_VERSION "0.4.9"
-#define IBFT_ISCSI_DATE "2008-Mar-14"
+#define IBFT_ISCSI_VERSION "0.5.0"
+#define IBFT_ISCSI_DATE "2010-Feb-25"
MODULE_AUTHOR("Peter Jones <pjones@redhat.com> and \
Konrad Rzeszutek <ketuzsezr@darnok.org>");
@@ -238,7 +242,7 @@ static const char *ibft_initiator_properties[] =
*/
struct ibft_kobject {
- struct ibft_table_header *header;
+ struct acpi_table_ibft *header;
union {
struct ibft_initiator *initiator;
struct ibft_nic *nic;
@@ -536,12 ...From: Mike Christie <michaelc@cs.wisc.edu> Not all iscsi drivers support ibft. For drivers like be2iscsi that do not but are bootable through a vendor firmware specific format/process this patch moves the sysfs interface from the ibft code to a lib module. This then allows userspace tools to search for iscsi boot info in a common place and in a common format. ibft iscsi boot info is exported in the same place as it was before: /sys/firmware/ibft. vendor/fw boot info gets export in /sys/firmware/iscsi_bootX, where X is the scsi host number of the HBA. Underneath these parent dirs, the target, ethernet, and initiator dirs are the same as they were before. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Peter Jones <pjones@redhat.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org> --- drivers/firmware/Kconfig | 8 + drivers/firmware/Makefile | 1 + drivers/firmware/iscsi_boot_sysfs.c | 481 +++++++++++++++++++++++++++++++++++ include/linux/iscsi_boot_sysfs.h | 123 +++++++++ 4 files changed, 613 insertions(+), 0 deletions(-) create mode 100644 drivers/firmware/iscsi_boot_sysfs.c create mode 100644 include/linux/iscsi_boot_sysfs.h diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index 1b03ba1..571d218 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -122,6 +122,14 @@ config ISCSI_IBFT_FIND is necessary for iSCSI Boot Firmware Table Attributes module to work properly. +config ISCSI_BOOT_SYSFS + tristate "iSCSI Boot Sysfs Interface" + default n + help + This option enables support for exposing iSCSI boot information + via sysfs to userspace. If you wish to export this information, + say Y. Otherwise, say N. + config ISCSI_IBFT tristate "iSCSI Boot Firmware Table Attributes module" depends on ISCSI_IBFT_FIND diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile index 1c3c173..5fe7e16 100644 --- a/drivers/firmware/Makefile +++ ...
From: Mike Christie <michaelc@cs.wisc.edu>
This patch just converts the iscsi_ibft module to the
iscsi boot sysfs lib module.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
Signed-off-by: Peter Jones <pjones@redhat.com>
---
drivers/firmware/Kconfig | 1 +
drivers/firmware/iscsi_ibft.c | 698 +++++++++++++++--------------------------
2 files changed, 248 insertions(+), 451 deletions(-)
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 571d218..a6c670b 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -132,6 +132,7 @@ config ISCSI_BOOT_SYSFS
config ISCSI_IBFT
tristate "iSCSI Boot Firmware Table Attributes module"
+ select ISCSI_BOOT_SYSFS
depends on ISCSI_IBFT_FIND
default n
help
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index b3ab24f..4f04ec0 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -82,6 +82,7 @@
#include <linux/string.h>
#include <linux/types.h>
#include <linux/acpi.h>
+#include <linux/iscsi_boot_sysfs.h>
#define IBFT_ISCSI_VERSION "0.5.0"
#define IBFT_ISCSI_DATE "2010-Feb-25"
@@ -170,74 +171,6 @@ enum ibft_id {
};
/*
- * We do not support the other types, hence the usage of NULL.
- * This maps to the enum ibft_id.
- */
-static const char *ibft_id_names[] =
- {NULL, NULL, "initiator", "ethernet%d", "target%d", NULL, NULL};
-
-/*
- * The text attributes names for each of the kobjects.
-*/
-enum ibft_eth_properties_enum {
- ibft_eth_index,
- ibft_eth_flags,
- ibft_eth_ip_addr,
- ibft_eth_subnet_mask,
- ibft_eth_origin,
- ibft_eth_gateway,
- ibft_eth_primary_dns,
- ibft_eth_secondary_dns,
- ibft_eth_dhcp,
- ibft_eth_vlan,
- ibft_eth_mac,
- /* ibft_eth_pci_bdf - this is replaced by link to the device itself. */
- ibft_eth_hostname,
- ibft_eth_end_marker,
-};
-
-static const char *ibft_eth_properties[] =
- {"index", "flags", "ip-addr", ...