smartmontools SVN Rev 5612
Utility to control and monitor storage systems with "S.M.A.R.T."
Classes | Namespaces | Macros | Functions | Variables
os_freebsd.cpp File Reference
#include <sys/param.h>
#include <sys/endian.h>
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
#include <fcntl.h>
#include <err.h>
#include <errno.h>
#include <camlib.h>
#include <cam/scsi/scsi_message.h>
#include <cam/scsi/scsi_pass.h>
#include <sys/ata.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/uio.h>
#include <glob.h>
#include <stddef.h>
#include <paths.h>
#include <sys/utsname.h>
#include "config.h"
#include "atacmds.h"
#include "scsicmds.h"
#include "cciss.h"
#include "utility.h"
#include "os_freebsd.h"
#include "dev_interface.h"
#include "dev_ata_cmd_set.h"
#include "dev_areca.h"
#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>
#include "freebsd_nvme_ioctl.h"
Include dependency graph for os_freebsd.cpp:

Go to the source code of this file.

Classes

class  os_freebsd::freebsd_smart_device
 Implement shared open/close routines with old functions. More...
 
class  os_freebsd::freebsd_ata_device
 Implement standard ATA support. More...
 
class  os_freebsd::freebsd_nvme_device
 NVMe support. More...
 
class  os_freebsd::freebsd_escalade_device
 Implement AMCC/3ware RAID support. More...
 
class  os_freebsd::freebsd_megaraid_device
 LSI MegaRAID support. More...
 
class  os_freebsd::freebsd_highpoint_device
 Implement Highpoint RAID support with old functions. More...
 
class  os_freebsd::freebsd_scsi_device
 Standard SCSI support. More...
 
class  os_freebsd::freebsd_areca_ata_device
 Areca RAID support. More...
 
class  os_freebsd::freebsd_areca_scsi_device
 
class  os_freebsd::freebsd_cciss_device
 Implement CCISS RAID support with old functions. More...
 
class  os_freebsd::freebsd_smart_interface
 Implement platform interface with old functions. More...
 

Namespaces

namespace  os_freebsd
 

Macros

#define USBDEV   "/dev/usb"
 
#define FREEBSDVER   __FreeBSD_kernel_version
 
#define CONTROLLER_3WARE_9000_CHAR   0x01
 
#define CONTROLLER_3WARE_678K_CHAR   0x02
 
#define PATHINQ_SETTINGS_SIZE   128
 
#define NO_RETURN   0
 
#define BAD_SMART   1
 
#define NO_DISK_3WARE   2
 
#define BAD_KERNEL   3
 
#define MAX_MSG   3
 
#define BUFFER_LEN_678K_CHAR   ( sizeof(struct twe_usercommand) )
 
#define BUFFER_LEN_9000_CHAR   ( sizeof(TW_OSLI_IOCTL_NO_DATA_BUF) + sizeof(TWE_Command) )
 
#define TW_IOCTL_BUFFER_SIZE   ( MAX(BUFFER_LEN_678K_CHAR, BUFFER_LEN_9000_CHAR) )
 
#define ATA_DEVICE   "/dev/ata"
 
#define ARGUSED(x)   ((void)(x))
 

Functions

void printwarning (int msgNo, const char *extra)
 
bool os_freebsd::get_dev_names_cam (std::vector< std::string > &names, bool show_all)
 
int os_freebsd::get_dev_names_ata (char ***names)
 
static int os_freebsd::usbdevinfo (int f, int a, int rec, int busno, unsigned short &vendor_id, unsigned short &product_id, unsigned short &version)
 
static int os_freebsd::usbdevlist (int busno, unsigned short &vendor_id, unsigned short &product_id, unsigned short &version)
 

Variables

const char * os_XXXX_c_cvsid
 
unsigned char failuretest_permissive
 
unsigned char os_freebsd::m_controller_type
 
unsigned char os_freebsd::m_controller_port
 
static const char os_freebsd::smartctl_examples []
 
static char os_freebsd::done [USB_MAX_DEVICES]
 

Macro Definition Documentation

◆ ARGUSED

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

Definition at line 124 of file os_freebsd.cpp.

◆ ATA_DEVICE

#define ATA_DEVICE   "/dev/ata"

Definition at line 121 of file os_freebsd.cpp.

◆ BAD_KERNEL

#define BAD_KERNEL   3

Definition at line 85 of file os_freebsd.cpp.

◆ BAD_SMART

#define BAD_SMART   1

Definition at line 83 of file os_freebsd.cpp.

◆ BUFFER_LEN_678K_CHAR

#define BUFFER_LEN_678K_CHAR   ( sizeof(struct twe_usercommand) )

Definition at line 116 of file os_freebsd.cpp.

◆ BUFFER_LEN_9000_CHAR

#define BUFFER_LEN_9000_CHAR   ( sizeof(TW_OSLI_IOCTL_NO_DATA_BUF) + sizeof(TWE_Command) )

Definition at line 117 of file os_freebsd.cpp.

◆ CONTROLLER_3WARE_678K_CHAR

#define CONTROLLER_3WARE_678K_CHAR   0x02

Definition at line 73 of file os_freebsd.cpp.

◆ CONTROLLER_3WARE_9000_CHAR

#define CONTROLLER_3WARE_9000_CHAR   0x01

Definition at line 72 of file os_freebsd.cpp.

◆ FREEBSDVER

#define FREEBSDVER   __FreeBSD_kernel_version

Definition at line 55 of file os_freebsd.cpp.

◆ MAX_MSG

#define MAX_MSG   3

Definition at line 86 of file os_freebsd.cpp.

◆ NO_DISK_3WARE

#define NO_DISK_3WARE   2

Definition at line 84 of file os_freebsd.cpp.

◆ NO_RETURN

#define NO_RETURN   0

Definition at line 82 of file os_freebsd.cpp.

◆ PATHINQ_SETTINGS_SIZE

#define PATHINQ_SETTINGS_SIZE   128

Definition at line 76 of file os_freebsd.cpp.

◆ TW_IOCTL_BUFFER_SIZE

#define TW_IOCTL_BUFFER_SIZE   ( MAX(BUFFER_LEN_678K_CHAR, BUFFER_LEN_9000_CHAR) )

Definition at line 118 of file os_freebsd.cpp.

◆ USBDEV

#define USBDEV   "/dev/usb"

Definition at line 49 of file os_freebsd.cpp.

Function Documentation

◆ printwarning()

void printwarning ( int  msgNo,
const char *  extra 
)

Definition at line 89 of file os_freebsd.cpp.

Variable Documentation

◆ failuretest_permissive

unsigned char failuretest_permissive
extern

Definition at line 1456 of file smartctl.cpp.

◆ os_XXXX_c_cvsid

const char* os_XXXX_c_cvsid
Initial value:
="$Id: os_freebsd.cpp 5468 2023-03-14 20:01:29Z chrfranke $"
#define ATACMDS_H_CVSID
Definition: atacmds.h:16
#define CCISS_H_CVSID
Definition: cciss.h:14
#define OS_FREEBSD_H_CVSID
Definition: os_freebsd.h:72
#define SCSICMDS_H_CVSID
Definition: scsicmds.h:22
#define UTILITY_H_CVSID
Definition: utility.h:16

Definition at line 79 of file os_freebsd.cpp.