Advertisement
Guest User

Untitled

a guest
May 5th, 2011
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.43 KB | None | 0 0
  1. /* You want to define this in the config files */
  2. #define CONFIG_STORAGE  (STORAGE_SD | STORAGE_NAND)
  3. #define HAVE_HOTSWAP    /* for card slot */
  4.  
  5. /* For the NAND part */
  6. int nand_first_drive;
  7.  
  8. int nand_num_drives(int first_drive)
  9. {
  10.     nand_first_drive = first_drive;
  11.     return 1; /* I have one NAND drive */
  12. }
  13.  
  14. void nand_enable(bool on)
  15. {
  16. }
  17.  
  18. void nand_spindown(int seconds)
  19. {
  20. }
  21.  
  22. void nand_sleep(void)
  23. {
  24. }
  25.  
  26. void nand_sleepnow(void)
  27. {
  28. }
  29.  
  30. bool nand_disk_is_active(void)
  31. {
  32. }
  33.  
  34. int  nand_soft_reset(void)
  35. {
  36. }
  37.  
  38. int  nand_init(void)
  39. {
  40. }
  41.  
  42. void nand_close(void)
  43. {
  44. }
  45.  
  46. int nand_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf)
  47. {
  48.     /* If you have one drive, drive will equals nand_first_drive.
  49.      * If you have two drives, drive will equals nand_first_drive or nand_first_drive + 1
  50.      * Etc */
  51.     return -1;
  52. }
  53.  
  54. int nand_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf)
  55. {
  56.     return -1;
  57. }
  58.  
  59. /* Depends on your other defines then */
  60.  
  61. #ifdef HAVE_STORAGE_FLUSH
  62. int  nand_flush(void)
  63. {
  64. }
  65.  
  66. #endif
  67. void nand_spin(void)
  68. {
  69. }
  70.  
  71. int  nand_spinup_time(void) /* ticks */
  72. {
  73. }
  74.  
  75. #ifdef STORAGE_GET_INFO
  76. void nand_get_info(IF_MD2(int drive,) struct storage_info *info)
  77. {
  78. }
  79.  
  80. #endif
  81.  
  82. /* For the SD part */
  83. int sd_first_drive;
  84.  
  85. int sd_num_drives(int first_drive)
  86. {
  87.     sd_first_drive = first_drive;
  88.     return 1; /* I have one SD drive */
  89. }
  90.  
  91. void sd_enable(bool on)
  92. {
  93. }
  94.  
  95. void sd_spindown(int seconds)
  96. {
  97. }
  98.  
  99. void sd_sleep(void)
  100. {
  101. }
  102.  
  103. void sd_sleepnow(void)
  104. {
  105. }
  106.  
  107. bool sd_disk_is_active(void)
  108. {
  109. }
  110.  
  111. int  sd_soft_reset(void)
  112. {
  113. }
  114.  
  115. int  sd_init(void)
  116. {
  117. }
  118.  
  119. int  sd_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf)
  120. {
  121.     /* same thing as nand_read_sectors */
  122.     return -1;
  123. }
  124.  
  125. int  sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf)
  126. {
  127.     return -1;
  128. }
  129.  
  130. void sd_spin(void)
  131. {
  132. }
  133.  
  134. int  sd_spinup_time(void) /* ticks */
  135. {
  136. }
  137.  
  138. #ifdef STORAGE_GET_INFO
  139. void sd_get_info(IF_MD2(int drive,) struct storage_info *info)
  140. {
  141. }
  142. #endif
  143. #ifdef HAVE_HOTSWAP
  144. bool sd_removable(IF_MV_NONVOID(int drive))
  145. {
  146.     /* drive should equal sd_first_drive if you only have one SD drive */
  147.     return true;
  148. }
  149.  
  150. bool sd_present(IF_MV_NONVOID(int drive))
  151. {
  152.     /* you need to implement this since it's a card slot */
  153.     return false;
  154. }
  155. #endif
  156.  
  157. long sd_last_disk_activity(void);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement