diff options
| author | Konrad Rzeszutek <ketuzsezr@darnok.org> | 2008-04-09 22:50:41 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-19 22:10:28 -0400 |
| commit | 138fe4e069798d9aa948a5402ff15e58f483ee4e (patch) | |
| tree | 413ab0c86618df7dba7724c1945fd46cd33298b9 /include/linux | |
| parent | 95bc6a10830de469eee94c17fb1c37b3b1430715 (diff) | |
Firmware: add iSCSI iBFT Support
Add /sysfs/firmware/ibft/[initiator|targetX|ethernetX] 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. The /sysfs entries are read-only
one-name-and-value fields.
The usual set of data exposed is:
# for a in `find /sys/firmware/ibft/ -type f -print`; do echo -n "$a: "; cat $a; done
/sys/firmware/ibft/target0/target-name: iqn.2007.com.intel-sbx44:storage-10gb
/sys/firmware/ibft/target0/nic-assoc: 0
/sys/firmware/ibft/target0/chap-type: 0
/sys/firmware/ibft/target0/lun: 00000000
/sys/firmware/ibft/target0/port: 3260
/sys/firmware/ibft/target0/ip-addr: 192.168.79.116
/sys/firmware/ibft/target0/flags: 3
/sys/firmware/ibft/target0/index: 0
/sys/firmware/ibft/ethernet0/mac: 00:11:25:9d:8b:01
/sys/firmware/ibft/ethernet0/vlan: 0
/sys/firmware/ibft/ethernet0/gateway: 192.168.79.254
/sys/firmware/ibft/ethernet0/origin: 0
/sys/firmware/ibft/ethernet0/subnet-mask: 255.255.252.0
/sys/firmware/ibft/ethernet0/ip-addr: 192.168.77.41
/sys/firmware/ibft/ethernet0/flags: 7
/sys/firmware/ibft/ethernet0/index: 0
/sys/firmware/ibft/initiator/initiator-name: iqn.2007-07.com:konrad.initiator
/sys/firmware/ibft/initiator/flags: 3
/sys/firmware/ibft/initiator/index: 0
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
[akpm@linux-foundation.org: fix build]
Signed-off-by: Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: Peter Jones <pjones@redhat.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/iscsi_ibft.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h new file mode 100644 index 000000000000..6092487e2950 --- /dev/null +++ b/include/linux/iscsi_ibft.h | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2007 Red Hat, Inc. | ||
| 3 | * by Peter Jones <pjones@redhat.com> | ||
| 4 | * Copyright 2007 IBM, Inc. | ||
| 5 | * by Konrad Rzeszutek <konradr@linux.vnet.ibm.com> | ||
| 6 | * Copyright 2008 | ||
| 7 | * by Konrad Rzeszutek <ketuzsezr@darnok.org> | ||
| 8 | * | ||
| 9 | * This code exposes the iSCSI Boot Format Table to userland via sysfs. | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or modify | ||
| 12 | * it under the terms of the GNU General Public License v2.0 as published by | ||
| 13 | * the Free Software Foundation | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, | ||
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | * GNU General Public License for more details. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef ISCSI_IBFT_H | ||
| 22 | #define ISCSI_IBFT_H | ||
| 23 | |||
| 24 | struct ibft_table_header { | ||
| 25 | char signature[4]; | ||
| 26 | u32 length; | ||
| 27 | u8 revision; | ||
| 28 | u8 checksum; | ||
| 29 | char oem_id[6]; | ||
| 30 | char oem_table_id[8]; | ||
| 31 | char reserved[24]; | ||
| 32 | } __attribute__((__packed__)); | ||
| 33 | |||
| 34 | /* | ||
| 35 | * Logical location of iSCSI Boot Format Table. | ||
| 36 | * If the value is NULL there is no iBFT on the machine. | ||
| 37 | */ | ||
| 38 | extern struct ibft_table_header *ibft_addr; | ||
| 39 | |||
| 40 | /* | ||
| 41 | * Routine used to find and reserve the iSCSI Boot Format Table. The | ||
| 42 | * mapped address is set in the ibft_addr variable. | ||
| 43 | */ | ||
| 44 | #ifdef CONFIG_ISCSI_IBFT_FIND | ||
| 45 | extern void __init reserve_ibft_region(void); | ||
| 46 | #else | ||
| 47 | static inline void reserve_ibft_region(void) { } | ||
| 48 | #endif | ||
| 49 | |||
| 50 | #endif /* ISCSI_IBFT_H */ | ||
