2006-08-15 20:37:04 +00:00
|
|
|
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
|
|
|
|
|
|
|
#ifndef __SG
|
|
|
|
#define __SG
|
|
|
|
|
2006-10-14 12:24:03 +00:00
|
|
|
#ifdef __FreeBSD__
|
|
|
|
|
|
|
|
/* >>> To hold all state information of BSD device enumeration
|
|
|
|
which are now local in sg_enumerate() . So that sg_give_next_adr()
|
|
|
|
can work in BSD and sg_enumerate() can use it. */
|
|
|
|
struct burn_drive_enumeration_state {
|
|
|
|
int dummy;
|
|
|
|
};
|
|
|
|
typedef struct burn_drive_enumeration_state burn_drive_enumerator_t;
|
|
|
|
|
|
|
|
#else /* __FreeBSD__ */
|
|
|
|
|
|
|
|
/* <<< just for testing the C syntax */
|
|
|
|
struct burn_drive_enumeration_state {
|
|
|
|
int dummy;
|
|
|
|
};
|
|
|
|
typedef struct burn_drive_enumeration_state burn_drive_enumerator_tX;
|
|
|
|
|
|
|
|
typedef int burn_drive_enumerator_t;
|
|
|
|
|
|
|
|
#endif /* ! __FreeBSD__ */
|
|
|
|
|
2006-08-15 20:37:04 +00:00
|
|
|
struct burn_drive;
|
|
|
|
struct command;
|
|
|
|
|
|
|
|
enum response
|
|
|
|
{ RETRY, FAIL };
|
|
|
|
|
2006-09-25 14:09:14 +00:00
|
|
|
/* ts A60925 : ticket 74 */
|
|
|
|
int sg_close_drive_fd(char *fname, int driveno, int *fd, int sorry);
|
|
|
|
|
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-09-27 11:57:28 +00:00
|
|
|
/* ts A60926 : ticket 33 ++ */
|
|
|
|
int sg_open_scsi_siblings(char *fname, int driveno,
|
|
|
|
int sibling_fds[], int *sibling_count,
|
|
|
|
int host_no, int channel_no, int id_no, int lun_no);
|
|
|
|
int sg_release_siblings(int sibling_fds[], int *sibling_count);
|
|
|
|
int sg_close_drive(struct burn_drive *d);
|
|
|
|
|
2006-08-15 20:37:04 +00:00
|
|
|
void sg_enumerate(void);
|
|
|
|
void ata_enumerate(void);
|
|
|
|
int sg_grab(struct burn_drive *);
|
|
|
|
int sg_release(struct burn_drive *);
|
|
|
|
int sg_issue_command(struct burn_drive *, struct command *);
|
|
|
|
enum response scsi_error(struct burn_drive *, unsigned char *, int);
|
|
|
|
|
2006-10-14 12:24:03 +00:00
|
|
|
|
2006-08-15 20:37:04 +00:00
|
|
|
#endif /* __SG */
|