aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-04-02 06:41:08 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-04-02 10:09:27 -0400
commite6214487492566b15ff24e97c6747bb2e5d9e040 (patch)
tree6c6a1538555999336070eedfa4648d7463ef3771 /include/net/bluetooth
parent444c6dd54d81edf81c606f571cb52eff4d47fa99 (diff)
Bluetooth: Add second hci_request callback option for full skb
This patch adds a second possible callback for HCI requests where the callback will receive the full skb of the last successfully completed HCI command. This API is useful for cases where we want to use a request to read some data and the existing hci_event.c handlers do not store it e.g. in the hci_dev struct. The reason the patch is a bit bigger than just adding the new API is because the hci_req_cmd_complete() functions required some refactoring to enable it: now hci_req_cmd_complete() is simply used to request the callback pointers if any, and the actual calling of them happens from a single place at the end of hci_event_packet(). The reason for this is that we need to pass the original skb (without any skb_pull, etc modifications done to it) and it's simplest to keep track of it within the hci_event_packet() function. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net/bluetooth')
-rw-r--r--include/net/bluetooth/bluetooth.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index eeaff4b5cb62..7dba80546f16 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -277,11 +277,14 @@ struct l2cap_ctrl {
277struct hci_dev; 277struct hci_dev;
278 278
279typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status, u16 opcode); 279typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status, u16 opcode);
280typedef void (*hci_req_complete_skb_t)(struct hci_dev *hdev, u8 status,
281 u16 opcode, struct sk_buff *skb);
280 282
281struct req_ctrl { 283struct req_ctrl {
282 bool start; 284 bool start;
283 u8 event; 285 u8 event;
284 hci_req_complete_t complete; 286 hci_req_complete_t complete;
287 hci_req_complete_skb_t complete_skb;
285}; 288};
286 289
287struct bt_skb_cb { 290struct bt_skb_cb {