scsi-uclass.c 740 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2015 Google, Inc
  3. * Written by Simon Glass <sjg@chromium.org>
  4. * Copyright (c) 2016 Xilinx, Inc
  5. * Written by Michal Simek
  6. *
  7. * Based on ahci-uclass.c
  8. *
  9. * SPDX-License-Identifier: GPL-2.0+
  10. */
  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_platdata_auto_alloc_size = sizeof(struct scsi_platdata),
  32. };