scsi-uclass.c 752 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #define LOG_CATEGORY UCLASS_SCSI
  11. #include <common.h>
  12. #include <dm.h>
  13. #include <scsi.h>
  14. int scsi_exec(struct udevice *dev, struct scsi_cmd *pccb)
  15. {
  16. struct scsi_ops *ops = scsi_get_ops(dev);
  17. if (!ops->exec)
  18. return -ENOSYS;
  19. return ops->exec(dev, pccb);
  20. }
  21. int scsi_bus_reset(struct udevice *dev)
  22. {
  23. struct scsi_ops *ops = scsi_get_ops(dev);
  24. if (!ops->bus_reset)
  25. return -ENOSYS;
  26. return ops->bus_reset(dev);
  27. }
  28. UCLASS_DRIVER(scsi) = {
  29. .id = UCLASS_SCSI,
  30. .name = "scsi",
  31. .per_device_plat_auto = sizeof(struct scsi_plat),
  32. };