blob: 6dffa8555a39016fb09f1ea9eb1adfb10f14c3b9 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _SCSI_SCSI_DRIVER_H
3#define _SCSI_SCSI_DRIVER_H
4
Christoph Hellwig159b2cb2018-11-09 14:42:39 +01005#include <linux/blk_types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#include <linux/device.h>
7
8struct module;
Christoph Hellwiga1b73fc2014-05-01 16:51:04 +02009struct request;
Linus Torvalds1da177e2005-04-16 15:20:36 -070010struct scsi_cmnd;
James Bottomley7f9a6bc2007-08-04 10:06:25 -050011struct scsi_device;
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
13struct scsi_driver {
Linus Torvalds1da177e2005-04-16 15:20:36 -070014 struct device_driver gendrv;
15
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 void (*rescan)(struct device *);
Christoph Hellwig159b2cb2018-11-09 14:42:39 +010017 blk_status_t (*init_command)(struct scsi_cmnd *);
Christoph Hellwiga1b73fc2014-05-01 16:51:04 +020018 void (*uninit_command)(struct scsi_cmnd *);
Linus Torvalds7b3d9542008-01-06 10:17:12 -080019 int (*done)(struct scsi_cmnd *);
James Bottomley24510792013-11-11 13:44:53 +010020 int (*eh_action)(struct scsi_cmnd *, int);
Hannes Reinecke7a38dc02017-04-06 15:36:29 +020021 void (*eh_reset)(struct scsi_cmnd *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070022};
23#define to_scsi_driver(drv) \
24 container_of((drv), struct scsi_driver, gendrv)
25
26extern int scsi_register_driver(struct device_driver *);
27#define scsi_unregister_driver(drv) \
28 driver_unregister(drv);
29
30extern int scsi_register_interface(struct class_interface *);
31#define scsi_unregister_interface(intf) \
32 class_interface_unregister(intf)
33
Linus Torvalds1da177e2005-04-16 15:20:36 -070034#endif /* _SCSI_SCSI_DRIVER_H */