smartmontools  SVN Rev 5304
Utility to control and monitor storage systems with "S.M.A.R.T."
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
os_freebsd::freebsd_smart_interface Class Reference

Implement platform interface with old functions. More...

Collaboration diagram for os_freebsd::freebsd_smart_interface:
Collaboration graph
[legend]

Public Member Functions

virtual std::string get_os_version_str () override
 Return info string about build host and/or OS version. More...
 
virtual std::string get_app_examples (const char *appname) override
 Return example string for program 'appname'. More...
 
virtual bool scan_smart_devices (smart_device_list &devlist, const char *type, const char *pattern=0) override
 Fill 'devlist' with devices of some 'type' with device names specified by some optional 'pattern'. More...
 
- Public Member Functions inherited from smart_interface
 smart_interface ()
 
virtual ~smart_interface ()
 
virtual std::string get_valid_dev_types_str ()
 Return valid args for device type option/directive. More...
 
virtual bool disable_system_auto_standby (bool disable)
 Disable/Enable system auto standby/sleep mode. More...
 
const smart_device::error_infoget_err () const
 Get last error info struct. More...
 
int get_errno () const
 Get last error number. More...
 
const char * get_errmsg () const
 Get last error message. More...
 
bool set_err (int no, const char *msg,...) __attribute_format_printf(3
 Set last error number and message. More...
 
bool bool set_err (const smart_device::error_info &err)
 Set last error info struct. More...
 
void clear_err ()
 Clear last error info. More...
 
bool set_err (int no)
 Set last error number and default message. More...
 
bool set_err_var (smart_device::error_info *err, int no)
 Set last error number and default message to any error_info. More...
 
virtual const char * get_msg_for_errno (int no)
 Convert error number into message, used by set_err(no). More...
 
virtual smart_deviceget_smart_device (const char *name, const char *type)
 Return device object for device 'name' with some 'type'. More...
 
virtual bool scan_smart_devices (smart_device_list &devlist, const smart_devtype_list &types, const char *pattern=0)
 Fill 'devlist' with devices of all 'types' with device names specified by some optional 'pattern'. More...
 
virtual std::string get_unique_dev_name (const char *name, const char *type) const
 Return unique device name which is (only) suitable for duplicate detection. More...
 
virtual bool is_raid_dev_type (const char *type) const
 Return true if the 'type' string contains a RAID drive number. More...
 
virtual ata_deviceautodetect_sat_device (scsi_device *scsidev, const unsigned char *inqdata, unsigned inqsize)
 Try to detect a SAT device behind a SCSI interface. More...
 
virtual const char * get_usb_dev_type_by_id (int vendor_id, int product_id, int version=-1)
 Get type name for USB device with known VENDOR:PRODUCT ID. More...
 

Protected Member Functions

virtual ata_deviceget_ata_device (const char *name, const char *type) override
 Return standard ATA device. More...
 
virtual scsi_deviceget_scsi_device (const char *name, const char *type) override
 Return standard SCSI device. More...
 
virtual nvme_deviceget_nvme_device (const char *name, const char *type, unsigned nsid) override
 Return standard NVMe device. More...
 
virtual smart_deviceautodetect_smart_device (const char *name) override
 Autodetect device if no device type specified. More...
 
virtual smart_deviceget_custom_smart_device (const char *name, const char *type) override
 Return device for platform specific 'type'. More...
 
virtual std::string get_valid_custom_dev_types_str () override
 Return valid 'type' args accepted by above. More...
 
- Protected Member Functions inherited from smart_interface
virtual smart_deviceget_scsi_passthrough_device (const char *type, scsi_device *scsidev)
 Return ATA->SCSI of NVMe->SCSI filter for a SAT, SNT or USB 'type'. More...
 
virtual ata_deviceget_sat_device (const char *type, scsi_device *scsidev)
 Return ATA->SCSI filter for a SAT or USB 'type'. More...
 
virtual nvme_deviceget_snt_device (const char *type, scsi_device *scsidev)
 Return NVMe->SCSI filter for a SNT or USB 'type'. More...
 
virtual ata_deviceget_intelliprop_device (const char *type, ata_device *atadev)
 Return filter for Intelliprop controllers. More...
 
virtual ata_deviceget_jmb39x_device (const char *type, smart_device *smartdev)
 Return JMB93x->ATA filter. More...
 

Private Member Functions

bool get_nvme_devlist (smart_device_list &devlist, const char *type)
 
bool get_dev_megaraid (smart_device_list &devlist)
 
int megaraid_pd_add_list (const char *devname, smart_device_list &devlist)
 
int megaraid_dcmd_cmd (const char *devname, uint32_t opcode, void *buf, size_t bufsize, uint8_t *mbox, size_t mboxlen, uint8_t *statusp)
 

Additional Inherited Members

- Static Public Member Functions inherited from smart_interface
static void init ()
 Initialize platform interface and register with smi(). More...
 
- Static Protected Member Functions inherited from smart_interface
static void set (smart_interface *intf)
 Set interface to use, must be called from init(). More...
 

Detailed Description

Implement platform interface with old functions.

Definition at line 1670 of file os_freebsd.cpp.

Member Function Documentation

◆ autodetect_smart_device()

smart_device * os_freebsd::freebsd_smart_interface::autodetect_smart_device ( const char *  name)
overrideprotectedvirtual

Autodetect device if no device type specified.

Implements smart_interface.

Definition at line 2296 of file os_freebsd.cpp.

◆ get_app_examples()

std::string os_freebsd::freebsd_smart_interface::get_app_examples ( const char *  appname)
overridevirtual

Return example string for program 'appname'.

Default implementation returns empty string. For the migration of print_smartctl_examples(), function is allowed to print examples to stdout. TODO: Remove this hack.

Reimplemented from smart_interface.

Definition at line 1716 of file os_freebsd.cpp.

◆ get_ata_device()

ata_device * os_freebsd::freebsd_smart_interface::get_ata_device ( const char *  name,
const char *  type 
)
overrideprotectedvirtual

Return standard ATA device.

Implements smart_interface.

Definition at line 1723 of file os_freebsd.cpp.

◆ get_custom_smart_device()

smart_device * os_freebsd::freebsd_smart_interface::get_custom_smart_device ( const char *  name,
const char *  type 
)
overrideprotectedvirtual

Return device for platform specific 'type'.

Default implementation returns 0.

Reimplemented from smart_interface.

Definition at line 2417 of file os_freebsd.cpp.

◆ get_dev_megaraid()

bool os_freebsd::freebsd_smart_interface::get_dev_megaraid ( smart_device_list devlist)
private

Definition at line 2055 of file os_freebsd.cpp.

◆ get_nvme_device()

nvme_device * os_freebsd::freebsd_smart_interface::get_nvme_device ( const char *  name,
const char *  type,
unsigned  nsid 
)
overrideprotectedvirtual

Return standard NVMe device.

Default implementation returns 0.

Reimplemented from smart_interface.

Definition at line 1740 of file os_freebsd.cpp.

◆ get_nvme_devlist()

bool os_freebsd::freebsd_smart_interface::get_nvme_devlist ( smart_device_list devlist,
const char *  type 
)
private

Definition at line 2034 of file os_freebsd.cpp.

◆ get_os_version_str()

std::string os_freebsd::freebsd_smart_interface::get_os_version_str ( )
overridevirtual

Return info string about build host and/or OS version.

Default implementation returns SMARTMONTOOLS_BUILD_HOST.

Reimplemented from smart_interface.

Definition at line 1709 of file os_freebsd.cpp.

◆ get_scsi_device()

scsi_device * os_freebsd::freebsd_smart_interface::get_scsi_device ( const char *  name,
const char *  type 
)
overrideprotectedvirtual

Return standard SCSI device.

Implements smart_interface.

Definition at line 1735 of file os_freebsd.cpp.

◆ get_valid_custom_dev_types_str()

std::string os_freebsd::freebsd_smart_interface::get_valid_custom_dev_types_str ( )
overrideprotectedvirtual

Return valid 'type' args accepted by above.

This is called in get_valid_dev_types_str(). Default implementation returns empty string.

Reimplemented from smart_interface.

Definition at line 2518 of file os_freebsd.cpp.

◆ megaraid_dcmd_cmd()

int os_freebsd::freebsd_smart_interface::megaraid_dcmd_cmd ( const char *  devname,
uint32_t  opcode,
void *  buf,
size_t  bufsize,
uint8_t *  mbox,
size_t  mboxlen,
uint8_t *  statusp 
)
private

Definition at line 2071 of file os_freebsd.cpp.

◆ megaraid_pd_add_list()

int os_freebsd::freebsd_smart_interface::megaraid_pd_add_list ( const char *  devname,
smart_device_list devlist 
)
private

Definition at line 2128 of file os_freebsd.cpp.

◆ scan_smart_devices()

bool os_freebsd::freebsd_smart_interface::scan_smart_devices ( smart_device_list devlist,
const char *  type,
const char *  pattern = 0 
)
overridevirtual

Fill 'devlist' with devices of some 'type' with device names specified by some optional 'pattern'.

Use platform specific default if 'type' is empty or 0. Return false on error. Default implementation returns false;

Reimplemented from smart_interface.

Definition at line 1969 of file os_freebsd.cpp.


The documentation for this class was generated from the following file: