mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
![]() Instead of using a clunky if-statement paradigm, we now have all drivers being declaring two methods for their adapter class - create and probe. These methods are linked in each PCINetworkDriverInitializer structure, in a new s_initializers static list of them. Then, when we probe for a PCI device, we use each probe method and if there's a match, then the corresponding create method is called. After the adapter instance is created, we call the virtual initialize method on it, because many drivers actually require a sort of post-construction initialization sequence to ensure the network adapter can properly function. As a result of this change, it's much more easy to add more drivers and the initialization code is more readable and it's easier to understand when and where things could fail in the whole initialization sequence. |
||
---|---|---|
.. | ||
E1000ENetworkAdapter.cpp | ||
E1000ENetworkAdapter.h | ||
E1000NetworkAdapter.cpp | ||
E1000NetworkAdapter.h |