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.

147 lines
5.1 KiB

15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
  1. /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
  2. /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
  3. Copyright (c) 2006 - 2014 Thomas Schmitt <scdbackup@gmx.net>
  4. Provided under GPL version 2 or later.
  5. */
  6. #ifndef __MMC
  7. #define __MMC
  8. struct burn_drive;
  9. struct burn_write_opts;
  10. struct command;
  11. struct buffer;
  12. struct cue_sheet;
  13. /* MMC commands */
  14. void mmc_read(struct burn_drive *);
  15. /* ts A61009 : removed redundant parameter d in favor of o->drive */
  16. /* void mmc_close_session(struct burn_drive *, struct burn_write_opts *); */
  17. /* void mmc_close_disc(struct burn_drive *, struct burn_write_opts *); */
  18. void mmc_close_session(struct burn_write_opts *o);
  19. void mmc_close_disc(struct burn_write_opts *o);
  20. void mmc_close(struct burn_drive *, int session, int track);
  21. void mmc_get_event(struct burn_drive *);
  22. int mmc_write(struct burn_drive *, int start, struct buffer *buf);
  23. void mmc_write_12(struct burn_drive *d, int start, struct buffer *buf);
  24. void mmc_sync_cache(struct burn_drive *);
  25. void mmc_load(struct burn_drive *);
  26. void mmc_eject(struct burn_drive *);
  27. void mmc_erase(struct burn_drive *, int);
  28. void mmc_read_toc(struct burn_drive *);
  29. void mmc_read_disc_info(struct burn_drive *);
  30. void mmc_read_atip(struct burn_drive *);
  31. int mmc_read_cd(struct burn_drive *d, int start, int len,
  32. int sec_type, int main_ch,
  33. const struct burn_read_opts *o, struct buffer *buf, int flag);
  34. void mmc_set_speed(struct burn_drive *, int, int);
  35. void mmc_read_lead_in(struct burn_drive *, struct buffer *);
  36. void mmc_perform_opc(struct burn_drive *);
  37. void mmc_get_configuration(struct burn_drive *);
  38. /* ts A61110 : added parameters trackno, lba, nwa. Redefined return value.
  39. @return 1=nwa is valid , 0=nwa is not valid , -1=error */
  40. int mmc_get_nwa(struct burn_drive *d, int trackno, int *lba, int *nwa);
  41. /* ts B11228 : changed from void to int */
  42. int mmc_send_cue_sheet(struct burn_drive *, struct cue_sheet *);
  43. /* ts A61023 : get size and free space of drive buffer */
  44. int mmc_read_buffer_capacity(struct burn_drive *d);
  45. /* ts A61021 : the mmc specific part of sg.c:enumerate_common()
  46. */
  47. int mmc_setup_drive(struct burn_drive *d);
  48. /* ts A61219 : learned much from dvd+rw-tools-7.0: plus_rw_format()
  49. and mmc5r03c.pdf, 6.5 FORMAT UNIT */
  50. int mmc_format_unit(struct burn_drive *d, off_t size, int flag);
  51. /* ts A61225 : obtain write speed descriptors via ACh GET PERFORMANCE */
  52. int mmc_get_write_performance(struct burn_drive *d);
  53. /* ts A61229 : outsourced from spc_select_write_params() */
  54. /* Note: Page data is not zeroed here to allow preset defaults. Thus
  55. memset(pd, 0, 2 + d->mdata->write_page_length);
  56. is the eventual duty of the caller.
  57. */
  58. int mmc_compose_mode_page_5(struct burn_drive *d,
  59. struct burn_session *s, int tno,
  60. const struct burn_write_opts *o,
  61. unsigned char *pd);
  62. /* ts A70201 */
  63. int mmc_four_char_to_int(unsigned char *data);
  64. /* ts A70201 :
  65. Common track info fetcher for mmc_get_nwa() and mmc_fake_toc()
  66. */
  67. int mmc_read_track_info(struct burn_drive *d, int trackno, struct buffer *buf,
  68. int alloc_len);
  69. /* ts A70812 : return 0 = ok , return BE_CANCELLED = error occurred */
  70. int mmc_read_10(struct burn_drive *d, int start, int amount,
  71. struct buffer *buf);
  72. /* ts A81210 : Determine the upper limit of readable data size */
  73. int mmc_read_capacity(struct burn_drive *d);
  74. /* ts A61201 */
  75. char *mmc_obtain_profile_name(int profile_number);
  76. /* mmc5r03c.pdf 4.3.4.4.1 d) "The maximum number of RZones is 2 302." */
  77. #define BURN_MMC_FAKE_TOC_MAX_SIZE 2302
  78. /* ts A90903 */
  79. /* MMC backend of API call burn_get_media_product_id()
  80. */
  81. int mmc_get_media_product_id(struct burn_drive *d,
  82. char **product_id, char **media_code1, char **media_code2,
  83. char **book_type, int flag);
  84. /* ts A60910 (estimated) */
  85. int mmc_function_spy(struct burn_drive *d, char * text);
  86. /* ts A91118 */
  87. int mmc_start_if_needed(struct burn_drive *d, int flag);
  88. /* ts B00924 */
  89. int mmc_get_bd_spare_info(struct burn_drive *d,
  90. int *alloc_blocks, int *free_blocks, int flag);
  91. /* ts B10801 */
  92. int mmc_get_phys_format_info(struct burn_drive *d, int *disk_category,
  93. char **book_name, int *part_version, int *num_layers,
  94. int *num_blocks, int flag);
  95. /* ts B11201 */
  96. int mmc_get_leadin_text(struct burn_drive *d,
  97. unsigned char **text_packs, int *num_packs, int flag);
  98. /* ts B40107 */
  99. int mmc_get_performance(struct burn_drive *d, int descr_type, int flag);
  100. /* ts B90414 */
  101. int burn_make_feature_text(struct burn_drive *d, unsigned int feature_code,
  102. unsigned char flags,
  103. unsigned char additional_length,
  104. unsigned char *feature_data,
  105. char **text, int flag);
  106. #ifdef Libburn_develop_quality_scaN
  107. /* B21108 ts */
  108. int mmc_nec_optiarc_f3(struct burn_drive *d, int sub_op,
  109. int start_lba, int rate_period,
  110. int *eba, int *error_rate1, int *error_rate2);
  111. #endif
  112. #endif /*__MMC*/