blob: 891a658aa8673d03b5ad8ac848f3318662d39707 [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);
Linus Torvalds1da177e2005-04-16 15:20:36 -070019};
20#define to_scsi_driver(drv) \
21 container_of((drv), struct scsi_driver, gendrv)
22
23extern int scsi_register_driver(struct device_driver *);
24#define scsi_unregister_driver(drv) \
25 driver_unregister(drv);
26
27extern int scsi_register_interface(struct class_interface *);
28#define scsi_unregister_interface(intf) \
29 class_interface_unregister(intf)
30
Linus Torvalds1da177e2005-04-16 15:20:36 -070031#endif /* _SCSI_SCSI_DRIVER_H */