diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/u-boot/drivers/scsi/scsi-uclass.c | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/u-boot/drivers/scsi/scsi-uclass.c')
-rw-r--r-- | roms/u-boot/drivers/scsi/scsi-uclass.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/roms/u-boot/drivers/scsi/scsi-uclass.c b/roms/u-boot/drivers/scsi/scsi-uclass.c new file mode 100644 index 000000000..90a0adda4 --- /dev/null +++ b/roms/u-boot/drivers/scsi/scsi-uclass.c @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2015 Google, Inc + * Written by Simon Glass <sjg@chromium.org> + * Copyright (c) 2016 Xilinx, Inc + * Written by Michal Simek + * + * Based on ahci-uclass.c + */ + +#include <common.h> +#include <dm.h> +#include <scsi.h> + +int scsi_exec(struct udevice *dev, struct scsi_cmd *pccb) +{ + struct scsi_ops *ops = scsi_get_ops(dev); + + if (!ops->exec) + return -ENOSYS; + + return ops->exec(dev, pccb); +} + +int scsi_bus_reset(struct udevice *dev) +{ + struct scsi_ops *ops = scsi_get_ops(dev); + + if (!ops->bus_reset) + return -ENOSYS; + + return ops->bus_reset(dev); +} + +UCLASS_DRIVER(scsi) = { + .id = UCLASS_SCSI, + .name = "scsi", + .per_device_plat_auto = sizeof(struct scsi_plat), +}; |