Open MrEngman opened 7 years ago
Any ideas anyone? I would really like to fix this but my knowledge of C is almost none.
Can anyone suggest how I could go about debugging what the issue is?
What happens if you remove every instance of -DRESOURCE_PRE_ALLOC
from os/linux/config.mk
and rebuild?
The driver fails to compile with a load of errors.
I see the same warnings as in my first post but then further on a number of errors shown below and the compile fails.
CC [M] /home/richard/src-4.8/Netgear-A6210/os/linux/../../os/linux/cfg80211/cfg80211_p2p.o
CC [M] /home/richard/src-4.8/Netgear-A6210/os/linux/../../os/linux/cfg80211/cfg80211_ap.o
CC [M] /home/richard/src-4.8/Netgear-A6210/os/linux/../../os/linux/cfg80211/cfg80211drv.o
CC [M] /home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.o
/home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.c:599:2: error: #error or Here?
#error or Here?
^
In file included from ./include/linux/string.h:18:0,
from ./include/linux/bitmap.h:8,
from ./include/linux/nodemask.h:94,
from ./include/linux/mmzone.h:16,
from ./include/linux/gfp.h:5,
from ./include/linux/kmod.h:22,
from ./include/linux/module.h:13,
from /home/richard/src-4.8/Netgear-A6210/include/os/rt_linux.h:14,
from /home/richard/src-4.8/Netgear-A6210/include/rtmp_os.h:30,
from /home/richard/src-4.8/Netgear-A6210/include/rtmp_comm.h:64,
from /home/richard/src-4.8/Netgear-A6210/include/rt_config.h:34,
from /home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.c:17:
/home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.c: In function ‘NICInitRecv’:
/home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.c:667:36: error: ‘struct _CMD_RSP_CONTEXT’ has no member named ‘TransferBuffer’
NdisZeroMemory(pCmdRspEventContext->TransferBuffer, CMD_RSP_BULK_SIZE);
^
./arch/arm/include/asm/string.h:36:17: note: in definition of macro ‘memset’
void *__p = (p); size_t __n = n; \
^
/home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.c:667:2: note: in expansion of macro ‘NdisZeroMemory’
NdisZeroMemory(pCmdRspEventContext->TransferBuffer, CMD_RSP_BULK_SIZE);
^
/home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.c: In function ‘NICInitTransmit’:
/home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.c:765:3: warning: passing argument 1 of ‘os_alloc_mem’ makes integer from pointer without a cast [enabled by default]
os_alloc_mem(pAd, (PUCHAR *)(&pAd->MgmtDescRing.AllocVa), pAd->MgmtDescRing.AllocSize);
^
In file included from /home/richard/src-4.8/Netgear-A6210/include/rt_config.h:59:0,
from /home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.c:17:
/home/richard/src-4.8/Netgear-A6210/include/rt_os_util.h:33:7: note: expected ‘size_t’ but argument is of type ‘PRTMP_ADAPTER’
void *os_alloc_mem(size_t size);
^
/home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.c:765:3: error: too many arguments to function ‘os_alloc_mem’
os_alloc_mem(pAd, (PUCHAR *)(&pAd->MgmtDescRing.AllocVa), pAd->MgmtDescRing.AllocSize);
^
In file included from /home/richard/src-4.8/Netgear-A6210/include/rt_config.h:59:0,
from /home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.c:17:
/home/richard/src-4.8/Netgear-A6210/include/rt_os_util.h:33:7: note: declared here
void *os_alloc_mem(size_t size);
^
/home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.c: In function ‘RTMPFreeTxRxRingMemory’:
/home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.c:999:35: error: ‘struct _CMD_RSP_CONTEXT’ has no member named ‘TransferBuffer’
(PUCHAR *)&pCmdRspEventContext->TransferBuffer,
^
scripts/Makefile.build:293: recipe for target '/home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.o' failed
make[2]: *** [/home/richard/src-4.8/Netgear-A6210/os/linux/../../common/cmm_mac_usb.o] Error 1
Makefile:1490: recipe for target '_module_/home/richard/src-4.8/Netgear-A6210/os/linux' failed
make[1]: *** [_module_/home/richard/src-4.8/Netgear-A6210/os/linux] Error 2
make[1]: Leaving directory '/home/richard/src/linux'
Makefile:59: recipe for target 'debug' failed
make: *** [debug] Error 2
I got it to start with setting the kernel parameter "coherent_pool=4M". But no luck with starting an AP yet.
I have this issue too. Running a Raspberry Pi 3 B+, kernel version 4.9.73-v7+
[ 257.803709] usb 1-1.3: new high-speed USB device number 4 using dwc_otg
[ 257.935348] usb 1-1.3: New USB device found, idVendor=0846, idProduct=9053
[ 257.935363] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 257.935371] usb 1-1.3: Product: A6210
[ 257.935378] usb 1-1.3: Manufacturer: NETGEAR
[ 257.935386] usb 1-1.3: SerialNumber: 100
[ 259.078714] mt7662u_sta: loading out-of-tree module taints kernel.
[ 259.093707] rtusb init rt2870 --->
[ 259.095367]
=== pAd = b97ae000, size = 1184160 ===
[ 259.095379] driver version: 3.0.0.1 (Jan 3 2018 18:34:51) .
[ 259.095421] <-- ERROR in Alloc Bulk buffer for HTTxContext!
[ 259.095426] ---> RTMPFreeTxRxRingMemory
[ 259.095445] <--- RTMPFreeTxRxRingMemory
[ 259.095449] ERROR mt766u_sta:
[ 259.095455] Failed to allocate memory - TxRxRing
[ 259.095476] ------------[ cut here ]------------
[ 259.100332] kernel BUG at mm/slub.c:3873!
[ 259.104512] Internal error: Oops - BUG: 0 [#1] SMP ARM
[ 259.109857] Modules linked in: mt7662u_sta(O+) bnep hci_uart btbcm bluetooth ip6table_filter ip6_tables ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack iptable_filter ip_tables x_tables brcmfmac brcmutil cfg80211 spidev rfkill snd_bcm2835 snd_pcm snd_timer i2c_bcm2835 snd bcm2835_gpiomem spi_bcm2835 uio_pdrv_genirq uio fixed i2c_dev fuse ipv6
[ 259.148947] CPU: 1 PID: 1601 Comm: systemd-udevd Tainted: G O 4.9.73-v7+ #1072
[ 259.157632] Hardware name: BCM2835
[ 259.161167] task: b5f66740 task.stack: b3732000
[ 259.165883] PC is at kfree+0x1a8/0x1e8
[ 259.170137] LR is at os_free_mem+0x24/0x3c [mt7662u_sta]
[ 259.175665] pc : [<8025ff90>] lr : [<7f4e9eec>] psr: 40000013
sp : b3733b68 ip : 0020551e fp : b3733b94
[ 259.187597] r10: b97ae000 r9 : b3733c0c r8 : b98ce000
[ 259.192959] r7 : 7f5619b4 r6 : b97ae000 r5 : 7f4e9eec r4 : b97ae000
[ 259.199664] r3 : b782b478 r2 : 00000000 r1 : 00000000 r0 : b97ae000
[ 259.206369] Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 259.213696] Control: 10c5383d Table: 2a84006a DAC: 00000055
[ 259.219593] Process systemd-udevd (pid: 1601, stack limit = 0xb3732210)
[ 259.226380] Stack: (0xb3733b68 to 0xb3734000)
[ 259.230850] 3b60: 801722ec 80171ac8 b97ae000 b344d200 00000003 7f5619b4
[ 259.239249] 3b80: b98ce000 b3733c0c b3733bac b3733b98 7f4e9eec 8025fdf4 00000006 b98cd000
[ 259.247646] 3ba0: b3733bdc b3733bb0 7f4acb8c 7f4e9ed4 00000000 b344de00 b3493070 b3493000
[ 259.260430] 3bc0: 7f5619ec 7f5619b4 b3493000 b35f5c00 b3733c84 b3733be0 7f516c74 7f4ac8f8
[ 259.273229] 3be0: b3733c0c b3733bf0 802eb63c 80718ef8 00000002 00000000 aaa18af0 805063f4
[ 259.286058] 3c00: b34930dc 7f561a64 802eb778 00000000 60000013 60000013 00000004 b35f5c84
[ 259.298871] 3c20: 60000013 60000013 00000000 b3493070 00000000 b35f5c84 b3733c5c b3733c48
[ 259.311675] 3c40: 8071bd84 801e3b18 00000081 b35f5c20 b3733c84 b3733c60 80506830 ffffffed
[ 259.324467] 3c60: b3493070 b3493000 7f5619ec b35f5c00 7f561a64 b35f5c20 b3733cbc b3733c88
[ 259.337328] 3c80: 805611c8 7f516bf8 802ee00c 802edf0c b3733cbc 80d0e4a8 b35f5c20 00000000
[ 259.350273] 3ca0: 7f5619ec 00000017 7f561b40 00000000 b3733ce4 b3733cc0 804fc1f0 805610c0
[ 259.363287] 3cc0: 00000000 b35f5c20 7f5619ec b35f5c54 00000000 7f539d74 b3733d04 b3733ce8
[ 259.376402] 3ce0: 804fc358 804fbfdc 804fc29c 00000000 7f5619ec 804fc29c b3733d2c b3733d08
[ 259.389611] 3d00: 804fa1cc 804fc2a8 b6a7715c b62f5a34 b6a77170 7f5619ec b5d5c900 80c5c3f0
[ 259.402863] 3d20: b3733d3c b3733d30 804fbb70 804fa15c b3733d64 b3733d40 804fb708 804fbb50
[ 259.416126] 3d40: 7f539d1c b3733d50 7f5619ec 00000000 80c5c3f0 7f5619ec b3733d7c b3733d68
[ 259.429411] 3d60: 804fca50 804fb568 7f5619b8 00000000 b3733da4 b3733d80 8055fc40 804fc9d4
[ 259.442644] 3d80: 7f562d00 7f58e000 b62cd100 7f561b40 00000001 49d32e5c b3733dbc b3733da8
[ 259.455868] 3da0: 7f58e09c 8055fbcc 00000000 7f561b40 b3733e3c b3733dc0 80101bf0 7f58e00c
[ 259.469091] 3dc0: 00000000 00000000 b3733e14 b3733dd8 80213e88 36465000 8024f0fc b3529780
[ 259.482345] 3de0: 0002930d 8025ec0c b3733e3c b3733df8 8025ec0c 80717854 8025ffcc 8025f470
[ 259.495597] 3e00: 00000001 0002930d b62cd140 a0000013 b9657000 7f561b40 00000001 b62cd100
[ 259.508824] 3e20: 7f561b40 00000001 49d32e5c b62cd1c8 b3733e64 b3733e40 8020a548 80101bac
[ 259.522066] 3e40: b3733e64 b3733e50 8024f1f0 b3733f3c 00000001 b62cd1c0 b3733f14 b3733e68
[ 259.535301] 3e60: 801a39ac 8020a4e0 7f561b4c 00007fff 7f561b40 801a1090 b3733ea4 7f561d2c
[ 259.548534] 3e80: b973d384 7f5b4c7c 7f562d08 00000002 7f561c54 7f561b88 b3733ee4 b3733ea8
[ 259.561765] 3ea0: 80277480 80277300 b9657000 00000000 00000000 00000000 00000000 00000000
[ 259.574992] 3ec0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 259.588245] 3ee0: 00000000 00000000 7fffffff 00000000 00000007 76d94004 0000017b 7fffffff
[ 259.601491] 3f00: 00000000 00000000 b3733fa4 b3733f18 801a42c4 801a1fec 7fffffff 00000000
[ 259.614757] 3f20: 00000003 8022d908 b3733f74 b9657000 00155ac0 00000000 00000002 b9657000
[ 259.627999] 3f40: 00155ac0 b97ac368 b9743081 b975e638 000e9d08 00103e98 00000000 00000000
[ 259.641246] 3f60: 00000000 00026c7c 0000002d 0000002e 00000023 00000027 00000017 00000000
[ 259.654506] 3f80: 0000017b 0048104c 00000000 00020000 80108244 b3732000 00000000 b3733fa8
[ 259.667744] 3fa0: 801080c0 801a4234 0048104c 00000000 00000007 76d94004 00000000 00c2c3c8
[ 259.680978] 3fc0: 0048104c 00000000 00020000 0000017b 76d94004 00020000 00c2c3c8 00000000
[ 259.694206] 3fe0: 7ea1a200 7ea1a1f0 76d8c09c 76ee8c40 60000010 00000007 377fa861 377fac61
[ 259.707649] [<8025ff90>] (kfree) from [<7f4e9eec>] (os_free_mem+0x24/0x3c [mt7662u_sta])
[ 259.721147] [<7f4e9eec>] (os_free_mem [mt7662u_sta]) from [<7f4acb8c>] (RTMPAllocAdapterBlock+0x2a0/0x2c4 [mt7662u_sta])
[ 259.737545] [<7f4acb8c>] (RTMPAllocAdapterBlock [mt7662u_sta]) from [<7f516c74>] (rtusb_probe+0x88/0x480 [mt7662u_sta])
[ 259.753657] [<7f516c74>] (rtusb_probe [mt7662u_sta]) from [<805611c8>] (usb_probe_interface+0x114/0x284)
[ 259.768281] [<805611c8>] (usb_probe_interface) from [<804fc1f0>] (driver_probe_device+0x220/0x2cc)
[ 259.782358] [<804fc1f0>] (driver_probe_device) from [<804fc358>] (__driver_attach+0xbc/0xc0)
[ 259.795902] [<804fc358>] (__driver_attach) from [<804fa1cc>] (bus_for_each_dev+0x7c/0xb0)
[ 259.809198] [<804fa1cc>] (bus_for_each_dev) from [<804fbb70>] (driver_attach+0x2c/0x30)
[ 259.822310] [<804fbb70>] (driver_attach) from [<804fb708>] (bus_add_driver+0x1ac/0x224)
[ 259.835434] [<804fb708>] (bus_add_driver) from [<804fca50>] (driver_register+0x88/0x108)
[ 259.848659] [<804fca50>] (driver_register) from [<8055fc40>] (usb_register_driver+0x80/0x144)
[ 259.862511] [<8055fc40>] (usb_register_driver) from [<7f58e09c>] (init_module+0x9c/0xa4 [mt7662u_sta])
[ 259.877215] [<7f58e09c>] (init_module [mt7662u_sta]) from [<80101bf0>] (do_one_initcall+0x50/0x184)
[ 259.891448] [<80101bf0>] (do_one_initcall) from [<8020a548>] (do_init_module+0x74/0x1e4)
[ 259.904694] [<8020a548>] (do_init_module) from [<801a39ac>] (load_module+0x19cc/0x2108)
[ 259.917848] [<801a39ac>] (load_module) from [<801a42c4>] (SyS_finit_module+0x9c/0xac)
[ 259.930824] [<801a42c4>] (SyS_finit_module) from [<801080c0>] (ret_fast_syscall+0x0/0x1c)
[ 259.944155] Code: 1a000003 e5932014 e3120001 1a000000 (e7f001f2)
[ 259.952862] ---[ end trace f815979b8f7f43b8 ]---
Edit file /boot/cmdline.txt
and add coherent_pool=4M
to the end of the file.
I am getting the following error when trying to run the driver on a Raspberry Pi B+ ARMv6 and the Pi appears to hang.
The error is identical on kernels 4.8.13, 4.9.0 and 4.9.2 other than the actual address values and the two lines
appear as one with kernel 4.8.13.
Jan 10 04:07:03 raspberrypi kernel: [ 11.894239] ERROR mt7662u_sta:Failed to allocate memory - TxRxRing
Error on Raspberry Pi kernel 4.9.2, with 4.9.0 and 4.8.13 identical.
Also when compiling for kernels 3.18, 4.0, 4.1, 4.4, 4.8 or 4.9 I get the same following warnings