Skip to contentSkip to conversation

Bluetooth: Add opcode parameter to hci_req_complete_t callback

RFC New Marcel Holtmann 1 participant 1 message Jan 11, 2015

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

RFC 1/1 Bluetooth: Add opcode parameter to hci_req_complete_t callback

---
 include/net/bluetooth/bluetooth.h |  2 +-
 net/bluetooth/hci_conn.c          |  2 +-
 net/bluetooth/hci_core.c          |  9 ++++----
 net/bluetooth/hci_request.c       |  3 ++-
 net/bluetooth/mgmt.c              | 44 ++++++++++++++++++++++-----------------
 5 files changed, 34 insertions(+), 26 deletions(-)
include/net/bluetooth/bluetooth.h +1 -1
index 58695ffeb138..e00455aab18c 100644
@@ -273,7 +273,7 @@ struct l2cap_ctrl {
 
 struct hci_dev;
 
-typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status);
+typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status, u16 opcode);
 
 struct hci_req_ctrl {
 	bool			start;
net/bluetooth/hci_conn.c +1 -1
index 75240aaca101..2e724e0b75b9 100644
@@ -633,7 +633,7 @@ void hci_le_conn_failed(struct hci_conn *conn, u8 status)
 	mgmt_reenable_advertising(hdev);
 }
 
-static void create_le_conn_complete(struct hci_dev *hdev, u8 status)
+static void create_le_conn_complete(struct hci_dev *hdev, u8 status, u16 opcode)
 {
 	struct hci_conn *conn;
 
net/bluetooth/hci_core.c +5 -4
index bc5486ea5411..012dae059dc7 100644
@@ -141,7 +141,7 @@ static const struct file_operations dut_mode_fops = {
 
 /* ---- HCI requests ---- */
 
-static void hci_req_sync_complete(struct hci_dev *hdev, u8 result)
+static void hci_req_sync_complete(struct hci_dev *hdev, u8 result, u16 opcode)
 {
 	BT_DBG("%s result 0x%2.2x", hdev->name, result);
 
@@ -2754,7 +2754,7 @@ void hci_conn_params_clear_all(struct hci_dev *hdev)
 	BT_DBG("All LE connection parameters were removed");
 }
 
-static void inquiry_complete(struct hci_dev *hdev, u8 status)
+static void inquiry_complete(struct hci_dev *hdev, u8 status, u16 opcode)
 {
 	if (status) {
 		BT_ERR("Failed to start inquiry: status %d", status);
@@ -2766,7 +2766,8 @@ static void inquiry_complete(struct hci_dev *hdev, u8 status)
 	}
 }
 
-static void le_scan_disable_work_complete(struct hci_dev *hdev, u8 status)
+static void le_scan_disable_work_complete(struct hci_dev *hdev, u8 status,
+					  u16 opcode)
 {
 	/* General inquiry access code (GIAC) */
 	u8 lap[3] = { 0x33, 0x8b, 0x9e };
@@ -4159,7 +4160,7 @@ void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status)
 
 call_complete:
 	if (req_complete)
-		req_complete(hdev, status);
+		req_complete(hdev, status, HCI_OP_NOP);
 }
 
 static void hci_rx_work(struct work_struct *work)
net/bluetooth/hci_request.c +2 -1
index 324c6418b17c..b59f92c6df0c 100644
@@ -533,7 +533,8 @@ void __hci_update_background_scan(struct hci_request *req)
 	}
 }
 
-static void update_background_scan_complete(struct hci_dev *hdev, u8 status)
+static void update_background_scan_complete(struct hci_dev *hdev, u8 status,
+					    u16 opcode)
 {
 	if (status)
 		BT_DBG("HCI request failed to update background scanning: "
net/bluetooth/mgmt.c +25 -19

158 lines not on this page · raw message

Signature · 1 line
2.1.0