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.

84 lines
2.6 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) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+
  3. */
  4. #ifndef __SG
  5. #define __SG
  6. #include "os.h"
  7. /* see os.h for name of particular os-*.h where this is defined */
  8. BURN_OS_DEFINE_DRIVE_ENUMERATOR_T
  9. struct burn_drive;
  10. struct command;
  11. /* ts A60922 ticket 33 */
  12. int sg_give_next_adr(burn_drive_enumerator_t *enm_context,
  13. char adr[], int adr_size, int initialize);
  14. int sg_is_enumerable_adr(char *adr);
  15. int sg_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no,
  16. int *target_no, int *lun_no);
  17. int sg_grab(struct burn_drive *);
  18. int sg_release(struct burn_drive *);
  19. int sg_issue_command(struct burn_drive *, struct command *);
  20. /* ts A61115 : formerly sg_enumerate();ata_enumerate() */
  21. int scsi_enumerate_drives(void);
  22. int sg_drive_is_open(struct burn_drive * d);
  23. int burn_os_is_2k_seekrw(char *path, int flag);
  24. int burn_os_stdio_capacity(char *path, off_t write_start, off_t *bytes);
  25. /* ts A91227 */
  26. /** Returns the id string of the SCSI transport adapter and eventually
  27. needed operating system facilities.
  28. This call is usable even if sg_initialize() was not called yet. In that
  29. case a preliminary constant message might be issued if detailed info is
  30. not available yet.
  31. @param msg returns id string
  32. @param flag unused yet, submit 0
  33. @return 1 = success, <=0 = failure
  34. */
  35. int sg_id_string(char msg[1024], int flag);
  36. /* ts A91225 */
  37. /** Performs global initialization of the SCSI transport adapter and eventually
  38. needed operating system facilities. Checks for compatibility supporting
  39. software components.
  40. @param msg returns ids and/or error messages of eventual helpers
  41. @param flag unused yet, submit 0
  42. @return 1 = success, <=0 = failure
  43. */
  44. int sg_initialize(char msg[1024], int flag);
  45. /* ts A91227 */
  46. /** Performs global finalization of the SCSI transport adapter and eventually
  47. needed operating system facilities. Releases globally acquired resources.
  48. @param flag unused yet, submit 0
  49. @return 1 = success, <=0 = failure
  50. */
  51. int sg_shutdown(int flag);
  52. /* ts A91227 */
  53. /** Finalizes BURN_OS_TRANSPORT_DRIVE_ELEMENTS, the components of
  54. struct burn_drive which are defined in os-*.h.
  55. The eventual initialization of those components was made underneath
  56. scsi_enumerate_drives().
  57. This will be called when a burn_drive gets disposed.
  58. @param d the drive to be finalized
  59. @param flag unused yet, submit 0
  60. @return 1 = success, <=0 = failure
  61. */
  62. int sg_dispose_drive(struct burn_drive *d, int flag);
  63. #endif /* __SG */