thats why i guess, we cannot do it…i have not much time for cleaning up this hugh folder…tried to do it a bit, but there is also much garbage in it (references to LTE,GPS-Driver in makefiles/code that is not existent)…there are many compiler-switches in the code currently not used.
maybe we can push code outside the driver/misc/mediatek-folder like watchdog and genetlink to avoid porting that every time…as a first step
@garywang / @Ryder.Lee: i made a pull-request for merging wlan-branch into 4.16-main…there i see some changes in cpu-section in dtsi:
I doubt it is a linaro bug, I also spent some time on it with gcc 7, although not this one specific as far as I can remember. Couldn’t find it at the time either… but I suspect some shady coding, perhaps even compiler flags.
strange tried building 4.14-main (also with this wifi-driver) and no error occour…and this error/warning is not the only one in kernel 4.16…
e.g. this is outside the wifi-driver and also not compilable with gcc7-cross
drivers/usb/core/hcd.c:460:34: warning: '%s' directive output may be truncated writing up to 64 bytes into a region of size between 35 and 99 [-Wformat-truncation=]
snprintf (buf, sizeof buf, "%s %s %s", init_utsname()->sysname,
^~
init_utsname()->release, hcd->driver->description);
~~~~~~~~~~~~
drivers/usb/core/hcd.c:460:3: note: 'snprintf' output 3 or more bytes (assuming 131) into a destination of size 100
snprintf (buf, sizeof buf, "%s %s %s", init_utsname()->sysname,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
init_utsname()->release, hcd->driver->description);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [drivers] Error 2
for wifi-driver i can disable the following -Werror…but this is imho not the right way and does not solve compile-issues outside wifi-driver:
Where should I copy the WMT_SOC.cfg file to? There is no folder named “system” on my SD card (it is Your ubuntu-18.04-bpi-r2-preview.img … thank You for that too).
The file bpi-r2_4.18.0-rc1_rc.tar.gz does not yet contain the last commit from main-branch?
create a /etc/hostapd/hostapd_ap0.conf and run wifi.sh
for automatic creation this is simply done:
wmt_loader.c:18++
#define WCN_COMBO_LOADER_DEV "/dev/wmtdetect"
gLoaderFd = open(WCN_COMBO_LOADER_DEV, O_RDWR | O_NOCTTY);
// Get Device ID
chipId = ioctl(gLoaderFd, COMBO_IOCTL_GET_SOC_CHIP_ID, NULL);
// Set Device ID
iRet = ioctl(gLoaderFd, COMBO_IOCTL_SET_CHIP_ID, chipId);
// do module init
iRet = ioctl(gLoaderFd, COMBO_IOCTL_DO_MODULE_INIT, chipId);
these values are handled here:
drivers/misc/mediatek/connectivity/common/common_detect/wmt_detect.c:83 static long wmt_detect_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
so we need to place the wmtloader-code in wmt_detect.c instead of waiting for a file-operation
I’m trying to get things working on OpenWrt with 3.14 kernel and those drivers on top and having some problems with that. Either a device cannot connect claiming WPA handshake failed or, sometimes, it can connect but then works only for a couple of minutes, gets disassociated and continues to fail WPA handshakes then. I have custom patches that rename interfaces (to get OpenWrt play better with them) but apart from that it’s effectively @frank-w 's drivers port[1]. Any idea what is going wrong? Errors on hostapd side are pretty vague:
root@abbradarrouter:~# hostapd hostapd-mtkp2p0.conf
Configuration file: hostapd-mtkp2p0.conf
mtkap0: interface state UNINITIALIZED->COUNTRY_UPDATE
mtkap0: interface state COUNTRY_UPDATE->HT_SCAN
Using interface mtkap0 with hwaddr 02:08:22:00:0b:c6 and ssid "foo"
mtkap0: interface state HT_SCAN->ENABLED
mtkap0: AP-ENABLED
mtkap0: STA c4:0b:cb:85:b9:3b IEEE 802.11: associated
mtkap0: AP-STA-CONNECTED c4:0b:cb:85:b9:3b
mtkap0: STA c4:0b:cb:85:b9:3b WPA: pairwise key handshake completed (RSN)
mtkap0: STA c4:0b:cb:85:b9:3b IEEE 802.11: disassociated
mtkap0: AP-STA-DISCONNECTED c4:0b:cb:85:b9:3b
mtkap0: STA c4:0b:cb:85:b9:3b IEEE 802.11: associated
mtkap0: STA c4:0b:cb:85:b9:3b IEEE 802.11: disassociated
mtkap0: STA c4:0b:cb:85:b9:3b IEEE 802.11: associated
mtkap0: STA c4:0b:cb:85:b9:3b IEEE 802.11: disassociated
mtkap0: STA c4:0b:cb:85:b9:3b IEEE 802.11: associated
mtkap0: STA c4:0b:cb:85:b9:3b IEEE 802.11: disassociated
My hostapd configuration is pretty much barebones:
I’ve built a full-featured hostapd which has a debug log[1]. It’s as if at some point the chip stops sending and receiving messages. Notice that the first (successful) connection when during key exchange there are EAPOL_RX events and the next ones when there are no such events at all and key exchange timeouts.
I’ve tried installing haveged and also looked at diff between my and yours dts-es – there were some changes which I ported but it made no difference. If you have the radio working, can you show me your dmesg from the moment when you run wmt_loader till you have connection for some time?
Nah, that’s not going to help after all – I thought the problem is in Cannot find pinctrl defaulterror but I managed to solve it and nothing has changed.
Does anyone have a stable connection (by that I mean that fast.com running some time doesn’t kill the AP)? If so, on what kernel and did you make any tweaks to hostapd.conf or something else? I’m trying to get results with the official LEDE image now to see what’s different.
I’ve tested more and it turns out it works normally on official LEDE image. It’s also broken without my custom changes to connectivity driver meaning that possible reasons are:
I’ve forgot to take some change from @frank-w’s tree;
It doesn’t work on 4.14 at all.
Unfortunately I can’t just test @frank-w’s kernel because it’s not trivial to make OpenWrt run on it.
@frank-w@garywang how is combo chip connected to the CPU? I think which .dts changes may be relevant; I didn’t yet port fixes for SDIO for example. Could that be relevant?
In my mutiple tries to port (4.14, 4.16, 4.17, 4.18) i got no ap0 device if i forgot anything in dts(i).
Wifi-chip (mt6626l) is connected via btif (similar to uart). If this node is wrong (different compatible or clock) kernel crashes. If main-node is disabled you get timeout on echo A.
the problem looks more like wpasupplicant or similar is running (or just installed). Try to remove that if you found it
@abbradar how do you solve “Cannot find pinctrl default”-Error? I looked in hostapd-log on my router and found no eapol timeouts
From my very limited understanding on newer kernels when there’s only one pinctrl state entry it’s placed under PINCTRL STATE DEFAULT. Anyway this doesn’t change anything, and I’m not even sure that’s needed – I think it’s done automatically by the kernel when there’s only one entry. Notice that this is all half-assumptions! Just to be sure earlier I listed all state entries in that place – only default is there.