Skip to content

Commit a9de924

Browse files
holtmannDavid S. Miller
authored andcommitted
[Bluetooth] Switch from OGF+OCF to using only opcodes
The Bluetooth HCI commands are divided into logical OGF groups for easier identification of their purposes. While this still makes sense for the written specification, its makes the code only more complex and harder to read. So instead of using separate OGF and OCF values to identify the commands, use a common 16-bit opcode that combines both values. As a side effect this also reduces the complexity of OGF and OCF calculations during command header parsing. Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 55b70a0 commit a9de924

File tree

8 files changed

+1318
-1035
lines changed

8 files changed

+1318
-1035
lines changed

drivers/bluetooth/hci_bcsp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data,
237237
if (hciextn && chan == 5) {
238238
struct hci_command_hdr *hdr = (struct hci_command_hdr *) data;
239239

240-
if (hci_opcode_ogf(__le16_to_cpu(hdr->opcode)) == OGF_VENDOR_CMD) {
240+
/* Vendor specific commands */
241+
if (hci_opcode_ogf(__le16_to_cpu(hdr->opcode)) == 0x3f) {
241242
u8 desc = *(data + HCI_COMMAND_HDR_SIZE);
242243
if ((desc & 0xf0) == 0xc0) {
243244
data += HCI_COMMAND_HDR_SIZE + 1;

0 commit comments

Comments
 (0)