[Q] Can't modify Wifi operations... - Nexus S Q&A, Help & Troubleshooting

Hello, I'm trying to modify Wifi operations (802.11 MAC) in Nexus S.
For example, I'm trying to change the values of fields in MAC header in Beacon frame or Null data frame(for power saving mode).
But, I have a critical problem that I cannot find the corresponding kernel files.
I don't know where the 802.11 MAC header is created in case of TX,
and where the values of fields of 802.11 MAC header are extracted from the received packet in case of RX.
Actually, I found several kernel files relating to 802.11 operations, so for example, kernel/net/mac80211/*, and so on.
Especially, kernel/net/mac802.11/tx.c includes "ieee80211_subif_start_xmit" function.
However, when I compile the kernel files to generate zImage, they are not included (they are not compiled), but my Nexus S works properly.
Also, I found that Nexus S employing JB uses kernel/drivers/net/wireless/bcmdmd/*
However, in .../bcmdhd/*, the functions which might be 802.11-related are not executed when browsing Internet using Nexus S.
Please let me know how to do or what to do...
and I'm currently working on the kernel version is 3.0.31 (JB).
Thank you.

Related

system call -> SOFTAP on -> infrastructure mode

Hello,
Has anyone taken a look at the bcm4329's kernel module? I've been looking around and trying to figure out how the Sprint Hotspot application works and I've found it calls the SIOCSIWPRIV system call on the interface to bring up this mode.
Does anyone have any experience on this matter? I'm looking to get infrastructure mode working.
My current approach is to write a native C app, do the ioctl with some sort of struct (I'm tempted just to memalloc and hand-write the first one), and see what happens.
The driver throws a bunch of debug info into the kernel log when you invoke the command so its dead easy to spot.
Any suggestions?
andrew500 said:
Hello,
Has anyone taken a look at the bcm4329's kernel module? I've been looking around and trying to figure out how the Sprint Hotspot application works and I've found it calls the SIOCSIWPRIV system call on the interface to bring up this mode.
Does anyone have any experience on this matter? I'm looking to get infrastructure mode working.
My current approach is to write a native C app, do the ioctl with some sort of struct (I'm tempted just to memalloc and hand-write the first one), and see what happens.
The driver throws a bunch of debug info into the kernel log when you invoke the command so its dead easy to spot.
Any suggestions?
Click to expand...
Click to collapse
im definitely not up to speed on this but if you wanna post some links to the source files you're referencing, it might help me and anybody else who is interested to get up to speed quicker and provide suggestions.
appreciate your work on troubleshooting and experimenting with wifi tether!
joeykrim,
I'm knee deep in it right now. I'm taking the source code to iwconfig and using it as a template to implement the system calls I need, using a hybrid of the structs in wireless.h and in the bcm4329 driver source, from the bravo kernel. Basically I create a big struct in memory and pass it into the driver using a pointer to a iw_point struct, which holds my big master struct, and then the driver copies it out of user-space into kernel space and acts upon it.
I'll put together all the details once they are a little more solid.
It looks like infrastructure-mode on the EVO is a very distinct possibility, this code will also translate into the workaround for built-in tether on Froyo, from what I've seen they are exclusively using this broadcom interface so far.
It's a hardware specific hack, but many of the phones that have come out lately are using the bcm4329 (and with good reason, chip has freakin everything).

Complete WiFi UI - Solved

I am starting this thread because i found that after all this long time of waiting an improvement from Android guys from Google regarding a complete UI for connecting to the miscellaneous WiFi configurations nothing comes out.
I consider my thread android development related, but if the mods want to move it please do it.
I am not a developer but I'm a user which wants all the cake not just a bite.
I am referring to special type of WiFi connections which wpa_supplicant is capable like:
"
EAP-TLS
EAP-PEAP/MSCHAPv2 (both PEAPv0 and PEAPv1)
EAP-PEAP/TLS (both PEAPv0 and PEAPv1)
EAP-PEAP/GTC (both PEAPv0 and PEAPv1)
EAP-PEAP/OTP (both PEAPv0 and PEAPv1)
EAP-PEAP/MD5-Challenge (both PEAPv0 and PEAPv1)
EAP-TTLS/EAP-MD5-Challenge
EAP-TTLS/EAP-GTC
EAP-TTLS/EAP-OTP
EAP-TTLS/EAP-MSCHAPv2
EAP-TTLS/EAP-TLS
EAP-TTLS/MSCHAPv2
EAP-TTLS/MSCHAP
EAP-TTLS/PAP
EAP-TTLS/CHAP
EAP-SIM
EAP-AKA
EAP-AKA'
EAP-PSK
EAP-FAST
EAP-PAX
EAP-SAKE
EAP-IKEv2
EAP-GPSK
LEAP (note: requires special support from the driver)"
This is copied from here http://hostap.epitest.fi/wpa_supplicant/
Seems that we have the gun and the bullets but we don't have the trigger.
This idea come to me when i was struggling connecting to my work WiFi and never succeeded, phones like Symbian or Windows based laughed into my phone's face (and i think that is not correct, considering it frustrating).
My proposal to all the devs from XDA is to build a new app and wpa_supplicant with all drivers and stuff which will be able to help us connecting very easy to all kind of WiFi methods.
PS: My work network configuration for windows is like this:
SSID, CKIP LEAP, username, domain, password.
Hidden WiFi: http://code.google.com/p/android/issues/detail?id=1041
LEAP WiFi: http://code.google.com/p/android/issues/detail?id=1871 ; http://code.google.com/p/android/issues/detail?id=1386
Ad-Hoc WiFi: http://code.google.com/p/android/issues/detail?id=82
Devices that are capable to connect on my work WiFi network:
Symbian V3 (Nokia N8)
Windows Mobile 6.5 (HTC Diamond)
Devices that are not capable to connect on my work WiFi network:
Android (HTC Desire HD and Samsung Galaxy S I)
iOS 4 (iPhone 3Gs)
iOS 5 (iPod)
Blackbery (Curve 8900)
============================================================
Update: 29/11/2011
After a 2-3 weeks of Google-ing I think that i found the gap with LEAP:
How you can see above LEAP - requires special support from the driver and i found a Linux driver which says like this:
2086 // CCX 1 spec v1.13, A01.1 CKIP Negotiation (page23):
2087 // "A Cisco access point advertises support for CKIP in beacon and probe response packets,
2088 // by adding an Aironet element and setting one or both of the CKIP negotiation bits."
2089 if( (info_element->data[IE_CISCO_FLAG_POSITION]&SUPPORT_CKIP_MIC) ||
2090 (info_element->data[IE_CISCO_FLAG_POSITION]&SUPPORT_CKIP_PK) )
Source:http://lxr.free-electrons.com/source/drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c
My work WiFi require CKIP Encryption so this is root cause for me to not be able to connect to LEAP.
Currently broadcom support: 802.1x; WEP, WEP2, WPA, WPA2 (Personal) TKIP and AES hardware acceleration 802.11i. When "broadcom" will release compatible drivers, we will be able to connect. Until then, all users that are in my situation will better get an alternative.
http://pdf.eccn.com/pdfs/Datasheets/Broadcom/BCM4329.pdf
http://os1a.cs.columbia.edu/lxr/source/drivers/net/wireless/bcm4329/wl_iw.c
So next remaining thing will be a "Complete UI" release for android which offers all type of connections.
================================================================================================
Update: 07/12/2011
In my craziness to find a solution to my problem regarding connection to work corporate WiFi, I found the missing link (in my opinion) between android and Linux capability to access CKIP encrypted networks: http://o2droid.phj.hu/trac/browser/kern_oII/drivers/staging/rt2860/sta/assoc.c . It is about a special characteristic that allow connections to Aironet access points with CCX (CISCO Compatible Extensions).
================================================================================================
Update: 14/03/2012
I need a port from Dell Streak to HTC DHD
I searched Google again and i found this:
http://forum.xda-developers.com/show...62&postcount=1 here is a file listed "system/etc/wlan/sdio-g-cdc-reclaim-idsup-wme-pktfilter-keepalive-aoe-toe-ccx-wapi.bin" and with a F3 in Total Commander contain this:
"NONE WEP1 TKIP WEP128 AES_CCM AES_OCB_MSDU AES_OCB_MPDU CKIP CKIP_MMH WEP_MMH" and
"ccx_auth_mode"
The file is in the Streaksmi.zip which is miui for dell streak that has bcm4325 chipset.
================================================================================================
Update: 10/07/2013
Working Solution Update: 10/07/2013
Flash [ROM][UNOFFICIAL] CyanogenMod 10.1 Nightlies / M-Series [RC5] and say many thanks to Mustaavalkosta !!! - Tested working build: cm-10.1-20130709-UNOFFICIAL-ace.zip
I too have issues with wifi sometimes, but I found using miui and connecting, inputting the password and then using the individual settings to input a manual IP and all that seems to work.
Sorry if I've misunderstood
Sent from my HTC Desire HD using Tapatalk
Difference between OS's
Joey93 said:
I too have issues with wifi sometimes, but I found using miui and connecting, inputting the password and then using the individual settings to input a manual IP and all that seems to work.
Sorry if I've misunderstood
Sent from my HTC Desire HD using Tapatalk
Click to expand...
Click to collapse
So what is different between MIUI and a usual Android system?
No idea apart from that it keeps the individual settings separately so you don't have to input manually every time you need to change, but it seems to be the only thing that works for all the networks I use.
Sent from my HTC Desire HD using Tapatalk
Compatibility with Ad-Hoc
Joey93 said:
No idea apart from that it keeps the individual settings separately so you don't have to input manually every time you need to change, but it seems to be the only thing that works for all the networks I use.
Sent from my HTC Desire HD using Tapatalk
Click to expand...
Click to collapse
Is it capable to connect with Ad-Hoc type of networks too?
And the answer is "Yes", wpa_supplicant from MIUI is capable to connect to Ad-Hoc networks.
Not sure what your problem connecting might be. At uni, we have EAP-PEAP/MSCHAPv2, and I can connect fine, and connect any android phones that come in fine aswell. We use a program called xpressconnect, but can do it manually too.
whiperhack said:
Is it capable to connect with Ad-Hoc type of networks too?
And the answer is "Yes", wpa_supplicant from MIUI is capable to connect to Ad-Hoc networks.
Click to expand...
Click to collapse
I have an application on my laptop that makes a network from it (like a router) which I've always assumed used ad-hoc and it's always connected fine to that so yeah I assume so =)
Old Leedroid ROMs used to work too if you wanted sense, but they were back in August-ish time
Already tried manual config
rorydaredkign said:
Not sure what your problem connecting might be. At uni, we have EAP-PEAP/MSCHAPv2, and I can connect fine, and connect any android phones that come in fine aswell. We use a program called xpressconnect, but can do it manually too.
Click to expand...
Click to collapse
Before i start this thread i tried several combination of configurations, I buyed even Advanced Leap WiFi from market and nothing. This problem is not from configuration because, like I said windows mobile and symbian is piece of cake to connect.
My connection is hidden ssid. After I put my credentials configured with leap, another network with same name but with WEP security appears, saying connecting...disconnected.
Update
I just tried MIUI and conclusions are:
1) Ad-Hoc is connectible (but stock android with a modified(patched) wpa_supplicant is capable to connect to Ad-Hoc too).
2) LEAP is still doing Connecting....Disconnected.
3) MIUI has a file named "/system/bin/wpa_cli" which stock didn't have it.
whiperhack said:
I just tried MIUI and conclusions are:
1) Ad-Hoc is connectible (but stock android with a modified(patched) wpa_supplicant is capable to connect to Ad-Hoc too).
2) LEAP is still doing Connecting....Disconnected.
3) MIUI has a file named "/system/bin/wpa_cli" which stock didn't have it.
Click to expand...
Click to collapse
For number 2 try manually inputting a static ip, dns, gateway and netmask =)
Must be something which makes the difference
Joey93 said:
For number 2 try manually inputting a static ip, dns, gateway and netmask =)
Click to expand...
Click to collapse
Thanks for the tip, I will try tomorrow. But what is the catch? What makes WM and Symbian better than Android when is about connecting to a LEAP network?
So you'd like other people to build an app for you?
Learn how to code!
All android comunity will thank to the courageous developer who will create the tweak
ivolol said:
So you'd like other people to build an app for you?
Learn how to code!
Click to expand...
Click to collapse
Why do you say "YOU"? Is not just me, is the whole android community that has lack of what i said in the thread. The work that will be done by a skilled developer from here will be used in the future by all androiders.
All the info and opinions that will be wrote in here will help the "courageous developer" to build the Complete WiFi UI.
My experience with the WiFi will help others to connect on similar networks.
In my opinion this is true development: trying to reach the impossible, or not yet possible, or not yet known.
I think is at last 1 developer in here which knows very good the WiFi protocols and can give us a hint.
For us (the ordinary users) is very difficult to start now learn coding in android and network protocols, because will last at least six months of staying in codes to get the idea of coding.
Compiling in android OS
ivolol said:
Learn how to code!
Click to expand...
Click to collapse
I checked your thread and is says nothing about compiling in Android OS. In my opinion this is the root cause of not fully working WiFi connectivity. With a proper .conf file of latest wpa_supplicant i think that the issue will become history.
Logcat and new tests
Hello again,
I've made some new tests and I found ......... nothing.
The thread with steps that i followed is this: http://code.google.com/p/android/issues/detail?id=8804

[Q] Reading 802.11 packet including header to application using onboard wifi chipset

Hi,
I am writing an wifi tether app where in we want to read total 802.11 packet (i.e. including 802.11 header) to application space and forward these packets to different gateways through LTE based on some criteria. Can you please suggest me if we can we do this without root privileges using onboard WIFI chipset on galaxy nexus(Verizon) phone?
Only method I know is writing a kernel module to hijack the packets from bcm4330 driver and handover to application. This requires kernel compilation and hence rooting the device. Any suggestions/comments or ideas on this idea?
Thanks In Advance.
Thanks,
ponugoti

[Q] Editing Kernal C Code, and adding a function to Java

Hello,
I am extremely lost here.
The RSSI (Received Signal Strength Index) for Wifi P2P in Android is not implemented. It is set to a constant 60 in the Java code. However, looking at the kernel, in p2p_supplicant.c, there is a pointer bss->level that contains the RSSI.
If I create a function in that file to get RSSI which just returns bss->level, how can I call that in Java?
I know that I will be creating a custom ROM, and I will read about doing that, but my question is how to connect the Java with the C?

Accessing integrated hardware (modem, gps, etc) after linux deploy

I'm an engineer/developer and know myself around Linux and a number of programming languages. I have however never programmed on a phone before and find myself on a project where I need to do just that.
We are building a field unit to capture radiometric data using custom shields on an Arduino. Due to power restrictions we cannot use more powerful hardware, yet we need to upload 8 to 10MB of data every 24 hours. I had the idea of using a mobile phone with Android, rooting and installing linux, then using the processing power and internal components to get GPS information, re-sync RTC, and then upload the data to the remote server. (The Arduino by itself is too small handle the SSH library and it doesn't have enough memory to upload the entire file using FTP. One could stream the data to the FTP protocol, but that requires multi-core processing which the Arduino doesn't support. )
I have rooted the device and installed Debian using "Linux Deploy", however I'm having a real hard time figuring out how to access the modem and GPS. It is a Motorola Moto E6. I couldn't find the modem and even install modem-manager to see if it would detect the device, but it didn't.
If anyone could point me in the right direction (drivers, documentation, instructionals, etc.) it would be very much appreciated.
Thank you.
Hi,
question is open here for quite a time, did you meanwhile figure out how to access the sensors? Some devices like accelerator are found via i2c, on my phone this is /sys/bus/i2c/devices, also current cpu frequency can be retrieved via cat /sys/bus/cpu/devices/cpu0/cpufreq/cpuinfo_cur_freq. The linux package lm-sensors and i2s-tools might help to access the devices. /sys/bus/platform/devices or /sys/devices, The current battery percentage is available from /sys/class/power_supply/battery/capacity and you can play with the leds via /sys/class/leds/<color>/brightness. Important for linux-deploy is to echo 1 > /sys/power/wake_lock to prevent the android from disabling the network while display is off.

Categories

Resources