text:
namespace scsi {

using LunAddress = uint64_t;

// SAM-4 Table 33
enum class Status : uint8_t {
  kGood = 0x0,
  kCheckCondition = 0x2,
  kConditionMet = 0x4,
  kBusy = 0x8,
  kIntermediate = 0x10,              // obsolete
  kIntermediateConditionMet = 0x14,  // obsolete
  kReservationConflict = 0x18,
  kCommandTerminated = 0x22,  // obsolete
  kTaskSetFull = 0x28,
  kAcaActive = 0x30,
  kTaskAborted = 0x40,
};

// SCSI Reference Manual Table 11
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class SenseResponse : uint8_t {
  kCurrentFixedError = 0x70,
  kDeferredFixedError = 0x71,
  kCurrentDescriptorError = 0x72,
  kDeferredDescriptorError = 0x73,
};

// SCSI Reference Manual Table 28
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class SenseKey : uint8_t {
  kNoSense = 0x0,
  kRecoveredError = 0x1,
  kNotReady = 0x2,
  kMediumError = 0x3,
  kHardwareError = 0x4,
  kIllegalRequest = 0x5,
  kUnitAttention = 0x6,
  kDataProtect = 0x7,
  kBlankCheck = 0x8,
  kVendorSpecific = 0x9,
  kCopyAborted = 0xa,
  kAbortedCommand = 0xb,
  kReserved = 0xc,
  kVolumeOverflow = 0xd,
  kMiscompare = 0xe,
  kCompleted = 0xf,
};

// SCSI Reference Manual Table 29
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class AdditionalSenseCode : uint8_t {
  kNoAdditionalSenseInfo = 0x0,
  kPeripheralDeviceWriteFault = 0x03,
  kLogicalUnitNotReadyCauseNotReportable = 0x04,
  kWarningPowerLossExpected = 0x0b,
  kLogicalBlockGuardCheckFailed = 0x10,
  kLogicalBlockApplicationTagCheckFailed = 0x10,
  kLogicalBlockReferenceTagCheckFailed = 0x10,
  kUnrecoveredReadError = 0x11,
  kMiscompareDuringVerifyOp = 0x1d,
  kAccessDeniedInvalidLuIdentifier = 0x20,
  kInvalidCommandOpCode = 0x20,
  kLbaOutOfRange = 0x21,
  kInvalidFieldInCdb = 0x24,
  kFormatCommandFailed = 0x31,
  kInternalTargetFailure = 0x44,
};

// SCSI Reference Manual Table 29
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
// Listed in the same order as the AdditionalSenseCode counterparts
enum class AdditionalSenseCodeQualifier : uint8_t {
  kNoAdditionalSenseInfo = 0x0,
  kPeripheralDeviceWriteFault = 0x0,
  kLogicalUnitNotReadyCauseNotReportable = 0x0,
  kWarningPowerLossExpected = 0x08,
  kLogicalBlockGuardCheckFailed = 0x01,
  kLogicalBlockApplicationTagCheckFailed = 0x02,
  kLogicalBlockReferenceTagCheckFailed = 0x03,
  kUnrecoveredReadError = 0x0,
  kMiscompareDuringVerifyOp = 0x0,
  kAccessDeniedInvalidLuIdentifier = 0x09,
  kInvalidCommandOpCode = 0x0,
  kLbaOutOfRange = 0x0,
  kInvalidFieldInCdb = 0x0,
  kFormatCommandFailed = 0x01,
  kInternalTargetFailure = 0x0,
};

// SCSI Reference Manual Table 61
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class PeripheralDeviceType : uint8_t {
  kDirectAccessBlock = 0x0,
  kSequentialAccess = 0x1,
  kPrinter = 0x2,
  kProcessor = 0x3,
  kWriteOnce = 0x4,
  kCdDvd = 0x5,
  kOpticalMemory = 0x7,
  kMediumChanger = 0x8,
  kStorageArrayController = 0xc,
  kEnclosureServices = 0xd,
  kSimplifiedDirectAccess = 0xe,
  kOpticalCardReaderWriter = 0xf,
  kBridgeControllerCommands = 0x10,
  kObjectBasedStorage = 0x11,
  kAutomationDriveInterface = 0x12,
  kWellKnownLogicalUnit = 0x1e,
  kUnknown = 0x1f,
};

// SCSI Reference Manual Table 62
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
// Field code of implemented version of the SPC standard
enum class Version : uint8_t {
  kNoStandard = 0x0,
  kSpc = 0x3,
  kSpc2 = 0x4,
  kSpc3 = 0x5,
  kSpc4 = 0x6,
  kSpc5 = 0x7,
};

// SCSI Reference Manual
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
// Operation codes defined for SCSI commands supported by this project; this
// list may increase
enum class OpCode : uint8_t {
  kTestUnitReady = 0x0,
  kRequestSense = 0x3,
  kRead6 = 0x08,
  kWrite6 = 0x0a,
  kInquiry = 0x12,
  kReserve6 = 0x16,
  kRelease6 = 0x17,
  kModeSense6 = 0x1a,
  kStartStopUnit = 0x1b,
  kDoPreventAllowMediumRemoval = 0x1e,
  kReadCapacity10 = 0x25,
  kRead10 = 0x28,
  kWrite10 = 0x2a,
  kVerify10 = 0x2f,
  kSync10 = 0x35,
  kUnmap = 0x42,
  kReadToc = 0x43,
  kModeSense10 = 0x5a,
  kPersistentReserveIn = 0x5e,
  kPersistentReserveOut = 0x5f,
  kRead32 = 0x7f,
  kWrite32 = 0x7f,
  kVerify32 = 0x7f,
  kRead16 = 0x88,
  kWrite16 = 0x8a,
  kVerify16 = 0x8f,
  kSync16 = 0x91,
  kWriteSame16 = 0x93,
  kServiceActionIn = 0x9e,
  kReportLuns = 0xa0,
  kMaintenanceIn = 0xa3,
  kRead12 = 0xa8,
  kWrite12 = 0xaa,
  kVerify12 = 0xaf,
};

// SCSI Reference Manual Table 359
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class ModePageCode : uint8_t {
  kNull = 0x00,
  kCacheMode = 0x08,
  kControlMode = 0x0a,
  kPowerConditionMode = 0x1a,
  kAllSupportedModes = 0x3f
};

enum class PageCode : uint8_t {
  kSupportedVpd = 0x00,
  kUnitSerialNumber = 0x80,
  kDeviceIdentification = 0x83,
  kExtended = 0x86,
  kBlockLimitsVpd = 0xb0,
  kBlockDeviceCharacteristicsVpd = 0xb1,
  kLogicalBlockProvisioningVpd = 0xb2
};

// SCSI Reference Manual Table 456
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class ActivateMicrocode : uint8_t {
  // The actions of the device server may or may not be as defined for values
  // 01b or 10b.
  kAmbiguous = 0b00,

  // The device server:
  // 1) activates the microcode before completion of the final command in the
  // WRITE BUFFER sequence; and
  // 2) establishes a unit attention condition for the initiator port associated
  // with every I_T nexus, except the I_T nexus on which the WRITE BUFFER
  // command was received, with the additional sense code set to MICROCODE HAS
  // BEEN CHANGED.
  kActivateBeforeHardReset = 0b01,

  // The device server:
  // 1) activates the microcode after:
  //    A) a vendor specific event;
  //    B) a power on event; or
  //    C) a hard reset event;
  // and
  // 2) establishes a unit attention condition for the initiator port associated
  //    with every I_T nexus with the additional sense code set to MICROCODE HAS
  //    BEEN CHANGED.
  kActivateAfterHardReset = 0b10,

  kReserved = 0b11,
};

// SCSI Reference Manual Table 461
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class Association : uint8_t {

  // The IDENTIFIER field is associated with the addressed physical or logical
  // device
  kPhysicalDevice = 0x0,

  // The IDENTIFIER field is associated with the port that received the request
  kPort = 0x1,

  // The IDENTIFIER field is associated with the SCSI target device that
  // contains the addressed logical unit.
  kScsiTargetDevice = 0x2,

  // Reserved code
  kReserved = 0x3
};

// SCSI Reference Manual, Section 5.4.11
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class CodeSet : uint8_t {
  kReserved = 0x0,

  // The IDENTIFIER field shall contain binary values
  kBinary = 0x1,

  // 2h The IDENTIFIER field shall contain ASCII graphic codes (i.e., code
  // values 20h through 7Eh)
  kASCII = 0x2,
};

// SCSI Reference Manual, Table 463
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class IdentifierType : uint8_t {
  // No assignment authority was used and consequently there is no guarantee
  // that the identifier is globally unique (i.e., the identifier is vendor
  // specific).
  kVendorSpecific1 = 0x0,

  // The first 8 bytes of the IDENTIFIER field are a Vendor ID. The organization
  // associated with the Vendor ID is responsible for ensuring that the
  // remainder of the identifier field is unique. One recommended method of
  // constructing the remainder of the identifier field is to concatenate the
  // product identification field from the standard INQUIRY data field and the
  // product serial number field from the unit serial number page
  kVendorSpecific2 = 0x1,

  // The IDENTIFIER field contains a Canonical form IEEE Extended Unique
  // Identifier, 64-bit (EUI-64). In this case, the identifier length field
  // shall be set to 8. Note that the IEEE guide-lines for EUI-64 specify a
  // method for unambiguously encapsulating an IEEE 48-bit identifier within an
  // EUI-64.
  kEUI64 = 0x2,

  // The IDENTIFIER field contains an FC-PH, FC-PH3 or FC-FS Name_Identifier.
  // Any FC-PH, FC-PH3 or FC-FS identifier may be used, including one of the
  // four based on a Canonical form IEEE company_id.
  kFibreChannel = 0x3,

  // If the ASSOCIATION field contains 1h, the Identifier value contains a
  // four-byte binary number identifying the port relative to other ports in the
  // device using the values shown Table 462. The CODE SET field shall be set to
  // 1h and the IDENTIFIER LENGTH field shall be set to 4h. If the ASSOCIATION
  // field does not contain 1h, use of this identifier type is reserved.
  kAssociationDependent1 = 0x4,
  kAssociationDependent2 = 0x5,

  // If the ASSOCIATION value is 0h, the IDENTIFIER value contains a four-byte
  // binary number identifying the port relative to other ports in the device
  // using the values shown Table 462. The CODE SET field shall be set to 1h and
  // the IDENTIFIER LENGTH field shall be set to 4h. If the ASSOCIATION field
  // does not contain 0h, use of this identifier type is reserved.
  kAssociationDependent3 = 0x6,

  // The MD5 logical unit identifier shall not be used if a logical unit
  // provides unique identification using identifier types 2h or 3h. A bridge
  // device may return a MD5 logical unit identifier type for that logical unit
  // that does not support the Device Identification VPD page.
  kNoMD5Support = 0x7,
};

// SCSI Reference Manual Table 461
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class ProtocolIdentifier : uint8_t {
  kFibreChannel = 0x0,
  kObsolete = 0x1,
  kSSA = 0x2,
  kIEEE1394 = 0x3,
  kRDMA = 0x4,
  kInternetSCSI = 0x5,
  kSASSerialSCSIProtocol = 0x6,
};

// SCSI Reference Manual Table 440
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class MediumRotationRate : uint16_t {
  kRotationNotReported = 0x0000,
  kNonRotatingMedium = 0x0001,
  kReserved = 0xFFFF,
};

// SCSI Reference Manual Table 441
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class ProductType : uint8_t {
  kNotIndicated = 0x00,
  kCFast = 0x01,
  kCompactFlash = 0x02,
  kMemoryStick = 0x03,
  kMultiMediaCard = 0x04,
  kSecureDigitalCard = 0x05,
  kXQD = 0x06,
  kUniversalFlashStorage = 0x07
};

// SCSI Reference Manual Table 442
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class Wacereq : uint8_t {
  kNotSpecified = 0b00,

  // The device server completes the read command specifying that LBA with GOOD
  // status and any data transferred to the Data-In Buffer is indeterminate.
  kSuccess = 0b01,

  // The device server terminates the read command specifying that LBA with
  // CHECK CONDITION status with sense key set to MEDIUM ERROR and the
  // additional sense code set to an appropriate value other than WRITE AFTER
  // SANITIZE REQUIRED (e.g., ID CRC OR ECC ERROR).
  kFailureWithoutWriteSanitize = 0b10,

  // The device server terminates the read command specifying that LBA with
  // CHECK CONDITION status with sense key set to MEDIUM ERROR and the
  // additional sense code set to WRITE AFTER SANITIZE REQUIRED.
  kFailureWithWriteSanitize = 0b11
};

// SCSI Reference Manual Table 443
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class Wabereq : uint8_t {
  kNotSpecified = 0b00,

  // The device server completes the read command specifying that LBA with GOOD
  // status and any data transferred to the Data-In Buffer is indeterminate.
  kSuccess = 0b01,

  // The device server terminates the read command specifying that LBA with
  // CHECK CONDITION status with sense key set to MEDIUM ERROR and the
  // additional sense code set to an appropriate value other than WRITE AFTER
  // SANITIZE REQUIRED (e.g., ID CRC OR ECC ERROR).
  kFailureWithoutWriteSanitize = 0b10,

  // The device server terminates the read command specifying that LBA with
  // CHECK CONDITION status with sense key set to MEDIUM ERROR and the
  // additional sense code set to WRITE AFTER SANITIZE REQUIRED.
  kFailureWithWriteSanitize = 0b11
};

// SCSI Reference Manual Table 444
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class NominalFormFactor : uint8_t {
  kNotReported = 0x0,
  kExtraLarge = 0x1,  // 5.25 inch
  kLarge = 0x2,       // 3.5 inch
  kMedium = 0x3,      // 2.5 inch
  kSmall = 0x4,       // 1.8 inch
  kExtraSmall = 0x5,  // less than 1.8 inch
};

// SCSI Reference Manual Table 445
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class Zoned : uint8_t {
  kNotReported = 0b00,

  // Device server implements the host aware zoned block device capabilities
  // defined in ZBC
  kHostAware = 0b01,

  // Device server implements device managed zoned block device capabilities
  kDeviceManaged = 0b10,
  kReserved = 0b11,
};

// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class PageLength : uint16_t {
  kExtendedInquiryCommand = 0x3c,
  kBlockDeviceCharacteristicsVpd = 0x3c,
};

struct ControlByte {
  uint8_t obsolete : 2;
  bool naca : 1;
  uint8_t reserved : 3;
  uint8_t vendor_specific : 2;
};

// SCSI Reference Manual Table 202
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct TestUnitReadyCommand {
  uint32_t reserved : 32;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(TestUnitReadyCommand) == 5);

// SCSI Reference Manual Table 119
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct ReadCapacity10Command {
  uint8_t reserved_1 : 8;               // obsolete
  uint32_t logical_block_address : 32;  // obsolete
  uint16_t reserved_2 : 16;
  uint8_t reserved_3 : 8;  // obsolete PMI bit
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ReadCapacity10Command) == 9);

// SCSI Reference Manual Table 120
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct ReadCapacity10Data {
  uint32_t returned_logical_block_address : 32;
  uint32_t block_length : 32;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ReadCapacity10Data) == 8);

// Refer to
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
// , Section 3.6 Table 58
struct InquiryCommand {
  bool evpd : 1;      // Enable Vital Product Data (EVPD)
  bool obsolete : 1;  // formerly CMDDT
  uint8_t reserved : 6;
  PageCode page_code : 8;
  uint16_t allocation_length : 16;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(InquiryCommand) == 5);

// Refer to
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
// , Section 3.6.2 Table 60
enum class PeripheralQualifier : uint8_t {
  kPeripheralDeviceConnected = 0b000,
  kPeripheralDeviceNotConnected = 0b001,
  kReserved = 0b010,
  kNotSupported = 0b011
};

// Refer to
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
// , Section 3.6.2 Table 63
enum class TPGS : uint8_t {
  kNotSupported = 0b00,
  kImplicitAccess = 0b01,
  kExcplicitAccess = 0b10,
  kFullAccess = 0b11,
};

enum class ResponseDataFormat : uint8_t {
  kObsolete0 = 0x0,
  kObsolete1 = 0x1,
  kCompliant = 0x2,
};

// Table 74
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class PageControl : uint8_t {
  kCurrent = 0b00,
  kChangeable = 0b01,
  kDefault = 0b10,
  kSaved = 0b11
};

// Refer to
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
// , Section 3.6.2 Table 59
// Based on internal documentation SPC-4 Revision 37 Table 176
struct InquiryData {
  PeripheralDeviceType peripheral_device_type : 5;
  PeripheralQualifier peripheral_qualifier : 3;
  uint8_t reserved_1 : 6;
  bool lu_cong : 1;
  bool rmb : 1;  // Removable Media Bit (RMB)
  Version version : 8;
  ResponseDataFormat response_data_format : 4;
  bool hisup : 1;    // Hierarchical Support Bit (HISUP)
  bool normaca : 1;  // Normal ACA (NORMACA)
  uint8_t reserved_2 : 2;
  uint8_t additional_length : 8;
  bool protect : 1;
  uint8_t reserved_3 : 2;
  bool third_party_copy : 1;  // referred to as 3PC in the documentation
  TPGS tpgs : 2;              // Target Port Group Support (TPGS)
  bool acc : 1;               // Access controls Coordinator Bit
  bool sccs : 1;              // SCC Supported
  bool addr_16 : 1;           // SCSI 16-bit address support bit
  uint8_t reserved_4 : 2;
  bool obsolete_1 : 1;
  bool multip : 1;   // multiple SCSI Port
  bool vs_1 : 1;     // vendor specific bit
  bool encserv : 1;  // Enclosure Services Bit
  bool obsolete_2 : 1;
  bool vs_2 : 1;    // vendor specific bit
  bool cmdque : 1;  // Command Management Model bit
  bool reserved_5 : 1;
  bool obsolete_3 : 1;
  bool sync : 1;
  bool wbus_16 : 1;  // Wide Bus bit
  bool reserved_6 : 1;
  bool obsolete_4 : 1;
  char vendor_identification[8];
  uint8_t product_identification[16];
  uint8_t product_revision_level[4];
  uint8_t vendor_specific_1[20];
  bool ius : 1;  // Information Units Supported bit
  bool qas : 1;  // Quick Arbitration and Selection Supported bit
  uint8_t clocking : 2;
  uint8_t reserved_7 : 4;
  uint8_t reserved_8 : 8;
  uint16_t vendor_descriptors[8];
  uint8_t reserved_9[22];
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(InquiryData) == 96);

// SCSI Reference Manual Table 76
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct PersistentReserveInCommand {
  uint8_t service_action : 5;
  uint8_t reserved_1 : 3;
  uint64_t reserved_2 : 40;
  uint16_t allocation_length : 16;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(PersistentReserveInCommand) == 9);

// Persistent Reserve In Read Reservation Data No Reservation
// SCSI Reference Manual Table 79
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct PriReadReservationDataNoReservation {
  uint32_t prgeneration : 32;
  uint32_t additional_length : 32;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(PriReadReservationDataNoReservation) == 8);

// Persistent Reserve In Read Reservation Data With Reservation
// SCSI Reference Manual Table 80
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct PriReadReservationDataWithReservation {
  PriReadReservationDataNoReservation priDataNoReservation;
  uint64_t reservation_key : 64;
  uint32_t obsolete_1 : 32;
  uint8_t reserved : 8;
  uint8_t type : 4;
  uint8_t scope : 4;
  uint16_t obsolete_2 : 16;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(PriReadReservationDataWithReservation) == 24);

// SCSI Reference Manual Table 88
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct PersistentReserveOutCommand {
  uint8_t service_action : 5;
  uint8_t reserved_1 : 3;
  uint8_t type : 4;
  uint8_t scope : 4;
  uint16_t reserved_2 : 16;
  uint32_t parameter_list_length : 32;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(PersistentReserveOutCommand) == 9);

// Persistent Reserve Out Parameter List
// Used by Persistent Reserve Out command for any service action other than
// Register and Move SCSI Reference Manual Table 90
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct ProParamList {
  uint64_t reservation_key : 64;
  uint64_t service_action_reservation_key : 64;
  uint32_t obsolete_1 : 32;
  bool aptpl : 1;  // Activate Persist Through Power Loss bit
  bool reserved : 1;
  bool all_tg_pt : 1;  // All Target Ports bit
  bool spc_i_pt : 1;   // Specify Initiator Ports bit
  uint8_t reserved_1 : 4;
  uint8_t reserved_2 : 8;
  uint16_t obsolete_2 : 16;
  // additional parameter data
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ProParamList) == 24);

// SCSI Reference Manual Table 95
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct Read6Command {
  uint8_t logical_block_address_1 : 5;
  uint8_t reserved : 3;
  uint16_t logical_block_address_2 : 16;
  uint8_t transfer_length : 8;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(Read6Command) == 5);

// SCSI Reference Manual Table 97
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct Read10Command {
  uint8_t obsolete : 2;
  bool rarc : 1;           // Rebuild Assist Recovery bit
  bool fua : 1;            // Forced Unit access bit
  bool dpo : 1;            // disable page output bit
  uint8_t rd_protect : 3;  // read protect bit
  uint32_t logical_block_address : 32;
  uint8_t group_number : 5;
  uint8_t reserved : 3;
  uint16_t transfer_length : 16;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(Read10Command) == 9);

// SCSI Reference Manual Table 99
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct Read12Command {
  uint8_t obsolete : 2;
  bool rarc : 1;  // Rebuild Assist Recovery bit
  bool fua : 1;   // Forced Unit access bit
  bool dpo : 1;   // disable page output bit
  uint8_t rd_protect : 3;
  uint32_t logical_block_address : 32;
  uint32_t transfer_length : 32;
  uint8_t group_number : 5;
  uint8_t reserved : 2;
  bool restricted_mmc_6 : 1;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(Read12Command) == 11);

// SCSI Reference Manual Table 100
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct Read16Command {
  bool dld_2 : 1;
  bool obsolete : 1;
  bool rarc : 1;  // Rebuild Assist Recovery bit
  bool fua : 1;   // Forced Unit access bit
  bool dpo : 1;   // disable page output bit
  uint8_t rd_protect : 3;
  uint64_t logical_block_address : 64;
  uint32_t transfer_length : 32;
  uint8_t group_number : 6;
  bool dld_0 : 1;
  bool dld_1 : 1;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(Read16Command) == 15);

// SCSI Reference Manual Table 215
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct Write6Command {
  uint8_t logical_block_address_1 : 5;
  uint8_t reserved : 3;
  uint16_t logical_block_address_2 : 16;
  uint8_t transfer_length : 8;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(Write6Command) == 5);

// SCSI Reference Manual Table 216
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct Write10Command {
  uint8_t obsolete : 2;
  bool reserved_1 : 1;
  bool fua : 1;  // Forced Unit access bit
  bool dpo : 1;  // disable page output bit
  uint8_t wr_protect : 3;
  uint32_t logical_block_address : 32;
  uint8_t group_number : 5;
  uint8_t reserved_2 : 3;
  uint16_t transfer_length : 16;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(Write10Command) == 9);

// SCSI Reference Manual Table 218
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct Write12Command {
  uint8_t obsolete : 2;
  bool reserved_1 : 1;
  bool fua : 1;  // Forced Unit access bit
  bool dpo : 1;  // disable page output bit
  uint8_t wr_protect : 3;
  uint32_t logical_block_address : 32;
  uint32_t transfer_length : 32;
  uint8_t group_number : 5;
  uint8_t reserved_2 : 2;
  bool restricted_mmc_5 : 1;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(Write12Command) == 11);

// SCSI Reference Manual Table 219
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct Write16Command {
  bool dld_2 : 1;
  bool obsolete : 1;
  bool reserved : 1;
  bool fua : 1;  // Forced Unit access bit
  bool dpo : 1;  // disable page output bit
  uint8_t wr_protect : 3;
  uint64_t logical_block_address : 64;
  uint32_t transfer_length : 32;
  uint8_t group_number : 6;
  bool dld_0 : 1;
  bool dld_1 : 1;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(Write16Command) == 15);

// SCSI Reference Manual Table 207
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct Verify10Command {
  bool obsolete : 1;
  uint8_t bytchk : 2;
  bool reserved_1 : 1;
  bool dpo : 1;  // disable page output bit
  uint8_t vr_protect : 3;
  uint32_t logical_block_address : 32;
  uint8_t group_number : 5;
  uint8_t reserved_2 : 2;
  bool restricted_mmc_5 : 1;
  uint16_t verification_length : 16;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(Verify10Command) == 9);

// SCSI Reference Manual Table 218
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct Verify12Command {
  bool obsolete : 1;
  uint8_t bytchk : 2;
  bool reserved_1 : 1;
  bool dpo : 1;  // disable page output bit
  uint8_t vr_protect : 3;
  uint32_t logical_block_address : 32;
  uint32_t verification_length : 32;
  uint8_t group_number : 5;
  uint8_t reserved_2 : 2;
  bool restricted_mmc_5 : 1;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(Verify12Command) == 11);

// SCSI Reference Manual Table 219
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct Verify16Command {
  bool reserved_1 : 1;
  uint8_t bytchk : 2;
  bool reserved_2 : 1;
  bool dpo : 1;  // disable page output bit
  uint8_t vr_protect : 3;
  uint64_t logical_block_address : 64;
  uint32_t verification_length : 32;
  uint8_t group_number : 5;
  uint8_t reserved_3 : 2;
  bool restricted_mmc_5 : 1;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(Verify16Command) == 15);

// SCSI Reference Manual Table 199
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct SynchronizeCache10Command {
  bool obsolete_1 : 1;
  bool immed : 1;  // Immediate bit
  bool obsolete_2 : 1;
  uint8_t reserved_1 : 5;
  uint32_t logical_block_address : 32;
  uint8_t group_number : 5;
  uint8_t reserved_2 : 3;
  uint16_t number_of_blocks : 16;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(SynchronizeCache10Command) == 9);

// SCSI Reference Manual Table 201
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct SynchronizeCache16Command {
  bool reserved_1 : 1;
  bool immed : 1;  // Immediate bit
  bool obsolete : 1;
  uint8_t reserved_2 : 5;
  uint64_t logical_block_address : 64;
  uint32_t number_of_blocks : 32;
  uint8_t group_number : 5;
  uint8_t reserved_3 : 3;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(SynchronizeCache16Command) == 15);

// SCSI Reference Manual Table 73
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct ModeSense6Command {
  uint8_t reserved_1 : 3;
  bool dbd : 1;  // Disable block descriptors
  uint8_t reserved_2 : 4;
  ModePageCode page_code : 6;
  PageControl pc : 2;  // Page control
  uint8_t sub_page_code : 8;
  uint8_t alloc_length : 8;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ModeSense6Command) == 5);

// SCSI Reference Manual Table 75
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct ModeSense10Command {
  uint8_t reserved_1 : 3;
  bool dbd : 1;    // Disable block descriptors
  bool llbaa : 1;  // Long LBA accepted
  uint8_t reserved_2 : 3;
  ModePageCode page_code : 6;
  PageControl pc : 2;  // Page control
  uint8_t sub_page_code : 8;
  uint32_t reserved_3 : 24;
  uint16_t alloc_length : 16;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ModeSense10Command) == 9);

// SCSI Reference Manual Table 148
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
enum class SelectReport : uint8_t {
  kRestrictedMethods = 0x0,
  kWellKnown = 0x1,
  kAllLogical = 0x2
};

// SCSI Reference Manual Table 147
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct ReportLunsCommand {
  uint8_t reserved_1 : 8;
  SelectReport select_report : 8;
  uint32_t reserved_2 : 24;
  uint32_t alloc_length : 32;
  uint8_t reserved_3 : 8;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ReportLunsCommand) == 11);

// SCSI Reference Manual Table 149
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
// This struct is a header for variable sized data
struct ReportLunsParamData {
  uint32_t list_byte_length : 32;
  uint32_t reserved_1 : 32;
};
static_assert(sizeof(ReportLunsParamData) == 8);

// SCSI Reference Manual Table 150, 159, 162
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct MaintenanceInHeader {
  uint8_t service_action : 5;
  uint8_t reserved_1 : 3;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(MaintenanceInHeader) == 1);

// SCSI Reference Manual Table 150
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct ReportOpCodesCommand {
  MaintenanceInHeader maintenance_in_header;
  uint8_t reporting_options : 3;
  uint8_t reserved_1 : 4;
  bool rctd : 1;  // Return commands timeout descriptor
  uint8_t requested_op_code : 8;
  uint16_t requested_service_action : 16;
  uint32_t alloc_length : 32;
  uint8_t reserved_2 : 8;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ReportOpCodesCommand) == 11);

// SCSI Reference Manual Table 157
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct CommandTimeoutsDescriptor {
  uint16_t descriptor_length : 16;
  uint8_t reserved_1 : 8;
  uint8_t cmd_specific : 8;
  uint32_t nominal_cmd_timeout : 32;
  uint32_t reccomended_cmd_timeout : 32;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(CommandTimeoutsDescriptor) == 12);

// SCSI Reference Manual Table 153
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct CommandDescriptor {
  uint8_t reserved_1 : 8;
  uint16_t service_action : 16;
  uint8_t reserved_2 : 8;
  bool servactv : 1;  // Service action valid
  bool ctdp : 1;      // Command timeouts descriptor present
  uint8_t reserved_3 : 6;
  uint16_t cdb_length : 16;  // Command descriptor block length
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(CommandDescriptor) == 7);

struct CommandDescriptorTimeoutIncluded {
  uint8_t reserved_1 : 8;
  uint16_t service_action : 16;
  uint8_t reserved_2 : 8;
  bool servactv : 1;  // Service action valid
  bool ctdp : 1;      // Command timeouts descriptor present
  uint8_t reserved_3 : 6;
  uint16_t cdb_length : 16;  // Command descriptor block length
  CommandTimeoutsDescriptor
      cmd_timeouts_desc;  // This field's validity is specified by ctdp.
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(CommandDescriptorTimeoutIncluded) == 19);

// SCSI Reference Manual Table 152
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
// This struct is a header for variable sized data
struct AllCommandsParamData {
  uint32_t listByteSize : 32;
};

// SCSI Reference Manual Table 155
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
// This struct is a header for variable sized data
struct OneCommandParamData {
  uint8_t reserved_1 : 8;
  uint8_t support : 3;
  uint8_t reserved_2 : 4;
  bool ctdp : 1;  // Command timeouts descriptor present
  uint16_t cdb_size : 16;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(OneCommandParamData) == 4);

// SCSI Reference Manual Table 159
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
// Report supported task managment functions command
struct ReportTmfCommand {
  MaintenanceInHeader maintenance_in_header;
  uint8_t reserved_1 : 7;
  bool repd : 1;  // Return extended parameter data
  uint32_t reserved_2 : 24;
  uint32_t alloc_length : 32;
  uint8_t reserved_3 : 8;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ReportTmfCommand) == 11);

// SCSI Reference Manual Table 160
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
// Report supported task managment functions parameter data
struct ReportTmfParamData {
  uint8_t obsolete_1 : 2;
  bool qts : 1;    // Query task supported
  bool lurs : 1;   // Logical unit reset supported
  bool ctss : 1;   // Clear task set supported
  bool cacas : 1;  // Clear ACA supported
  bool atss : 1;   // Abort task set supported
  bool ats : 1;    // Abort task supported
  bool itnrs : 1;  // I-T Nexus reset supported
  bool qtss : 1;   // Query task set supported
  bool qaes : 1;   // Query async event supported
  uint8_t reserved_1 : 5;
  uint8_t reserved_2 : 8;
  uint8_t additional_data_length : 8;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ReportTmfParamData) == 4);

// SCSI Reference Manual Table 162
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct ReportTimestampCommand {
  uint32_t reserved_1 : 32;
  uint32_t alloc_length : 32;
  uint8_t reserved_2 : 8;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ReportTimestampCommand) == 10);

// SCSI Reference Manual Table 163
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct ReportTimestampParamData {
  uint16_t data_length : 16;
  uint8_t ts_origin : 3;  // Timestamp origin
  uint8_t reserved_1 : 5;
  uint8_t reserved : 8;
  uint64_t timestamp : 48;
  uint8_t reserved_2 : 8;
  uint8_t reserved_3 : 8;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ReportTimestampParamData) == 12);

// SCSI Reference Manual Table 204
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct UnmapCommand {
  bool anchor : 1;
  uint8_t reserved_1 : 7;
  uint32_t reserved_2 : 32;
  uint8_t group_number : 5;
  uint8_t reserved_3 : 3;
  uint16_t param_list_length : 16;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(UnmapCommand) == 9);

// SCSI Reference Manual Table 205
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
// This struct is a header for variable length data
struct UnmapParamList {
  uint16_t data_length : 16;
  uint16_t block_desc_data_length : 16;
  uint32_t reserved_1 : 32;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(UnmapParamList) == 8);

// SCSI Reference Manual Table 206
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct UnmapBlockDescriptor {
  uint64_t logical_block_addr : 64;
  uint32_t logical_block_count : 32;
  uint32_t reserved_1 : 32;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(UnmapBlockDescriptor) == 16);

// SCSI Reference Manual Table 372
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct CachingModePage {
  ModePageCode page_code : 6;
  bool spf : 1;  // Sub-page format
  bool ps : 1;   // Parameter saveable
  uint8_t page_length : 8;
  bool rcd : 1;        // Read cache disable
  bool mf : 1;         // Multiplication factor
  bool wce : 1;        // Write cache enabled
  bool size : 1;       // Size enable
  bool disc : 1;       // Disconinuity
  bool cap : 1;        // Caching analysis permitted
  bool abpf : 1;       // Abort prefetch
  bool ic : 1;         // Initiator control
  uint8_t wrp : 4;     // Write retention priority
  uint8_t drrp : 4;    // Demand read retention priority
  uint16_t dptl : 16;  // Disable prefetch transfer length
  uint16_t min_prefetch : 16;
  uint16_t max_prefetch : 16;
  uint16_t max_prefetch_ceil : 16;
  bool nv_dis : 1;  // Non-volatile cache disabled
  uint8_t sync_prog : 2;
  uint8_t vs : 2;    // Vendor specific
  bool dra : 1;      // Disable read ahead
  bool lbcss : 1;    //  Logical block cache segment size bit
  bool fsw : 1;      // Force sequential write
  uint8_t nocs : 8;  // Number of cache segments
  uint16_t cache_segment_time : 16;
  uint8_t reserved : 8;
  uint32_t obsolete : 24;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(CachingModePage) == 20);

// SCSI Reference Manual Table 377
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct ControlModePage {
  ModePageCode page_code : 6;
  bool spf : 1;  // Sub-page format
  bool ps : 1;   // Parameter saveable
  uint8_t page_length : 8;
  bool rlec : 1;     // Report log exception condition
  bool gltsd : 1;    // Global logging target solve disable
  bool d_sense : 1;  // Descriptor format sense data bit
  bool dpicz : 1;  // Disable protection information check if protect field zero
  bool tmf_only : 1;  // Allow task managment functions only
  uint8_t tst : 3;    // Task set type
  bool dque : 1;      // Disable queueing
  uint8_t qerr : 2;   // Queue error mangment
  bool nuar : 1;      // No unit attention on release
  uint8_t qam : 4;    // Queue algorithm modifier
  uint8_t obsolete_1 : 3;
  bool swp : 1;                // Software write protect
  uint8_t ua_intlck_ctrl : 2;  // Unit attention interlocks control
  bool rac : 1;                // Report a check
  bool vs : 1;                 // Vendor specific
  uint8_t autoload_mode : 3;
  bool reserved : 1;
  bool rwwp : 1;   // Reject write without protection
  bool atmpe : 1;  // Application tag mode page enabled
  bool tas : 1;    // Task aborted status
  bool ato : 1;    // Application tag owner
  uint16_t obsolete_2 : 16;
  uint16_t busy_timeout_period : 16;
  uint16_t estct : 16;  // Extended self-test completion time
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ControlModePage) == 12);

// SCSI Reference Manual Table 397
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct PowerConditionModePage {
  ModePageCode page_code : 6;
  bool spf : 1;  // Sub-page format
  bool ps : 1;   // Parameter saveable
  uint8_t page_length : 8;
  bool standby_y : 1;
  uint8_t reserved_1 : 5;
  uint8_t pm_bg_precedence : 2;
  bool standby_z : 1;
  bool idle_a : 1;
  bool idle_b : 1;
  bool idle_c : 1;
  uint8_t reserved_2 : 4;
  uint32_t idle_a_ct : 32;     // Idle A condition timer
  uint32_t standby_z_ct : 32;  // Standby Z condition timer
  uint32_t idle_b_ct : 32;     // Idle B condition timer
  uint32_t idle_c_ct : 32;     // Idle C condition timer
  uint32_t standby_y_ct : 32;  // Standby Y condition timer
  uint8_t reserved_3[15];
  uint8_t reserved_4 : 2;
  int8_t ccf_stopped : 2;   // Check condition from stopped
  uint8_t ccf_standby : 2;  // Check condition from standby
  uint8_t ccf_idle : 2;     // Check condition from idle
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(PowerConditionModePage) == 40);

// SCSI Reference Manual Table 361
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct ModeParameter6Header {
  uint8_t mode_data_length : 8;
  uint8_t medium_type : 8;
  uint8_t reserved_2 : 4;
  bool dpofua : 1;  // DPO and FUA support
  uint8_t reserved_1 : 2;
  bool wp : 1;      // Write protect
  uint8_t bdl : 8;  // Block descriptor length
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ModeParameter6Header) == 4);

// SCSI Reference Manual Table 362
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct ModeParameter10Header {
  uint16_t mode_data_length : 16;
  uint8_t medium_type : 8;
  uint8_t reserved_1 : 4;
  bool dpofua : 1;  // DPO and FUA support
  uint16_t reserved_2 : 2;
  bool wp : 1;  // Write protect
  bool longlba : 1;
  uint16_t reserved_3 : 15;
  uint16_t bdl : 16;  // Block descriptor length
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ModeParameter10Header) == 8);

struct ShortLbaBlockDescriptor {
  uint32_t number_of_blocks : 32;
  uint8_t reserved : 8;
  uint32_t logical_block_length : 24;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ShortLbaBlockDescriptor) == 8);

struct LongLbaBlockDescriptor {
  uint64_t number_of_blocks : 64;
  uint32_t reserved : 32;
  uint32_t logical_block_length : 32;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(LongLbaBlockDescriptor) == 16);

// SCSI Reference Manual Table 164
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct RequestSenseCommand {
  bool desc : 1;
  uint8_t reserved_1 : 7;
  uint16_t reserved_2 : 16;
  uint8_t allocation_length : 8;
  ControlByte control_byte;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(RequestSenseCommand) == 5);

// SCSI Reference Manual Table 27
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct FixedFormatSenseData {
  SenseResponse response_code : 7;
  bool valid : 1;
  uint8_t _obsolete : 8;
  SenseKey sense_key : 4;
  bool reserved_1 : 1;
  bool ili : 1;  // Incorrect length indicator
  bool eom : 1;  // End-of-Medium
  bool filemark : 1;
  uint32_t info : 32;
  uint8_t additional_sense_length : 8;
  uint32_t command_specific_info : 32;
  AdditionalSenseCode additional_sense_code : 8;
  AdditionalSenseCodeQualifier additional_sense_code_qualifier : 8;
  uint8_t field_replaceable_unit_code : 8;
  uint8_t sense_key_specific_1 : 7;
  bool sksv : 1;
  uint16_t sense_key_specific_2 : 16;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(FixedFormatSenseData) == 18);

// SCSI Reference Manual Table 12
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct DescriptorFormatSenseData {
  SenseResponse response_code : 7;
  bool reserved_1 : 1;
  SenseKey sense_key : 4;
  uint8_t reserved_2 : 4;
  AdditionalSenseCode additional_sense_code : 8;
  AdditionalSenseCodeQualifier additional_sense_code_qualifier : 8;
  uint32_t reserved_3 : 24;
  uint8_t additional_sense_length : 8;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(DescriptorFormatSenseData) == 8);

// SCSI Reference Manual Table 483
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct SupportedVitalProductData {
  PeripheralDeviceType peripheral_device_type : 5;
  PeripheralQualifier peripheral_qualifier : 3;
  PageCode page_code : 8;
  uint8_t _reserved : 8;
  uint8_t page_length : 8;
  // PageCode supported_page_list[256];
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(SupportedVitalProductData) == 4);

// SCSI Reference Manual Table 484
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct UnitSerialNumber {
  PeripheralDeviceType peripheral_device_type : 5;
  PeripheralQualifier peripheral_qualifier : 3;
  PageCode page_code : 8;
  uint8_t _reserved : 8;
  uint8_t page_length : 8;
  // uint8_t product_serial_number[256];
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(UnitSerialNumber) == 4);

// SCSI Reference Manual Table 460
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct IdentificationDescriptor {
  CodeSet code_set : 4;
  ProtocolIdentifier protocol_identifier : 4;
  IdentifierType identifier_type : 4;
  Association association : 2;
  bool _reserved1 : 1;
  bool protocol_identifier_valid : 1;
  uint8_t _reserved2 : 8;
  uint8_t identifier_length : 8;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(IdentificationDescriptor) == 4);

// SCSI Reference Manual Table 459
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct DeviceIdentificationVpd {
  PeripheralDeviceType peripheral_device_type : 5;
  PeripheralQualifier peripheral_qualifier : 3;
  PageCode page_code : 8;
  uint8_t page_length : 8;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(DeviceIdentificationVpd) == 3);

// SCSI reference Manual Table 455
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct ExtendedInquiryDataVpd {
  PeripheralDeviceType peripheral_device_type : 5;
  PeripheralQualifier peripheral_qualifer : 3;
  PageCode page_code : 8;
  PageLength page_length : 16;
  bool ref_chk : 1;  // reference tag check bit
  bool app_chk : 1;  // application tag check bit
  bool grd_chk : 1;  // guard check bit
  uint8_t spt : 3;   // supported protection type
  ActivateMicrocode activate_microcode : 2;
  bool simpsup : 1;    // Simple Supported bit
  bool ordsup : 1;     // Ordered Supported bit
  bool headsup : 1;    // Head of Queue Supported bit
  bool prior_sup : 1;  // Priority Supported bit
  bool group_sup : 1;  // Grouping Function Supported bit
  bool uask_sup : 1;   // Unit Attention Sense Key Supported bit
  uint8_t _reserved1 : 2;
  bool v_sup : 1;    // Volatile Cache Supported Bit
  bool nv_sup : 1;   // Non-Volatile Cache Supported bit
  bool crd_sup : 1;  // Correction Disable Supported bit
  bool wu_sup : 1;   // Write Uncorrectable Supported bit
  uint8_t _reserved2 : 4;
  bool luiclr : 1;  // Logical Unit I_T Nexus Clear bit
  uint8_t _reserved3 : 3;
  bool p_i_i_sup : 1;  // Protection Information Interval Supported bit
  bool no_pi_chk : 1;  // No Protection Information Checking bit
  uint8_t _reserved4 : 2;
  bool obsolete : 1;
  bool hssrelef : 1;  // History Snapshots Release Effects bit
  bool rtd_sup : 1;   // Resistance Temperature Detection bit
  bool _reserved5 : 1;
  bool r_sup : 1;  // Referrals Supported bit
  uint8_t _reserved6 : 3;
  uint8_t multi_t_nexus_microcode_download : 4;
  uint8_t _reserved7 : 4;
  uint16_t extended_self_test_completion_minutes : 16;
  uint8_t _reserved8 : 5;
  bool vsa_sup : 1;  // Vendor Specific Activation Supported bit
  bool hra_sup : 1;  // Hard Reset Activation Supported bit
  bool poa_sup : 1;  // Power on Activation Supported bit
  uint8_t maximum_supported_sense_data_length : 8;
  // uint8_t _reserved9[50];
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(ExtendedInquiryDataVpd) == 14);

// SCSI Reference Manual Table 459
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct BlockDeviceCharacteristicsVpd {
  PeripheralDeviceType peripheral_device_type : 5;
  PeripheralQualifier peripheral_qualifier : 3;
  PageCode page_code : 8;
  PageLength page_length : 16;
  MediumRotationRate medium_rotation_rate : 16;
  ProductType product_type : 8;
  NominalFormFactor nominal_form_factor : 4;
  Wacereq wacereq : 2;
  Wabereq wabereq : 2;
  bool vbuls : 1;
  bool fuab : 1;
  bool bocs : 1;
  bool _reserved1 : 1;
  Zoned zoned : 2;  //
  uint8_t _reserved2 : 2;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(BlockDeviceCharacteristicsVpd) == 9);

// namespace scsi_defs
// SCSI Reference Manual Table 467
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct LogicalBlockProvisioningVpd {
  PeripheralDeviceType peripheral_device_type : 5;
  PeripheralQualifier peripheral_qualifier : 3;
  PageCode page_code : 8;
  uint16_t page_length : 16;
  uint8_t threshold_exponent : 8;
  bool dp : 1;
  bool anc_sup : 1;
  uint8_t lbprz : 3;
  bool lbpws10 : 1;
  bool lbpws : 1;
  bool lbpu : 1;
  uint8_t provisioning_type : 3;
  uint8_t min_percentage : 5;
  uint8_t threshold_percentage : 8;
  uint8_t provisioning_group_descriptor[56];
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(LogicalBlockProvisioningVpd) == 64);

// SCSI Reference Manual Table 450
// https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf
struct BlockLimitsVpd {
  PeripheralDeviceType peripheral_device_type : 5;
  PeripheralQualifier peripheral_qualifier : 3;
  PageCode page_code : 8;
  uint16_t page_length : 16;
  bool wsnz : 1;
  uint8_t _reserved : 7;
  uint8_t max_compare_write_length : 8;
  uint16_t optimal_translater_length_granularity : 16;
  uint32_t max_transfer_length : 32;
  uint32_t optimal_transfer_length : 32;
  uint32_t max_prefetch_length : 32;
  uint32_t max_unmap_lba_count : 32;
  uint32_t max_unmap_block_descriptor_count : 32;
  uint32_t optimal_unmap_granularity : 32;
  uint8_t unmap_granularity_alignment_1 : 7;
  bool ugavalid : 1;
  uint32_t unmap_graularity_alignment_2 : 24;
  uint64_t max_write_same_length : 64;
  uint32_t max_atomic_transfer_length : 32;
  uint32_t atomic_alignment : 32;
  uint32_t atomic_transfer_length_granularity : 32;
  uint32_t max_atomic_transfer_length_with_atomic_boundary : 32;
  uint32_t max_atomic_boundary_size : 32;
} ABSL_ATTRIBUTE_PACKED;
static_assert(sizeof(BlockLimitsVpd) == 64);

}  // namespace scsi

#endif


text:
The iconic Mojito
Legend has it that the Mojito dates back to the early 16th century, when English explorer Francis Drake, between two lootings in Havana, was said to enjoy sipping on a drink made with mint leaves muddled in tafia (industrial rum).
In the 20th century, the original recipe evolved: the tafia was replaced with white rum and lime was added to complement the mixture. Thus, the Mojito as we know it was born. In 1920, the Mojito became a true symbol of Cuban culture, and was elevated to the rank of Cuba's national cocktail. It is said to have been one of Ernest Hemingway's favorite drinks, and that he enjoyed it regularly when he lived in Cuba between 1939 and 1960 as part of his famous local habits: "My Mojito in La Bodeguita, my Daiquiri in El Floridita". The cocktail ended up being exported first to the United States, then to Europe, before becoming a staple in most bars around the world.
Main alcohol : Rum
1½ Parts White Rum
1 Part Lime Juice
⅔ Part Simple Syrup
8 Whole Mint Leaves
1 Sprig Mint
Add 8 whole mint leaves into a highball glass. Add ⅔ part simple syrup and gently muddle. Fill with cracked ice. Add 1 part lime juice and 1½ parts white rum. Top up with soda water. Garnish with a sprig of mint leaves and serve.
Drinkware : Highball Glass
Nui. Hostel & Bar Lounge Certified World's Best Bar
Tell Camellia Certified World's Best Bar
The Hansom Certified World's Best Bar
The Tippling Club Certified World's Best Bar

redpajama_set_name: RedPajamaCommonCrawl


text:
Gregory K
NR, 1 hr.29 min.
Drama , Television
Directed By: Linda Otto
In Theaters: Feb 8, 1993 Wide
On DVD:
Michael Jaffe Productions
Gregory K Reviews
Why are you flagging this review?
We encourage our community to report abusive content and/ or spam. Our team will review flagged items and determine whether or not they meet our community guidelines.
It is offensive and/or threatening.
It contains inappropriate language.
It is spam.
It contains spoilers.
It contains a link.
Please choose best explanation for why you are flagging this review.
Thank you for your submission. This post has been submitted for our review.
Sincerely, The Rotten Tomatoes Team
Lisa Michelle A
This is a really good film. It's based on a true story too. Gregory was the first child to ever divorce his parents, his father because he was abusive and his mother because she was an alcholic who cared more about drink than her sons. This film is really sad to watch but as soon as he meets the Wilson's who want to adopt him his life changes for the better. Joseph Gordon-Levitt does a star turn as young Gregory, who later becomes Sean. I love it.
A sweet made for TV movie, starring a young Joseph Gordon-Levitt as a kid who has had a difficult upbringing with parents who have struggled to care for him. He has been put in and out of care for years, when finally he meets a family who want to adopt him, but suddenly his parents want him back. Gregory (Gordon-Levitt) fights back, becoming the first child to go through the courts to divorce his parents, hoping to secure a happy future for himself. The film itself is no masterpiece, but Joseph Gordon-Levitt really stands out as a great actor, and it is worth watching for him alone.
Drama based on a true story of a young boy named Gregory, who legally divorced his parents. Very well done. A young Joesph Gordon Levitt plays the role of Gregory (pre 3rd Rock days)


I really enjoyed this light, flowery flavor. It was very close to lavender, but had a very, very subtle diesel aftertaste. The undertones of vanilla added a bit of sweetness to the savory lavender, but I wish it was just a little bit sweeter! I may try a drop of this flavor with a drop of the Nilly Vanilla for a richer, smoother, and more playful taste. I also recommend mixing this flavor with Strawberry Cough and Convicted Melon.
Thus one is very subtle and light. A nice change from stronger, fuller bodied flavors. Not disappointed .
I have yet to try this one alone, but I tried it for the first time tonight in a mixture with another flavor. I loaded half a bowl, put in 2 drops Purple Haze and 1 drop Nilly Vanilla, loaded the second half, and did another 2 drops Purple Haze with another drop of Nilly Vanilla. The resulting flavor was… Absolutely sublime. I am in love with this mixture. I plan on using the Purple Haze on its own as well, but if this is any indication of how good it is on its own, I will be reordering this when I run out.


Moisture transport associated with the summertime North American monsoon.
The origins and transport of water vapor into the semi-arid Sonoran Desert region of southwestern North America are examined for the July-August wet season. Vertically-integrated fluxes and flux divergences of water vapor are computed for the 8 summers, 1985-1992, from ECMWF mandatory-level analyses possessing a spectral resolution of triangular 106 (T106). The intraseasonal variability of water vapor transports are also examined. Composite wet and dry periods defined from rain gauge data for southeast Arizona, are compared. Cloud top temperature (CCT), wind, specific humidity, precipitable water (PW), convective indices, moisture flux, and parcel trajectories are all examined. The ECMWF analyses indicate that transports of water vapor by the time-mean flow dominate the transports by the transient eddies. Climatologically, upper-level (above 700 mb) moisture over the Sonoran Desert arrives from over the Gulf of Mexico and the northern fringe of the moist air mass over western Mexico, while at low-levels (below 700 mb) the water vapor comes predominantly from over the northern Gulf of California. There is no indication of moisture entering the Sonoran Desert at low-levels directly from the southern Gulf of California or the tropical East Pacific. Water vapor from these regions can enter the Sonoran Desert aloft after vertical mixing along the western slopes of the Sierra Madre Occidental mountains of Mexico and subsequent horizontal transport aloft. Significant differences exist between wet and dry conditions over the Sonoran Desert for all fields considered. As the monsoon shifts from dry to wet conditions, the subtropical ridge shifts ∼5° latitude toward the north, and precipitable water increases by as much as ∼1.2 cm (∼0.5 inches). Parcels in the middle troposphere ascend into the region from the southeast, and the atmosphere becomes more unstable. The result is a significant increase in the frequency of deep convection, as determined from CTT < -38°C. During both monsoon regimes, most of the water vapor entering the Sonoran Desert at low-levels (below 700 mb) arrives from over the northern and central Gulf of California, with a slightly greater flux into the region occurring during the dry phase. Above 700 mb, moisture transported into the Sonoran Desert during both regimes is a mixture of water vapor from over the Gulf of Mexico and Gulf of California, and from residual convective inputs over the Sierra Madre Occidental mountains of Mexico. During wet periods, however, a longer fetch through the moist air mass above western Mexico results in a greater moisture flux into the Sonoran Desert aloft. Less water vapor from over the Gulf of Mexico flows into western Mexico and the Sonoran Desert under wet conditions than during dry phases, both above and below 700 mb.


text:
Insights / Transportation
How much does electric vehicle charging infrastructure actually cost?
By Sam Pournazeri
We analyzed EV charger cost data from more than 240 projects to help EV infrastructure planners get the biggest bang for their buck.
From consumer sales to federal legislation, 2021 was an exciting year for electric vehicles (EVs). While the sales of internal combustion engines went down from 204 million vehicles in 2019 to 166 million in 2021, the sales of EVs reached a new all-time high. Despite supply chain and the chip-shortage issues, almost 167,000 light duty plug-in electric vehicles were sold in the U.S. in the third quarter of 2021—doubling sales from the same time frame in 2019.
This is paired with the zero-emission vehicle announcement and executive orders from the White House. In August 2021, the Biden administration set a target of 50% EV sales by 2030. Later in December 2021, the administration called for a zero-emissions federal fleet by 2027. Critical to achieving these goals is access to charging infrastructure that will power this increase in EVs. Last year, the Biden administration set a goal to increase the number of charging stations in the U.S. to 500,000 by the end of this decade—a 10-fold increase in the number of chargers from today's level.
With these orders in place and the increased consumer enthusiasm for EVs, the real question remains: How much will this massive public EV infrastructure buildout cost?
As part of the Infrastructure Investment and Jobs Act (IIJA), $7.5 billion is allocated for the nationwide deployment of EV charging stations—only half of what the White House initially proposed for EV charging. With this limited funding, combined with ambitious EV targets, it is more important than ever to get a better understanding of the actual cost of EV charging infrastructure. Doing so will allow us to maximize the utility of these funds through a proper EV infrastructure planning.
Over the past three years, multiple studies conducted by various non-profit organizations such as the International Council on Clean Transportation (ICCT), the National Renewable Energy Laboratory (NREL), Rocky Mountain Institute (RMI), and the Environmental Defense Fund (EDF) estimated the cost of EV charging infrastructure deployment, including the cost of equipment, installation, needed utility upgrades (e.g., grid interconnections).
Considering the known challenges with EV infrastructure deployment, it is no surprise to see a significant cost variability across these studies. While these studies provided similar estimates for the equipment costs, the installation and utility upgrade costs varied significantly. A list of estimates provided by these studies is shown below in Table 1.
Go to ICF
Analyzing significant variabilities in cost estimates
To further elaborate on the variability of EV infrastructure cost, we recently acquired EV charging infrastructure cost data associated with projects funded by the California Energy Commission through the California Electric Vehicle Infrastructure Project (CALeVIP). The CALeVIP, implemented by the Center for Sustainable Energy (CSE), provides incentives for EV charger installations, and works with local partners on projects that support regional EV needs for Level 2 and DC fast-charging units (DCFCs).
Between December 2017 and October 2021, the program funded 244 projects to deploy more than 500 Level 2 chargers with charging capacities ranging from 7 kW to 10 kW and approximately 300 DCFCs with charging capacities ranging from 50 kW to 63 kW. A summary of the cost data from CALeVIP projects are illustrated in the two whisker-box plots below.
While on average, the equipment and installation cost for both Level 2 and DC fast chargers lines up with the recent published studies, this dataset clearly shows the significant variability across different projects. For Level 2 chargers, the total cost of EV charger deployment can vary between $2,700 to $24,000 per charger (excluding outliers), and for DCFCs, it can range from $70,000 to $130,000.
It is apparent that while there are some levels of variability across the equipment cost, the cost of installation is what mainly drives the variability for the total cost of deployment. For example, for DCFCs, while the equipment cost varies from $18,000 to $61,000 (excluding outliers), the installation costs range from as low as $4,000 to as high as $137,000.
The installation cost variability is an inherent challenge to EV charging infrastructure deployment. This is mainly because there are several different variables involved in determining the total cost of installing a charger including the number of chargers per site, permitting/code requirements, site preparation cost, availability of grid interconnection, grid capacity, utility upgrades (e.g., transformers/switchgears), parking availability, and the level of construction needed. With all these elements in mind, it should not be surprising to see such a wide range of cost for public charging stations. However, this could certainly pose a challenge when it comes to budgeting mass deployment of chargers across the nation.
While it will be hard to say how many chargers the IIJA can end up deploying, using the average cost data extracted from CALeVIP, $7.5 billion might be able to fund around 500,000 Level 2 chargers or approximately 73,000 DCFC units. However, those numbers can significantly change knowing the appreciable variability in the cost of installation. Of course, with proper planning and rigorous analysis of the available data on hand, we can find the most cost-effective and equitable ways of building the charging network across the nation to facilitate the much-needed transition to zero-emission transportation in this decade.
Using data to develop solutions
Unlike EV consumer purchases, the cost of developing EV infrastructure doesn't come with a one-size-fits-all price tag. Similarly, cities, states, and regions all face distinct challenges when it comes to implementation—ranging from weather to population density. As the nation works towards its latest zero-emission goals, proper EV infrastructure planning is required to ensure a successful deployment.
To optimize funding, stakeholders need to be aware that making federal EV ambitions a reality requires careful data analysis combined with expert industry knowledge. Our team's deep knowledge of EV charging technology and its installation hurdles, combined with the latest tools, offer guidance to state and local agencies, transportation planners, and utilities as they embark on their EV infrastructure goals.
Sam Pournazeri, Director, Transportation and Energy
5 actions for utilities to prepare for IRA impacts
Shift to GA4 means evolving your tracking and reporting strategy
3 data analytics tips to accelerate mission outcomes


Z&Z Cleaning Services is specialized in residential and office cleaning services. We provide the most dependable and experienced staff ready to deliver quality cleaning services and the special care you deserve. Our goal is to provide high standard cleaning service for the best price. Our prices vary depending on House/Apartment/Office size and frequency of the service. We guarantee rates are competitive and you will be satisfied with our cleaning services.
Z&Z Cleaning Services coves all areas in Kyiv and its suburbs. We will gladly provide you with an estimate for our services – call us for your FREE property cleaning estimate at (044) 383 7277.


text:
Sonic Riders är ett spel för GameCube Playstation 2, Xbox och Microsoft Windows. Dess mål är att spelfiguren Sonic åker på en svävande snowboard som man ska styra igenom banorna. Han får en rival som heter Jet och han har med sig ett gäng som också åker på svävande snowboard.

Sonic the Hedgehog
Playstation 2-spel
Xbox-spel
Windows-spel
GameCube-spel
Datorspel 2006
Datorspel med antropomorfa figurer
Spel med enspelarläge och flerspelarläge

redpajama_set_name: RedPajamaWikipedia


text:
Previous article : « Italy returns to the old austerity (...) »
Next article : « Threat to Africa's parks »
> April 2021
Conflicting identities, clan interests
Montenegro's ragged coalition
Montenegro changed government democratically for the first time last August, after being in turn communist, pan-Serbian nationalist, separatist, then pro-European. But the new administration faces the same pressures as before.
by Philippe Descamps & Ana Otasevic
Bishop Joanikije Mićović with demonstrators on the Sinjajevina plateau, October 2020
Philippe Descamps
Last October, on the Sinjajevina plateau in the mountains of northern Montenegro, a group of local activists huddled around a bonfire in the biting cold. Supported by ecologists, they were fighting to prevent the military from taking over this austere yet beautiful pastureland.
Milan Sekulović, who founded the Save Sinjajevina association in 2018, told us, 'The last government wanted to use this area, around Lake Savina Voda, for military exercises and destroying obsolete munitions. The plan threatens around 50 family livestock farms when the number of smallholders is already falling because of a lack of government support, and investment in roads and electricity. We import 80% of our food, but we could develop livestock farming and self-sufficiency.'
The last administration, led by Milo Đukanović, who had been in power since the days of communist Yugoslavia, suffered a shock election defeat on 30 August 2020, but activists are still waiting for a firm commitment from the new government. It is underconsiderable external pressure: since 2017 the Montenegrin army has been part of NATO, whose secretary-general Jens Stoltenberg is equivocal. Last October he told journalists, 'I'm ... confident that there are ways to reconcile the need to protect nature and, at the same time, to exercise forces, which is important for all Allies' (1). It's a sensitive issue because NATO bombed Montenegro, then still part of Serbia, during the Kosovo war in 1999 (2). As well as smallholders and ecologists, it mobilises all who identify primarily as Serbs and object to the monopoly on power held for many years by those who identify as Montenegrin. (Some consider the identities to be very close, if not identical.)
Up on the Sinjajevina plateau, a giant in a cassock extracted himself from an all-terrain vehicle and walked briskly towards the activists, his beard blowing in the wind. It was Joanikije Mićović, bishop of Budimlje-Nikšić and number two in the Serbian Orthodox Church in Montenegro.
He began by offering to baptise anyone who wanted it on the shore of the little lake. Then he declared, 'This is a pivotal moment, our final battle against communism and what it did to Montenegro after 1945. People today are returning to their faith. They are defending the land, natural resources, everything on which their lives and survival depend. They are also defending their heritage, their family history.'
People today are returning to their faith ... defending the land, natural resources, everything on which their lives and survival depend Joanikije Mićović
To the bishop and his audience, the ecological fight echoes the struggle against a freedom of religion law introduced in December 2019, which they see as an attempt to rob the Serbian Orthodox Church of its monasteries and places of worship. Mićović spent three days in police custody last May. 'They wanted to take away not only our churches, but our identity too. We had no choice but to demonstrate,' he said. 'It brought people together, and 100,000 of us took to the streets, which is equivalent to 10 million in France.'
Political chameleon
President Đukanović's Democratic Party of Socialists (Demokratska Partija Socijalista, DPS), an astonishing political chameleon that is a direct descendant of the League of Communists of Yugoslavia, remained in power for 30 years despite many changes of political direction. It first supported, then opposed Serbia's president Slobodan Milošević; it was Russophile; then advocated independence; then became Atlanticist. It survived scandals involving its leadership, and an exodus of young people from Montenegro, but was finally brought down by an identity issue: setting out to build a Montenegrin Orthodox Church that would appoint its own head, at the expense of the Serbian Orthodox Church, to which most of the population still belongs.
At the last census, in 2011, 72% of the population recorded their religion as Orthodox, 19% as Muslim, and 3% as Catholic. By ethnicity, citizens identified as Montenegrin (45% of the overall population), Serb (28.7%), Bosniak (8.6%) or Albanian (4.9%), but many who identified as Montenegrin are members of the Serbian Church. During the communist era, it was felt more respectable to identify as Montenegrin, as 90% did in the 1948 census, and 68% in 1981 (when 3.3% identified as Serb).
The emergence of a Montenegrin national identity distinct from the Serbian identity is not a result of historical and geographical factors alone, according to Amaël Cattaruzza, an expert in geopolitics: 'The authoritarian policies of Slobodan Milošević in Serbia and the strategy adopted by the international community (mainly the US and the EU), which sought to isolate the Serbian regime, helped to swell the ranks of sovereigntist protesters in Montenegro. These protesters justified their demands by championing a certain idea of Montenegrin national identity, based sometimes on ethnic and sometimes on civic criteria' (3). After Milošević's removal, in 2000, the breakup of the State Union of Serbia and Montenegro led to independence for Montenegro; 55% of the population voted for it in 2006, overriding those who identified primarily as Serbs.
The identity issue hides a social question: Montenegro is divided most of all by unequal development. Covering just over 12,000 sq km, with a population of only 620,000, it has 66 millionaires, but a quarter of Montenegrins live below the poverty line, which was less than €2,261 a year for a single person in 2019 (4). Even more significant are the huge regional disparities, reflected in 2018 (pre-Covid) unemployment rates: 36.6 % in the north, which voted for change; 3.9 % in the coastal region (5).
Mourning Metropolitan Amfilohije Radović at Cetinje, October 2020
Ana Otašević
Coastline now a playground for rich
The new marina at Porto Montenegro, on the shores of the Adriatic, is in another world. The huge naval dockyard at Tivat, once the pride of the Yugoslav navy, is now a hangout for rich foreigners: there are yachts for hire at €165,000 a week, prestige hotels (kitsch imitations of those on the French Riviera) and luxury boutiques. The Bay of Kotor, a huge, winding gulf with many creeks, fishing villages and several medieval towns listed by Unesco as world heritage sites,has changed in the last 20 years. Foreign investors, attracted by tax concessions, have concreted over the coastline with no regard for its natural and historical treasures, or for planning regulations.
On the eve of independence in 2006, the Canadian Peter Munk, founder of Barrick Gold, the world's largest gold producer, was flying over the bay in a military helicopter chartered by Đukanović, then prime minister, when he spotted the naval dockyard, which still employed nearly 500 workers. The two men signed an agreement under which the new Montenegrin state would sell Munk 30 well-situated hectares of land for €23m (6). The Russian oligarch Oleg Deripaska, who has since 2005 owned the Podgorica aluminium smelter Uniprom KAP, Montenegro's only big industrial company, has invested in what is to become a new Monaco, along with the British investment banker Jacob Rothschild and the French tycoon Bernard Arnault.
We are not going to ignore the interference that has been taking place since 2016, since the moment Russia decided to impede Montenegro's accession to NATO Milo Đukanović
The Montenegrin government is promoting luxury tourism and foreign investment on sites abandoned by the Yugoslav armed forces. At Kumbor, the other side of the Bay of Kotor, Arzu and Leyla Aliyeva, daughters of Azerbaijan's president Ilham Aliyev, and his father-in-law Arif Pashayev are building a luxury development; on Luštica Bay, the Egyptian company Orascom Development, controlled by billionaire Samih Sawiris, is building apartments. Vanja Ćalović is executive director of MANS (Network for Affirmation of the NGO Sector), which fights corruption in Montenegro, though the revelations it has published have not as yet led to any prosecutions. 'Behind all these projects,' she told us, 'as with the new motorway project, you find Bemax, a Montenegrin subcontractor with close links to the last government. The Bemax empire has swallowed up all other construction companies in the country.'
Other hotel, casino and amusement park projects are linked to organised crime. The best known is the Hotel Splendid at Bečići, just south of Budva, which hosted the extravagant weddings of the son and daughter of Montenegro's 'godfather' Branislav Mićunović. Ćalović told us that the hotel, like many others, is rumoured to have been built without planning permission.
'Lion's share of the corruption'
Milka Tadić Mijović, co-founder of the independent weekly Monitor and president of the Centre for Investigative Journalism of Montenegro, said, 'Those at the top take the lion's share of the corruption. Over the last 30 years, most state enterprises have been privatised, and the process has lacked transparency. Đukanović and his family have become the richest people in Montenegro. His brother Aleksandar, who was unemployed, now controls the capital of Montenegro's biggest bank, Prva Banka. His sister Ana, who was a judge during the privatisations, now owns one of the country's biggest law firms. Any foreign investor who wants to avoid problems has an interest in using its services.'
Revelations published by Monitor and the opposition dailies Dan and Vijesti have brought trouble for journalists critical of the government, including a bomb attack on Vijesti's offices, a journalist shot and wounded, and defamation campaigns in newspapers with links to the DPS. Mijović told us, 'Since independence, there have been more than 30 physical attacks on our journalists. The daily newspaper Pobjeda has published more than 200 articles about us. They have called me a prostitute and a traitor to my country. It took me seven years to win one court case against them. Most of these attacks have never been punished, which suggests that the government is behind them somewhere.'
The change of government did not include Đukanović, who was elected president for a five-year term in 2018. During this new period of cohabitation, he will retain an important, if secondary, role. We asked him about the extent of corruption in Montenegro, but his answer seemed rehearsed: 'We are a small community, and everything gets exaggerated. Moreover, because of the unique circumstances in Montenegro, we had no change of government for 30 years. Those who aspired to replace the government tried to discredit it by any means available, including exaggerating the scale of corruption. The problem certainly exists, but it is also certain that the state is taking it seriously.'
When we mentioned revelations that had not led to any prosecutions, suggesting a culture of impunity, he replied, 'That's a completely false perception. People very close to me have been tried and sentenced.' Đukanović was referring to his former right-hand man Svetozar Marović, president of the state of Serbia and Montenegro 2003-06 and number two in the DPS. He was arrested in 2015 on charges of corruption and involvement in organised crime, found guilty and sentenced to 44 months in prison, but fled to Serbia. The government presented the fall of the 'Marović clan' as evidence of its fight against organised crime; the opposition interpreted it as an internal settling of scores. Mijović said, 'The most important thing for Montenegro now would be to get an independent justice system. If we do get one,I'm sure many other scandals involving Đukanović and his family will emerge.'
Bar-Belgrade motorway viaduct over Morača gorge, October 2020
'The law is being hijacked'
To gauge the sense of impunity that poisoned the election campaign, we took a boat trip on Lake Skadar with Dražen Ivanović, formerly in charge of the 16 rangers who guard the national park surrounding it. The park has outstanding biodiversity and is home to some of Europe's last pelicans and hundreds of other bird species. The lake, which straddles the border with Albania, was once filled with carp, eels and other fish that were good eating.
For nine years Ivanović hunted poachers who use electrofishing and other illegal techniques. He showed us the remains of unauthorised buildings whose construction he had managed to stop. Last summer he resigned, disgusted by the lack of resources and the feeble punishments handed out when so many natural species are under threat: 'The fines don't do much to deter fishermen who break the rules. They can afford to pay them if they get caught. And we have only five boats, which are far too slow. The law is being tragically hijacked.'
The river Tara, another of Montenegro's natural wonders, has the triple protection of designation as a national park, a Unesco listing and a parliamentary declaration. All this has not prevented irreparable damage during the construction of a motorway from the Montenegrin port of Bar to the Serbian border village of Boljare and on to Belgrade. The 170km stretch from the Adriatic to the Serbian border includes some 40 tunnels and 80 bridges. A viaduct already towers over the Morača gorge. When we visited, one of the piers was decorated with a huge Montenegrin flag, celebrating the completion of the first stage of construction.
The motorway, a source of national pride, would not have been possible without foreign investors. The Export-Import Bank of China has provided a loan of €809m to cover the cost of the first 41km section, which is being built by the China Road and Bridge Corporation. The entire project is expected to cost €2.5bn, around half of Montenegro's GDP. According to Aleksandar Perović, executive director of the environmental organisation Ozon, ecocide and corruption go hand-in-hand. He is pressing the new government to draw up an ecological plan: 'We are concerned that our society is entering a period of revanchism, and our initiative aims to go beyond the spurious talk of patriotism. If we truly wish to defend our country, we should start by defending our natural environment and our fragile natural resources.'
On 31 October we visited the monastery at Cetinje, for centuries a bastion of resistance against the Ottomans, and the historical heart of Montenegro (see map). The precincts were crowded withpeople who had come to pay their last respects to Amfilohije Radović, metropolitan of the Serbian Orthodox Church and figurehead of resistance to the last government. Inside, representatives of the new government, including Prime Minister Zdravko Krivokapić, stood around the open coffin. Radović had been a victim of the second wave of Covid-19, which has hit the Balkans hard. He had toured Montenegro tirelessly since his appointment in 1990, working to rebuild his church.
Radović was a skilled politician too, supporting Đukanović when he turned away from his mentor Milošević in 1997. Radović was silent during the independence campaign of 2006, but later criticised the government's power-grabbing and bestowal of sinecures, which it did under cover of constructing a Montenegrin nationalism (which he considered fake) through language and religion. He was also critical of Serbia's president Aleksandar Vučić and his political horse-trading over Kosovo (7).
'We have lost our archbishop'
Next day, thousands of people gathered outside the cathedral in Podgorica for Radović's funeral, with little regard for health precautions. As the procession arrived, they knelt spontaneously. Svetozar Pavićević, 95, who had come on foot from his home village, said, 'We have lost our archbishop, who united the people.' The president was conspicuously absent, but another head of state, Vučić, was in the front row, alongside religious dignitaries from across the Orthodox world. It was his first visit to Montenegro since coming to power in Serbia (as prime minister in 2014, then as president in 2017).
Despite the apparent coldness of Vučić's relations with Đukanović, the two have much in common: absolute authority, a taste for gigantic projects funded by foreign investors, and governing their country as if it was a family business, with a stranglehold on institutions and media (8).
In an interview on the opposition TV channel Vijesti, Vučić defended himself against accusations of having secret links with Đukanović and interfering in elections in Montenegro. 'I'm not the American ambassador, so I don't try to tell them who can and can't be in the government,' he said, implying that any external pressures on Podgorica there may be don't come from Belgrade. A few days earlier, US Ambassador Judy Rising Reinke had called on Krivokapić to ensure that 'people appointed to posts in the new government, especially to sensitive roles in the security sector, have a proven attachment to western values, to Montenegro's sovereignty, and to the Euro-Atlantic line, which includes responsibilities to NATO' (9).
Montenegro's new prime minister used to teach mechanical engineering at the University of Montenegro in Podgorica, and did not find forming a government easy. Chosen by the Montenegrin clergy, he took command of a ragged coalition of Atlanticist liberals, conservatives with ties to Serbia, ecologists and former socialists. He could not count on the support of a faithful political party, and faced scepticism from western governments. He told us, 'When we came to power, no one wanted to talk to us. On the evening of 30 August, I wrote seven letters to foreign embassies, but no one wanted to see us. They labelled us "pro-Russian" or "pro-Serb". They said that we were endangering regional stability, and that Montenegro was no longer trustworthy.'
Montenegro's path to independence
Cécile Marin
'Democracy we can now aspire to'
Krivokapić had to act quickly.The new government's leaders met on 8 September, again under the auspices of the Church, at the monastery in Ostrog, where they agreed on a number of undertakings designed to reassure the West: to increase cooperation with NATO; to implement the reforms required for accession to the EU; to respect the constitution and the symbols of the state (flag, national anthem); and not to go back on Montenegro's recognition of Kosovo's independence. After the Ostrog meeting, the German ambassador agreed to meet Krivokapić, who told us, 'It wasn't an official meeting — we didn't publish a declaration. I talked about my experiences in Germany, and told him that for me, Helmut Kohl was the incarnation of the kind of democracy I wanted for Montenegro, and to which we could now aspire.'
Đukanović, an expert on western intentions, visited Berlin on 7 October. He told us about the warning he had given his opponents: 'If the new government endangers the state, it will have a problem with everyone who respects ten centuries of Montenegrin independence. And we will defend that independence by any means necessary. We are not going to ignore the obvious interference that has been taking place since 2016, since the moment Russia decided to impede Montenegro's accession to NATO. That interference can be seen in the presence of high volumes of illegal funds, in Russia's strong influence over the media via Serbia, and in the involvement of intelligence services.'
The final makeup of the new government was only revealed on 4 December. The main difficulty had been the appointment to ministerial roles of the leaders of the Democratic Front alliance — the largest contingent in the For the Future of Montenegro coalition, which included 27 of the 41 MPs in the new parliamentary majority suspected of having links to Russia and Serbia. Andrija Mandić and Milan Knežević have been sentenced to five years in prison over the mysterious attempted 'coup' of 2016. They have appealed against their conviction as being based on trumped-up charges. But they have already had to give up part of their programme — taking Montenegro out of NATO. Mandić admitted, 'We wanted a referendum on NATO membership, but we don't have a political majority for that.'
Deputy prime minister Dritan Abazović, a liberal Atlanticist and darling of the West, explained the trick the new government had used: 'I don't believe Washington has anything against a government of experts.' The Montenegrin parliament accepted a government of technocrats, and Democratic Front MPs decided to put up with this, hoping to gain ground on their priority issues. Mandić said, 'Our first priority is government reform, getting rid of systems left over from the communist era. We also want to end discrimination against Serbs, who have been excluded from public sector jobs. And finally, we want to fight against the culture of impunity and bring in a lustration law to remove people who are corrupt.'
The pandemic and its impact on the economy, internal tensions and the ever-present supervision of the West all suggest the new government is not likely to have an easy time, especially as tensions between government and president have grown, and Đukanović intends to make full use of his prerogatives. He began 2021 by refusing to sign the first major laws passed by parliament, notably the repeal of the most controversial provisions of the religious freedom law. This symbolic gesture, which forced a second vote in parliament, shows that, after 30 years as leader of the DPS and the country, he is not afraid to stir up division to bolster his own position.
Philippe Descamps & Ana Otasevic
Philippe Descamps is a member of Le Monde diplomatique's editorial team; Ana Otašević is journalist and film director in Belgrade.
Translated by Charles Goulden
(1) 'Online pre-ministerial press conference by NATO Secretary General Jens Stoltenberg ahead of the meetings of NATO Defence Ministers', NATO, 21 October 2020.
(2) See Philippe Descamps, 'Kosovo's open wounds, twenty years on', Le Monde diplomatique, English edition, March 2019.
(3) Amaël Cattaruzza, Territoire et nationalisme au Monténégro (Territory and nationalism in Montenegro), L'Harmattan, Paris, 2011.
(4) 'Survey on income and living conditions (EU-SILC) 2019', Statistical Office of Montenegro (Monstat), 7 December 2020.
(5) Statistical Yearbook 2019, Monstat, 2019.
(6) Vijesti, Podgorica, 12 August 2013.
(7) See Jean-Arnault Dérens and Laurent Geslin, 'Balkan borderlands', Le Monde diplomatique, English edition, August 2019.
(8) See Jean-Arnault Dérens and Laurent Geslin, 'Serbia's strongman tightens his grip', Le Monde diplomatique, English edition, March 2020.
(9) Interview in Dan, Podgorica, 30 October 2020.
Cécile Marin Aperçu
Balkans are the new front line
Jean-Arnault Dérens & Laurent Geslin, July 2015
Fantasy of a Greater Serbia
J.-A. D. & L. G., July 2006 Aperçu
Kosovo's open wounds, twenty years on
Philippe Descamps, March 2019
français — Clientélisme et vertiges identitaires au Monténégro
Español — Clientelismo y devaneos identitarios en Montenegro
Deutsch — Neustart in Montenegro
日本語 — モンテネグロ、独立15年目の新たな船出
Here is a terrific article you should definitely read: "Montenegro's ragged coalition", by Philippe Descamps & Ana Otasevic (open access, April 2021) // https://mondediplo.com/9745
« Italy returns to the old austerity politics »
« Threat to Africa's parks »


text:
"""
HTTP statsd Service Mock
"""
import re

from stackinabox.services.service import StackInABoxService

class HttpStatsdService(StackInABoxService):

    def __init__(self):
        super(HttpStatsdService, self).__init__('statsd')
        self.register(StackInABoxService.PUT,
                      re.compile('^/$'),
                      HttpStatsdService.handler)
        self.register(StackInABoxService.POST,
                      re.compile('^/$'),
                      HttpStatsdService.handler)

    def handler(self, request, uri, headers):
        print('HttpStatsdService ({0}): Received {1}'
              .format(id(self), request.body))
        return (201, headers, '')

redpajama_set_name: RedPajamaGithub


text:
Drag Racing Videos
Wheels / Tires
DIY How To
Falcon Wing Doors
Gigafactory
The Boring Company
TESLARATI
VW CEO Diess talks EV sales, autonomy, and Elon Musk
(Credit: Herbert Diess/LinkedIn)
By Joey Klender
Volkswagen Auto Group CEO Herbert Diess has led his German car company to be one of the most respected in terms of large entities that have chosen to leave a long and successful past of producing gas-powered vehicles in favor of electrified models. Diess has worked long and hard to dissolve VW's past mistakes, especially the Dieselgate scandal from several years ago. However, in 2021, VW has left its blemished past behind it and is the most popular electrified brand in Europe, leading companies like Tesla, Peugeot, and Renault in the world's most robust market for electrified vehicles. Diess is a big part of this accomplishment and has one of the more keen eyes for the industry, self-admittedly behind Elon Musk.
Diess' thoughts on the EV industry and how 2021 has shaped it to be one of the most difficult and challenging sectors of the year due to semiconductor shortages, along with his plans for Volkswagen's electrified future and his respect for fellow auto CEO Elon Musk were discussed in a recent interview with CNN's Anna Stewart who caught up with the VW frontman at the International Motor Show in Munich.
50% of sales electric by 2030
Diess responds to Stewart's first inquiry, which regards VW's goal to have 50% of its sales be electric by 2030. "In Europe, we are already leading," Diess said, which is true based on the most recent figures from EU-EVs.com, showing Volkswagen has a comfortable lead over second-place Tesla by just over 20,000 vehicles. In other markets, Volkswagen is performing well. "Even in the US, we have been in second place for the last months, and in China, we are growing fast. We think we will become the market leader for EVs," Diess adds.
Volkswagen has absolutely taken on the EV initiative better than 99% of other car companies, making its goals the most believable moving forward. The ID. family of vehicles has performed incredibly well, with Volkswagen offering specific models for specific markets to keep things fresh, exciting, and relevant. The question is, will VW be able to keep up its domination of the European market when Tesla begins production at Giga Berlin later this year?
Global semiconductor shortage
One of the biggest bottlenecks in recent history, the global semiconductor supply shortage, has plagued automakers to scrap basic functions like "push-to-start" features in ICE vehicles. Diess, a usually optimistic person, admits that Volkswagen is still struggling with the shortages, and he is not quite sure when things will get better.
"It has gotten worse already. We expected that we would have relief after the summer break, which didn't happen because, in Malaysia, we had really quite significant problems with Covid," Diess added. "Some of our suppliers, the back ends of our suppliers are mostly based in Malaysia, and three plants were hit hard. We think that we will overcome this situation towards the end of the month, and then we should see relief."
In terms of autonomy, Diess is optimistic about the capabilities of self-driving cars. "We see a much bigger transition for the industry when cars are becoming autonomous because cars will be used differently, used by more people. You can send your children or your grandparents in a car somewhere. Now imagine!" Volkswagen previously claimed it could sell a self-driving system that charged by the hour, and it would be profitable doing it. However, Diess said the business still has a long way to go, and Volkswagen will likely roll out its first fleet in 2024 or 2026. "But it's now time to invest and to prepare. And that's what we are doing," he stated.
Volkswagen says it can profitably sell a self-driving system for €7 an hour
Volkswagen vs. Tesla
Diess holds high regard for Tesla CEO Elon Musk. The two are friends and have shared several compliments with each other on several occasions. Musk even took a ride in an ID.3 in Germany with Diess piloting the vehicle, which ignited rumors of a potential collaboration between the two automotive CEOs. Diess still holds the utmost respect for Musk and Tesla, calling the company's frontman "a brilliant guy" who "makes a difference. He's changing the world with his ventures."
Despite the two companies combating to dominate EV sales across the globe, Diess does not see any parallels between VW and Tesla. "We are quite different. He is very focused on Tesla, on his story. I'm running a big traditional company, which we try to prepare for the future. And I think we also require different characters. I like him a lot, but I think we are quite different."
As for whether Diess was ever offered the CEO job at Tesla, Herbert simply ended with, "I don't know," and a slight chuckle."
What do you think? Let us know in the comments below, or be sure to email me at [email protected] or on Twitter @KlenderJoey.
The Tesla Model 3 is driving the chip industry's transition into the post-silicon age
Tesla is sourcing auto components from suppliers in India: report
Recent Most Popular
'Dismayed' U.S. Lawmakers pen letter to Tesla's Musk questioning Xinjiang Showroom
Two "dismayed" United States Lawmakers have penned a letter to Tesla CEO Elon Musk...
Tesla unlikely to offer five or seven-seat Model X Plaid seating configurations again
Tesla is unlikely to offer the five or seven-seat configurations again for the Model...
SpaceX sets the stage for three Falcon 9 launches in six days
SpaceX has successfully tested a Falcon 9 rocket tasked with launching Italy's CSG-2 Earth...
Tesla Insurance goes live in Arizona and Ohio
Tesla Insurance has officially gone live in Arizona and Ohio, becoming the fourth and...
IIHS announces new ratings set for the safeguards of semi-autonomous vehicles
The Insurance Institute for Highway Safety (IIHS) has announced that it is developing a...
Copyright © TESLARATI. All rights reserved.


colors. I Work closely with local wool farmers and artisans, playing with texture and shape to develop a style that offers an exciting approach to Textile.
Wool & felting being a continuing element in my work.
Simplistic clean lines combined with structure and texture finishing.
Personal experience becomes a dialogue between art and textile.
The process is a combination of traditional craftsmanship and modern sustainable design.
My pieces are at once art, craft and design. Committed to prolonging the active lifetime of textile by using ecological and recycled fibers with minimum waste.
I am Icelandic but live in The Netherlands and travel regularly to Iceland for inspiration and work at my studio in Reykjavik. I studied Fashion & Textile Design (BA & MS) in The Netherlands and France.