[Q] Looking for tuning beacon interval on BCM4325 WLAN card - Android Software/Hacking General [Developers Only]

I am carrying out wifi mesh experiments on my several GT540 phones which are configured with wifi ad hoc mode.
However, I found that the network traffic has been dominated by the beacon messages which are broadcasted at the interval of 0.1 second. So I am looking for methods that can increase this beacon interval for higher network throughput.
The wifi adapters on my GT540 phones are Broadcom BCM4325. How can I configure their beacon intervals?
I did a liitle search into the android source code.
$ cd android-source-folder/hardware/broadcom/wlan/bcm4325
$ grep -lir "beacon_period" .
./src/include/wlioctl.h
./src/include/proto/802.11.h
There is only a range defined for beacon interval in the file 802.11.h.
#define DOT11_MIN_BEACON_PERIOD 1
#define DOT11_MAX_BEACON_PERIOD 0xFFFF
How I can adjust this beacon period? Any feedback would be extremely appreciated
Shawn

Related

[Q] Networking (netmask) issues on a Captivate

I've got a shiny new Samsung Captivate (Galaxy S) on AT&T.. working fairly well so far, besides the annoyances with the phone being locked down and the crappy bundled mail client (I've got loooots of email in my imap box, grin.) Phone is still stock; haven't had a chance to root it yet.
In any case, the issue I'm having is that the phone is setting an invalid netmask (255.0.0.0) on the wifi interface, instead of the proper one as served by dhcp (255.255.255.0).. this is preventing the phone from talking to other devices in 10/8.
Here's the DHCP response sent to the phone by my DHCP server:
Code:
Client-IP 10.20.0.120
Your-IP 10.20.0.120
Client-Ethernet-Address 00:26:37:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: ACK
Server-ID Option 54, length 4: 10.20.0.254
Lease-Time Option 51, length 4: 86400
Subnet-Mask Option 1, length 4: 255.255.255.0
Default-Gateway Option 3, length 4: 10.20.0.254
Domain-Name-Server Option 6, length 8: 10.20.0.254,10.20.0.1
BR Option 28, length 4: 10.20.0.255
RN Option 58, length 4: 43200
RB Option 59, length 4: 75600
END Option 255, length 0
PAD Option 0, length 0, occurs 4
As you can see from the above, the phone was assigned 10.20.0.120 with a netmask of 255.255.255.0. I finally set up the android sdk, and fired up a shell with adb.. here's what it thinks its ip is:
Code:
$ ifconfig eth0
eth0: ip 10.20.0.120 mask 255.0.0.0 flags [up broadcast running multicast]
even odder, the properties on the phone has the correct netmask; output from 'getprop':
Code:
[dhcp.eth0.pid]: [3350]
[dhcp.eth0.reason]: [BOUND]
[dhcp.eth0.dns1]: [10.20.0.254]
[dhcp.eth0.dns2]: [10.20.0.1]
[dhcp.eth0.dns3]: []
[dhcp.eth0.dns4]: []
[dhcp.eth0.ipaddress]: [10.20.0.120]
[dhcp.eth0.gateway]: [10.20.0.254]
[dhcp.eth0.mask]: [255.255.255.0]
[dhcp.eth0.leasetime]: [86400]
[dhcp.eth0.server]: [10.20.0.254]
I suspect a firmware bug, but don't know for sure - anyone run into this before?
Appreciate any thoughts!
Same issue here. I posted about it here and on the ATT forums and sadly nobody has any suggestions other than reporting the bug to samsung. I did a bit of poking around in the console grepping 255.0.0.0 but didnt find any files. Im just gonna weather the storm and wait for the next firmware to be released. I have a shortcut to wifi settings and I just toggle the "static ip" option as needed.
FYI, there's also a post on ATT's forums about this.. I'm not allowed to link to it, but a Google search for "Samsung Captivate WiFi DHCP netmask issue" will get you to it..
Generally I dislike reviving old threads, but this appears unresolved and I've been encountering it on my Samsung Vibrant.
Can anyone confirm whether this happens with Froyo, or other Eclair-based handsets, or is it specific to Android 2.1 on Samsung GalaxyS?
When the Wifi DHCP assigns an IP in the 10.x.x.x block, (which is actually assigned with a /24 netmask) android puts the IP on the interface TWICE, with both /24 and an incorrect /8 subnet mask. ("ifconfig" is essentially a legacy command from linux kernel 2.2 era, when multiple IPs required aliased interfaces - with two IPs on one interface today "ifconfig" will only show the first one. Since kernel 2.4 days "ip" is the preferred tool)
$ busybox ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: usb0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 5e:38:e9:7b:aa:6d brd ff:ff:ff:ff:ff:ff
3: tunl0: <NOARP> mtu 1480 qdisc noop state DOWN
link/ipip 0.0.0.0 brd 0.0.0.0
4: gre0: <NOARP> mtu 1476 qdisc noop state DOWN
link/gre 0.0.0.0 brd 0.0.0.0
30: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 5c:da:d4:09:fb:f3 brd ff:ff:ff:ff:ff:ff
inet 10.200.10.28/8 brd 10.255.255.255 scope global eth0
inet 10.200.10.28/24 brd 10.200.10.255 scope global eth0
inet6 2001:470:e130:98:5eda:d4ff:fe09:fbf3/64 scope global dynamic
valid_lft 2591705sec preferred_lft 604505sec
inet6 fe80::5eda:d4ff:fe09:fbf3/64 scope link
valid_lft forever preferred_lft forever
$
This causes me significant problems, as 10.200.10.0/24 is the wifi subnet, but 50 other 10.x.x.x subnets exist on the local network, and because it erroneously applies a /8 mask on the local interface I'm unable to reach anything on the 10.x.x.x networks outside of 10.200.10.x. (I have to manually go in and remove the first IP with the /8 subnet)
(Aside, as you might notice it correctly autoconfigured an ipv6 address, with 2001:470:e130::1/64 gateway running radvd - now if only apps like web browser understood ipv6...)
j

Reduce Wifi Tx power via wlan_cu (or other config)?

Hello,
I am looking to reduce the maximum transmit power of the wifi module from 100mW to 50 or 10mW. Unlike iOS (iPod Touch, iPhone, iPad) Android does not seem to reduce the Tx power of the wifi radio as needed. On Nokia devices you're able to set the maximum Tx level of the Wifi module / antenna from the "Show advanced" menu in your wlan configuration. After pressing yes to 'blah blah advanced blah blah blah. On Android it seems to be at a constant 100mW regardless of Rx decibels. Not only wasting more batter than ever, but also subjecting you to unneeded amounts of radiation.
Reading online some users have tweaked the wlan power saving mode using wlan_cu. Also another posting indicated options might be in tiwlan.conf (but this seems related to tethering only).
I couldn't find either wlan_cu or tiwlan.conf on my 2.2 android desire.
Code:
which wlan_cu
find / -name tiwlan.conf
find / -name wlan_cu
On my Android 2.1 tablet, you can reduce tx power on the command line using iwconfig.
iwconfig wlan0 txpower auto
Click to expand...
Click to collapse
At home I've found this reduces the power (according to iwconfig) from 16 dBm to 1 dBm. However, this setting is lost when wifi is disabled.
I haven't yet tested whether this results in a significant improvement to battery life, but if it does I'm planning to write an app to set it automatically whenever wifi is disabled.
StevePER said:
On my Android 2.1 tablet, you can reduce tx power on the command line using iwconfig.
At home I've found this reduces the power (according to iwconfig) from 16 dBm to 1 dBm. However, this setting is lost when wifi is disabled.
I haven't yet tested whether this results in a significant improvement to battery life, but if it does I'm planning to write an app to set it automatically whenever wifi is disabled.
Click to expand...
Click to collapse
Did it give any good results?

[Q] Hide tethering - IP Tables

Hey everyone,
I've been a lurker here for a while now but I had an idea that google and searches here couldn't give me a definite answer on.
I tether fairly often but don't use excessive amounts of data, but that could change quickly when they flip the switch on LTE in my area. From what I've read, AT&T uses the TTL of packets they receive to detect most instances of tethering. I have changed the TTL of my laptop to 65 so that after traffic hops through the phone, it will match the 64 TTL value of all the other traffic leaving my phone. I know that in linux it is possible to change the ip table settings so that every outgoing packet has a specified TTL value. From what I found out using google, access to ip table is in the android source but has to be added to the kernel. This is where everything goes over my head as I have no experience developing on android and limited experience with linux.
The big question is, would it be possible to enable this so that it would not be necessary to change the TTL value of tethered devices as all outgoing packets would leave the phone with the same TTL value?

[Q] Photon Q capable of 5GHz Wifi

Hi!
Is the Q capable of doing wifi over 5GHz ?
Accoriding to:
http://www.qualcomm.com/snapdragon/smartphones/motorola-photon-q
and
http://en.wikipedia.org/wiki/Snapdragon_(system_on_chip)#Snapdragon_S4
it should be capable of doiung so.
Is there a way to determine the exact cpu type build in? ... did a cat /proc/cpuinfo
-> Hardware is : msm8960dt
So the hardware is capable of 5Ghz Wifi. Maybe there are some antennas missing.
As far as I can tell, it isn't. When I run the INSSIDer application, it does not detect any 5 ghz channels, despite having 5 ghz channels in range.
Sucks! I have to buy a dual band router because the 2.4GHz spectrum is crowded in this apartment. I literally get a better signal from my upstairs neighbors router than i do my own.
Sent from my XT897 using Tapatalk 2
jae18708 said:
Sucks! I have to buy a dual band router because the 2.4GHz spectrum is crowded in this apartment. I literally get a better signal from my upstairs neighbors router than i do my own.
Sent from my XT897 using Tapatalk 2
Click to expand...
Click to collapse
Try changing the channel on your router.
As a matter of fact, you can use that same inssider application I mentioned to find what channels nearby wifi networks are running, and change the channel yours is operating on to avoid the interference.
Have you tried poking around in the build.prop to see if 5 GHz can be enabled? You may have to find one from an Android device that does have 5 GHz to get the proper line.
Found this @ /system/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini
Something about gEnableApProt states about n.
Hopefully someone is wiser and braver than me to know more about this file and changes which may enable 5ghz.
Code:
# This file allows user to override the factory
# defaults for the WLAN Driver
# Enable IMPS or not
gEnableImps=1
# Enable/Disable Idle Scan
gEnableIdleScan=0
# Increase sleep duration (seconds) during IMPS
# 0 implies no periodic wake up from IMPS. Periodic wakeup is
# unnecessary if Idle Scan is disabled.
gImpsModSleepTime=0
# Enable BMPS or not
gEnableBmps=1
gBmpsMinListenInterval=1
gBmpsModListenInterval=2
gBmpsMaxListenInterval=3
gPowerUsage=Max
#Telescopic Beacon skipping
gTelescopicBeaconWakeupEn=1
telescopicBeaconTransListenInterval=3
telescopicBeaconTransListenIntervalNumIdleBcns=1
telescopicBeaconMaxListenInterval=3
telescopicBeaconMaxListenIntervalNumIdleBcns=1
# Performance parameters
gEnableCloseLoop=1
gDataInactivityTimeout=120
gChannelBondingMode5GHz=1
# Enable suspend or not
# 1: Enable standby, 2: Enable Deep sleep, 3: Enable Mcast/Bcast Filter
gEnableSuspend=3
# Phy Mode (auto, b, g, n, etc)
gDot11Mode=0
# Handoff Enable(1) Disable(0)
gEnableHandoff=0
# CSR Roaming Enable(1) Disable(0)
gRoamingTime=0
# Assigned MAC Addresses - This will be used until NV items are in place
# Each byte of MAC address is represented in Hex format as XX
Intf0MacAddress=000AF58989FF
Intf1MacAddress=000AF58989FE
Intf2MacAddress=000AF58989FD
Intf3MacAddress=000AF58989FC
# UAPSD service interval for VO,VI, BE, BK traffic
UapsdMask=0
InfraUapsdVoSrvIntv=0
InfraUapsdViSrvIntv=0
InfraUapsdBeSrvIntv=0
InfraUapsdBkSrvIntv=0
# Disable RSSI FW filtering
gEnableFWRssiMonitoring=0
# Make 1x1 the default antenna configuration
gNumRxAnt=1
# Beacon filtering frequency (unit in beacon intervals)
gNthBeaconFilter=50
# Enable WAPI or not
# WAPIIsEnabled=0
# Flags to filter Mcast abd Bcast RX packets.
# Value 0: No filtering, 1: Filter all Multicast.
# 2: Filter all Broadcast. 3: Filter all Mcast abd Bcast
McastBcastFilter=0
#Flag to enable HostARPOffload feature or not
hostArpOffload=1
#SoftAP Related Parameters
# AP MAc addr
gAPMacAddr=000AF58989EF
# 802.11n Protection flag
gEnableApProt=1
#Enable OBSS protection
gEnableApOBSSProt=0
#Enable/Disable UAPSD for SoftAP
gEnableApUapsd=1
# Fixed Rate
gFixedRate=0
# Maximum Tx power
# gTxPowerCap=30
# Fragmentation Threshold
# gFragmentationThreshold=2346
# RTS threshold
RTSThreshold=2347
# Intra-BSS forward
gDisableIntraBssFwd=0
# WMM Enable/Disable
WmmIsEnabled=0
# 802.11d support
g11dSupportEnabled=1
# SAP Country code
# Default Country Code is 2 bytes, 3rd byte is optional indoor or out door.
# Example
# US Indoor, USI
# Korea Outdoor, KRO
# Japan without optional byte, JP
# France without optional byte, FR
#gAPCntryCode=USI
#Short Guard Interval Enable/disable
gShortGI20Mhz=1
gShortGI40Mhz=1
#Auto Shutdown Value in seconds. A value of 0 means Auto shutoff is disabled
gAPAutoShutOff=0
# SAP auto channel selection configuration
# 0 = disable auto channel selection
# 1 = enable auto channel selection, channel provided by supplicant will be ignored
gApAutoChannelSelection=0
# Listen Energy Detect Mode Configuration
# Valid values 0-128
# 128 means disable Energy Detect feature
# 0-9 are threshold code and 7 is recommended value from system if feature is to be enabled.
# 10-128 are reserved.
# The EDET threshold mapping is as follows in 3dB step:
# 0 = -60 dBm
# 1 = -63 dBm
# 2 = -66 dBm
# ...
# 7 = -81 dBm
# 8 = -84 dBm
# 9 = -87 dBm
# Note: Any of these settings are valid. Setting 0 would yield the highest power saving (in a noisy environment) at the cost of more range. The range impact is approximately #calculated as:
#
# Range Loss (dB) = EDET threshold level (dBm) + 97 dBm.
#
gEnablePhyAgcListenMode=128
#Preferred channel to start BT AMP AP mode (0 means, any channel)
BtAmpPreferredChannel=0
#Preferred band (both or 2.4 only or 5 only)
BandCapability=1
#Beacon Early Termination (1 = enable the BET feature, 0 = disable)
enableBeaconEarlyTermination=1
beaconEarlyTerminationWakeInterval=3
#Bluetooth Alternate Mac Phy (1 = enable the BT AMP feature, 0 = disable)
gEnableBtAmp=0
#SOFTAP Channel Range selection
gAPChannelSelectStartChannel=1
gAPChannelSelectEndChannel=11
#SOFTAP Channel Range selection Operating band
# 0:2.4GHZ 1: LOW-5GHZ 2:MID-5GHZ 3:HIGH-5GHZ 4: 4.9HZ BAND
gAPChannelSelectOperatingBand=0
#Enable Keep alive with non-zero period value
gStaKeepAlivePeriod=55
#If set will start with active scan after driver load, otherwise will start with
#passive scan to find out the domain
gEnableBypass11d=1
#If set to 0, will not scan DFS channels
gEnableDFSChnlScan=1
# Enable logp/SSR
gEnableLogp=1
# Enable Automatic Tx Power control
gEnableAutomaticTxPowerControl=1
# Priority Setting:COUNTRY IOCTL > 11d > NV default
gCountryCodePriority=1
END
# Note: Configuration parser would not read anything past the END marker
Sent from my awesome XT897
Found this :
http://www.modaco.com/topic/361678-5ghz-wifi/
Try it when i am home and in range of a 5ghz rooter.
Sent from my awesome XT897
A quick look through iwlist looks good so far
Code:
sh-4.2$ iwlist wlan0 frequency
wlan0 32 channels in total; available frequencies :
Channel 01 : 2.412 GHz
Channel 02 : 2.417 GHz
Channel 03 : 2.422 GHz
Channel 04 : 2.427 GHz
Channel 05 : 2.432 GHz
Channel 06 : 2.437 GHz
Channel 07 : 2.442 GHz
Channel 08 : 2.447 GHz
Channel 09 : 2.452 GHz
Channel 10 : 2.457 GHz
Channel 11 : 2.462 GHz
Channel 12 : 2.467 GHz
Channel 13 : 2.472 GHz
Channel 36 : 5.18 GHz
Channel 40 : 5.2 GHz
Channel 44 : 5.22 GHz
Channel 48 : 5.24 GHz
Channel 52 : 5.26 GHz
Channel 56 : 5.28 GHz
Channel 60 : 5.3 GHz
Channel 64 : 5.32 GHz
Channel 100 : 5.5 GHz
Channel 104 : 5.52 GHz
Channel 108 : 5.54 GHz
Channel 112 : 5.56 GHz
Channel 116 : 5.58 GHz
Channel 120 : 5.6 GHz
Channel 124 : 5.62 GHz
Channel 128 : 5.64 GHz
Channel 132 : 5.66 GHz
Channel 136 : 5.68 GHz
Channel 140 : 5.7 GHz
Current Channel:6
Sent from my awesome XT897
So back home but unable to see 5ghz wifi ;( don't know if i miss something to edit, or if the gui is "forcing" 2.4 ghz.
Maybe a more experienced user can hop in.
Finally answering and closing this thread.
I am now on scrillax gsm cm10.1 nightlies and able to connect to 5ghz networks.
Somehow the signalstrength is not properly shown, so it may use a stronger 2.4 Ghz channel if applicable. Forcing 5Ghz works just fine.
Gesendet von meinem XT897 mit Tapatalk 2
I wonder what is different in skrillax's ROM that enables 5GHz, and if it's something that can be applied to stock JB.
BAMF said:
I wonder what is different in skrillax's ROM that enables 5GHz, and if it's something that can be applied to stock JB.
Click to expand...
Click to collapse
Is this thread really dead?
I can't imagine that nobody is interested in getting 5GHz WiFi working...
probably it's just some regulatory settings, as there seem to be ROMS that are capable of 5GHz wifi.
Just tried CM11 nightly and CarbonROM, no luck with both.
Can't somebody experienced have a look at the configuration?
Killler07 said:
Is this thread really dead?
I can't imagine that nobody is interested in getting 5GHz WiFi working...
probably it's just some regulatory settings, as there seem to be ROMS that are capable of 5GHz wifi.
Just tried CM11 nightly and CarbonROM, no luck with both.
Can't somebody experienced have a look at the configuration?
Click to expand...
Click to collapse
See this thread:
http://forum.xda-developers.com/showthread.php?t=2671559

How to debug Wifi Calling?

Hi there,
I have a very strange behavior with one of my mobile phones.
Let me start by describing my setup a little bit.
I have 2 locations with 2 separate Wifis.
The first Wifi (Wifi1) is a WPA2-PEAP/MSCHAPv2 one. Here a Cisco 240AC is used as access point, a Linux firewall and a Cisco router for Dial-Up. ISP is Deutsche Telekom.
The firewall does not block any traffic to or from the mobile devices.
The second Wifi (Wifi2) is WPA2-PSK with a Fritzbox as access point and router and also Deutsche Telekom as ISP. So the ISP is the same for both locations.
I have 3 mobile phones available. Two times OnePlus and one Blackview BV9900 Pro.
All of them have a T-Mobile SIM.
The One Plus devices do Wifi Calling without any problems on Wifi1 (and probably Wifi2, but not tested).
For the Blackview device Wifi Calling is working on Wifi2.
Unfortunately the Blackview is not able to do any Wifi Calls on Wifi1.
I can see UDP-packets flowing from the Blackview phone to the T-Mobile-VoWifi-Server (109.237.187.131) with destination ports 500 and 4500 on tcpdump/wireshark.
The T-Mobile-Server is also responding with some packets. But the phone does not establish a Wifi call.
If it would be a problem with the Blackview mobile phone, I'd expect it won't work with any WIFI.
If it would be a problem with the Wifi itself, I'd expect it won't work with any device there.
Has anybody a hint how to debug that?
Thanks a lot.
Try
Code:
adb devices
adb shell "logcat -b radio | tee logcat.txt"
To stop logcat-ing press Ctrl-C
Thanks a lot @jwoegerbauer
Sorry for late reply, but I've spent the last days with comparing the logcats recorded in Wifi1 and Wifi2.
Unfortunately there are so many messages, that I get totally lost. And I could not find any error message.
Only these suspicious message appearing in Wifi1 only:
Code:
07-27 12:11:38.539 2399 2801 D RILJ : LCE capacity information received:{downlinkCapacityKbps=0, uplinkCapacityKbps=0, confidence=-1, status=-1 [SUB0]
07-27 12:11:38.539 2399 2801 D RILJ : [UNSL]< UNSOL_LCE_INFO_RECV {downlinkCapacityKbps=0, uplinkCapacityKbps=0, confidence=-1, status=-1 [SUB0]
07-27 12:12:12.377 2399 2801 D RILJ : LCE capacity information received:{downlinkCapacityKbps=25812, uplinkCapacityKbps=0, confidence=-1, status=-1 [SUB0]
07-27 12:12:12.377 2399 2801 D RILJ : [UNSL]< UNSOL_LCE_INFO_RECV {downlinkCapacityKbps=25812, uplinkCapacityKbps=0, confidence=-1, status=-1 [SUB0]
Those messages are missing in Wifi2 logcat completely.
So, I decided to change almost everything in Wifi1. I had a different Cisco access point model on spare and connected it directly to the router (with the help of a Cisco switch instead of Netgear switch).
Setup is now: (Blackview Mobile) -> (Cisco AP) -> (Cisco SW) -> (Cisco Router).
I changed also the encryption to WPA2-PSK (like in Wifi2, because I want to be sure there is no bug in Android) and also the Network mode from 802.11ac to 802.11n (also like in Wifi2).
I gave a static IP to the mobile phone via Android settings and set the DNS server to my ISP's manually.
You can say, I removed the firewall and changed everything except the router itself.
But still, Wifi Calling is not working.
After several month of investigation I found the issue.
I could not find the problem on logcat, but I used tcpdump and Wireshark to capture the traffic on my firewall.
The packets had a size of up to 1378 bytes and the "Don't fragment" bit set.
The link between firewall and router had an MTU of 1280 Bytes.
Therefore many packets got dropped at the firewall.
Increasing the MTU to 1500 Bytes solved the problem and Wifi Calling is working now.

Categories

Resources