HTC Incredible with 802.11n

From magicandroidapps.com Wiki

Jump to: navigation, search

Contents

Introduction

Now that the HTC Incredible has been rooted, and the kernel source released by HTC, it is possible to make changes to the BCM4329 WiFi driver to support 802.11n. The modification is trivial, but getting the new driver installed on the phone is a bit more challenging since the HTC Incredible NAND FLASH is locked (ie, you can't write to /system/ unless you are in Recovery Mode.) Hopefully this limitation will be removed soon.

In this writeup, I will illustrate how to modify and compile the driver, and how to copy it onto your phone. Obviously, this is for seasoned Android devs, and not for the casual user. Since your phone needs to be rooted before doing this procedure, you will have to void your phone's warranty, but since you are a dev, you have probably done this already... PROCEED AT YOUR OWN RISK!

Prerequisites

  • Linux machine with Android Source Code and tools installed. You primarily need to GCC 4.4.0 compiler that is included in the Android source distribution. This is required to build the Android kernel. This tutorial assumes your Android source is in ~/mydroid.
  • Rooted HTC Incredible currently running in recovery mode as illustrated on UnrEVOked Root Wiki.

Conventions

  • linux$ means a command that is executed on your Linux machine.
  • $ non-root Android command line prompt from adb shell
  • # root Android command line prompt from adb shell

HTC Incredible Kernel

Download the HTC Incredible Linux Kernel Source from the HTC Developer Site or

wget http://member.america.htc.com/download/RomCode/Source_and_Binaries/incrediblec_cc1c2268.tar.bz2

un-bzip2 and untar the kernel. Assuming you extracted the source to ~/Incredible_Kernel:

cd ~/Incredible_Kernel/incrediblec_cc1c2268/

Modify and build WIFI Driver

Modify drivers/net/wireless/bcm4329/dhd_cdc.c

In the function dhd_preinit_ioctls(), change the value of nmode to 1:

uint32 nmode = 1;

Then configure the Linux Kernel for the Incredible:

linux$ make ARCH=arm CROSS_COMPILE=~/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- incrediblec_defconfig
#
# configuration written to .config
#

Now, build the kernel and modules. Note that EXTRAVERSION should be set to whatever your running kernel is using. For the standard HTC Incredible image, the following should work:

linux$ make EXTRAVERSION=-cc1c2268 ARCH=arm CROSS_COMPILE=~/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- zImage modules

Install Driver to Phone

After the kernel and modules are built, push the driver to the sdcard on your phone (must be in recovery mode at the "Post Hack Tasks" portion of the UnrEVOked Root Wiki).

linux$ adb push drivers/net/wireless/bcm4329/bcm4329.ko /sdcard/bcm4329.ko-11n
1889 KB/s (216708 bytes in 0.112s)

Now, shell into the phone, backup your original driver, and update with the new one:

linux$ adb shell
$ su
# cd /system/lib/modules
# /system/bin/cat bcm4329.ko > bcm4329.ko-orig
# /system/bin/cat /sdcard/bcm4329.ko-11n > bcm4329.ko
# /system/bin/ls -l
-rw-r--r-- root     root       217116 2010-04-06 13:42 bcm4329.ko-orig
-rw-rw-rw- root     shell      216716 2010-06-19 01:39 bcm4329.ko
# /system/bin/sync
# exit
$ exit
linux$

Finally, reboot your phone using the recovery menu.

You should now be able to connect to an 802.11n access point. File:Incredible_11n.png

Frequently Asked Questions

Q: Why use 802.11n?
A: 802.11n has improved range and throughput vs 802.11b/g.

Q: Is 802.11n "MIMO?"
A: It can be, but phones typically support only the SISO mode of 802.11n. MIMO has higher current requirements as well as the need for multiple antennas. Most phones only have a single WIFI antenna, and battery and thermal constraints that make MIMO impractical.

Q: What is SISO?
A: SISO is "Single Stream 802.11n" also known as 1x1.

Q: If my phone doesn't support MIMO, why bother with 802.11n?
A: You can still get better throughput using SISO 802.11n than regular 11g. Single-stream 11n also allows your access point to be in "N-only mode." For 802.11g, the maximum link speed is 54Mbit/S, while for SISO 802.11n, you will often see 65- or 72Mbit/S.

Q: Is my phone "dual band" or does it support the 5GHz band?
A: Probably not. 5GHz support is not only a function of the WIFI chip, but also a function of software and other hardware components on the phone, including, but not limited to, the antenna.

Q: How do I measure the WiFi performance of my Android device?
A: Use iPerf for Android.

Personal tools