2.4Ghz and 5.6Ghz Wifi Working fine


(Yusuf Bülbül) #123

Hi Frank I solved the problem by changing the major number of wifi device as 155.

For this operation, I change #define WIFI_DEV_MAJOR 155 defination in the files

linux-mt/drivers/misc/mediatek/connectivity/common/combo/linux/wmt_chrdev_wifi.c
linux-mt/drivers/misc/mediatek/connectivity/common/conn_soc/linux/pub/wmt_chrdev_wifi.c

and I have rebuiled the kernel. The crash of spidev and wifi_dev has been removed.

cat /proc/devices
153 spi
154 mtk_wcn_detect
155 mtk_wmt_WIFI_chrdev

dmesg |grep -i wifi
[   21.342303] [MTK-WIFI] WIFI_init: mtk_wmt_WIFI_chrdev driver(major 155) installed.
[   21.342312] [WLAN-MOD-INIT][I]do_wlan_drv_init:WMT-WIFI char dev init, ret:0
[   23.376886] [MTK-WIFI] WIFI_open: WIFI_open: major 155 minor 0 (pid 848)
[   23.376931] [MTK-WIFI] WIFI_write: WIFI_write 1
[   25.638586] [WMT-FUNC][W]wmt_func_wifi_on:WMT-FUNC: wmt wlan func on before wlan probe
[   26.772321] [MTK-WIFI] register_set_p2p_mode_handler: (pid 858) register set p2p mode handler c07223e4
[   26.772349] [WMT-FUNC][W]wmt_func_wifi_on:WMT-FUNC: wmt call wlan probe ok
[   26.772448] [MTK-WIFI] WIFI_write: WMT turn on WIFI success!
[   26.772470] [MTK-WIFI] WIFI_close: WIFI_close: major 155 minor 0 (pid 848)

(Frank W.) #124

Can you use ap0?

Imho combo-folder is not used (removed in 4.14) so it must be changed only in conn_soc


(Yusuf Bülbül) #125

Yes. I can create and use ap0.

I am using kernel 4.4


(Frank W.) #126

According to http://elixir.free-electrons.com/linux/latest/source/Documentation/admin-guide/devices.txt major 154 (and 155) is assigned to “Specialix RIO serial card” but these should not be used on r2 so maybe we can use that. Else we have to use e.g. 60-63 (local/experiental)

tried on 4.14…same behaviour (as expected), fixed the same way

also uploaded fixed compiled version to my gdrive: https://drive.google.com/drive/folders/1EGN1TvqCpDHdOAS-mjRg9ipi0kahnOUV?usp=sharing

created an issue on sinovoips repo: https://github.com/BPI-SINOVOIP/BPI-R2-bsp/issues/27

also fixed in my 4.4-fork:


(Yusuf Bülbül) #127

Hi Frank.

I tried NAT operations with my new kernel. But; after command “iptables -S”. It gives this error.

modprobe: ERROR: could not insert 'ip_tables': Invalid argument
iptables v1.6.0: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

Have you any idea? Should I enabled something like iptables from kernel options?


(Frank W.) #128

there are some options that must be set to support iptables: you can look in my 4.14-defconfig

at least CONFIG_NETFILTER, CONFIG_IP_NF_NAT and CONFIG_NF_NAT_MASQUERADE_IPV4


(Yusuf Bülbül) #129

How Can I use insmod command to insert loadable kernel modules and where are the loadable kernel modules?


(Frank W.) #130

You have to build it with your kernel…i don’t knoe currently which are selected in the repo

the modules are .ko-files in /lib/modules/$(uname -r)

I usually use “modprobe modulename” to load it (underscore to dash)


(Yusuf Bülbül) #131

Hi Frank,

In the link of deconfig file which you give me above, the CONFIG_NF_NAT_MASQUERADE_IPV4 and CONFIG_IP_NF_NAT are marked as m (module). Also In my kernel marked these modules as Module.

And, I can’t marked these as y(yes) because they have many dependencies. How Can I find dependencies?


(Frank W.) #132

then you have to load it…

find /lib/modules/$(uname -r) -iname '*.ko'
modprobe ...

iptables must be loaded first. filename with underscore (_) is changed to dash (-) without .ko


(Yusuf Bülbül) #133

Should I load which sequences and name?

Example, there is a .ko file named “iptable_filter.ko” I enter the command;

modprobe iptable-filter

but gives an error

modprobe: ERROR: could not insert ‘iptable_filter’: Invalid argument

Also, There is ip_tables.ko file. But, ıt can’t be insterted.


(Frank W.) #134

have you tried

modprobe ip-tables

?


(Yusuf Bülbül) #135

Yes. I have tried but, It can’t be inserted.

modprobe: ERROR: could not insert ‘ip_tables’: Invalid argument.

There is ip_tables.ko file in modules folder


(Frank W.) #136

ok, please make a new thread for the iptables with your steps…here it is off-topic

i look at home which modules are loaded on my system


(Yusuf Bülbül) #137

Ok.

Accually, I think, My image was damaged. I have changed kernel and image. The problem is fixed. There is no kernel problem.


(peter.r.volkov) #138

How to set AP mode persistent? At the moment interface ap0 is not present after reboot, and I have to run echo A > /dev/wmtWifi everytime I boot system


(Frank W.) #139

Imho you have to call wmt-loader and stp-uart-launcher also on each reboot. Maybe in official ubuntu this is done via init-script,here you can append the echo-command (after a delay to give the previous commands time to create the wmtWifi-device)


(Mark Edworthy) #140

@frank-w, Can you confirm that it is not possible to create a bridge between the ethernet switch and the wlan interfaces?

I am attempting to try and create a bridge (bro) between eth0 and wlan0, whilst using wlan0 as an access point via the use of hostapd.

Also, something strange that I have noticed with this board is that the the 4 port switch is being displayed as eth0 and the single port rj45 is being displayed as eth1 (not a major issue).

Note: I have am using the recently provided CentOS image as a base for my installation.


(Frank W.) #141

which kernel do you use? in 4.14, eth0 represents not a ethernet-port…

have not tried to bridge wlan-interface and “normal” network-interface because i want to route traffic between interfaces


(Mark Edworthy) #142

Kernel version 4.4.70