sysprog21 / vwifi

A virtual wireless device driver for Linux
MIT License
203 stars 39 forks source link

Implement customized naming for wiphy #57

Closed vax-r closed 8 months ago

vax-r commented 8 months ago

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 of wiphy_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 for struct 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

vax-r commented 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.

jserv commented 8 months ago

Thank @vax-r for contributing!