Latest product reviews
ARCHOS 50 Diamond
ARCHOS GamePad2
ARCHOS
Smartphones
ARCHOS
TV Connect
ARCHOS 101 XS

A A A
Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?

ClockworkMod (CWM) Recovery easy install for RK3066 and RK3188 -- TWRP/CWM Flash-Tool and root for RK3288

 Please donate to support OMA and CrewRKTablets firmware work, thank you !

sp_Feed sp_TopicIcon
Cross-compiling rtl8188 wifi driver
Avatar
lujji

Contributor
Forum Posts: 67
Member Since:
2013/07/09
sp_UserOfflineSmall Offline

Thanks Received: 19
1
2014/12/30 - 12:32
sp_Permalink sp_Print

I'm porting RK3188 JB kernel to KK. Pretty much everything works fine, but I'm having problems with wifi module. Logcat returns the following errors:

E/WifiHW ( 426): wifi_load_driver: get wifi_ifname(PRIMARY) fail
E/WifiHW ( 426): wifi_power_ctrl(0)
E/WifiHW ( 426): wifi_power_ctrl: open(/sys/class/rkwifi/power) for write failed: Permission denied (13)
D/SoftapController( 109): Softap fwReload - Ok
W/CommandListener( 109): Failed to retrieve HW addr for wlan0 (No such device)
D/CommandListener( 109): Setting iface cfg
E/WifiStateMachine( 426): Unable to change interface settings: java.lang.IllegalStateException: command '9 interface setcfg wlan0 0.0.0.0 0 down' failed with '400 9 Failed to set address (No such device)'
D/WifiHW ( 426): check_wifi_ifname_from_proc: find lo
D/WifiHW ( 426): check_wifi_ifname_from_proc: find sit0
D/WifiHW ( 426): check_wifi_ifname_from_proc: find ip6tnl0
E/WifiHW ( 426): update_ctrl_interface: get wifi_ifname(PRIMARY) fail
D/WifiHW ( 426): check_wifi_ifname_from_proc: find lo
D/WifiHW ( 426): check_wifi_ifname_from_proc: find sit0
D/WifiHW ( 426): check_wifi_ifname_from_proc: find ip6tnl0
E/WifiHW ( 426): update_ctrl_interface: get wifi_ifname(PRIMARY) fail
E/WifiHW ( 426): Wi-Fi will not be enabled
E/WifiStateMachine( 426): Failed to start supplicant!
E/WifiStateMachine( 426): wifi sta open fail, disable
D/WifiService( 426): setWifiEnabled: false pid=426, uid=1000

I suspect that the problem might be resolved by compiling rtl8188eu module against existing kernel source, however there are some differences between jellybean and kitkat kernels that I don't understand. In JB sources folder drivers/net/wireless/rkusbwifi/rtl8188eu contains only Kconfig with the following lines:

config RTL8188EU
tristate "Realtek 8188EU USB WiFi Support"
select WIRELESS_EXT
select WEXT_PRIV
select IEEE80211
---help---
Help message of RTL8188EU & RTL8189ES

On the other hand, in KitKat same folder contains full source for rtl8188eu and the module is built into kernel. Now the question is: why is the kernel module 8188eu.ko still present in /system/lib/modules in the firmware if the module is built into kernel? If it's built-in then there should be no need for an external module.

Another question is: if the external module is needed, then how do I compile it? I tried cross-compiling but I always ended up with "modpost 0 modules" for some reason.

Here is my defconfig, if it helps.

 

P.S.: Happy holidays!

Avatar
lujji

Contributor
Forum Posts: 67
Member Since:
2013/07/09
sp_UserOfflineSmall Offline

Thanks Received: 19
2
2015/01/03 - 12:44
sp_Permalink sp_Print sp_EditHistory

Ok, so apparently Rockchip SDK is a mess. They decided to include 8188 sources into the kernel in this commit, however wifi supplicant still depends on the external module for some reason.

I've updated wireless drivers to the latest stable-3.0 linux-rockchip branch and I can get wifi working now:

# insmod /system/lib/modules/8188eu.ko 

# cat /sys/kernel/debug/usb/devices
...
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=0bda ProdID=0179 Rev= 0.00
S: Manufacturer=Realtek
S: Product=802.11n NIC
S: SerialNumber=08D833303245
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=rtl8188eu
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
...
# svc wifi enable
# iwconfig
lo no wireless extensions.

sit0 no wireless extensions.

ip6tnl0 no wireless extensions.

iw_get_stats return success.
wlan0 unassociated Nickname:"<WIFI@REALTEK>"
Mode:Auto Frequency=2.412 GHz Access Point: Not-Associated
Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=0/100 Signal level=0 dBm Noise level=0 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

iw_get_stats return success.
wlan1 unassociated Nickname:"<WIFI@REALTEK>"
Mode:Auto Frequency=2.412 GHz Access Point: Not-Associated
Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=0/100 Signal level=0 dBm Noise level=0 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

However, I have to insmod the module manually and I can't enable wifi from gui. This is the logcat output after I toggle wireless switch:

I/dalvikvm( 1419): DexOpt: not all deps represented
E/dalvikvm( 1419): /system/framework/svc.jar odex has stale dependencies
D/dalvikvm( 1419): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
E/memtrack( 1419): Couldn't load memtrack module (No such file or directory)
E/android.os.Debug( 1419): failed to load memtrack module: -2
D/AndroidRuntime( 1419): Calling main entry com.android.commands.svc.Svc
D/WifiService( 429): setWifiEnabled: true pid=1419, uid=0
D/AndroidRuntime( 1419): Shutting down VM
E/WifiHW ( 429): wifi_power_ctrl(1)
D/dalvikvm( 1419): GC_CONCURRENT freed 95K, 16% free 560K/660K, paused 9ms+2ms, total 20ms
E/BluetoothAdapter( 622): Bluetooth binder is null
D/dalvikvm( 622): GC_CONCURRENT freed 279K, 12% free 4166K/4708K, paused 9ms+20ms, total 123ms
D/WifiHW ( 429): check_wifi_ifname_from_proc: find lo
D/WifiHW ( 429): check_wifi_ifname_from_proc: find sit0
D/WifiHW ( 429): check_wifi_ifname_from_proc: find ip6tnl0
D/WifiHW ( 429): check_wifi_ifname_from_proc: find wlan0
D/WifiHW ( 429): check_wifi_ifname_from_proc: find wlan1
D/SoftapController( 110): Softap fwReload - Ok
D/CommandListener( 110): Setting iface cfg
D/CommandListener( 110): Trying to bring down wlan0
D/WifiHW ( 429): check_wifi_ifname_from_proc: find lo
D/WifiHW ( 429): check_wifi_ifname_from_proc: find sit0
D/WifiHW ( 429): check_wifi_ifname_from_proc: find ip6tnl0
D/WifiHW ( 429): check_wifi_ifname_from_proc: find wlan0
D/WifiHW ( 429): check_wifi_ifname_from_proc: find wlan1
...
D/WifiHW ( 429): check_wifi_ifname_from_proc: find ip6tnl0
D/WifiHW ( 429): check_wifi_ifname_from_proc: find wlan0
D/WifiHW ( 429): check_wifi_ifname_from_proc: find wlan1
E/WifiHW ( 429): wifi_start_supplicant get wifi_ifname(SECONDARY) fail
E/WifiStateMachine( 429): Failed to start supplicant!
E/WifiStateMachine( 429): wifi sta open fail, disable
D/WifiService( 429): setWifiEnabled: false pid=429, uid=1000

Enabling wireless from GUI works fine with the kernel under android 4.2.2, but not in 4.4.4. Any ideas?

Avatar
lujji

Contributor
Forum Posts: 67
Member Since:
2013/07/09
sp_UserOfflineSmall Offline

Thanks Received: 19
3
2015/01/03 - 17:39
sp_Permalink sp_Print sp_EditHistory

Well, problem solved by using a precompiled libhardware_legacy with overrides for insmod and rmmod functions. The 8188eu.ko module is indeed redundant and can be safely removed from the system if the module is built-in. No idea why it's left there, I guess rockchip sdk is a joke.

.. I just love talking to myself in this thread -__-

The following users say thank you to lujji for this useful post:

ADz83
Avatar
ADz83
Member
Forum Posts: 19
Member Since:
2014/10/13
sp_UserOfflineSmall Offline

Thanks Received: 1
4
2015/01/06 - 04:33
sp_Permalink sp_Print

Hi Lujji,

 

I was just wondering if you had made any more progress with this project?  :)

-ADz


Avatar
lujji

Contributor
Forum Posts: 67
Member Since:
2013/07/09
sp_UserOfflineSmall Offline

Thanks Received: 19
5
2015/01/07 - 18:39
sp_Permalink sp_Print

Yes, I've got the driver working properly now.

The following users say thank you to lujji for this useful post:

ADz83
Avatar
ADz83
Member
Forum Posts: 19
Member Since:
2014/10/13
sp_UserOfflineSmall Offline

Thanks Received: 1
6
2015/01/07 - 18:45
sp_Permalink sp_Print

Does this mean we can expect a custom KK kernel from you?  Would you be releasing one for the JXD S7800B?   :)

Avatar
lujji

Contributor
Forum Posts: 67
Member Since:
2013/07/09
sp_UserOfflineSmall Offline

Thanks Received: 19
7
2015/01/07 - 19:09
sp_Permalink sp_Print

I'll finish porting the kernel sometime next week, probably. Some minor issues still remain.

The following users say thank you to lujji for this useful post:

ADz83
Avatar
skelton

Contributor
Forum Posts: 45
Member Since:
2013/04/01
sp_UserOfflineSmall Offline

Thanks Received: 26
8
2015/01/09 - 17:26
sp_Permalink sp_Print

Hi lujji, I see you are using g7 KK kernel as a base for the port. I have a newer RK source in my github ready for Android 4.4.4 in case you need it, though I don't think it changes too much, but in case you want to take a look at it.

https://github.com/skelton/G5_444

The following users say thank you to skelton for this useful post:

lujji
Avatar
lujji

Contributor
Forum Posts: 67
Member Since:
2013/07/09
sp_UserOfflineSmall Offline

Thanks Received: 19
9
2015/01/10 - 13:26
sp_Permalink sp_Print

Hi skelton, your G7 repo was very helpful ;) Porting the kernel was easier than I expected, but still not a piece of cake. I actually thought that g7 was also 4.4.4 but it's not a big deal, I try to update parts of the kernel to the linux-rockchip stable branch anyway.

If tincore agrees to let me pack slightly outdated versions of his Keymapper and Quickflasher apps, then I'll publish a rom with the new kernel.

I'm a bit concerned with battery indication, stock  KK kernel had a random number generator instead. In JB I used BATTERY_RK30_ADC config but it is no good in KK, so I switched to BATTERY_RK30_ADC_FAC because it allows me to set voltage divider values. Indication is better but seems slightly off.

Which option would you recommend? I looked at your G5 defconfig and I can find neither of theses definitions. 

Avatar
skelton

Contributor
Forum Posts: 45
Member Since:
2013/04/01
sp_UserOfflineSmall Offline

Thanks Received: 26
10
2015/01/10 - 14:10
sp_Permalink sp_Print

To be honest I have never changed anything related to battery, so I didn't know g5a came with no defintions at all.

However in g7 it comes with:

CONFIG_BATTERY_RK30_ADC_FAC=y

CONFIG_BATTERY_RK30_VOL3V8=y

But g7 and g5a use different boards, so I suppose it depends on the board.

in g5a, g58 and q88+ it comes with no definition, unless it is controlled by:

CONFIG_POWER_RT5025=y , ¬†though √ć think 7800 does not use rt5025 regulator.

So honestly no idea which one can be used in 7800, I am afraid only choice is to keep trying with the different options.

Or look for another source of a device that use the phonepad board to see a better reference.

The following users say thank you to skelton for this useful post:

lujji
Forum Timezone: Europe/Paris

Most Users Ever Online: 749

Currently Online:
177 Guest(s)

Currently Browsing this Page:
1 Guest(s)


Devices in use: Desktop (153), Phone (20), Tablet (4)

Top Posters:

Oma7144: 5664

globula_neagra: 2424

finless: 604

DarthJabba: 551

exelletor: 450

JochenKauz: 450

cracktech: 430

maikal: 394

Newest Members:

ascaval2

abcgame01

lovelovelove

at1491

Gub78

MezaCorleehone

Forum Stats:

Groups: 10

Forums: 185

Topics: 5884

Posts: 58439

 

Member Stats:

Guest Posters: 43

Members: 255374

Moderators: 5

Admins: 1

Administrators: admin

Moderators: globula_neagra, exelletor, JochenKauz, Oma7144, cracktech


CrewRKTablets moderators: JochenKauz and Astralix