-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Goal: make it easier to incorporate changes to the BSD driver into this driver by creating a BSD-driver baseline and minimizing this driver's differences from that baseline. This way, incorporating BSD driver changes into this driver can be done by updating the baseline and then making the same changes to this driver. With the exception of using BCryptGenRandom instead of GetTickCount when picking the random ethernet address, I expect this to have no impact on the actual behavior of the driver -- this is just refactoring. DETAILS: import: - Add a copy of the files from the BSD driver. (I did the best I could to find the BSD driver version that looked like the baseline of this driver.) if_re_bsd.h: - Recreate. Start with the BSD driver's if_rereg.h, then apply changes needed to get this driver to build. Wrap all changes in `#ifdef _WIN32`. Goal is that every difference between this file and `if_rereg.h` are additions that are wrapped in the appropriate `#ifdef`. - Moved the "Our Additions" section of `re_softc` up to the top to be together with the `dev` field. - Moved `mtu`, `if_capenable`, and `if_hwassist` inside of a struct to help reduce the code differences between BSD and this driver. - Moved some definitions from `bsd.h` into this header so that they are closer to the corresponding BSD definitions. - Changed the Windows definitions of the DBGPRINT macros to more-closely match the BSD behavior. rtlhw.cpp: - Recreate. Similar to what was done with if_re_bsd.h - start with the BSD version then apply minimal changes to make it build, with all changes wrapped in appropriate `#ifdef _WIN32`. - Lots of whitespace changes, which can be ignored. - Changed the implementation of `random_ether_addr` to use `BCryptGenRandom` instead of `GetTickCount`. - Replaced `max_rx_mbuf_sz` with `MJUM9BYTES` to match the BSD driver. - Restored original function ordering (unfortunately this makes the diff harder to read). - Moving the `if_` variables inside of a field allows more of the code to match, so we end up with things like `ifp->if_mtu` instead of `sc->mtu`, but nothing has really changed in practice. adapter.cpp: device.cpp: - Some `re_softc` fields moved inside struct, so update references. bsd.h: - `stdint.h` isn't supported in kernel mode yet, so just define our own `uintN_t` types. - Move `intrin.h` into `precomp.h`. - Prefer typedef over macro. - Move some macros into if_re_bsd.h to be closer to the definition of the BSD version of the macro so it's easier to see how the BSD definition compares to the WIN32 definition. - Move the definition of random_ether_addr back into rtlhw.cpp in the same place as the BSD version. - Define placeholder types so we don't have to ifdef-out structs that use them. if_re.vcxproj: - Add dependency on Ksecdd.lib since we need BCryptGenRandom. - Fix precompiled header usage. (We should compile "precomp.cpp" with "CREATE", and then everything else in the project should compile with "USE".) rxqueue.cpp: txqueue.cpp: - Fix a few compiler warnings.
- Loading branch information
Showing
15 changed files
with
73,366 additions
and
31,406 deletions.
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
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
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
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
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
Oops, something went wrong.