blob: fae8b465233ecdfc2f6b82eb61c1b966b2d390a1 [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
5#include <linux/device.h>
6
7struct module;
Christoph Hellwiga1b73fc2014-05-01 16:51:04 +02008struct request;
Linus Torvalds1da177e2005-04-16 15:20:36 -07009struct scsi_cmnd;
James Bottomley7f9a6bc2007-08-04 10:06:25 -050010struct scsi_device;
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
12struct scsi_driver {
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 struct device_driver gendrv;
14
Linus Torvalds1da177e2005-04-16 15:20:36 -070015 void (*rescan)(struct device *);
Christoph Hellwiga1b73fc2014-05-01 16:51:04 +020016 int (*init_command)(struct scsi_cmnd *);
17 void (*uninit_command)(struct scsi_cmnd *);
Linus Torvalds7b3d9542008-01-06 10:17:12 -080018 int (*done)(struct scsi_cmnd *);
James Bottomley24510792013-11-11 13:44:53 +010019 int (*eh_action)(struct scsi_cmnd *, int);
Hannes Reinecke7a38dc02017-04-06 15:36:29 +020020 void (*eh_reset)(struct scsi_cmnd *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070021};
22#define to_scsi_driver(drv) \
23 container_of((drv), struct scsi_driver, gendrv)
24
25extern int scsi_register_driver(struct device_driver *);
26#define scsi_unregister_driver(drv) \
27 driver_unregister(drv);
28
29extern int scsi_register_interface(struct class_interface *);
30#define scsi_unregister_interface(intf) \
31 class_interface_unregister(intf)
32
Linus Torvalds1da177e2005-04-16 15:20:36 -070033#endif /* _SCSI_SCSI_DRIVER_H */