]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Bluetooth: Provide HCI command opcode information to driver
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 14 Sep 2014 21:06:28 +0000 (23:06 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 15 Sep 2014 04:15:45 +0000 (07:15 +0300)
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>
include/net/bluetooth/bluetooth.h
net/bluetooth/hci_core.c

index 373000de610d4d3077f289a2f7a1967910ef09e3..7e666d06b97ff3a4c311f8f69dbb60b95bacd2ec 100644 (file)
@@ -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;
index 067526d9680de91bfd5921fa539b0fc287f14af1..41948678f5145e707d21aa6016483034aee16582 100644 (file)
@@ -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;
 }