xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

sg-linux.c File Reference
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <string.h>
#include <sys/poll.h>
#include <linux/hdreg.h>
#include <stdlib.h>
#include <sys/utsname.h>
#include <scsi/scsi.h>
#include <sys/statvfs.h>
#include <linux/fs.h>
#include <sys/mman.h>
#include <scsi/sg.h>
#include <limits.h>
#include <linux/cdrom.h>
#include "libburn.h"
#include "transport.h"
#include "drive.h"
#include "sg.h"
#include "spc.h"
#include "mmc.h"
#include "sbc.h"
#include "debug.h"
#include "toc.h"
#include "util.h"
#include "init.h"
#include "libdax_msgs.h"
Include dependency graph for sg-linux.c:

Go to the source code of this file.

Macros

#define Libburn_sg_host_oK   0
 
#define Libburn_sg_driver_oK   0
 
#define Libburn_udev_wait_useC   100000
 

Functions

int burn_drive_is_banned (char *device_address)
 
static void enumerate_common (char *fname, int fd_in, int bus_no, int host_no, int channel_no, int target_no, int lun_no)
 
static int sg_obtain_scsi_adr_fd (char *path, int fd_in, int *bus_no, int *host_no, int *channel_no, int *target_no, int *lun_no)
 
int mmc_function_spy (struct burn_drive *d, char *text)
 
static void sg_evaluate_kernel (void)
 
static void sg_select_device_family (void)
 
static int sg_exchange_scd_for_sr (char *fname, int flag)
 
static int sgio_log_cmd (unsigned char *cmd, int cmd_len, FILE *fp_in, int flag)
 
static int sgio_log_reply (unsigned char *opcode, int data_dir, unsigned char *data, int dxfer_len, void *fp_in, unsigned char sense[18], int sense_len, double duration, int flag)
 
static int sgio_test (int fd)
 
static int sgio_inquiry_cd_drive (int fd, char *fname)
 
static int sg_handle_busy_device (char *fname, int os_errno)
 
static int sg_close_drive_fd (char *fname, int driveno, int *fd, int sorry)
 
static int sg_fcntl_lock (int *fd, char *fd_name, int l_type, int verbose)
 
static int sg_open_drive_fd (char *fname, int scan_mode)
 
static int sg_release_siblings (int sibling_fds[], char sibling_fnames[][BURN_OS_SG_MAX_NAMELEN], int *sibling_count)
 
static int sg_os_revalidate_disc (struct burn_drive *d)
 
static int sg_close_drive (struct burn_drive *d)
 
static int sg_open_scsi_siblings (char *path, int driveno, int sibling_fds[], char sibling_fnames[][BURN_OS_SG_MAX_NAMELEN], int *sibling_count, int host_no, int channel_no, int id_no, int lun_no)
 
static int is_ata_drive (char *fname, int fd_in)
 
static int is_scsi_drive (char *fname, int fd_in, int *bus_no, int *host_no, int *channel_no, int *target_no, int *lun_no)
 
static int sg_open_for_enumeration (char *fname, int flag)
 
static void ata_enumerate (void)
 
static void sg_enumerate (void)
 
static int fname_other_name (char *fname, char other_name[80], int flag)
 
static int fname_drive_is_listed (char *fname, int flag)
 
static int fname_enumerate (char *fname, int flag)
 
static int single_enumerate (int flag)
 
static int proc_sys_dev_cdrom_info (char ***list, int *count, int flag)
 
static int add_proc_info_drives (int flag)
 
int sg_id_string (char msg[1024], int flag)
 
int sg_initialize (char msg[1024], int flag)
 
int sg_shutdown (int flag)
 
int sg_dispose_drive (struct burn_drive *d, int flag)
 
int sg_give_next_adr (burn_drive_enumerator_t *idx, char adr[], int adr_size, int initialize)
 
int scsi_enumerate_drives (void)
 
int sg_drive_is_open (struct burn_drive *d)
 
int sg_grab (struct burn_drive *d)
 
int sg_release (struct burn_drive *d)
 
static int evaluate_transport_success (struct burn_drive *d, struct command *c, FILE *fp, unsigned short host_status, unsigned short driver_status)
 
static void react_on_drive_loss (struct burn_drive *d, struct command *c, FILE *fp)
 
int sg_issue_command (struct burn_drive *d, struct command *c)
 
int sg_obtain_scsi_adr (char *path, int *bus_no, int *host_no, int *channel_no, int *target_no, int *lun_no)
 
int sg_is_enumerable_adr (char *adr)
 
int burn_os_is_2k_seekrw (char *path, int flag)
 
int burn_os_stdio_capacity (char *path, off_t write_start, off_t *bytes)
 
int burn_os_open_track_src (char *path, int open_flags, int flag)
 
void * burn_os_alloc_buffer (size_t amount, int flag)
 
int burn_os_free_buffer (void *buffer, size_t amount, int flag)
 

Variables

static int sg_kernel_age = -1
 
static int linux_sg_enumerate_debug = 0
 
static char linux_sg_device_family [80] = {"/dev/sg%d"}
 
static int linux_sg_auto_family = 1
 
static int linux_sg_accept_any_type = 0
 
static char linux_ata_device_family [80] = {"/dev/hd%c"}
 
static int linux_ata_enumerate_verbose = 0
 
struct libdax_msgs * libdax_messenger
 
int burn_sg_open_o_excl
 
int burn_sg_fcntl_f_setlk
 
int burn_sg_use_family
 
int burn_sg_open_o_nonblock
 
int burn_sg_open_abort_busy
 
int burn_sg_log_scsi
 

Macro Definition Documentation

◆ Libburn_sg_driver_oK

#define Libburn_sg_driver_oK   0

Definition at line 157 of file sg-linux.c.

◆ Libburn_sg_host_oK

#define Libburn_sg_host_oK   0

PORTING : ----— OS dependent headers and definitions ---—

Definition at line 155 of file sg-linux.c.

◆ Libburn_udev_wait_useC

#define Libburn_udev_wait_useC   100000

Function Documentation

◆ add_proc_info_drives()

static int add_proc_info_drives ( int  flag)
static

◆ ata_enumerate()

static void ata_enumerate ( void  )
static

Speciality of GNU/Linux: detect non-SCSI ATAPI (EIDE) which will from then on used used via generic SCSI as is done with (emulated) SCSI drives

Definition at line 1213 of file sg-linux.c.

References burn_drive_is_banned(), enumerate_common(), is_ata_drive(), linux_ata_device_family, linux_ata_enumerate_verbose, and sg_open_for_enumeration().

Referenced by scsi_enumerate_drives().

◆ burn_drive_is_banned()

int burn_drive_is_banned ( char *  device_address)

Definition at line 1723 of file drive.c.

Referenced by add_proc_info_drives(), ata_enumerate(), and sg_enumerate().

◆ burn_os_alloc_buffer()

void* burn_os_alloc_buffer ( size_t  amount,
int  flag 
)

Allocate a memory area that is suitable for reading with a file descriptor opened by burn_os_open_track_src().

Parameters
amountNumber of bytes to allocate. This should be a multiple of the operating system's i/o block size. 32 KB is guaranteed by libburn to be safe.
flagBitfield for control purposes (unused yet, submit 0).
Returns
The address of the allocated memory, or NULL on failure. A non-NULL return value has finally to be disposed via burn_os_free_buffer().
Since
0.7.4

Definition at line 2608 of file sg-linux.c.

References libdax_messenger, LIBDAX_MSGS_PRIO_HIGH, LIBDAX_MSGS_SEV_DEBUG, and libdax_msgs_submit().

◆ burn_os_free_buffer()

int burn_os_free_buffer ( void *  buffer,
size_t  amount,
int  flag 
)

Dispose a memory area which was obtained by burn_os_alloc_buffer(),

Parameters
bufferMemory address to be freed.
amountThe number of bytes which was allocated at that address.
flagBitfield for control purposes (unused yet, submit 0).
Returns
1 success , <=0 failure
Since
0.7.4

Definition at line 2633 of file sg-linux.c.

◆ burn_os_is_2k_seekrw()

int burn_os_is_2k_seekrw ( char *  path,
int  flag 
)

Definition at line 2483 of file sg-linux.c.

◆ burn_os_open_track_src()

int burn_os_open_track_src ( char *  path,
int  open_flags,
int  flag 
)

Opens a file with eventual acceleration preparations which may depend on the operating system and on compile time options of libburn. You may use this call instead of open(2) for opening file descriptors which shall be handed to burn_fd_source_new(). This should only be done for tracks with BURN_BLOCK_MODE1 (2048 bytes per block).

If you use this call then you MUST allocate the buffers which you use with read(2) by call burn_os_alloc_buffer(). Read sizes MUST be a multiple of a safe buffer amount. Else you risk that track data get altered during transmission. burn_disk_write() will allocate a suitable read/write buffer for its own operations. A fifo created by burn_fifo_source_new() will allocate suitable memory for its buffer if called with flag bit0 and a multiple of a safe buffer amount.

Parameters
pathThe file address to open
open_flagsThe flags as of man 2 open. Normally just O_RDONLY.
flagBitfield for control purposes (unused yet, submit 0).
Returns
A file descriptor as of open(2). Finally to be disposed by close(2). -1 indicates failure.
Since
0.7.4

Definition at line 2592 of file sg-linux.c.

References libdax_messenger, LIBDAX_MSGS_PRIO_HIGH, LIBDAX_MSGS_SEV_DEBUG, and libdax_msgs_submit().

◆ burn_os_stdio_capacity()

int burn_os_stdio_capacity ( char *  path,
off_t  write_start,
off_t *  bytes 
)

Estimate the potential payload capacity of a file address.

Parameters
pathThe address of the file to be examined. If it does not exist yet, then the directory will be inquired.
bytesThe pointed value gets modified, but only if an estimation is possible.
Returns
-2 = cannot perform necessary operations on file object -1 = neither path nor dirname of path exist 0 = could not estimate size capacity of file object 1 = estimation has been made, bytes was set

Definition at line 2508 of file sg-linux.c.

References BURN_ALLOC_MEM, BURN_FREE_MEM, and burn_sparse_file_addsize().

◆ enumerate_common()

static void enumerate_common ( char *  fname,
int  fd_in,
int  bus_no,
int  host_no,
int  channel_no,
int  target_no,
int  lun_no 
)
static

◆ evaluate_transport_success()

static int evaluate_transport_success ( struct burn_drive d,
struct command c,
FILE *  fp,
unsigned short  host_status,
unsigned short  driver_status 
)
static

◆ fname_drive_is_listed()

static int fname_drive_is_listed ( char *  fname,
int  flag 
)
static

Definition at line 1325 of file sg-linux.c.

References burn_drive_is_listed(), and fname_other_name().

Referenced by fname_enumerate().

◆ fname_enumerate()

◆ fname_other_name()

static int fname_other_name ( char *  fname,
char  other_name[80],
int  flag 
)
static

Definition at line 1304 of file sg-linux.c.

Referenced by fname_drive_is_listed(), and sg_give_next_adr().

◆ is_ata_drive()

static int is_ata_drive ( char *  fname,
int  fd_in 
)
static

◆ is_scsi_drive()

static int is_scsi_drive ( char *  fname,
int  fd_in,
int *  bus_no,
int *  host_no,
int *  channel_no,
int *  target_no,
int *  lun_no 
)
static

◆ mmc_function_spy()

◆ proc_sys_dev_cdrom_info()

static int proc_sys_dev_cdrom_info ( char ***  list,
int *  count,
int  flag 
)
static

◆ react_on_drive_loss()

◆ scsi_enumerate_drives()

int scsi_enumerate_drives ( void  )

Brings all available, not-whitelist-banned, and accessible drives into libburn's list of drives. PORTING: If not stricken with an incompletely unified situation like in GNU/Linux one would rather implement this by a loop calling sg_give_next_adr(). If needed with your sg_give_next_adr() results, do a test for existence and accessability. If burn activities are prone to external interference on your system it is also necessary to obtain exclusive access locks on the drives. Hand over each accepted drive to enumerate_common() or its replacement within your port.

See FreeBSD port sketch sg-freebsd-port.c for such an implementation.

Definition at line 1754 of file sg-linux.c.

References add_proc_info_drives(), ata_enumerate(), sg_enumerate(), and single_enumerate().

◆ sg_close_drive()

◆ sg_close_drive_fd()

static int sg_close_drive_fd ( char *  fname,
int  driveno,
int *  fd,
int  sorry 
)
static

◆ sg_dispose_drive()

int sg_dispose_drive ( struct burn_drive d,
int  flag 
)

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.

Parameters
dthe drive to be finalized
flagunused yet, submit 0
Returns
1 = success, <=0 = failure

Definition at line 1636 of file sg-linux.c.

◆ sg_drive_is_open()

int sg_drive_is_open ( struct burn_drive d)

Tells whether libburn has the given drive in use or exclusively reserved. If it is "open" then libburn will eventually call sg_release() on it when it is time to give up usage and reservation. Published as burn_drive.drive_is_open()

Definition at line 1777 of file sg-linux.c.

Referenced by enumerate_common().

◆ sg_enumerate()

static void sg_enumerate ( void  )
static

◆ sg_evaluate_kernel()

static void sg_evaluate_kernel ( void  )
static

Definition at line 301 of file sg-linux.c.

References sg_kernel_age.

Referenced by proc_sys_dev_cdrom_info(), and sg_select_device_family().

◆ sg_exchange_scd_for_sr()

static int sg_exchange_scd_for_sr ( char *  fname,
int  flag 
)
static

◆ sg_fcntl_lock()

static int sg_fcntl_lock ( int *  fd,
char *  fd_name,
int  l_type,
int  verbose 
)
static

◆ sg_give_next_adr()

int sg_give_next_adr ( burn_drive_enumerator_t idx,
char  adr[],
int  adr_size,
int  initialize 
)

PORTING: In this GNU/Linux implementation, this function mirrors the enumeration done in sg_enumerate and ata_enumerate(). It would be better to base those functions on this sg_give_next_adr() but the situation is not inviting. Returns the next index number and the next enumerated drive address. The enumeration has to cover all available and accessible drives. It is allowed to return addresses of drives which are not available but under some (even exotic) circumstances could be available. It is on the other hand allowed, only to hand out addresses which can really be used right in the moment of this call. (This implementation chooses the former.)

Parameters
idxAn opaque handle. Make no own theories about it.
adrTakes the reply
adr_sizeGives maximum size of reply including final 0
initialize1 = start new, 0 = continue, use no other values for now -1 = finish
Returns
1 = reply is a valid address , 0 = no further address available -1 = severe error (e.g. adr_size too small)

Definition at line 1663 of file sg-linux.c.

References burn_sg_use_family, fname_other_name(), burn_drive_enumerator_struct::info_count, burn_drive_enumerator_struct::info_list, linux_ata_device_family, linux_sg_device_family, burn_drive_enumerator_struct::pos, proc_sys_dev_cdrom_info(), sg_exchange_scd_for_sr(), and sg_select_device_family().

Referenced by sg_is_enumerable_adr().

◆ sg_grab()

int sg_grab ( struct burn_drive d)

Opens the drive for SCSI commands and - if burn activities are prone to external interference on your system - obtains an exclusive access lock on the drive. (Note: this is not physical tray locking.) A drive that has been opened with sg_grab() will eventually be handed over to sg_release() for closing and unreserving.

Definition at line 1794 of file sg-linux.c.

References burn_drive_is_open(), burn_sg_open_o_excl, burn_sg_open_o_nonblock, burn_drive::channel, burn_drive::devname, burn_drive::global_index, burn_drive::host, burn_drive::id, Libburn_udev_wait_useC, libdax_messenger, LIBDAX_MSGS_PRIO_HIGH, LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_SEV_SORRY, libdax_msgs_submit(), burn_drive::lun, mmc_function_spy(), burn_drive::released, sg_close_drive(), sg_fcntl_lock(), and sg_open_scsi_siblings().

Referenced by enumerate_common().

◆ sg_handle_busy_device()

static int sg_handle_busy_device ( char *  fname,
int  os_errno 
)
static

◆ sg_id_string()

int sg_id_string ( char  msg[1024],
int  flag 
)

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.

Parameters
msgreturns id string
flagunused yet, submit 0
Returns
1 = success, <=0 = failure

Definition at line 1596 of file sg-linux.c.

Referenced by sg_initialize().

◆ sg_initialize()

int sg_initialize ( char  msg[1024],
int  flag 
)

Performs global initialization of the SCSI transport adapter and eventually needed operating system facilities. Checks for compatibility supporting software components.

Parameters
msgreturns ids and/or error messages of eventual helpers
flagunused yet, submit 0
Returns
1 = success, <=0 = failure

Definition at line 1610 of file sg-linux.c.

References sg_id_string().

◆ sg_is_enumerable_adr()

int sg_is_enumerable_adr ( char *  adr)

Tells whether a text is a persistent address as listed by the enumeration functions.

Definition at line 2453 of file sg-linux.c.

References BURN_ALLOC_MEM, BURN_FREE_MEM, and sg_give_next_adr().

◆ sg_issue_command()

int sg_issue_command ( struct burn_drive d,
struct command c 
)

Sends a SCSI command to the drive, receives reply and evaluates whether the command succeeded or shall be retried or finally failed. Returned SCSI errors shall not lead to a return value indicating failure. The callers get notified by c->error. An SCSI failure which leads not to a retry shall be notified via scsi_notify_error().

Returns
: 1 success , <=0 failure

Definition at line 2157 of file sg-linux.c.

References BUFFER_SIZE, BURN_ALLOC_MEM, BURN_FREE_MEM, burn_get_time(), burn_sg_log_scsi, buffer::bytes, burn_drive::cancel, buffer::data, command::dir, command::dxfer_len, command::end_time, command::error, evaluate_transport_success(), FROM_DRIVE, burn_drive::global_index, Libburn_scsi_default_timeouT, libdax_messenger, LIBDAX_MSGS_PRIO_HIGH, LIBDAX_MSGS_SEV_FATAL, libdax_msgs_submit(), mmc_function_spy(), NO_TRANSFER, command::opcode, command::oplen, command::page, react_on_drive_loss(), burn_drive::released, scsi_eval_cmd_outcome(), scsi_log_cmd(), scsi_log_message(), scsi_log_text(), command::sense, spc_human_readable_cmd(), spc_register_retry(), command::start_time, command::timeout, and TO_DRIVE.

Referenced by enumerate_common().

◆ sg_obtain_scsi_adr()

int sg_obtain_scsi_adr ( char *  path,
int *  bus_no,
int *  host_no,
int *  channel_no,
int *  target_no,
int *  lun_no 
)

Tries to obtain SCSI address parameters.

Returns
1 is success , 0 is failure

Definition at line 2441 of file sg-linux.c.

References sg_obtain_scsi_adr_fd().

Referenced by sg_open_scsi_siblings().

◆ sg_obtain_scsi_adr_fd()

static int sg_obtain_scsi_adr_fd ( char *  path,
int  fd_in,
int *  bus_no,
int *  host_no,
int *  channel_no,
int *  target_no,
int *  lun_no 
)
static

Tries to obtain SCSI address parameters.

Returns
1 is success , 0 is failure

Definition at line 2370 of file sg-linux.c.

References burn_sg_open_o_excl, burn_sg_open_o_nonblock, linux_ata_device_family, sg_close_drive_fd(), and sg_fcntl_lock().

Referenced by is_scsi_drive(), and sg_obtain_scsi_adr().

◆ sg_open_drive_fd()

◆ sg_open_for_enumeration()

static int sg_open_for_enumeration ( char *  fname,
int  flag 
)
static

◆ sg_open_scsi_siblings()

static int sg_open_scsi_siblings ( char *  path,
int  driveno,
int  sibling_fds[],
char  sibling_fnames[][BURN_OS_SG_MAX_NAMELEN],
int *  sibling_count,
int  host_no,
int  channel_no,
int  id_no,
int  lun_no 
)
static

◆ sg_os_revalidate_disc()

static int sg_os_revalidate_disc ( struct burn_drive d)
static

Urges the operating system to re-assess drive and medium state

Definition at line 826 of file sg-linux.c.

References BURN_ALLOC_MEM, BURN_FREE_MEM, burn_drive::devname, burn_drive::global_index, libdax_messenger, LIBDAX_MSGS_PRIO_HIGH, LIBDAX_MSGS_SEV_DEBUG, and libdax_msgs_submit().

Referenced by sg_close_drive().

◆ sg_release()

int sg_release ( struct burn_drive d)

PORTING: Is mainly about the call to sg_close_drive() and whether it implements the demanded functionality. Gives up the drive for SCSI commands and releases eventual access locks. (Note: this is not physical tray locking.)

Definition at line 1958 of file sg-linux.c.

References mmc_function_spy(), and sg_close_drive().

Referenced by enumerate_common().

◆ sg_release_siblings()

static int sg_release_siblings ( int  sibling_fds[],
char  sibling_fnames[][BURN_OS_SG_MAX_NAMELEN],
int *  sibling_count 
)
static

◆ sg_select_device_family()

static void sg_select_device_family ( void  )
static

◆ sg_shutdown()

int sg_shutdown ( int  flag)

Performs global finalization of the SCSI transport adapter and eventually needed operating system facilities. Releases globally acquired resources.

Parameters
flagunused yet, submit 0
Returns
1 = success, <=0 = failure

Definition at line 1621 of file sg-linux.c.

◆ sgio_inquiry_cd_drive()

static int sgio_inquiry_cd_drive ( int  fd,
char *  fname 
)
static

◆ sgio_log_cmd()

static int sgio_log_cmd ( unsigned char *  cmd,
int  cmd_len,
FILE *  fp_in,
int  flag 
)
static

Definition at line 388 of file sg-linux.c.

References burn_sg_log_scsi, FROM_DRIVE, NO_TRANSFER, and scsi_log_command().

Referenced by sgio_inquiry_cd_drive(), and sgio_test().

◆ sgio_log_reply()

static int sgio_log_reply ( unsigned char *  opcode,
int  data_dir,
unsigned char *  data,
int  dxfer_len,
void *  fp_in,
unsigned char  sense[18],
int  sense_len,
double  duration,
int  flag 
)
static

Definition at line 418 of file sg-linux.c.

References scsi_log_reply().

Referenced by sgio_inquiry_cd_drive(), and sgio_test().

◆ sgio_test()

static int sgio_test ( int  fd)
static

Definition at line 431 of file sg-linux.c.

References burn_get_time(), NO_TRANSFER, sgio_log_cmd(), and sgio_log_reply().

Referenced by is_ata_drive(), and is_scsi_drive().

◆ single_enumerate()

Variable Documentation

◆ burn_sg_fcntl_f_setlk

int burn_sg_fcntl_f_setlk
extern

Definition at line 57 of file init.c.

Referenced by burn_preset_device_open(), and sg_fcntl_lock().

◆ burn_sg_log_scsi

int burn_sg_log_scsi
extern

Definition at line 110 of file init.c.

Referenced by sg_issue_command(), and sgio_log_cmd().

◆ burn_sg_open_abort_busy

int burn_sg_open_abort_busy
extern

Definition at line 77 of file init.c.

Referenced by burn_preset_device_open(), and sg_handle_busy_device().

◆ burn_sg_open_o_excl

int burn_sg_open_o_excl
extern

Definition at line 53 of file init.c.

Referenced by is_scsi_drive(), sg_grab(), sg_obtain_scsi_adr_fd(), and sg_open_drive_fd().

◆ burn_sg_open_o_nonblock

int burn_sg_open_o_nonblock
extern

Definition at line 72 of file init.c.

Referenced by burn_preset_device_open(), sg_grab(), sg_obtain_scsi_adr_fd(), and sg_open_drive_fd().

◆ burn_sg_use_family

int burn_sg_use_family
extern

◆ libdax_messenger

struct libdax_msgs* libdax_messenger
extern

PORTING : ---— libburn portable headers and definitions --—

PORTING : ----— OS dependent headers and definitions ---— PORTING : ---— libburn portable headers and definitions --—

Definition at line 42 of file init.c.

Referenced by burn_os_alloc_buffer(), burn_os_open_track_src(), evaluate_transport_success(), fname_enumerate(), proc_sys_dev_cdrom_info(), react_on_drive_loss(), sg_close_drive_fd(), sg_exchange_scd_for_sr(), sg_fcntl_lock(), sg_grab(), sg_handle_busy_device(), sg_issue_command(), sg_open_drive_fd(), sg_open_scsi_siblings(), sg_os_revalidate_disc(), sg_release_siblings(), sgio_inquiry_cd_drive(), and single_enumerate().

◆ linux_ata_device_family

char linux_ata_device_family[80] = {"/dev/hd%c"}
static

Definition at line 224 of file sg-linux.c.

Referenced by ata_enumerate(), sg_give_next_adr(), and sg_obtain_scsi_adr_fd().

◆ linux_ata_enumerate_verbose

int linux_ata_enumerate_verbose = 0
static

Definition at line 228 of file sg-linux.c.

Referenced by ata_enumerate(), is_ata_drive(), and sg_open_for_enumeration().

◆ linux_sg_accept_any_type

int linux_sg_accept_any_type = 0
static

Definition at line 215 of file sg-linux.c.

Referenced by is_scsi_drive().

◆ linux_sg_auto_family

int linux_sg_auto_family = 1
static

Definition at line 208 of file sg-linux.c.

Referenced by sg_select_device_family().

◆ linux_sg_device_family

char linux_sg_device_family[80] = {"/dev/sg%d"}
static

◆ linux_sg_enumerate_debug

int linux_sg_enumerate_debug = 0
static

PORTING : Device file families for bus scanning and drive access. Both device families must support the following ioctls: SG_IO, SG_GET_SCSI_ID SCSI_IOCTL_GET_BUS_NUMBER SCSI_IOCTL_GET_IDLUN as well as mutual exclusively locking with open(O_EXCL). If a device family is left empty, then it will not be used.

To avoid misunderstandings: both families are used via identical transport methods as soon as a device file is accepted as CD drive by the family specific function <family>_enumerate(). One difference remains throughout usage: Host,Channel,Id,Lun and Bus address parameters of ATA devices are considered invalid.

Definition at line 187 of file sg-linux.c.

Referenced by fname_enumerate(), is_scsi_drive(), sg_enumerate(), and sg_open_for_enumeration().

◆ sg_kernel_age

int sg_kernel_age = -1
static

Indication of the Linux kernel this software is running on

Definition at line 167 of file sg-linux.c.

Referenced by proc_sys_dev_cdrom_info(), sg_evaluate_kernel(), and sg_select_device_family().