-
Notifications
You must be signed in to change notification settings - Fork 115
Fix the slow speeds #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This is necessary to make the firmware start, in Linux too, not just in Windows. This fixes the slow download and even slower upload speeds.
Hi! This patch broken work driver. |
The patch breaks the driver? That's weird. I mean, I only tested it for two minutes, but it seemed to work. It improved the speed a lot: 95 megabits/second download, 75 upload. What happens when you try it? |
I guess your computer is different. On my Intel laptop the wifi interface is called wlp0s20f0u3. If you want to keep investigating, we'll need more information from the driver. Changing CONFIG_RTW_DEBUG to "y" in the Makefile will make it print more messages. |
I chose the adapter interface on purpose to show you that it doesn't work. After downloading the firmware and performing a reset, this is what your patch does, the adapter stops responding. Perhaps you had the same thing, and you got speeds on another adapter, because this adapter stopped working and system select other. |
I also do not exclude the possibility that your reset could affect the loading of the firmware not from the driver, but from its built-in efuse memory, so it works for you, but not on my adapter. |
That happened to me before 😂 but nowadays I make sure only one adapter is active so the system can't select another. It works here: 8710bu.txt Something must be different about your computer or your adapter. |
I always get this error: |
Interesting. It says the firmware "download" failed. The firmware checksum calculated by the adapter was wrong, so it's refusing to start. (At least I assume that's what happens, based on bit 2, MCU_FW_DL_CSUM_REPORT, being 0.) Can you upload the Windows driver stored in the adapter's flash memory? I want to see if the firmware in it is different. (I already checked the Windows driver from my device, it contains the same firmware you have in this repo.) |
I checked before, the firmware is the same as for Windows. |
But without your patch, everything works, the firmware is loaded and check pass OK. |
Indeed. _FWFreeToGo is only called if the checksum was correct. So then what kind of speeds do you get without my patch? |
Download 20-50Mbit, upload 3-5Mbit... |
Yes, that means the firmware is not actually functioning. Now I notice that your adapter is indeed different: Mine is: Something to try: diff --git a/hal/rtl8710b/rtl8710b_hal_init.c b/hal/rtl8710b/rtl8710b_hal_init.c
index b273f2c..9dcd45e 100644
--- a/hal/rtl8710b/rtl8710b_hal_init.c
+++ b/hal/rtl8710b/rtl8710b_hal_init.c
@@ -229,7 +228,7 @@ static s32 _FWFreeToGo(_adapter *adapter, u32 min_cnt, u32 timeout_ms)
value32 &= ~WINTINI_RDY;
rtw_write32(adapter, REG_8051FW_CTRL_V1_8710B, value32);
- _8051Reset8710(adapter);
+ // _8051Reset8710(adapter);
/* polling for FW ready */
do { If that doesn't help: diff --git a/hal/rtl8710b/rtl8710b_hal_init.c b/hal/rtl8710b/rtl8710b_hal_init.c
index b273f2c..9dcd45e 100644
--- a/hal/rtl8710b/rtl8710b_hal_init.c
+++ b/hal/rtl8710b/rtl8710b_hal_init.c
@@ -54,7 +54,7 @@ static int _BlockWrite(PADAPTER padapter, PVOID buffer, u32 buffSize)
{
int ret = _SUCCESS;
- u32 blockSize_p1 = 4; /* (Default) Phase #1 : PCI muse use 4-byte write to download FW */
+ u32 blockSize_p1 = 128; /* (Default) Phase #1 : PCI muse use 4-byte write to download FW */
u32 blockSize_p2 = 8; /* Phase #2 : Use 8-byte, if Phase#1 use big size to write FW. */
u32 blockSize_p3 = 1; /* Phase #3 : Use 1-byte, the remnant of FW image. */
u32 blockCount_p1 = 0, blockCount_p2 = 0, blockCount_p3 = 0;
@@ -71,14 +71,14 @@ static int _BlockWrite(PADAPTER padapter, PVOID buffer, u32 buffSize)
remainSize_p1 = buffSize % blockSize_p1;
for (i = 0; i < blockCount_p1; i++) {
-#if 0
-#ifdef CONFIG_USB_HCI
+//#if 0
+//#ifdef CONFIG_USB_HCI
ret = rtw_writeN(padapter, (FW_8710B_START_ADDRESS + i * blockSize_p1), blockSize_p1, (bufferPtr + i * blockSize_p1));
-#else
- ret = rtw_write32(padapter, (FW_8710B_START_ADDRESS + i * blockSize_p1), le32_to_cpu(*((u32 *)(bufferPtr + i * blockSize_p1))));
-#endif
-#endif
- ret = rtw_write32(padapter, (FW_8710B_START_ADDRESS + i * blockSize_p1), le32_to_cpu(*((u32 *)(bufferPtr + i * blockSize_p1))));
+//#else
+// ret = rtw_write32(padapter, (FW_8710B_START_ADDRESS + i * blockSize_p1), le32_to_cpu(*((u32 *)(bufferPtr + i * blockSize_p1))));
+//#endif
+//#endif
+// ret = rtw_write32(padapter, (FW_8710B_START_ADDRESS + i * blockSize_p1), le32_to_cpu(*((u32 *)(bufferPtr + i * blockSize_p1))));
if (ret == _FAIL) {
RTW_ERR("====>%s %d i:%d\n", __func__, __LINE__, i);
goto exit;
@@ -91,16 +91,16 @@ static int _BlockWrite(PADAPTER padapter, PVOID buffer, u32 buffSize)
blockCount_p2 = remainSize_p1 / blockSize_p2;
remainSize_p2 = remainSize_p1 % blockSize_p2;
-#if 0
-#ifdef CONFIG_USB_HCI
+//#if 0
+//#ifdef CONFIG_USB_HCI
for (i = 0; i < blockCount_p2; i++) {
ret = rtw_writeN(padapter, (FW_8710B_START_ADDRESS + offset + i * blockSize_p2), blockSize_p2, (bufferPtr + offset + i * blockSize_p2));
if (ret == _FAIL)
goto exit;
}
-#endif
-#endif
+//#endif
+//#endif
}
/* 3 Phase #3 */ |
This is the first thing I did after your patch. This resulted in death of system. |
Hm. Maybe I should stop trying to help. :) |
By the way, does your adapter work with the Windows driver? |
linux moment |
Patch does not work on my adapter either, chip version is CHIP_8710B_Normal_Chip_UMC_A_CUT_1T1R_RomVer(2). I also tried the changes proposed above but with no success. Attaching debug log. One interesting observation is that I get constant printouts in dmesg while the driver is loaded: |
Wow. That works. After applying the umc.txt patch, TX speed is up from 4mbps to 22mbps. RX is around 35mbps. |
where is the "umc.txt" patch??? |
https://github.com/McMCCRU/rtl8188gu/files/10831841/umc.txt I guess this is what you want. Or you can use rtl8xxxu, it supports 8188GU now and has no slow upload issue. |
CC: @wandercn