/*1* Header file for SCSI device handler infrastruture.2*3* Modified version of patches posted by Mike Christie <[email protected]>4*5* This program is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License as published by the7* Free Software Foundation; either version 2 of the License, or (at your8* option) any later version.9*10* This program is distributed in the hope that it will be useful, but11* WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13* General Public License for more details.14*15* You should have received a copy of the GNU General Public License along16* with this program; if not, write to the Free Software Foundation, Inc.,17* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.18*19* Copyright IBM Corporation, 200720* Authors:21* Chandra Seetharaman <[email protected]>22* Mike Anderson <[email protected]>23*/2425#include <scsi/scsi_device.h>2627enum {28SCSI_DH_OK = 0,29/*30* device errors31*/32SCSI_DH_DEV_FAILED, /* generic device error */33SCSI_DH_DEV_TEMP_BUSY,34SCSI_DH_DEV_UNSUPP, /* device handler not supported */35SCSI_DH_DEVICE_MAX, /* max device blkerr definition */3637/*38* transport errors39*/40SCSI_DH_NOTCONN = SCSI_DH_DEVICE_MAX + 1,41SCSI_DH_CONN_FAILURE,42SCSI_DH_TRANSPORT_MAX, /* max transport blkerr definition */4344/*45* driver and generic errors46*/47SCSI_DH_IO = SCSI_DH_TRANSPORT_MAX + 1, /* generic error */48SCSI_DH_INVALID_IO,49SCSI_DH_RETRY, /* retry the req, but not immediately */50SCSI_DH_IMM_RETRY, /* immediately retry the req */51SCSI_DH_TIMED_OUT,52SCSI_DH_RES_TEMP_UNAVAIL,53SCSI_DH_DEV_OFFLINED,54SCSI_DH_NOSYS,55SCSI_DH_DRIVER_MAX,56};57#if defined(CONFIG_SCSI_DH) || defined(CONFIG_SCSI_DH_MODULE)58extern int scsi_dh_activate(struct request_queue *, activate_complete, void *);59extern int scsi_dh_handler_exist(const char *);60extern int scsi_dh_attach(struct request_queue *, const char *);61extern void scsi_dh_detach(struct request_queue *);62extern int scsi_dh_set_params(struct request_queue *, const char *);63#else64static inline int scsi_dh_activate(struct request_queue *req,65activate_complete fn, void *data)66{67fn(data, 0);68return 0;69}70static inline int scsi_dh_handler_exist(const char *name)71{72return 0;73}74static inline int scsi_dh_attach(struct request_queue *req, const char *name)75{76return SCSI_DH_NOSYS;77}78static inline void scsi_dh_detach(struct request_queue *q)79{80return;81}82static inline int scsi_dh_set_params(struct request_queue *req, const char *params)83{84return -SCSI_DH_NOSYS;85}86#endif878889