summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-03-17 19:03:58 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-03-17 19:03:58 +0000
commitac2daf48298cb601d1a57b0e00e38887b5e0a675 (patch)
treea5067eb247a7a56e91f7013c93463f57d1fc9f6f
parentcfb680f0660169fe231c575cb2a0c7f72826f4f4 (diff)
Add support for reading CSR panic and fault codes
-rw-r--r--tools/csr.h3
-rw-r--r--tools/hciconfig.c12
2 files changed, 14 insertions, 1 deletions
diff --git a/tools/csr.h b/tools/csr.h
index b96dd0f7..f29fc764 100644
--- a/tools/csr.h
+++ b/tools/csr.h
@@ -31,6 +31,9 @@
#define CSR_VARID_CHIPREV 0x281b
#define CSR_VARID_MAX_CRYPT_KEY_LENGTH 0x282c
+#define CSR_VARID_PANIC_ARG 0x6805
+#define CSR_VARID_FAULT_ARG 0x6806
+
#define CSR_PSKEY_HOSTIO_MAP_SCO_PCM 0x01ab
char *csr_buildidtostr(uint16_t id);
diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index d8c40e8f..defe59c9 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -974,7 +974,7 @@ static void print_rev_ericsson(int dd)
static void print_rev_csr(int dd, uint16_t rev)
{
- uint16_t buildid, chipver, chiprev, maxkeylen, mapsco;
+ uint16_t buildid, chipver, chiprev, maxkeylen, mapsco, error;
if (csr_read_varid_uint16(dd, 0, CSR_VARID_BUILDID, &buildid) < 0) {
printf("\t%s\n", csr_buildidtostr(rev));
@@ -994,6 +994,16 @@ static void print_rev_csr(int dd, uint16_t rev)
if (!csr_read_pskey_uint16(dd, 4, CSR_PSKEY_HOSTIO_MAP_SCO_PCM, &mapsco))
printf("\tSCO mapping: %s\n", mapsco ? "PCM" : "HCI");
+
+ if (!csr_read_varid_uint16(dd, 5, CSR_VARID_PANIC_ARG, &error)) {
+ if (error < 0x0100)
+ printf("\tPanic code: 0x%02x\n", error);
+ }
+
+ if (!csr_read_varid_uint16(dd, 6, CSR_VARID_FAULT_ARG, &error)) {
+ if (error < 0x0100)
+ printf("\tFault code: 0x%02x\n", error);
+ }
}
static void print_rev_digianswer(int dd)