whitebatman2 / rtl8821CU

Realtek 802.11ac USB WLAN driver
GNU General Public License v2.0
311 stars 178 forks source link

wiphy_register fail on A20 w/ 5.3.9-sunxi and 2001:331d #39

Open platima opened 4 years ago

platima commented 4 years ago

Hi,

I added 2001:331d to usb_intf.h as per official driver http://files.dlink.com.au/products/DWA-171/REV_C/Drivers/DWA-171_Linux_driver_v5.8.1_Driver/, and it builds and installs fine, but always seems to crash or warn, with;

[ 6091.419452] WARNING: CPU: 0 PID: 12035 at net/wireless/core.c:868 wiphy_register+0x6b5/0x90c [cfg80211] [ 6091.419459] Modules linked in: 8821cu(O+) cfg80211 uas bnep btusb btbcm btintel btrtl bluetooth ecdh_generic rfkill ecc sun4i_gpadc_iio lima gpu_sched axp20x_usb_power axp20x_battery axp20x_adc evdev industrialio sun4i_codec snd_soc_core snd_pcm_dmaengine snd_pcm snd_timer sun4i_ts snd sunxi_cir zram sun4i_gpadc soundcore sun4i_ss uio_pdrv_genirq uio cpufreq_dt sch_fq_codel ip_tables x_tables pinctrl_axp209 realtek [last unloaded: cfg80211] [ 6091.419551] CPU: 0 PID: 12035 Comm: modprobe Tainted: G W O 5.3.9-sunxi #19.11.3 [ 6091.419554] Hardware name: Allwinner sun7i (A20) Family [ 6091.419586] [] (unwind_backtrace) from [] (show_stack+0x11/0x14) [ 6091.419604] [] (show_stack) from [] (dump_stack+0x69/0x78) [ 6091.419623] [] (dump_stack) from [] (warn.part.3+0x83/0x9a) [ 6091.419636] [] (warn.part.3) from [] (warn_slowpath_null+0x33/0x36) [ 6091.419726] [] (warn_slowpath_null) from [] (wiphy_register+0x6b5/0x90c [cfg80211]) [ 6091.420862] [] (wiphy_register [cfg80211]) from [] (rtw_wiphy_register+0x15/0x16 [8821cu]) [ 6091.422323] [] (rtw_wiphy_register [8821cu]) from [] (rtw_cfg80211_ndev_res_register+0x13/0x18 [8821cu]) [ 6091.423570] [] (rtw_cfg80211_ndev_res_register [8821cu]) from [] (rtw_os_ndev_register+0x47/0xee [8821cu]) [ 6091.424796] [] (rtw_os_ndev_register [8821cu]) from [] (rtw_os_ndevs_register+0x5d/0xc6 [8821cu]) [ 6091.426006] [] (rtw_os_ndevs_register [8821cu]) from [] (rtw_os_ndevs_init+0x1f/0x2c [8821cu]) [ 6091.427194] [] (rtw_os_ndevs_init [8821cu]) from [] (rtw_drv_init+0x1f9/0x288 [8821cu]) [ 6091.427798] [] (rtw_drv_init [8821cu]) from [] (usb_probe_interface+0xa1/0x1b8) [ 6091.427817] [] (usb_probe_interface) from [] (really_probe+0xa9/0x1e8) [ 6091.427830] [] (really_probe) from [] (driver_probe_device+0x43/0x120) [ 6091.427841] [] (driver_probe_device) from [] (device_driver_attach+0x3d/0x40) [ 6091.427852] [] (device_driver_attach) from [] (__driver_attach+0x37/0x78) [ 6091.427862] [] (__driver_attach) from [] (bus_for_each_dev+0x41/0x68) [ 6091.427872] [] (bus_for_each_dev) from [] (bus_add_driver+0x129/0x140) [ 6091.427883] [] (bus_add_driver) from [] (driver_register+0x39/0xa0) [ 6091.427895] [] (driver_register) from [] (usb_register_driver+0x55/0xdc) [ 6091.428549] [] (usb_register_driver) from [] (rtw_drv_entry+0x45/0x1000 [8821cu]) [ 6091.429275] [] (rtw_drv_entry [8821cu]) from [] (do_one_initcall+0x37/0x1a8) [ 6091.429294] [] (do_one_initcall) from [] (do_init_module+0x4d/0x1ac) [ 6091.429306] [] (do_init_module) from [] (load_module+0x175f/0x1a1c) [ 6091.429317] [] (load_module) from [] (sys_finit_module+0x79/0x8c) [ 6091.429327] [] (sys_finit_module) from [] (ret_fast_syscall+0x1/0x62) [ 6091.429333] Exception stack(0xedbddfa8 to 0xedbddff0) [ 6091.429343] dfa0: 00498b70 00000000 00000004 004983ac 00000000 00498d98 [ 6091.429352] dfc0: 00498b70 00000000 1665d400 0000017b 00fcc498 00000000 00000000 00fcc3f8 [ 6091.429359] dfe0: be983308 be9832f8 004904a1 b6e8ef42

Note with this DWA-171 I have to do a usb_modeswitch -KW -v 0bda -p 1a2b first. lsusb does show the device there, but iwconfig shows no interfaces available.

I also got that official driver to compile, and have the exact same issue, so I am not 100% on the cause.

platima commented 4 years ago

Note https://github.com/brektrou/rtl8821CU does not have this issue for some reason

ovhpa commented 4 years ago

I run into the same trouble with a driver for cudy wu700 (ac650).

This commit have solve it.

Probably only the changes on rtw_cfgvendor.c file is necessary for your issue.