The attached patch improve the ability of VAPs to handle proc entries. Specifically it allows parts of the driver to register a proc entry and appropriate handlers with the vap. The vap will then take care of ensuring that this proc entry exists for the lifetime of the vap and that it is correctly relocated if the vap is renamed.
Previously these tasks had to be handled by whatever registered the proc entry, which promoted code duplication.
The list of proc entries for a specific vap is stored as a linked list. Two new methods are added.
The first is used to add a proc entry to the vap. It is called ieee80211_proc_vcreate:
int ieee80211_proc_vcreate(struct ieee80211vap *vap,
struct file_operations *fileops, char *name)
- vap - pointer to the vap to create the entry for
- fileops - pointer to methods to handle read/writes from the entry. Any NULL entries in this structure will be substituted with default entries. These default entries will use a proc_ieee80211_priv structure to provide a list of associated stations. Typically a caller will only need to provide an open method to read the desired information into the read buffer of the proc_ieee80211_priv structure.
- name - the name for the proc entry
The second method (ieee80211_proc_cleanup) is only used internally and cleans up the memory used by the linked list of proc entries when the vap is destroyed. ieee80211_proc_vdetach cannot be used for this purpose as it is used when a vap is being renamed. Were we to deallocate the linked list in the vdetach method all registered proc entries would be lost if a vap was renamed.
This patch will make it significantly easier to perform further development to add more information to the proc interface, please apply.
Signed-off-by: Matt Brown <matt@mattb.net.nz>