kirkstone migration: update bluez5 package

* Refresh the 5.56 patches on top of new version 5.64
* Separate the patches for 5.41 and 5.64. The code base has changed a
lot between those two releases, so having common patch files under
'bluez5' directory makes maintenance more cumbersome.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2022-05-25 14:23:15 +02:00
parent 9a596836c9
commit 674af78711
14 changed files with 150 additions and 57 deletions

View File

@ -45,8 +45,8 @@ FEATURE_PACKAGES_dey-wireless = "packagegroup-dey-wireless"
# Our layer only provides version 5.41, which we want to keep because
# it was used for Bluetooth certification. However by default the newer
# 5.56 version should be used, which is provided by the poky layer.
PREFERRED_VERSION_bluez5 ?= "5.56"
# 5.64 version should be used, which is provided by the poky layer.
PREFERRED_VERSION_bluez5 ?= "5.64"
# Set the PREFERRED_PROVIDER for jpeg functionality based on the MACHINE
# architecture. For armv7a devices libjpeg-turbo should be used to take

View File

@ -0,0 +1,24 @@
From: Gabriel Valcazar <gabriel.valcazar@digi.com>
Date: Thu, 7 Feb 2019 13:15:43 +0100
Subject: [PATCH] bluetooth.service: add Digi customizations
These changes include:
* Having the bluetooth stack start automatically on boot.
Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
---
src/bluetooth.service.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bluetooth.service.in b/src/bluetooth.service.in
index 4d39ad49d5bf..495ce39f133b 100644
--- a/src/bluetooth.service.in
+++ b/src/bluetooth.service.in
@@ -32,5 +32,5 @@ NoNewPrivileges=true
RestrictRealtime=true
[Install]
-WantedBy=bluetooth.target
+WantedBy=multi-user.target
Alias=dbus-org.bluez.service

View File

@ -0,0 +1,22 @@
From: Isaac Hermida <isaac.hermida@digi.com>
Date: Fri, 8 Jul 2016 12:19:33 +0200
Subject: [PATCH] hcitool: do not show unsupported refresh option
Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
---
tools/hcitool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/hcitool.c b/tools/hcitool.c
index 639ee6a511fb..3d5d4029d988 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -556,7 +556,7 @@ static struct option scan_options[] = {
static const char *scan_help =
"Usage:\n"
- "\tscan [--length=N] [--numrsp=N] [--iac=lap] [--flush] [--class] [--info] [--oui] [--refresh]\n";
+ "\tscan [--length=N] [--numrsp=N] [--iac=lap] [--flush] [--class] [--info] [--oui]\n";
static void cmd_scan(int dev_id, int argc, char **argv)
{

View File

@ -0,0 +1,57 @@
From: Isaac Hermida <isaac.hermida@digi.com>
Date: Fri, 8 Jul 2016 10:42:57 +0200
Subject: [PATCH] hcitool: increase the shown connection limit to 20
Created a variable to set the number of connections to shown and increase that
value so we can list more current LE connections.
https://jira.digi.com/browse/DEL-2735
Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
---
tools/hcitool.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tools/hcitool.c b/tools/hcitool.c
index 3d5d4029d988..07053910fc9c 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -57,6 +57,8 @@
#define EIR_TX_POWER 0x0A /* transmit power level */
#define EIR_DEVICE_ID 0x10 /* device ID */
+#define MAX_CONNECTIONS_SHOWN 20 /* Max number of "hcitool conn" items to shown */
+
#define for_each_opt(opt, long, short) while ((opt=getopt_long(argc, argv, short ? short:"+", long, NULL)) != -1)
static volatile int signal_received = 0;
@@ -144,12 +146,12 @@ static int conn_list(int s, int dev_id, long arg)
if (id != -1 && dev_id != id)
return 0;
- if (!(cl = malloc(10 * sizeof(*ci) + sizeof(*cl)))) {
+ if (!(cl = malloc(MAX_CONNECTIONS_SHOWN * sizeof(*ci) + sizeof(*cl)))) {
perror("Can't allocate memory");
exit(1);
}
cl->dev_id = dev_id;
- cl->conn_num = 10;
+ cl->conn_num = MAX_CONNECTIONS_SHOWN;
ci = cl->conn_info;
if (ioctl(s, HCIGETCONNLIST, (void *) cl)) {
@@ -178,12 +180,12 @@ static int find_conn(int s, int dev_id, long arg)
struct hci_conn_info *ci;
int i;
- if (!(cl = malloc(10 * sizeof(*ci) + sizeof(*cl)))) {
+ if (!(cl = malloc(MAX_CONNECTIONS_SHOWN * sizeof(*ci) + sizeof(*cl)))) {
perror("Can't allocate memory");
exit(1);
}
cl->dev_id = dev_id;
- cl->conn_num = 10;
+ cl->conn_num = MAX_CONNECTIONS_SHOWN;
ci = cl->conn_info;
if (ioctl(s, HCIGETCONNLIST, (void *) cl)) {

View File

@ -9,7 +9,7 @@ Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/test/test-discovery b/test/test-discovery
index eccc7c7e3..9aeace414 100755
index eccc7c7e31f0..9aeace414ada 100755
--- a/test/test-discovery
+++ b/test/test-discovery
@@ -1,4 +1,4 @@

View File

@ -1,4 +1,3 @@
From 36dceaad707ca0dbed2fdad59e4730c08caddf14 Mon Sep 17 00:00:00 2001
From: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
Date: Mon, 8 Jan 2018 10:29:51 +0100
Subject: [PATCH] Add hciattach rome support for Qualcomm chip QCA6564
@ -8,23 +7,22 @@ support for its chip in bluez stack (hciattach rome).
Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
Signed-off-by: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
---
Makefile.tools | 3 +-
profiles/audio/avrcp.c | 27 +-
tools/hciattach.c | 45 +-
tools/hciattach.h | 2 +
tools/hciattach.h | 1 +
tools/hciattach_rome.c | 1941 ++++++++++++++++++++++++++++++++++++++++
tools/hciattach_rome.h | 390 ++++++++
6 files changed, 2400 insertions(+), 8 deletions(-)
6 files changed, 2399 insertions(+), 8 deletions(-)
create mode 100644 tools/hciattach_rome.c
create mode 100644 tools/hciattach_rome.h
diff --git a/Makefile.tools b/Makefile.tools
index d5fdf2d..baafecf 100644
index bd902fd834aa..e6d9f48781e2 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -350,7 +350,8 @@ tools_hciattach_SOURCES = tools/hciattach.c tools/hciattach.h \
@@ -373,7 +373,8 @@ tools_hciattach_SOURCES = tools/hciattach.c tools/hciattach.h \
tools/hciattach_ath3k.c \
tools/hciattach_qualcomm.c \
tools/hciattach_intel.c \
@ -35,10 +33,10 @@ index d5fdf2d..baafecf 100644
tools_hciconfig_SOURCES = tools/hciconfig.c
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index c093dea..a6168b9 100644
index 80f34c7a77a1..5cf327367589 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -2203,13 +2203,19 @@ static gboolean avrcp_get_play_status_rsp(struct avctp *conn, uint8_t code,
@@ -2219,13 +2219,19 @@ static gboolean avrcp_get_play_status_rsp(struct avctp *conn, uint8_t code,
void *user_data)
{
struct avrcp *session = user_data;
@ -58,9 +56,9 @@ index c093dea..a6168b9 100644
+ mp = player->user_data;
+
if (pdu == NULL || code == AVC_CTYPE_REJECTED ||
ntohs(pdu->params_len) != 9)
be16_to_cpu(pdu->params_len) != 9)
return FALSE;
@@ -2267,12 +2273,18 @@ static gboolean avrcp_player_value_rsp(struct avctp *conn, uint8_t code,
@@ -2281,12 +2287,18 @@ static gboolean avrcp_player_value_rsp(struct avctp *conn, uint8_t code,
void *user_data)
{
struct avrcp *session = user_data;
@ -81,7 +79,7 @@ index c093dea..a6168b9 100644
if (pdu == NULL) {
media_player_set_setting(mp, "Error", "Timeout");
return FALSE;
@@ -2424,10 +2436,15 @@ static gboolean avrcp_get_element_attributes_rsp(struct avctp *conn,
@@ -2442,10 +2454,15 @@ static gboolean avrcp_get_element_attributes_rsp(struct avctp *conn,
void *user_data)
{
struct avrcp *session = user_data;
@ -99,7 +97,7 @@ index c093dea..a6168b9 100644
return FALSE;
diff --git a/tools/hciattach.c b/tools/hciattach.c
index 276a4e5..d535277 100644
index 276a4e56ef9d..d53527761bed 100644
--- a/tools/hciattach.c
+++ b/tools/hciattach.c
@@ -57,6 +57,8 @@ struct uart_t {
@ -233,18 +231,10 @@ index 276a4e5..d535277 100644
return 0;
}
diff --git a/tools/hciattach.h b/tools/hciattach.h
index 26c0d54..00721e1 100644
index 26c0d542434d..96ff9e38cfda 100644
--- a/tools/hciattach.h
+++ b/tools/hciattach.h
@@ -32,6 +32,7 @@
#define HCI_UART_AG6XX 9
#define HCI_UART_NOKIA 10
#define HCI_UART_MRVL 11
+#define HCI_UART_IBS 12
#define HCI_UART_RAW_DEVICE 0
#define HCI_UART_RESET_ON_INIT 1
@@ -53,6 +54,7 @@ int ath3k_init(int fd, int speed, int init_speed, char *bdaddr,
@@ -53,6 +53,7 @@ int ath3k_init(int fd, int speed, int init_speed, char *bdaddr,
struct termios *ti);
int ath3k_post(int fd, int pm);
int qualcomm_init(int fd, int speed, struct termios *ti, const char *bdaddr);
@ -254,7 +244,7 @@ index 26c0d54..00721e1 100644
const char *bdaddr);
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
new file mode 100644
index 0000000..59bdc16
index 000000000000..59bdc16e4e8f
--- /dev/null
+++ b/tools/hciattach_rome.c
@@ -0,0 +1,1941 @@
@ -2201,7 +2191,7 @@ index 0000000..59bdc16
+}
diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h
new file mode 100644
index 0000000..89f7db3
index 000000000000..89f7db3bef86
--- /dev/null
+++ b/tools/hciattach_rome.h
@@ -0,0 +1,390 @@

View File

@ -1,6 +1,6 @@
From: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
Date: Mon, 8 Jan 2018 10:30:18 +0100
Subject: [PATCH 2/4] hciattach_rome: Respect the user indication for noflow
Subject: [PATCH] hciattach_rome: Respect the user indication for noflow
When hciattach is called with noflow, it should not assume the hardware
supports hardware flow control.
@ -13,15 +13,15 @@ Signed-off-by: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
---
tools/hciattach.c | 2 +-
tools/hciattach.h | 2 +-
tools/hciattach_rome.c | 50 +++++++++++++++++++++++++++++++++++---------------
tools/hciattach_rome.c | 50 +++++++++++++++++++++++++++++-------------
tools/hciattach_rome.h | 1 +
4 files changed, 38 insertions(+), 17 deletions(-)
diff --git a/tools/hciattach.c b/tools/hciattach.c
index dda639cabca3..81d78ab3f69a 100644
index d53527761bed..b94eb5ad1a5b 100644
--- a/tools/hciattach.c
+++ b/tools/hciattach.c
@@ -286,7 +286,7 @@ static int ath3k_pm(int fd, struct uart_t *u, struct termios *ti)
@@ -274,7 +274,7 @@ static int ath3k_pm(int fd, struct uart_t *u, struct termios *ti)
static int qca(int fd, struct uart_t *u, struct termios *ti)
{
fprintf(stderr,"qca\n");
@ -31,10 +31,10 @@ index dda639cabca3..81d78ab3f69a 100644
static int qualcomm(int fd, struct uart_t *u, struct termios *ti)
diff --git a/tools/hciattach.h b/tools/hciattach.h
index 481e3a65f685..5f2764cca0b0 100644
index 96ff9e38cfda..4370a87ca3af 100644
--- a/tools/hciattach.h
+++ b/tools/hciattach.h
@@ -67,7 +67,7 @@ int ath3k_init(int fd, int speed, int init_speed, char *bdaddr,
@@ -53,7 +53,7 @@ int ath3k_init(int fd, int speed, int init_speed, char *bdaddr,
struct termios *ti);
int ath3k_post(int fd, int pm);
int qualcomm_init(int fd, int speed, struct termios *ti, const char *bdaddr);

View File

@ -1,6 +1,6 @@
From: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
Date: Mon, 8 Jan 2018 10:30:27 +0100
Subject: [PATCH 3/4] hciattach: If the user supplies a bdaddr, use it
Subject: [PATCH] hciattach: If the user supplies a bdaddr, use it
The QCA6564 has no non-volatile configuration file for the bluetooth
MAC, so use the one supplied on the command line.
@ -9,14 +9,14 @@ Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
Signed-off-by: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
---
tools/hciattach.c | 4 +--
tools/hciattach_rome.c | 76 ++++++++++----------------------------------------
tools/hciattach_rome.c | 76 +++++++++---------------------------------
2 files changed, 17 insertions(+), 63 deletions(-)
diff --git a/tools/hciattach.c b/tools/hciattach.c
index 81d78ab3f69a..022bbe5fa6d5 100644
index b94eb5ad1a5b..cdef3e206931 100644
--- a/tools/hciattach.c
+++ b/tools/hciattach.c
@@ -285,7 +285,7 @@ static int ath3k_pm(int fd, struct uart_t *u, struct termios *ti)
@@ -273,7 +273,7 @@ static int ath3k_pm(int fd, struct uart_t *u, struct termios *ti)
static int qca(int fd, struct uart_t *u, struct termios *ti)
{
@ -25,7 +25,7 @@ index 81d78ab3f69a..022bbe5fa6d5 100644
return qca_soc_init(fd, u->speed, u->bdaddr, ti);
}
@@ -1363,7 +1363,7 @@ int main(int argc, char *argv[])
@@ -1351,7 +1351,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Unknown device type or id\n");
exit(1);
}

View File

@ -1,6 +1,6 @@
From: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
Date: Mon, 8 Jan 2018 10:30:49 +0100
Subject: [PATCH 4/4] hciattach: Add verbosity option
Subject: [PATCH] hciattach: Add verbosity option
And reduce the verbosity of the hciattach_rome plugin.
@ -9,14 +9,14 @@ Signed-off-by: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
---
lib/bluetooth.h | 3 +
tools/hciattach.c | 13 ++-
tools/hciattach_rome.c | 244 ++++++++++++++++++++++++-------------------------
tools/hciattach_rome.c | 244 ++++++++++++++++++++---------------------
3 files changed, 132 insertions(+), 128 deletions(-)
diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index eb279260e009..38e3e6900744 100644
index 0fcf412c6c6b..b15702bdcb4c 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
@@ -136,6 +136,9 @@ enum {
@@ -171,6 +171,9 @@ enum {
BT_CLOSED
};
@ -27,10 +27,10 @@ index eb279260e009..38e3e6900744 100644
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define htobs(d) (d)
diff --git a/tools/hciattach.c b/tools/hciattach.c
index 022bbe5fa6d5..4aacdafeda7d 100644
index cdef3e206931..f5ee540c58f3 100644
--- a/tools/hciattach.c
+++ b/tools/hciattach.c
@@ -50,6 +50,8 @@
@@ -38,6 +38,8 @@
#include "hciattach.h"
@ -39,7 +39,7 @@ index 022bbe5fa6d5..4aacdafeda7d 100644
struct uart_t {
char *type;
int m_id;
@@ -125,8 +127,6 @@ int read_hci_event(int fd, unsigned char* buf, int size)
@@ -113,8 +115,6 @@ int read_hci_event(int fd, unsigned char* buf, int size)
fprintf(stderr, "%s: Timing out on select for 3 secs.\n", __FUNCTION__);
return -1;
}
@ -48,7 +48,7 @@ index 022bbe5fa6d5..4aacdafeda7d 100644
/* The first byte identifies the packet type. For HCI event packets, it
* should be 0x04, so we read until we get to the 0x04. */
@@ -285,7 +285,7 @@ static int ath3k_pm(int fd, struct uart_t *u, struct termios *ti)
@@ -273,7 +273,7 @@ static int ath3k_pm(int fd, struct uart_t *u, struct termios *ti)
static int qca(int fd, struct uart_t *u, struct termios *ti)
{
@ -57,7 +57,7 @@ index 022bbe5fa6d5..4aacdafeda7d 100644
return qca_soc_init(fd, u->speed, u->bdaddr, ti);
}
@@ -1258,7 +1258,7 @@ static void usage(void)
@@ -1246,7 +1246,7 @@ static void usage(void)
{
printf("hciattach - HCI UART driver initialization utility\n");
printf("Usage:\n");
@ -66,7 +66,7 @@ index 022bbe5fa6d5..4aacdafeda7d 100644
" <tty> <type | id> [speed] [flow|noflow]"
" [sleep|nosleep] [bdaddr]\n");
printf("\thciattach -l\n");
@@ -1281,7 +1281,7 @@ int main(int argc, char *argv[])
@@ -1269,7 +1269,7 @@ int main(int argc, char *argv[])
printpid = 0;
raw = 0;
@ -75,7 +75,7 @@ index 022bbe5fa6d5..4aacdafeda7d 100644
switch(opt) {
case 'b':
send_break = 1;
@@ -1319,6 +1319,9 @@ int main(int argc, char *argv[])
@@ -1307,6 +1307,9 @@ int main(int argc, char *argv[])
fprintf(stderr, "Line_disp val : %d\n", line_disp);
break;

View File

@ -3,18 +3,18 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:${THISDIR}/${BP}:"
SRC_URI += " \
file://bluetooth.service-add-customizations.patch \
file://main.conf \
file://0001-hcitool-do-not-show-unsupported-refresh-option.patch \
file://0002-hcitool-increase-the-shown-connection-limit-to-20.patch \
file://0003-port-test-discovery-to-python3.patch \
file://0001-bluetooth.service-add-Digi-customizations.patch \
file://0002-hcitool-do-not-show-unsupported-refresh-option.patch \
file://0003-hcitool-increase-the-shown-connection-limit-to-20.patch \
file://0004-port-test-discovery-to-python3.patch \
"
QCA65XX_COMMON_PATCHES = " \
file://0004-QCA_bluetooth_chip_support.patch \
file://0005-hciattach_rome-Respect-the-user-indication-for-noflo.patch \
file://0006-hciattach-If-the-user-supplies-a-bdaddr-use-it.patch \
file://0007-hciattach-Add-verbosity-option.patch \
file://0005-Add-hciattach-rome-support-for-Qualcomm-chip-QCA6564.patch \
file://0006-hciattach_rome-Respect-the-user-indication-for-noflo.patch \
file://0007-hciattach-If-the-user-supplies-a-bdaddr-use-it.patch \
file://0008-hciattach-Add-verbosity-option.patch \
"
SRC_URI:append:ccimx6ul = " ${QCA65XX_COMMON_PATCHES}"