summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-06-29 07:03:50 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-06-29 07:03:50 +0000
commitc2a3b84e7e6b6e90d5806897ad6c5c088480673a (patch)
tree2282bba81b964956d83b7afd71017af1e0357e36
parent943b02e163e169795a010c36a3b3343cc5092a96 (diff)
Add support for changing the BD_ADDR of ISSC chips
-rw-r--r--test/bdaddr.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/test/bdaddr.c b/test/bdaddr.c
index e317c8ad..91ce5791 100644
--- a/test/bdaddr.c
+++ b/test/bdaddr.c
@@ -40,6 +40,18 @@
static int transient = 0;
+static int generic_reset_device(int dd)
+{
+ bdaddr_t bdaddr;
+ int err;
+
+ err = hci_send_cmd(dd, 0x03, 0x0003, 0, NULL);
+ if (err < 0)
+ return err;
+
+ return hci_read_bd_addr(dd, &bdaddr, 10000);
+}
+
#define OCF_ERICSSON_WRITE_BD_ADDR 0x000d
typedef struct {
bdaddr_t bdaddr;
@@ -271,18 +283,6 @@ static int st_write_bd_addr(int dd, bdaddr_t *bdaddr)
return ericsson_store_in_flash(dd, 0xfe, 6, (uint8_t *) bdaddr);
}
-static int st_reset_device(int dd)
-{
- bdaddr_t bdaddr;
- int err;
-
- err = hci_send_cmd(dd, 0x03, 0x0003, 0, NULL);
- if (err < 0)
- return err;
-
- return hci_read_bd_addr(dd, &bdaddr, 10000);
-}
-
static struct {
uint16_t compid;
int (*write_bd_addr)(int dd, bdaddr_t *bdaddr);
@@ -293,7 +293,8 @@ static struct {
{ 13, ti_write_bd_addr, NULL, },
{ 15, bcm_write_bd_addr, NULL, },
{ 18, zeevo_write_bd_addr, NULL },
- { 48, st_write_bd_addr, st_reset_device },
+ { 48, st_write_bd_addr, generic_reset_device },
+ { 57, ericsson_write_bd_addr, generic_reset_device },
{ 65535, NULL, NULL },
};