blob: 36c4114ed9bc2ce47dfab7b5beb79e2a64a68aa5 [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 {
12 struct module *owner;
13 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);
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
James Bottomley7f9a6bc2007-08-04 10:06:25 -050032int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req);
33int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req);
James Bottomley7f9a6bc2007-08-04 10:06:25 -050034
Linus Torvalds1da177e2005-04-16 15:20:36 -070035#endif /* _SCSI_SCSI_DRIVER_H */