-
Notifications
You must be signed in to change notification settings - Fork 199
Atmel SAM driver: let gmac_dev_read() return the proper length #950
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -621,6 +621,9 @@ uint32_t gmac_dev_read( gmac_device_t * p_gmac_dev, | |||||
return GMAC_RX_NO_DATA; | ||||||
} | ||||||
|
||||||
/* Return the number of bytes received. */ | ||||||
*p_rcv_size = bytesLeft; | ||||||
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.
Suggested change
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. 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. Hi @AniruddhaKanhere, |
||||||
|
||||||
/* gmac_dev_poll has confirmed that there is a complete frame at | ||||||
* the current position 'ul_rx_idx' | ||||||
*/ | ||||||
|
@@ -693,8 +696,6 @@ uint32_t gmac_dev_read( gmac_device_t * p_gmac_dev, | |||||
|
||||||
p_gmac_dev->ul_rx_idx = nextIdx; | ||||||
|
||||||
*p_rcv_size = bytesLeft; | ||||||
|
||||||
return GMAC_OK; | ||||||
} | ||||||
|
||||||
|
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.
Is it necessary to compare with frame size?
The
*p_rcv_size
might be different whenul_frame_size
is smaller thanbytesLeft + 2
.