-
-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NetBSD compatibility: Increase daynaport minimum packet size to 128 bytes (#1334) #1335
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
// Copyright (C) 2020 akuker | ||
// Copyright (C) 2014-2020 GIMONS | ||
// Copyright (C) 2001-2006 PI.([email protected]) | ||
// Copyright (C) 2023 Uwe Seimet | ||
// | ||
// Licensed under the BSD 3-Clause License. | ||
// See LICENSE file in the project root folder. | ||
|
@@ -212,13 +213,14 @@ int SCSIDaynaPort::Read(cdb_t cdb, vector<uint8_t>& buf, uint64_t) | |
// response->flags = e_no_more_data; | ||
// } | ||
int size = rx_packet_size; | ||
if (size < 64) { | ||
// A frame must have at least 64 bytes (see https://github.com/PiSCSI/piscsi/issues/619) | ||
if (size < 128) { | ||
// A frame must have at least 128 bytes (see https://github.com/PiSCSI/piscsi/issues/619 | ||
// and https://github.com/PiSCSI/piscsi/issues/1098. | ||
// Note that this work-around breaks the checksum. As currently there are no known drivers | ||
// that care for the checksum, and the Daynaport driver for the Atari expects frames of | ||
// 64 bytes it was decided to accept the broken checksum. If a driver should pop up that | ||
// breaks because of this, the work-around has to be re-evaluated. | ||
size = 64; | ||
// that care for the checksum, the Daynaport driver for the Atari expects frames of 64 bytes | ||
// and the driver for NetBSD 128 bytes it was decided to accept the broken checksum. | ||
// If a driver should pop up that breaks because of this, the work-around has to be re-evaluated. | ||
size = 128; | ||
} | ||
SetInt16(buf, 0, size); | ||
SetInt32(buf, 2, tap.HasPendingPackets() ? 0x10 : 0x00); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
// Copyright (C) 2020 akuker | ||
// Copyright (C) 2014-2020 GIMONS | ||
// Copyright (C) 2001-2006 PI.([email protected]) | ||
// Copyright (C) 2023 Uwe Seimet | ||
// | ||
// Licensed under the BSD 3-Clause License. | ||
// See LICENSE file in the project root folder. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if I missed the whole discussion elsewhere, but you're saying that the Atari driver expects 64 bit frames but can handle 128 bit frames too because it's a multiple of 64?
(The resulting code comment reads contradictory to me)
Also, I assume @benjamink is helping you test this change with the Mac drivers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this change successfully with the Atari driver, i.e. it can cope with 128 bytes. I guess anything > 64 bytes is fine, but 128 bytes definitely work.
Yes, @benjamink is doing the Mac tests.
The comment is indeed inconsistent. I just updated it, hope it is clearer now.