All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC v2] Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection
@ 2024-05-09 22:50 Luiz Augusto von Dentz
  2024-05-09 23:27 ` [RFC,v2] " bluez.test.bot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2024-05-09 22:50 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This makes MGMT_OP_LOAD_CONN_PARAM update existing connection by
dectecting the request is just for one connection, parameters already
exists and there is a connection.

Since this is a new behavior the revision is also updated to enable
userspace to detect it.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/hci_sync.c | 18 +++++++++++++++
 net/bluetooth/mgmt.c     | 47 ++++++++++++++++++++++++++++++++++++++--
 2 files changed, 63 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 891cae8a30da..9f8ef175c251 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -6712,3 +6712,21 @@ int hci_cancel_connect_sync(struct hci_dev *hdev, struct hci_conn *conn)
 
 	return -ENOENT;
 }
+
+int hci_le_conn_update_sync(struct hci_dev *hdev, struct hci_conn *conn,
+			    struct hci_conn_params *params)
+{
+	struct hci_cp_le_conn_update cp;
+
+	memset(&cp, 0, sizeof(cp));
+	cp.handle		= cpu_to_le16(conn->handle);
+	cp.conn_interval_min	= cpu_to_le16(params->conn_min_interval);
+	cp.conn_interval_max	= cpu_to_le16(params->conn_max_interval);
+	cp.conn_latency		= cpu_to_le16(params->conn_latency);
+	cp.supervision_timeout	= cpu_to_le16(params->supervision_timeout);
+	cp.min_ce_len		= cpu_to_le16(0x0000);
+	cp.max_ce_len		= cpu_to_le16(0x0000);
+
+	return __hci_cmd_sync_status(hdev, HCI_OP_LE_CONN_UPDATE,
+				     sizeof(cp), &cp, HCI_CMD_TIMEOUT);
+}
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 64e66d911c74..7e81eaddba85 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -42,7 +42,7 @@
 #include "aosp.h"
 
 #define MGMT_VERSION	1
-#define MGMT_REVISION	22
+#define MGMT_REVISION	23
 
 static const u16 mgmt_commands[] = {
 	MGMT_OP_READ_INDEX_LIST,
@@ -7874,6 +7874,18 @@ static int remove_device(struct sock *sk, struct hci_dev *hdev,
 	return err;
 }
 
+static int conn_update_sync(struct hci_dev *hdev, void *data)
+{
+	struct hci_conn_params *params = data;
+
+	conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
+				       params->addr_type);
+	if (!conn)
+		return -ECANCELED
+
+	return hci_le_conn_update_sync(hdev, conn, params);
+}
+
 static int load_conn_param(struct sock *sk, struct hci_dev *hdev, void *data,
 			   u16 len)
 {
@@ -7907,13 +7919,15 @@ static int load_conn_param(struct sock *sk, struct hci_dev *hdev, void *data,
 
 	hci_dev_lock(hdev);
 
-	hci_conn_params_clear_disabled(hdev);
+	if (i > 1)
+		hci_conn_params_clear_disabled(hdev);
 
 	for (i = 0; i < param_count; i++) {
 		struct mgmt_conn_param *param = &cp->params[i];
 		struct hci_conn_params *hci_param;
 		u16 min, max, latency, timeout;
 		u8 addr_type;
+		bool update;
 
 		bt_dev_dbg(hdev, "Adding %pMR (type %u)", &param->addr.bdaddr,
 			   param->addr.type);
@@ -7940,6 +7954,19 @@ static int load_conn_param(struct sock *sk, struct hci_dev *hdev, void *data,
 			continue;
 		}
 
+		/* Detect when the loading is for an existing parameter then
+		 * attempt to trigger the connection update procedure.
+		 */
+		if (!i && params == 1) {
+			hci_param = hci_conn_params_lookup(hdev,
+							   &param->addr.bdaddr,
+							   addr_type);
+			if (hci_param)
+				update = true;
+			else
+				hci_conn_params_clear_disabled(hdev);
+		}
+
 		hci_param = hci_conn_params_add(hdev, &param->addr.bdaddr,
 						addr_type);
 		if (!hci_param) {
@@ -7951,6 +7978,22 @@ static int load_conn_param(struct sock *sk, struct hci_dev *hdev, void *data,
 		hci_param->conn_max_interval = max;
 		hci_param->conn_latency = latency;
 		hci_param->supervision_timeout = timeout;
+
+		if (update) {
+			struct hci_conn *conn;
+
+			conn = hci_conn_hash_lookup_le(hdev,
+						       params->addr.bdaddr,
+						       addr_type);
+			if (conn && conn->role == HCI_ROLE_MASTER &&
+			    (conn->le_conn_min_interval != min ||
+			     conn->le_conn_max_interval != max ||
+			     conn->le_conn_latency != latency ||
+			     conn->le_supervision_timeout != timeout))
+				hci_cmd_sync_queue(hdev, conn_update_sync,
+						   hci_params, NULL);
+			}
+		}
 	}
 
 	hci_dev_unlock(hdev);
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [RFC,v2] Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection
  2024-05-09 22:50 [RFC v2] Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection Luiz Augusto von Dentz
@ 2024-05-09 23:27 ` bluez.test.bot
  2024-05-10  9:51 ` [RFC v2] " kernel test robot
  2024-05-10 10:02 ` kernel test robot
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2024-05-09 23:27 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 25866 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=852061

---Test result---

Test Summary:
CheckPatch                    PASS      0.84 seconds
GitLint                       FAIL      0.64 seconds
SubjectPrefix                 PASS      0.10 seconds
BuildKernel                   FAIL      22.90 seconds
CheckAllWarning               FAIL      25.27 seconds
CheckSparse                   FAIL      28.35 seconds
CheckSmatch                   FAIL      35.93 seconds
BuildKernel32                 FAIL      21.68 seconds
TestRunnerSetup               FAIL      492.86 seconds
TestRunner_l2cap-tester       FAIL      0.12 seconds
TestRunner_iso-tester         FAIL      0.12 seconds
TestRunner_bnep-tester        FAIL      0.12 seconds
TestRunner_mgmt-tester        FAIL      0.12 seconds
TestRunner_rfcomm-tester      FAIL      0.44 seconds
TestRunner_sco-tester         FAIL      0.12 seconds
TestRunner_ioctl-tester       FAIL      0.12 seconds
TestRunner_mesh-tester        FAIL      0.12 seconds
TestRunner_smp-tester         FAIL      0.12 seconds
TestRunner_userchan-tester    FAIL      0.12 seconds
IncrementalBuild              FAIL      20.13 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[RFC,v2] Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
1: T1 Title exceeds max length (81>80): "[RFC,v2] Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection"
##############################
Test: BuildKernel - FAIL
Desc: Build Kernel for Bluetooth
Output:

net/bluetooth/mgmt.c: In function ‘conn_update_sync’:
net/bluetooth/mgmt.c:7881:2: error: ‘conn’ undeclared (first use in this function)
 7881 |  conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
      |  ^~~~
net/bluetooth/mgmt.c:7881:2: note: each undeclared identifier is reported only once for each function it appears in
net/bluetooth/mgmt.c:7881:51: error: ‘bdaddr_t’ {aka ‘struct <anonymous>’} has no member named ‘bdaddr’
 7881 |  conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
      |                                                   ^
net/bluetooth/mgmt.c:7886:2: error: expected ‘;’ before ‘return’
 7886 |  return hci_le_conn_update_sync(hdev, conn, params);
      |  ^~~~~~
net/bluetooth/mgmt.c: In function ‘load_conn_param’:
net/bluetooth/mgmt.c:7960:13: error: ‘params’ undeclared (first use in this function); did you mean ‘param’?
 7960 |   if (!i && params == 1) {
      |             ^~~~~~
      |             param
net/bluetooth/mgmt.c:7992:15: error: ‘struct hci_conn’ has no member named ‘le_supervision_timeout’; did you mean ‘le_supv_timeout’?
 7992 |         conn->le_supervision_timeout != timeout))
      |               ^~~~~~~~~~~~~~~~~~~~~~
      |               le_supv_timeout
net/bluetooth/mgmt.c:7994:10: error: ‘hci_params’ undeclared (first use in this function); did you mean ‘hci_param’?
 7994 |          hci_params, NULL);
      |          ^~~~~~~~~~
      |          hci_param
In file included from net/bluetooth/mgmt.c:31:
net/bluetooth/mgmt.c: At top level:
./include/net/bluetooth/hci_core.h:1615:40: error: expected declaration specifiers or ‘...’ before ‘&’ token
 1615 | #define hci_dev_unlock(d) mutex_unlock(&d->lock)
      |                                        ^
net/bluetooth/mgmt.c:7999:2: note: in expansion of macro ‘hci_dev_unlock’
 7999 |  hci_dev_unlock(hdev);
      |  ^~~~~~~~~~~~~~
net/bluetooth/mgmt.c:8001:2: error: expected identifier or ‘(’ before ‘return’
 8001 |  return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM, 0,
      |  ^~~~~~
net/bluetooth/mgmt.c:8003:1: error: expected identifier or ‘(’ before ‘}’ token
 8003 | }
      | ^
net/bluetooth/mgmt.c: In function ‘load_conn_param’:
net/bluetooth/mgmt.c:7997:2: error: control reaches end of non-void function [-Werror=return-type]
 7997 |  }
      |  ^
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:244: net/bluetooth/mgmt.o] Error 1
make[3]: *** [scripts/Makefile.build:485: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:485: net] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/github/workspace/src/src/Makefile:1919: .] Error 2
make: *** [Makefile:240: __sub-make] Error 2
##############################
Test: CheckAllWarning - FAIL
Desc: Run linux kernel with all warning enabled
Output:

net/bluetooth/mgmt.c: In function ‘conn_update_sync’:
net/bluetooth/mgmt.c:7881:2: error: ‘conn’ undeclared (first use in this function)
 7881 |  conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
      |  ^~~~
net/bluetooth/mgmt.c:7881:2: note: each undeclared identifier is reported only once for each function it appears in
net/bluetooth/mgmt.c:7881:51: error: ‘bdaddr_t’ {aka ‘struct <anonymous>’} has no member named ‘bdaddr’
 7881 |  conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
      |                                                   ^
net/bluetooth/mgmt.c:7886:2: error: expected ‘;’ before ‘return’
 7886 |  return hci_le_conn_update_sync(hdev, conn, params);
      |  ^~~~~~
net/bluetooth/mgmt.c: In function ‘load_conn_param’:
net/bluetooth/mgmt.c:7960:13: error: ‘params’ undeclared (first use in this function); did you mean ‘param’?
 7960 |   if (!i && params == 1) {
      |             ^~~~~~
      |             param
net/bluetooth/mgmt.c:7992:15: error: ‘struct hci_conn’ has no member named ‘le_supervision_timeout’; did you mean ‘le_supv_timeout’?
 7992 |         conn->le_supervision_timeout != timeout))
      |               ^~~~~~~~~~~~~~~~~~~~~~
      |               le_supv_timeout
net/bluetooth/mgmt.c:7994:10: error: ‘hci_params’ undeclared (first use in this function); did you mean ‘hci_param’?
 7994 |          hci_params, NULL);
      |          ^~~~~~~~~~
      |          hci_param
In file included from net/bluetooth/mgmt.c:31:
net/bluetooth/mgmt.c: At top level:
./include/net/bluetooth/hci_core.h:1615:40: error: expected declaration specifiers or ‘...’ before ‘&’ token
 1615 | #define hci_dev_unlock(d) mutex_unlock(&d->lock)
      |                                        ^
net/bluetooth/mgmt.c:7999:2: note: in expansion of macro ‘hci_dev_unlock’
 7999 |  hci_dev_unlock(hdev);
      |  ^~~~~~~~~~~~~~
net/bluetooth/mgmt.c:8001:2: error: expected identifier or ‘(’ before ‘return’
 8001 |  return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM, 0,
      |  ^~~~~~
net/bluetooth/mgmt.c:8003:1: error: expected identifier or ‘(’ before ‘}’ token
 8003 | }
      | ^
net/bluetooth/mgmt.c: In function ‘load_conn_param’:
net/bluetooth/mgmt.c:7997:2: error: control reaches end of non-void function [-Werror=return-type]
 7997 |  }
      |  ^
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:244: net/bluetooth/mgmt.o] Error 1
make[3]: *** [scripts/Makefile.build:485: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:485: net] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/github/workspace/src/src/Makefile:1919: .] Error 2
make: *** [Makefile:240: __sub-make] Error 2
##############################
Test: CheckSparse - FAIL
Desc: Run sparse tool with linux kernel
Output:

net/bluetooth/af_bluetooth.c:226:25: warning: context imbalance in 'bt_accept_enqueue' - different lock contexts for basic block
drivers/bluetooth/hci_ag6xx.c:257:24: warning: restricted __le32 degrades to integer
drivers/bluetooth/hci_mrvl.c:170:23: warning: restricted __le16 degrades to integer
drivers/bluetooth/hci_mrvl.c:203:23: warning: restricted __le16 degrades to integer
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
./include/net/bluetooth/hci.h:2585:47: warning: array of flexible structures
./include/net/bluetooth/hci.h:2671:43: warning: array of flexible structures
net/bluetooth/mgmt.c: In function ‘conn_update_sync’:
net/bluetooth/mgmt.c:7881:2: error: ‘conn’ undeclared (first use in this function)
 7881 |  conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
      |  ^~~~
net/bluetooth/mgmt.c:7881:2: note: each undeclared identifier is reported only once for each function it appears in
net/bluetooth/mgmt.c:7881:51: error: ‘bdaddr_t’ {aka ‘struct <anonymous>’} has no member named ‘bdaddr’
 7881 |  conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
      |                                                   ^
net/bluetooth/mgmt.c:7886:2: error: expected ‘;’ before ‘return’
 7886 |  return hci_le_conn_update_sync(hdev, conn, params);
      |  ^~~~~~
net/bluetooth/mgmt.c: In function ‘load_conn_param’:
net/bluetooth/mgmt.c:7960:13: error: ‘params’ undeclared (first use in this function); did you mean ‘param’?
 7960 |   if (!i && params == 1) {
      |             ^~~~~~
      |             param
net/bluetooth/mgmt.c:7992:15: error: ‘struct hci_conn’ has no member named ‘le_supervision_timeout’; did you mean ‘le_supv_timeout’?
 7992 |         conn->le_supervision_timeout != timeout))
      |               ^~~~~~~~~~~~~~~~~~~~~~
      |               le_supv_timeout
net/bluetooth/mgmt.c:7994:10: error: ‘hci_params’ undeclared (first use in this function); did you mean ‘hci_param’?
 7994 |          hci_params, NULL);
      |          ^~~~~~~~~~
      |          hci_param
In file included from net/bluetooth/mgmt.c:31:
net/bluetooth/mgmt.c: At top level:
./include/net/bluetooth/hci_core.h:1615:40: error: expected declaration specifiers or ‘...’ before ‘&’ token
 1615 | #define hci_dev_unlock(d) mutex_unlock(&d->lock)
      |                                        ^
net/bluetooth/mgmt.c:7999:2: note: in expansion of macro ‘hci_dev_unlock’
 7999 |  hci_dev_unlock(hdev);
      |  ^~~~~~~~~~~~~~
net/bluetooth/mgmt.c:8001:2: error: expected identifier or ‘(’ before ‘return’
 8001 |  return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM, 0,
      |  ^~~~~~
net/bluetooth/mgmt.c:8003:1: error: expected identifier or ‘(’ before ‘}’ token
 8003 | }
      | ^
net/bluetooth/mgmt.c: In function ‘load_conn_param’:
net/bluetooth/mgmt.c:7997:2: error: control reaches end of non-void function [-Werror=return-type]
 7997 |  }
      |  ^
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:244: net/bluetooth/mgmt.o] Error 1
make[3]: *** [scripts/Makefile.build:485: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:485: net] Error 2
make[2]: *** Waiting for unfinished jobs....
drivers/bluetooth/hci_nokia.c:284:23: warning: incorrect type in assignment (different base types)
drivers/bluetooth/hci_nokia.c:284:23:    expected unsigned short [usertype] baud
drivers/bluetooth/hci_nokia.c:284:23:    got restricted __le16 [usertype]
drivers/bluetooth/hci_nokia.c:287:26: warning: incorrect type in assignment (different base types)
drivers/bluetooth/hci_nokia.c:287:26:    expected unsigned short [usertype] sys_clk
drivers/bluetooth/hci_nokia.c:287:26:    got restricted __le16 [usertype]
make[1]: *** [/github/workspace/src/src/Makefile:1919: .] Error 2
make: *** [Makefile:240: __sub-make] Error 2
##############################
Test: CheckSmatch - FAIL
Desc: Run smatch tool with source
Output:

Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: net/bluetooth/hci_core.o] Error 139
make[4]: *** Deleting file 'net/bluetooth/hci_core.o'
make[3]: *** [scripts/Makefile.build:485: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:485: net] Error 2
make[2]: *** Waiting for unfinished jobs....
Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: drivers/bluetooth/bcm203x.o] Error 139
make[4]: *** Deleting file 'drivers/bluetooth/bcm203x.o'
make[4]: *** Waiting for unfinished jobs....
Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: drivers/bluetooth/bpa10x.o] Error 139
make[4]: *** Deleting file 'drivers/bluetooth/bpa10x.o'
make[3]: *** [scripts/Makefile.build:485: drivers/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:485: drivers] Error 2
make[1]: *** [/github/workspace/src/src/Makefile:1919: .] Error 2
make: *** [Makefile:240: __sub-make] Error 2
##############################
Test: BuildKernel32 - FAIL
Desc: Build 32bit Kernel for Bluetooth
Output:

net/bluetooth/mgmt.c: In function ‘conn_update_sync’:
net/bluetooth/mgmt.c:7881:2: error: ‘conn’ undeclared (first use in this function)
 7881 |  conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
      |  ^~~~
net/bluetooth/mgmt.c:7881:2: note: each undeclared identifier is reported only once for each function it appears in
net/bluetooth/mgmt.c:7881:51: error: ‘bdaddr_t’ {aka ‘struct <anonymous>’} has no member named ‘bdaddr’
 7881 |  conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
      |                                                   ^
net/bluetooth/mgmt.c:7886:2: error: expected ‘;’ before ‘return’
 7886 |  return hci_le_conn_update_sync(hdev, conn, params);
      |  ^~~~~~
net/bluetooth/mgmt.c: In function ‘load_conn_param’:
net/bluetooth/mgmt.c:7960:13: error: ‘params’ undeclared (first use in this function); did you mean ‘param’?
 7960 |   if (!i && params == 1) {
      |             ^~~~~~
      |             param
net/bluetooth/mgmt.c:7992:15: error: ‘struct hci_conn’ has no member named ‘le_supervision_timeout’; did you mean ‘le_supv_timeout’?
 7992 |         conn->le_supervision_timeout != timeout))
      |               ^~~~~~~~~~~~~~~~~~~~~~
      |               le_supv_timeout
net/bluetooth/mgmt.c:7994:10: error: ‘hci_params’ undeclared (first use in this function); did you mean ‘hci_param’?
 7994 |          hci_params, NULL);
      |          ^~~~~~~~~~
      |          hci_param
In file included from net/bluetooth/mgmt.c:31:
net/bluetooth/mgmt.c: At top level:
./include/net/bluetooth/hci_core.h:1615:40: error: expected declaration specifiers or ‘...’ before ‘&’ token
 1615 | #define hci_dev_unlock(d) mutex_unlock(&d->lock)
      |                                        ^
net/bluetooth/mgmt.c:7999:2: note: in expansion of macro ‘hci_dev_unlock’
 7999 |  hci_dev_unlock(hdev);
      |  ^~~~~~~~~~~~~~
net/bluetooth/mgmt.c:8001:2: error: expected identifier or ‘(’ before ‘return’
 8001 |  return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM, 0,
      |  ^~~~~~
net/bluetooth/mgmt.c:8003:1: error: expected identifier or ‘(’ before ‘}’ token
 8003 | }
      | ^
net/bluetooth/mgmt.c: In function ‘load_conn_param’:
net/bluetooth/mgmt.c:7997:2: error: control reaches end of non-void function [-Werror=return-type]
 7997 |  }
      |  ^
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:244: net/bluetooth/mgmt.o] Error 1
make[3]: *** [scripts/Makefile.build:485: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:485: net] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/github/workspace/src/src/Makefile:1919: .] Error 2
make: *** [Makefile:240: __sub-make] Error 2
##############################
Test: TestRunnerSetup - FAIL
Desc: Setup kernel and bluez for test-runner
Output:
Kernel: 
net/bluetooth/mgmt.c: In function ‘conn_update_sync’:
net/bluetooth/mgmt.c:7881:2: error: ‘conn’ undeclared (first use in this function)
 7881 |  conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
      |  ^~~~
net/bluetooth/mgmt.c:7881:2: note: each undeclared identifier is reported only once for each function it appears in
net/bluetooth/mgmt.c:7881:51: error: ‘bdaddr_t’ {aka ‘struct <anonymous>’} has no member named ‘bdaddr’
 7881 |  conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
      |                                                   ^
net/bluetooth/mgmt.c:7886:2: error: expected ‘;’ before ‘return’
 7886 |  return hci_le_conn_update_sync(hdev, conn, params);
      |  ^~~~~~
net/bluetooth/mgmt.c: In function ‘load_conn_param’:
net/bluetooth/mgmt.c:7960:13: error: ‘params’ undeclared (first use in this function); did you mean ‘param’?
 7960 |   if (!i && params == 1) {
      |             ^~~~~~
      |             param
net/bluetooth/mgmt.c:7992:15: error: ‘struct hci_conn’ has no member named ‘le_supervision_timeout’; did you mean ‘le_supv_timeout’?
 7992 |         conn->le_supervision_timeout != timeout))
      |               ^~~~~~~~~~~~~~~~~~~~~~
      |               le_supv_timeout
net/bluetooth/mgmt.c:7994:10: error: ‘hci_params’ undeclared (first use in this function); did you mean ‘hci_param’?
 7994 |          hci_params, NULL);
      |          ^~~~~~~~~~
      |          hci_param
In file included from net/bluetooth/mgmt.c:31:
net/bluetooth/mgmt.c: At top level:
./include/net/bluetooth/hci_core.h:1615:40: error: expected declaration specifiers or ‘...’ before ‘&’ token
 1615 | #define hci_dev_unlock(d) mutex_unlock(&d->lock)
      |                                        ^
net/bluetooth/mgmt.c:7999:2: note: in expansion of macro ‘hci_dev_unlock’
 7999 |  hci_dev_unlock(hdev);
      |  ^~~~~~~~~~~~~~
net/bluetooth/mgmt.c:8001:2: error: expected identifier or ‘(’ before ‘return’
 8001 |  return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM, 0,
      |  ^~~~~~
net/bluetooth/mgmt.c:8003:1: error: expected identifier or ‘(’ before ‘}’ token
 8003 | }
      | ^
net/bluetooth/mgmt.c: In function ‘load_conn_param’:
net/bluetooth/mgmt.c:7997:2: error: control reaches end of non-void function [-Werror=return-type]
 7997 |  }
      |  ^
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:244: net/bluetooth/mgmt.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:485: net/bluetooth] Error 2
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:485: net] Error 2
make[1]: *** [/github/workspace/src/src/Makefile:1919: .] Error 2
make: *** [Makefile:240: __sub-make] Error 2
##############################
Test: TestRunner_l2cap-tester - FAIL
Desc: Run l2cap-tester with test-runner
Output:

Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:

Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_bnep-tester - FAIL
Desc: Run bnep-tester with test-runner
Output:

Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:

Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_rfcomm-tester - FAIL
Desc: Run rfcomm-tester with test-runner
Output:

Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_sco-tester - FAIL
Desc: Run sco-tester with test-runner
Output:

Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_ioctl-tester - FAIL
Desc: Run ioctl-tester with test-runner
Output:

Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:

Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_smp-tester - FAIL
Desc: Run smp-tester with test-runner
Output:

Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_userchan-tester - FAIL
Desc: Run userchan-tester with test-runner
Output:

Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: IncrementalBuild - FAIL
Desc: Incremental build with the patches in the series
Output:
[RFC,v2] Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection

net/bluetooth/mgmt.c: In function ‘conn_update_sync’:
net/bluetooth/mgmt.c:7881:2: error: ‘conn’ undeclared (first use in this function)
 7881 |  conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
      |  ^~~~
net/bluetooth/mgmt.c:7881:2: note: each undeclared identifier is reported only once for each function it appears in
net/bluetooth/mgmt.c:7881:51: error: ‘bdaddr_t’ {aka ‘struct <anonymous>’} has no member named ‘bdaddr’
 7881 |  conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
      |                                                   ^
net/bluetooth/mgmt.c:7886:2: error: expected ‘;’ before ‘return’
 7886 |  return hci_le_conn_update_sync(hdev, conn, params);
      |  ^~~~~~
net/bluetooth/mgmt.c: In function ‘load_conn_param’:
net/bluetooth/mgmt.c:7960:13: error: ‘params’ undeclared (first use in this function); did you mean ‘param’?
 7960 |   if (!i && params == 1) {
      |             ^~~~~~
      |             param
net/bluetooth/mgmt.c:7992:15: error: ‘struct hci_conn’ has no member named ‘le_supervision_timeout’; did you mean ‘le_supv_timeout’?
 7992 |         conn->le_supervision_timeout != timeout))
      |               ^~~~~~~~~~~~~~~~~~~~~~
      |               le_supv_timeout
net/bluetooth/mgmt.c:7994:10: error: ‘hci_params’ undeclared (first use in this function); did you mean ‘hci_param’?
 7994 |          hci_params, NULL);
      |          ^~~~~~~~~~
      |          hci_param
In file included from net/bluetooth/mgmt.c:31:
net/bluetooth/mgmt.c: At top level:
./include/net/bluetooth/hci_core.h:1615:40: error: expected declaration specifiers or ‘...’ before ‘&’ token
 1615 | #define hci_dev_unlock(d) mutex_unlock(&d->lock)
      |                                        ^
net/bluetooth/mgmt.c:7999:2: note: in expansion of macro ‘hci_dev_unlock’
 7999 |  hci_dev_unlock(hdev);
      |  ^~~~~~~~~~~~~~
net/bluetooth/mgmt.c:8001:2: error: expected identifier or ‘(’ before ‘return’
 8001 |  return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM, 0,
      |  ^~~~~~
net/bluetooth/mgmt.c:8003:1: error: expected identifier or ‘(’ before ‘}’ token
 8003 | }
      | ^
net/bluetooth/mgmt.c: In function ‘load_conn_param’:
net/bluetooth/mgmt.c:7997:2: error: control reaches end of non-void function [-Werror=return-type]
 7997 |  }
      |  ^
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:244: net/bluetooth/mgmt.o] Error 1
make[3]: *** [scripts/Makefile.build:485: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:485: net] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/github/workspace/src/src/Makefile:1919: .] Error 2
make: *** [Makefile:240: __sub-make] Error 2


---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC v2] Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection
  2024-05-09 22:50 [RFC v2] Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection Luiz Augusto von Dentz
  2024-05-09 23:27 ` [RFC,v2] " bluez.test.bot
@ 2024-05-10  9:51 ` kernel test robot
  2024-05-10 10:02 ` kernel test robot
  2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2024-05-10  9:51 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: oe-kbuild-all

Hi Luiz,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on bluetooth-next/master]
[also build test ERROR on bluetooth/master linus/master v6.9-rc7 next-20240510]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Luiz-Augusto-von-Dentz/Bluetooth-MGMT-Make-MGMT_OP_LOAD_CONN_PARAM-update-existing-connection/20240510-065108
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
patch link:    https://lore.kernel.org/r/20240509225043.1357933-1-luiz.dentz%40gmail.com
patch subject: [RFC v2] Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20240510/202405101745.hjoY6Te2-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240510/202405101745.hjoY6Te2-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405101745.hjoY6Te2-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   net/bluetooth/mgmt.c: In function 'conn_update_sync':
>> net/bluetooth/mgmt.c:7881:9: error: 'conn' undeclared (first use in this function)
    7881 |         conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
         |         ^~~~
   net/bluetooth/mgmt.c:7881:9: note: each undeclared identifier is reported only once for each function it appears in
>> net/bluetooth/mgmt.c:7881:58: error: 'bdaddr_t' has no member named 'bdaddr'
    7881 |         conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
         |                                                          ^
>> net/bluetooth/mgmt.c:7886:9: error: expected ';' before 'return'
    7886 |         return hci_le_conn_update_sync(hdev, conn, params);
         |         ^~~~~~
   net/bluetooth/mgmt.c: In function 'load_conn_param':
>> net/bluetooth/mgmt.c:7960:27: error: 'params' undeclared (first use in this function); did you mean 'param'?
    7960 |                 if (!i && params == 1) {
         |                           ^~~~~~
         |                           param
>> net/bluetooth/mgmt.c:7992:36: error: 'struct hci_conn' has no member named 'le_supervision_timeout'; did you mean 'le_supv_timeout'?
    7992 |                              conn->le_supervision_timeout != timeout))
         |                                    ^~~~~~~~~~~~~~~~~~~~~~
         |                                    le_supv_timeout
>> net/bluetooth/mgmt.c:7994:52: error: 'hci_params' undeclared (first use in this function); did you mean 'hci_param'?
    7994 |                                                    hci_params, NULL);
         |                                                    ^~~~~~~~~~
         |                                                    hci_param
   In file included from net/bluetooth/mgmt.c:31:
   net/bluetooth/mgmt.c: At top level:
>> include/net/bluetooth/hci_core.h:1615:46: error: expected declaration specifiers or '...' before '&' token
    1615 | #define hci_dev_unlock(d)       mutex_unlock(&d->lock)
         |                                              ^
   net/bluetooth/mgmt.c:7999:9: note: in expansion of macro 'hci_dev_unlock'
    7999 |         hci_dev_unlock(hdev);
         |         ^~~~~~~~~~~~~~
>> net/bluetooth/mgmt.c:8001:9: error: expected identifier or '(' before 'return'
    8001 |         return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM, 0,
         |         ^~~~~~
>> net/bluetooth/mgmt.c:8003:1: error: expected identifier or '(' before '}' token
    8003 | }
         | ^
   net/bluetooth/mgmt.c: In function 'load_conn_param':
>> net/bluetooth/mgmt.c:7997:9: warning: control reaches end of non-void function [-Wreturn-type]
    7997 |         }
         |         ^
--
>> net/bluetooth/hci_sync.c:6716:5: warning: no previous prototype for 'hci_le_conn_update_sync' [-Wmissing-prototypes]
    6716 | int hci_le_conn_update_sync(struct hci_dev *hdev, struct hci_conn *conn,
         |     ^~~~~~~~~~~~~~~~~~~~~~~


vim +/conn +7881 net/bluetooth/mgmt.c

  7876	
  7877	static int conn_update_sync(struct hci_dev *hdev, void *data)
  7878	{
  7879		struct hci_conn_params *params = data;
  7880	
> 7881		conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
  7882					       params->addr_type);
  7883		if (!conn)
  7884			return -ECANCELED
  7885	
> 7886		return hci_le_conn_update_sync(hdev, conn, params);
  7887	}
  7888	
  7889	static int load_conn_param(struct sock *sk, struct hci_dev *hdev, void *data,
  7890				   u16 len)
  7891	{
  7892		struct mgmt_cp_load_conn_param *cp = data;
  7893		const u16 max_param_count = ((U16_MAX - sizeof(*cp)) /
  7894					     sizeof(struct mgmt_conn_param));
  7895		u16 param_count, expected_len;
  7896		int i;
  7897	
  7898		if (!lmp_le_capable(hdev))
  7899			return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM,
  7900					       MGMT_STATUS_NOT_SUPPORTED);
  7901	
  7902		param_count = __le16_to_cpu(cp->param_count);
  7903		if (param_count > max_param_count) {
  7904			bt_dev_err(hdev, "load_conn_param: too big param_count value %u",
  7905				   param_count);
  7906			return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM,
  7907					       MGMT_STATUS_INVALID_PARAMS);
  7908		}
  7909	
  7910		expected_len = struct_size(cp, params, param_count);
  7911		if (expected_len != len) {
  7912			bt_dev_err(hdev, "load_conn_param: expected %u bytes, got %u bytes",
  7913				   expected_len, len);
  7914			return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM,
  7915					       MGMT_STATUS_INVALID_PARAMS);
  7916		}
  7917	
  7918		bt_dev_dbg(hdev, "param_count %u", param_count);
  7919	
  7920		hci_dev_lock(hdev);
  7921	
  7922		if (i > 1)
  7923			hci_conn_params_clear_disabled(hdev);
  7924	
  7925		for (i = 0; i < param_count; i++) {
  7926			struct mgmt_conn_param *param = &cp->params[i];
  7927			struct hci_conn_params *hci_param;
  7928			u16 min, max, latency, timeout;
  7929			u8 addr_type;
  7930			bool update;
  7931	
  7932			bt_dev_dbg(hdev, "Adding %pMR (type %u)", &param->addr.bdaddr,
  7933				   param->addr.type);
  7934	
  7935			if (param->addr.type == BDADDR_LE_PUBLIC) {
  7936				addr_type = ADDR_LE_DEV_PUBLIC;
  7937			} else if (param->addr.type == BDADDR_LE_RANDOM) {
  7938				addr_type = ADDR_LE_DEV_RANDOM;
  7939			} else {
  7940				bt_dev_err(hdev, "ignoring invalid connection parameters");
  7941				continue;
  7942			}
  7943	
  7944			min = le16_to_cpu(param->min_interval);
  7945			max = le16_to_cpu(param->max_interval);
  7946			latency = le16_to_cpu(param->latency);
  7947			timeout = le16_to_cpu(param->timeout);
  7948	
  7949			bt_dev_dbg(hdev, "min 0x%04x max 0x%04x latency 0x%04x timeout 0x%04x",
  7950				   min, max, latency, timeout);
  7951	
  7952			if (hci_check_conn_params(min, max, latency, timeout) < 0) {
  7953				bt_dev_err(hdev, "ignoring invalid connection parameters");
  7954				continue;
  7955			}
  7956	
  7957			/* Detect when the loading is for an existing parameter then
  7958			 * attempt to trigger the connection update procedure.
  7959			 */
> 7960			if (!i && params == 1) {
  7961				hci_param = hci_conn_params_lookup(hdev,
  7962								   &param->addr.bdaddr,
  7963								   addr_type);
  7964				if (hci_param)
  7965					update = true;
  7966				else
  7967					hci_conn_params_clear_disabled(hdev);
  7968			}
  7969	
  7970			hci_param = hci_conn_params_add(hdev, &param->addr.bdaddr,
  7971							addr_type);
  7972			if (!hci_param) {
  7973				bt_dev_err(hdev, "failed to add connection parameters");
  7974				continue;
  7975			}
  7976	
  7977			hci_param->conn_min_interval = min;
  7978			hci_param->conn_max_interval = max;
  7979			hci_param->conn_latency = latency;
  7980			hci_param->supervision_timeout = timeout;
  7981	
  7982			if (update) {
  7983				struct hci_conn *conn;
  7984	
  7985				conn = hci_conn_hash_lookup_le(hdev,
  7986							       params->addr.bdaddr,
  7987							       addr_type);
  7988				if (conn && conn->role == HCI_ROLE_MASTER &&
  7989				    (conn->le_conn_min_interval != min ||
  7990				     conn->le_conn_max_interval != max ||
  7991				     conn->le_conn_latency != latency ||
> 7992				     conn->le_supervision_timeout != timeout))
  7993					hci_cmd_sync_queue(hdev, conn_update_sync,
> 7994							   hci_params, NULL);
  7995				}
  7996			}
> 7997		}
  7998	
> 7999		hci_dev_unlock(hdev);
  8000	
> 8001		return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM, 0,
  8002					 NULL, 0);
> 8003	}
  8004	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC v2] Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection
  2024-05-09 22:50 [RFC v2] Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection Luiz Augusto von Dentz
  2024-05-09 23:27 ` [RFC,v2] " bluez.test.bot
  2024-05-10  9:51 ` [RFC v2] " kernel test robot
@ 2024-05-10 10:02 ` kernel test robot
  2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2024-05-10 10:02 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: llvm, oe-kbuild-all

Hi Luiz,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on bluetooth-next/master]
[also build test ERROR on bluetooth/master linus/master v6.9-rc7 next-20240510]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Luiz-Augusto-von-Dentz/Bluetooth-MGMT-Make-MGMT_OP_LOAD_CONN_PARAM-update-existing-connection/20240510-065108
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
patch link:    https://lore.kernel.org/r/20240509225043.1357933-1-luiz.dentz%40gmail.com
patch subject: [RFC v2] Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection
config: arm-defconfig (https://download.01.org/0day-ci/archive/20240510/202405101700.NwHcUWrt-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240510/202405101700.NwHcUWrt-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405101700.NwHcUWrt-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

>> net/bluetooth/mgmt.c:7881:2: error: use of undeclared identifier 'conn'
           conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
           ^
>> net/bluetooth/mgmt.c:7881:52: error: no member named 'bdaddr' in 'bdaddr_t'
           conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
                                                ~~~~~~~~~~~~ ^
   net/bluetooth/mgmt.c:7883:7: error: use of undeclared identifier 'conn'; did you mean 'down'?
           if (!conn)
                ^~~~
                down
   include/linux/semaphore.h:44:13: note: 'down' declared here
   extern void down(struct semaphore *sem);
               ^
>> net/bluetooth/mgmt.c:7883:7: warning: address of function 'down' will always evaluate to 'true' [-Wpointer-bool-conversion]
           if (!conn)
               ~^~~~
   net/bluetooth/mgmt.c:7883:7: note: prefix with the address-of operator to silence this warning
           if (!conn)
                ^
                &
>> net/bluetooth/mgmt.c:7884:20: error: expected ';' after return statement
                   return -ECANCELED
                                    ^
                                    ;
>> net/bluetooth/mgmt.c:7960:13: error: use of undeclared identifier 'params'; did you mean 'param'?
                   if (!i && params == 1) {
                             ^~~~~~
                             param
   net/bluetooth/mgmt.c:7926:27: note: 'param' declared here
                   struct mgmt_conn_param *param = &cp->params[i];
                                           ^
   net/bluetooth/mgmt.c:7986:14: error: use of undeclared identifier 'params'
                                                          params->addr.bdaddr,
                                                          ^
>> net/bluetooth/mgmt.c:7992:15: error: no member named 'le_supervision_timeout' in 'struct hci_conn'; did you mean 'le_supv_timeout'?
                                conn->le_supervision_timeout != timeout))
                                      ^~~~~~~~~~~~~~~~~~~~~~
                                      le_supv_timeout
   include/net/bluetooth/hci_core.h:712:9: note: 'le_supv_timeout' declared here
           __u16           le_supv_timeout;
                           ^
>> net/bluetooth/mgmt.c:7994:10: error: use of undeclared identifier 'hci_params'; did you mean 'hci_param'?
                                                      hci_params, NULL);
                                                      ^~~~~~~~~~
                                                      hci_param
   net/bluetooth/mgmt.c:7927:27: note: 'hci_param' declared here
                   struct hci_conn_params *hci_param;
                                           ^
>> net/bluetooth/mgmt.c:7999:2: error: expected parameter declarator
           hci_dev_unlock(hdev);
           ^
   include/net/bluetooth/hci_core.h:1615:40: note: expanded from macro 'hci_dev_unlock'
   #define hci_dev_unlock(d)       mutex_unlock(&d->lock)
                                                ^
>> net/bluetooth/mgmt.c:7999:2: error: expected ')'
   include/net/bluetooth/hci_core.h:1615:40: note: expanded from macro 'hci_dev_unlock'
   #define hci_dev_unlock(d)       mutex_unlock(&d->lock)
                                                ^
   net/bluetooth/mgmt.c:7999:2: note: to match this '('
   include/net/bluetooth/hci_core.h:1615:39: note: expanded from macro 'hci_dev_unlock'
   #define hci_dev_unlock(d)       mutex_unlock(&d->lock)
                                               ^
>> net/bluetooth/mgmt.c:7999:2: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int]
           hci_dev_unlock(hdev);
           ^
   include/net/bluetooth/hci_core.h:1615:27: note: expanded from macro 'hci_dev_unlock'
   #define hci_dev_unlock(d)       mutex_unlock(&d->lock)
                                   ^
>> net/bluetooth/mgmt.c:7999:2: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
   include/net/bluetooth/hci_core.h:1615:39: note: expanded from macro 'hci_dev_unlock'
   #define hci_dev_unlock(d)       mutex_unlock(&d->lock)
                                               ^
>> net/bluetooth/mgmt.c:7999:2: error: conflicting types for 'mutex_unlock'
   include/net/bluetooth/hci_core.h:1615:27: note: expanded from macro 'hci_dev_unlock'
   #define hci_dev_unlock(d)       mutex_unlock(&d->lock)
                                   ^
   include/linux/mutex.h:165:13: note: previous declaration is here
   extern void mutex_unlock(struct mutex *lock);
               ^
>> net/bluetooth/mgmt.c:8001:2: error: expected identifier or '('
           return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM, 0,
           ^
>> net/bluetooth/mgmt.c:8003:1: error: extraneous closing brace ('}')
   }
   ^
   1 warning and 15 errors generated.
--
>> net/bluetooth/hci_sync.c:6716:5: warning: no previous prototype for function 'hci_le_conn_update_sync' [-Wmissing-prototypes]
   int hci_le_conn_update_sync(struct hci_dev *hdev, struct hci_conn *conn,
       ^
   net/bluetooth/hci_sync.c:6716:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int hci_le_conn_update_sync(struct hci_dev *hdev, struct hci_conn *conn,
   ^
   static 
   1 warning generated.


vim +/conn +7881 net/bluetooth/mgmt.c

  7876	
  7877	static int conn_update_sync(struct hci_dev *hdev, void *data)
  7878	{
  7879		struct hci_conn_params *params = data;
  7880	
> 7881		conn = hci_conn_hash_lookup_le(hdev, params->addr.bdaddr,
  7882					       params->addr_type);
> 7883		if (!conn)
> 7884			return -ECANCELED
  7885	
  7886		return hci_le_conn_update_sync(hdev, conn, params);
  7887	}
  7888	
  7889	static int load_conn_param(struct sock *sk, struct hci_dev *hdev, void *data,
  7890				   u16 len)
  7891	{
  7892		struct mgmt_cp_load_conn_param *cp = data;
  7893		const u16 max_param_count = ((U16_MAX - sizeof(*cp)) /
  7894					     sizeof(struct mgmt_conn_param));
  7895		u16 param_count, expected_len;
  7896		int i;
  7897	
  7898		if (!lmp_le_capable(hdev))
  7899			return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM,
  7900					       MGMT_STATUS_NOT_SUPPORTED);
  7901	
  7902		param_count = __le16_to_cpu(cp->param_count);
  7903		if (param_count > max_param_count) {
  7904			bt_dev_err(hdev, "load_conn_param: too big param_count value %u",
  7905				   param_count);
  7906			return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM,
  7907					       MGMT_STATUS_INVALID_PARAMS);
  7908		}
  7909	
  7910		expected_len = struct_size(cp, params, param_count);
  7911		if (expected_len != len) {
  7912			bt_dev_err(hdev, "load_conn_param: expected %u bytes, got %u bytes",
  7913				   expected_len, len);
  7914			return mgmt_cmd_status(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM,
  7915					       MGMT_STATUS_INVALID_PARAMS);
  7916		}
  7917	
  7918		bt_dev_dbg(hdev, "param_count %u", param_count);
  7919	
  7920		hci_dev_lock(hdev);
  7921	
  7922		if (i > 1)
  7923			hci_conn_params_clear_disabled(hdev);
  7924	
  7925		for (i = 0; i < param_count; i++) {
  7926			struct mgmt_conn_param *param = &cp->params[i];
  7927			struct hci_conn_params *hci_param;
  7928			u16 min, max, latency, timeout;
  7929			u8 addr_type;
  7930			bool update;
  7931	
  7932			bt_dev_dbg(hdev, "Adding %pMR (type %u)", &param->addr.bdaddr,
  7933				   param->addr.type);
  7934	
  7935			if (param->addr.type == BDADDR_LE_PUBLIC) {
  7936				addr_type = ADDR_LE_DEV_PUBLIC;
  7937			} else if (param->addr.type == BDADDR_LE_RANDOM) {
  7938				addr_type = ADDR_LE_DEV_RANDOM;
  7939			} else {
  7940				bt_dev_err(hdev, "ignoring invalid connection parameters");
  7941				continue;
  7942			}
  7943	
  7944			min = le16_to_cpu(param->min_interval);
  7945			max = le16_to_cpu(param->max_interval);
  7946			latency = le16_to_cpu(param->latency);
  7947			timeout = le16_to_cpu(param->timeout);
  7948	
  7949			bt_dev_dbg(hdev, "min 0x%04x max 0x%04x latency 0x%04x timeout 0x%04x",
  7950				   min, max, latency, timeout);
  7951	
  7952			if (hci_check_conn_params(min, max, latency, timeout) < 0) {
  7953				bt_dev_err(hdev, "ignoring invalid connection parameters");
  7954				continue;
  7955			}
  7956	
  7957			/* Detect when the loading is for an existing parameter then
  7958			 * attempt to trigger the connection update procedure.
  7959			 */
> 7960			if (!i && params == 1) {
  7961				hci_param = hci_conn_params_lookup(hdev,
  7962								   &param->addr.bdaddr,
  7963								   addr_type);
  7964				if (hci_param)
  7965					update = true;
  7966				else
  7967					hci_conn_params_clear_disabled(hdev);
  7968			}
  7969	
  7970			hci_param = hci_conn_params_add(hdev, &param->addr.bdaddr,
  7971							addr_type);
  7972			if (!hci_param) {
  7973				bt_dev_err(hdev, "failed to add connection parameters");
  7974				continue;
  7975			}
  7976	
  7977			hci_param->conn_min_interval = min;
  7978			hci_param->conn_max_interval = max;
  7979			hci_param->conn_latency = latency;
  7980			hci_param->supervision_timeout = timeout;
  7981	
  7982			if (update) {
  7983				struct hci_conn *conn;
  7984	
  7985				conn = hci_conn_hash_lookup_le(hdev,
  7986							       params->addr.bdaddr,
  7987							       addr_type);
  7988				if (conn && conn->role == HCI_ROLE_MASTER &&
  7989				    (conn->le_conn_min_interval != min ||
  7990				     conn->le_conn_max_interval != max ||
  7991				     conn->le_conn_latency != latency ||
> 7992				     conn->le_supervision_timeout != timeout))
  7993					hci_cmd_sync_queue(hdev, conn_update_sync,
> 7994							   hci_params, NULL);
  7995				}
  7996			}
  7997		}
  7998	
> 7999		hci_dev_unlock(hdev);
  8000	
> 8001		return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_LOAD_CONN_PARAM, 0,
  8002					 NULL, 0);
> 8003	}
  8004	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-10 10:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-09 22:50 [RFC v2] Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection Luiz Augusto von Dentz
2024-05-09 23:27 ` [RFC,v2] " bluez.test.bot
2024-05-10  9:51 ` [RFC v2] " kernel test robot
2024-05-10 10:02 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.