-
Notifications
You must be signed in to change notification settings - Fork 8
Usbd MSC windows minimum scsi implementation #47
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
Open
alexrayne
wants to merge
7
commits into
insane-adding-machines:master
Choose a base branch
from
alexrayne:usbd-FRC
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9415f2d
*usbd:USBD_DEBUG - now accepts numeric verbosity level.
alexrayne 34e79c4
*usbd:USBD_LOG - continue migrate to USBD_LOG, make messages shorter
alexrayne e4e171b
*usbd:msc:backend:msc_lba_t - a bit fine code introduced typedef for …
alexrayne 187aa70
+usbd:msc:scsi:USB_MSC_SCSI_READ_FORMAT_CAPACITIES support - requred …
alexrayne a0691e9
*usbd:log - shorter messages
alexrayne de582cb
<usbd:log enhanses
alexrayne 9831aa0
!windows:msc - provided minimum api for msc requres <inquiry serial> …
alexrayne 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 hidden or 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
This file contains hidden or 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 |
---|---|---|
|
@@ -92,6 +92,8 @@ struct sbc_sense_info { | |
uint8_t ascq; | ||
}; | ||
|
||
|
||
#define USBD_MSC_SEC_SIZE 512 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea 👍 |
||
struct usb_msc_trans { | ||
struct usb_msc_cbw cbw; | ||
|
||
|
@@ -103,7 +105,7 @@ struct usb_msc_trans { | |
uint32_t block_count; | ||
uint32_t current_block; | ||
|
||
uint8_t msd_buf[512]; | ||
uint8_t msd_buf[USBD_MSC_SEC_SIZE]; | ||
|
||
struct usb_msc_csw csw; | ||
}; | ||
|
@@ -257,7 +259,7 @@ static void scsi_read_capacity(usbd_msc *ms, | |
enum trans_event event) | ||
{ | ||
if (EVENT_CBW_VALID == event) { | ||
uint32_t last_logical_addr = ms->backend->block_count - 1; | ||
msc_lba_t last_logical_addr = usbd_msc_blocks(ms->backend)-1; | ||
trans->msd_buf[0] = last_logical_addr >> 24; | ||
trans->msd_buf[1] = 0xff & (last_logical_addr >> 16); | ||
trans->msd_buf[2] = 0xff & (last_logical_addr >> 8); | ||
|
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.
Look ok to me but,
Tab between "uint32_t" "msc_lba_t;"
(Not nitpicking) but a space is sufficient.
In other part of the code (was a typedef), you use a space instead.
Please read more code of the project and maintain the same pattern/code style.