ps3stor.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * PS3 Storage Devices
  3. *
  4. * Copyright (C) 2007 Sony Computer Entertainment Inc.
  5. * Copyright 2007 Sony Corp.
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published
  9. * by the Free Software Foundation; version 2 of the License.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. */
  20. #ifndef _ASM_POWERPC_PS3STOR_H_
  21. #define _ASM_POWERPC_PS3STOR_H_
  22. #include <linux/interrupt.h>
  23. #include <asm/ps3.h>
  24. struct ps3_storage_region {
  25. unsigned int id;
  26. u64 start;
  27. u64 size;
  28. };
  29. struct ps3_storage_device {
  30. struct ps3_system_bus_device sbd;
  31. struct ps3_dma_region dma_region;
  32. unsigned int irq;
  33. u64 blk_size;
  34. u64 tag;
  35. u64 lv1_status;
  36. struct completion done;
  37. unsigned long bounce_size;
  38. void *bounce_buf;
  39. u64 bounce_lpar;
  40. dma_addr_t bounce_dma;
  41. unsigned int num_regions;
  42. unsigned long accessible_regions;
  43. unsigned int region_idx; /* first accessible region */
  44. struct ps3_storage_region regions[0]; /* Must be last */
  45. };
  46. static inline struct ps3_storage_device *to_ps3_storage_device(struct device *dev)
  47. {
  48. return container_of(dev, struct ps3_storage_device, sbd.core);
  49. }
  50. extern int ps3stor_setup(struct ps3_storage_device *dev,
  51. irq_handler_t handler);
  52. extern void ps3stor_teardown(struct ps3_storage_device *dev);
  53. extern u64 ps3stor_read_write_sectors(struct ps3_storage_device *dev, u64 lpar,
  54. u64 start_sector, u64 sectors,
  55. int write);
  56. extern u64 ps3stor_send_command(struct ps3_storage_device *dev, u64 cmd,
  57. u64 arg1, u64 arg2, u64 arg3, u64 arg4);
  58. #endif /* _ASM_POWERPC_PS3STOR_H_ */