18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _SCSI_SCSI_DRIVER_H
38c2ecf20Sopenharmony_ci#define _SCSI_SCSI_DRIVER_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <linux/blk_types.h>
68c2ecf20Sopenharmony_ci#include <linux/device.h>
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_cistruct module;
98c2ecf20Sopenharmony_cistruct request;
108c2ecf20Sopenharmony_cistruct scsi_cmnd;
118c2ecf20Sopenharmony_cistruct scsi_device;
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_cistruct scsi_driver {
148c2ecf20Sopenharmony_ci	struct device_driver	gendrv;
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci	void (*rescan)(struct device *);
178c2ecf20Sopenharmony_ci	blk_status_t (*init_command)(struct scsi_cmnd *);
188c2ecf20Sopenharmony_ci	void (*uninit_command)(struct scsi_cmnd *);
198c2ecf20Sopenharmony_ci	int (*done)(struct scsi_cmnd *);
208c2ecf20Sopenharmony_ci	int (*eh_action)(struct scsi_cmnd *, int);
218c2ecf20Sopenharmony_ci	void (*eh_reset)(struct scsi_cmnd *);
228c2ecf20Sopenharmony_ci};
238c2ecf20Sopenharmony_ci#define to_scsi_driver(drv) \
248c2ecf20Sopenharmony_ci	container_of((drv), struct scsi_driver, gendrv)
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciextern int scsi_register_driver(struct device_driver *);
278c2ecf20Sopenharmony_ci#define scsi_unregister_driver(drv) \
288c2ecf20Sopenharmony_ci	driver_unregister(drv);
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ciextern int scsi_register_interface(struct class_interface *);
318c2ecf20Sopenharmony_ci#define scsi_unregister_interface(intf) \
328c2ecf20Sopenharmony_ci	class_interface_unregister(intf)
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#endif /* _SCSI_SCSI_DRIVER_H */
35