1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Export the iSCSI boot info to userland via sysfs.
5 * Copyright (C) 2010 Red Hat, Inc. All rights reserved.
6 * Copyright (C) 2010 Mike Christie
8 #ifndef _ISCSI_BOOT_SYSFS_
9 #define _ISCSI_BOOT_SYSFS_
12 * The text attributes names for each of the kobjects.
14 enum iscsi_boot_eth_properties_enum {
17 ISCSI_BOOT_ETH_IP_ADDR,
18 ISCSI_BOOT_ETH_PREFIX_LEN,
19 ISCSI_BOOT_ETH_SUBNET_MASK,
20 ISCSI_BOOT_ETH_ORIGIN,
21 ISCSI_BOOT_ETH_GATEWAY,
22 ISCSI_BOOT_ETH_PRIMARY_DNS,
23 ISCSI_BOOT_ETH_SECONDARY_DNS,
27 /* eth_pci_bdf - this is replaced by link to the device itself. */
28 ISCSI_BOOT_ETH_HOSTNAME,
29 ISCSI_BOOT_ETH_END_MARKER,
32 enum iscsi_boot_tgt_properties_enum {
35 ISCSI_BOOT_TGT_IP_ADDR,
38 ISCSI_BOOT_TGT_CHAP_TYPE,
39 ISCSI_BOOT_TGT_NIC_ASSOC,
41 ISCSI_BOOT_TGT_CHAP_NAME,
42 ISCSI_BOOT_TGT_CHAP_SECRET,
43 ISCSI_BOOT_TGT_REV_CHAP_NAME,
44 ISCSI_BOOT_TGT_REV_CHAP_SECRET,
45 ISCSI_BOOT_TGT_END_MARKER,
48 enum iscsi_boot_initiator_properties_enum {
51 ISCSI_BOOT_INI_ISNS_SERVER,
52 ISCSI_BOOT_INI_SLP_SERVER,
53 ISCSI_BOOT_INI_PRI_RADIUS_SERVER,
54 ISCSI_BOOT_INI_SEC_RADIUS_SERVER,
55 ISCSI_BOOT_INI_INITIATOR_NAME,
56 ISCSI_BOOT_INI_END_MARKER,
59 enum iscsi_boot_acpitbl_properties_enum {
60 ISCSI_BOOT_ACPITBL_SIGNATURE,
61 ISCSI_BOOT_ACPITBL_OEM_ID,
62 ISCSI_BOOT_ACPITBL_OEM_TABLE_ID,
65 struct attribute_group;
67 struct iscsi_boot_kobj {
69 struct attribute_group *attr_group;
70 struct list_head list;
73 * Pointer to store driver specific info. If set this will
74 * be freed for the LLD when the kobj release function is called.
78 * Driver specific show function.
80 * The enum of the type. This can be any value of the above
83 ssize_t (*show) (void *data, int type, char *buf);
86 * Drivers specific visibility function.
87 * The function should return if they the attr should be readable
88 * writable or should not be shown.
90 * The enum of the type. This can be any value of the above
93 umode_t (*is_visible) (void *data, int type);
96 * Driver specific release function.
98 * The function should free the data passed in.
100 void (*release) (void *data);
103 struct iscsi_boot_kset {
104 struct list_head kobj_list;
108 struct iscsi_boot_kobj *
109 iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index,
111 ssize_t (*show) (void *data, int type, char *buf),
112 umode_t (*is_visible) (void *data, int type),
113 void (*release) (void *data));
115 struct iscsi_boot_kobj *
116 iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index,
118 ssize_t (*show) (void *data, int type, char *buf),
119 umode_t (*is_visible) (void *data, int type),
120 void (*release) (void *data));
121 struct iscsi_boot_kobj *
122 iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index,
124 ssize_t (*show) (void *data, int type, char *buf),
125 umode_t (*is_visible) (void *data, int type),
126 void (*release) (void *data));
128 struct iscsi_boot_kobj *
129 iscsi_boot_create_acpitbl(struct iscsi_boot_kset *boot_kset, int index,
131 ssize_t (*show)(void *data, int type, char *buf),
132 umode_t (*is_visible)(void *data, int type),
133 void (*release)(void *data));
135 struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name);
136 struct iscsi_boot_kset *iscsi_boot_create_host_kset(unsigned int hostno);
137 void iscsi_boot_destroy_kset(struct iscsi_boot_kset *boot_kset);