~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/scsi/scsi_dh.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * Header file for SCSI device handler infrastructure.
  4  *
  5  * Modified version of patches posted by Mike Christie <michaelc@cs.wisc.edu>
  6  *
  7  * Copyright IBM Corporation, 2007
  8  *      Authors:
  9  *               Chandra Seetharaman <sekharan@us.ibm.com>
 10  *               Mike Anderson <andmike@linux.vnet.ibm.com>
 11  */
 12 
 13 #include <scsi/scsi_device.h>
 14 
 15 enum {
 16         SCSI_DH_OK = 0,
 17         /*
 18          * device errors
 19          */
 20         SCSI_DH_DEV_FAILED,     /* generic device error */
 21         SCSI_DH_DEV_TEMP_BUSY,
 22         SCSI_DH_DEV_UNSUPP,     /* device handler not supported */
 23         SCSI_DH_DEVICE_MAX,     /* max device blkerr definition */
 24 
 25         /*
 26          * transport errors
 27          */
 28         SCSI_DH_NOTCONN = SCSI_DH_DEVICE_MAX + 1,
 29         SCSI_DH_CONN_FAILURE,
 30         SCSI_DH_TRANSPORT_MAX,  /* max transport blkerr definition */
 31 
 32         /*
 33          * driver and generic errors
 34          */
 35         SCSI_DH_IO = SCSI_DH_TRANSPORT_MAX + 1, /* generic error */
 36         SCSI_DH_INVALID_IO,
 37         SCSI_DH_RETRY,          /* retry the req, but not immediately */
 38         SCSI_DH_IMM_RETRY,      /* immediately retry the req */
 39         SCSI_DH_TIMED_OUT,
 40         SCSI_DH_RES_TEMP_UNAVAIL,
 41         SCSI_DH_DEV_OFFLINED,
 42         SCSI_DH_NOMEM,
 43         SCSI_DH_NOSYS,
 44         SCSI_DH_DRIVER_MAX,
 45 };
 46 
 47 typedef void (*activate_complete)(void *, int);
 48 struct scsi_device_handler {
 49         /* Used by the infrastructure */
 50         struct list_head list; /* list of scsi_device_handlers */
 51 
 52         /* Filled by the hardware handler */
 53         struct module *module;
 54         const char *name;
 55         enum scsi_disposition (*check_sense)(struct scsi_device *,
 56                                              struct scsi_sense_hdr *);
 57         int (*attach)(struct scsi_device *);
 58         void (*detach)(struct scsi_device *);
 59         int (*activate)(struct scsi_device *, activate_complete, void *);
 60         blk_status_t (*prep_fn)(struct scsi_device *, struct request *);
 61         int (*set_params)(struct scsi_device *, const char *);
 62         void (*rescan)(struct scsi_device *);
 63 };
 64 
 65 #ifdef CONFIG_SCSI_DH
 66 extern int scsi_dh_activate(struct request_queue *, activate_complete, void *);
 67 extern int scsi_dh_attach(struct request_queue *, const char *);
 68 extern const char *scsi_dh_attached_handler_name(struct request_queue *, gfp_t);
 69 extern int scsi_dh_set_params(struct request_queue *, const char *);
 70 #else
 71 static inline int scsi_dh_activate(struct request_queue *req,
 72                                         activate_complete fn, void *data)
 73 {
 74         fn(data, 0);
 75         return 0;
 76 }
 77 static inline int scsi_dh_attach(struct request_queue *req, const char *name)
 78 {
 79         return SCSI_DH_NOSYS;
 80 }
 81 static inline const char *scsi_dh_attached_handler_name(struct request_queue *q,
 82                                                         gfp_t gfp)
 83 {
 84         return NULL;
 85 }
 86 static inline int scsi_dh_set_params(struct request_queue *req, const char *params)
 87 {
 88         return -SCSI_DH_NOSYS;
 89 }
 90 #endif
 91 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php