Originally Posted by aorth
Yo, psyke. "fixed" as in it was broken and now is fixed? Or "fixed" as in static? I'm curious because I saw some patches on another device which got the hardware MAC address for the wifi interface. Can't remember where, though. It'd be nice to use the hardware's real MAC address...
Continuing what I said previously: the MAC addresses are based on the serial number defined in /sys/module/g_android/parameters/serial_number. The wifi device uses the serial with the last group of hex values incremented by one, and the Bluetooth incremented by two.
The script is quite messy and may fail under certain conditions (e.g. if the base serial number's last group of hex digits are > x0FD). It could use some improvement, but it works for now.
For the wifi mac address, the init script does a sed expression filter on the static mac address in /system/wifi/nvram.txt, writing the real mac address in /data/misc/wifi/nvram.txt. This works when libhardware_legacy's WIFI_DRIVER_MODULE_ARG is configured to use the latter file.
For Bluetooth, the script writes the mac address to /data/misc/bluetooth/bdaddr, and "setprop ro.bt.bdaddr_path /data/misc/bluetooth/bdaddr" is added to the init.u81x0.rc file.
This is the part that affects your U8150: the ro.bt.bdaddr_path prop is parsed only by brcm_patchram_plus, which you don't use. You should switch over to using it, if possible.
I was previously using Huawei's brcm_patchram_plus proprietary binary due to a problem with CM7's version, but it stopped working once the above property was set (some weird error related to oncrpc...).
I did some troubleshooting and discovered that CM7's brcm_patchram_plus isn't fully compatible with my U8160 when using the "--enable_lpm" (low power mode) option; the HCI device completely stops responding properly after it's used.
I checked the Huawei brcm_patchram_plus binary via a hex editor and found that some of the hci values for lpm are different compared to the CM7 source. I edited the source and rebuilt the binary, placing it in the device tree as a prebuilt binary.
For your device, I recommend you remove your original hciattach service, and replace with this:
service hciattach /system/bin/brcm_patchram_plus \
--enable_hci --enable_lpm --baudrate 3000000 \
group qcom_oncrpc bluetooth net_bt_admin system
If it doesn't work (or Bluetooth can only initialize on first boot, and fails afterwards), then either remove "--enable_lpm", or try my prebuilt binary instead of the stock CM7 one.
Also, does the CRT Off animation work on your device? Ours stopped working a few months ago and I never had time to figure out why. I see in frameworks/base/core/res/res/values/config.xml it's enabled by default in CM's framework, so it must be something in our U8150 device tree.
What you need is:
<!-- Use the new fancy screen off animation.
Turn off to use new Gingerbread animation -->