-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
RTL8139/RTL8168 driver #504
base: master
Are you sure you want to change the base?
Conversation
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.
cursory look, between lectures; I don't know whether the driver itself is correct yet though.
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.
LGTM with my somewhat limited knowledge.
* This class serves to encapsulate the peculiarities of queue indices, especially their | ||
* wrap-around modular arithmetic. | ||
*/ | ||
struct QueueIndex { |
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.
This seems like something that is better suited to maybe put in frigg?
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.
this seems like it's part of a more general ring buffer style container
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.
Yeah it also seems like it's used this way in the code. Might be cleaner to just use a straight up ring-buffer container.
struct TxQueue { | ||
TxQueue(size_t descriptors, RealtekNic &nic); | ||
|
||
virtual ~TxQueue() = default; |
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.
What's the need for this virtual destructor?
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.
gcc complains otherwise: warning: delete called on 'TxQueue' that is abstract but has non-virtual destructor
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'll trust your judgement on the driver code itself since i have damn near zero experience with the RTLs this is a driver for.
seems good overall, a few comments left.
p.s. sorry about the delay.
struct RxQueue { | ||
RxQueue(size_t descriptors, RealtekNic &nic); | ||
|
||
uintptr_t getBase() { |
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.
could be const
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.
If I make getBase
constant, gcc complains about the operator[]
method not being const.
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.
make that const too then :)
(rather, there needs to be two overloads)
Addressed the comments above and rebased on master. |
The driver is now capable of sending and receiving packets somewhat reliably on my revision of the RTL8168 card (MacVer46, rtl8168h). |
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.
LGTM
Depends on managarm/frigg#58.