导入:widora github中的代码,LUCI中 WIFI设置没有WPA和WPA2加密选项 (marc)


  • administrators

    下载github中代码编译后,加入LUCI,发现WIFI密码加密项中没有WPA和WPA2的选项,请问是否是LUCI需要改动什么,还是wifi驱动问题呢?
    是luci暂时对ralink闭源驱动支持不好。
    你可以参考一下这个改法试试,忘了是哪个大神给我的了。

    diff -uNr a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua
    --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua	2016-06-14 01:59:09.675367523 +0000
    +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua	2016-06-14 02:00:52.573839173 +0000
    @@ -181,7 +181,13 @@
     	end
     
     	function ch.write(self, section, value)
    -		m:set(section, "hwmode", value[1])
    +
    +		if hwtype == "ralink" then
    +		   m:set(section, "hwmode", '11a')
    +		else
    +		   m:set(section, "hwmode", value[1])
    +		end
    +
     		m:set(section, "channel", value[2])
     		m:set(section, "htmode", value[3])
     	end
    @@ -740,6 +746,11 @@
     	encr:value("psk", "WPA-PSK")
     	encr:value("psk2", "WPA2-PSK")
     	encr:value("psk+psk2", "WPA-PSK/WPA2-PSK Mixed Mode")
    +
    +elseif hwtype == "ralink" then
    +        encr:value("psk", "WPA-PSK")
    +        encr:value("psk2", "WPA2-PSK")
    +        encr:value("psk+psk2", "WPA-PSK/WPA2-PSK Mixed Mode")
     end
     
     auth_server = s:taboption("encryption", Value, "auth_server", translate("Radius-Authentication-Server"))
    

    0_1477497494245_509a1417cba7f1ab914b1e2ec2153408294496ba_1_605x500.png