]>
git.ipfire.org Git - thirdparty/systemd.git/blob - extras/multipath/main.h
2 * Soft: Description here...
4 * Version: $Id: main.h,v 0.0.1 2003/09/18 15:13:38 cvaroqui Exp $
6 * Author: Copyright (C) 2003 Christophe Varoqui
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 * See the GNU General Public License for more details.
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version
16 * 2 of the License, or (at your option) any later version.
23 #include "sg_include.h"
25 /* exerpt from "sg_err.h" */
26 #define SCSI_CHECK_CONDITION 0x2
27 #define SCSI_COMMAND_TERMINATED 0x22
28 #define SG_ERR_DRIVER_SENSE 0x08
30 /* exerpt from "scsi.h" */
31 #define SCSI_IOCTL_GET_IDLUN 0x5382
32 #define SCSI_IOCTL_GET_BUS_NUMBER 0x5386
36 #define SERIAL_SIZE 14
38 #define MAX_MP MAX_DEVS / 2
39 #define MAX_MP_PATHS MAX_DEVS / 4
40 #define FILE_NAME_SIZE 256
41 #define DEF_TIMEOUT 60000
44 #define DM_TARGET "multipath"
46 /* Storage controlers cpabilities */
49 #define GROUP_BY_SERIAL 2
51 #define PINDEX(x,y) mp[(x)].pindex[(y)]
73 char dev
[FILE_NAME_SIZE
];
74 struct scsi_idlun scsi_id
;
79 char dev
[FILE_NAME_SIZE
];
80 char sg_dev
[FILE_NAME_SIZE
];
81 struct scsi_idlun scsi_id
;
87 char serial
[SERIAL_SIZE
];
95 int pindex
[MAX_MP_PATHS
];
105 char sysfs_path
[FILE_NAME_SIZE
];
106 char hotplugdev
[FILE_NAME_SIZE
];
110 #define PROG "multipath"
112 #define VERSION_CODE 0x000012
113 #define DATE_CODE 0x021504
115 #define MULTIPATH_VERSION(version) \
116 (version >> 16) & 0xFF, \
117 (version >> 8) & 0xFF, \
120 #define VERSION_STRING PROG" v%d.%d.%d (%.2d/%.2d, 20%.2d)\n", \
121 MULTIPATH_VERSION(VERSION_CODE), \
122 MULTIPATH_VERSION(DATE_CODE)