summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-06-14 11:03:30 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-06-14 11:03:30 +0000
commit0e9c5be0acf66ffaa851b85a4c0525de09b28fcc (patch)
tree6280e46519e6420c646834bb5d0d1b6fcc2e8e89 /test
parentcb778770890a9c3e69179488f5b21becc5973e59 (diff)
Add support for changing Broadcom device addresses
Diffstat (limited to 'test')
-rw-r--r--test/bdaddr.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/bdaddr.c b/test/bdaddr.c
index a48c85b1..e317c8ad 100644
--- a/test/bdaddr.c
+++ b/test/bdaddr.c
@@ -210,6 +210,34 @@ static int ti_write_bd_addr(int dd, bdaddr_t *bdaddr)
return 0;
}
+#define OCF_BCM_WRITE_BD_ADDR 0x0001
+typedef struct {
+ bdaddr_t bdaddr;
+} __attribute__ ((packed)) bcm_write_bd_addr_cp;
+#define BCM_WRITE_BD_ADDR_CP_SIZE 6
+
+static int bcm_write_bd_addr(int dd, bdaddr_t *bdaddr)
+{
+ struct hci_request rq;
+ bcm_write_bd_addr_cp cp;
+
+ memset(&cp, 0, sizeof(cp));
+ bacpy(&cp.bdaddr, bdaddr);
+
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = OGF_VENDOR_CMD;
+ rq.ocf = OCF_BCM_WRITE_BD_ADDR;
+ rq.cparam = &cp;
+ rq.clen = BCM_WRITE_BD_ADDR_CP_SIZE;
+ rq.rparam = NULL;
+ rq.rlen = 0;
+
+ if (hci_send_req(dd, &rq, 1000) < 0)
+ return -1;
+
+ return 0;
+}
+
#define OCF_ZEEVO_WRITE_BD_ADDR 0x0001
typedef struct {
bdaddr_t bdaddr;
@@ -263,6 +291,7 @@ static struct {
{ 0, ericsson_write_bd_addr, NULL },
{ 10, csr_write_bd_addr, csr_reset_device },
{ 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 },
{ 65535, NULL, NULL },