blob: a5534ccad859d29069bff2b240ccfca4dd0c9567 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _SCSI_SCSI_DRIVER_H
2#define _SCSI_SCSI_DRIVER_H
3
4#include <linux/device.h>
5
6struct module;
Christoph Hellwiga1b73fc2014-05-01 16:51:04 +02007struct request;
Linus Torvalds1da177e2005-04-16 15:20:36 -07008struct scsi_cmnd;
James Bottomley7f9a6bc2007-08-04 10:06:25 -05009struct scsi_device;
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
11struct scsi_driver {
Linus Torvalds1da177e2005-04-16 15:20:36 -070012 struct device_driver gendrv;
13
Linus Torvalds1da177e2005-04-16 15:20:36 -070014 void (*rescan)(struct device *);
Christoph Hellwiga1b73fc2014-05-01 16:51:04 +020015 int (*init_command)(struct scsi_cmnd *);
16 void (*uninit_command)(struct scsi_cmnd *);
Linus Torvalds7b3d9542008-01-06 10:17:12 -080017 int (*done)(struct scsi_cmnd *);
James Bottomley24510792013-11-11 13:44:53 +010018 int (*eh_action)(struct scsi_cmnd *, int);
Hannes Reinecke7a38dc02017-04-06 15:36:29 +020019 void (*eh_reset)(struct scsi_cmnd *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070020};
21#define to_scsi_driver(drv) \
22 container_of((drv), struct scsi_driver, gendrv)
23
24extern int scsi_register_driver(struct device_driver *);
25#define scsi_unregister_driver(drv) \
26 driver_unregister(drv);
27
28extern int scsi_register_interface(struct class_interface *);
29#define scsi_unregister_interface(intf) \
30 class_interface_unregister(intf)
31
Linus Torvalds1da177e2005-04-16 15:20:36 -070032#endif /* _SCSI_SCSI_DRIVER_H */