Skip to content

Commit

Permalink
Merge with develop
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Nov 11, 2023
1 parent 43bd575 commit 7bcd43d
Show file tree
Hide file tree
Showing 14 changed files with 1,218 additions and 1,307 deletions.
16 changes: 9 additions & 7 deletions cpp/controllers/scsi_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,15 @@ void ScsiController::Command()

void ScsiController::Execute()
{
stringstream s;
s << "Controller is executing " << command_mapping.find(GetOpcode())->second.second << ", CDB $"
<< setfill('0') << hex;
for (int i = 0; i < BUS::GetCommandByteCount(static_cast<uint8_t>(GetOpcode())); i++) {
s << setw(2) << GetCmdByte(i);
}
LogDebug(s.str());
if (spdlog::get_level() == spdlog::level::trace) {
stringstream s;
s << "Controller is executing " << command_mapping.find(GetOpcode())->second.second << ", CDB $"
<< setfill('0') << hex;
for (int i = 0; i < BUS::GetCommandByteCount(static_cast<uint8_t>(GetOpcode())); i++) {
s << setw(2) << GetCmdByte(i);
}
LogTrace(s.str());
}

// Initialization for data transfer
ResetOffset();
Expand Down
2 changes: 1 addition & 1 deletion cpp/devices/scsi_daynaport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ int SCSIDaynaPort::Read(cdb_t cdb, vector<uint8_t>& buf, uint64_t)
return DAYNAPORT_READ_HEADER_SZ;
}

byte_read_count += rx_packet_size * read_count;
byte_read_count += rx_packet_size;

LogTrace("Packet Size " + to_string(rx_packet_size) + ", read count: " + to_string(read_count));

Expand Down
25 changes: 2 additions & 23 deletions cpp/hal/gpiobus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ int GPIOBUS::CommandHandShake(vector<uint8_t> &buf)

bool ack = WaitACK(true);

#ifdef NO_DELAY
// Wait until the signal line stabilizes
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
#endif

buf[0] = GetDAT();

SetREQ(false);
Expand All @@ -69,10 +64,6 @@ int GPIOBUS::CommandHandShake(vector<uint8_t> &buf)

ack = WaitACK(true);

#ifdef NO_DELAY
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
#endif

// Get the actual SCSI command
buf[0] = GetDAT();

Expand Down Expand Up @@ -103,11 +94,6 @@ int GPIOBUS::CommandHandShake(vector<uint8_t> &buf)

ack = WaitACK(true);

#ifdef NO_DELAY
// Wait until the signal line stabilizes
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
#endif

buf[offset] = GetDAT();

SetREQ(false);
Expand Down Expand Up @@ -136,11 +122,6 @@ int GPIOBUS::ReceiveHandShake(uint8_t *buf, int count)

const bool ack = WaitACK(true);

#ifdef NO_DELAY
// Wait until the signal line stabilizes
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
#endif

*buf = GetDAT();

SetREQ(false);
Expand Down Expand Up @@ -168,10 +149,6 @@ int GPIOBUS::ReceiveHandShake(uint8_t *buf, int count)
break;
}

#ifdef NO_DELAY
// Wait until the signal line stabilizes
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
#endif

*buf = GetDAT();

Expand Down Expand Up @@ -211,6 +188,8 @@ int GPIOBUS::SendHandShake(uint8_t *buf, int count, int delay_after_bytes)
if (actmode == mode_e::TARGET) {
for (bytes_sent = 0; bytes_sent < count; bytes_sent++) {
if (bytes_sent == delay_after_bytes) {
spdlog::trace("DELAYING for " + to_string(SCSI_DELAY_SEND_DATA_DAYNAPORT_US) + " us after " +
to_string(delay_after_bytes) + " bytes");
SysTimer::SleepUsec(SCSI_DELAY_SEND_DATA_DAYNAPORT_US);
}

Expand Down
12 changes: 12 additions & 0 deletions cpp/piscsi/localizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Localizer::Localizer()
Add(LocalizationKey::ERROR_DEVICE_MISSING_FILENAME, "en", "Device type %1 requires a filename");
Add(LocalizationKey::ERROR_DEVICE_MISSING_FILENAME, "de", "Gerätetyp %1 erfordert einen Dateinamen");
Add(LocalizationKey::ERROR_DEVICE_MISSING_FILENAME, "sv", "Enhetstypen %1 kräver ett filnamn");
Add(LocalizationKey::ERROR_DEVICE_MISSING_FILENAME, "fr", "Périphérique de type %1 à besoin d'un nom de fichier");
Add(LocalizationKey::ERROR_DEVICE_MISSING_FILENAME, "es", "El tipo de dispositivo %1 requiere un nombre de archivo");
Add(LocalizationKey::ERROR_DEVICE_MISSING_FILENAME, "zh", "设备类型 %1 需要一个文件名");

Expand All @@ -66,6 +67,7 @@ Localizer::Localizer()
Add(LocalizationKey::ERROR_IMAGE_FILE_INFO, "en", "Can't create image file info for '%1'");
Add(LocalizationKey::ERROR_IMAGE_FILE_INFO, "de", "Image-Datei-Information für '%1' kann nicht erzeugt werden");
Add(LocalizationKey::ERROR_IMAGE_FILE_INFO, "sv", "Kunde ej skapa skivbildsfilsinfo för '%1'");
Add(LocalizationKey::ERROR_IMAGE_FILE_INFO, "fr", "Ne peux pas créer les informations du fichier image '%1'");
Add(LocalizationKey::ERROR_IMAGE_FILE_INFO, "es", "No se puede crear información de archivo de imagen para '%1'");
Add(LocalizationKey::ERROR_IMAGE_FILE_INFO, "zh", "无法为'%1'创建图像文件信息");

Expand Down Expand Up @@ -114,6 +116,7 @@ Localizer::Localizer()
Add(LocalizationKey::ERROR_DETACH, "en", "Couldn't detach device");
Add(LocalizationKey::ERROR_DETACH, "de", "Geräte konnte nicht entfernt werden");
Add(LocalizationKey::ERROR_DETACH, "sv", "Kunde ej koppla ifrån enheten");
Add(LocalizationKey::ERROR_DETACH, "fr", "Impossible de détacher le périphérique");
Add(LocalizationKey::ERROR_DETACH, "es", "No se ha podido desconectar el dispositivo");
Add(LocalizationKey::ERROR_DETACH, "zh", "无法卸载设备");

Expand Down Expand Up @@ -176,54 +179,63 @@ Localizer::Localizer()
Add(LocalizationKey::ERROR_SCSI_CONTROLLER, "en", "Couldn't create SCSI controller");
Add(LocalizationKey::ERROR_SCSI_CONTROLLER, "de", "SCSI-Controller konnte nicht erzeugt werden");
Add(LocalizationKey::ERROR_SCSI_CONTROLLER, "sv", "Kunde ej skapa SCSI-gränssnitt");
Add(LocalizationKey::ERROR_SCSI_CONTROLLER, "fr", "Impossible de créer le contrôleur SCSI");
Add(LocalizationKey::ERROR_SCSI_CONTROLLER, "es", "No se ha podido crear el controlador SCSI");
Add(LocalizationKey::ERROR_SCSI_CONTROLLER, "zh", "无法创建 SCSI 控制器");

Add(LocalizationKey::ERROR_INVALID_ID, "en", "Invalid device ID %1 (0-%2)");
Add(LocalizationKey::ERROR_INVALID_ID, "de", "Ungültige Geräte-ID %1 (0-%2)");
Add(LocalizationKey::ERROR_INVALID_ID, "sv", "Ogiltigt enhets-id %1 (0-%2)");
Add(LocalizationKey::ERROR_INVALID_ID, "fr", "ID de périphérique invalide %1 (0-%2)");
Add(LocalizationKey::ERROR_INVALID_ID, "es", "ID de dispositivo inválido %1 (0-%2)");
Add(LocalizationKey::ERROR_INVALID_ID, "zh", "无效的设备 ID %1 (0-%2)");

Add(LocalizationKey::ERROR_INVALID_LUN, "en", "Invalid LUN %1 (0-%2)");
Add(LocalizationKey::ERROR_INVALID_LUN, "de", "Ungültige LUN %1 (0-%2)");
Add(LocalizationKey::ERROR_INVALID_LUN, "sv", "Ogiltigt enhetsnummer %1 (0-%2)");
Add(LocalizationKey::ERROR_INVALID_LUN, "fr", "LUN invalide %1 (0-%2)");
Add(LocalizationKey::ERROR_INVALID_LUN, "es", "LUN invalido %1 (0-%2)");
Add(LocalizationKey::ERROR_INVALID_LUN, "zh", "无效的 LUN %1 (0-%2)");

Add(LocalizationKey::ERROR_LUN0, "en", "LUN 0 cannot be detached as long as there is still another LUN");
Add(LocalizationKey::ERROR_LUN0, "de", "LUN 0 kann nicht entfernt werden, solange noch eine andere LUN existiert");
Add(LocalizationKey::ERROR_LUN0, "sv", "Enhetsnummer 0 kan ej bli frånkopplat så länge som andra enhetsnummer är anslutna");
Add(LocalizationKey::ERROR_LUN0, "fr", "LUN 0 ne peux pas être détaché tant qu'il y'a un autre LUN");
Add(LocalizationKey::ERROR_LUN0, "es", "El LUN 0 no se puede desconectar mientras haya otro LUN");
Add(LocalizationKey::ERROR_LUN0, "zh", "LUN 0 无法卸载,因为当前仍有另一个 LUN。");

Add(LocalizationKey::ERROR_INITIALIZATION, "en", "Initialization of %1 failed");
Add(LocalizationKey::ERROR_INITIALIZATION, "de", "Initialisierung von %1 fehlgeschlagen");
Add(LocalizationKey::ERROR_INITIALIZATION, "sv", "Kunde ej initialisera %1 ");
Add(LocalizationKey::ERROR_INITIALIZATION, "fr", "Echec de l'initialisation de %1");
Add(LocalizationKey::ERROR_INITIALIZATION, "es", "La inicialización del %1 falló");
Add(LocalizationKey::ERROR_INITIALIZATION, "zh", "%1 的初始化失败");

Add(LocalizationKey::ERROR_OPERATION_DENIED_STOPPABLE, "en", "%1 operation denied, %2 isn't stoppable");
Add(LocalizationKey::ERROR_OPERATION_DENIED_STOPPABLE, "de", "%1-Operation verweigert, %2 ist nicht stopbar");
Add(LocalizationKey::ERROR_OPERATION_DENIED_STOPPABLE, "sv", "Operationen %1 nekades för att %2 inte kan stoppas");
Add(LocalizationKey::ERROR_OPERATION_DENIED_STOPPABLE, "fr", "Opération %1 refusée, %2 ne peut être stoppé");
Add(LocalizationKey::ERROR_OPERATION_DENIED_STOPPABLE, "es", "%1 operación denegada, %2 no se puede parar");
Add(LocalizationKey::ERROR_OPERATION_DENIED_STOPPABLE, "zh", "%1 操作被拒绝,%2 不可停止");

Add(LocalizationKey::ERROR_OPERATION_DENIED_REMOVABLE, "en", "%1 operation denied, %2 isn't removable");
Add(LocalizationKey::ERROR_OPERATION_DENIED_REMOVABLE, "de", "%1-Operation verweigert, %2 ist nicht wechselbar");
Add(LocalizationKey::ERROR_OPERATION_DENIED_REMOVABLE, "sv", "Operationen %1 nekades för att %2 inte är uttagbar(t)");
Add(LocalizationKey::ERROR_OPERATION_DENIED_REMOVABLE, "fr", "Opération %1 refusée, %2 n'est pas détachable");
Add(LocalizationKey::ERROR_OPERATION_DENIED_REMOVABLE, "es", "%1 operación denegada, %2 no es removible");
Add(LocalizationKey::ERROR_OPERATION_DENIED_REMOVABLE, "zh", "%1 操作被拒绝,%2 不可移除");

Add(LocalizationKey::ERROR_OPERATION_DENIED_PROTECTABLE, "en", "%1 operation denied, %2 isn't protectable");
Add(LocalizationKey::ERROR_OPERATION_DENIED_PROTECTABLE, "de", "%1-Operation verweigert, %2 ist nicht schützbar");
Add(LocalizationKey::ERROR_OPERATION_DENIED_PROTECTABLE, "sv", "Operationen %1 nekades för att %2 inte är skyddbar(t)");
Add(LocalizationKey::ERROR_OPERATION_DENIED_PROTECTABLE, "fr", "Opération %1 refusée, %2 n'est pas protégeable");
Add(LocalizationKey::ERROR_OPERATION_DENIED_PROTECTABLE, "es", "%1 operación denegada, %2 no es protegible");
Add(LocalizationKey::ERROR_OPERATION_DENIED_PROTECTABLE, "zh", "%1 操作被拒绝,%2 不可保护");

Add(LocalizationKey::ERROR_OPERATION_DENIED_READY, "en", "%1 operation denied, %2 isn't ready");
Add(LocalizationKey::ERROR_OPERATION_DENIED_READY, "de", "%1-Operation verweigert, %2 ist nicht bereit");
Add(LocalizationKey::ERROR_OPERATION_DENIED_READY, "sv", "Operationen %1 nekades för att %2 inte är redo");
Add(LocalizationKey::ERROR_OPERATION_DENIED_READY, "fr", "Opération %1 refusée, %2 n'est pas prêt");
Add(LocalizationKey::ERROR_OPERATION_DENIED_READY, "es", "%1 operación denegada, %2 no está listo");
Add(LocalizationKey::ERROR_OPERATION_DENIED_READY, "zh", "%1 操作被拒绝,%2 还没有准备好");
}
Expand Down
2 changes: 1 addition & 1 deletion easyinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ SECRET_FILE="$HOME/.config/piscsi/secret"
FILE_SHARE_PATH="$HOME/shared_files"
FILE_SHARE_NAME="Pi File Server"

APT_PACKAGES_COMMON="build-essential git protobuf-compiler bridge-utils"
APT_PACKAGES_COMMON="build-essential git protobuf-compiler bridge-utils dhcpcd"
APT_PACKAGES_BACKEND="libspdlog-dev libpcap-dev libprotobuf-dev protobuf-compiler libgmock-dev clang"
APT_PACKAGES_PYTHON="python3 python3-dev python3-pip python3-venv python3-setuptools python3-wheel libev-dev libevdev2"
APT_PACKAGES_WEB="nginx-light genisoimage man2html hfsutils dosfstools kpartx unzip unar disktype gettext"
Expand Down
4 changes: 2 additions & 2 deletions python/web/src/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@
<label for="download_url">{{ _("Download file from URL:") }}</label>
<input name="url" id="download_url" required="" type="url">
<label for="disk_images" class="hidden">{{ _("Disk Images") }}</label>
<label for="images_subdir">{{ _("To directory:") }}</label>
<input type="radio" name="destination" id="disk_images" value="disk_images" checked="checked">
<label for="images_subdir" class="hidden">{{ _("Directory") }}</label>
<select name="images_subdir" id="images_subdir">
{% for dir in images_subdirs %}
<option value="{{dir}}">{{env['image_root_dir']}}/{{dir}}</option>
Expand All @@ -406,7 +406,7 @@
{% if file_server_dir_exists %}
<label for="shared_files" class="hidden">{{ _("Shared Files") }}</label>
<input type="radio" name="destination" id="shared_files" value="shared_files">
<label for="shared_subdir" class="hidden">{{ _("Directory") }}</label>
<label for="shared_subdir" class="hidden">{{ _("To directory:") }}</label>
<select name="shared_subdir" id="shared_subdir">
{% for dir in shared_subdirs %}
<option value="{{dir}}">{{env['shared_root_dir']}}/{{dir}}</option>
Expand Down
4 changes: 2 additions & 2 deletions python/web/src/templates/upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h2>{{ _("Upload File from Local Computer") }}</h2>
<legend>{{ _("Destination") }}</legend>
<label for="disk_images" class="hidden">{{ _("Disk Images") }}</label>
<input type="radio" name="destination" id="disk_images" value="disk_images" checked="checked">
<label for="images_subdir" class="hidden">{{ _("Directory") }}</label>
<label for="images_subdir" class="hidden">{{ _("To directory:") }}</label>
<select name="images_subdir" id="images_subdir">
{% for dir in images_subdirs %}
<option value="{{dir}}">{{ env['image_root_dir'] }}/{{dir}}</option>
Expand All @@ -26,7 +26,7 @@ <h2>{{ _("Upload File from Local Computer") }}</h2>
{% if file_server_dir_exists %}
<label for="shared_files" class="hidden">{{ _("Shared Files") }}</label>
<input type="radio" name="destination" id="shared_files" value="shared_files">
<label for="shared_subdir" class="hidden">{{ _("Directory") }}</label>
<label for="shared_subdir" class="hidden">{{ _("To directory:") }}</label>
<select name="shared_subdir" id="shared_subdir">
{% for dir in shared_subdirs %}
<option value="{{dir}}">{{ env['shared_root_dir'] }}/{{dir}}</option>
Expand Down
Loading

0 comments on commit 7bcd43d

Please sign in to comment.