Skip to content

Commit 40652f8

Browse files
stephen-hurdBjoern A. Zeeb
authored andcommitted
rc: bluetooth: startup improvements
During startup hccontrol reset needs to be run multiple times for iwbt to work more reliably. Add a loop trying up to three times. Tested by: various (original version; I changed test to -eq) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D44861
1 parent 9e8c1ab commit 40652f8

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

libexec/rc/rc.d/bluetooth

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,17 @@ bluetooth_setup_stack()
127127
> /dev/null 2>&1 || return 1
128128

129129
# Initilalize HCI node
130-
${hccontrol} -n ${dev}hci reset \
131-
> /dev/null 2>&1 || return 1
130+
for loop in 1 2 3
131+
do
132+
${hccontrol} -n ${dev}hci reset \
133+
> /dev/null 2>1 && break
134+
if [ ${loop} -eq 3 ]
135+
then
136+
warn Reset failed three times, giving up.
137+
return 1
138+
fi
139+
warn Reset failed, retrying.
140+
done
132141

133142
${hccontrol} -n ${dev}hci read_bd_addr \
134143
> /dev/null 2>&1 || return 1

0 commit comments

Comments
 (0)