10 #define NODE_NAME_SIZE 224
11 #define PATH_STR_SIZE 16
12 #define PARAMS_SIZE 4096
13 #define FILE_NAME_SIZE 256
14 #define CALLOUT_MAX_SIZE 256
15 #define BLK_DEV_SIZE 33
20 #define SCSI_VENDOR_SIZE 9
21 #define SCSI_PRODUCT_SIZE 17
22 #define SCSI_REV_SIZE 5
23 #define SCSI_STATE_SIZE 19
25 #define NO_PATH_RETRY_UNDEF 0
26 #define NO_PATH_RETRY_FAIL -1
27 #define NO_PATH_RETRY_QUEUE -2
69 enum queue_without_daemon_states {
93 enum log_checker_err_states {
98 enum user_friendly_names_states {
99 USER_FRIENDLY_NAMES_UNDEF,
100 USER_FRIENDLY_NAMES_OFF,
101 USER_FRIENDLY_NAMES_ON,
104 enum retain_hwhandler_states {
105 RETAIN_HWHANDLER_UNDEF,
106 RETAIN_HWHANDLER_OFF,
110 enum detect_prio_states {
117 SCSI_PROTOCOL_FCP = 0, /* Fibre Channel */
118 SCSI_PROTOCOL_SPI = 1, /* parallel SCSI */
119 SCSI_PROTOCOL_SSA = 2, /* Serial Storage Architecture - Obsolete */
120 SCSI_PROTOCOL_SBP = 3, /* firewire */
121 SCSI_PROTOCOL_SRP = 4, /* Infiniband RDMA */
122 SCSI_PROTOCOL_ISCSI = 5,
123 SCSI_PROTOCOL_SAS = 6,
124 SCSI_PROTOCOL_ADT = 7, /* Media Changers */
125 SCSI_PROTOCOL_ATA = 8,
126 SCSI_PROTOCOL_UNSPEC = 0xf, /* No specific protocol */
136 enum scsi_protocol proto_id;
141 # define HDIO_GETGEO 0x0301 /* get device geometry */
145 unsigned char sectors;
146 unsigned short cylinders;
152 char dev[FILE_NAME_SIZE];
153 char dev_t[BLK_DEV_SIZE];
154 struct udev_device *udev;
156 struct hd_geometry geom;
157 char wwid[WWID_SIZE];
158 char vendor_id[SCSI_VENDOR_SIZE];
159 char product_id[SCSI_PRODUCT_SIZE];
160 char rev[SCSI_REV_SIZE];
161 char serial[SERIAL_SIZE];
162 char tgt_node_name[NODE_NAME_SIZE];
163 unsigned long long size;
164 unsigned int checkint;
175 char * uid_attribute;
178 struct checker checker;
179 struct multipath * mpp;
182 /* configlet pointers */
183 struct hwentry * hwe;
186 typedef int (pgpolicyfn) (struct multipath *);
189 char wwid[WWID_SIZE];
190 char alias_old[WWID_SIZE];
192 pgpolicyfn *pgpolicyfn;
200 int nr_active; /* current available(= not known as failed) paths */
201 int no_path_retry; /* number of retries after all paths are down */
202 int retry_tick; /* remaining times for retries */
205 int flush_on_last_del;
208 int retain_hwhandler;
209 unsigned int dev_loss;
213 unsigned long long size;
216 struct dm_info * dmi;
218 /* configlet pointers */
224 struct mpentry * mpe;
225 struct hwentry * hwe;
231 unsigned int stat_switchgroup;
232 unsigned int stat_path_failures;
233 unsigned int stat_map_loads;
234 unsigned int stat_total_queueing_time;
235 unsigned int stat_queueing_timeouts;
237 /* checkers shared data */
240 /* persistent management data*/
241 unsigned char * reservation_key;
242 unsigned char prflag;
254 struct path * alloc_path (void);
255 struct pathgroup * alloc_pathgroup (void);
256 struct multipath * alloc_multipath (void);
257 void free_path (struct path *);
258 void free_pathvec (vector vec, enum free_path_mode free_paths);
259 void free_pathgroup (struct pathgroup * pgp, enum free_path_mode free_paths);
260 void free_pgvec (vector pgvec, enum free_path_mode free_paths);
261 void free_multipath (struct multipath *, enum free_path_mode free_paths);
262 void free_multipath_attributes (struct multipath *);
263 void drop_multipath (vector mpvec, char * wwid, enum free_path_mode free_paths);
264 void free_multipathvec (vector mpvec, enum free_path_mode free_paths);
266 int store_path (vector pathvec, struct path * pp);
267 int store_pathgroup (vector pgvec, struct pathgroup * pgp);
269 struct multipath * find_mp_by_alias (vector mp, char * alias);
270 struct multipath * find_mp_by_wwid (vector mp, char * wwid);
271 struct multipath * find_mp_by_str (vector mp, char * wwid);
272 struct multipath * find_mp_by_minor (vector mp, int minor);
274 struct path * find_path_by_devt (vector pathvec, char * devt);
275 struct path * find_path_by_dev (vector pathvec, char * dev);
276 struct path * first_path (struct multipath * mpp);
278 int pathcountgr (struct pathgroup *, int);
279 int pathcount (struct multipath *, int);
280 int pathcmp (struct pathgroup *, struct pathgroup *);
281 void setup_feature(struct multipath *, char *);
282 int add_feature (char **, char *);
283 int remove_feature (char **, char *);
285 extern char sysfs_path[PATH_SIZE];
287 #endif /* _STRUCTS_H */