Skip to content

Commit

Permalink
Bluetooth: Provide HCI command opcode information to driver
Browse files Browse the repository at this point in the history
The Bluetooth core already does processing of the HCI command header
and puts it together before sending it to the driver. It is not really
efficient for the driver to look at the HCI command header again in
case it has to make certain decisions about certain commands. To make
this easier, just provide the opcode as part of the SKB control buffer
information. The extra information about the opcode is optional and
only provided for HCI commands.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  • Loading branch information
Marcel Holtmann authored and Johan Hedberg committed Sep 15, 2014
1 parent 7cb9d20 commit 43e73e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/net/bluetooth/bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ struct hci_req_ctrl {
struct bt_skb_cb {
__u8 pkt_type;
__u8 incoming;
__u16 opcode;
__u16 expect;
__u8 force_active;
struct l2cap_chan *chan;
Expand Down
1 change: 1 addition & 0 deletions net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4547,6 +4547,7 @@ static struct sk_buff *hci_prepare_cmd(struct hci_dev *hdev, u16 opcode,
BT_DBG("skb len %d", skb->len);

bt_cb(skb)->pkt_type = HCI_COMMAND_PKT;
bt_cb(skb)->opcode = opcode;

return skb;
}
Expand Down

0 comments on commit 43e73e4

Please sign in to comment.