您尚未登录。

楼主 #1 2019-06-03 09:49:36

阿黄
会员
注册时间: 2018-10-03
已发帖子: 298
积分: 133

分享一个在nano 4.15.0上使用的RTL8188EU/RTL8188ETV的驱动

Step:
1、在linux/drivers/net/wireless/realtek 目录下,git clone https://gitee.com/buyadong/TL-WN722N-V2.git
2、cd TL-WN722N-V2
3、修改Makefile文件
     

CONFIG_POWER_SAVING = n


CONFIG_PLATFORM_I386_PC = n

# 增加型号
CONFIG_PLATFORM_ARM_SUNIV = y

# 增加编译路径
ifeq ($(CONFIG_PLATFORM_ARM_SUNIV), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUNIV
# default setting for Android 4.1, 4.2
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DDCONFIG_P2P_IPS

EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS
ifeq ($(CONFIG_USB_HCI), y)
EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX
_PLATFORM_FILES += platform/platform_ARM_SUNxI_usb.o
endif
ifeq ($(CONFIG_SDIO_HCI), y)
# default setting for A10-EVB mmc0
#EXTRA_CFLAGS += -DCONFIG_WITS_EVB_V13
_PLATFORM_FILES += platform/platform_ARM_SUNxI_sdio.o
endif

ARCH := arm
CROSS_COMPILE := arm-none-linux-gnueabi-
#CROSS_COMPILE=/home/android_sdk/Allwinner/a10/android-jb42/lichee-jb42/buildroot/output/external-toolchain/bin/arm-none-linux-gnueabi-
KVER  := 4.15.0
KSRC:= ../../../../../
#KSRC=/home/android_sdk/Allwinner/a10/android-jb42/lichee-jb42/linux-3.0
endif
     

4、修改TL-WN722N-V2/platform/platform_ARM_SUNxI_usb.c
  //#include <mach/sys_config.h>

5、修改realtek目录下Kconfig,增加一行 source "drivers/net/wireless/realtek/TL-WN722N-V2/Kconfig"

6、修改realtek目录下Makefile,增加一行 obj-$(CONFIG_RTL8188EU)        += TL-WN722N-V2/

7、配置kernel的menuconfig : make CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm   menuconfig
    [ * ]  Device Drivers  ---> [ * ] Network device Support ---> [ * ] Wireless LAN ---> [ * ] Realtek devices ---> <M> Realtek 8188E USB Wifi

8、编译 make CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm   -j4

9、拷贝TL-WN722N-V2文件中 8188eu.ko文件到nano,并加载.



======================================================================
不知道怎么回事,我加载了8188eu之后,内核会崩溃

# lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 003: ID 1a86:7523
Bus 001 Device 002: ID 05e3:0608
Bus 001 Device 004: ID 0bda:8179
# 
# 
# 
# 
# insmod /mnt/8188eu.ko 
[   32.081646] RTL871X: module init start
[   32.089295] RTL871X: rtl8188eu v4.3.0.8_13968.20150417
[   32.098202] RTL871X: build time:  __DATE__  __TIME__
[   32.107163] RTL871X: 
[   32.107163] usb_endpoint_descriptor(0):
[   32.120353] RTL871X: bLength=7
[   32.126832] RTL871X: bDescriptorType=5
[   32.134016] RTL871X: bEndpointAddress=81
[   32.141319] RTL871X: wMaxPacketSize=512
[   32.148464] RTL871X: bInterval=0
[   32.154880] RTL871X: RT_usb_endpoint_is_bulk_in = 1
[   32.162958] RTL871X: 
[   32.162958] usb_endpoint_descriptor(1):
[   32.175160] RTL871X: bLength=7
[   32.181282] RTL871X: bDescriptorType=5
[   32.188123] RTL871X: bEndpointAddress=2
[   32.194960] RTL871X: wMaxPacketSize=512
[   32.201790] RTL871X: bInterval=0
[   32.207952] RTL871X: RT_usb_endpoint_is_bulk_out = 2
[   32.215789] RTL871X: 
[   32.215789] usb_endpoint_descriptor(2):
[   32.227398] RTL871X: bLength=7
[   32.233146] RTL871X: bDescriptorType=5
[   32.239593] RTL871X: bEndpointAddress=3
[   32.245987] RTL871X: wMaxPacketSize=512
[   32.252375] RTL871X: bInterval=0
[   32.258157] RTL871X: RT_usb_endpoint_is_bulk_out = 3
[   32.265609] RTL871X: nr_endpoint=3, in_num=1, out_num=2
[   32.265609] 
[   32.277090] RTL871X: USB_SPEED_HIGH
[   32.301718] RTL871X: CHIP TYPE: RTL8188E
[   32.308359] RTL871X: register rtw_netdev_ops to netdev_ops
[   32.318645] RTL871X: rtw_wdev_alloc(padapter=b91c52d3)
[   32.327620] RTL871X: Chip Version Info: CHIP_8188E_Normal_Chip_TSMC_D_CUT_1T1R_RomVer(0)
[   32.340765] RTL871X: RF_Type is 3!!
[   32.346704] RTL871X: _ConfigNormalChipOutEP_8188E OutEpQueueSel(0x05), OutEpNumber(2) 
[   32.363568] RTL871X: EEPROM type is E-FUSE
[   32.370461] RTL871X: ====> _ReadAdapterInfo8188EU
[   32.378038] RTL871X: Boot from EFUSE, Autoload OK !
[   32.389555] RTL871X: SetHwReg8188EU: bMacPwrCtrlOn=1
[   32.400388] bFWReady == _FALSE call reset 8051...
[   32.408722] RTL871X: =====> _8051Reset88E(): 8051 reset success .
[   32.434492] RTL871X: efuse_read_phymap_from_txpktbuf bcnhead:0
[   32.446915] RTL871X: efuse_read_phymap_from_txpktbuf len:109, lenbak:109, aaa:109, aaabak:109
[   32.469120] RTL871X: efuse_read_phymap_from_txpktbuf read count:107
[   32.482135] RTL871X: EEPROM ID=0x8129
[   32.489087] RTL871X: VID = 0x0BDA, PID = 0x8179
[   32.496749] RTL871X: Customer ID: 0x00, SubCustomer ID: 0xCD
[   32.508679] RTL871X: Hal_ReadPowerSavingMode88E...bHWPwrPindetect(0)-bHWPowerdown(0) ,bSupportRemoteWakeup(1)
[   32.525229] RTL871X: ### PS params=>  power_mgnt(0),usbss_enable(0) ###
[   32.538660] RTL871X: ======= Path 0, Channel 1 =======
[   32.547404] RTL871X: Index24G_CCK_Base[0][1] = 0x28
[   32.555765] RTL871X: Index24G_BW40_Base[0][1] = 0x31
[   32.564286] RTL871X: ======= Path 0, Channel 2 =======
[   32.572993] RTL871X: Index24G_CCK_Base[0][2] = 0x28
[   32.581446] RTL871X: Index24G_BW40_Base[0][2] = 0x31
[   32.589908] RTL871X: ======= Path 0, Channel 3 =======
[   32.598520] RTL871X: Index24G_CCK_Base[0][3] = 0x28
[   32.606791] RTL871X: Index24G_BW40_Base[0][3] = 0x31
[   32.615168] RTL871X: ======= Path 0, Channel 4 =======
[   32.623715] RTL871X: Index24G_CCK_Base[0][4] = 0x28
[   32.632025] RTL871X: Index24G_BW40_Base[0][4] = 0x31
[   32.640328] RTL871X: ======= Path 0, Channel 5 =======
[   32.648821] RTL871X: Index24G_CCK_Base[0][5] = 0x28
[   32.657034] RTL871X: Index24G_BW40_Base[0][5] = 0x31
[   32.665288] RTL871X: ======= Path 0, Channel 6 =======
[   32.673737] RTL871X: Index24G_CCK_Base[0][6] = 0x28
[   32.681948] RTL871X: Index24G_BW40_Base[0][6] = 0x31
[   32.690193] RTL871X: ======= Path 0, Channel 7 =======
[   32.698600] RTL871X: Index24G_CCK_Base[0][7] = 0x28
[   32.706597] RTL871X: Index24G_BW40_Base[0][7] = 0x31
[   32.714705] RTL871X: ======= Path 0, Channel 8 =======
[   32.722940] RTL871X: Index24G_CCK_Base[0][8] = 0x28
[   32.730862] RTL871X: Index24G_BW40_Base[0][8] = 0x31
[   32.738814] RTL871X: ======= Path 0, Channel 9 =======
[   32.746839] RTL871X: Index24G_CCK_Base[0][9] = 0x28
[   32.754655] RTL871X: Index24G_BW40_Base[0][9] = 0x31
[   32.762575] RTL871X: ======= Path 0, Channel 10 =======
[   32.770766] RTL871X: Index24G_CCK_Base[0][10] = 0x28
[   32.778652] RTL871X: Index24G_BW40_Base[0][10] = 0x31
[   32.786496] RTL871X: ======= Path 0, Channel 11 =======
[   32.794522] RTL871X: Index24G_CCK_Base[0][11] = 0x28
[   32.802257] RTL871X: Index24G_BW40_Base[0][11] = 0x31
[   32.810031] RTL871X: ======= Path 0, Channel 12 =======
[   32.817969] RTL871X: Index24G_CCK_Base[0][12] = 0x28
[   32.825561] RTL871X: Index24G_BW40_Base[0][12] = 0x31
[   32.833310] RTL871X: ======= Path 0, Channel 13 =======
[   32.841225] RTL871X: Index24G_CCK_Base[0][13] = 0x28
[   32.848874] RTL871X: Index24G_BW40_Base[0][13] = 0x31
[   32.856552] RTL871X: ======= Path 0, Channel 14 =======
[   32.864461] RTL871X: Index24G_CCK_Base[0][14] = 0x28
[   32.872130] RTL871X: Index24G_BW40_Base[0][14] = 0x31
[   32.879882] RTL871X: ======= TxCount 0 =======
[   32.886942] RTL871X: CCK_24G_Diff[0][0]= 0
[   32.893683] RTL871X: OFDM_24G_Diff[0][0]= 0
[   32.900516] RTL871X: BW20_24G_Diff[0][0]= 0
[   32.907308] RTL871X: BW40_24G_Diff[0][0]= 0
[   32.913980] RTL871X: EEPROMRegulatory = 0x2
[   32.920715] RTL871X: mlmepriv.ChannelPlan = 0x20
[   32.927892] RTL871X: CrystalCap: 0x20
[   32.934000] RTL871X: EEPROM Customer ID: 0x 0
[   32.940878] RTL871X: EEPROM : AntDivCfg = 0, TRxAntDivType = 3
[   32.951623] RTL871X: Board Type: 0x 0
[   32.957851] RTL871X: ThermalMeter = 0x1a
[   32.964263] RTL871X: <==== _ReadAdapterInfo8188EU in 590 ms
[   33.004059] RTL871X: init_channel_set ChannelPlan ID 20 Chan num:13  
[   33.018616] RTL871X: pwrctrlpriv.bSupportRemoteWakeup~~~~~~
[   33.029750] RTL871X: pwrctrlpriv.bSupportRemoteWakeup~~~[1]~~~
[   33.041216] RTL871X: can't get autopm: 
[   33.047972] RTL871X: rtw_macaddr_cfg MAC Address  = 4c:0f:c7:5c:aa:64
[   33.060099] RTL871X: bDriverStopped:1, bSurpriseRemoved:0, bup:0, hw_init_completed:0
[   33.075447] RTL871X: register rtw_netdev_ops to netdev_ops
[   33.087120] RTL871X: register rtw_netdev_if2_ops to netdev_ops
[   33.099429] RTL871X: rtw_wdev_alloc(padapter=a383325a)
[   33.109914] RTL871X: Chip Version Info: CHIP_8188E_Normal_Chip_TSMC_D_CUT_1T1R_RomVer(0)
[   33.124604] RTL871X: RF_Type is 3!!
[   33.131452] RTL871X: _ConfigNormalChipOutEP_8188E OutEpQueueSel(0x05), OutEpNumber(2) 
[   33.147774] RTL871X: init_channel_set ChannelPlan ID 20 Chan num:13  
[   33.162958] Unable to handle kernel NULL pointer dereference at virtual address 00000004   <---------------------------------
[   33.178489] pgd = 582847d4
[   33.184819] [00000004] *pgd=81045831, *pte=00000000, *ppte=00000000
[   33.198424] Internal error: Oops: 817 [#1] ARM
[   33.206542] Modules linked in: 8188eu(+)
[   33.214138] CPU: 0 PID: 93 Comm: insmod Not tainted 4.15.0-rc8-licheepi-nano+ #8
[   33.228930] Hardware name: Allwinner suniv Family
[   33.237384] PC is at memcpy+0xb4/0x330                                                                    <---------------------------------
[   33.244824] LR is at 0x5cc70f4c
[   33.251571] pc : [<c0612d74>]    lr : [<5cc70f4c>]    psr: 00000013
[   33.264938] sp : c1befcbc  ip : 0000001c  fp : bf0a646c
[   33.273746] r10: c2a3f22b  r9 : c2a3f200  r8 : c1aeb000
[   33.282522] r7 : c1aeb184  r6 : 00000000  r5 : c1040000  r4 : c2a3c000
[   33.296066] r3 : 00000030  r2 : ffffffe6  r1 : c2a3f258  r0 : 00000004
[   33.309610] Flags: nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   33.323722] Control: 0005317f  Table: 81038000  DAC: 00000051
[   33.336425] Process insmod (pid: 93, stack limit = 0x92c6ddb1)
[   33.349260] Stack: (0xc1befcbc to 0xc1bf0000)
[   33.357152] fca0:                                                                c1040000
[   33.372259] fcc0: 00000000 c1aeb184 c1aeb000 00000004 c2a3c000 bf0400f4 c2a3c000 bf041f6c
[   33.387401] fce0: c2aa8254 bf03aaa0 c2aa5000 c2aa8254 c2a3c000 bf041cb4 0f4e0000 c2a3c000
[   33.402551] fd00: c1aeb000 c1bcfa00 c2aa5000 c1ae1730 000000a8 c1bbf870 00000003 bf043ae4
[   33.417692] fd20: c1af3c48 c1bbf870 c1bbf870 00000000 bf0baa58 c1bcfa20 ffffffed c1bcfa00
[   33.432987] fd40: c1bbf870 c1bbf800 bf0baa08 c0447094 c0446f78 c1bcfa20 c0a6e8ac 00000000
[   33.448314] fd60: bf0baa08 0000000f 00000000 c2a3abec 00000024 c03eef40 c1bcfa20 bf0baa08
[   33.463744] fd80: c1bcfa54 00000000 c1bf73e4 00000001 c2a3abec c03ef0c8 00000000 bf0baa08
[   33.479196] fda0: c03ef024 c03ed49c c187ce8c c1bcd270 bf0baa08 c1044420 c0a26e44 c03ee488
[   33.494753] fdc0: bf0a7018 c0a30b50 bf0baa08 bf0baa08 bf0baa08 bf0d2a40 c0a26e44 c03ef97c
[   33.510437] fde0: bf0ba9d8 bf0baa08 bf0d2a40 c0446080 bf0ba9d8 00000000 bf0f9000 c1bf73c0
[   33.526191] fe00: c1bf73e4 bf0f908c ffffe000 c0101854 00000001 c1fab7f4 00000000 0080007f
[   33.542096] fe20: c1fab7f0 c1fab7e8 bf0d2a88 c1fab7e8 00000001 00080000 00000001 0080007f
[   33.558039] fe40: 00000001 c2a3abec 00000024 c018a154 20000013 00000001 bf0d2a40 00000001
[   33.574000] fe60: c1286560 c1bf73c0 c1bf73e4 c01680d8 00000001 c0167334 c1beff50 00000001
[   33.589959] fe80: bf0d2a40 c016733c bf0d2a4c 00007fff bf0d2a40 c0164be0 bf0d2a88 c0701c10
[   33.605916] fea0: 00000031 c0701bf4 bf0d2b50 bf0d2bd4 bf0d2b34 00000000 ffffe000 bf000000
[   33.621982] fec0: 00132c14 00000000 c1beff48 00000000 00000000 00000000 00000000 00000000
[   33.638184] fee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   33.654362] ff00: 00000000 00000000 7fffffff 00000000 00000003 000c2008 0000017b c0107f08
[   33.670492] ff20: c1bee000 00000000 00000000 c0167b28 7fffffff 00000000 00000003 00000000
[   33.686620] ff40: c1010000 c2908000 00132c14 00000000 c29bd96f c2908000 00132c14 c2a3a64c
[   33.702725] ff60: c2a3a4dc c29f3dcc 000d9000 000eafe0 00000000 00000000 00000000 000296e0
[   33.718839] ff80: 00000022 00000023 0000001a 00000000 0000000b 00000000 000c2008 ffffffff
[   33.734946] ffa0: beabdf49 c0107ce0 000c2008 ffffffff 00000003 000c2008 00000000 beabdf49
[   33.751060] ffc0: 000c2008 ffffffff beabdf49 0000017b 000c179c 00000000 b6fd8000 00000000
[   33.767129] ffe0: beabdca8 beabdc98 0001ce24 b6f3f020 60000010 00000003 00000000 00000000
[   33.784859] [<c0612d74>] (memcpy) from [<bf0400f4>] (_rtw_memcpy+0x8/0xc [8188eu])                 <---------------------------------
[   33.803696] [<bf0400f4>] (_rtw_memcpy [8188eu]) from [<bf041f6c>] (rtw_drv_register_netdev+0xe0/0x14c [8188eu])
[   33.825172] [<bf041f6c>] (rtw_drv_register_netdev [8188eu]) from [<bf043ae4>] (rtw_drv_init+0x2bc/0x460 [8188eu])
[   33.845212] [<bf043ae4>] (rtw_drv_init [8188eu]) from [<c0447094>] (usb_probe_interface+0x11c/0x270)
[   33.862467] [<c0447094>] (usb_probe_interface) from [<c03eef40>] (driver_probe_device+0x250/0x334)
[   33.879461] [<c03eef40>] (driver_probe_device) from [<c03ef0c8>] (__driver_attach+0xa4/0xa8)
[   33.895909] [<c03ef0c8>] (__driver_attach) from [<c03ed49c>] (bus_for_each_dev+0x50/0x9c)
[   33.912105] [<c03ed49c>] (bus_for_each_dev) from [<c03ee488>] (bus_add_driver+0x170/0x204)
[   33.928440] [<c03ee488>] (bus_add_driver) from [<c03ef97c>] (driver_register+0x78/0xf4)
[   33.944598] [<c03ef97c>] (driver_register) from [<c0446080>] (usb_register_driver+0x60/0x12c)
[   33.962984] [<c0446080>] (usb_register_driver) from [<bf0f908c>] (rtw_drv_entry+0x8c/0x1000 [8188eu])
[   33.982116] [<bf0f908c>] (rtw_drv_entry [8188eu]) from [<c0101854>] (do_one_initcall+0x3c/0x16c)
[   33.999180] [<c0101854>] (do_one_initcall) from [<c01680d8>] (do_init_module+0x58/0x1e4)
[   34.015441] [<c01680d8>] (do_init_module) from [<c016733c>] (load_module+0x1bbc/0x21b0)
[   34.031607] [<c016733c>] (load_module) from [<c0167b28>] (SyS_finit_module+0x98/0xb4)
[   34.047610] [<c0167b28>] (SyS_finit_module) from [<c0107ce0>] (ret_fast_syscall+0x0/0x50)
[   34.063987] Code: e4805004 e4806004 e4807004 e4808004 (e480e004) 
[   34.078371] ---[ end trace 775bd7fd7e30c5a5 ]---
Segmentation fault
# 
[   35.047046] Unable to handle kernel NULL pointer dereference at virtual address 00000178             <---------------------------------
[   35.063402] pgd = ae781fd2
[   35.070104] [00000178] *pgd=00000000
[   35.077656] Internal error: Oops: 17 [#2] ARM
[   35.085912] Modules linked in: 8188eu(+)
[   35.093751] CPU: 0 PID: 0 Comm: swapper Tainted: G      D          4.15.0-rc8-licheepi-nano+ #8
[   35.110094] Hardware name: Allwinner suniv Family
[   35.120285] PC is at rtw_get_on_cur_ch_time+0x8/0x1c [8188eu]                                            <---------------------------------
[   35.135327] LR is at rtw_signal_stat_timer_hdl+0x194/0x208 [8188eu]
[   35.149213] pc : [<bf0244e0>]    lr : [<bf029598>]    psr: 60000013
[   35.162971] sp : c0a01e40  ip : 00000004  fp : c0a3aa20
[   35.171959] r10: 00000000  r9 : c0a3aa24  r8 : c0a01e8c
[   35.180930] r7 : c0a0e600  r6 : 00000000  r5 : 00000000  r4 : c2a3d838
[   35.194675] r3 : 00000000  r2 : 00000000  r1 : 00000000  r0 : c2a3d838
[   35.208398] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   35.222716] Control: 0005317f  Table: 81bfc000  DAC: 00000051
[   35.235627] Process swapper (pid: 0, stack limit = 0x4cb10c6f)
[   35.248612] Stack: (0xc0a01e40 to 0xc0a02000)
[   35.256572] 1e40: ffffe000 00000100 bf029404 c0a0e600 c0a01e8c c0a3aa24 00000100 c0150358
[   35.271841] 1e60: a0000093 ffffffff c0a01e90 00000200 00000000 c015043c c0a01e8c c0a0e600
[   35.287101] 1e80: c0a0e5e0 c0a0e600 c0a01e8c c01504d8 00000000 c0a34f48 c07c6948 c04bbd84
[   35.302444] 1ea0: c1807100 c01475c8 c0a5f908 c0a60200 00000002 ffffe000 00000002 40000001
[   35.317842] 1ec0: 00000001 c0101474 c1804200 c0a00000 c0a3aa20 0000000a ffff9881 00200102
[   35.333424] 1ee0: 00000000 00000000 c0a34610 00000000 00000001 c1804200 c0a00000 c0a34f40
[   35.349145] 1f00: 00000001 c0119740 00000000 c014701c c0a6acbc c0a01f38 ffffffff c0a01f6c
[   35.364913] 1f20: c0a2d058 c01013c4 c0108d20 60000013 ffffffff c010c0e8 00000000 0005317f
[   35.380703] 1f40: 0005217f 60000013 00000000 ffffe000 c0a030a0 00000000 c0a2d058 c0a030b0
[   35.396491] 1f60: c0a34f40 00000001 600000d3 c0a01f88 c0108d28 c0108d20 60000013 ffffffff
[   35.412314] 1f80: 00000053 00000000 00000000 c013ce10 00000000 c0a3a380 c0a3a340 ffffffff
[   35.428207] 1fa0: c0a03020 c1fb4aa0 c0924a28 00053177 00000000 c013d0fc c0a3a380 c0900bdc
[   35.444243] 1fc0: ffffffff ffffffff 00000000 c090066c 00000000 c0924a28 00000000 c090032c
[   35.460315] 1fe0: 00000053 00003135 00000000 80e60000 41069265 00000000 00000000 00000000
[   35.479718] [<bf0244e0>] (rtw_get_on_cur_ch_time [8188eu]) from [<bf029598>] (rtw_signal_stat_timer_hdl+0x194/0x208 [8188eu])<---------------------------------
[   35.504711] [<bf029598>] (rtw_signal_stat_timer_hdl [8188eu]) from [<c0150358>] (call_timer_fn+0x20/0x98)  
[   35.522441] [<c0150358>] (call_timer_fn) from [<c015043c>] (expire_timers+0x6c/0x7c)
[   35.538290] [<c015043c>] (expire_timers) from [<c01504d8>] (run_timer_softirq+0x8c/0x174)
[   35.554560] [<c01504d8>] (run_timer_softirq) from [<c0101474>] (__do_softirq+0x94/0x25c)
[   35.570767] [<c0101474>] (__do_softirq) from [<c0119740>] (irq_exit+0xd8/0xec)
[   35.586087] [<c0119740>] (irq_exit) from [<c014701c>] (__handle_domain_irq+0x50/0xa8)
[   35.601996] [<c014701c>] (__handle_domain_irq) from [<c01013c4>] (sun4i_handle_irq+0x38/0x50)
[   35.618649] [<c01013c4>] (sun4i_handle_irq) from [<c010c0e8>] (__irq_svc+0x68/0x84)
[   35.634400] Exception stack(0xc0a01f38 to 0xc0a01f80)
[   35.643524] 1f20:                                                       00000000 0005317f
[   35.659685] 1f40: 0005217f 60000013 00000000 ffffe000 c0a030a0 00000000 c0a2d058 c0a030b0
[   35.675779] 1f60: c0a34f40 00000001 600000d3 c0a01f88 c0108d28 c0108d20 60000013 ffffffff
[   35.691933] [<c010c0e8>] (__irq_svc) from [<c0108d20>] (arch_cpu_idle+0x24/0x34)
[   35.707334] [<c0108d20>] (arch_cpu_idle) from [<c013ce10>] (do_idle+0x104/0x190)
[   35.722712] [<c013ce10>] (do_idle) from [<c013d0fc>] (cpu_startup_entry+0xc/0x10)
[   35.738122] [<c013d0fc>] (cpu_startup_entry) from [<c0900bdc>] (start_kernel+0x320/0x390)
[   35.754258] Code: e593017c e12fff1e e590301c e5d015b6 (e5d32178) 
[   35.768253] ---[ end trace 775bd7fd7e30c5a6 ]---
[   35.776845] Kernel panic - not syncing: Fatal exception in interrupt
[   35.791052] Rebooting in 5 seconds..

看第二个问题:
inline u32 rtw_get_on_cur_ch_time(_adapter *adapter)
{
    if (adapter->mlmeextpriv.cur_channel == adapter_to_dvobj(adapter)->oper_channel)
        return adapter_to_dvobj(adapter)->on_oper_ch_time;
    else
        return 0;
}

主要是adapter_to_dvobj(adapter) 也就是 adapter->dvobj 是空指针,导致出错,但是如果加上判断 if (adapter_to_dvobj(adapter) == NULL) return 0; 就会包mod_timer那里空指针。 搞不定了

离线

#2 2019-06-03 11:58:46

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,223
积分: 9197

Re: 分享一个在nano 4.15.0上使用的RTL8188EU/RTL8188ETV的驱动

感谢楼主分享!





离线

#3 2021-07-30 17:25:26

拉轰的脚踏车
会员
注册时间: 2020-03-20
已发帖子: 288
积分: 222

Re: 分享一个在nano 4.15.0上使用的RTL8188EU/RTL8188ETV的驱动

insmod r8723bs.ko 也出错了:

[   38.355036] r8723bs: module is from the staging directory, the quality is unknown, you have been warned.
[   38.367400] RTL8723BS: module init start
[   38.367443] RTL8723BS: rtl8723bs v4.3.5.5_12290.20140916_BTCOEX20140507-4E40
[   38.367452] RTL8723BS: rtl8723bs BT-Coex version = BTCOEX20140507-4E40
[   38.379098] pnetdev = c26ed800
[   38.452533] Unable to handle kernel NULL pointer dereference at virtual address 00000004
[   38.452571] pgd = c27c4000
[   38.452584] [00000004] *pgd=42721835, *pte=00000000, *ppte=00000000
[   38.452620] Internal error: Oops: 817 [#1] SMP ARM
[   38.452632] Modules linked in: r8723bs(C+)
[   38.452667] CPU: 0 PID: 167 Comm: insmod Tainted: G         C      4.13.0-licheepi-zero+ #29
[   38.452676] Hardware name: Allwinner sun8i Family
[   38.452685] task: c2a95cc0 task.stack: c2770000
[   38.453333] PC is at rtw_drv_register_netdev+0x48/0x7c [r8723bs]
[   38.453366] LR is at netif_carrier_off+0x14/0x50
[   38.453375] pc : [<bf0559b0>]    lr : [<c04e44ac>]    psr: 60000013
[   38.453383] sp : c2771d30  ip : 00000000  fp : 000036c4
[   38.453392] r10: 000036b0  r9 : 000036b4  r8 : 000036b8
[   38.453402] r7 : c26ed800  r6 : c4277000  r5 : 00000000  r4 : c26ed800
[   38.453411] r3 : c427a318  r2 : 00000004  r1 : 9f5d8388  r0 : c26ed800
[   38.453424] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   38.453433] Control: 10c5387d  Table: 427c406a  DAC: 00000051
[   38.453445] Process insmod (pid: 167, stack limit = 0xc2770210)
[   38.453456] Stack: (0xc2771d30 to 0xc2772000)
[   38.453470] 1d20:                                     c4277000 c26ec000 c2441400 bf058054
[   38.453485] 1d40: bf057e64 c2441408 c2441400 00000000 bf06a5ec bf05cf9c 0000000a c21432c0
[   38.453499] 1d60: 0000b6ce c04546b4 c2441408 c0c76b98 00000000 bf06a5ec 00000000 c037f2b0
[   38.453513] 1d80: 00000000 c2441408 bf06a5ec c244143c 00000000 00000001 c2143288 c037f42c
[   38.453527] 1da0: 00000000 bf06a5ec c037f380 c037d7f4 c3911758 c2445434 bf06a5ec c2445500
[   38.453542] 1dc0: c0c2ec28 c037e8dc bf0625a4 00000001 bf06a5ec bf06a5ec bf066000 bf081000
[   38.453556] 1de0: 00000000 c037fcb4 bf06a5dc bf06a5dc bf066000 bf08106c bf06a680 bf06a680
[   38.453570] 1e00: bf081000 c0101790 c2771e08 00000000 00000000 c0c6af80 c0c063c4 c3df05c8
[   38.453584] 1e20: c0c38080 8040003f 00000012 00000003 c0b635c8 0328d000 c3e44480 c3e45860
[   38.453599] 1e40: bf06a680 00000001 c0c666bc bf06a680 bf06a680 bf06a680 c2143340 c2143280
[   38.453612] 1e60: 00000001 c018b61c c2771f48 bf06a680 c2771f48 bf06a680 00000001 c018aab0
[   38.453627] 1e80: bf06a68c 00007fff bf06a680 c0187e88 c2771f40 00000124 00000000 bf06a6c8
[   38.453641] 1ea0: bf06a794 bf06a7b0 c0602fc0 bf06a83c 000a3196 00000000 c2bebb40 c01f5554
[   38.453654] 1ec0: 000a3196 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   38.453667] 1ee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   38.453681] 1f00: 7fffffff 7fffffff 00000000 00000000 000c7008 c0107444 c2770000 00000000
[   38.453695] 1f20: 00000000 c018b048 7fffffff 00000000 00000003 c2447a00 00000020 c467a000
[   38.453709] 1f40: 000a3196 00000000 c46dc42d c467a000 000a3196 c46e4fe8 c46e4e1f c4711ac8
[   38.453723] 1f60: 00070000 000776a0 00000000 00000000 00000000 0001acb0 0000002a 0000002b
[   38.453737] 1f80: 00000020 00000000 00000012 00000000 000c7008 000c7008 ffffffff bec9eed6
[   38.453752] 1fa0: 0000017b c0107280 000c7008 ffffffff 00000003 000c7008 00000000 bec9eed6
[   38.453766] 1fc0: 000c7008 ffffffff bec9eed6 0000017b 000c67ac 00000000 b6f45000 00000000
[   38.453780] 1fe0: bec9ec18 bec9ec08 0001d874 b6eac020 60000010 00000003 00000000 00000000
[   38.454427] [<bf0559b0>] (rtw_drv_register_netdev [r8723bs]) from [<bf058054>] (rtw_drv_init+0x1f0/0x224 [r8723bs])
[   38.454681] [<bf058054>] (rtw_drv_init [r8723bs]) from [<c04546b4>] (sdio_bus_probe+0x100/0x118)
[   38.454726] [<c04546b4>] (sdio_bus_probe) from [<c037f2b0>] (driver_probe_device+0x22c/0x2fc)
[   38.454748] [<c037f2b0>] (driver_probe_device) from [<c037f42c>] (__driver_attach+0xac/0xb0)
[   38.454768] [<c037f42c>] (__driver_attach) from [<c037d7f4>] (bus_for_each_dev+0x60/0x94)
[   38.454787] [<c037d7f4>] (bus_for_each_dev) from [<c037e8dc>] (bus_add_driver+0x1a0/0x218)
[   38.454803] [<c037e8dc>] (bus_add_driver) from [<c037fcb4>] (driver_register+0x78/0xf8)
[   38.455041] [<c037fcb4>] (driver_register) from [<bf08106c>] (rtw_drv_entry+0x6c/0x1000 [r8723bs])
[   38.455275] [<bf08106c>] (rtw_drv_entry [r8723bs]) from [<c0101790>] (do_one_initcall+0x40/0x168)
[   38.455308] [<c0101790>] (do_one_initcall) from [<c018b61c>] (do_init_module+0x60/0x1f0)
[   38.455330] [<c018b61c>] (do_init_module) from [<c018aab0>] (load_module+0x1dbc/0x2188)
[   38.455348] [<c018aab0>] (load_module) from [<c018b048>] (SyS_finit_module+0x8c/0x9c)
[   38.455367] [<c018b048>] (SyS_finit_module) from [<c0107280>] (ret_fast_syscall+0x0/0x3c)
[   38.455388] Code: e2863c33 e59421d8 e1a00004 e5b31018 (e5821000)
[   38.455410] ---[ end trace da7adddc61e75a09 ]---
[  133.603423] r8723bs: module is from the staging directory, the quality is unknown, you have been warned.

离线

#4 2023-05-07 11:09:59

19chan19
会员
注册时间: 2023-04-07
已发帖子: 9
积分: 9

Re: 分享一个在nano 4.15.0上使用的RTL8188EU/RTL8188ETV的驱动

[   75.124136] RTW: error adapter_to_dvobj(adapter) == NULL
[   75.124159] ------------[ cut here ]------------
[   75.134098] kernel BUG at kernel/time/timer.c:952!
[   75.138884] Internal error: Oops - BUG: 0 [#1] SMP ARM
[   75.144015] Modules linked in: 8723bs(C) g_ffs usb_f_fs
[   75.149247] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G         C        5.2.0-licheepi-zero+ #7
[   75.157757] Hardware name: Allwinner sun8i Family
[   75.162471] PC is at mod_timer+0x1fc/0x2f8
[   75.167168] LR is at rtw_signal_stat_timer_hdl+0x154/0x1bc [8723bs]
[   75.173433] pc : [<c01805ac>]    lr : [<bf0484bc>]    psr: 60000113
[   75.179689] sp : c0b01dd0  ip : 00000014  fp : c0b03080
[   75.184905] r10: 03514000  r9 : c0b04c48  r8 : c0a4f400
[   75.190122] r7 : 00000000  r6 : c0b04c48  r5 : 00000000  r4 : c4c65488
[   75.196638] r3 : 7231f7b1  r2 : 00000000  r1 : ffffa828  r0 : c4c66910
[   75.203158] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   75.210283] Control: 10c5387d  Table: 42bc006a  DAC: 00000051
[   75.216027] Process swapper/0 (pid: 0, stack limit = 0x389b9e98)
[   75.222025] Stack: (0xc0b01dd0 to 0xc0b02000)
[   75.226380] 1dc0:                                     00000000 7231f7b1 c0b01dec c4c65488
[   75.234550] 1de0: 00000000 00000000 00000000 c0a4f400 c0b04c48 03514000 c0b03080 bf0484bc
[   75.242718] 1e00: ffffe000 00000100 bf048368 00000000 c0a4f400 c01800bc c0a4f400 c0b04c48
[   75.250886] 1e20: c3f63400 c0b01e4c 00000200 c01801c8 c0b01e48 c3f63400 c0b01e48 c0b03d00
[   75.259055] 1e40: c0a4f400 c01802b8 c3f64650 00000000 00000000 7fffffff 7fffffff c3f64500
[   75.267223] 1e60: c3f64500 20000193 00000003 7231f7b1 00000000 00000001 c0b03084 ffffe000
[   75.275391] 1e80: 00000100 c0b03080 40000001 c0102288 c3f645b0 c3f64630 7d804a23 c0a4b338
[   75.283559] 1ea0: c0a52840 0000000a c0904468 c0a4b2c8 ffffa829 c0b03d00 c08019dc 00200102
[   75.291727] 1ec0: 00000001 ffffe000 00000000 00000000 00000001 c340a000 c4803000 c0b4e080
[   75.299895] 1ee0: 00000001 c0122474 c0a52834 c0169f84 c0b0501c c0b16690 c480200c c4802000
[   75.308063] 1f00: c0b01f28 c03d17f4 c01087a0 60000013 ffffffff c0b01f5c c0b48a6b c0b00000
[   75.316231] 1f20: c0b4e080 c0101a8c 00000000 0001f920 c3f67430 c0117800 ffffe000 c0b04c68
[   75.324399] 1f40: c0b04ca8 00000001 c0b48a6b c0906218 c0b4e080 00000001 ffffffff c0b01f78
[   75.332567] 1f60: c010879c c01087a0 60000013 ffffffff 00000051 00000000 ffffe000 c0147020
[   75.340736] 1f80: 000000cd c0b04c48 c0b04c40 ffffffff 000000a0 c0b4e080 c0b4e080 c0147320
[   75.348904] 1fa0: c0b4e0cc c0a00d9c ffffffff ffffffff 00000000 c0a006dc c0a38a38 c3f71bc0
[   75.357072] 1fc0: 00000000 c0a38a38 7234f5b1 00000000 00000000 c0a00330 00000051 10c0387d
[   75.365239] 1fe0: 00000000 42df9000 410fc075 10c5387d 00000000 00000000 00000000 00000000
[   75.373843] [<c01805ac>] (mod_timer) from [<bf0484bc>] (rtw_signal_stat_timer_hdl+0x154/0x1bc [8723bs])
[   75.383614] [<bf0484bc>] (rtw_signal_stat_timer_hdl [8723bs]) from [<c01800bc>] (call_timer_fn.constprop.4+0x24/0x94)
[   75.394223] [<c01800bc>] (call_timer_fn.constprop.4) from [<c01801c8>] (expire_timers+0x9c/0xa8)
[   75.403001] [<c01801c8>] (expire_timers) from [<c01802b8>] (run_timer_softirq+0xe4/0x1dc)
[   75.411173] [<c01802b8>] (run_timer_softirq) from [<c0102288>] (__do_softirq+0x120/0x2bc)
[   75.419347] [<c0102288>] (__do_softirq) from [<c0122474>] (irq_exit+0xbc/0xd8)
[   75.426566] [<c0122474>] (irq_exit) from [<c0169f84>] (__handle_domain_irq+0x60/0xb4)
[   75.434394] [<c0169f84>] (__handle_domain_irq) from [<c03d17f4>] (gic_handle_irq+0x4c/0x90)
[   75.442740] [<c03d17f4>] (gic_handle_irq) from [<c0101a8c>] (__irq_svc+0x6c/0x90)
[   75.450210] Exception stack(0xc0b01f28 to 0xc0b01f70)
[   75.455260] 1f20:                   00000000 0001f920 c3f67430 c0117800 ffffe000 c0b04c68
[   75.463429] 1f40: c0b04ca8 00000001 c0b48a6b c0906218 c0b4e080 00000001 ffffffff c0b01f78
[   75.471595] 1f60: c010879c c01087a0 60000013 ffffffff

我移植到linux5.y上确实是会报mod_timer那里空指针,
应该是新内核定时器函数定义有些变化了

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn