summaryrefslogtreecommitdiffstats
path: root/tools/bccmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bccmd.c')
-rw-r--r--tools/bccmd.c42
1 files changed, 30 insertions, 12 deletions
diff --git a/tools/bccmd.c b/tools/bccmd.c
index f39686eb..3bdf702a 100644
--- a/tools/bccmd.c
+++ b/tools/bccmd.c
@@ -66,24 +66,16 @@ static inline int transport_open(int transport, char *device)
return csr_open_hci(device);
case CSR_TRANSPORT_USB:
return csr_open_usb(device);
+ case CSR_TRANSPORT_BCSP:
+ return csr_open_bcsp(device);
+ case CSR_TRANSPORT_H4:
+ return csr_open_h4(device);
default:
fprintf(stderr, "Unsupported transport\n");
return -1;
}
}
-static inline void transport_close(int transport)
-{
- switch (transport) {
- case CSR_TRANSPORT_HCI:
- csr_close_hci();
- break;
- case CSR_TRANSPORT_USB:
- csr_close_usb();
- break;
- }
-}
-
static inline int transport_read(int transport, uint16_t varid, uint8_t *value, uint16_t length)
{
switch (transport) {
@@ -91,6 +83,10 @@ static inline int transport_read(int transport, uint16_t varid, uint8_t *value,
return csr_read_hci(varid, value, length);
case CSR_TRANSPORT_USB:
return csr_read_usb(varid, value, length);
+ case CSR_TRANSPORT_BCSP:
+ return csr_read_bcsp(varid, value, length);
+ case CSR_TRANSPORT_H4:
+ return csr_read_h4(varid, value, length);
default:
errno = EOPNOTSUPP;
return -1;
@@ -104,12 +100,34 @@ static inline int transport_write(int transport, uint16_t varid, uint8_t *value,
return csr_write_hci(varid, value, length);
case CSR_TRANSPORT_USB:
return csr_write_usb(varid, value, length);
+ case CSR_TRANSPORT_BCSP:
+ return csr_write_bcsp(varid, value, length);
+ case CSR_TRANSPORT_H4:
+ return csr_write_h4(varid, value, length);
default:
errno = EOPNOTSUPP;
return -1;
}
}
+static inline void transport_close(int transport)
+{
+ switch (transport) {
+ case CSR_TRANSPORT_HCI:
+ csr_close_hci();
+ break;
+ case CSR_TRANSPORT_USB:
+ csr_close_usb();
+ break;
+ case CSR_TRANSPORT_BCSP:
+ csr_close_bcsp();
+ break;
+ case CSR_TRANSPORT_H4:
+ csr_close_h4();
+ break;
+ }
+}
+
static struct {
uint16_t pskey;
int type;