You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

aoedev.c 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (C) 2006 Michael Brown <mbrown@fensystems.co.uk>.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 of the
  7. * License, or any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18. #include <stddef.h>
  19. #include <gpxe/async.h>
  20. #include <gpxe/aoe.h>
  21. /** @file
  22. *
  23. * AoE ATA device
  24. *
  25. */
  26. /**
  27. * Issue ATA command via AoE device
  28. *
  29. * @v ata ATA device
  30. * @v command ATA command
  31. * @ret rc Return status code
  32. */
  33. static int aoe_command ( struct ata_device *ata,
  34. struct ata_command *command ) {
  35. struct aoe_device *aoedev
  36. = container_of ( ata, struct aoe_device, ata );
  37. struct async async;
  38. return async_block ( &async, aoe_issue ( &aoedev->aoe, command,
  39. &async ) );
  40. }
  41. /**
  42. * Initialise AoE device
  43. *
  44. * @v aoedev AoE device
  45. */
  46. int init_aoedev ( struct aoe_device *aoedev ) {
  47. aoedev->ata.command = aoe_command;
  48. aoe_open ( &aoedev->aoe );
  49. return init_atadev ( &aoedev->ata );
  50. }