]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/scsi.h
dm: power: Convert as3722 to driver model
[people/ms/u-boot.git] / include / scsi.h
index af07dbe6dbc4e3c17b4309db31b8e558032f8fee..7173912de4a85e85301b5cf1858ed6d20609e0b7 100644 (file)
@@ -191,18 +191,46 @@ struct scsi_ops {
        int (*bus_reset)(struct udevice *dev);
 };
 
-#ifndef CONFIG_DM_SCSI
-void scsi_low_level_init(int busdevfunc);
-void scsi_init(void);
-#endif
+#define scsi_get_ops(dev)        ((struct scsi_ops *)(dev)->driver->ops)
+
+extern struct scsi_ops scsi_ops;
+
+/**
+ * scsi_exec() - execute a command
+ *
+ * @dev:       SCSI bus
+ * @cmd:       Command to execute
+ * @return 0 if OK, -ve on error
+ */
+int scsi_exec(struct udevice *dev, struct scsi_cmd *cmd);
 
-int scsi_exec(struct udevice *dev, struct scsi_cmd *pccb);
+/**
+ * scsi_bus_reset() - reset the bus
+ *
+ * @dev:       SCSI bus to reset
+ * @return 0 if OK, -ve on error
+ */
 int scsi_bus_reset(struct udevice *dev);
 
-/***************************************************************************
- * functions residing inside cmd_scsi.c
+/**
+ * scsi_scan() - Scan all SCSI controllers for available devices
+ *
+ * @vebose: true to show information about each device found
+ */
+int scsi_scan(bool verbose);
+
+/**
+ * scsi_scan_dev() - scan a SCSI bus and create devices
+ *
+ * @dev:       SCSI bus
+ * @verbose:   true to show information about each device found
  */
-int scsi_scan(int mode);
+int scsi_scan_dev(struct udevice *dev, bool verbose);
+
+#ifndef CONFIG_DM_SCSI
+void scsi_low_level_init(int busdevfunc);
+void scsi_init(void);
+#endif
 
 #define SCSI_IDENTIFY                                  0xC0  /* not used */