2022-11-01 12:00:57

by Marek Vasut

[permalink] [raw]
Subject: [PATCH BlueZ] tools: Make hciattach_* firmware path build-time configurable

Make hciattach_qualcomm.c and hciattach_tialt.c behave the same way
as hciattach_bcm43xx.c does, where FIRMWARE_DIR can be overridden
at build time by using -DFIRMWARE_DIR= CFLAGS.

Signed-off-by: Marek Vasut <[email protected]>
---
tools/hciattach.h | 4 ++++
tools/hciattach_bcm43xx.c | 4 ----
tools/hciattach_qualcomm.c | 3 ++-
tools/hciattach_tialt.c | 3 ++-
4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/tools/hciattach.h b/tools/hciattach.h
index 26c0d5424..dfa4c1e7a 100644
--- a/tools/hciattach.h
+++ b/tools/hciattach.h
@@ -40,6 +40,10 @@
#define HCI_UART_EXT_CONFIG 4
#define HCI_UART_VND_DETECT 5

+#ifndef FIRMWARE_DIR
+#define FIRMWARE_DIR "/etc/firmware"
+#endif
+
int read_hci_event(int fd, unsigned char *buf, int size);
int set_speed(int fd, struct termios *ti, int speed);
int uart_speed(int speed);
diff --git a/tools/hciattach_bcm43xx.c b/tools/hciattach_bcm43xx.c
index dbb5a3fe3..b89fc1b50 100644
--- a/tools/hciattach_bcm43xx.c
+++ b/tools/hciattach_bcm43xx.c
@@ -30,10 +30,6 @@

#include "hciattach.h"

-#ifndef FIRMWARE_DIR
-#define FIRMWARE_DIR "/etc/firmware"
-#endif
-
#define FW_EXT ".hcd"

#define BCM43XX_CLOCK_48 1
diff --git a/tools/hciattach_qualcomm.c b/tools/hciattach_qualcomm.c
index 77b6db170..d228aeec0 100644
--- a/tools/hciattach_qualcomm.c
+++ b/tools/hciattach_qualcomm.c
@@ -222,7 +222,8 @@ int qualcomm_init(int fd, int speed, struct termios *ti, const char *bdaddr)

} while (resp[3] != 0 && resp[4] != 2);

- snprintf(fw, sizeof(fw), "/etc/firmware/%c%c%c%c%c%c_%c%c%c%c.bin",
+ snprintf(fw, sizeof(fw), "%s/%c%c%c%c%c%c_%c%c%c%c.bin",
+ FIRMWARE_DIR,
resp[18], resp[19], resp[20], resp[21],
resp[22], resp[23],
resp[32], resp[33], resp[34], resp[35]);
diff --git a/tools/hciattach_tialt.c b/tools/hciattach_tialt.c
index 4f7fd42a3..bf6e84923 100644
--- a/tools/hciattach_tialt.c
+++ b/tools/hciattach_tialt.c
@@ -221,7 +221,8 @@ int texasalt_init(int fd, int speed, struct termios *ti)
((brf_chip > 7) ? "unknown" : c_brf_chip[brf_chip]),
brf_chip);

- sprintf(fw, "/etc/firmware/%s.bin",
+ sprintf(fw, "%s/%s.bin",
+ FIRMWARE_DIR,
(brf_chip > 7) ? "unknown" : c_brf_chip[brf_chip]);
texas_load_firmware(fd, fw);

--
2.35.1



2022-11-01 13:40:44

by bluez.test.bot

[permalink] [raw]
Subject: RE: [BlueZ] tools: Make hciattach_* firmware path build-time configurable

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=690839

---Test result---

Test Summary:
CheckPatch PASS 1.01 seconds
GitLint PASS 0.86 seconds
Prep - Setup ELL PASS 26.44 seconds
Build - Prep PASS 0.68 seconds
Build - Configure PASS 8.16 seconds
Build - Make PASS 723.76 seconds
Make Check PASS 10.90 seconds
Make Check w/Valgrind PASS 287.82 seconds
Make Distcheck PASS 233.70 seconds
Build w/ext ELL - Configure PASS 8.17 seconds
Build w/ext ELL - Make PASS 83.94 seconds
Incremental Build w/ patches PASS 0.00 seconds
Scan Build WARNING 476.19 seconds

Details
##############################
Test: Scan Build - WARNING
Desc: Run Scan Build with patches
Output:
*****************************************************************************
The bugs reported by the scan-build may or may not be caused by your patches.
Please check the list and fix the bugs if they are caused by your patch.
*****************************************************************************
tools/hciattach_qualcomm.c:218:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
if ((n = read_hci_event(fd, resp, 100)) < 0) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/hciattach_qualcomm.c:253:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
if ((n = read_hci_event(fd, resp, 100)) < 0) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.




---
Regards,
Linux Bluetooth

2022-11-01 15:45:54

by Marek Vasut

[permalink] [raw]
Subject: Re: [BlueZ] tools: Make hciattach_* firmware path build-time configurable

On 11/1/22 14:37, [email protected] wrote:
> 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=690839
>
> ---Test result---
>
> Test Summary:
> CheckPatch PASS 1.01 seconds
> GitLint PASS 0.86 seconds
> Prep - Setup ELL PASS 26.44 seconds
> Build - Prep PASS 0.68 seconds
> Build - Configure PASS 8.16 seconds
> Build - Make PASS 723.76 seconds
> Make Check PASS 10.90 seconds
> Make Check w/Valgrind PASS 287.82 seconds
> Make Distcheck PASS 233.70 seconds
> Build w/ext ELL - Configure PASS 8.17 seconds
> Build w/ext ELL - Make PASS 83.94 seconds
> Incremental Build w/ patches PASS 0.00 seconds
> Scan Build WARNING 476.19 seconds
>
> Details
> ##############################
> Test: Scan Build - WARNING
> Desc: Run Scan Build with patches
> Output:
> *****************************************************************************
> The bugs reported by the scan-build may or may not be caused by your patches.
> Please check the list and fix the bugs if they are caused by your patch.
> *****************************************************************************
> tools/hciattach_qualcomm.c:218:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
> if ((n = read_hci_event(fd, resp, 100)) < 0) {
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> tools/hciattach_qualcomm.c:253:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
> if ((n = read_hci_event(fd, resp, 100)) < 0) {
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 2 warnings generated.

That's unlikely caused by this patch.

2022-11-01 19:33:03

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [BlueZ] tools: Make hciattach_* firmware path build-time configurable

Hi Marek,

On Tue, Nov 1, 2022 at 8:45 AM Marek Vasut <[email protected]> wrote:
>
> On 11/1/22 14:37, [email protected] wrote:
> > 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=690839
> >
> > ---Test result---
> >
> > Test Summary:
> > CheckPatch PASS 1.01 seconds
> > GitLint PASS 0.86 seconds
> > Prep - Setup ELL PASS 26.44 seconds
> > Build - Prep PASS 0.68 seconds
> > Build - Configure PASS 8.16 seconds
> > Build - Make PASS 723.76 seconds
> > Make Check PASS 10.90 seconds
> > Make Check w/Valgrind PASS 287.82 seconds
> > Make Distcheck PASS 233.70 seconds
> > Build w/ext ELL - Configure PASS 8.17 seconds
> > Build w/ext ELL - Make PASS 83.94 seconds
> > Incremental Build w/ patches PASS 0.00 seconds
> > Scan Build WARNING 476.19 seconds
> >
> > Details
> > ##############################
> > Test: Scan Build - WARNING
> > Desc: Run Scan Build with patches
> > Output:
> > *****************************************************************************
> > The bugs reported by the scan-build may or may not be caused by your patches.
> > Please check the list and fix the bugs if they are caused by your patch.
> > *****************************************************************************
> > tools/hciattach_qualcomm.c:218:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
> > if ((n = read_hci_event(fd, resp, 100)) < 0) {
> > ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > tools/hciattach_qualcomm.c:253:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
> > if ((n = read_hci_event(fd, resp, 100)) < 0) {
> > ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 2 warnings generated.
>
> That's unlikely caused by this patch.

Yep, the scan-build rebuilds the file you have changed so any problem
it finds in that file will be reported, anyway I can ignore the
warnings but patches to fix these warnings are welcome as well.

--
Luiz Augusto von Dentz

2022-11-01 20:33:50

by Marek Vasut

[permalink] [raw]
Subject: Re: [BlueZ] tools: Make hciattach_* firmware path build-time configurable

On 11/1/22 20:24, Luiz Augusto von Dentz wrote:
> Hi Marek,
>
> On Tue, Nov 1, 2022 at 8:45 AM Marek Vasut <[email protected]> wrote:
>>
>> On 11/1/22 14:37, [email protected] wrote:
>>> 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=690839
>>>
>>> ---Test result---
>>>
>>> Test Summary:
>>> CheckPatch PASS 1.01 seconds
>>> GitLint PASS 0.86 seconds
>>> Prep - Setup ELL PASS 26.44 seconds
>>> Build - Prep PASS 0.68 seconds
>>> Build - Configure PASS 8.16 seconds
>>> Build - Make PASS 723.76 seconds
>>> Make Check PASS 10.90 seconds
>>> Make Check w/Valgrind PASS 287.82 seconds
>>> Make Distcheck PASS 233.70 seconds
>>> Build w/ext ELL - Configure PASS 8.17 seconds
>>> Build w/ext ELL - Make PASS 83.94 seconds
>>> Incremental Build w/ patches PASS 0.00 seconds
>>> Scan Build WARNING 476.19 seconds
>>>
>>> Details
>>> ##############################
>>> Test: Scan Build - WARNING
>>> Desc: Run Scan Build with patches
>>> Output:
>>> *****************************************************************************
>>> The bugs reported by the scan-build may or may not be caused by your patches.
>>> Please check the list and fix the bugs if they are caused by your patch.
>>> *****************************************************************************
>>> tools/hciattach_qualcomm.c:218:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
>>> if ((n = read_hci_event(fd, resp, 100)) < 0) {
>>> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> tools/hciattach_qualcomm.c:253:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
>>> if ((n = read_hci_event(fd, resp, 100)) < 0) {
>>> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> 2 warnings generated.
>>
>> That's unlikely caused by this patch.
>
> Yep, the scan-build rebuilds the file you have changed so any problem
> it finds in that file will be reported, anyway I can ignore the
> warnings but patches to fix these warnings are welcome as well.

Done

2022-11-01 21:15:40

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH BlueZ] tools: Make hciattach_* firmware path build-time configurable

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <[email protected]>:

On Tue, 1 Nov 2022 12:53:33 +0100 you wrote:
> Make hciattach_qualcomm.c and hciattach_tialt.c behave the same way
> as hciattach_bcm43xx.c does, where FIRMWARE_DIR can be overridden
> at build time by using -DFIRMWARE_DIR= CFLAGS.
>
> Signed-off-by: Marek Vasut <[email protected]>
> ---
> tools/hciattach.h | 4 ++++
> tools/hciattach_bcm43xx.c | 4 ----
> tools/hciattach_qualcomm.c | 3 ++-
> tools/hciattach_tialt.c | 3 ++-
> 4 files changed, 8 insertions(+), 6 deletions(-)

Here is the summary with links:
- [BlueZ] tools: Make hciattach_* firmware path build-time configurable
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=d9253248363b

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html