summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2003-09-07 21:40:13 +0000
committerMarcel Holtmann <marcel@holtmann.org>2003-09-07 21:40:13 +0000
commit68e6756b899d040b14062baaa1ae9ae0e14f3b02 (patch)
tree8cca940ac3c4edc538946b969754817a70da9bfa /tools
parent4e2dd78121a7c16836a1e28b6f545e4dd9c2d596 (diff)
Correct decoding class of device
Diffstat (limited to 'tools')
-rw-r--r--tools/hciconfig.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index c1df2815..c241b7d5 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -516,11 +516,11 @@ void cmd_class(int ctl, int hdev, char *opt)
} else
printf("Unspecified");
printf("\n\tDevice Class: ");
- if (cls[1] > sizeof(major_devices))
+ if ((cls[1] & 0x1f) > sizeof(major_devices))
printf("Invalid Device Class!\n");
else
- printf("%s, %s\n", major_devices[cls[1]],
- get_minor_device_name(cls[1], cls[0] / 4));
+ printf("%s, %s\n", major_devices[cls[1] & 0x1f],
+ get_minor_device_name(cls[1] & 0x1f, cls[0] >> 2));
}
}