summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
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));
}
}