Closed vax-r closed 8 months ago
I just figured out why does the value of variable wiphy_counter
never decreased.
Since in this way they can ensure the name of each wiphy is abolutely unique.
There'll be no need to submit patches to linux kernel community.
However, I think we should still have a customized naming and indexing for wiphy in vwifi to separate vwifi's wiphy from other wiphy used in the kernel (you might have other projects also utilizing struct wiphy
).
I'll refine git commit message and the comments in the code later.
Thank @vax-r for contributing!
Summary
The default phy%d naming for wiphy in linux kernel depends on the value of a static variable
wiphy_counter
. Since they never attempts to decrease the value ofwiphy_counter
even a wiphy is unregistered or freed, this behavior ensures the naming and indexing for wiphy will be absolutely unique.However, the kernel might have other projects also utilize wiphy structure, which will cause some confusion of wiphy's index and naming when using
struct wiphy
. We implement a custom-made name "vw_phy%d" for wiphy in our project, in order to seperate the naming and indexing forstruct wiphy
in our project.As for the troublesome behavior causing by the never-decreasing index of wiphy structure as decribed in #54 , we suggest to make some changes when doing manual testing by finding the wiphy index of the interface first, and use the index to query the actual wiphy's name for the interface as describe in the changes of README.md.
Reference
Related issue
Fix #54