]>
Commit | Line | Data |
---|---|---|
a6a8d9f8 CS |
1 | /* |
2 | * Header file for SCSI device handler infrastruture. | |
3 | * | |
4 | * Modified version of patches posted by Mike Christie <[email protected]> | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify it | |
7 | * under the terms of the GNU General Public License as published by the | |
8 | * Free Software Foundation; either version 2 of the License, or (at your | |
9 | * option) any later version. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, but | |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | * General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License along | |
17 | * with this program; if not, write to the Free Software Foundation, Inc., | |
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
19 | * | |
20 | * Copyright IBM Corporation, 2007 | |
21 | * Authors: | |
22 | * Chandra Seetharaman <[email protected]> | |
23 | * Mike Anderson <[email protected]> | |
24 | */ | |
25 | ||
26 | #include <scsi/scsi_device.h> | |
27 | ||
28 | enum { | |
29 | SCSI_DH_OK = 0, | |
30 | /* | |
31 | * device errors | |
32 | */ | |
33 | SCSI_DH_DEV_FAILED, /* generic device error */ | |
34 | SCSI_DH_DEV_TEMP_BUSY, | |
b6ff1b14 | 35 | SCSI_DH_DEV_UNSUPP, /* device handler not supported */ |
a6a8d9f8 CS |
36 | SCSI_DH_DEVICE_MAX, /* max device blkerr definition */ |
37 | ||
38 | /* | |
39 | * transport errors | |
40 | */ | |
41 | SCSI_DH_NOTCONN = SCSI_DH_DEVICE_MAX + 1, | |
42 | SCSI_DH_CONN_FAILURE, | |
43 | SCSI_DH_TRANSPORT_MAX, /* max transport blkerr definition */ | |
44 | ||
45 | /* | |
46 | * driver and generic errors | |
47 | */ | |
48 | SCSI_DH_IO = SCSI_DH_TRANSPORT_MAX + 1, /* generic error */ | |
49 | SCSI_DH_INVALID_IO, | |
50 | SCSI_DH_RETRY, /* retry the req, but not immediately */ | |
51 | SCSI_DH_IMM_RETRY, /* immediately retry the req */ | |
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 | }; | |
fe9233fb | 58 | #if defined(CONFIG_SCSI_DH) || defined(CONFIG_SCSI_DH_MODULE) |
3ae31f6a | 59 | extern int scsi_dh_activate(struct request_queue *, activate_complete, void *); |
a6a8d9f8 | 60 | extern int scsi_dh_handler_exist(const char *); |
ae11b1b3 HR |
61 | extern int scsi_dh_attach(struct request_queue *, const char *); |
62 | extern void scsi_dh_detach(struct request_queue *); | |
18ee70c9 | 63 | extern int scsi_dh_set_params(struct request_queue *, const char *); |
fe9233fb | 64 | #else |
3ae31f6a CS |
65 | static inline int scsi_dh_activate(struct request_queue *req, |
66 | activate_complete fn, void *data) | |
fe9233fb | 67 | { |
3ae31f6a | 68 | fn(data, 0); |
fe9233fb CS |
69 | return 0; |
70 | } | |
71 | static inline int scsi_dh_handler_exist(const char *name) | |
72 | { | |
73 | return 0; | |
74 | } | |
ae11b1b3 HR |
75 | static inline int scsi_dh_attach(struct request_queue *req, const char *name) |
76 | { | |
77 | return SCSI_DH_NOSYS; | |
78 | } | |
79 | static inline void scsi_dh_detach(struct request_queue *q) | |
80 | { | |
81 | return; | |
82 | } | |
18ee70c9 CS |
83 | static inline int scsi_dh_set_params(struct request_queue *req, const char *params) |
84 | { | |
85 | return -SCSI_DH_NOSYS; | |
86 | } | |
fe9233fb | 87 | #endif |