diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 14:25:58 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 14:25:58 -0400 |
| commit | 5abd9ccced7a726c817dd6b5b96bc933859138d1 (patch) | |
| tree | 52b4612b5fb54f00364eadf39e0155209498e5d9 /include | |
| parent | d5fc1d517543857ea117fc57f23b394aa9784f06 (diff) | |
| parent | 57a5f3c99c99f70f8fdfa0bbc83b98c48f56551a (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft-2.6:
ibft: Use IBFT_SIGN instead of open-coding the search string.
ibft: convert iscsi_ibft module to iscsi boot lib
ibft: separate ibft parsing from sysfs interface
ibft: For UEFI machines actually do scan ACPI for iBFT.
ibft: Update iBFT handling for v1.03 of the spec.
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/iscsi_boot_sysfs.h | 123 | ||||
| -rw-r--r-- | include/linux/iscsi_ibft.h | 12 |
2 files changed, 125 insertions, 10 deletions
diff --git a/include/linux/iscsi_boot_sysfs.h b/include/linux/iscsi_boot_sysfs.h new file mode 100644 index 000000000000..f1e6c184f14f --- /dev/null +++ b/include/linux/iscsi_boot_sysfs.h | |||
| @@ -0,0 +1,123 @@ | |||
| 1 | /* | ||
| 2 | * Export the iSCSI boot info to userland via sysfs. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Red Hat, Inc. All rights reserved. | ||
| 5 | * Copyright (C) 2010 Mike Christie | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License v2.0 as published by | ||
| 9 | * the Free Software Foundation | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | */ | ||
| 16 | #ifndef _ISCSI_BOOT_SYSFS_ | ||
| 17 | #define _ISCSI_BOOT_SYSFS_ | ||
| 18 | |||
| 19 | /* | ||
| 20 | * The text attributes names for each of the kobjects. | ||
| 21 | */ | ||
| 22 | enum iscsi_boot_eth_properties_enum { | ||
| 23 | ISCSI_BOOT_ETH_INDEX, | ||
| 24 | ISCSI_BOOT_ETH_FLAGS, | ||
| 25 | ISCSI_BOOT_ETH_IP_ADDR, | ||
| 26 | ISCSI_BOOT_ETH_SUBNET_MASK, | ||
| 27 | ISCSI_BOOT_ETH_ORIGIN, | ||
| 28 | ISCSI_BOOT_ETH_GATEWAY, | ||
| 29 | ISCSI_BOOT_ETH_PRIMARY_DNS, | ||
| 30 | ISCSI_BOOT_ETH_SECONDARY_DNS, | ||
| 31 | ISCSI_BOOT_ETH_DHCP, | ||
| 32 | ISCSI_BOOT_ETH_VLAN, | ||
| 33 | ISCSI_BOOT_ETH_MAC, | ||
| 34 | /* eth_pci_bdf - this is replaced by link to the device itself. */ | ||
| 35 | ISCSI_BOOT_ETH_HOSTNAME, | ||
| 36 | ISCSI_BOOT_ETH_END_MARKER, | ||
| 37 | }; | ||
| 38 | |||
| 39 | enum iscsi_boot_tgt_properties_enum { | ||
| 40 | ISCSI_BOOT_TGT_INDEX, | ||
| 41 | ISCSI_BOOT_TGT_FLAGS, | ||
| 42 | ISCSI_BOOT_TGT_IP_ADDR, | ||
| 43 | ISCSI_BOOT_TGT_PORT, | ||
| 44 | ISCSI_BOOT_TGT_LUN, | ||
| 45 | ISCSI_BOOT_TGT_CHAP_TYPE, | ||
| 46 | ISCSI_BOOT_TGT_NIC_ASSOC, | ||
| 47 | ISCSI_BOOT_TGT_NAME, | ||
| 48 | ISCSI_BOOT_TGT_CHAP_NAME, | ||
| 49 | ISCSI_BOOT_TGT_CHAP_SECRET, | ||
| 50 | ISCSI_BOOT_TGT_REV_CHAP_NAME, | ||
| 51 | ISCSI_BOOT_TGT_REV_CHAP_SECRET, | ||
| 52 | ISCSI_BOOT_TGT_END_MARKER, | ||
| 53 | }; | ||
| 54 | |||
| 55 | enum iscsi_boot_initiator_properties_enum { | ||
| 56 | ISCSI_BOOT_INI_INDEX, | ||
| 57 | ISCSI_BOOT_INI_FLAGS, | ||
| 58 | ISCSI_BOOT_INI_ISNS_SERVER, | ||
| 59 | ISCSI_BOOT_INI_SLP_SERVER, | ||
| 60 | ISCSI_BOOT_INI_PRI_RADIUS_SERVER, | ||
| 61 | ISCSI_BOOT_INI_SEC_RADIUS_SERVER, | ||
| 62 | ISCSI_BOOT_INI_INITIATOR_NAME, | ||
| 63 | ISCSI_BOOT_INI_END_MARKER, | ||
| 64 | }; | ||
| 65 | |||
| 66 | struct attribute_group; | ||
| 67 | |||
| 68 | struct iscsi_boot_kobj { | ||
| 69 | struct kobject kobj; | ||
| 70 | struct attribute_group *attr_group; | ||
| 71 | struct list_head list; | ||
| 72 | |||
| 73 | /* | ||
| 74 | * Pointer to store driver specific info. If set this will | ||
| 75 | * be freed for the LLD when the kobj release function is called. | ||
| 76 | */ | ||
| 77 | void *data; | ||
| 78 | /* | ||
| 79 | * Driver specific show function. | ||
| 80 | * | ||
| 81 | * The enum of the type. This can be any value of the above | ||
| 82 | * properties. | ||
| 83 | */ | ||
| 84 | ssize_t (*show) (void *data, int type, char *buf); | ||
| 85 | |||
| 86 | /* | ||
| 87 | * Drivers specific visibility function. | ||
| 88 | * The function should return if they the attr should be readable | ||
| 89 | * writable or should not be shown. | ||
| 90 | * | ||
| 91 | * The enum of the type. This can be any value of the above | ||
| 92 | * properties. | ||
| 93 | */ | ||
| 94 | mode_t (*is_visible) (void *data, int type); | ||
| 95 | }; | ||
| 96 | |||
| 97 | struct iscsi_boot_kset { | ||
| 98 | struct list_head kobj_list; | ||
| 99 | struct kset *kset; | ||
| 100 | }; | ||
| 101 | |||
| 102 | struct iscsi_boot_kobj * | ||
| 103 | iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index, | ||
| 104 | void *data, | ||
| 105 | ssize_t (*show) (void *data, int type, char *buf), | ||
| 106 | mode_t (*is_visible) (void *data, int type)); | ||
| 107 | |||
| 108 | struct iscsi_boot_kobj * | ||
| 109 | iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index, | ||
| 110 | void *data, | ||
| 111 | ssize_t (*show) (void *data, int type, char *buf), | ||
| 112 | mode_t (*is_visible) (void *data, int type)); | ||
| 113 | struct iscsi_boot_kobj * | ||
| 114 | iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index, | ||
| 115 | void *data, | ||
| 116 | ssize_t (*show) (void *data, int type, char *buf), | ||
| 117 | mode_t (*is_visible) (void *data, int type)); | ||
| 118 | |||
| 119 | struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name); | ||
| 120 | struct iscsi_boot_kset *iscsi_boot_create_host_kset(unsigned int hostno); | ||
| 121 | void iscsi_boot_destroy_kset(struct iscsi_boot_kset *boot_kset); | ||
| 122 | |||
| 123 | #endif | ||
diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h index d2e4042f8f5e..8ba7e5b9d62c 100644 --- a/include/linux/iscsi_ibft.h +++ b/include/linux/iscsi_ibft.h | |||
| @@ -21,21 +21,13 @@ | |||
| 21 | #ifndef ISCSI_IBFT_H | 21 | #ifndef ISCSI_IBFT_H |
| 22 | #define ISCSI_IBFT_H | 22 | #define ISCSI_IBFT_H |
| 23 | 23 | ||
| 24 | struct ibft_table_header { | 24 | #include <acpi/acpi.h> |
| 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 | 25 | ||
| 34 | /* | 26 | /* |
| 35 | * Logical location of iSCSI Boot Format Table. | 27 | * Logical location of iSCSI Boot Format Table. |
| 36 | * If the value is NULL there is no iBFT on the machine. | 28 | * If the value is NULL there is no iBFT on the machine. |
| 37 | */ | 29 | */ |
| 38 | extern struct ibft_table_header *ibft_addr; | 30 | extern struct acpi_table_ibft *ibft_addr; |
| 39 | 31 | ||
| 40 | /* | 32 | /* |
| 41 | * Routine used to find and reserve the iSCSI Boot Format Table. The | 33 | * Routine used to find and reserve the iSCSI Boot Format Table. The |
