android wifi porting,Porting WiFi drivers to Android

Hi,Was trying the same but have been facing some errors. E/WifiHW ( ):

Unable to open connection to supplicant on

"/data/system/wpa_supplicant/wlan0"

Even though i have added permissions as mentioned. Would like to

compare my files with yours. Would you mind sharing a copy of the

modified files ?

Thanks

Yonathana

Add a chown wifi wifi on the folders and verify with ls -l

/data/system/ on console. I placed the files here:http://www.linuxconsulting.ro/android/files/wifi/

Also try to turnoff/turnon wifi, maybe wpa_supplicant hasn't yet

created the socket. I've seen this on my build.

You should see something similar to this in logcat (if you enabled

wpa_supplicant debug):

D/wpa_supplicant( 843): Initializing interface 'wlan0' conf

'/system/etc/wifi/wpa_supplicant.conf' driver 'awext'

ctrl_interface 'N/A' bridge 'N/A'

D/wpa_supplicant( 843): Configuration file

'/system/etc/wifi/wpa_supplicant.conf' ->

'/system/etc/wifi/wpa_supplicant.conf'D/wpa_supplicant( 843): Reading configuration file

'/system/etc/wifi/wpa_supplicant.conf'

D/wpa_supplicant( 843): ctrl_interface='wlan0'

This is what i did panic : drop both your files in the respective

dir and cross check in the rfs if they are sameCheck permissions of

s -l /data/system

-rw-rw-r-- system system 35326 2000-01-01 00:00

packages.xml

-rw------- system system 8 2000-01-01 00:01

syncmanager.prefs

drwxrwx--x system system 2000-01-01 00:00

registered_services

drwxrwxrwx wifi wifi 2000-01-01 00:00 wpa_supplicant

-rw------- system system 4096 2000-01-01 00:00

entropy.dat

-rw------- system system 171 2000-01-01 00:00

wallpaper_info.xml

-rw-rw---- system system 16384 2000-01-01 00:00

accounts.db

-rw------- system system 604 2000-01-01 00:00

batterystats.bin

drwx------ system system 2000-01-01 00:00 usagestats

-rw------- system system 64 2000-01-01 00:00

appwidgets.xml

I/ActivityManager( 802): Starting activity: Intent {

act=android.intent.action.MAIN

cmp=com.android.settings/.WirelessSettings }

D/dalvikvm( 802): GC freed 9763 objects / 499352 bytes in

96ms

I/ActivityManager( 802): Displayed activity

com.android.settings/.WirelessSettings: 556 ms (total 556

ms)

W/WifiHW ( 802): Could not open /proc/modules: No such file or

directory

I/StatusBarPolicy( 802): received intent

android.net.wifi.WIFI_STATE_CHANGED

D/SettingsWifiEnabler( 985): Received wifi state changed from

Disabled to Enabling

D/WifiService( 802): ACTION_BATTERY_CHANGED pluggedType:

1

E/WifiHW ( 802): Unable to open connection to supplicant on

"/data/system/wpa_supplicant/wlan0": No such file or

directory

D/SettingsWifiEnabler( 985): Received wifi state changed from

Enabling to Enabled

I/StatusBarPolicy( 802): received intent

android.net.wifi.WIFI_STATE_CHANGED

E/WifiHW ( 802): Unable to open connection to supplicant on

"/data/system/wpa_supplicant/wlan0": No such file or

directory

E/WifiHW ( 802): Unable to open connection to supplicant on

"/data/system/wpa_supplicant/wlan0": No such file or

directory

I/StatusBarPolicy( 802): received intent

android.intent.action.TIME_TICK

E/WifiHW ( 802): Unable to opeinit: no such service

'dhcpcdwlan0'

n connection to supplicant on "/data/system/wpa_supplicant/wlan0":

No such file or directory

V/WifiStateTracker( 802): Supplicant died unexpectedly

E/WifiStateTracker( 802): Could not stop DHCP

D/NetworkStateTracker( 802): setDetailed state, old =IDLE and new

state=DISCONNECTED

D/ConnectivityService( 802): ConnectivityChange for WIFI:

DISCONNECTED/DISCONNECTED

I/EthernetService( 802): setEthState from 2 to 2

init: no such service 'dhcpcdwlan0'

D/SettingsWifiEnabler( 985): Received wifi state changed from

Enabled to Disabling

I/StatusBarPolicy( 802): received intent

android.net.wifi.supplicant.CONNECTION_CHANGE

I/StatusBarPolicy( 802): received intent

android.net.wifi.WIFI_STATE_CHANGED

Am i at loss of ideas, Any clues what could be wrong ?

Also when i do a command line init as soon as system

bootswpa_supplicant -iwlan0 -c/system/etc/wifi/wpa_supplicant.conf

-ddI/StatusBarPolicy( 802): received intent

android.intent.action.TIME_TICK

D/wpa_supplicant( 989): Initializing interface 'wlan0' conf

'/system/etc/wifi/wpa_supplicant.conf' driver 'default'

ctrl_interface 'N/A' bridge 'N/A'

D/wpa_supplicant( 989): Configuration file

'/system/etc/wifi/wpa_supplicant.conf' ->

'/system/etc/wifi/wpa_supplicant.conf'

D/wpa_supplicant( 989): Reading configuration file

'/system/etc/wifi/wpa_supplicant.conf'

E/wpa_supplicant( 989): Failed to read or parse configuration

'/system/etc/wifi/wpa_supplicant.conf'.

D/wpa_supplicant( 989): Failed to add interface wlan0

D/wpa_supplicant( 989): Cancelling scan request

D/wpa_supplicant( 989): Cancelling authentication timeout

# I/StatusBarPolicy( 802): received intent

android.intent.action.TIME_TICK

# cat /system/etc/wifi/wpa_supplicant.conf

ctrl_interface=DIR=/data/system/wpa_supplicant GROUP=wifi

update_config=1

This is what i see ? Wonder why the wpa_supplicant .conf is not

being parsed

Should have read access to wifi user/group. Also specify -Dwext as

driver.

Dear sir, I had setup my device with wpa_supplicant working good.

But the message "ioctl[SIOCGIWRATE]: No such device" is showed

after linkspeed command parsed by driver_awext.c. Would you please

help me to figure out where to setup the correct interface in this

situation? Thank you~

@yonathana You have syntax errors on your dhcpcd line also check

permissions for /system/etc/wifi

@Oramon Your driver doesn't support WRATE ioctl that means you will

have no link speed information but wifi should be working

without.

Hi

In Step6, building it as a module,When you say:

"Make sure you copy your kernel module when building android to the

correct location."

What is the correct location ? I built my driver on linux and

copied the generated wl.ko file to the

out/target/product/xxx/system/lib/modules/2.6.29-android-x86/kernel/drivers/net/wireless/wl/wl.ko

But, I get "Exec format error" when I try to do insmod

wl.ko.

How do I include the module to be built by android ? Mine is a

broadcom 4311 wireless card.

Regards

Sireesha.

Hi panic,

thanks for your work. It helped me a lot.

Here some improvements:

@ point 4

if you use dhcp in init.rc you should also add a working

folder.

mkdir /data/misc/dhcp 0770 dhcp dhcp

chmod 0770 /data/misc/dhcp

@ point 5

you have to use the wpa_supplicant.conf in /data/misc/wifi because

in /system/etc/wifi/ is only a template which is write protected.

to save configured networks you need to have write access to the

conf file.

@ point 8

your awext driver patch misses a small part.

diff --git a/drivers.c b/drivers.c

index 45c2f55..cc5621c 100644

--- a/drivers.c

+++ b/drivers.c

@@ -15,6 +15,9 @@

#include "includes.h"

+#ifdef CONFIG_DRIVER_AWEXT

+extern struct wpa_driver_ops wpa_driver_awext_ops;

+#endif

#ifdef CONFIG_DRIVER_WEXT

extern struct wpa_driver_ops wpa_driver_wext_ops;

#endif

@@ -62,6 +65,9 @@ extern struct wpa_driver_ops

wpa_driver_custom_ops;

struct wpa_driver_ops *wpa_supplicant_drivers[] =

{

+#ifdef CONFIG_DRIVER_AWEXT

+ &wpa_driver_awext_ops,

+#endif

#ifdef CONFIG_DRIVER_WEXT

&wpa_driver_wext_ops,

#endif

Hi,

I'm trying to build wpa_supplicant_6 (Andriod 2.1),have made the

modifications as said.But im getting build errors

-----------------------------------------

config.c:60: error: expected declaration specifiers or ‘...’ before

‘size_t’

config.c: In function ‘wpa_config_parse_string’:

config.c:66: warning: implicit declaration of function

‘os_strrchr’

config.c:66: warning: assignment makes pointer from integer without

a cast

config.c:67: error: ‘NULL’ undeclared (first use in this

function)

config.c:67: error: (Each undeclared identifier is reported only

once

config.c:67: error: for each function it appears in.)

config.c:69: error: ‘len’ undeclared (first use in this

function)

config.c:70: warning: implicit declaration of function

‘os_malloc’

----------------------------------------

Also pls clarify where the kernel module needs to copied.

Thanks

Kiranmai

Kiran the patch and howto is for wpa_supplicat not for the

wpa_supplicant_6 that appeared on froyo. I will look on _6 version

soon.

panic,i want to use upnp-service discovery in andriod.Do you i/p's

about that?

Any workiing library sources/refernces.

Thanks

Kiranmai

Hi, I followed the steps to enable wifi on froyo. wifi is getting

enabled but when tried to connect it is not setting system

properties like dhcp.eth0.ipaddress and other. it is setting only

dhcp.eth0.dns1, dhcp.eth0.dns2 and dns3. whether I need to

configure or change to set all system properties?

Thanks Nicu. I wish I had found your post a couple of days earlier,

but even so, it saved me considerable time configuring things for

one of our customers.

I posted some notes on my experiences on our blog:

http://boundarydevices.com/blogs/?p=284

Great stuff! Works like a charm on Eclair. What about Froyo and

wpa_supplicant_6?

If you are interested, I have done it for supplicant 0.6.10: it's

here:

http://git.alwaysinnovating.com/cgit.cgi/ai.android/tree/preprocess/froyo/wifi.patch

The only notable difference is .get_scan_results2

Hi,

I'd like very much to speak to you about your informative post on

porting Wi-Fi drivers to Android. Are you interested in freelance

consulting work? I'd be really grateful if you could contact me -

blake@hfield.com. I look forward to hearing from you.

-Blake

Sorry but I haven't found any way to contact you. So, why your sis

drivers aren't part of Xorg?

Is it updated?

Thank you.

Dear Sir

First, thank you for your shares, it really helps me a lot. Now I

have a question of supporting multi-WiFi drivers at the same time.

Is there any possibility not to init interface

name(ex.wlan0,wpa_supplicant -iwlan0 -c xxxxx......) in init.rc?

Because different WiFi drivers have different interface names. Or

could you provide any other suggestions for this purpose? My

work-arounded solution is to modify the same interface name for

different WiFi drivers in src code(ex.wlan0). Then modify

wifi.c(hardware\libhardware_legacy\wifi) to load different WiFi

modules base on VID/PID table, which I've added for this purpose.

But I think it's not a good solution. I'd appreciate of your

comments. Thank you for your kindly help again.

ps. my email is hoyushen@gmail.com

Sincerely, Kevin

proveyourselfthom:

No the X11 drivers are no longer updated, although Mandriva had

picked up my driver and added fixes and updates. I think the driver

name was sisimedia or something similar.

hoyushen:

Might be possible with gingerbread, since I've seen that the

wpa_supplicant and dhcp are now started from wifi.c in

hardware_legacy/wifi

You will need to modify wifi.c to get the interface name from sysfs

and build up the wpa_supplicant command.

Hi panic,

Thanks a lot for this beautiful guide.

I could now make wifi working on GingerBread.

The issue I am facing is, it doesn't scan any network(it doesnt

give error thoug). (ping works fine)

wpa_supplicant.conf

--------------------

update_config=1

ctrl_interface=DIR=/data/system/wpa_supplicant GROUP=wifi

eapol_version=1

ap_scan=1

fast_reauth=1

What I do is,

"insmode wlan.ko"

To do it from shell, I have 2 shells open.

1. wpa_supplicant -dd -Dwext -imlan0

-c/data/misc/wifi/wpa_supplicant.conf

2. wpa_cli -p /data/system/wpa_cupplicant

> scan

Logcat

========

D/wpa_supplicant( 1450): CMD: PING

D/wpa_supplicant( 1450): CMD: SCAN

D/wpa_supplicant( 1450): Setting scan request: 0 sec 0

usec

D/wpa_supplicant( 1450): wpa_supplicant_scan: scan_req = 2, ap_scan

= 1

D/wpa_supplicant( 1450): State: INACTIVE -> SCANNING

I/wpa_supplicant( 1450): CTRL-EVENT-STATE-CHANGE id=-1 state=2

BSSID=00:00:00:00:00:00

D/wpa_supplicant( 1450): Starting AP scan (broadcast

SSID)

D/wpa_supplicant( 1450): wpa_driver_wext_combo_scan:

Start

D/wpa_supplicant( 1450): Scan requested - scan timeout 10

seconds

D/wpa_supplicant( 1450): CMD: PING

D/wpa_supplicant( 1450): Scan timeout - try to get

results

D/wpa_supplicant( 1450): Received 0 bytes of scan results (0

BSSes)

D/wpa_supplicant( 1450): New scan results available

D/wpa_supplicant( 1450): No suitable AP found.

D/wpa_supplicant( 1450): State: SCANNING -> INACTIVE

I/wpa_supplicant( 1450): CTRL-EVENT-STATE-CHANGE id=-1 state=1

BSSID=00:00:00:00:00:00

D/wpa_supplicant( 1450): CMD: PING

Can you please help out in terms of what I am missing???

Hi,

I followed the steps as you have mentioned in the post, using

Android Sockets, but I get an error as follows:-

I/wpa_supplicant( 1221): CTRL_IFACE monitor[0]: 13 - Permission

denied

I/wpa_supplicant( 1221): CTRL-EVENT-STATE-CHANGE id=-1 state=1

BSSID=00:00:00:00:00:00

I/wpa_supplicant( 1221): CTRL_IFACE monitor[0]: 13 - Permission

denied.

Please let me know if you have come across this issue.

Thanks & Regards,

Yegnesh

http://blog.naver.com/ernice/20146498720

Thanks. I successed with RTL8188cu usb wifi modules and NFS

Panic,

Are you still taking some wifi related questions?

Next update will be for Android 4.x ICS

Hi !

What is the difference between Android private socket and Unix

standard socket ? What should one prefer ?

Thanks,

Andrey

i am using panda board runs Android ICS and the on board wifi

interface is enabled "wlan0"

Now i am trying to add another interface "wlan1" to android and i

want when i enable the wifi on the GUI it turns on my interface , i

have succeeded to do so with wpa_supplicant by setting

wifi.interface wlan1 , but the problem is with the DHCP , the DHCP

is always trying to run over wlan0 not wlan1

Is there is any property that i can sit to convince the GUI to run

the DHCP over wlan1?

Salut, as dori si eu niste ajutor, am o tableta arnova 7c g2,

filesystem yaffs, si am reusit sa folosesc un rom de zte v9,

problema e ca, nu am wifi, telefonie, radio, bluetoth, am incercat

sa portez asa cum zici tu aici, dar nu reusesc de nici un fel (am

folosit driverele originale care erau pe room-ul de la arnova,

editat init etc.)

Am aproximativ acelasi rezultat cu un tip care a postat pe aici, as

aprea foarte mult orice tip de sfat.

Panic,

I have a hardware device very similar to the O2 joggler.

Specifically it is an Atom-based Openpeak Openframe 7E.

There are some great Android builds out there for it's sister

device, the o2 Joggler, but that device has a different WiFi

radio.http://www.jogglerwiki.com/forum/viewtopic.php?f=2&t=196&start=240

As a result it appears that the joggler image mentioned doesn't

have the necessary WiFi driver for the Openframe

hardware.

The Wireless hardware in the OpenFrame, verified by lspci, is the

BCM43225. From this site, I believe the driver would be the

brcmsmac.

Assuming that makes sense so far, here's my goal. I'd like to add

the appropriate Android driver for this WiFi hardware to the custom

build mentioned above. I believe it would entail the addition of

the .ko driver, as well as the .bin firmware files as you

outline.

My challenge, however, is that I cannot find an Android driver

(.ko) already built, nor have I been able to verify that adding

that driver would actually work.

Naively I took an ubuntu version of the brcmsmac.ko, added it to my

device, and ran insmod on it. That errors out and fails to

load.

Any suggestions? Any questions that would help clarify what I'm

trying to do?

Bottom line, I have an andriod image that's 99% of the way there, I

just need to "add" support for the specific wireless device

installed in my hardware.

Any guidance would be greatly appreciated.

Thanks and best regards

AT

@AT you will need to get the kernel source for that device, and

compile the kernel module for the wifi. It probably fails because

of missmatched kernel version / arch. The ubuntu compiled .ko won't

work since it's compiled for another kernel and probably with

another march flags.

@globula_neagra If you change the kernel version by using another

ROM the old modules won't work, they need to be recompiled.

@Adel Nour The latest gingerbread added support for multiple

interface DHCPCD.

They are configured in init.rc by dhcpcd_wlan0,

dhcpcd_wlan1

For older versions of android see my patch:

https://gitorious.org/picopc-android-eclair/system-core/commit/515dbcf064d432d6a8f04a106f31287e1780e96b

Thanks Nicu! I have the source for the driver. Can I compile on OSX

by specifying the proper target architecture??

Hi Nicu ,According to following :

Android uses wireless-extensions to support its 802.11 drivers. The

drivers that Android devices have up to this day used are all using

wireless-extensions for communication.

It seems to said that a kernel driver implment via mac80211,

cfg80211 API could not support Andorid now, right ?

I am trying to port a rtl81xx series driver (in linux 2.6.35,

realtek chip) to support Android but failed; the Android setting UI

- wifi enable checkbox appers to on then off again and again

...

I find this driver implement via mac80211 , cfg80211 API , issues

seems to be related about after scanning ...

Is there any solution to resolve this ?

Thanks very much .

Hi Nicu ,According to following :

Android uses wireless-extensions to support its 802.11 drivers. The

drivers that Android devices have up to this day used are all using

wireless-extensions for communication.

It seems to said that a kernel driver implment via mac80211,

cfg80211 API could not support Andorid now, right ?

I am trying to port a rtl81xx series driver (in linux 2.6.35,

realtek chip) to support Android but failed; the Android setting UI

- wifi enable checkbox appers to on then off again and again

...

I find this driver implement via mac80211 , cfg80211 API , issues

seems to be related about after scanning ...

Is there any solution to resolve this ?

Thanks very much .

Hi, thanks for this clear and complete tutorial. Very

helpful!

But... one thing I miss, very basic I think. I have prepared my

wpa_supplicant.conf and I have built my driver from the kernel. So,

in opedr to pick them with my Andorid build, in my full_.mk I've

added these copy operations:

PRODUCT_COPY_FILES += \

$(LOCAL_PATH)/bcm/dhd.ko:system/lib/modules \

$(LOCAL_PATH)/bcm/4329_nvram.txt:system/etc/firmware \

$(LOCAL_PATH)/bcm/fw4329.bin:system/etc/firmware \

$(LOCAL_PATH)/bcm/wpa_supplicant.conf:system/etc/wifi

but as neither system/etc/firmware nor system/etc/wifi exist in the

AOSP out/target dir, the result is incomplete.

How to make the AOSP build create the missing

directories?

thanks

PS- Anyone interested, this is he discussion group about the

platform I'm working on:https://groups.google.com/forum/?fromgroups#!forum/renesas-emev-osp

Hi Pavel, thanks a lot for this helpful tutorial.

One thing I miss. Once I have the kernel driver, firmware and

wpa_supplicant.conf, in order to include these in the AOSP build I

should add these copy operations in my full_.mk, I think:

PRODUCT_COPY_FILES += \

$(LOCAL_PATH)/bcm/dhd.ko:system/lib/modules \

$(LOCAL_PATH)/bcm/4329_nvram.txt:system/etc/firmware \

$(LOCAL_PATH)/bcm/fw4329.bin:system/etc/firmware \

$(LOCAL_PATH)/bcm/wpa_supplicant.conf:system/etc/wifi

But system/etc/firmware and system/etc/wifi directories aren't

created by the standard build, so that isn't enough.

What do I miss?

thanks

Fabio

PS - anyone interested - this is the group where we discuss about

the platform I'm building for:

https://groups.google.com/forum/?fromgroups#!forum/renesas-emev-osp

Hi Techies,

I had downloaded the android ICS source code from google

repositories.

I am able to compile and run the source code and build for emulator

is working superb.Then I decided to burn on device Huawei Ascend

G300 U8818.I had downloaded the Device configuration from github

repository.

Now I started compiling for Huawei device.

When I execute the command make -j4 then I get the following

errormake: *** No rule to make target

`out/target/product/u8818/obj/STATIC_LIBRARIES/lib_driver_cmd_wext_intermediates/lib_driver_cmd_wext.a',

needed by

`out/target/product/u8818/obj/EXECUTABLES/wpa_supplicant_intermediates/LINKED/wpa_supplicant'.

St

Please help in me.I am googling for almost 15 days but no guide no

clues.

Thank You.

Hi Techies,

I had downloaded the android ICS source code from google

repositories.

I am able to compile and run the source code and build for emulator

is working superb.Then I decided to burn on device Huawei Ascend

G300 U8818.I had downloaded the Device configuration from github

repository.

Now I started compiling for Huawei device.

When I execute the command make -j4 then I get the following

errormake: *** No rule to make target

`out/target/product/u8818/obj/STATIC_LIBRARIES/lib_driver_cmd_wext_intermediates/lib_driver_cmd_wext.a',

needed by

`out/target/product/u8818/obj/EXECUTABLES/wpa_supplicant_intermediates/LINKED/wpa_supplicant'.

St

Please help in me.I am googling for almost 15 days but no guide no

clues.

Thank You.

Thanks a ton!

I got wifi running on CyanMobileX custom ROM for Galaxy 551

(GT-I5510)

THanks

Hello Nicu,

Thank you for this tutorial

I want to know if are you doing the update for Android

4.x.

Because I can't do this modifications in Android 4.0.

Thank you.

Best regards,

S.K

Hello Nicolae,

Do you have the update for android version 4.X ?

Thank you.

Best regards,

S.K

Hello Nicolae,

Do you have the update for android version 4.X ?

Thank you.

Best regards,

S.K

I will start working on ICS version in a few weeks. But probably

rowboat, cyanogen might already have these patches ported to ICS so

it's worth checking them out too.

Regarding the issue where wifi automatically turns off after

enabling it, it's because it can't ifup the interface (missing

firmware, driver has other name for interface instead of wlan0).

Check logcat it should tell you more.

Hi Nicu,

I've amanged to complete the integration on GB and now I'm porting

to JB. issue is that in GB I used to have the "wifi" option enabled

under wireless settings, even before integrating the driver etc,

while I miss this in JB. Any idea what could be missing?

thanks again

Fabio

Ok, got it. In order for the WiFi Settings sub-option to show up,

the sfollowing file needs to be present in the build:

system/etc/permissions/android.hardware.wifi.xml

In ICS or JB we do something like this in device.mk to copy the

file:

PRODUCT_COPY_FILES += \

frameworks/base/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml

Content is simply something like:

- manu Thanks to Viesh , from

https://groups.google.com/d/msg/android-porting/KDMjAcfPUtc/z9yYLPO9MowJ

-

Thanks for letting me know. Also for some reason the content of

android.hardware.wifi doesn't show up in comments.

来源:http://blog.linuxconsulting.ro/2010/04/porting-wifi-drivers-to-android.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值