4 #define SYSFS_PATH_SIZE 255
5 #define INQUIRY_CMDLEN 6
6 #define INQUIRY_CMD 0x12
7 #define SENSE_BUFF_LEN 32
8 #define RECOVERED_ERROR 0x01
9 #define MX_ALLOC_LEN 255
13 #define BLKGETSIZE _IO(0x12,96)
17 #define DEF_TIMEOUT 30
21 * excerpt from sg_err.h
23 #define SCSI_CHECK_CONDITION 0x2
24 #define SCSI_COMMAND_TERMINATED 0x22
25 #define SG_ERR_DRIVER_SENSE 0x08
28 #define PATHINFO_FAILED 1
29 #define PATHINFO_SKIPPED 2
33 int path_discovery (vector pathvec, int flag);
34 int path_get_tpgs(struct path *pp); /* This function never returns TPGS_UNDEF */
36 int path_offline (struct path *);
37 int get_state (struct path * pp, struct config * conf, int daemon, int state);
38 int get_vpd_sgio (int fd, int pg, int vend_id, char * str, int maxlen);
39 int pathinfo (struct path * pp, struct config * conf, int mask);
40 int alloc_path_with_pathinfo (struct config *conf, struct udev_device *udevice,
41 const char *wwid, int flag, struct path **pp_ptr);
42 int store_pathinfo (vector pathvec, struct config *conf,
43 struct udev_device *udevice, int flag,
44 struct path **pp_ptr);
45 int sysfs_set_scsi_tmo (struct multipath *mpp, unsigned int checkint);
46 int sysfs_get_timeout(const struct path *pp, unsigned int *timeout);
47 int sysfs_get_host_pci_name(const struct path *pp, char *pci_name);
48 int sysfs_get_iscsi_ip_address(const struct path *pp, char *ip_address);
49 int sysfs_get_host_adapter_name(const struct path *pp,
51 ssize_t sysfs_get_vpd (struct udev_device *udev, unsigned char pg,
52 unsigned char *buff, size_t len);
53 ssize_t sysfs_get_inquiry(struct udev_device *udev,
54 unsigned char *buff, size_t len);
55 int sysfs_get_asymmetric_access_state(struct path *pp,
56 char *buff, int buflen);
57 bool has_uid_fallback(struct path *pp);
58 int get_uid(struct path * pp, int path_state, struct udev_device *udev,
60 bool is_vpd_page_supported(int fd, int pg);
76 #define DI_SYSFS (1 << __DI_SYSFS)
77 #define DI_SERIAL (1 << __DI_SERIAL)
78 #define DI_CHECKER (1 << __DI_CHECKER)
79 #define DI_PRIO (1 << __DI_PRIO)
80 #define DI_WWID (1 << __DI_WWID)
81 #define DI_BLACKLIST (1 << __DI_BLACKLIST)
82 #define DI_NOIO (1 << __DI_NOIO) /* Avoid IO on the device */
83 #define DI_NOFALLBACK (1 << __DI_NOFALLBACK) /* do not allow wwid fallback */
85 #define DI_ALL (DI_SYSFS | DI_SERIAL | DI_CHECKER | DI_PRIO | \
88 #endif /* DISCOVERY_H */