scsi-uclass.c 737 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (c) 2015 Google, Inc
  4. * Written by Simon Glass <sjg@chromium.org>
  5. * Copyright (c) 2016 Xilinx, Inc
  6. * Written by Michal Simek
  7. *
  8. * Based on ahci-uclass.c
  9. */
  10. #include <common.h>
  11. #include <dm.h>
  12. #include <scsi.h>
  13. int scsi_exec(struct udevice *dev, struct scsi_cmd *pccb)
  14. {
  15. struct scsi_ops *ops = scsi_get_ops(dev);
  16. if (!ops->exec)
  17. return -ENOSYS;
  18. return ops->exec(dev, pccb);
  19. }
  20. int scsi_bus_reset(struct udevice *dev)
  21. {
  22. struct scsi_ops *ops = scsi_get_ops(dev);
  23. if (!ops->bus_reset)
  24. return -ENOSYS;
  25. return ops->bus_reset(dev);
  26. }
  27. UCLASS_DRIVER(scsi) = {
  28. .id = UCLASS_SCSI,
  29. .name = "scsi",
  30. .per_device_platdata_auto_alloc_size = sizeof(struct scsi_platdata),
  31. };