// /*************************************************************************** // The Disc Image Chef // ---------------------------------------------------------------------------- // // Filename : Enums.cs // Author(s) : Natalia Portillo // // Component : FreeBSD direct device access. // // --[ Description ] ---------------------------------------------------------- // // Contains enumerations necessary for directly interfacing devices under // FreeBSD. // // --[ License ] -------------------------------------------------------------- // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 2.1 of the // License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, see . // // ---------------------------------------------------------------------------- // Copyright © 2011-2017 Natalia Portillo // ****************************************************************************/ using System; namespace DiscImageChef.Devices.FreeBSD { [Flags] enum FileFlags { /// /// O_RDONLY /// ReadOnly = 0x00000000, /// /// O_WRONLY /// WriteOnly = 0x00000001, /// /// O_RDWR /// ReadWrite = 0x00000002, /// /// O_NONBLOCK /// NonBlocking = 0x00000004, /// /// O_APPEND /// Append = 0x00000008, /// /// O_SHLOCK /// SharedLock = 0x00000010, /// /// O_EXLOCK /// ExclusiveLock = 0x00000020, /// /// O_ASYNC /// Async = 0x00000040, /// /// O_FSYNC /// SyncWrites = 0x00000080, /// /// O_NOFOLLOW /// NoFollowSymlink = 0x00000100, /// /// O_CREAT /// OpenOrCreate = 0x00000200, /// /// O_TRUNC /// Truncate = 0x00000400, /// /// O_EXCL /// CreateNew = 0x00000800, /// /// O_NOCTTY /// NoControlTTY = 0x00008000, /// /// O_DIRECT /// Direct = 0x00010000, /// /// O_DIRECTORY /// Directory = 0x00020000, /// /// O_EXEC /// Execute = 0x00040000, /// /// O_TTY_INIT /// InitializeTTY = 0x00080000, /// /// O_CLOEXEC /// CloseOnExec = 0x00100000 } [Flags] enum CamAtaIoFlags : byte { /// /// 48-bit command /// ExtendedCommand = 0x01, /// /// FPDMA command /// FPDMA = 0x02, /// /// Control, not a command /// Control = 0x04, /// /// Needs result /// NeedResult = 0x08, /// /// DMA command /// DMA = 0x10 } /// XPT Opcodes for xpt_action [Flags] enum xpt_opcode { // Function code flags are bits greater than 0xff /// Non-immediate function code XPT_FC_QUEUED = 0x100, XPT_FC_USER_CCB = 0x200, /// Only for the transport layer device XPT_FC_XPT_ONLY = 0x400, /// Passes through the device queues XPT_FC_DEV_QUEUED = 0x800 | XPT_FC_QUEUED, // Common function commands: 0x00->0x0F /// Execute Nothing XPT_NOOP = 0x00, /// Execute the requested I/O operation XPT_SCSI_IO = 0x01 | XPT_FC_DEV_QUEUED, /// Get type information for specified device XPT_GDEV_TYPE = 0x02, /// Get a list of peripheral devices XPT_GDEVLIST = 0x03, /// Path routing inquiry XPT_PATH_INQ = 0x04, /// Release a frozen device queue XPT_REL_SIMQ = 0x05, /// Set Asynchronous Callback Parameters XPT_SASYNC_CB = 0x06, /// Set device type information XPT_SDEV_TYPE = 0x07, /// (Re)Scan the SCSI Bus XPT_SCAN_BUS = 0x08 | XPT_FC_QUEUED | XPT_FC_USER_CCB | XPT_FC_XPT_ONLY, /// Get EDT entries matching the given pattern XPT_DEV_MATCH = 0x09 | XPT_FC_XPT_ONLY, /// Turn on debugging for a bus, target or lun XPT_DEBUG = 0x0a, /// Path statistics (error counts, etc.) XPT_PATH_STATS = 0x0b, /// Device statistics (error counts, etc.) XPT_GDEV_STATS = 0x0c, /// Get/Set Device advanced information XPT_DEV_ADVINFO = 0x0e, /// Asynchronous event XPT_ASYNC = 0x0f | XPT_FC_QUEUED | XPT_FC_USER_CCB | XPT_FC_XPT_ONLY, /// SCSI Control Functions: 0x10->0x1F /// Abort the specified CCB XPT_ABORT = 0x10, /// Reset the specified SCSI bus XPT_RESET_BUS = 0x11 | XPT_FC_XPT_ONLY, /// Bus Device Reset the specified SCSI device XPT_RESET_DEV = 0x12 | XPT_FC_DEV_QUEUED, /// Terminate the I/O process XPT_TERM_IO = 0x13, /// Scan Logical Unit XPT_SCAN_LUN = 0x14 | XPT_FC_QUEUED | XPT_FC_USER_CCB | XPT_FC_XPT_ONLY, /// Get default/user transfer settings for the target XPT_GET_TRAN_SETTINGS = 0x15, /// Set transfer rate/width negotiation settings XPT_SET_TRAN_SETTINGS = 0x16, /// Calculate the geometry parameters for a device give the sector size and volume size. XPT_CALC_GEOMETRY = 0x17, /// Execute the requested ATA I/O operation XPT_ATA_IO = 0x18 | XPT_FC_DEV_QUEUED, /// Compat only XPT_GET_SIM_KNOB_OLD = 0x18, /// Set SIM specific knob values. XPT_SET_SIM_KNOB = 0x19, /// Get SIM specific knob values. XPT_GET_SIM_KNOB = 0x1a, /// Serial Management Protocol XPT_SMP_IO = 0x1b | XPT_FC_DEV_QUEUED, /// Scan Target XPT_SCAN_TGT = 0x1E | XPT_FC_QUEUED | XPT_FC_USER_CCB | XPT_FC_XPT_ONLY, // HBA engine commands 0x20->0x2F /// HBA engine feature inquiry XPT_ENG_INQ = 0x20 | XPT_FC_XPT_ONLY, /// HBA execute engine request XPT_ENG_EXEC = 0x21 | XPT_FC_DEV_QUEUED, // Target mode commands: 0x30->0x3F /// Enable LUN as a target XPT_EN_LUN = 0x30, /// Execute target I/O request XPT_TARGET_IO = 0x31 | XPT_FC_DEV_QUEUED, /// Accept Host Target Mode CDB XPT_ACCEPT_TARGET_IO = 0x32 | XPT_FC_QUEUED | XPT_FC_USER_CCB, /// Continue Host Target I/O Connection XPT_CONT_TARGET_IO = 0x33 | XPT_FC_DEV_QUEUED, /// Notify Host Target driver of event (obsolete) XPT_IMMED_NOTIFY = 0x34 | XPT_FC_QUEUED | XPT_FC_USER_CCB, /// Acknowledgement of event (obsolete) XPT_NOTIFY_ACK = 0x35, /// Notify Host Target driver of event XPT_IMMEDIATE_NOTIFY = 0x36 | XPT_FC_QUEUED | XPT_FC_USER_CCB, /// Acknowledgement of event XPT_NOTIFY_ACKNOWLEDGE = 0x37 | XPT_FC_QUEUED | XPT_FC_USER_CCB, /// Vendor Unique codes: 0x80->0x8F XPT_VUNIQUE = 0x80 } }