• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

WORKING: Infrastructure Mode AP!

Search This thread

andrew500

Member
Mar 6, 2009
39
0
Hello All,

I have gotten infrastructure mode working on my EVO. I compiled support for the SIOCSIWPRIV AP_PROFILE_SET system call into iwconfig and lo and behold:

After unloading and reloading the _ap.bin firmware using insmod while wifi-tether is running I issue the following command:

Command: # ./ultraiwconfig eth0 mode master

Response in kernel log:
Code:
<4>[19452.040679] penguin, get AP_PROFILE_SET
<4>[19452.041076] wl_iw: set ap profile:
<4>[19452.041442]       ssid = AndrewsAndroidAP
<4>[19452.042144]       security = wpa-psk
<4>[19452.042510]       key = 1234567890
<4>[19452.042877]       channel = 0
<4>[19452.043243]       max scb = 2
<4>[19454.110931] Set auto channel = 1
<4>[19454.112182] wl_iw_setap: do passhash...
<4>[19454.210723] [00]: aa2f2f2c
<4>[19454.210845] [01]: f4081ab1
<4>[19454.211059] [02]: ccc1d613
<4>[19454.211181] [03]: 887fd525
<4>[19454.211273] [04]: b51d0c01
<4>[19454.211395] [05]: 781b89b1
<4>[19454.211608] [06]: b5de9c57
<4>[19454.211730] [07]: 2f8812e2
<4>[19454.211853] wl_iw_setap: passphase = 2c2f2faab11a08f413d6c1cc25d57f88010c1db5b1891b78579cdeb5e212882f
<4>[19454.222106] ap setup done
<4>[19454.224487] send AP_UP

And proceed to assign IP information and bring the interface up.

The interface then appears on my Windows 7 laptop in infrastructure mode fully supporting wpa.

I will be working with Harald in the coming days to integrate this functionality into android-wifi-tether!
 

Attachments

  • tether.png
    tether.png
    22.7 KB · Views: 723
Last edited:

geeserver

Senior Member
Dec 29, 2005
145
40
PHX, AZ
NICE! this would be the first phone to do this right. Good option, dont really like the computer to computer mode. Thanks
 

spurnout

Senior Member
Sep 6, 2007
252
8
Can't believe I don't know this but this would make wifi-tether look like a real WAP instead of ad-hoc?
 

blakejohnson86

Senior Member
Nov 8, 2009
126
20
Plymouth, MN
I compiled support for the SIOCSIWPRIV AP_PROFILE_SET system call into iwconfig

So, if you compiled in support for it, than how did it work before? Wouldn't the Sprint Hotspot app have to use the same system calls?

I guess I would not put it past them to write a custom one that does some account checks before hand to make sure people are paying for the service...
 

andrew500

Member
Mar 6, 2009
39
0
So, if you compiled in support for it, than how did it work before? Wouldn't the Sprint Hotspot app have to use the same system calls?

I guess I would not put it past them to write a custom one that does some account checks before hand to make sure people are paying for the service...

They did not use iwconfig to setup their hotspot! I'm actually curious as to how they did do it. From what I can deduce they've created something in android.net.hotspot and just do java-based calls to that class. com.htc.WifiRouter is the name of the task that manages it.

I come from the world of linux so I'm just starting to see how the Android API fits into the picture, but I'm going to assume that's how they can make the system-calls needed to pull this off.

I'm using the same system calls, just I compiled them (because they are undocumented!) into iwconfig.

I'm going to guess this is how they manage to ensure you pay your bill, and will with FroYo, they hook into the interface that lets the applications make the system calls and as a result they are the gatekeeper.

Sprint changes your apn information btw, when you use their app, to ensure you pay for it. You're basically authenticating under a different 3g username.
 

joeykrim

Inactive Recognized Developer
Jan 9, 2009
1,979
1,310
I have gotten infrastructure mode working on my EVO. I compiled support for the SIOCSIWPRIV AP_PROFILE_SET system call into iwconfig and lo and behold:

After unloading and reloading the _ap.bin firmware using insmod while wifi-tether is running I issue the following command:

Command: # ./ultraiwconfig eth0 mode master
would it be possible you could post the binary for your custom configurated iwconfig?

it'd be great for the advanced users (hence the dev section) to get access to your amazing work.
thanks for this discovery and hard work to bring it about!

to clarify steps, start wifi tether, unload, reload _ap.bin firmware with insmod, start iwconfig wtih ./ultraiwconfig eth0 mode master, assign ip information and bring up the interface.

did i catch everything? thanks again!
 
Last edited:

kwajr

Senior Member
May 26, 2008
220
7
44
lynchburg va
Omfg I have been waiting on this for ever thank you
This was the only thing that made me want the hotbot app now I can tether my June and download music from the market place anywhere and regress my drm
-------------------------------------
Sent via the XDA Tapatalk App
 

mrmomoman

Senior Member
Feb 19, 2009
843
15
Awesome work. I was wondering when you were going to get this working :) I knew that ad-hoc wasn't not good enough from your perspective.

Thanks for the great work!!
 

andrew500

Member
Mar 6, 2009
39
0
would it be possible you could post the binary for your custom configurated iwconfig?

it'd be great for the advanced users (hence the dev section) to get access to your amazing work.
thanks for this discovery and hard work to bring it about!

to clarify steps, start wifi tether, unload, reload _ap.bin firmware with insmod, start iwconfig wtih ./ultraiwconfig eth0 mode master, assign ip information and bring up the interface.

did i catch everything? thanks again!

Here you go dude, it's rough.

I will not answer questions on this binary. It's a hack for sure. Here are my notes on it:

Turn off WiFi (not necessary, just being consistant)

Start WiFi Tether and start tethering

Issue the following commands:

rmmod bcm4329
insmod /system/lib/modules/bcm4329.ko firmware_path=/etc/firmware/fw_bcm4329_ap.bin
./ultraiwconfig eth0 mode master
ifconfig eth0 192.168.2.254 netmask 255.255.255.0
ifconfig eth0 up

You should have a fully functional wifi hotspot! I understand some of those commands are redundant but I haven't worked on them yet. The ultraiwconfig utility will be cleaned up in the final version, right now it does not take any parameters. Your AP will be called AndrewsAndroidAP and the wpa pass is 0123456789.
 

Attachments

  • ultraiwconfig.zip
    62.7 KB · Views: 100

joeykrim

Inactive Recognized Developer
Jan 9, 2009
1,979
1,310
Here you go dude, it's rough.

I will not answer questions on this binary. It's a hack for sure. Here are my notes on it:

Turn off WiFi (not necessary, just being consistant)

Start WiFi Tether and start tethering

Issue the following commands:

rmmod bcm4329
insmod /system/lib/modules/bcm4329.ko firmware_path=/etc/firmware/fw_bcm4329_ap.bin
./ultraiwconfig eth0 mode master
ifconfig eth0 192.168.2.254 netmask 255.255.255.0
ifconfig eth0 up

You should have a fully functional wifi hotspot! I understand some of those commands are redundant but I haven't worked on them yet. The ultraiwconfig utility will be cleaned up in the final version, right now it does not take any parameters. Your AP will be called AndrewsAndroidAP and the wpa pass is 0123456789.
been following your posts on the progress, so it all makes sense. just was missing the actual binary you tweaked. thanks, it looks good!
 

realgt

Member
May 24, 2010
23
0
getting a permission denied error on
./ultraiwconfig eth0 mode master

i guess it doesn't work on unrevoked rooted phones