Add iSCSI IBFT support (v0.4.3)
Subsystems (4)
PATCH 1/1 Add iSCSI IBFT support (v0.4.3)
This patch (v0.4.3) adds /sysfs/firmware/ibft/[initiator|targetX|ethernetX| extensionX] directories along with text properties which export the the iSCSI Boot Firmware Table (iBFT) structure.
What is iSCSI Boot Firmware Table? It is a mechanism for the iSCSI tools to extract from the machine NICs the iSCSI connection information so that they can automagically mount the iSCSI share/target. Currently the iSCSI information is hard-coded in the initrd.
For full details of the IBFT structure please take a look at:
ftp://ftp.software.ibm.com/systems/support/system_x_pdf/ibm_iscsi_boot_firmware_table_v1.02.pdf
Please note that this patch depends on the Greg KH patches tree kobject changes.
Documentation/ABI/testing/sysfs-ibft new file +31 -0
@@ -0,0 +1,31 @@ +What: /sys/firmware/ibft/initiator +Date: November 2007 +Contact: Konrad Rzeszutek <[email protected]> +Description: The /sys/firmware/ibft/initiator directory will contain + files that expose the iSCSI Boot Firmware Table initiator data. + Usually this contains the Initiator name. + +What: /sys/firmware/ibft/targetX +Date: November 2007 +Contact: Konrad Rzeszutek <[email protected]> +Description: The /sys/firmware/ibft/targetX directory will contain + files that expose the iSCSI Boot Firmware Table target data. + Usually this contains the target's IP address, boot LUN, + target name, and what NIC it is associated with. It can also + contain the CHAP name (and password), the reverse CHAP + name (and password) + +What: /sys/firmware/ibft/ethernetX +Date: November 2007 +Contact: Konrad Rzeszutek <[email protected]> +Description: The /sys/firmware/ibft/ethernetX directory will contain + files that expose the iSCSI Boot Firmware Table NIC data. + This can this can the IP address, MAC, and gateway of the NIC. + +What: /sys/firmware/ibft/extensionX +Date: November 2007 +Contact: Konrad Rzeszutek <[email protected]> +Description: The /sys/firmware/ibft/extensionX directory will contain + files that expose the iSCSI Boot Firmware Table extension data. + The extended data structure is not supported so there would be + no files in this directory.
arch/x86/kernel/setup_32.c +17 -0
@@ -39,6 +39,7 @@ #include <linux/module.h>#include <linux/efi.h> #include <linux/init.h> #include <linux/edd.h> +#include <linux/iscsi_ibft.h> #include <linux/nodemask.h> #include <linux/kexec.h> #include <linux/crash_dump.h>
@@ -148,6 +149,20 @@ static inline void copy_edd(void) }#endif +#if defined(CONFIG_ISCSI_IBFT_FIND ) +static void __init reserve_ibft_region (void ) +{ +unsigned int ibft_len; + + ibft_len =find_ibft (); +if (ibft_len) +reserve_bootmem ((unsigned int )ibft_phys, +PAGE_ALIGN (ibft_len)); +} +#else +static void __init reserve_ibft_region (void ) { } +#endif +int __initdata user_defined_memmap =0 ;/*
@@ -496,6 +511,8 @@ #ifdef CONFIG_BLK_DEV_INITRD }#endif reserve_crashkernel (); + +reserve_ibft_region (); }/*
arch/x86/kernel/setup_64.c +18 -0
@@ -33,6 +33,7 @@ #include <linux/pci.h>#include <linux/acpi.h> #include <linux/kallsyms.h> #include <linux/edd.h> +#include <linux/iscsi_ibft.h> #include <linux/mmzone.h> #include <linux/kexec.h> #include <linux/cpufreq.h>
@@ -198,6 +199,20 @@ static inline void copy_edd(void) }#endif +#if defined(CONFIG_ISCSI_IBFT_FIND ) +static void __init reserve_ibft_region (void ) +{ +unsigned int ibft_len; + + ibft_len =find_ibft (); +if (ibft_len) +reserve_bootmem_generic ((unsigned long )ibft_phys, +PAGE_ALIGN (ibft_len)); +} +#else +static void __init reserve_ibft_region (void ) { } +#endif +#ifdef CONFIG_KEXEC static void __init reserve_crashkernel (void ) {
@@ -403,6 +418,9 @@ #ifdef CONFIG_BLK_DEV_INITRD }#endif reserve_crashkernel (); + +reserve_ibft_region (); +paging_init ();#ifdef CONFIG_PCI
drivers/firmware/Kconfig +19 -0
@@ -93,4 +93,23 @@ config DMIID information from userspace through /sys/class/dmi/id/ or if you want DMI-based module auto-loading. +config ISCSI_IBFT_FIND + bool "iSCSI Boot Firmware Table Attributes" + default n + help + This option enables the kernel to find the region of memory + in which the ISCSI Boot Firmware Table (iBFT) resides. This + is necessary for iSCSI Boot Firmware Table Attributes module to work + properly. + +config ISCSI_IBFT + tristate "iSCSI Boot Firmware Table Attributes module" + depends on ISCSI_IBFT_FIND + default n + help + This option enables support for detection and exposing of iSCSI + Boot Firmware Table (iBFT) via sysfs to userspace. If you wish to + detect iSCSI boot parameters dynamically during system boot, say Y. + Otherwise, say N. + endmenu
drivers/firmware/Makefile +2 -0
@@ -8,3 +8,5 @@ obj-$(CONFIG_EFI_PCDP) += pcdp.o obj-$(CONFIG_DELL_RBU) += dell_rbu.o obj-$(CONFIG_DCDBAS) += dcdbas.o obj-$(CONFIG_DMIID) += dmi-id.o +obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o +obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o
drivers/firmware/iscsi_ibft.c new file +927 -0
927 lines not on this page · raw message
drivers/firmware/iscsi_ibft_find.c new file +77 -0
77 lines not on this page · raw message
drivers/scsi/libsas/sas_ata.c +0 -0
include/linux/iscsi_ibft.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* Copyright 2007 Red Hat, Inc. +* by Peter Jones <[email protected]> +* Copyright 2007 IBM, Inc. +* by Konrad Rzeszutek <[email protected]> +* +* This code exposes the iSCSI Boot Format Table to userland via sysfs. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License v2.0 as published by +* the Free Software Foundation +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#ifndef ISCSI_IBFT_H +#define ISCSI_IBFT_H + +#if defined(CONFIG_ISCSI_IBFT_FIND ) + +/* +* Physical location of iSCSI Boot Format Table. +*/ +extern void *ibft_phys; + +/* +* Routine used to find the iSCSI Boot Format Table. The physical +* location is set in the ibft_phys variable. The return value is the +* size of IBFT. +*/ +extern ssize_t find_ibft (void ); + +#endif + +#endif /* ISCSI_IBFT_H */