RASCSI/src/raspberrypi/devices/scsihd.h
Uwe Seimet d80fbec03d
Added support for .hd1 (SCSI-1) image files (#828)
* Added support for .hd1 (SCSI-1) image files

* Update c-cpp.yml

* Fixed unit test warnings

* Fixed wrong scan default default (must be 1, not -1)

* Updated max length check

* Removed file not present in develop branch

* Added unit test

* Added workflow configurations and README updates (#832)

* automated test try 1

* filter branches

* filter branches

* filter branches

* filter branches

* filter branches

* Configured build and test CI workflows

* enable for all branches

* Update README.md

* Update README.md

Co-authored-by: Tony Kuker <akuker@gmail.com>

* Fix simple SonarCloud issues (#834)

* Fixing SonarCloud issues, first round

* Fixing SonarCLoud issues, next round

* Fixing SonarQube issues, next round

* Fixed warning

* Replaced empty constructors/destructors with = default;

* Fixed warning

* Replaced new

* Use constants instead of macros

* Use structured binding declarations

* Use init statements for if

* Use string views

* Use enum class, use using instead of typedef

* Fixed more SonarCloud warnings

* Replaced redundant/duplicate types with auto

* Devlared methods const

* Memory management update

* Fixed warning

* Added missing const

* Improved RaScsiResponse memory management

* Improved memory management

* Improved memory management

* Replaced macros by constants, removed unused constants

* Made member private

* Fixed warning

* Added comment

* Fixed shadowing warnings

* Cleanup

* Cleanup

* Cleanup

* Fixed shadowing warning

* Removed unused code

* Fixed more warnings

* Removed obsolete casts

* Fixed warnings

* Removed unused field

* Removed library not needed by rasctl

* Include cleanup

* Updated platform check for better compatibility

* Improved check for invalid option. This prevents rasctl to break on macos.

* Updated option check

* Fixed typo

* Added TODO

* Removed macro

* Scope update

* Replaced macro

* Added TODO, update memory management

* Fixed typo

* Replaced NULL by nullptr

* Use more structured bindings

* Added TODO

* Use calloc instead of mallco to not need memset

* Fixed warnings

* Fixed SonarQube initialization issues

* Fixed warning

* Cleaned up override/virtual/final

* Fixed warnings

* Constructor update

* Fixed tests

* Improved memory management

* Added missing const

* Added const

* Fixed two bugs reported by SonarCloud

* Fix SonarCloud hotspot

* Fixed memory management

* Memory management update

* Addressing hotspot by using strncpy

* Fixed SonarCloud issues

* Fixed SonarQube issues

* Added missing const

* Added const

* Added const

* Suppress false positive

* Added SonarQube suppressions for false positives

* Added suppresoin

* Fixed code smells

* Reverted changes that is a SonarQube issue, but caused problems with -O3

* Removed TODO based on review

* Update c-cpp.yml

* Finalized merge

Co-authored-by: akuker <34318535+akuker@users.noreply.github.com>
Co-authored-by: Tony Kuker <akuker@gmail.com>
2022-09-07 21:45:00 -05:00

45 lines
1.1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//---------------------------------------------------------------------------
//
// SCSI Target Emulator RaSCSI Reloaded
// for Raspberry Pi
//
// Copyright (C) 2001-2006 (ytanaka@ipc-tokai.or.jp)
// Copyright (C) 2014-2020 GIMONS
// Copyright (C) akuker
//
// Licensed under the BSD 3-Clause License.
// See LICENSE file in the project root folder.
//
// [ SCSI hard disk ]
//
//---------------------------------------------------------------------------
#pragma once
#include "os.h"
#include "disk.h"
#include "filepath.h"
class SCSIHD : public Disk, public FileSupport
{
public:
SCSIHD(const unordered_set<uint32_t>&, bool, scsi_defs::scsi_level = scsi_level::SCSI_2);
virtual ~SCSIHD() {}
void FinalizeSetup(const Filepath&, off_t);
void Reset();
void Open(const Filepath&) override;
// Commands
vector<BYTE> InquiryInternal() const override;
void ModeSelect(const DWORD *cdb, const BYTE *buf, int length) override;
void AddFormatPage(map<int, vector<BYTE>>&, bool) const override;
void AddVendorPage(map<int, vector<BYTE>>&, int, bool) const override;
private:
scsi_defs::scsi_level scsi_level;
};