mirror of
https://github.com/thewesker/RASCSI.git
synced 2025-12-20 12:21:10 -05:00
Disabled SEL interrupt functionality so we can receive IP packets without delays. Some updates for receiving messages. Appears that the HD functionality still works, but others are untested
This commit is contained in:
3
src/raspberrypi/.vscode/launch.json
vendored
3
src/raspberrypi/.vscode/launch.json
vendored
@@ -8,13 +8,14 @@
|
|||||||
"name": "(gdb) Launch",
|
"name": "(gdb) Launch",
|
||||||
"type": "cppdbg",
|
"type": "cppdbg",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceFolder}/bin/rascsi",
|
"program": "${workspaceFolder}/bin/fullspec/rascsi",
|
||||||
"args": [],
|
"args": [],
|
||||||
"stopAtEntry": true,
|
"stopAtEntry": true,
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"environment": [],
|
"environment": [],
|
||||||
"externalConsole": false,
|
"externalConsole": false,
|
||||||
"MIMode": "gdb",
|
"MIMode": "gdb",
|
||||||
|
"miDebuggerPath": "${workspaceFolder}/launch_sudo.sh",
|
||||||
"setupCommands": [
|
"setupCommands": [
|
||||||
{
|
{
|
||||||
"description": "Enable pretty-printing for gdb",
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ BUS::phase_t FASTCALL SCSIDEV::Process()
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Phaes
|
// Phases
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -2083,3 +2083,32 @@ BOOL FASTCALL SCSIDEV::XferMsg(DWORD msg)
|
|||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Transfer IP packet to the host via SCSI
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
BOOL FASTCALL SCSIDEV::TransferPacketToHost(int packet_len){
|
||||||
|
|
||||||
|
// Aquire the bus
|
||||||
|
|
||||||
|
// Reselection
|
||||||
|
|
||||||
|
// Message OUT (expect a "NO OPERATION")
|
||||||
|
// IF we get a DISCONNECT message, abort sending the message
|
||||||
|
// Transition to MESSAGE IN and send a DISCONNECT
|
||||||
|
// then go to BUS FREE
|
||||||
|
|
||||||
|
// DATA IN
|
||||||
|
// ... send the packet
|
||||||
|
|
||||||
|
// MESSAGE OUT (expect a "NO OPERATION")
|
||||||
|
|
||||||
|
// If more packets, go back to DATA IN
|
||||||
|
|
||||||
|
// Else
|
||||||
|
// MESSAGE IN (sends DISCONNECT)
|
||||||
|
|
||||||
|
// BUS FREE
|
||||||
|
}
|
||||||
@@ -102,6 +102,8 @@ public:
|
|||||||
BOOL FASTCALL IsSCSI() const {return TRUE;}
|
BOOL FASTCALL IsSCSI() const {return TRUE;}
|
||||||
// SCSI check
|
// SCSI check
|
||||||
|
|
||||||
|
BOOL FASTCALL TransferPacketToHost(int packet_len);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Phase
|
// Phase
|
||||||
void FASTCALL BusFree();
|
void FASTCALL BusFree();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
//
|
//
|
||||||
// Powered by XM6 TypeG Technology.
|
// Powered by XM6 TypeG Technology.
|
||||||
// Copyright (C) 2016-2020 GIMONS
|
// Copyright (C) 2016-2020 GIMONS
|
||||||
|
// Copyright akuker
|
||||||
//
|
//
|
||||||
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
|
// Imported NetBSD support and some optimisation patch by Rin Okuyama.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -460,22 +460,27 @@ void FASTCALL SCSINuvolink::SetMacAddr(BYTE *mac)
|
|||||||
// Receive Packet
|
// Receive Packet
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
void FASTCALL SCSINuvolink::ReceivePacket()
|
int FASTCALL SCSINuvolink::ReceivePacket()
|
||||||
{
|
{
|
||||||
static const BYTE bcast_addr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
static const BYTE bcast_addr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||||
|
|
||||||
ASSERT(this);
|
ASSERT(this);
|
||||||
ASSERT(tap);
|
ASSERT(tap);
|
||||||
LOGTRACE("SCSINuvolink::ReceivePacket");
|
//LOGTRACE("SCSINuvolink::ReceivePacket");
|
||||||
|
|
||||||
// previous packet has not been received
|
// // previous packet has not been received
|
||||||
if (packet_enable) {
|
// if (packet_enable) {
|
||||||
return;
|
// LOGDEBUG("packet not enabled");
|
||||||
}
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
// Receive packet
|
// Receive packet
|
||||||
packet_len = tap->Rx(packet_buf);
|
packet_len = tap->Rx(packet_buf);
|
||||||
|
|
||||||
|
if(packet_len){
|
||||||
|
LOGINFO("Received a packet of size %d",packet_len);
|
||||||
|
}
|
||||||
|
|
||||||
// Check if received packet
|
// Check if received packet
|
||||||
if (memcmp(packet_buf, mac_addr, 6) != 0) {
|
if (memcmp(packet_buf, mac_addr, 6) != 0) {
|
||||||
if (memcmp(packet_buf, bcast_addr, 6) != 0) {
|
if (memcmp(packet_buf, bcast_addr, 6) != 0) {
|
||||||
@@ -486,16 +491,23 @@ void FASTCALL SCSINuvolink::ReceivePacket()
|
|||||||
|
|
||||||
// Discard if it exceeds the buffer size
|
// Discard if it exceeds the buffer size
|
||||||
if (packet_len > 2048) {
|
if (packet_len > 2048) {
|
||||||
|
LOGDEBUG("Packet size was too big. Dropping it");
|
||||||
packet_len = 0;
|
packet_len = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store in receive buffer
|
// TransferPacket(packet_len, packet_buff);
|
||||||
if (packet_len > 0) {
|
return packet_len;
|
||||||
packet_enable = TRUE;
|
|
||||||
}
|
// // Store in receive buffer
|
||||||
|
// if (packet_len > 0) {
|
||||||
|
// packet_enable = TRUE;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Get Packet
|
// Get Packet
|
||||||
|
|||||||
@@ -44,16 +44,18 @@ public:
|
|||||||
// Destructor
|
// Destructor
|
||||||
|
|
||||||
// commands
|
// commands
|
||||||
int FASTCALL Inquiry(const DWORD *cdb, BYTE *buf, DWORD major, DWORD minor);
|
int FASTCALL Inquiry(const DWORD *cdb, BYTE *buffer, DWORD major, DWORD minor);
|
||||||
// INQUIRY command
|
// INQUIRY command
|
||||||
BOOL FASTCALL TestUnitReady(const DWORD *cdb);
|
BOOL FASTCALL TestUnitReady(const DWORD *cdb);
|
||||||
// TEST UNIT READY command
|
// TEST UNIT READY command
|
||||||
int FASTCALL GetMessage6(const DWORD *cdb, BYTE *buf);
|
int FASTCALL GetMessage6(const DWORD *cdb, BYTE *buffer);
|
||||||
// GET MESSAGE10 command
|
// GET MESSAGE10 command
|
||||||
BOOL FASTCALL SendMessage6(const DWORD *cdb, BYTE *buf);
|
BOOL FASTCALL SendMessage6(const DWORD *cdb, BYTE *buffer);
|
||||||
// SEND MESSAGE10 command
|
// SEND MESSAGE10 command
|
||||||
BOOL SendPacket(BYTE *buf, int len);
|
BOOL SendPacket(BYTE *buffer, int len);
|
||||||
// Send a packet
|
// Send a packet
|
||||||
|
int FASTCALL ReceivePacket();
|
||||||
|
// Receive a packet
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -77,17 +79,16 @@ private:
|
|||||||
static const char* m_revision;
|
static const char* m_revision;
|
||||||
|
|
||||||
#if defined(RASCSI) && !defined(BAREMETAL)
|
#if defined(RASCSI) && !defined(BAREMETAL)
|
||||||
int FASTCALL GetMacAddr(BYTE *buf);
|
int FASTCALL GetMacAddr(BYTE *buffer);
|
||||||
// Get MAC address
|
// Get MAC address
|
||||||
void FASTCALL SetMacAddr(BYTE *buf);
|
void FASTCALL SetMacAddr(BYTE *buffer);
|
||||||
// Set MAC address
|
// Set MAC address
|
||||||
void FASTCALL ReceivePacket();
|
void FASTCALL GetPacketBuf(BYTE *buffer);
|
||||||
// Receive a packet
|
|
||||||
void FASTCALL GetPacketBuf(BYTE *buf);
|
|
||||||
// Get a packet
|
// Get a packet
|
||||||
void FASTCALL SetMulticastRegisters(BYTE *buf, int len);
|
void FASTCALL SetMulticastRegisters(BYTE *buffer, int len);
|
||||||
// Change the multicast registers
|
// Change the multicast registers
|
||||||
|
void FASTCALL TransferPacketToHost(BYTE *buffer, int len);
|
||||||
|
// Transfer the received packet to the host
|
||||||
CTapDriver *tap;
|
CTapDriver *tap;
|
||||||
// TAP driver
|
// TAP driver
|
||||||
BOOL m_bTapEnable;
|
BOOL m_bTapEnable;
|
||||||
|
|||||||
3
src/raspberrypi/launch_sudo.sh
Executable file
3
src/raspberrypi/launch_sudo.sh
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
# This is used for debugging. VisualStudio code will call this file when launching
|
||||||
|
# the debugger, instead of directly calling GDB. That way we can add the pkexec
|
||||||
|
sudo /usr/bin/gdb "$@"
|
||||||
@@ -1136,6 +1136,31 @@ LOGCRITICAL("LOGCRITICAL");
|
|||||||
actid = -1;
|
actid = -1;
|
||||||
phase = BUS::busfree;
|
phase = BUS::busfree;
|
||||||
|
|
||||||
|
// If any of the controllers are an Ethernet
|
||||||
|
// device, check to see if there is new data
|
||||||
|
// received.
|
||||||
|
for (int x = 0; x < CtrlMax; x++) {
|
||||||
|
if (!ctrl[x]){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int y = 0; y < UnitNum; y++) {
|
||||||
|
int unitno = x * UnitNum + y;
|
||||||
|
// branch by unit type
|
||||||
|
if (disk[unitno]) {
|
||||||
|
if (disk[unitno]->GetID() == MAKEID('S','C','N','L')) {
|
||||||
|
// Receive the data....
|
||||||
|
int packet_len = ((SCSINuvolink*)disk[unitno])->ReceivePacket();
|
||||||
|
if(packet_len > 0){
|
||||||
|
((SCSIDEV*)ctrl[x])->TransferPacketToHost(packet_len);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_SEL_EVENT_ENABLE
|
#ifdef USE_SEL_EVENT_ENABLE
|
||||||
// SEL signal polling
|
// SEL signal polling
|
||||||
if (bus->PollSelectEvent() < 0) {
|
if (bus->PollSelectEvent() < 0) {
|
||||||
|
|||||||
@@ -39,7 +39,9 @@
|
|||||||
// Various Operation Settings
|
// Various Operation Settings
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
#define USE_SEL_EVENT_ENABLE // Check SEL signal by event
|
// For now, USE_SEL_EVENT_ENABLE is incompatible with the Nuvolink functionality.
|
||||||
|
// See https://github.com/akuker/RASCSI/issues/27 for more information
|
||||||
|
//#define USE_SEL_EVENT_ENABLE // Check SEL signal by event
|
||||||
#define REMOVE_FIXED_SASIHD_SIZE // remove the size limitation of SASIHD
|
#define REMOVE_FIXED_SASIHD_SIZE // remove the size limitation of SASIHD
|
||||||
#define USE_MZ1F23_1024_SUPPORT // MZ-1F23 (SASI 20M/sector size 1024)
|
#define USE_MZ1F23_1024_SUPPORT // MZ-1F23 (SASI 20M/sector size 1024)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user