Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/arm/mach-msm/board-htcleo-wifi-nvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static int parse_tag_msm_wifi(void)
sid1 = crc32(~0, &id1, 4);
sid2 = crc32(~0, &id2, 4);
sid3 = crc32(~0, &id3, 4);
sprintf(nvs_mac_addr, "macaddr=00:90:4c:%2x:%2x:%2x\n", sid1 % 0xff, sid2 % 0xff, sid3 % 0xff);
sprintf(nvs_mac_addr, "macaddr=00:23:76:%2x:%2x:%2x\n", sid1 % 0xff, sid2 % 0xff, sid3 % 0xff);
pr_info("Device Wifi Mac Address: %s\n", nvs_mac_addr);
return 0;
}
Expand Down
28 changes: 14 additions & 14 deletions arch/arm/mach-msm/board-htcleo.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*
*/

#include <linux/crc32.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
Expand Down Expand Up @@ -900,30 +901,27 @@ struct platform_device bcm_bt_lpm_device = {
};


#define ATAG_BDADDR 0x43294329 /* htcleo bluetooth address tag */
#define ATAG_BDADDR_SIZE 4
#define BDADDR_STR_SIZE 18

static char bdaddr[BDADDR_STR_SIZE];

module_param_string(bdaddr, bdaddr, sizeof(bdaddr), 0400);
MODULE_PARM_DESC(bdaddr, "bluetooth address");

static int __init parse_tag_bdaddr(const struct tag *tag)
static int parse_tag_bdaddr(void)
{
unsigned char *b = (unsigned char *)&tag->u;

if (tag->hdr.size != ATAG_BDADDR_SIZE)
return -EINVAL;

snprintf(bdaddr, BDADDR_STR_SIZE, "%02X:%02X:%02X:%02X:%02X:%02X",
b[0], b[1], b[2], b[3], b[4], b[5]);

uint32_t id1, id2, id3, sid1, sid2, sid3;
uint32_t id_base = 0xef260;
id1 = readl(MSM_SHARED_RAM_BASE + id_base + 0x0);
id2 = readl(MSM_SHARED_RAM_BASE + id_base + 0x4);
id3 = readl(MSM_SHARED_RAM_BASE + id_base + 0x8);
sid1 = crc32(~0, &id1, 4);
sid2 = crc32(~0, &id2, 4);
sid3 = crc32(~0, &id3, 4);
sprintf(bdaddr, "00:23:76:%2X:%2X:%2X", sid3 % 0xff, sid2 % 0xff, sid1 % 0xff);
pr_info("Device Bluetooth Mac Address: %s\n", bdaddr);
return 0;
}

__tagtable(ATAG_BDADDR, parse_tag_bdaddr);

static int __init board_serialno_setup(char *serialno)
{
#ifdef CONFIG_USB_ANDROID_RNDIS
Expand Down Expand Up @@ -1490,6 +1488,8 @@ static void __init htcleo_init(void)

config_gpio_table(bt_gpio_table, ARRAY_SIZE(bt_gpio_table));

parse_tag_bdaddr();

bt_export_bd_address();

htcleo_audio_init();
Expand Down