Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
firmware
FFS Gluon
Commits
901b122d
Unverified
Commit
901b122d
authored
7 years ago
by
Julian Labus
Committed by
Matthias Schiffer
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
gluon-web-wifi-config: use find_phy from gluon.util
parent
734d1925
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/gluon-web-wifi-config/luasrc/lib/gluon/web/model/admin/wifi-config.lua
+2
-21
2 additions, 21 deletions
...i-config/luasrc/lib/gluon/web/model/admin/wifi-config.lua
with
2 additions
and
21 deletions
package/gluon-web-wifi-config/luasrc/lib/gluon/web/model/admin/wifi-config.lua
+
2
−
21
View file @
901b122d
...
@@ -4,21 +4,6 @@ local uci = require("simple-uci").cursor()
...
@@ -4,21 +4,6 @@ local uci = require("simple-uci").cursor()
local
util
=
require
'gluon.util'
local
util
=
require
'gluon.util'
local
function
find_phy_by_path
(
path
)
for
phy
in
fs
.
glob
(
"/sys/devices/"
..
path
..
"/ieee80211/phy*"
)
do
return
phy
:
match
(
"([^/]+)$"
)
end
end
local
function
find_phy_by_macaddr
(
macaddr
)
local
addr
=
macaddr
:
lower
()
for
file
in
fs
.
glob
(
"/sys/class/ieee80211/*/macaddress"
)
do
if
util
.
trim
(
fs
.
readfile
(
file
))
==
addr
then
return
file
:
match
(
"([^/]+)/macaddress$"
)
end
end
end
local
function
txpower_list
(
phy
)
local
function
txpower_list
(
phy
)
local
list
=
iwinfo
.
nl80211
.
txpwrlist
(
phy
)
or
{
}
local
list
=
iwinfo
.
nl80211
.
txpwrlist
(
phy
)
or
{
}
local
off
=
tonumber
(
iwinfo
.
nl80211
.
txpower_offset
(
phy
))
or
0
local
off
=
tonumber
(
iwinfo
.
nl80211
.
txpower_offset
(
phy
))
or
0
...
@@ -84,12 +69,8 @@ uci:foreach('wireless', 'wifi-device', function(config)
...
@@ -84,12 +69,8 @@ uci:foreach('wireless', 'wifi-device', function(config)
vif_option
(
'mesh'
,
translate
(
"Enable mesh network (802.11s)"
))
vif_option
(
'mesh'
,
translate
(
"Enable mesh network (802.11s)"
))
vif_option
(
'ibss'
,
translate
(
"Enable mesh network (IBSS)"
))
vif_option
(
'ibss'
,
translate
(
"Enable mesh network (IBSS)"
))
local
phy
local
phy
=
util
.
find_phy
(
config
)
if
config
.
path
then
if
not
phy
then
phy
=
find_phy_by_path
(
config
.
path
)
elseif
config
.
macaddr
then
phy
=
find_phy_by_macaddr
(
config
.
macaddr
)
else
return
return
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment