smartmontools SVN Rev 3317
Utility to control and monitor storage systems with "S.M.A.R.T."
Classes | Namespaces | Defines | Functions | Variables
os_linux.cpp File Reference
#include "config.h"
#include <errno.h>
#include <fcntl.h>
#include <glob.h>
#include <scsi/scsi.h>
#include <scsi/scsi_ioctl.h>
#include <scsi/sg.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <unistd.h>
#include <stddef.h>
#include <sys/uio.h>
#include <sys/types.h>
#include <dirent.h>
#include <sys/sysmacros.h>
#include "int64.h"
#include "atacmds.h"
#include "os_linux.h"
#include "scsicmds.h"
#include "utility.h"
#include "cciss.h"
#include "megaraid.h"
#include "aacraid.h"
#include "dev_interface.h"
#include "dev_ata_cmd_set.h"
#include "dev_areca.h"
Include dependency graph for os_linux.cpp:

Go to the source code of this file.

Classes

class  os_linux::linux_smart_device
 Shared open/close routines. More...
class  os_linux::linux_ata_device
 Linux ATA support. More...
struct  os_linux::linux_ioctl_send_command
class  os_linux::linux_scsi_device
 Standard SCSI support. More...
class  os_linux::linux_aacraid_device
 PMC AacRAID support. More...
class  os_linux::linux_megaraid_device
 LSI MegaRAID support. More...
class  os_linux::linux_escalade_device
 CCISS RAID support. More...
class  os_linux::linux_areca_ata_device
 Areca RAID support. More...
class  os_linux::linux_areca_scsi_device
class  os_linux::linux_marvell_device
 Marvell support. More...
class  os_linux::linux_highpoint_device
 Highpoint RAID support. More...
class  os_linux::linux_smart_interface
 Linux interface. More...

Namespaces

namespace  os_linux

Defines

#define ENOTSUP   ENOSYS
#define ARGUSED(x)   ((void)(x))
#define BUFFER_LENGTH   (4+512)
#define MAX_DXFER_LEN   1024
#define SEND_IOCTL_RESP_SENSE_LEN   16
#define SG_IO_RESP_SENSE_LEN   64
#define LSCSI_DRIVER_MASK   0xf
#define LSCSI_DRIVER_SENSE   0x8
#define LSCSI_DID_ERROR   0x7
#define LSCSI_DRIVER_TIMEOUT   0x6
#define LSCSI_DID_TIME_OUT   0x3
#define LSCSI_DID_BUS_BUSY   0x2
#define LSCSI_DID_NO_CONNECT   0x1
#define SCSI_IOCTL_SEND_COMMAND   1
#define SG_IO_PRESENT_UNKNOWN   0
#define SG_IO_PRESENT_YES   1
#define SG_IO_PRESENT_NO   2
#define MAJOR_STRING_LENGTH   3
#define DEVICE_STRING_LENGTH   32
#define NODE_STRING_LENGTH   16
#define BUFFER_LEN_678K   ( sizeof(TW_Ioctl) )
#define BUFFER_LEN_678K_CHAR   ( sizeof(TW_New_Ioctl)+512-1 )
#define BUFFER_LEN_9000   ( sizeof(TW_Ioctl_Buf_Apache)+512-1 )
#define TW_IOCTL_BUFFER_SIZE   ( MAX(MAX(BUFFER_LEN_678K, BUFFER_LEN_9000), BUFFER_LEN_678K_CHAR) )
#define STRANGE_BUFFER_LENGTH   (4+512*0xf8)

Functions

static int os_linux::sg_io_cmnd_io (int dev_fd, struct scsi_cmnd_io *iop, int report, int unknown)
static int os_linux::sisc_cmnd_io (int dev_fd, struct scsi_cmnd_io *iop, int report)
static int os_linux::do_normal_scsi_cmnd_io (int dev_fd, struct scsi_cmnd_io *iop, int report)
static int os_linux::setup_3ware_nodes (const char *nodename, const char *driver_name)
static int os_linux::find_areca_in_proc ()
static bool os_linux::read_id (const std::string &path, unsigned short &id)
static bool os_linux::get_usb_id (const char *name, unsigned short &vendor_id, unsigned short &product_id, unsigned short &version)
static unsigned os_linux::get_kernel_release ()

Variables

const char * os_linux_cpp_cvsid
unsigned char failuretest_permissive
static const char os_linux::smartctl_examples [] = " on Areca RAID controller)\n"
static int os_linux::sg_io_state = SG_IO_PRESENT_UNKNOWN

Define Documentation

#define ARGUSED (   x)    ((void)(x))

Definition at line 100 of file os_linux.cpp.

#define BUFFER_LEN_678K   ( sizeof(TW_Ioctl) )

Definition at line 1669 of file os_linux.cpp.

#define BUFFER_LEN_678K_CHAR   ( sizeof(TW_New_Ioctl)+512-1 )

Definition at line 1670 of file os_linux.cpp.

#define BUFFER_LEN_9000   ( sizeof(TW_Ioctl_Buf_Apache)+512-1 )

Definition at line 1671 of file os_linux.cpp.

#define BUFFER_LENGTH   (4+512)

Definition at line 256 of file os_linux.cpp.

#define DEVICE_STRING_LENGTH   32

Definition at line 1477 of file os_linux.cpp.

#define ENOTSUP   ENOSYS

Definition at line 97 of file os_linux.cpp.

#define LSCSI_DID_BUS_BUSY   0x2

Definition at line 506 of file os_linux.cpp.

#define LSCSI_DID_ERROR   0x7

Definition at line 503 of file os_linux.cpp.

#define LSCSI_DID_NO_CONNECT   0x1

Definition at line 507 of file os_linux.cpp.

#define LSCSI_DID_TIME_OUT   0x3

Definition at line 505 of file os_linux.cpp.

#define LSCSI_DRIVER_MASK   0xf

Definition at line 501 of file os_linux.cpp.

#define LSCSI_DRIVER_SENSE   0x8

Definition at line 502 of file os_linux.cpp.

#define LSCSI_DRIVER_TIMEOUT   0x6

Definition at line 504 of file os_linux.cpp.

#define MAJOR_STRING_LENGTH   3

Definition at line 1476 of file os_linux.cpp.

#define MAX_DXFER_LEN   1024

Definition at line 498 of file os_linux.cpp.

#define NODE_STRING_LENGTH   16

Definition at line 1478 of file os_linux.cpp.

#define SCSI_IOCTL_SEND_COMMAND   1

Definition at line 510 of file os_linux.cpp.

#define SEND_IOCTL_RESP_SENSE_LEN   16

Definition at line 499 of file os_linux.cpp.

#define SG_IO_PRESENT_NO   2

Definition at line 515 of file os_linux.cpp.

#define SG_IO_PRESENT_UNKNOWN   0

Definition at line 513 of file os_linux.cpp.

#define SG_IO_PRESENT_YES   1

Definition at line 514 of file os_linux.cpp.

#define SG_IO_RESP_SENSE_LEN   64

Definition at line 500 of file os_linux.cpp.

#define STRANGE_BUFFER_LENGTH   (4+512*0xf8)

Definition at line 2261 of file os_linux.cpp.

#define TW_IOCTL_BUFFER_SIZE   ( MAX(MAX(BUFFER_LEN_678K, BUFFER_LEN_9000), BUFFER_LEN_678K_CHAR) )

Definition at line 1672 of file os_linux.cpp.


Variable Documentation

unsigned char failuretest_permissive

Definition at line 1110 of file smartctl.cpp.

const char* os_linux_cpp_cvsid
Initial value:
"$Id: os_linux.cpp 3900 2014-05-01 17:08:59Z chrfranke $"
  OS_LINUX_H_CVSID

Definition at line 102 of file os_linux.cpp.