1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26#include <scsi/scsi_device.h>
27
28enum {
29 SCSI_DH_OK = 0,
30
31
32
33 SCSI_DH_DEV_FAILED,
34 SCSI_DH_DEV_TEMP_BUSY,
35 SCSI_DH_DEV_UNSUPP,
36 SCSI_DH_DEVICE_MAX,
37
38
39
40
41 SCSI_DH_NOTCONN = SCSI_DH_DEVICE_MAX + 1,
42 SCSI_DH_CONN_FAILURE,
43 SCSI_DH_TRANSPORT_MAX,
44
45
46
47
48 SCSI_DH_IO = SCSI_DH_TRANSPORT_MAX + 1,
49 SCSI_DH_INVALID_IO,
50 SCSI_DH_RETRY,
51 SCSI_DH_IMM_RETRY,
52 SCSI_DH_TIMED_OUT,
53 SCSI_DH_RES_TEMP_UNAVAIL,
54 SCSI_DH_DEV_OFFLINED,
55 SCSI_DH_NOSYS,
56 SCSI_DH_DRIVER_MAX,
57};
58#if defined(CONFIG_SCSI_DH) || defined(CONFIG_SCSI_DH_MODULE)
59extern int scsi_dh_activate(struct request_queue *, activate_complete, void *);
60extern int scsi_dh_handler_exist(const char *);
61extern int scsi_dh_attach(struct request_queue *, const char *);
62extern void scsi_dh_detach(struct request_queue *);
63extern const char *scsi_dh_attached_handler_name(struct request_queue *, gfp_t);
64extern int scsi_dh_set_params(struct request_queue *, const char *);
65#else
66static inline int scsi_dh_activate(struct request_queue *req,
67 activate_complete fn, void *data)
68{
69 fn(data, 0);
70 return 0;
71}
72static inline int scsi_dh_handler_exist(const char *name)
73{
74 return 0;
75}
76static inline int scsi_dh_attach(struct request_queue *req, const char *name)
77{
78 return SCSI_DH_NOSYS;
79}
80static inline void scsi_dh_detach(struct request_queue *q)
81{
82 return;
83}
84static inline const char *scsi_dh_attached_handler_name(struct request_queue *q,
85 gfp_t gfp)
86{
87 return NULL;
88}
89static inline int scsi_dh_set_params(struct request_queue *req, const char *params)
90{
91 return -SCSI_DH_NOSYS;
92}
93#endif
94