Skip to content

Commit

Permalink
Bluetooth: Store supported commands only during setup procedure
Browse files Browse the repository at this point in the history
The list of supported commands of a controller can not change during
its lifetime. So store the list just once during the setup procedure
and not every time the HCI command is executed.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  • Loading branch information
Marcel Holtmann authored and Gustavo Padovan committed Dec 4, 2013
1 parent d3d5dd3 commit 6a070e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,10 @@ static void hci_cc_read_local_commands(struct hci_dev *hdev,

BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);

if (!rp->status)
if (rp->status)
return;

if (test_bit(HCI_SETUP, &hdev->dev_flags))
memcpy(hdev->commands, rp->commands, sizeof(hdev->commands));
}

Expand Down

0 comments on commit 6a070e6

Please sign in to comment.