2006-08-15 20:37:04 +00:00
|
|
|
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
|
|
|
|
2010-02-14 08:45:14 +00:00
|
|
|
/* Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+
|
|
|
|
*/
|
|
|
|
|
2006-08-15 20:37:04 +00:00
|
|
|
#ifndef __SG
|
|
|
|
#define __SG
|
|
|
|
|
2006-11-16 11:17:55 +00:00
|
|
|
|
|
|
|
#include "os.h"
|
|
|
|
|
|
|
|
|
|
|
|
/* see os.h for name of particular os-*.h where this is defined */
|
|
|
|
BURN_OS_DEFINE_DRIVE_ENUMERATOR_T
|
|
|
|
|
2006-10-14 12:24:03 +00:00
|
|
|
|
2006-08-15 20:37:04 +00:00
|
|
|
struct burn_drive;
|
|
|
|
struct command;
|
|
|
|
|
2006-09-25 14:09:14 +00:00
|
|
|
|
2006-09-22 13:30:32 +00:00
|
|
|
/* ts A60922 ticket 33 */
|
2006-10-14 12:24:03 +00:00
|
|
|
int sg_give_next_adr(burn_drive_enumerator_t *enm_context,
|
|
|
|
char adr[], int adr_size, int initialize);
|
2006-09-22 13:30:32 +00:00
|
|
|
int sg_is_enumerable_adr(char *adr);
|
2006-10-05 14:21:34 +00:00
|
|
|
int sg_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no,
|
2006-09-22 19:29:11 +00:00
|
|
|
int *target_no, int *lun_no);
|
2006-09-22 13:30:32 +00:00
|
|
|
|
2006-08-15 20:37:04 +00:00
|
|
|
int sg_grab(struct burn_drive *);
|
|
|
|
int sg_release(struct burn_drive *);
|
|
|
|
int sg_issue_command(struct burn_drive *, struct command *);
|
|
|
|
|
2006-11-15 17:10:12 +00:00
|
|
|
/* ts A61115 : formerly sg_enumerate();ata_enumerate() */
|
|
|
|
int scsi_enumerate_drives(void);
|
|
|
|
|
|
|
|
int sg_drive_is_open(struct burn_drive * d);
|
2006-10-14 12:24:03 +00:00
|
|
|
|
2010-01-16 12:51:24 +00:00
|
|
|
int burn_os_is_2k_seekrw(char *path, int flag);
|
|
|
|
|
2014-06-10 07:37:40 +00:00
|
|
|
int burn_os_stdio_capacity(char *path, off_t write_start, off_t *bytes);
|
2007-09-09 13:31:29 +00:00
|
|
|
|
2009-12-27 14:45:05 +00:00
|
|
|
/* ts A91227 */
|
|
|
|
/** Returns the id string of the SCSI transport adapter and eventually
|
|
|
|
needed operating system facilities.
|
|
|
|
This call is usable even if sg_initialize() was not called yet. In that
|
|
|
|
case a preliminary constant message might be issued if detailed info is
|
|
|
|
not available yet.
|
|
|
|
@param msg returns id string
|
|
|
|
@param flag unused yet, submit 0
|
|
|
|
@return 1 = success, <=0 = failure
|
|
|
|
*/
|
|
|
|
int sg_id_string(char msg[1024], int flag);
|
|
|
|
|
2009-12-25 22:37:57 +00:00
|
|
|
/* ts A91225 */
|
|
|
|
/** Performs global initialization of the SCSI transport adapter and eventually
|
|
|
|
needed operating system facilities. Checks for compatibility supporting
|
|
|
|
software components.
|
|
|
|
@param msg returns ids and/or error messages of eventual helpers
|
|
|
|
@param flag unused yet, submit 0
|
|
|
|
@return 1 = success, <=0 = failure
|
|
|
|
*/
|
|
|
|
int sg_initialize(char msg[1024], int flag);
|
|
|
|
|
2009-12-27 14:45:05 +00:00
|
|
|
/* ts A91227 */
|
|
|
|
/** Performs global finalization of the SCSI transport adapter and eventually
|
2016-07-23 10:40:43 +00:00
|
|
|
needed operating system facilities. Releases globally acquired resources.
|
2009-12-27 14:45:05 +00:00
|
|
|
@param flag unused yet, submit 0
|
|
|
|
@return 1 = success, <=0 = failure
|
|
|
|
*/
|
|
|
|
int sg_shutdown(int flag);
|
|
|
|
|
|
|
|
/* ts A91227 */
|
|
|
|
/** Finalizes BURN_OS_TRANSPORT_DRIVE_ELEMENTS, the components of
|
|
|
|
struct burn_drive which are defined in os-*.h.
|
|
|
|
The eventual initialization of those components was made underneath
|
|
|
|
scsi_enumerate_drives().
|
|
|
|
This will be called when a burn_drive gets disposed.
|
|
|
|
@param d the drive to be finalized
|
|
|
|
@param flag unused yet, submit 0
|
|
|
|
@return 1 = success, <=0 = failure
|
|
|
|
*/
|
|
|
|
int sg_dispose_drive(struct burn_drive *d, int flag);
|
|
|
|
|
2009-12-25 22:37:57 +00:00
|
|
|
|
2006-08-15 20:37:04 +00:00
|
|
|
#endif /* __SG */
|