Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | #ifndef _SCSI_SCSI_DRIVER_H |
| 3 | #define _SCSI_SCSI_DRIVER_H |
| 4 | |
| 5 | #include <linux/device.h> |
| 6 | |
| 7 | struct module; |
Christoph Hellwig | a1b73fc | 2014-05-01 16:51:04 +0200 | [diff] [blame] | 8 | struct request; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | struct scsi_cmnd; |
James Bottomley | 7f9a6bc | 2007-08-04 10:06:25 -0500 | [diff] [blame] | 10 | struct scsi_device; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | |
| 12 | struct scsi_driver { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | struct device_driver gendrv; |
| 14 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | void (*rescan)(struct device *); |
Christoph Hellwig | a1b73fc | 2014-05-01 16:51:04 +0200 | [diff] [blame] | 16 | int (*init_command)(struct scsi_cmnd *); |
| 17 | void (*uninit_command)(struct scsi_cmnd *); |
Linus Torvalds | 7b3d954 | 2008-01-06 10:17:12 -0800 | [diff] [blame] | 18 | int (*done)(struct scsi_cmnd *); |
James Bottomley | 2451079 | 2013-11-11 13:44:53 +0100 | [diff] [blame] | 19 | int (*eh_action)(struct scsi_cmnd *, int); |
Hannes Reinecke | 7a38dc0 | 2017-04-06 15:36:29 +0200 | [diff] [blame] | 20 | void (*eh_reset)(struct scsi_cmnd *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | }; |
| 22 | #define to_scsi_driver(drv) \ |
| 23 | container_of((drv), struct scsi_driver, gendrv) |
| 24 | |
| 25 | extern int scsi_register_driver(struct device_driver *); |
| 26 | #define scsi_unregister_driver(drv) \ |
| 27 | driver_unregister(drv); |
| 28 | |
| 29 | extern int scsi_register_interface(struct class_interface *); |
| 30 | #define scsi_unregister_interface(intf) \ |
| 31 | class_interface_unregister(intf) |
| 32 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | #endif /* _SCSI_SCSI_DRIVER_H */ |