On Sun, Oct 11, 2015 at 10:31:00AM +0100, Carlos Meralto via Devel wrote:
> Finally I managed to create the file by debugfs.
> With debugfs_create_file("energy", 0777, phyd, &filevalue, &fops_debug);
> 
> And now I saw that the method: DEBUGFS_READONLY_FILE(energy, "%d",
> local->remain_energy); is not to be run periodically.
> 
> So i create a file in /sys/kernel/debug/ieee80211/phy0 but how i can
> refresh that value to use in mesh_hwmp.c? Put DEBUGFS_READONLY_FILE in
> ALM method calculation? Or exists some debugfs function that runs
> periodically?

You need to create a writable file in debugfs.  As an example, look at
debugfs_netdev.c for the "tsf" file.  When you write to the file from
userspace, you would then update some (new) battery level variable that
you store in either the struct ieee80211_local or struct
ieee80211_sta_info (depending on if this is the battery level for
_this_ device or for the one we're talking to).

mesh_hwmp.c will compute the airtime link metric when it needs it just like
it does currently.

Hopefully that is enough of a blueprint to go on.

-- 
Bob Copeland %% http://bobcopeland.com/
_______________________________________________
Devel mailing list
[email protected]
http://lists.open80211s.org/cgi-bin/mailman/listinfo/devel

Reply via email to