Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iscsi_boot_sysfs.h
Go to the documentation of this file.
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 */
34  /* eth_pci_bdf - this is replaced by link to the device itself. */
37 };
38 
53 };
54 
64 };
65 
66 struct attribute_group;
67 
69  struct kobject kobj;
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  umode_t (*is_visible) (void *data, int type);
95 
96  /*
97  * Driver specific release function.
98  *
99  * The function should free the data passed in.
100  */
101  void (*release) (void *data);
102 };
103 
106  struct kset *kset;
107 };
108 
109 struct iscsi_boot_kobj *
110 iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index,
111  void *data,
112  ssize_t (*show) (void *data, int type, char *buf),
113  umode_t (*is_visible) (void *data, int type),
114  void (*release) (void *data));
115 
116 struct iscsi_boot_kobj *
117 iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index,
118  void *data,
119  ssize_t (*show) (void *data, int type, char *buf),
120  umode_t (*is_visible) (void *data, int type),
121  void (*release) (void *data));
122 struct iscsi_boot_kobj *
123 iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index,
124  void *data,
125  ssize_t (*show) (void *data, int type, char *buf),
126  umode_t (*is_visible) (void *data, int type),
127  void (*release) (void *data));
128 
129 struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name);
130 struct iscsi_boot_kset *iscsi_boot_create_host_kset(unsigned int hostno);
131 void iscsi_boot_destroy_kset(struct iscsi_boot_kset *boot_kset);
132 
133 #endif