xref: /freebsd/libexec/rc/rc.d/ubthidhci (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1#!/bin/sh
2#
3#
4
5# PROVIDE: ubthidhci
6# REQUIRE: DAEMON
7# BEFORE: bluetooth
8# KEYWORD: nojail shutdown
9
10. /etc/rc.subr
11
12name="ubthidhci"
13rcvar="ubthidhci_enable"
14command="/usr/sbin/usbconfig"
15start_precmd="ubthidhci_prestart"
16
17ubthidhci_prestart()
18{
19
20	if [ -z ${ubthidhci_busnum} ]; then
21		warn ubthidhci_busnum is not set
22		return 1
23	fi
24	if [ -z ${ubthidhci_addr} ]; then
25		warn ubthidhci_addr is not set
26		return 1
27	fi
28}
29
30load_rc_config $name
31#
32# We discard the output because:
33# 1) we don't want it to show up during boot; and
34# 2) the request usually returns an error, but that doesn't mean it failed
35#
36# NB: 0x40 is UT_VENDOR
37command_args="-u ${ubthidhci_busnum} -a ${ubthidhci_addr} do_request 0x40 0 0 0 0 > /dev/null 2>&1"
38
39run_rc_command "$1"
40